Box2D  3.0.0
A Real-Time-Oriented 2-D Physics Engine
Classes | Public Types | Public Member Functions | List of all members
box2d::WorldManifold Class Reference

World Manifold. More...

#include <WorldManifold.hpp>

Classes

struct  PointSeparation
 

Public Types

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

Public Member Functions

 WorldManifold () noexcept=default
 Default constructor. More...
 
constexpr WorldManifold (UnitVec2 normal) noexcept
 
constexpr WorldManifold (UnitVec2 normal, PointSeparation ps0) noexcept
 
constexpr WorldManifold (UnitVec2 normal, PointSeparation ps0, PointSeparation ps1) noexcept
 
size_type GetPointCount () const noexcept
 Gets the point count. More...
 
UnitVec2 GetNormal () const noexcept
 Gets the normal of the contact. More...
 
Length2D GetPoint (size_type index) const noexcept
 Gets the indexed point's location in world coordinates. More...
 
Length GetSeparation (size_type index) const noexcept
 Gets the amount of separation at the given indexed point. More...
 

Detailed Description

World Manifold.

This is used to recoginze the current state of a contact manifold in world coordinates.

Note
This data structure is 36-bytes large (on at least one 64-bit platform).

Member Typedef Documentation

◆ size_type

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

Constructor & Destructor Documentation

◆ WorldManifold() [1/4]

box2d::WorldManifold::WorldManifold ( )
defaultnoexcept

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 box2d::WorldManifold::WorldManifold ( UnitVec2  normal)
inlineexplicitnoexcept

◆ WorldManifold() [3/4]

constexpr box2d::WorldManifold::WorldManifold ( UnitVec2  normal,
PointSeparation  ps0 
)
inlineexplicitnoexcept

◆ WorldManifold() [4/4]

constexpr box2d::WorldManifold::WorldManifold ( UnitVec2  normal,
PointSeparation  ps0,
PointSeparation  ps1 
)
inlineexplicitnoexcept

Member Function Documentation

◆ GetNormal()

UnitVec2 box2d::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()

Length2D box2d::WorldManifold::GetPoint ( size_type  index) const
inlinenoexcept

Gets the indexed point's location in world coordinates.

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

◆ GetPointCount()

size_type box2d::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.

◆ GetSeparation()

Length box2d::WorldManifold::GetSeparation ( size_type  index) const
inlinenoexcept

Gets the amount of separation at the given indexed point.

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

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