CollisionAudioEvent

February 7, 2023 ยท View on GitHub

from tdw.physics_audio.collision_audio_event import CollisionAudioEvent

This class is used only in PyImpact, which has been deprecated. See: Clatter.

Data for a collision audio event. Includes collision data as well as the "primary" and "secondary" objects and the type of audio event.


Class Variables

VariableTypeDescriptionValue
ROLL_ANGULAR_VELOCITYfloatIf the angular velocity is this or greater, the event is a roll, not a scrape.0.5
IMPACT_AREA_RATIOfloatIf the area of the collision increases by at least this factor during a stay event, the collision is actually an impact.5
IMPACT_AREA_NEW_COLLISIONfloatOn a stay event, if the previous area is None and the current area is greater than this, the collision is actually an impact.1e-5

Fields

  • collision The collision data.

  • area The area of the collision contact points.

  • collision_type The collision audio event type.

  • primary_id The ID of the primary object.

  • secondary_id The ID of the secondary object. If this is an environment collision, the value of this field is None.

  • magnitude A value to mark the overall "significance" of the collision event.

  • velocity The velocity vector.


Functions

__init__

CollisionAudioEvent(collision, object_0_static, object_0_dynamic, previous_areas)

CollisionAudioEvent(collision, object_0_static, object_0_dynamic, previous_areas, object_1_static=None, object_1_dynamic=None)

ParameterTypeDefaultDescription
collisionCollisionBaseThe collision data.
object_0_staticObjectAudioStaticStatic data for the first object.
object_0_dynamicRigidbodyDynamic data for the first object.
previous_areasDict[int, float]Areas of collisions from the previous frame.
object_1_staticObjectAudioStaticNoneStatic data for the second object. If this is an environment collision, the value of this parameter should be None.
object_1_dynamicRigidbodyNoneDynamic data for the second object. If this is an environment collision, the value of this parameter should be None.