GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::physics::ContactPoint< N > Struct Template Reference

Contact point between two potentially colliding objects in a Simulation. More...

#include <GREM/physics/collision.hpp>

Public Member Functions

OrthonormalBasis< N > getTangentSpaceBasis (Direction< N > normal) const
 Get the tangent-space basis of this contact point given the manifold normal.

Public Attributes

Pair< Length< N > > offsets
 Ordered pair of offsets from the objects' centers of mass to their respective surfaces where the contact point is located in world space at the start of the last simulation step.
Pair< Length< N > > localOffsets
 Ordered pair of offsets from the objects' centers of mass to their respective surfaces where the contact point is located in shape-local space at the time of impact.
Scale< N > tangent {}
 Unit vector in the separating plane of the collision, pointing in the direction of the objects' relative velocity at the contact point at the time of impact, projected onto the separating plane, in world space.
LinearVelocity< N > relativeVelocityInTangentSpace {}
 Relative velocity of the contact points along the tangent, bitangent and normal (TBN) directions at the start of the last simulation step (or along the tangent and normal directions in 2D).
LinearMomentum< N > momentumInTangentSpace {}
 Total correction momentum of this contact point along the tangent, bitangent and normal (TBN) directions (or along the tangent and normal directions in 2D).
LinearImpulse< N > impulseInTangentSpace {}
 Total correction impulse applied to this contact point along the tangent, bitangent and normal (TBN) directions in the last simulation step (or along the tangent and normal directions in 2D).
LinearMomentum1D restitutionMomentum {}
 Total restitution momentum of this contact point along the normal direction.
LinearImpulse1D restitutionImpulse {}
 Total restitution impulse applied to this contact point along the normal direction in the last simulation step.

Detailed Description

template<size_t N>
struct grem::physics::ContactPoint< N >

Contact point between two potentially colliding objects in a Simulation.

Template Parameters
Nnumber of dimensions of the world space (must be 2 or 3).

Member Function Documentation

◆ getTangentSpaceBasis()

template<size_t N>
OrthonormalBasis< N > grem::physics::ContactPoint< N >::getTangentSpaceBasis ( Direction< N > normal) const
inlinenodiscard

Get the tangent-space basis of this contact point given the manifold normal.

Parameters
normalworld-space normal of the contact manifold that contains this point.
Returns
the tangent-space basis in world space as a TBN matrix (tangent, bitangent, normal) in 3D or a TN matrix (tangent, normal) in 2D.

Member Data Documentation

◆ offsets

template<size_t N>
Pair<Length<N> > grem::physics::ContactPoint< N >::offsets

Ordered pair of offsets from the objects' centers of mass to their respective surfaces where the contact point is located in world space at the start of the last simulation step.

◆ localOffsets

template<size_t N>
Pair<Length<N> > grem::physics::ContactPoint< N >::localOffsets

Ordered pair of offsets from the objects' centers of mass to their respective surfaces where the contact point is located in shape-local space at the time of impact.

◆ tangent

template<size_t N>
Scale<N> grem::physics::ContactPoint< N >::tangent {}

Unit vector in the separating plane of the collision, pointing in the direction of the objects' relative velocity at the contact point at the time of impact, projected onto the separating plane, in world space.

Note
If collision detection was performed outside of a simulation step, the tangent will be zero.

◆ relativeVelocityInTangentSpace

template<size_t N>
LinearVelocity<N> grem::physics::ContactPoint< N >::relativeVelocityInTangentSpace {}

Relative velocity of the contact points along the tangent, bitangent and normal (TBN) directions at the start of the last simulation step (or along the tangent and normal directions in 2D).

Note
If the contact was inactive in the last simulation step, this value will not be up-to-date.

◆ momentumInTangentSpace

template<size_t N>
LinearMomentum<N> grem::physics::ContactPoint< N >::momentumInTangentSpace {}

Total correction momentum of this contact point along the tangent, bitangent and normal (TBN) directions (or along the tangent and normal directions in 2D).

Note
If the contact was inactive in the last simulation step, this value will not be up-to-date.

◆ impulseInTangentSpace

template<size_t N>
LinearImpulse<N> grem::physics::ContactPoint< N >::impulseInTangentSpace {}

Total correction impulse applied to this contact point along the tangent, bitangent and normal (TBN) directions in the last simulation step (or along the tangent and normal directions in 2D).

Note
If the contact was inactive in the last simulation step, this value will not be up-to-date.

◆ restitutionMomentum

template<size_t N>
LinearMomentum1D grem::physics::ContactPoint< N >::restitutionMomentum {}

Total restitution momentum of this contact point along the normal direction.

Note
If the contact was inactive in the last simulation step, this value will not be up-to-date.

◆ restitutionImpulse

template<size_t N>
LinearImpulse1D grem::physics::ContactPoint< N >::restitutionImpulse {}

Total restitution impulse applied to this contact point along the normal direction in the last simulation step.

Note
If the contact was inactive in the last simulation step, this value will not be up-to-date.

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