A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
KartTire.cc
1#include "KartTire.hh"
2
3namespace Kart {
4
6KartTire::KartTire(KartSuspensionPhysics::TireType tireType, u16 bspWheelIdx)
7 : m_tireType(tireType), m_bspWheelIdx(bspWheelIdx) {}
8
10KartTire::~KartTire() {
11 delete m_wheelPhysics;
12}
13
15void KartTire::createPhysics(u16 tireIdx) {
16 m_wheelPhysics = new WheelPhysics(tireIdx, 1);
17}
18
20void KartTire::init(u16 tireIdx) {
21 createPhysics(tireIdx);
22 m_wheelPhysics->init();
23}
24
26void KartTire::initBsp() {
27 m_wheelPhysics->initBsp();
28}
29
31KartTireFront::KartTireFront(KartSuspensionPhysics::TireType tireType, u16 bspWheelIdx)
32 : KartTire(tireType, bspWheelIdx) {}
33
35KartTireFront::~KartTireFront() = default;
36
38void KartTireFront::createPhysics(u16 tireIdx) {
39 m_wheelPhysics = new WheelPhysics(tireIdx, 0);
40}
41
42KartTireFrontBike::KartTireFrontBike(KartSuspensionPhysics::TireType tireType, u16 bspWheelIdx)
43 : KartTire(tireType, bspWheelIdx) {}
44
46KartTireFrontBike::~KartTireFrontBike() = default;
47
49void KartTireFrontBike::createPhysics(u16 tireIdx) {
50 m_wheelPhysics = new WheelPhysics(tireIdx, 0);
51}
52
53KartTireRearBike::KartTireRearBike(KartSuspensionPhysics::TireType tireType, u16 bspWheelIdx)
54 : KartTire(tireType, bspWheelIdx) {}
55
57KartTireRearBike::~KartTireRearBike() = default;
58
60void KartTireRearBike::createPhysics(u16 tireIdx) {
61 m_wheelPhysics = new WheelPhysics(tireIdx, 1);
62}
63
64} // namespace Kart
TireType
Every other kart tire is a mirror of the first. Bikes do not leverage this.
Pertains to kart-related functionality.