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

#include <CollisionGroup.hh>

Description

Represents a hitbox for the kart body or a wheel.

A hitbox's position information is directly used in the KCL collision check functions.

Definition at line 48 of file CollisionGroup.hh.

Public Member Functions

void calc (f32 totalScale, f32 sinkDepth, const EGG::Vector3f &scale, const EGG::Quatf &rot, const EGG::Vector3f &pos)
 Calculates the position of a given hitbox, both relative to the player and world.
 

Setters

void reset ()
 
void setRadius (f32 radius)
 
void setBspHitbox (const BSP::Hitbox *hitbox, bool owns=false)
 
void setWorldPos (const EGG::Vector3f &pos)
 
void setLastPos (const EGG::Vector3f &pos)
 
void setLastPos (const EGG::Vector3f &scale, const EGG::Matrix34f &pose)
 

Getters

const BSP::HitboxbspHitbox () const
 
const EGG::Vector3fworldPos () const
 
const EGG::Vector3flastPos () const
 
const EGG::Vector3frelPos () const
 
f32 radius () const
 

Private Attributes

const BSP::Hitboxm_bspHitbox
 
f32 m_radius
 
EGG::Vector3f m_worldPos
 
EGG::Vector3f m_lastPos
 
EGG::Vector3f m_relPos
 
bool m_ownsBSP
 

Constructor & Destructor Documentation

◆ Hitbox()

Kart::Hitbox::Hitbox ( )
0x805B7F48

Definition at line 32 of file CollisionGroup.cc.

◆ ~Hitbox()

Kart::Hitbox::~Hitbox ( )
0x805B8480

Definition at line 35 of file CollisionGroup.cc.

Member Function Documentation

◆ bspHitbox()

const BSP::Hitbox * Kart::Hitbox::bspHitbox ( ) const
inlinenodiscard

Definition at line 80 of file CollisionGroup.hh.

◆ calc()

void Kart::Hitbox::calc ( f32 totalScale,
f32 sinkDepth,
const EGG::Vector3f & scale,
const EGG::Quatf & rot,
const EGG::Vector3f & pos )
0x805B7FBC

Calculates the position of a given hitbox, both relative to the player and world.

Definition at line 43 of file CollisionGroup.cc.

◆ lastPos()

const EGG::Vector3f & Kart::Hitbox::lastPos ( ) const
inlinenodiscard

Definition at line 88 of file CollisionGroup.hh.

◆ radius()

f32 Kart::Hitbox::radius ( ) const
inlinenodiscard

Definition at line 96 of file CollisionGroup.hh.

◆ relPos()

const EGG::Vector3f & Kart::Hitbox::relPos ( ) const
inlinenodiscard

Definition at line 92 of file CollisionGroup.hh.

◆ reset()

void Kart::Hitbox::reset ( )
0x805B7F84

Definition at line 58 of file CollisionGroup.cc.

◆ setBspHitbox()

void Kart::Hitbox::setBspHitbox ( const BSP::Hitbox * hitbox,
bool owns = false )
inline

Definition at line 63 of file CollisionGroup.hh.

◆ setLastPos() [1/2]

void Kart::Hitbox::setLastPos ( const EGG::Vector3f & pos)
inline

Definition at line 72 of file CollisionGroup.hh.

◆ setLastPos() [2/2]

void Kart::Hitbox::setLastPos ( const EGG::Vector3f & scale,
const EGG::Matrix34f & pose )
0x805B80A8

Definition at line 65 of file CollisionGroup.cc.

◆ setRadius()

void Kart::Hitbox::setRadius ( f32 radius)
inline

Definition at line 59 of file CollisionGroup.hh.

◆ setWorldPos()

void Kart::Hitbox::setWorldPos ( const EGG::Vector3f & pos)
inline

Definition at line 68 of file CollisionGroup.hh.

◆ worldPos()

const EGG::Vector3f & Kart::Hitbox::worldPos ( ) const
inlinenodiscard

Definition at line 84 of file CollisionGroup.hh.

Member Data Documentation

◆ m_bspHitbox

const BSP::Hitbox* Kart::Hitbox::m_bspHitbox
private

Definition at line 102 of file CollisionGroup.hh.

◆ m_lastPos

EGG::Vector3f Kart::Hitbox::m_lastPos
private

Definition at line 105 of file CollisionGroup.hh.

◆ m_ownsBSP

bool Kart::Hitbox::m_ownsBSP
private

Definition at line 108 of file CollisionGroup.hh.

◆ m_radius

f32 Kart::Hitbox::m_radius
private

Definition at line 103 of file CollisionGroup.hh.

◆ m_relPos

EGG::Vector3f Kart::Hitbox::m_relPos
private

Definition at line 106 of file CollisionGroup.hh.

◆ m_worldPos

EGG::Vector3f Kart::Hitbox::m_worldPos
private

Definition at line 104 of file CollisionGroup.hh.