#include <KartCollide.hh>
Manages body+wheel collision and its influence on position/velocity/etc.
Definition at line 48 of file KartCollide.hh.
Public Types | |
enum class | eSurfaceFlags { Wall = 0 , SolidOOB = 1 , ObjectWall = 2 , ObjectWall3 = 3 , BoostRamp = 4 , Offroad = 6 , GroundBoostPanelOrRamp = 7 , Trickable = 11 , NotTrickable = 12 , StopHalfPipeState = 16 } |
typedef EGG::TBitFlag< u32, eSurfaceFlags > | SurfaceFlags |
Public Member Functions | |
void | init () |
void | resetHitboxes () |
void | calcHitboxes () |
On each frame, calculates the positions for each hitbox. | |
void | findCollision () |
void | FUN_80572F4C () |
void | FUN_805B72B8 (f32 param_1, f32 param_2, bool lockXZ, bool addExtVelY) |
Affects velocity when landing from airtime. | |
void | calcBodyCollision (f32 totalScale, f32 sinkDepth, const EGG::Quatf &rot, const EGG::Vector3f &scale) |
Checks and acts on collision for each kart hitbox. | |
void | calcFloorEffect () |
void | calcTriggers (Field::KCLTypeMask *mask, const EGG::Vector3f &pos, bool twoPoint) |
void | handleTriggers (Field::KCLTypeMask *mask) |
void | calcFallBoundary (Field::KCLTypeMask *mask, bool shortBoundary) |
void | calcBeforeRespawn () |
void | activateOob (bool detachCamera, Field::KCLTypeMask *mask, bool somethingCPU, bool somethingBullet) |
void | calcWheelCollision (u16 wheelIdx, CollisionGroup *hitboxGroup, const EGG::Vector3f &colVel, const EGG::Vector3f ¢er, f32 radius) |
Checks wheel hitbox collision and stores position/velocity info. | |
void | calcSideCollision (CollisionData &collisionData, Hitbox &hitbox, Field::CollisionInfo *colInfo) |
void | calcBoundingRadius () |
void | calcObjectCollision () |
void | calcPoleTimer () |
void | processWheel (CollisionData &collisionData, Hitbox &hitbox, Field::CollisionInfo *colInfo, Field::KCLTypeMask *maskOut) |
Processes moving water and floor collision effects. | |
void | processBody (CollisionData &collisionData, Hitbox &hitbox, Field::CollisionInfo *colInfo, Field::KCLTypeMask *maskOut) |
bool | processWall (CollisionData &collisionData, Field::KCLTypeMask *maskOut) |
void | processFloor (CollisionData &collisionData, Hitbox &hitbox, Field::CollisionInfo *colInfo, Field::KCLTypeMask *maskOut, bool wheel) |
Processes the floor triangles' attributes. | |
void | processCannon (Field::KCLTypeMask *maskOut) |
Checks if we are colliding with a cannon trigger and sets the state flag if so. | |
void | applySomeFloorMoment (f32 down, f32 rate, CollisionGroup *hitboxGroup, const EGG::Vector3f &forward, const EGG::Vector3f &nextDir, const EGG::Vector3f &speed, bool b1, bool b2, bool b3) |
Applies external and angular velocity based on the collision with the floor. | |
bool | FUN_805B6A9C (CollisionData &collisionData, const Hitbox &hitbox, EGG::BoundBox3f &minMax, EGG::Vector3f &relPos, s32 &count, const Field::KCLTypeMask &maskOut, const Field::CollisionInfo &colInfo) |
Called on collision of a new KCL type??? This only happens after airtime so far. | |
void | applyBodyCollision (CollisionData &collisionData, const EGG::Vector3f &movement, const EGG::Vector3f &posRel, s32 count) |
Saves collision info when vehicle body collision occurs. | |
void | startFloorMomentRate () |
void | calcFloorMomentRate () |
Action | handleReactNone (size_t idx) |
Object collision functions. | |
Action | handleReactWallAllSpeed (size_t idx) |
Action | handleReactSpinAllSpeed (size_t idx) |
Action | handleReactSpinSomeSpeed (size_t idx) |
Action | handleReactFireSpin (size_t idx) |
Action | handleReactSmallLaunch (size_t idx) |
Action | handleReactKnockbackSomeSpeedLoseItem (size_t idx) |
Action | handleReactLaunchSpinLoseItem (size_t idx) |
Action | handleReactKnockbackBumpLoseItem (size_t idx) |
Action | handleReactLongCrushLoseItem (size_t idx) |
Action | handleReactHighLaunchLoseItem (size_t idx) |
Action | handleReactWeakWall (size_t idx) |
Action | handleReactLaunchSpin (size_t idx) |
Action | handleReactWallSpark (size_t idx) |
Action | handleReactShortCrushLoseItem (size_t idx) |
Action | handleReactCrushRespawn (size_t idx) |
Action | handleReactExplosionLoseItem (size_t idx) |
Setters | |
void | setFloorColInfo (CollisionData &collisionData, const EGG::Vector3f &relPos, const EGG::Vector3f &vel, const EGG::Vector3f &floorNrm) |
void | setTangentOff (const EGG::Vector3f &v) |
void | setMovement (const EGG::Vector3f &v) |
Getters | |
f32 | boundingRadius () const |
f32 | floorMomentRate () const |
const SurfaceFlags & | surfaceFlags () const |
const EGG::Vector3f & | tangentOff () const |
const EGG::Vector3f & | movement () const |
f32 | suspBottomHeightSoftWall () const |
u16 | someSoftWallTimer () const |
f32 | suspBottomHeightNonSoftWall () const |
u16 | someNonSoftWallTimer () const |
f32 | colPerpendicularity () const |
Private Types | |
typedef Action(KartCollide::*) | ObjectCollisionHandler(size_t idx) |
Static Private Attributes | |
static std::array< ObjectCollisionHandler, 33 > | s_objectCollisionHandlers |
Additional Inherited Members | |
![]() | |
void | setPos (const EGG::Vector3f &pos) |
void | setRot (const EGG::Quatf &q) |
void | setInertiaScale (const EGG::Vector3f &scale) |
KartAction * | action () |
const KartAction * | action () const |
KartBody * | body () |
const KartBody * | body () const |
KartCollide * | collide () |
const KartCollide * | collide () const |
CollisionGroup * | collisionGroup () |
const CollisionGroup * | collisionGroup () const |
KartMove * | move () |
const KartMove * | move () const |
KartHalfPipe * | halfPipe () |
const KartHalfPipe * | halfPipe () const |
KartJump * | jump () |
const KartJump * | jump () const |
KartParam * | param () |
const KartParam * | param () const |
const BSP & | bsp () const |
KartPhysics * | physics () |
const KartPhysics * | physics () const |
KartDynamics * | dynamics () |
const KartDynamics * | dynamics () const |
KartState * | state () |
const KartState * | state () const |
KartSub * | sub () |
const KartSub * | sub () const |
KartSuspension * | suspension (u16 suspIdx) |
const KartSuspension * | suspension (u16 suspIdx) const |
KartSuspensionPhysics * | suspensionPhysics (u16 suspIdx) |
const KartSuspensionPhysics * | suspensionPhysics (u16 suspIdx) const |
KartTire * | tire (u16 tireIdx) |
const KartTire * | tire (u16 tireIdx) const |
WheelPhysics * | tirePhysics (u16 tireIdx) |
const WheelPhysics * | tirePhysics (u16 tireIdx) const |
CollisionData & | collisionData () |
const CollisionData & | collisionData () const |
CollisionData & | collisionData (u16 tireIdx) |
const CollisionData & | collisionData (u16 tireIdx) const |
const System::KPad * | inputs () const |
Render::KartModel * | model () |
const Render::KartModel * | model () const |
Field::ObjectCollisionKart * | objectCollisionKart () |
const Field::ObjectCollisionKart * | objectCollisionKart () const |
Field::BoxColUnit * | boxColUnit () |
const Field::BoxColUnit * | boxColUnit () const |
const EGG::Vector3f & | scale () const |
const EGG::Matrix34f & | pose () const |
EGG::Vector3f | bodyFront () const |
Returns the third column of the rotation matrix, which is the facing vector. | |
EGG::Vector3f | bodyForward () const |
Returns the first column of the rotation matrix, which is the "right" direction. | |
EGG::Vector3f | bodyUp () const |
Returns the second column of the rotation matrix, which is the "up" direction. | |
const EGG::Vector3f & | componentXAxis () const |
const EGG::Vector3f & | componentYAxis () const |
const EGG::Vector3f & | componentZAxis () const |
const EGG::Vector3f & | pos () const |
const EGG::Vector3f & | prevPos () const |
const EGG::Quatf & | fullRot () const |
const EGG::Vector3f & | extVel () const |
const EGG::Vector3f & | intVel () const |
const EGG::Vector3f & | velocity () const |
f32 | speed () const |
f32 | acceleration () const |
f32 | softSpeedLimit () const |
const EGG::Quatf & | mainRot () const |
const EGG::Vector3f & | angVel2 () const |
bool | isBike () const |
u16 | suspCount () const |
u16 | tireCount () const |
bool | hasFloorCollision (const WheelPhysics *wheelPhysics) const |
std::pair< EGG::Vector3f, EGG::Vector3f > | getCannonPosRot () |
f32 | speedRatio () const |
f32 | speedRatioCapped () const |
bool | isInRespawn () const |
void | apply (size_t idx) |
![]() | |
static std::list< KartObjectProxy * > & | proxyList () |
|
private |
Definition at line 194 of file KartCollide.hh.
Definition at line 62 of file KartCollide.hh.
|
strong |
Enumerator | |
---|---|
Offroad | [Unused] |
Definition at line 50 of file KartCollide.hh.
|
0x8056E56C |
Definition at line 18 of file KartCollide.cc.
|
0x80573B00 |
Definition at line 383 of file KartCollide.cc.
|
0x805B6D48 |
Saves collision info when vehicle body collision occurs.
Additionally may apply a change in position for certain KCL types.
Definition at line 884 of file KartCollide.cc.
|
0x805B7928 |
Applies external and angular velocity based on the collision with the floor.
down | Always 0.1f |
rate | Downward velocity? Related to suspension stiffness |
hitboxGroup | Used to retrieve CollisionData reference |
forward | Current world facing direction of the kart |
nextDir | Updated facing direction of the kart |
speed | Tire speed |
Definition at line 731 of file KartCollide.cc.
|
inlinenodiscard |
Definition at line 152 of file KartCollide.hh.
|
0x80573ED4 |
Definition at line 364 of file KartCollide.cc.
|
0x805B6724 |
Checks and acts on collision for each kart hitbox.
totalScale | |
rot | |
scale |
Definition at line 210 of file KartCollide.cc.
|
0x8056E70C |
Definition at line 511 of file KartCollide.cc.
|
0x80571D98 |
Definition at line 350 of file KartCollide.cc.
|
0x80571634 |
Definition at line 261 of file KartCollide.cc.
|
0x805713FC |
Definition at line 920 of file KartCollide.cc.
|
0x8056EE24 |
On each frame, calculates the positions for each hitbox.
Definition at line 54 of file KartCollide.cc.
|
0x80571F10 |
Definition at line 516 of file KartCollide.cc.
|
Inlined in 0x80571F10 |
Definition at line 563 of file KartCollide.cc.
|
0x8056F26C |
Definition at line 459 of file KartCollide.cc.
|
0x805718D4 |
Definition at line 295 of file KartCollide.cc.
|
0x805B6F4C |
Checks wheel hitbox collision and stores position/velocity info.
hitboxGroup | The wheel's collision information |
colVel | The wheel's velocity. In the base game, it is always \(\vec{v} = \begin{bmatrix} 0 \\ -13 \\ 0 \end{bmatrix}\) |
center | The wheel's position |
radius | The wheel's size |
Definition at line 405 of file KartCollide.cc.
|
inlinenodiscard |
Definition at line 188 of file KartCollide.hh.
|
0x80572C20 |
Definition at line 64 of file KartCollide.cc.
|
inlinenodiscard |
Definition at line 156 of file KartCollide.hh.
|
0x80572F4C |
Definition at line 98 of file KartCollide.cc.
|
nodiscard0x805B6A9C |
Called on collision of a new KCL type??? This only happens after airtime so far.
Definition at line 829 of file KartCollide.cc.
|
0x805B72B8 |
Affects velocity when landing from airtime.
Every frame, this function checks the player's velocity relative to the floor collision and applies external velocity and angular velocity. This is mostly relevant when you were midair and just landed.
Definition at line 122 of file KartCollide.cc.
|
0x805735DC |
Definition at line 1007 of file KartCollide.cc.
|
0x805735E4 |
Definition at line 1012 of file KartCollide.cc.
|
0x805735AC |
Definition at line 948 of file KartCollide.cc.
|
0x805733E4 |
Definition at line 978 of file KartCollide.cc.
|
0x805733EC |
Definition at line 968 of file KartCollide.cc.
|
0x805733DC |
Definition at line 958 of file KartCollide.cc.
|
0x805733F4 |
Definition at line 989 of file KartCollide.cc.
|
0x8057353C |
Definition at line 963 of file KartCollide.cc.
|
0x805735B4 |
Definition at line 973 of file KartCollide.cc.
|
0x8056E564 |
Object collision functions.
Definition at line 925 of file KartCollide.cc.
|
0x805735D4 |
Definition at line 1002 of file KartCollide.cc.
|
0x805733C4 |
Definition at line 953 of file KartCollide.cc.
|
0x805733CC |
Definition at line 938 of file KartCollide.cc.
|
0x805733D4 |
Definition at line 943 of file KartCollide.cc.
|
0x8057363C |
Definition at line 930 of file KartCollide.cc.
|
0x805736C8 |
Definition at line 994 of file KartCollide.cc.
|
0x80573754 |
Definition at line 983 of file KartCollide.cc.
|
0x8056F510 |
Definition at line 333 of file KartCollide.cc.
|
0x8056E624 |
Definition at line 27 of file KartCollide.cc.
|
inlinenodiscard |
Definition at line 168 of file KartCollide.hh.
|
0x8056E764 |
Definition at line 582 of file KartCollide.cc.
|
0x8056F490 |
Checks if we are colliding with a cannon trigger and sets the state flag if so.
Definition at line 713 of file KartCollide.cc.
|
0x8056EA04 |
Processes the floor triangles' attributes.
collisionData | Stores the resulting speed and handling info |
maskOut | Stores the flags from the floor KCL |
wheel | Differentiates between body and wheel floor collision (boost panels) |
Definition at line 624 of file KartCollide.cc.
|
nodiscard0x8056F184 |
Definition at line 596 of file KartCollide.cc.
|
0x8056E8D4 |
Processes moving water and floor collision effects.
Definition at line 576 of file KartCollide.cc.
|
0x805730D4 |
Definition at line 44 of file KartCollide.cc.
|
inline |
Definition at line 135 of file KartCollide.hh.
|
inline |
Definition at line 146 of file KartCollide.hh.
|
inline |
Definition at line 143 of file KartCollide.hh.
|
inlinenodiscard |
Definition at line 184 of file KartCollide.hh.
|
inlinenodiscard |
Definition at line 176 of file KartCollide.hh.
|
0x805713D8 |
Definition at line 915 of file KartCollide.cc.
|
inlinenodiscard |
Definition at line 160 of file KartCollide.hh.
|
inlinenodiscard |
Definition at line 180 of file KartCollide.hh.
|
inlinenodiscard |
Definition at line 172 of file KartCollide.hh.
|
inlinenodiscard |
Definition at line 164 of file KartCollide.hh.
|
private |
Definition at line 196 of file KartCollide.hh.
|
private |
Definition at line 211 of file KartCollide.hh.
|
private |
Definition at line 197 of file KartCollide.hh.
|
private |
Definition at line 201 of file KartCollide.hh.
|
private |
Definition at line 209 of file KartCollide.hh.
|
private |
Definition at line 210 of file KartCollide.hh.
|
private |
Definition at line 202 of file KartCollide.hh.
|
private |
Definition at line 204 of file KartCollide.hh.
|
private |
Definition at line 203 of file KartCollide.hh.
|
private |
Definition at line 208 of file KartCollide.hh.
|
private |
Definition at line 206 of file KartCollide.hh.
|
private |
Definition at line 199 of file KartCollide.hh.
|
private |
Definition at line 207 of file KartCollide.hh.
|
private |
Definition at line 205 of file KartCollide.hh.
|
private |
Definition at line 200 of file KartCollide.hh.
|
private |
Definition at line 198 of file KartCollide.hh.
|
staticprivate |
Definition at line 213 of file KartCollide.hh.