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

Separation finder. More...

#include <SeparationFinder.hpp>

Classes

struct  Data
 Separation finder data. More...
 

Public Types

enum  Type { e_points, e_faceA, e_faceB }
 Separation finder type. More...
 

Public Member Functions

Data FindMinSeparation (const Transformation &xfA, const Transformation &xfB) const
 Finds the minimum separation. More...
 
Length Evaluate (IndexPair indexPair, const Transformation &xfA, const Transformation &xfB) const
 Evaluates the separation of the identified proxy vertices at the given time factor. More...
 
BOX2D_CONSTEXPR Type GetType () const noexcept
 
BOX2D_CONSTEXPR UnitVec2 GetAxis () const noexcept
 
BOX2D_CONSTEXPR Length2D GetLocalPoint () const noexcept
 

Static Public Member Functions

static SeparationFinder Get (Span< const IndexPair > indices, const DistanceProxy &proxyA, const Transformation &xfA, const DistanceProxy &proxyB, const Transformation &xfB)
 Gets a separation finder for the given inputs. More...
 

Detailed Description

Separation finder.

Member Enumeration Documentation

◆ Type

Separation finder type.

Enumerator
e_points 
e_faceA 
e_faceB 

Member Function Documentation

◆ Evaluate()

Length box2d::SeparationFinder::Evaluate ( IndexPair  indexPair,
const Transformation xfA,
const Transformation xfB 
) const
inline

Evaluates the separation of the identified proxy vertices at the given time factor.

Parameters
indexPairIndexes of the proxy A and proxy B vertexes.
xfATransformation A.
xfBTransformation B.
Returns
Separation distance which will be negative when the given transforms put the vertices on the opposite sides of the separating axis.

◆ FindMinSeparation()

Data box2d::SeparationFinder::FindMinSeparation ( const Transformation xfA,
const Transformation xfB 
) const
inline

Finds the minimum separation.

Returns
indexes of proxy A's and proxy B's vertices that have the minimum distance between them and what that distance is.

◆ Get()

SeparationFinder SeparationFinder::Get ( Span< const IndexPair indices,
const DistanceProxy proxyA,
const Transformation xfA,
const DistanceProxy proxyB,
const Transformation xfB 
)
static

Gets a separation finder for the given inputs.

Warning
Behavior is undefined if given less than one index pair or more than three.
Parameters
indicesCollection of 1 to 3 index pairs. A points-type finder will be returned if given 1 index pair. A face-type finder will be returned otherwise.
proxyAProxy A.
xfATransformation A.
proxyBProxy B.
xfBTransformation B.

◆ GetAxis()

BOX2D_CONSTEXPR UnitVec2 box2d::SeparationFinder::GetAxis ( ) const
inlinenoexcept

◆ GetLocalPoint()

BOX2D_CONSTEXPR Length2D box2d::SeparationFinder::GetLocalPoint ( ) const
inlinenoexcept

◆ GetType()

BOX2D_CONSTEXPR SeparationFinder::Type box2d::SeparationFinder::GetType ( ) const
inlinenoexcept

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