#include <ObjectEscalator.hh>
Represents an individual escalator on Coconut Mall.
Escalators have two settings which are used to determine two framecounts at which the escalator comes to a standstill and changes to the next speed setting. This does not always indicate a direction change, as can be demonstrated by the escalator right before the first fountain whose steps always move downwards. Escalators use a piecewise function to mimic the position offset induced by the individual steps. For Kinoko, creative liberty was taken to create a few const members for expressions that are commonly re-used in this piecewise function that do not need to be recomputed every frame.
Definition at line 15 of file ObjectEscalator.hh.
Public Member Functions | |
| ObjectEscalator (const System::MapdataGeoObj ¶ms, bool reverse=false) | |
| void | calc () override |
| ObjectId | id () const override |
| LoadFlags | loadFlags () const override |
| Returns a bitmask indicating which lifecycle hooks should be called for the object. | |
| bool | checkPointPartial (const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info, KCLTypeMask *maskOut) override |
| bool | checkPointPartialPush (const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info, KCLTypeMask *maskOut) override |
| bool | checkPointFull (const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut) override |
| bool | checkPointFullPush (const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut) override |
| bool | checkSpherePartial (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| bool | checkSpherePartialPush (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| bool | checkSphereFull (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| bool | checkSphereFullPush (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| void | narrScLocal (f32 radius, const EGG::Vector3f &pos, KCLTypeMask mask, u32 timeOffset) override |
| bool | checkPointCachedPartial (const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info, KCLTypeMask *maskOut) override |
| bool | checkPointCachedPartialPush (const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info, KCLTypeMask *maskOut) override |
| bool | checkPointCachedFull (const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut) override |
| bool | checkPointCachedFullPush (const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut) override |
| bool | checkSphereCachedPartial (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| bool | checkSphereCachedPartialPush (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| bool | checkSphereCachedFull (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| bool | checkSphereCachedFullPush (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| const EGG::Matrix34f & | getUpdatedMatrix (u32 timeOffset) override |
| f32 | colRadiusAdditionalLength () const override |
| bool | checkCollision (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| bool | checkCollisionCached (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| Public Member Functions inherited from Kinoko::Field::ObjectKCL | |
| ObjectKCL (const System::MapdataGeoObj ¶ms) | |
| void | createCollision () override |
| void | calcCollisionTransform () override |
| const EGG::Vector3f & | getPosition () const override |
| f32 | getCollisionRadius () const override |
| void | initCollision () override |
| bool | checkPointPartial (const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info, KCLTypeMask *maskOut) override |
| bool | checkPointPartialPush (const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info, KCLTypeMask *maskOut) override |
| bool | checkPointFull (const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut) override |
| bool | checkPointFullPush (const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut) override |
| bool | checkSpherePartial (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| bool | checkSpherePartialPush (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| bool | checkSphereFull (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| bool | checkSphereFullPush (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| void | narrScLocal (f32 radius, const EGG::Vector3f &pos, KCLTypeMask mask, u32 timeOffset) override |
| bool | checkPointCachedPartial (const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info, KCLTypeMask *maskOut) override |
| bool | checkPointCachedPartialPush (const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info, KCLTypeMask *maskOut) override |
| bool | checkPointCachedFull (const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut) override |
| bool | checkPointCachedFullPush (const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut) override |
| bool | checkSphereCachedPartial (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| bool | checkSphereCachedPartialPush (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| bool | checkSphereCachedFull (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| bool | checkSphereCachedFullPush (f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info, KCLTypeMask *maskOut, u32 timeOffset) override |
| virtual void | update (u32 timeOffset) |
| virtual void | calcScale (u32 timeOffset) |
| virtual void | setMovingObjVel (const EGG::Vector3f &v) |
| virtual f32 | getScaleY (u32) const |
| virtual bool | shouldCheckColNoPush () const |
| virtual bool | shouldCheckColPush () const |
| Public Member Functions inherited from Kinoko::Field::ObjectDrivable | |
| ObjectDrivable (const System::MapdataGeoObj ¶ms) | |
| void | load () override |
| virtual void | loadAABB (f32 radius) |
| Public Member Functions inherited from Kinoko::Field::ObjectBase | |
| 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 | 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 |
| 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 () |
Private Types | |
| using | ShouldCheckFunc = bool (ObjectEscalator::*)() const |
| template<typename T> | |
| using | CheckPointFunc |
| template<typename T> | |
| using | CheckSphereFunc |
Private Member Functions | |
| template<typename T> requires std::is_same_v<T, CollisionInfo> || std::is_same_v<T, CollisionInfoPartial> | |
| bool | checkPointImpl (ShouldCheckFunc shouldCheckFunc, CheckPointFunc< T > checkFunc, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, T *info, KCLTypeMask *maskOut) |
| template<typename T> requires std::is_same_v<T, CollisionInfo> || std::is_same_v<T, CollisionInfoPartial> | |
| bool | checkSphereImpl (ShouldCheckFunc shouldCheckFunc, CheckSphereFunc< T > checkFunc, f32 radius, const EGG::Vector3f &pos, const EGG::Vector3f &prevPos, KCLTypeMask mask, T *info, KCLTypeMask *maskOut, u32 timeOffset) |
| f32 | calcStepFactor (s32 t) |
| f32 | calcSpeed (s32 t) |
Private Attributes | |
| EGG::Vector3f | m_initialPos |
| EGG::Vector3f | m_initialRot |
| f32 | m_stepFactor |
| Used so that the steps have a tangible height difference on the escalator. | |
| EGG::Vector3f | m_stepDims |
| Length and height of steps but aligned with its facing direction. | |
| EGG::Matrix34f | m_workMatrix |
| const std::array< s32, 2 > | m_stillFrames |
| When escalators change direction (two times). | |
| const std::array< f32, 3 > | m_speed |
| Velocity for each of the three directions it moves. | |
| const f32 | m_checkColYPosMax |
| Collision checks early return if you are above this height. | |
| const f32 | m_checkColYPosMin |
| Collision checks early return if you are below this height. | |
| const std::array< f32, 2 > | m_stopFrames |
| When the escalator starts slowing down. | |
| const std::array< f32, 2 > | m_startFrames |
| When the escalator starts accelerating. | |
| const std::array< f32, 2 > | m_fullSpeedFrames |
| When escalator reaches max speed. | |
| const f32 | m_midDuration |
Static Private Attributes | |
| static constexpr f32 | STEP_HEIGHT = 10.0f |
| Duration of full speed in between the dir changes. | |
| static constexpr f32 | REVERSE_FRAMES_F32 = 240.0f |
| Frames the escalator waits before speeding up. | |
| static constexpr f32 | STANDSTILL_FRAMES = 50.0f |
| static constexpr f32 | MAX_HEIGHT_OFFSET = STEP_HEIGHT * (17.5f * STEP_HEIGHT) |
| static constexpr f32 | MIN_HEIGHT_OFFSET = 0.5f * (17.5f * STEP_HEIGHT) |
Additional Inherited Members | |
| Public Types inherited from Kinoko::Field::ObjectBase | |
| 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. | |
| 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::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::ObjectKCL | |
| ObjColMgr * | m_objColMgr |
| EGG::Vector3f | m_kclMidpoint |
| f32 | m_bboxHalfSideLength |
| s32 | m_lastMtxUpdateFrame |
| s32 | m_lastScaleUpdateFrame |
| 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 |
|
private |
Definition at line 99 of file ObjectEscalator.hh.
|
private |
Definition at line 104 of file ObjectEscalator.hh.
|
private |
Definition at line 95 of file ObjectEscalator.hh.
|
0x807FFB20 |
Definition at line 13 of file ObjectEscalator.cc.
|
overridedefault0x80803D00 |
|
overridevirtual0x808008FC |
Reimplemented from Kinoko::Field::ObjectBase.
Definition at line 45 of file ObjectEscalator.cc.
|
nodiscardprivate0x80800FBC |
Definition at line 368 of file ObjectEscalator.cc.
|
nodiscardprivate0x80800ABC |
Definition at line 293 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x808011CC |
Reimplemented from Kinoko::Field::ObjectKCL.
Definition at line 190 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x808014AC |
Reimplemented from Kinoko::Field::ObjectKCL.
Definition at line 224 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803358 |
Implements Kinoko::Field::ObjectDrivable.
Definition at line 135 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x8080344C |
Implements Kinoko::Field::ObjectDrivable.
Definition at line 142 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803170 |
Implements Kinoko::Field::ObjectDrivable.
Definition at line 119 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803264 |
Implements Kinoko::Field::ObjectDrivable.
Definition at line 127 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803AF8 |
Implements Kinoko::Field::ObjectDrivable.
Definition at line 68 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803BEC |
Implements Kinoko::Field::ObjectDrivable.
Definition at line 75 of file ObjectEscalator.cc.
|
nodiscardprivate |
Definition at line 259 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803910 |
Implements Kinoko::Field::ObjectDrivable.
Definition at line 54 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803A04 |
Implements Kinoko::Field::ObjectDrivable.
Definition at line 61 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803020 |
Implements Kinoko::Field::ObjectDrivable.
Definition at line 167 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803160 |
Implements Kinoko::Field::ObjectDrivable.
Definition at line 176 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80802DA0 |
Implements Kinoko::Field::ObjectDrivable.
Definition at line 149 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80802EE0 |
Implements Kinoko::Field::ObjectDrivable.
Definition at line 158 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x808037C0 |
Implements Kinoko::Field::ObjectDrivable.
Definition at line 98 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803900 |
Implements Kinoko::Field::ObjectDrivable.
Definition at line 106 of file ObjectEscalator.cc.
|
nodiscardprivate |
Definition at line 275 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803540 |
Implements Kinoko::Field::ObjectDrivable.
Definition at line 82 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803680 |
Implements Kinoko::Field::ObjectDrivable.
Definition at line 90 of file ObjectEscalator.cc.
|
inlinenodiscardoverridevirtual0x80803CE0 |
Reimplemented from Kinoko::Field::ObjectKCL.
Definition at line 83 of file ObjectEscalator.hh.
|
nodiscardoverridevirtual0x80800A10 |
Reimplemented from Kinoko::Field::ObjectKCL.
Definition at line 183 of file ObjectEscalator.cc.
|
inlinenodiscardoverridevirtual0x80803CF0 |
Reimplemented from Kinoko::Field::ObjectBase.
Definition at line 25 of file ObjectEscalator.hh.
|
inlinenodiscardoverridevirtual0x80803CF8 |
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 from Kinoko::Field::ObjectBase.
Definition at line 30 of file ObjectEscalator.hh.
|
overridevirtual0x80802D98 |
Reimplemented from Kinoko::Field::ObjectDrivable.
Definition at line 113 of file ObjectEscalator.cc.
|
private |
Collision checks early return if you are above this height.
Definition at line 130 of file ObjectEscalator.hh.
|
private |
Collision checks early return if you are below this height.
Definition at line 131 of file ObjectEscalator.hh.
|
private |
When escalator reaches max speed.
Definition at line 136 of file ObjectEscalator.hh.
|
private |
Definition at line 123 of file ObjectEscalator.hh.
|
private |
Definition at line 124 of file ObjectEscalator.hh.
|
private |
Definition at line 137 of file ObjectEscalator.hh.
|
private |
Velocity for each of the three directions it moves.
Definition at line 129 of file ObjectEscalator.hh.
|
private |
When the escalator starts accelerating.
Definition at line 135 of file ObjectEscalator.hh.
|
private |
Length and height of steps but aligned with its facing direction.
Definition at line 126 of file ObjectEscalator.hh.
|
private |
Used so that the steps have a tangible height difference on the escalator.
Definition at line 125 of file ObjectEscalator.hh.
|
private |
When escalators change direction (two times).
Definition at line 128 of file ObjectEscalator.hh.
|
private |
When the escalator starts slowing down.
Definition at line 134 of file ObjectEscalator.hh.
|
private |
Definition at line 127 of file ObjectEscalator.hh.
|
staticconstexprprivate |
Definition at line 147 of file ObjectEscalator.hh.
|
staticconstexprprivate |
Definition at line 148 of file ObjectEscalator.hh.
|
staticconstexprprivate |
Frames the escalator waits before speeding up.
Definition at line 142 of file ObjectEscalator.hh.
|
staticconstexprprivate |
Definition at line 145 of file ObjectEscalator.hh.
|
staticconstexprprivate |
Duration of full speed in between the dir changes.
Frames from full speed to still or vice versa
Definition at line 139 of file ObjectEscalator.hh.