|
Avara3D 0.2.0
C++ API reference
|
Describes a contact between two physics bodies. More...
#include <a3d/physics/PhysicsContact.h>
Public Member Functions | |
| std::weak_ptr< Node > | nodeA () const |
| Returns the first contact node as a weak reference. More... | |
| std::weak_ptr< Node > | nodeB () const |
| Returns the second contact node as a weak reference. More... | |
| const math::vec3 & | contactPoint () const |
| Returns the world-space midpoint between the two body contact points. More... | |
| const math::vec3 & | contactNormal () const |
| Returns the world-space contact normal pointing from nodeB() toward nodeA(). More... | |
| float | collisionImpulse () const |
| Returns the collision impulse associated with the represented contact point. More... | |
| float | penetrationDistance () const |
| Returns the penetration depth, where zero indicates no penetration and positive values indicate overlap. More... | |
| float | sweepTestFraction () const |
| Returns the sweep-test fraction associated with this contact; ordinary contact results use zero. More... | |
Describes a contact between two physics bodies.
The participating nodes are retained weakly. When a body pair has multiple underlying contact points, PhysicsContact represents the point with the greatest collision impulse, using deepest penetration as a tie-breaker. Contact persistence may keep a logical contact active across very small separations used to maintain stable simulation contact.
Definition at line 29 of file PhysicsContact.h.
| float a3d::PhysicsContact::collisionImpulse | ( | ) | const |
Returns the collision impulse associated with the represented contact point.
| const math::vec3 & a3d::PhysicsContact::contactNormal | ( | ) | const |
| const math::vec3 & a3d::PhysicsContact::contactPoint | ( | ) | const |
Returns the world-space midpoint between the two body contact points.
| std::weak_ptr< Node > a3d::PhysicsContact::nodeA | ( | ) | const |
Returns the first contact node as a weak reference.
| std::weak_ptr< Node > a3d::PhysicsContact::nodeB | ( | ) | const |
Returns the second contact node as a weak reference.
| float a3d::PhysicsContact::penetrationDistance | ( | ) | const |
Returns the penetration depth, where zero indicates no penetration and positive values indicate overlap.
| float a3d::PhysicsContact::sweepTestFraction | ( | ) | const |
Returns the sweep-test fraction associated with this contact; ordinary contact results use zero.