PlayRho  2.0.0
An interactive physics engine & library.
playrho::d2::WorldManifold Class Reference

Essentially a Manifold expressed in world coordinate terms. More...

#include <playrho/d2/WorldManifold.hpp>

Classes

struct  PointData
 Point data for world manifold. More...
 

Public Types

using size_type = std::remove_const_t< decltype(MaxManifoldPoints)>
 Size type.
 

Public Member Functions

 WorldManifold ()=default
 
constexpr WorldManifold (const UnitVec &normal) noexcept
 Initializing constructor. More...
 
constexpr WorldManifold (const UnitVec &normal, const PointData &ps0) noexcept
 Initializing constructor. More...
 
constexpr WorldManifold (const UnitVec &normal, const PointData &ps0, const PointData &ps1) noexcept
 Initializing constructor. More...
 
Momentum2 GetImpulses (size_type index) const noexcept
 Gets the given index contact impulses. More...
 
UnitVec GetNormal () const noexcept
 
Length2 GetPoint (size_type index) const noexcept
 Gets the indexed point's location in world coordinates. More...
 
size_type GetPointCount () const noexcept
 Gets the point count. More...
 
Length GetSeparation (size_type index) const noexcept
 Gets the amount of separation at the given indexed point. More...
 

Detailed Description

Essentially a Manifold expressed in world coordinate terms.

Used to recognize the current state of a contact manifold in world coordinates.

See also
GetWorldManifold

Constructor & Destructor Documentation

◆ WorldManifold() [1/4]

playrho::d2::WorldManifold::WorldManifold ( )
default

Default constructor.

A default constructed world manifold will gave a point count of zero, an invalid normal, invalid points, and invalid separations.

◆ WorldManifold() [2/4]

constexpr playrho::d2::WorldManifold::WorldManifold ( const UnitVec normal)
inlineexplicitconstexprnoexcept

Initializing constructor.

Precondition
IsValid(normal) is true.

◆ WorldManifold() [3/4]

constexpr playrho::d2::WorldManifold::WorldManifold ( const UnitVec normal,
const PointData ps0 
)
inlineexplicitconstexprnoexcept

Initializing constructor.

Precondition
IsValid(normal) is true.

◆ WorldManifold() [4/4]

constexpr playrho::d2::WorldManifold::WorldManifold ( const UnitVec normal,
const PointData ps0,
const PointData ps1 
)
inlineexplicitconstexprnoexcept

Initializing constructor.

Precondition
IsValid(normal) is true.

Member Function Documentation

◆ GetImpulses()

Momentum2 playrho::d2::WorldManifold::GetImpulses ( size_type  index) const
inlinenoexcept

Gets the given index contact impulses.

Precondition
index is less than MaxManifoldPoints.
Returns
"Normal impulse" and "tangent impulse" pair.

Referenced by playrho::d2::VelocityConstraint::VelocityConstraint().

◆ GetNormal()

UnitVec playrho::d2::WorldManifold::GetNormal ( ) const
inlinenoexcept

Gets the normal of the contact.

This is a directional unit-vector.

Returns
Normal of the contact or an invalid value.

◆ GetPoint()

Length2 playrho::d2::WorldManifold::GetPoint ( size_type  index) const
inlinenoexcept

Gets the indexed point's location in world coordinates.

Parameters
indexIndex to return point for. This must be between 0 and GetPointCount() to get a valid point from this function.
Precondition
index is less than MaxManifoldPoints.
Returns
Point or an invalid value if the given index was invalid.

Referenced by playrho::d2::VelocityConstraint::VelocityConstraint().

◆ GetPointCount()

size_type playrho::d2::WorldManifold::GetPointCount ( ) const
inlinenoexcept

Gets the point count.

This is the maximum index value that can be used to access valid point or separation information.

Returns
Value between 0 and 2.

Referenced by playrho::d2::VelocityConstraint::VelocityConstraint().

◆ GetSeparation()

Length playrho::d2::WorldManifold::GetSeparation ( size_type  index) const
inlinenoexcept

Gets the amount of separation at the given indexed point.

Parameters
indexIndex to return separation for. This must be between 0 and GetPointCount().
Precondition
index is less than MaxManifoldPoints.
Returns
Separation amount (a negative value), or an invalid value if the given index was invalid.

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