Definition at line 16 of file ObjectBase.hh.
Public Types | |
| enum class | eFlags { Position = 0 , Rotation = 1 , Matrix = 2 , Scale = 3 } |
| enum class | eLoadFlags { Calc = 0 , Draw = 1 , AlwaysRecalc = 2 } |
| Describes whether the object needs to be updated every frame. More... | |
| typedef EGG::TBitFlag< u16, eFlags > | Flags |
| typedef EGG::TBitFlag< u8, eLoadFlags > | LoadFlags |
| A bitfield of eLoadFlags that represents the update requirements of the object. | |
Public Member Functions | |
| ObjectBase (const System::MapdataGeoObj ¶ms) | |
| ObjectBase (const char *name, const EGG::Vector3f &pos, const EGG::Vector3f &rot, const EGG::Vector3f &scale) | |
| virtual void | init () |
| virtual void | calc () |
| virtual void | calcModel () |
| virtual void | load ()=0 |
| virtual const char * | getResources () const |
| virtual void | loadGraphics () |
| virtual void | loadAnims () |
| virtual void | createCollision ()=0 |
| virtual void | loadRail () |
| virtual void | calcCollisionTransform ()=0 |
| virtual const char * | getName () const |
| virtual LoadFlags | loadFlags () const |
| Returns a bitmask indicating which lifecycle hooks should be called for the object. | |
| 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 f32 | getCollisionRadius () 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 () |
Protected Member Functions | |
| 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 | |
| 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::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 | |
| Render::DrawMdl * | m_drawMdl |
| Abstract::g3d::ResFile * | m_resFile |
| ObjectId | m_id |
| RailInterpolator * | m_railInterpolator |
| BoxColUnit * | m_boxColUnit |
| const System::MapdataGeoObj * | m_mapObj |
Private Types | |
| enum class | PendingRotation { None , TangentTo , OrthonormalBasis } |
| The source of a rotation for m_transform which has not been computed yet. More... | |
Private Member Functions | |
| void | resolvePendingRotation () |
| Computes the rotation columns of m_transform from the PendingRotation, if any. | |
Private Attributes | |
| Flags | m_flags |
| EGG::Vector3f | m_pos |
| EGG::Vector3f | m_scale |
| EGG::Vector3f | m_rot |
| bool | m_rotLock |
| EGG::Matrix34f | m_transform |
| PendingRotation | m_pendingRot |
| Rotation of m_transform yet to be computed. | |
| EGG::Vector3f | m_pendingWork0 |
| Up/forward vector depending on the PendingRotation type. | |
| EGG::Vector3f | m_pendingWork1 |
| Tangent vector of the PendingRotation. | |
| typedef EGG::TBitFlag<u16, eFlags> Kinoko::Field::ObjectBase::Flags |
Definition at line 24 of file ObjectBase.hh.
| typedef EGG::TBitFlag<u8, eLoadFlags> Kinoko::Field::ObjectBase::LoadFlags |
A bitfield of eLoadFlags that represents the update requirements of the object.
Definition at line 36 of file ObjectBase.hh.
|
strong |
Definition at line 18 of file ObjectBase.hh.
|
strong |
Describes whether the object needs to be updated every frame.
For the current purposes of Kinoko, we really only care about Calc. The others are effectively unused.
| Enumerator | |
|---|---|
| Calc | The state of the object should be recalculated every frame. |
| Draw | The object should be re-drawn every frame. |
| AlwaysRecalc | The object's BoxColUnit will always be recalculated. |
Definition at line 29 of file ObjectBase.hh.
|
strongprivate |
The source of a rotation for m_transform which has not been computed yet.
Kinoko-specific optimization. Many objects recompute their rotation every frame, but it is usually only read when checking collision against the kart, so the rotation columns of m_transform are only computed when the matrix is next read.
| Enumerator | |
|---|---|
| None | m_transform is up-to-date |
| TangentTo | SetRotTangentHorizontal() with the pending up and tangent |
| OrthonormalBasis | OrthonormalBasis() of the pending forward vector |
Definition at line 227 of file ObjectBase.hh.
|
0x8081F828 |
Definition at line 16 of file ObjectBase.cc.
|
0x8081FB04 |
Definition at line 26 of file ObjectBase.cc.
|
virtual0x8067E3C4 |
Definition at line 37 of file ObjectBase.cc.
|
inline |
Definition at line 117 of file ObjectBase.hh.
|
inline |
Definition at line 146 of file ObjectBase.hh.
|
staticnodiscardprotected0x807DE934 |
Definition at line 250 of file ObjectBase.cc.
|
inlinevirtual |
Reimplemented in Kinoko::Field::ObjectCowHerd.
Definition at line 44 of file ObjectBase.hh.
|
virtual0x808217B8 |
Definition at line 44 of file ObjectBase.cc.
|
inlinestaticnodiscardprotected0x806B59A8 |
Solves the standard kinematic equation \(y(t) = v_0\, t - \frac{1}{2} a t^{2}\).
Definition at line 204 of file ObjectBase.hh.
|
protected |
Definition at line 124 of file ObjectBase.cc.
|
protected0x80821640 |
Definition at line 113 of file ObjectBase.cc.
|
staticnodiscardprotected0x806B38A8 |
Calculates on what side of line segment ab point lies.
Definition at line 192 of file ObjectBase.cc.
|
pure virtual |
Implemented in Kinoko::Field::ObjectBirdLeader, and Kinoko::Field::ObjectEscalatorGroup.
|
inlinevirtual0x80821DEC |
Definition at line 79 of file ObjectBase.hh.
|
inlinevirtual0x80821E00 |
Definition at line 84 of file ObjectBase.hh.
|
inlinenodiscardvirtual0x8080BDC0 |
Reimplemented in Kinoko::Field::ObjectCollidable, Kinoko::Field::ObjectPakkunF, Kinoko::Field::ObjectPillarC, Kinoko::Field::ObjectPress, and Kinoko::Field::ObjectPropeller.
Definition at line 103 of file ObjectBase.hh.
|
nodiscardvirtual0x806806DC |
Reimplemented in Kinoko::Field::ObjectKinokoUd.
Definition at line 105 of file ObjectBase.cc.
|
nodiscardvirtual0x80680784 |
Definition at line 97 of file ObjectBase.cc.
|
inlinenodiscardvirtual0x80681598 |
Definition at line 98 of file ObjectBase.hh.
|
nodiscardvirtual0x80680730 |
Definition at line 49 of file ObjectBase.cc.
|
inlinevirtual0x80680618 |
Definition at line 89 of file ObjectBase.hh.
|
inlinenodiscardvirtual0x80572574 |
Definition at line 108 of file ObjectBase.hh.
|
inlinevirtual |
Reimplemented in Kinoko::Field::ObjectCowHerd, and Kinoko::Field::ObjectHeyhoShipManager.
Definition at line 43 of file ObjectBase.hh.
|
inlinestaticnodiscardprotected0x8086C098 |
Definition at line 210 of file ObjectBase.hh.
|
protected0x80820EB8 |
Definition at line 133 of file ObjectBase.cc.
|
inlinevirtual |
Reimplemented in Kinoko::Field::ObjectPenguinS.
Definition at line 49 of file ObjectBase.hh.
|
inlinenodiscardvirtual0x806BF434 |
Returns a bitmask indicating which lifecycle hooks should be called for the object.
In Kinoko, the only effective behavior of this bitmask is to determine whether calc() should be called. The other bits are unused.
Reimplemented in Kinoko::Field::ObjectAmi, Kinoko::Field::ObjectAurora, Kinoko::Field::ObjectBasabasa, Kinoko::Field::ObjectBasabasaDummy, Kinoko::Field::ObjectBelt, Kinoko::Field::ObjectBird, Kinoko::Field::ObjectBirdLeader, Kinoko::Field::ObjectBoble, Kinoko::Field::ObjectBreakable, Kinoko::Field::ObjectBulldozer, Kinoko::Field::ObjectCarA, Kinoko::Field::ObjectCarTGE, Kinoko::Field::ObjectChoropu, Kinoko::Field::ObjectChoropuGround, Kinoko::Field::ObjectChoropuHoll, Kinoko::Field::ObjectCowFollower, Kinoko::Field::ObjectCowHerd, Kinoko::Field::ObjectCowLeader, Kinoko::Field::ObjectCrab, Kinoko::Field::ObjectCrane, Kinoko::Field::ObjectDokan, Kinoko::Field::ObjectDossun, Kinoko::Field::ObjectDossunTsuibiHolder, Kinoko::Field::ObjectEscalator, Kinoko::Field::ObjectEscalatorGroup, Kinoko::Field::ObjectFireball, Kinoko::Field::ObjectFirebar, Kinoko::Field::ObjectFireRing, Kinoko::Field::ObjectFireSnake, Kinoko::Field::ObjectFireSnakeKid, Kinoko::Field::ObjectFlamePole, Kinoko::Field::ObjectFlamePoleFoot, Kinoko::Field::ObjectFlamePoleV, Kinoko::Field::ObjectHanachan, Kinoko::Field::ObjectHanachanPart, Kinoko::Field::ObjectHeyho, Kinoko::Field::ObjectHeyhoBall, Kinoko::Field::ObjectHeyhoShip, Kinoko::Field::ObjectHighwayManager, Kinoko::Field::ObjectItemboxLine, Kinoko::Field::ObjectItemboxPress, Kinoko::Field::ObjectKinoko, Kinoko::Field::ObjectKoopaBall, Kinoko::Field::ObjectKoopaFigure64, Kinoko::Field::ObjectKuribo, Kinoko::Field::ObjectObakeManager, Kinoko::Field::ObjectPakkunF, Kinoko::Field::ObjectParasolR, Kinoko::Field::ObjectPenguin, Kinoko::Field::ObjectPillar, Kinoko::Field::ObjectPoihanaBase, Kinoko::Field::ObjectPress, Kinoko::Field::ObjectPressSenko, Kinoko::Field::ObjectPropeller, Kinoko::Field::ObjectPsea, Kinoko::Field::ObjectPylon, Kinoko::Field::ObjectRock, Kinoko::Field::ObjectSanbo, Kinoko::Field::ObjectSandcone, Kinoko::Field::ObjectShip64, Kinoko::Field::ObjectSniper, Kinoko::Field::ObjectSunDS, Kinoko::Field::ObjectTownBridge, Kinoko::Field::ObjectTruckWagon, Kinoko::Field::ObjectTruckWagonCart, Kinoko::Field::ObjectTuribashi, Kinoko::Field::ObjectTwistedWay, Kinoko::Field::ObjectVolcanoBall, Kinoko::Field::ObjectVolcanoBallLauncher, Kinoko::Field::ObjectVolcanoPiece, Kinoko::Field::ObjectVolcanoRock, Kinoko::Field::ObjectWanwan, Kinoko::Field::ObjectWanwanPile, Kinoko::Field::ObjectWLWallGC, Kinoko::Field::ObjectWoodboxW, and Kinoko::Field::ObjectWoodboxWSub.
Definition at line 61 of file ObjectBase.hh.
|
virtual0x8081FD10 |
Definition at line 57 of file ObjectBase.cc.
|
virtual0x80820980 |
Reimplemented in Kinoko::Field::ObjectBird.
Definition at line 75 of file ObjectBase.cc.
|
staticnodiscardprotected0x806B3CA4 |
Definition at line 227 of file ObjectBase.cc.
|
inlinenodiscard |
Definition at line 167 of file ObjectBase.hh.
|
inlinenodiscard |
Definition at line 93 of file ObjectBase.hh.
|
inlinevirtual0x80821DB8 |
Definition at line 69 of file ObjectBase.hh.
|
private |
Computes the rotation columns of m_transform from the PendingRotation, if any.
This produces the same rotation as computing it immediately, since the rotation only depends on the saved up and tangent vectors, and all other writes to m_transform before this point either only touch the translation column or discard the pending rotation.
Definition at line 172 of file ObjectBase.cc.
|
inlinenodiscard |
Definition at line 175 of file ObjectBase.hh.
|
staticnodiscardprotected0x806B3AC4 |
Definition at line 207 of file ObjectBase.cc.
|
staticnodiscardprotected0x806B3900 |
Rotates a vector around the Y-axis and returns the XZ-plane portion of the vector.
Definition at line 199 of file ObjectBase.cc.
|
inlinenodiscard |
Definition at line 171 of file ObjectBase.hh.
|
protected0x808218B0 |
Definition at line 159 of file ObjectBase.cc.
|
protected0x80821910 |
Definition at line 147 of file ObjectBase.cc.
|
inline |
Definition at line 112 of file ObjectBase.hh.
|
inline |
Definition at line 137 of file ObjectBase.hh.
|
inline |
Definition at line 142 of file ObjectBase.hh.
|
staticprotected0x806B41E0 |
Definition at line 216 of file ObjectBase.cc.
|
inline |
Definition at line 127 of file ObjectBase.hh.
|
inline |
Definition at line 132 of file ObjectBase.hh.
|
inline0x806C296C |
Definition at line 159 of file ObjectBase.hh.
|
inline |
Definition at line 122 of file ObjectBase.hh.
|
inline |
Definition at line 152 of file ObjectBase.hh.
|
inlinenodiscard |
Definition at line 179 of file ObjectBase.hh.
|
inlinevirtual0x80821DD8 |
Definition at line 74 of file ObjectBase.hh.
|
protected |
Definition at line 219 of file ObjectBase.hh.
|
protected |
Definition at line 215 of file ObjectBase.hh.
|
private |
Definition at line 235 of file ObjectBase.hh.
|
protected |
Definition at line 217 of file ObjectBase.hh.
|
protected |
Definition at line 220 of file ObjectBase.hh.
|
private |
Rotation of m_transform yet to be computed.
Definition at line 242 of file ObjectBase.hh.
|
private |
Up/forward vector depending on the PendingRotation type.
Definition at line 243 of file ObjectBase.hh.
|
private |
Tangent vector of the PendingRotation.
Definition at line 244 of file ObjectBase.hh.
|
private |
Definition at line 236 of file ObjectBase.hh.
|
protected |
Definition at line 218 of file ObjectBase.hh.
|
protected |
Definition at line 216 of file ObjectBase.hh.
|
private |
Definition at line 238 of file ObjectBase.hh.
|
private |
Definition at line 239 of file ObjectBase.hh.
|
private |
Definition at line 237 of file ObjectBase.hh.
|
private |
Definition at line 240 of file ObjectBase.hh.