#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 |
u32 | loadFlags () const 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 |
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 |
![]() | |
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 |
![]() | |
ObjectDrivable (const System::MapdataGeoObj ¶ms) | |
void | load () override |
virtual void | loadAABB (f32 radius) |
![]() | |
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 |
const EGG::Vector3f & | pos () const |
void | setPos (const EGG::Vector3f &pos) |
void | setScale (const EGG::Vector3f &scale) |
void | setTransform (const EGG::Matrix34f &mat) |
const EGG::Vector3f & | scale () const |
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 | |
![]() | |
enum class | eFlags { Position = 0 , Rotation = 1 , Matrix = 2 , Scale = 3 } |
typedef EGG::TBitFlag< u16, eFlags > | Flags |
![]() | |
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) |
void | setMatrixFromOrthonormalBasisAndPos (const EGG::Vector3f &v) |
![]() | |
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 | Interpolate (f32 t, const EGG::Vector3f &v0, const EGG::Vector3f &v1) |
![]() | |
ObjColMgr * | m_objColMgr |
EGG::Vector3f | m_kclMidpoint |
f32 | m_bboxHalfSideLength |
s32 | m_lastMtxUpdateFrame |
s32 | m_lastScaleUpdateFrame |
![]() | |
Render::DrawMdl * | m_drawMdl |
Abstract::g3d::ResFile * | m_resFile |
ObjectId | m_id |
RailInterpolator * | m_railInterpolator |
BoxColUnit * | m_boxColUnit |
Flags | m_flags |
EGG::Vector3f | m_pos |
EGG::Vector3f | m_rot |
EGG::Vector3f | m_scale |
EGG::Matrix34f | m_transform |
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.
|
overridevirtual0x808008FC |
Reimplemented from Field::ObjectBase.
Definition at line 45 of file ObjectEscalator.cc.
|
nodiscardprivate0x80800FBC |
Definition at line 369 of file ObjectEscalator.cc.
|
nodiscardprivate0x80800ABC |
Definition at line 294 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x808011CC |
Reimplemented from Field::ObjectKCL.
Definition at line 191 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x808014AC |
Reimplemented from Field::ObjectKCL.
Definition at line 225 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803358 |
Implements Field::ObjectDrivable.
Definition at line 136 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x8080344C |
Implements Field::ObjectDrivable.
Definition at line 143 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803170 |
Implements Field::ObjectDrivable.
Definition at line 120 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803264 |
Implements Field::ObjectDrivable.
Definition at line 128 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803AF8 |
Implements Field::ObjectDrivable.
Definition at line 69 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803BEC |
Implements Field::ObjectDrivable.
Definition at line 76 of file ObjectEscalator.cc.
|
nodiscardprivate |
Definition at line 260 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803910 |
Implements Field::ObjectDrivable.
Definition at line 55 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803A04 |
Implements Field::ObjectDrivable.
Definition at line 62 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803020 |
Implements Field::ObjectDrivable.
Definition at line 168 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803160 |
Implements Field::ObjectDrivable.
Definition at line 177 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80802DA0 |
Implements Field::ObjectDrivable.
Definition at line 150 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80802EE0 |
Implements Field::ObjectDrivable.
Definition at line 159 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x808037C0 |
Implements Field::ObjectDrivable.
Definition at line 99 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803900 |
Implements Field::ObjectDrivable.
Definition at line 107 of file ObjectEscalator.cc.
|
nodiscardprivate |
Definition at line 276 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803540 |
Implements Field::ObjectDrivable.
Definition at line 83 of file ObjectEscalator.cc.
|
nodiscardoverridevirtual0x80803680 |
Implements Field::ObjectDrivable.
Definition at line 91 of file ObjectEscalator.cc.
|
inlinenodiscardoverridevirtual0x80803CE0 |
Reimplemented from Field::ObjectKCL.
Definition at line 83 of file ObjectEscalator.hh.
|
nodiscardoverridevirtual0x80800A10 |
Reimplemented from Field::ObjectKCL.
Definition at line 184 of file ObjectEscalator.cc.
|
inlinenodiscardoverridevirtual0x80803CF0 |
Reimplemented from Field::ObjectBase.
Definition at line 25 of file ObjectEscalator.hh.
|
inlinenodiscardoverridevirtual0x80803CF8 |
Reimplemented from Field::ObjectBase.
Definition at line 30 of file ObjectEscalator.hh.
|
overridevirtual0x80802D98 |
Reimplemented from Field::ObjectDrivable.
Definition at line 114 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.