Tracing Structures

Summary
Tracing Structures
EventBodyDataStructure that holds event data of a given object.
Variables
linearVelocity
angularVelocity
position
orientation
gameObject
ContactDataStructure holding basic contact information between two objects.
Variables
closingVelocity
impulse
distance
normal
position
ContactEventDataContact Event data between 2 bodies and their shared contact.
Variables
bodyA
bodyB
contact
TriggerEventDataTrigger Event data between 2 bodies.
Variables
bodyA
bodyB

EventBodyData

Structure that holds event data of a given object.

Variables

linearVelocity

vec3The body’s linear velocity vector.

angularVelocity

vec3The body’s angular velocity vector (Controllers will never have an angular velocity)

position

vec3The body’s position in world space.

orientation

quatThe body’s orientation in world space.  (Controllers use an identity quaternion)

gameObject

struct EventBodyData { EventBodyData() { linearVelocity = glm::highp_vec3(0.0f); angularVelocity = glm::highp_vec3(0.0f); position = glm::highp_vec3(0.0f); orientation = glm::quat(); gameObject = nullptr; } glm::highp_vec3 linearVelocity; glm::highp_vec3 angularVelocity; glm::highp_vec3 position; glm::quat orientation; GameObject* gameObject; }
GameObjectThe associated GameObject.

ContactData

Structure holding basic contact information between two objects.

Variables

closingVelocity

numberThe Scalar value of the closing velocity vector.

impulse

numberThe preventative interpenetration impulse being applied.

distance

numberThe distance between the two bodies.

normal

vec3The striking normal from BodyA to BodyB.

position

struct ContactData { ContactData() { closingVelocity = 0.0f; impulse = 0.0f; distance = 0.0f; normal = glm::highp_vec3(0.0f); position = glm::highp_vec3(0.0f); valid = true; } void Flip() { normal *= -1.0f; } float closingVelocity; float impulse; float distance; glm::highp_vec3 normal; glm::highp_vec3 position; bool valid; }
vec3The position of contact in world space.

ContactEventData

Contact Event data between 2 bodies and their shared contact.

Variables

bodyA

EventBodyDataBodyA’s data during this event callback.

bodyB

EventBodyDataBodyB’s data during this event callback.

contact

struct ContactEventData { ContactEventData() { } EventBodyData bodyA; EventBodyData bodyB; ContactData contact; void Flip() { EventBodyData t = bodyA; bodyA = bodyB; bodyB = t; } }
ContactDataThe contact point between BodyA and BodyB.

TriggerEventData

Trigger Event data between 2 bodies.

Variables

bodyA

EventBodyDataBodyA of the trigger (The trigger)

bodyB

struct TriggerEventData { TriggerEventData() { } EventBodyData bodyA; EventBodyData bodyB; ContactData contact; GameObject* m_rootObject; GameObject* m_leafObject; GameObject* m_hitRootObject; GameObject* m_hitLeafObject; void Flip() { EventBodyData t = bodyA; bodyA = bodyB; bodyB = t; contact.Flip(); } }
EventBodyDataBodyB of the trigger event (The triggering body)
struct EventBodyData { EventBodyData() { linearVelocity = glm::highp_vec3(0.0f); angularVelocity = glm::highp_vec3(0.0f); position = glm::highp_vec3(0.0f); orientation = glm::quat(); gameObject = nullptr; } glm::highp_vec3 linearVelocity; glm::highp_vec3 angularVelocity; glm::highp_vec3 position; glm::quat orientation; GameObject* gameObject; }
struct ContactData { ContactData() { closingVelocity = 0.0f; impulse = 0.0f; distance = 0.0f; normal = glm::highp_vec3(0.0f); position = glm::highp_vec3(0.0f); valid = true; } void Flip() { normal *= -1.0f; } float closingVelocity; float impulse; float distance; glm::highp_vec3 normal; glm::highp_vec3 position; bool valid; }
struct ContactEventData { ContactEventData() { } EventBodyData bodyA; EventBodyData bodyB; ContactData contact; void Flip() { EventBodyData t = bodyA; bodyA = bodyB; bodyB = t; } }
struct TriggerEventData { TriggerEventData() { } EventBodyData bodyA; EventBodyData bodyB; ContactData contact; GameObject* m_rootObject; GameObject* m_leafObject; GameObject* m_hitRootObject; GameObject* m_hitLeafObject; void Flip() { EventBodyData t = bodyA; bodyA = bodyB; bodyB = t; contact.Flip(); } }
Close