The per-contact velocity constraint data structure. More...
#include <playrho/d2/VelocityConstraint.hpp>
Classes | |
struct | Conf |
Configuration data for velocity constraints. More... | |
struct | Point |
Velocity constraint point. More... | |
Public Types | |
using | size_type = std::remove_const_t< decltype(MaxManifoldPoints)> |
Size type. | |
Public Member Functions | |
VelocityConstraint ()=default | |
Default constructor. More... | |
VelocityConstraint (const VelocityConstraint ©)=default | |
Copy constructor. | |
VelocityConstraint (Real friction, Real restitution, LinearVelocity tangentSpeed, const WorldManifold &worldManifold, BodyID bA, BodyID bB, const Span< const BodyConstraint > &bodies, const Conf &conf=GetDefaultConf()) | |
Initializing constructor. | |
BodyID | GetBodyA () const noexcept |
Gets identifier of body A. | |
BodyID | GetBodyB () const noexcept |
Gets identifier of body B. | |
Real | GetFriction () const noexcept |
Gets the combined friction of the associated contact. | |
InvMass22 | GetK () const noexcept |
UnitVec | GetNormal () const noexcept |
Momentum | GetNormalImpulseAtPoint (size_type index) const noexcept |
Mass22 | GetNormalMass () const noexcept |
Mass | GetNormalMassAtPoint (size_type index) const noexcept |
const Point & | GetPointAt (size_type index) const |
Accesses the point identified by the given index. More... | |
size_type | GetPointCount () const noexcept |
Length2 | GetPointRelPosA (size_type index) const noexcept |
Length2 | GetPointRelPosB (size_type index) const noexcept |
Real | GetRestitution () const noexcept |
Gets the combined restitution of the associated contact. | |
UnitVec | GetTangent () const noexcept |
Gets the tangent. | |
Momentum | GetTangentImpulseAtPoint (size_type index) const noexcept |
Mass | GetTangentMassAtPoint (size_type index) const noexcept |
LinearVelocity | GetTangentSpeed () const noexcept |
Gets the tangent speed of the associated contact. | |
LinearVelocity | GetVelocityBiasAtPoint (size_type index) const noexcept |
VelocityConstraint & | operator= (const VelocityConstraint ©)=default |
Assignment operator. | |
void | SetNormalImpulseAtPoint (size_type index, Momentum value) |
Sets the normal impulse at the given point. | |
void | SetTangentImpulseAtPoint (size_type index, Momentum value) |
Sets the tangent impulse at the given point. | |
Static Public Member Functions | |
static constexpr Conf | GetDefaultConf () noexcept |
Gets the default configuration for a VelocityConstraint . | |
The per-contact velocity constraint data structure.
|
default |
Default constructor.
GetNormal()
and GetTangent()
return a default constructed UnitVec
. GetPointCount()
, GetFriction()
, GetRestitution()
, GetTangentSpeed()
, GetK()
, GetNormalMass()
all return zero.
|
inlinenoexcept |
Gets the "K" value.
|
inlinenoexcept |
Gets the normal of the contact in world coordinates.
|
inlinenoexcept |
Gets the normal impulse at the given point.
AddPoint
or SetNormalImpulseAtPoint
function to set this value. Referenced by playrho::d2::GetNormalImpulseAtPoint().
|
inlinenoexcept |
Gets the normal mass.
|
inlinenoexcept |
Gets the normal mass at the given point.
AddPoint
function sets this value. Referenced by playrho::d2::GetNormalMassAtPoint().
Accesses the point identified by the given index.
index | Index of the point to return. This should be a value less than returned by GetPointCount . |
index
is less than MaxManifoldPoints
.
|
inlinenoexcept |
Gets the count of points added to this object.
MaxManifoldPoints
. Referenced by playrho::d2::GetContactImpulses().
|
inlinenoexcept |
Gets the point relative position of A.
AddPoint
function sets this value. Referenced by playrho::d2::GetPointRelPosA().
|
inlinenoexcept |
Gets the point relative position of B.
AddPoint
function sets this value. Referenced by playrho::d2::GetPointRelPosB().
|
inlinenoexcept |
Gets the tangent impulse at the given point.
AddPoint
or SetTangentImpulseAtPoint
function to set this value. Referenced by playrho::d2::GetTangentImpulseAtPoint().
|
inlinenoexcept |
Gets the tangent mass at the given point.
AddPoint
function sets this value. Referenced by playrho::d2::GetTangentMassAtPoint().
|
inlinenoexcept |
Gets the velocity bias at the given point.
AddPoint
function sets this value. Referenced by playrho::d2::GetVelocityBiasAtPoint().