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

#include <ObjectDossunSyuukai.hh>

Description

Thwomps that move along a rail and stomp.

Definition at line 8 of file ObjectDossunSyuukai.hh.

Inheritance diagram for Kinoko::Field::ObjectDossunSyuukai:

Public Member Functions

 ObjectDossunSyuukai (const System::MapdataGeoObj &params)
void init () override
void calc () override
void startStill () override
Public Member Functions inherited from Kinoko::Field::ObjectDossun
 ObjectDossun (const System::MapdataGeoObj &params)
u32 loadFlags () const override
void calcCollisionTransform () override
Kart::Reaction onCollision (Kart::KartObject *kartObj, Kart::Reaction reactionOnKart, Kart::Reaction reactionOnObj, EGG::Vector3f &hitDepth) override
void initState ()
void calcStomp ()
void startGrounded ()
Public Member Functions inherited from Kinoko::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
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 bool checkCollision (ObjectCollisionBase *lhs, EGG::Vector3f &dist)
virtual const EGG::Vector3f & getCollisionTranslation () const
virtual ObjectCollisionBase * collision () const
Public Member Functions inherited from Kinoko::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 const char * getResources () const
virtual void loadGraphics ()
virtual void loadAnims ()
virtual void loadRail ()
virtual const char * getName () const
virtual const char * getKclName () const
virtual void resize (f32 radius, f32 maxSpeed)
virtual void unregisterCollision ()
virtual void disableCollision () const
virtual void enableCollision () const
virtual const BoxColUnit * getUnit () const
const RailInterpolator * railInterpolator () const
virtual const EGG::Vector3f & getPosition () const
virtual ObjectId id () const
void setPos (const EGG::Vector3f &pos)
void addPos (const EGG::Vector3f &v)
void subPos (const EGG::Vector3f &v)
void setScale (const EGG::Vector3f &scale)
void setScale (f32 scale)
void setRot (const EGG::Vector3f &rot)
void setRotNoFlag (const EGG::Vector3f &rot)
void addRot (const EGG::Vector3f &v)
void subRot (const EGG::Vector3f &v)
void setTransform (const EGG::Matrix34f &mat)
const EGG::Vector3f & pos () const
const EGG::Vector3f & scale () const
const EGG::Vector3f & rot () const
const EGG::Matrix34f & transform () const

Private Types

enum class  State {
  Moving = 0 ,
  RotatingBeforeStomp = 1 ,
  Stomping = 2 ,
  RotatingAfterStomp = 3
}

Private Member Functions

void calcMoving ()
void calcRotating ()

Private Attributes

State m_state
f32 m_initRotY
bool m_rotating

Additional Inherited Members

Public Types inherited from Kinoko::Field::ObjectBase
enum class  eFlags {
  Position = 0 ,
  Rotation = 1 ,
  Matrix = 2 ,
  Scale = 3
}
typedef EGG::TBitFlag< u16, eFlags > Flags
Protected Types inherited from Kinoko::Field::ObjectDossun
enum class  AnmState {
  Still = 0 ,
  BeforeFall = 1 ,
  Falling = 2 ,
  Grounded = 3 ,
  Rising = 4
}
 Represents the current movement state of the Thwomp in terms of its stomp. More...
enum class  StompState {
  Inactive = 0 ,
  Active = 1
}
Protected Member Functions inherited from Kinoko::Field::ObjectCollidable
void createCollision () override
virtual const EGG::Vector3f & collisionCenter () const
void registerManagedObject ()
Protected Member Functions inherited from Kinoko::Field::ObjectBase
void calcTransform ()
void calcRotLock ()
void linkAnims (const std::span< const char * > &names, const std::span< Render::AnmType > types)
void setMatrixTangentTo (const EGG::Vector3f &up, const EGG::Vector3f &tangent)
void setMatrixFromOrthonormalBasisAndPos (const EGG::Vector3f &v)
Static Protected Member Functions inherited from Kinoko::Field::ObjectBase
static f32 CheckPointAgainstLineSegment (const EGG::Vector3f &point, const EGG::Vector3f &a, const EGG::Vector3f &b)
 Calculates on what side of line segment ab point lies.
static EGG::Vector3f RotateXZByYaw (f32 angle, const EGG::Vector3f &v)
 Rotates a vector around the Y-axis and returns the XZ-plane portion of the vector.
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::Matrix34f RailOrthonormalBasis (const RailInterpolator &railInterpolator)
static EGG::Vector3f AdjustVecForward (f32 sidewaysScalar, f32 forwardScalar, f32 minSpeed, const EGG::Vector3f &src, EGG::Vector3f forward)
static f32 CalcParabolicDisplacement (f32 initVel, f32 accel, u32 frame)
 Solves the standard kinematic equation \(y(t) = v_0\, t - \frac{1}{2} a t^{2}\).
static EGG::Vector3f Interpolate (f32 t, const EGG::Vector3f &v0, const EGG::Vector3f &v1)
Protected Attributes inherited from Kinoko::Field::ObjectDossun
StompState m_stompState
AnmState m_anmState
s32 m_beforeFallTimer
 Number of frames until the Thwomp will stomp down.
s32 m_stillTimer
 Number of frames the Thwomp will remain stationary (or shakes).
s32 m_groundedTimer
 Number of frames the Thwomp remains on the ground.
s32 m_shakePhase
 Causes the Thwomp's position to shake at the end of the "still" state.
f32 m_vel
 Vector3f in the base game, but only the y-component is used.
f32 m_initialPosY
u32 m_fullDuration
 Framecount of an entire animation loop.
s32 m_cycleTimer
f32 m_currRot
bool m_touchingGround
Protected Attributes inherited from Kinoko::Field::ObjectCollidable
ObjectCollisionBase * m_collision
Protected Attributes inherited from Kinoko::Field::ObjectBase
Render::DrawMdl * m_drawMdl
Abstract::g3d::ResFile * m_resFile
ObjectId m_id
RailInterpolator * m_railInterpolator
BoxColUnit * m_boxColUnit
const System::MapdataGeoObj * m_mapObj
Static Protected Attributes inherited from Kinoko::Field::ObjectDossun
static constexpr u32 BEFORE_FALL_DURATION = 10
 The total number of frames the thwomp rises before crashing down.

Member Enumeration Documentation

◆ State

enum class Kinoko::Field::ObjectDossunSyuukai::State
strongprivate

Definition at line 23 of file ObjectDossunSyuukai.hh.

Constructor & Destructor Documentation

◆ ObjectDossunSyuukai()

Kinoko::Field::ObjectDossunSyuukai::ObjectDossunSyuukai ( const System::MapdataGeoObj & params)
0x80760B20

Definition at line 6 of file ObjectDossunSyuukai.cc.

◆ ~ObjectDossunSyuukai()

Kinoko::Field::ObjectDossunSyuukai::~ObjectDossunSyuukai ( )
overridedefault0x80764B88

Member Function Documentation

◆ calc()

void Kinoko::Field::ObjectDossunSyuukai::calc ( )
overridevirtual0x80760C5C

Reimplemented from Kinoko::Field::ObjectBase.

Definition at line 22 of file ObjectDossunSyuukai.cc.

◆ calcMoving()

void Kinoko::Field::ObjectDossunSyuukai::calcMoving ( )
private0x80760D18

Definition at line 42 of file ObjectDossunSyuukai.cc.

◆ calcRotating()

void Kinoko::Field::ObjectDossunSyuukai::calcRotating ( )
private0x80760D8C

Approximately 5 degrees

Definition at line 51 of file ObjectDossunSyuukai.cc.

◆ init()

void Kinoko::Field::ObjectDossunSyuukai::init ( )
overridevirtual0x80760BD4

Reimplemented from Kinoko::Field::ObjectDossun.

Definition at line 13 of file ObjectDossunSyuukai.cc.

◆ startStill()

void Kinoko::Field::ObjectDossunSyuukai::startStill ( )
inlineoverridevirtual0x8076139C

Reimplemented from Kinoko::Field::ObjectDossun.

Definition at line 17 of file ObjectDossunSyuukai.hh.

Member Data Documentation

◆ m_initRotY

f32 Kinoko::Field::ObjectDossunSyuukai::m_initRotY
private

Definition at line 34 of file ObjectDossunSyuukai.hh.

◆ m_rotating

bool Kinoko::Field::ObjectDossunSyuukai::m_rotating
private

Definition at line 35 of file ObjectDossunSyuukai.hh.

◆ m_state

State Kinoko::Field::ObjectDossunSyuukai::m_state
private

Definition at line 33 of file ObjectDossunSyuukai.hh.