playrho::d2::WorldManifold Class Reference

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

#include <WorldManifold.hpp>

Classes

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

Public Types

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

Public Member Functions

 WorldManifold ()=default
 
PLAYRHO_CONSTEXPR WorldManifold (UnitVec normal) noexcept
 Initializing constructor. More...
 
PLAYRHO_CONSTEXPR WorldManifold (UnitVec normal, PointData ps0) noexcept
 Initializing constructor. More...
 
PLAYRHO_CONSTEXPR WorldManifold (UnitVec normal, PointData ps0, PointData ps1) noexcept
 Initializing constructor. More...
 
size_type GetPointCount () const noexcept
 Gets the point count. More...
 
UnitVec GetNormal () const noexcept
 
Length2 GetPoint (size_type index) const noexcept
 
Length GetSeparation (size_type index) const noexcept
 
Momentum2 GetImpulses (size_type index) const noexcept
 Gets the given index contact impulses. More...
 

Detailed Description

Essentially a Manifold expressed in world coordinate terms.

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

Note
This data structure is 48-bytes large (on at least one 64-bit platform).
See also
GetWorldManifold

Definition at line 39 of file WorldManifold.hpp.

Member Typedef Documentation

◆ size_type

using playrho::d2::WorldManifold::size_type = std::remove_const<decltype(MaxManifoldPoints)>::type

Size type.

Definition at line 60 of file WorldManifold.hpp.

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]

PLAYRHO_CONSTEXPR playrho::d2::WorldManifold::WorldManifold ( UnitVec  normal)
inlineexplicitnoexcept

Initializing constructor.

Definition at line 78 of file WorldManifold.hpp.

◆ WorldManifold() [3/4]

PLAYRHO_CONSTEXPR playrho::d2::WorldManifold::WorldManifold ( UnitVec  normal,
PointData  ps0 
)
inlineexplicitnoexcept

Initializing constructor.

Definition at line 86 of file WorldManifold.hpp.

◆ WorldManifold() [4/4]

PLAYRHO_CONSTEXPR playrho::d2::WorldManifold::WorldManifold ( UnitVec  normal,
PointData  ps0,
PointData  ps1 
)
inlineexplicitnoexcept

Initializing constructor.

Definition at line 97 of file WorldManifold.hpp.

Member Function Documentation

◆ 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.

Definition at line 114 of file WorldManifold.hpp.

◆ 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.

Definition at line 122 of file WorldManifold.hpp.

◆ GetPoint()

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

Gets the indexed point's location in world coordinates.

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

Definition at line 134 of file WorldManifold.hpp.

◆ GetSeparation()

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

Gets the amount of separation at the given indexed point.

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

Definition at line 150 of file WorldManifold.hpp.

◆ GetImpulses()

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

Gets the given index contact impulses.

Returns
"Normal impulse" and "tangent impulse" pair.

Definition at line 158 of file WorldManifold.hpp.


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