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

#include <ObjectCollisionConvexHull.hh>

Description

Smallest convex shape that encloses a given set of points.

Definition at line 8 of file ObjectCollisionConvexHull.hh.

Inheritance diagram for Field::ObjectCollisionConvexHull:

Public Member Functions

 ObjectCollisionConvexHull (const std::span< const EGG::Vector3f > &points)
 Creates a convex hull with the provided points.
 
void transform (const EGG::Matrix34f &mat, const EGG::Vector3f &scale, const EGG::Vector3f &speed) override
 
const EGG::Vector3fgetSupport (const EGG::Vector3f &v) const override
 
f32 getBoundingRadius () const override
 
virtual void setBoundingRadius (f32 val)
 
- Public Member Functions inherited from Field::ObjectCollisionBase
bool check (ObjectCollisionBase &rhs, EGG::Vector3f &distance)
 

Protected Member Functions

 ObjectCollisionConvexHull (size_t count)
 Allocates space for a convex hull with the provided point count. This overload can only be called via inheritance or delegating constructors.
 

Private Attributes

std::span< EGG::Vector3fm_points
 
std::span< EGG::Vector3fm_worldPoints
 
f32 m_worldRadius
 

Additional Inherited Members

- Protected Attributes inherited from Field::ObjectCollisionBase
EGG::Vector3f m_translation
 

Constructor & Destructor Documentation

◆ ObjectCollisionConvexHull() [1/2]

Field::ObjectCollisionConvexHull::ObjectCollisionConvexHull ( const std::span< const EGG::Vector3f > & points)
0x808364E0

Creates a convex hull with the provided points.

The base game has the possibility to only provide a count to allocate space. To account for this, we split the base game's constructor into two overloads. This overload enables conversion from std::array into a span, which initializes the points.

Definition at line 10 of file ObjectCollisionConvexHull.cc.

◆ ~ObjectCollisionConvexHull()

Field::ObjectCollisionConvexHull::~ObjectCollisionConvexHull ( )
override0x808365A8

Definition at line 20 of file ObjectCollisionConvexHull.cc.

◆ ObjectCollisionConvexHull() [2/2]

Field::ObjectCollisionConvexHull::ObjectCollisionConvexHull ( size_t count)
protected0x808364E0

Allocates space for a convex hull with the provided point count. This overload can only be called via inheritance or delegating constructors.

The base game has the possibility to only provide a count to allocate space. To account for this, we split the base game's constructor into two overloads. This overload enables avoiding immediate point initialization, which is useful for inheritance.

Definition at line 69 of file ObjectCollisionConvexHull.cc.

Member Function Documentation

◆ getBoundingRadius()

f32 Field::ObjectCollisionConvexHull::getBoundingRadius ( ) const
inlineoverridevirtual0x807F957C

Implements Field::ObjectCollisionBase.

Definition at line 18 of file ObjectCollisionConvexHull.hh.

◆ getSupport()

const EGG::Vector3f & Field::ObjectCollisionConvexHull::getSupport ( const EGG::Vector3f & v) const
overridevirtual0x80836628

Implements Field::ObjectCollisionBase.

Definition at line 46 of file ObjectCollisionConvexHull.cc.

◆ setBoundingRadius()

virtual void Field::ObjectCollisionConvexHull::setBoundingRadius ( f32 val)
inlinevirtual0x8080C414

Definition at line 23 of file ObjectCollisionConvexHull.hh.

◆ transform()

void Field::ObjectCollisionConvexHull::transform ( const EGG::Matrix34f & mat,
const EGG::Vector3f & scale,
const EGG::Vector3f & speed )
overridevirtual0x808367C4

Implements Field::ObjectCollisionBase.

Definition at line 26 of file ObjectCollisionConvexHull.cc.

Member Data Documentation

◆ m_points

std::span<EGG::Vector3f> Field::ObjectCollisionConvexHull::m_points
private

Definition at line 31 of file ObjectCollisionConvexHull.hh.

◆ m_worldPoints

std::span<EGG::Vector3f> Field::ObjectCollisionConvexHull::m_worldPoints
private

Definition at line 32 of file ObjectCollisionConvexHull.hh.

◆ m_worldRadius

f32 Field::ObjectCollisionConvexHull::m_worldRadius
private

Definition at line 33 of file ObjectCollisionConvexHull.hh.