3#include <egg/math/Math.hh>
8KartBody::KartBody(KartPhysics *physics) : m_physics(physics) {
11 m_targetSinkDepth = 0.0f;
18 mat.
makeQT(fullRot(), pos());
23void KartBody::reset() {
27 m_targetSinkDepth = 0.0f;
31void KartBody::calcSinkDepth() {
32 m_sinkDepth += (m_targetSinkDepth - m_sinkDepth) * 0.1f;
36void KartBody::trySetTargetSinkDepth(f32 val) {
37 m_targetSinkDepth = std::max(val, m_targetSinkDepth);
41void KartBody::calcTargetSinkDepth() {
42 m_targetSinkDepth = 3.0f *
static_cast<f32
>(collisionData().intensity);
46KartBodyKart::KartBodyKart(KartPhysics *physics) : KartBody(physics) {}
49KartBodyKart::~KartBodyKart() {
54KartBodyBike::KartBodyBike(KartPhysics *physics) : KartBody(physics) {}
57KartBodyBike::~KartBodyBike() {
69 mat.
makeQT(fullRot(), pos());
74 EGG::Vector3f position = param()->bikeDisp().m_handlePos * scale();
75 EGG::Vector3f rotation = DEG2RAD * param()->bikeDisp().m_handleRot;
78 handleMatrix.
makeRT(rotation, position);
83 yRotMatrix.
makeR(yRotation);
91KartBodyQuacker::~KartBodyQuacker() =
default;
95 mat.
makeQT(fullRot(), pos());
Matrix34f multiplyTo(const Matrix34f &rhs) const
Multiplies two matrices.
void makeR(const Vector3f &r)
Sets 3x3 rotation matrix from a vector of Euler angles.
void makeRT(const Vector3f &r, const Vector3f &t)
Sets rotation-translation matrix.
void makeQT(const Quatf &q, const Vector3f &t)
Sets matrix from rotation and position.
EGG::Matrix34f wheelMatrix(u16 wheelIdx) override
Computes a matrix to represent the rotation of a wheel.
EGG::Matrix34f wheelMatrix(u16 wheelIdx) override
Computes a matrix to represent the rotation of a wheel.
Manages the lifecycle of KartDynamics, handles moving floors and trick rotation.
Pertains to kart-related functionality.