40 f32 angle = EGG::Mathf::atan2(sin, cos);
41 angle = angle > 0.0f ? angle : -angle;
52 if (angle > minAngle) {
53 angle = 0.05f * (angle - 60.0f);
85 if (local_88.
y > 0.0f) {
102 f32 posScalar = 100.0f;
103 f32 radius = posScalar;
105 for (
size_t i = 0; i < 2; ++i) {
110 if (!colDir->checkSphereFullPush(radius, worldPos, worldUpPos,
KCL_TYPE_B0E82DFF, &colInfo,
135 f32 speedScalar = bVar15 ?
137 static_cast<f32>(
static_cast<f64>(EGG::Mathf::abs(
speed()) * 0.01f) - 0.3);
138 speedScalar = std::clamp(speedScalar, 0.0f, 1.0f);
141 colInfo.
tangentOff + radius * tangentOff + yOffset * tangentOff;
163 if (entry && entry->variant() == 0) {
171 if (mask & halfPipeInvisMask) {
172 if (colDir->findClosestCollisionEntry(&mask, halfPipeInvisMask)) {
@ COL_TYPE_HALFPIPE_INVISIBLE_WALL
Invisible wall after a half-pipe jump, like in BC.
#define KCL_TYPE_DRIVER_FLOOR
0x20E80DFF - Any KCL that the player can drive on.
#define KCL_TYPE_INVISIBLE_WALL
0x80002000
#define KCL_TYPE_B0E82DFF
0xB0E82DFF
constexpr bool offBit(Es... es) const
Checks if all of the corresponding bits for the provided enum values are off.
constexpr bool onBit(Es... es) const
Checks if any of the corresponding bits for the provided enum values are on.
constexpr TBitFlagExt< N, E > & resetBit(Es... es)
Resets the corresponding bits for the provided enum values.
constexpr TBitFlagExt< N, E > & setBit(Es... es)
Sets the corresponding bits for the provided enum values.
static CollisionDirector * Instance()
void setAngVel0(const EGG::Vector3f &v)
const EGG::Vector3f & pos() const
void setFullRot(const EGG::Quatf &q)
void setMainRot(const EGG::Quatf &q)
const EGG::Quatf & mainRot() const
const EGG::Vector3f & lastDir() const
const EGG::Vector3f & scale() const
void setUp(const EGG::Vector3f &v)
void setSmoothedUp(const EGG::Vector3f &v)
void setDir(const EGG::Vector3f &v)
void setVel1Dir(const EGG::Vector3f &v)
const EGG::Vector3f & up() const
const EGG::Vector3f & extVel() const
KartDynamics * dynamics()
const EGG::Vector3f & pos() const
EGG::Vector3f bodyUp() const
Returns the second column of the rotation matrix, which is the "up" direction.
const EGG::Vector3f & scale() const
void setPos(const EGG::Vector3f &pos)
const EGG::Quatf & mainRot() const
bool calcCollision(Field::CollisionInfo &colInfo, Field::KCLTypeMask mask, EGG::Vector3f &tangentOff)
Pertains to kart-related functionality.
@ RejectRoad
Collision which causes a change in the player's pos and rot.
@ HalfPipeRamp
Set while colliding with zipper KCL.
@ Hop
Set while we are in a drift hop. Clears when we land.
@ RejectRoadTrigger
e.g. DK Summit ending, and Maple Treeway side walls.
@ OverZipper
Set while mid-air from a zipper.
@ ZipperInvisibleWall
Set when colliding with invisible wall above a zipper.
A quaternion, used to represent 3D rotation.
constexpr void normalise()
Scales the quaternion to a unit length.
constexpr Vector3f rotateVector(const Vector3f &vec) const
Rotates a vector based on the quat.
static constexpr Quatf FromRPY(const EGG::Vector3f &rpy)
constexpr Quatf multSwap(const Vector3f &vec) const
static const Vector3f zero
constexpr f32 dot(const Vector3f &rhs) const
The dot product between two vectors.
constexpr f32 length() const
The square root of the vector's dot product.
constexpr f32 normalise()
Normalizes the vector and returns the original length.
constexpr Vector3f cross(const Vector3f &rhs) const
constexpr Vector3f perpInPlane(const EGG::Vector3f &rhs, bool normalise) const
Calculates the orthogonal vector, based on the plane defined by this vector and rhs.
Stores information pertaining to a collision.
EGG::Vector3f wallNrm
Colliding wall face's normal vector.
EGG::Vector3f tangentOff
The net "push out" vector.
EGG::Vector3f floorNrm
Colliding floor's up vector.