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

Description

Definition at line 23 of file ObjectCarTGE.hh.

Inheritance diagram for Field::ObjectCarTGE:

Public Types

enum class  CarType {
  Normal = 0 ,
  Truck = 1 ,
  BombCar = 2
}
 
- Public Types inherited from Field::ObjectBase
enum class  eFlags {
  Position = 0 ,
  Rotation = 1 ,
  Matrix = 2 ,
  Scale = 3
}
 
typedef EGG::TBitFlag< u16, eFlags > Flags
 

Public Member Functions

 ObjectCarTGE (const System::MapdataGeoObj &params)
 
void init () override
 
void calc () override
 
u32 loadFlags () const override
 
const char * getResources () const override
 
const char * getKclName () const override
 
void createCollision () override
 
void calcCollisionTransform () override
 
f32 getCollisionRadius () const override
 
Kart::Reaction onCollision (Kart::KartObject *kartObj, Kart::Reaction reactionOnKart, Kart::Reaction reactionOnObj, EGG::Vector3f &hitDepth) override
 
bool checkCollision (ObjectCollisionBase *lhs, EGG::Vector3f &dist) override
 
const EGG::Vector3fcollisionCenter () const override
 
void setHighwayManager (const ObjectHighwayManager *highwayMgr)
 
void reset ()
 
bool squashed () const
 
- Public Member Functions inherited from Field::ObjectCollidable
 ObjectCollidable (const System::MapdataGeoObj &params)
 
 ObjectCollidable (const char *name, const EGG::Vector3f &pos, const EGG::Vector3f &rot, const EGG::Vector3f &scale)
 
void load () override
 
void calcCollisionTransform () override
 
f32 getCollisionRadius () const override
 Finds the radius that fits fully in a BoxColUnit.
 
virtual void loadAABB (f32 maxSpeed)
 
virtual void loadAABB (f32 radius, f32 maxSpeed)
 
virtual void processKartReactions (Kart::KartObject *kartObj, Kart::Reaction &reactionOnKart, Kart::Reaction &reactionOnObj)
 
virtual void onWallCollision (Kart::KartObject *, const EGG::Vector3f &)
 
virtual void onObjectCollision (Kart::KartObject *)
 
virtual const EGG::Vector3fgetCollisionTranslation () const
 
virtual ObjectCollisionBasecollision () const
 
- Public Member Functions inherited from Field::ObjectBase
 ObjectBase (const System::MapdataGeoObj &params)
 
 ObjectBase (const char *name, const EGG::Vector3f &pos, const EGG::Vector3f &rot, const EGG::Vector3f &scale)
 
virtual void calcModel ()
 
virtual void loadGraphics ()
 
virtual void loadAnims ()
 
virtual void loadRail ()
 
virtual const char * getName () const
 
virtual const EGG::Vector3fgetPosition () const
 
virtual ObjectId id () const
 
const EGG::Vector3fpos () const
 
void setPos (const EGG::Vector3f &pos)
 
- Public Member Functions inherited from Field::StateManager< ObjectCarTGE >
 StateManager (ObjectCarTGE *obj)
 
- Public Member Functions inherited from Field::StateManagerBase< ObjectCarTGE >

Private Member Functions

void enterStateStub ()
 
void calcStateStub ()
 
void calcState1 ()
 The state when cars are speeding up.
 
void calcState2 ()
 The state when cars are slowing down.
 
void calcPos ()
 

Private Attributes

friend StateManager< ObjectCarTGE >
 
const ObjectHighwayManagerm_highwayMgr
 
ObjectCollisionBasem_auxCollision
 
f32 m_highwayVel
 Speed while on the highway.
 
f32 m_localVel
 Speed while off the highway.
 
char m_carName [32]
 
char m_mdlName [32]
 
CarType m_carType
 Car, truck, or bomb car.
 
ObjectId m_dummyId
 
EGG::Vector3f m_scaledTangentDir
 
f32 m_currSpeed
 
EGG::Vector3f m_up
 
EGG::Vector3f m_tangent
 
bool m_squashed
 
bool m_hasAuxCollision
 
f32 m_hitAngle
 

Static Private Attributes

static constexpr f32 TOLL_BOOTH_ACCEL = 200.0f
 

Additional Inherited Members

- Protected Member Functions inherited from Field::ObjectCollidable
void createCollision () override
 
void registerManagedObject ()
 
- Protected Member Functions inherited from Field::ObjectBase
void calcTransform ()
 
void linkAnims (const std::span< const char * > &names, const std::span< Render::AnmType > types)
 
void setMatrixTangentTo (const EGG::Vector3f &up, const EGG::Vector3f &tangent)
 
- Static Protected Member Functions inherited from Field::ObjectBase
static EGG::Vector3f RotateAxisAngle (f32 angle, const EGG::Vector3f &axis, const EGG::Vector3f &v1)
 
static void SetRotTangentHorizontal (EGG::Matrix34f &mat, const EGG::Vector3f &up, const EGG::Vector3f &tangent)
 
static EGG::Matrix34f OrthonormalBasis (const EGG::Vector3f &v)
 
static EGG::Vector3f Interpolate (f32 t, const EGG::Vector3f &v0, const EGG::Vector3f &v1)
 
- Protected Attributes inherited from Field::ObjectCollidable
ObjectCollisionBasem_collision
 
- Protected Attributes inherited from Field::ObjectBase
Render::DrawMdlm_drawMdl
 
Abstract::g3d::ResFilem_resFile
 
ObjectId m_id
 
RailInterpolatorm_railInterpolator
 
BoxColUnitm_boxColUnit
 
Flags m_flags
 
EGG::Vector3f m_pos
 
EGG::Vector3f m_rot
 
EGG::Vector3f m_scale
 
EGG::Matrix34f m_transform
 
const System::MapdataGeoObjm_mapObj
 
- Protected Attributes inherited from Field::StateManagerBase< ObjectCarTGE >
u16 m_currentStateId
 
s32 m_nextStateId
 
u32 m_currentFrame
 
std::span< u16m_entryIds
 
std::span< const StateManagerEntry< ObjectCarTGE > > m_entries
 
const ObjectCarTGEm_obj
 

Member Enumeration Documentation

◆ CarType

enum class Field::ObjectCarTGE::CarType
strong
Enumerator
BombCar 

Unused in time trials.

Definition at line 27 of file ObjectCarTGE.hh.

Constructor & Destructor Documentation

◆ ObjectCarTGE()

Field::ObjectCarTGE::ObjectCarTGE ( const System::MapdataGeoObj & params)
0x806D5EE4

Definition at line 15 of file ObjectCarTGE.cc.

◆ ~ObjectCarTGE()

Field::ObjectCarTGE::~ObjectCarTGE ( )
override0x806D691C

Definition at line 102 of file ObjectCarTGE.cc.

Member Function Documentation

◆ calc()

void Field::ObjectCarTGE::calc ( )
overridevirtual0x806D6ECC

Reimplemented from Field::ObjectBase.

Definition at line 144 of file ObjectCarTGE.cc.

◆ calcCollisionTransform()

void Field::ObjectCarTGE::calcCollisionTransform ( )
overridevirtual0x806D7BF8

Implements Field::ObjectBase.

Definition at line 195 of file ObjectCarTGE.cc.

◆ calcPos()

void Field::ObjectCarTGE::calcPos ( )
private0x806D9000

Definition at line 327 of file ObjectCarTGE.cc.

◆ calcState1()

void Field::ObjectCarTGE::calcState1 ( )
private0x806D7D70

The state when cars are speeding up.

On Moonview Highway, the speed cap m_highwayVel is 70, which means this state is only executed for 1 frame when cars get on the highway.

Definition at line 298 of file ObjectCarTGE.cc.

◆ calcState2()

void Field::ObjectCarTGE::calcState2 ( )
private0x806D7E0C

The state when cars are slowing down.

On Moonview Highway, the speed floor m_localVel is 40, which means this state is only executed for 1 frame when cars get off the highway.

Definition at line 314 of file ObjectCarTGE.cc.

◆ calcStateStub()

void Field::ObjectCarTGE::calcStateStub ( )
private

Definition at line 292 of file ObjectCarTGE.cc.

◆ checkCollision()

bool Field::ObjectCarTGE::checkCollision ( ObjectCollisionBase * lhs,
EGG::Vector3f & dist )
overridevirtual0x806DA660

Reimplemented from Field::ObjectCollidable.

Definition at line 262 of file ObjectCarTGE.cc.

◆ collisionCenter()

const EGG::Vector3f & Field::ObjectCarTGE::collisionCenter ( ) const
nodiscardoverridevirtual0x806D7CF8

Reimplemented from Field::ObjectCollidable.

Definition at line 275 of file ObjectCarTGE.cc.

◆ createCollision()

void Field::ObjectCarTGE::createCollision ( )
overridevirtual0x806D7AF8

Implements Field::ObjectBase.

Definition at line 176 of file ObjectCarTGE.cc.

◆ enterStateStub()

void Field::ObjectCarTGE::enterStateStub ( )
private

Definition at line 290 of file ObjectCarTGE.cc.

◆ getCollisionRadius()

f32 Field::ObjectCarTGE::getCollisionRadius ( ) const
nodiscardoverridevirtual0x806D69C0

Reimplemented from Field::ObjectBase.

Definition at line 213 of file ObjectCarTGE.cc.

◆ getKclName()

const char * Field::ObjectCarTGE::getKclName ( ) const
inlinenodiscardoverridevirtual0x806DA7A4

Reimplemented from Field::ObjectBase.

Definition at line 50 of file ObjectCarTGE.hh.

◆ getResources()

const char * Field::ObjectCarTGE::getResources ( ) const
inlinenodiscardoverridevirtual0x806D68B0

Reimplemented from Field::ObjectBase.

Definition at line 45 of file ObjectCarTGE.hh.

◆ init()

void Field::ObjectCarTGE::init ( )
overridevirtual0x806D6B14

Reimplemented from Field::ObjectBase.

Definition at line 107 of file ObjectCarTGE.cc.

◆ loadFlags()

u32 Field::ObjectCarTGE::loadFlags ( ) const
inlinenodiscardoverridevirtual0x806DA7AC

Reimplemented from Field::ObjectBase.

Definition at line 40 of file ObjectCarTGE.hh.

◆ onCollision()

Kart::Reaction Field::ObjectCarTGE::onCollision ( Kart::KartObject * kartObj,
Kart::Reaction reactionOnKart,
Kart::Reaction reactionOnObj,
EGG::Vector3f & hitDepth )
overridevirtual0x806D7328

Reimplemented from Field::ObjectCollidable.

Definition at line 222 of file ObjectCarTGE.cc.

◆ reset()

void Field::ObjectCarTGE::reset ( )
inline0x806D9A04

Definition at line 67 of file ObjectCarTGE.hh.

◆ setHighwayManager()

void Field::ObjectCarTGE::setHighwayManager ( const ObjectHighwayManager * highwayMgr)
inline

Definition at line 62 of file ObjectCarTGE.hh.

◆ squashed()

bool Field::ObjectCarTGE::squashed ( ) const
inlinenodiscard

Definition at line 71 of file ObjectCarTGE.hh.

Member Data Documentation

◆ m_auxCollision

ObjectCollisionBase* Field::ObjectCarTGE::m_auxCollision
private

Definition at line 86 of file ObjectCarTGE.hh.

◆ m_carName

char Field::ObjectCarTGE::m_carName[32]
private

Definition at line 89 of file ObjectCarTGE.hh.

◆ m_carType

CarType Field::ObjectCarTGE::m_carType
private

Car, truck, or bomb car.

Definition at line 91 of file ObjectCarTGE.hh.

◆ m_currSpeed

f32 Field::ObjectCarTGE::m_currSpeed
private

Definition at line 94 of file ObjectCarTGE.hh.

◆ m_dummyId

ObjectId Field::ObjectCarTGE::m_dummyId
private

Definition at line 92 of file ObjectCarTGE.hh.

◆ m_hasAuxCollision

bool Field::ObjectCarTGE::m_hasAuxCollision
private

Definition at line 98 of file ObjectCarTGE.hh.

◆ m_highwayMgr

const ObjectHighwayManager* Field::ObjectCarTGE::m_highwayMgr
private

Definition at line 85 of file ObjectCarTGE.hh.

◆ m_highwayVel

f32 Field::ObjectCarTGE::m_highwayVel
private

Speed while on the highway.

Definition at line 87 of file ObjectCarTGE.hh.

◆ m_hitAngle

f32 Field::ObjectCarTGE::m_hitAngle
private

Definition at line 99 of file ObjectCarTGE.hh.

◆ m_localVel

f32 Field::ObjectCarTGE::m_localVel
private

Speed while off the highway.

Definition at line 88 of file ObjectCarTGE.hh.

◆ m_mdlName

char Field::ObjectCarTGE::m_mdlName[32]
private

Definition at line 90 of file ObjectCarTGE.hh.

◆ m_scaledTangentDir

EGG::Vector3f Field::ObjectCarTGE::m_scaledTangentDir
private

Definition at line 93 of file ObjectCarTGE.hh.

◆ m_squashed

bool Field::ObjectCarTGE::m_squashed
private

Definition at line 97 of file ObjectCarTGE.hh.

◆ m_tangent

EGG::Vector3f Field::ObjectCarTGE::m_tangent
private

Definition at line 96 of file ObjectCarTGE.hh.

◆ m_up

EGG::Vector3f Field::ObjectCarTGE::m_up
private

Definition at line 95 of file ObjectCarTGE.hh.

◆ StateManager< ObjectCarTGE >

friend Field::ObjectCarTGE::StateManager< ObjectCarTGE >
private

Definition at line 24 of file ObjectCarTGE.hh.

◆ TOLL_BOOTH_ACCEL

f32 Field::ObjectCarTGE::TOLL_BOOTH_ACCEL = 200.0f
staticconstexprprivate

Definition at line 76 of file ObjectCarTGE.hh.