3#include <egg/math/Math.hh>
8KartBody::KartBody(
KartPhysics *physics) : m_physics(physics) {
11 m_targetSinkDepth = 0.0f;
25 setParams(kartDisp, bikeDisp);
29void KartBody::reset() {
33 m_targetSinkDepth = 0.0f;
37void KartBody::calcSinkDepth() {
38 m_sinkDepth += (m_targetSinkDepth - m_sinkDepth) * 0.1f;
42void KartBody::trySetTargetSinkDepth(f32 val) {
43 m_targetSinkDepth = std::max(val, m_targetSinkDepth);
47void KartBody::calcTargetSinkDepth() {
48 m_targetSinkDepth = 3.0f *
static_cast<f32
>(collisionData().intensity);
52KartBodyKart::KartBodyKart(KartPhysics *physics) : KartBody(physics) {}
55KartBodyKart::~KartBodyKart() {
56 EGG::egg_delete(m_physics);
63KartBodyBike::~KartBodyBike() {
64 EGG::egg_delete(m_physics);
85 yRotMatrix.
makeR(yRotation);
97KartBodyQuacker::KartBodyQuacker(KartPhysics *physics) : KartBodyBike(physics) {}
99KartBodyQuacker::~KartBodyQuacker() =
default;
constexpr void makeR(const Vector3f &r)
Sets 3x3 rotation matrix from a vector of Euler angles.
constexpr Matrix34f multiplyTo(const Matrix34f &rhs) const
Multiplies two matrices.
EGG::Matrix34f wheelMatrix(u16 wheelIdx, const EGG::Matrix34f &bodyMat) override
Computes a matrix to represent the rotation of a wheel.
EGG::Vector3f m_handlePos
The relative position of the handlebar.
EGG::Matrix34f m_handleRotMat
The rotation of the handlebar.
EGG::Matrix34f wheelMatrix(u16 wheelIdx, const EGG::Matrix34f &bodyMat) override
virtual EGG::Matrix34f wheelMatrix(u16, const EGG::Matrix34f &bodyMat)
Computes a matrix to represent wheel rotation. For Karts, this is wheel-agnostic.
Manages the lifecycle of KartDynamics, handles moving floors and trick rotation.
Pertains to kart-related functionality.