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

Description

Definition at line 9 of file ObjectKoopaBall.hh.

Inheritance diagram for Kinoko::Field::ObjectKoopaBall:

Public Member Functions

 ObjectKoopaBall (const System::MapdataGeoObj &params)
void init () override
void calc () override
u32 loadFlags () const override
Kart::Reaction onCollision (Kart::KartObject *kartObj, Kart::Reaction reactionOnKart, Kart::Reaction reactionOnObj, EGG::Vector3f &hitDepth) override
const EGG::Vector3fgetCollisionTranslation () const override
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
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 bool checkCollision (ObjectCollisionBase *lhs, EGG::Vector3f &dist)
virtual ObjectCollisionBasecollision () 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 BoxColUnitgetUnit () const
const RailInterpolatorrailInterpolator () const
virtual const EGG::Vector3fgetPosition () 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::Vector3fpos () const
const EGG::Vector3fscale () const
const EGG::Vector3frot () const
const EGG::Matrix34ftransform () const

Private Types

enum class  State {
  Tangible = 0 ,
  Intangible = 1 ,
  Exploding = 2
}

Private Member Functions

void calcTangible ()
void calcExploding ()
void calcIntangible ()
void checkSphereFull ()

Private Attributes

State m_state
f32 m_initPosY
 Starting height.
EGG::Vector3f m_vel
f32 m_angSpeed
s32 m_cooldownTimer
 Frames until koopa will start to shoot the fireball.
Render::DrawMdlm_bombCoreDrawMdl
s32 m_explodeTimer
u32 m_animFramecount
f32 m_angleRad
f32 m_curScale

Static Private Attributes

static constexpr f32 RADIUS_AABB = 870.0f * 2.0f
static constexpr f32 SCALE_INITIAL = RADIUS_AABB / 940.0f * 0.5f
static constexpr f32 SCALE_DELTA = SCALE_INITIAL / 25.0f
static constexpr f32 INITIAL_VELOCITY = 400.0f
static constexpr f32 INITIAL_ANGULAR_SPEED = 3.0f
static constexpr f32 INITIAL_Y_VEL = -30.0f

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 Member Functions inherited from Kinoko::Field::ObjectCollidable
void createCollision () override
virtual const EGG::Vector3fcollisionCenter () 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::ObjectCollidable
ObjectCollisionBasem_collision
Protected Attributes inherited from Kinoko::Field::ObjectBase
Render::DrawMdlm_drawMdl
Abstract::g3d::ResFilem_resFile
ObjectId m_id
RailInterpolatorm_railInterpolator
BoxColUnitm_boxColUnit
const System::MapdataGeoObjm_mapObj

Member Enumeration Documentation

◆ State

enum class Kinoko::Field::ObjectKoopaBall::State
strongprivate

Definition at line 31 of file ObjectKoopaBall.hh.

Constructor & Destructor Documentation

◆ ObjectKoopaBall()

Kinoko::Field::ObjectKoopaBall::ObjectKoopaBall ( const System::MapdataGeoObj & params)
0x80770384

Definition at line 10 of file ObjectKoopaBall.cc.

◆ ~ObjectKoopaBall()

Kinoko::Field::ObjectKoopaBall::~ObjectKoopaBall ( )
override0x80771F70

Definition at line 14 of file ObjectKoopaBall.cc.

Member Function Documentation

◆ calc()

void Kinoko::Field::ObjectKoopaBall::calc ( )
overridevirtual0x80770ADC

Reimplemented from Kinoko::Field::ObjectBase.

Definition at line 61 of file ObjectKoopaBall.cc.

◆ calcExploding()

void Kinoko::Field::ObjectKoopaBall::calcExploding ( )
private0x80771324

Definition at line 128 of file ObjectKoopaBall.cc.

◆ calcIntangible()

void Kinoko::Field::ObjectKoopaBall::calcIntangible ( )
private0x80771248

Definition at line 155 of file ObjectKoopaBall.cc.

◆ calcTangible()

void Kinoko::Field::ObjectKoopaBall::calcTangible ( )
private0x80770F4C

Definition at line 91 of file ObjectKoopaBall.cc.

◆ checkSphereFull()

void Kinoko::Field::ObjectKoopaBall::checkSphereFull ( )
private0x80771624

Definition at line 170 of file ObjectKoopaBall.cc.

◆ getCollisionTranslation()

const EGG::Vector3f & Kinoko::Field::ObjectKoopaBall::getCollisionTranslation ( ) const
inlineoverridevirtual0x80771F60

Reimplemented from Kinoko::Field::ObjectCollidable.

Definition at line 26 of file ObjectKoopaBall.hh.

◆ init()

void Kinoko::Field::ObjectKoopaBall::init ( )
overridevirtual0x807703D0

Reimplemented from Kinoko::Field::ObjectBase.

Definition at line 19 of file ObjectKoopaBall.cc.

◆ loadFlags()

u32 Kinoko::Field::ObjectKoopaBall::loadFlags ( ) const
inlinenodiscardoverridevirtual0x80771F68

Reimplemented from Kinoko::Field::ObjectBase.

Definition at line 18 of file ObjectKoopaBall.hh.

◆ onCollision()

Kart::Reaction Kinoko::Field::ObjectKoopaBall::onCollision ( Kart::KartObject * kartObj,
Kart::Reaction reactionOnKart,
Kart::Reaction reactionOnObj,
EGG::Vector3f & hitDepth )
overridevirtual0x80771BF4

Reimplemented from Kinoko::Field::ObjectCollidable.

Definition at line 84 of file ObjectKoopaBall.cc.

Member Data Documentation

◆ INITIAL_ANGULAR_SPEED

f32 Kinoko::Field::ObjectKoopaBall::INITIAL_ANGULAR_SPEED = 3.0f
staticconstexprprivate

Definition at line 58 of file ObjectKoopaBall.hh.

◆ INITIAL_VELOCITY

f32 Kinoko::Field::ObjectKoopaBall::INITIAL_VELOCITY = 400.0f
staticconstexprprivate

Definition at line 57 of file ObjectKoopaBall.hh.

◆ INITIAL_Y_VEL

f32 Kinoko::Field::ObjectKoopaBall::INITIAL_Y_VEL = -30.0f
staticconstexprprivate

Definition at line 59 of file ObjectKoopaBall.hh.

◆ m_angleRad

f32 Kinoko::Field::ObjectKoopaBall::m_angleRad
private

Definition at line 51 of file ObjectKoopaBall.hh.

◆ m_angSpeed

f32 Kinoko::Field::ObjectKoopaBall::m_angSpeed
private

Definition at line 46 of file ObjectKoopaBall.hh.

◆ m_animFramecount

u32 Kinoko::Field::ObjectKoopaBall::m_animFramecount
private

Definition at line 50 of file ObjectKoopaBall.hh.

◆ m_bombCoreDrawMdl

Render::DrawMdl* Kinoko::Field::ObjectKoopaBall::m_bombCoreDrawMdl
private

Definition at line 48 of file ObjectKoopaBall.hh.

◆ m_cooldownTimer

s32 Kinoko::Field::ObjectKoopaBall::m_cooldownTimer
private

Frames until koopa will start to shoot the fireball.

Definition at line 47 of file ObjectKoopaBall.hh.

◆ m_curScale

f32 Kinoko::Field::ObjectKoopaBall::m_curScale
private

Definition at line 52 of file ObjectKoopaBall.hh.

◆ m_explodeTimer

s32 Kinoko::Field::ObjectKoopaBall::m_explodeTimer
private

Definition at line 49 of file ObjectKoopaBall.hh.

◆ m_initPosY

f32 Kinoko::Field::ObjectKoopaBall::m_initPosY
private

Starting height.

Definition at line 44 of file ObjectKoopaBall.hh.

◆ m_state

State Kinoko::Field::ObjectKoopaBall::m_state
private

Definition at line 43 of file ObjectKoopaBall.hh.

◆ m_vel

EGG::Vector3f Kinoko::Field::ObjectKoopaBall::m_vel
private

Definition at line 45 of file ObjectKoopaBall.hh.

◆ RADIUS_AABB

f32 Kinoko::Field::ObjectKoopaBall::RADIUS_AABB = 870.0f * 2.0f
staticconstexprprivate

Definition at line 54 of file ObjectKoopaBall.hh.

◆ SCALE_DELTA

f32 Kinoko::Field::ObjectKoopaBall::SCALE_DELTA = SCALE_INITIAL / 25.0f
staticconstexprprivate

Definition at line 56 of file ObjectKoopaBall.hh.

◆ SCALE_INITIAL

f32 Kinoko::Field::ObjectKoopaBall::SCALE_INITIAL = RADIUS_AABB / 940.0f * 0.5f
staticconstexprprivate

Definition at line 55 of file ObjectKoopaBall.hh.