A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
Field::ObjectCollisionBase Class Referenceabstract

#include <ObjectCollisionBase.hh>

Description

The base class that all objects' collision inherits from.

Implementation is done via the GJK distance algorithm. https://en.wikipedia.org/wiki/Gilbert-Johnson-Keerthi_distance_algorithm

Definition at line 24 of file ObjectCollisionBase.hh.

Inheritance diagram for Field::ObjectCollisionBase:

Public Member Functions

virtual void transform (const EGG::Matrix34f &mat, const EGG::Vector3f &scale, const EGG::Vector3f &speed)=0
 
virtual const EGG::Vector3fgetSupport (const EGG::Vector3f &v) const =0
 
virtual f32 getBoundingRadius () const =0
 
bool check (ObjectCollisionBase &rhs, EGG::Vector3f &distance)
 

Protected Attributes

EGG::Vector3f m_translation
 

Private Member Functions

bool enclosesOrigin (const GJKState &state, u32 idx) const
 
void FUN_808350e4 (GJKState &state, EGG::Vector3f &v) const
 
bool getNearestSimplex (GJKState &state, EGG::Vector3f &v) const
 
void getNearestPoint (GJKState &state, u32 idx, EGG::Vector3f &v0, EGG::Vector3f &v1) const
 
bool FUN_808357e4 (const GJKState &state, u32 idx) const
 
bool inSimplex (const GJKState &state, const EGG::Vector3f &v) const
 
void getNearestPoint (const GJKState &state, u32 idx, EGG::Vector3f &v) const
 
void calcSimplex (GJKState &state) const
 

Private Attributes

EGG::Vector3f m_00
 

Static Private Attributes

static std::array< std::array< f32, 4 >, 4 > s_dotProductCache = {{}}
 

Member Function Documentation

◆ calcSimplex()

void Field::ObjectCollisionBase::calcSimplex ( GJKState & state) const
private0x80835A8C

Definition at line 227 of file ObjectCollisionBase.cc.

◆ check()

bool Field::ObjectCollisionBase::check ( ObjectCollisionBase & rhs,
EGG::Vector3f & distance )
0x80834348

Definition at line 14 of file ObjectCollisionBase.cc.

◆ enclosesOrigin()

bool Field::ObjectCollisionBase::enclosesOrigin ( const GJKState & state,
u32 idx ) const
private0x8083504C

Definition at line 100 of file ObjectCollisionBase.cc.

◆ FUN_808350e4()

void Field::ObjectCollisionBase::FUN_808350e4 ( GJKState & state,
EGG::Vector3f & v ) const
private0x808350E4

Definition at line 112 of file ObjectCollisionBase.cc.

◆ FUN_808357e4()

bool Field::ObjectCollisionBase::FUN_808357e4 ( const GJKState & state,
u32 idx ) const
private0x808357E40x808359A4

Definition at line 179 of file ObjectCollisionBase.cc.

◆ getNearestPoint() [1/2]

void Field::ObjectCollisionBase::getNearestPoint ( const GJKState & state,
u32 idx,
EGG::Vector3f & v ) const
private0x80835F34

Definition at line 209 of file ObjectCollisionBase.cc.

◆ getNearestPoint() [2/2]

void Field::ObjectCollisionBase::getNearestPoint ( GJKState & state,
u32 idx,
EGG::Vector3f & v0,
EGG::Vector3f & v1 ) const
private0x80835650

Definition at line 158 of file ObjectCollisionBase.cc.

◆ getNearestSimplex()

bool Field::ObjectCollisionBase::getNearestSimplex ( GJKState & state,
EGG::Vector3f & v ) const
private0x80835304

Definition at line 134 of file ObjectCollisionBase.cc.

◆ inSimplex()

bool Field::ObjectCollisionBase::inSimplex ( const GJKState & state,
const EGG::Vector3f & v ) const
private0x808358CC

Definition at line 198 of file ObjectCollisionBase.cc.

Member Data Documentation

◆ m_00

EGG::Vector3f Field::ObjectCollisionBase::m_00
private

Definition at line 49 of file ObjectCollisionBase.hh.

◆ m_translation

EGG::Vector3f Field::ObjectCollisionBase::m_translation
protected

Definition at line 37 of file ObjectCollisionBase.hh.

◆ s_dotProductCache

std::array< std::array< f32, 4 >, 4 > Field::ObjectCollisionBase::s_dotProductCache = {{}}
staticprivate

Definition at line 51 of file ObjectCollisionBase.hh.