Avara3D 0.2.0
C++ API reference
a3d::PhysicsContact Class Reference

Describes a contact between two physics bodies. More...

#include <a3d/physics/PhysicsContact.h>

Public Member Functions

std::weak_ptr< NodenodeA () const
 Returns the first contact node as a weak reference. More...
 
std::weak_ptr< NodenodeB () const
 Returns the second contact node as a weak reference. More...
 
const math::vec3contactPoint () const
 Returns the world-space midpoint between the two body contact points. More...
 
const math::vec3contactNormal () 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...
 

Detailed Description

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.

Member Function Documentation

◆ collisionImpulse()

float a3d::PhysicsContact::collisionImpulse ( ) const

Returns the collision impulse associated with the represented contact point.

◆ contactNormal()

const math::vec3 & a3d::PhysicsContact::contactNormal ( ) const

Returns the world-space contact normal pointing from nodeB() toward nodeA().

◆ contactPoint()

const math::vec3 & a3d::PhysicsContact::contactPoint ( ) const

Returns the world-space midpoint between the two body contact points.

◆ nodeA()

std::weak_ptr< Node > a3d::PhysicsContact::nodeA ( ) const

Returns the first contact node as a weak reference.

◆ nodeB()

std::weak_ptr< Node > a3d::PhysicsContact::nodeB ( ) const

Returns the second contact node as a weak reference.

◆ penetrationDistance()

float a3d::PhysicsContact::penetrationDistance ( ) const

Returns the penetration depth, where zero indicates no penetration and positive values indicate overlap.

◆ sweepTestFraction()

float a3d::PhysicsContact::sweepTestFraction ( ) const

Returns the sweep-test fraction associated with this contact; ordinary contact results use zero.


The documentation for this class was generated from the following file: