Contact

struct nvContactEvent

Contact event information.

Public Members

nvRigidBody *body_a

Body A.

nvRigidBody *body_b

Body B.

nvShape *shape_a

Shape A.

nvShape *shape_b

Shape B.

nvVector2 normal

Collision normal.

nv_float penetration

Contact point penetration depth.

nvVector2 position

Contact point position in world space.

nvVector2 normal_impulse

Impulse applied for non-penetration.

nvVector2 friction_impulse

Impulse applied for friction.

nv_uint64 id

Contact feature ID.

struct nvContactListener

Contact event listener.

Public Members

nvContactListenerCallback on_contact_added

This function is called the first frame where a contact point is detected. Since it’s not solved yet, impulse information is zeros.

nvContactListenerCallback on_contact_persisted

This function is called every frame when a contact point persist across frames.

nvContactListenerCallback on_contact_removed

This function is called the first frame when a contact point no longer exists.