Kinoko
A reimplementation of Mario Kart Wii's physics engine in C++
Toggle main menu visibility
Loading...
Searching...
No Matches
KartPullPath.hh
1
#pragma once
2
3
#include "game/kart/KartObjectProxy.hh"
4
5
#include "game/system/map/MapdataPointInfo.hh"
6
7
namespace
Kinoko::Kart
{
8
9
class
KartPullPath
;
10
13
class
KartPullPathTracker : KartObjectProxy {
14
public
:
15
enum class
Type {
16
Global,
17
Regional,
18
};
19
20
KartPullPathTracker(
KartPullPath
*handle, Type type);
21
~KartPullPathTracker();
22
23
void
calc();
24
25
void
setCurrentIdx(s16 idx) {
26
m_currentIdx = idx;
27
}
28
29
void
setPointInfo(
System::MapdataPointInfo
*info) {
30
m_pointInfo = info;
31
m_currentIdx = 0;
32
}
33
34
private
:
35
enum class
SearchDirection {
36
Current,
37
Next,
38
Previous,
39
};
40
41
void
calcTrackerGlobal();
42
void
calcTrackerRegional();
43
44
[[nodiscard]] f32
getDistance
(
const
EGG::Vector3f
&point,
const
EGG::Vector3f
&dir)
const
;
45
bool
search(SearchDirection searchDirection, s16 &idx,
EGG::Vector3f
&point,
46
EGG::Vector3f
&dir)
const
;
47
48
Type
m_type
;
49
s16 m_currentIdx;
50
System::MapdataPointInfo
*m_pointInfo;
51
KartPullPath
*m_handle;
52
};
53
56
class
KartPullPath : KartObjectProxy {
57
public
:
58
KartPullPath();
59
~KartPullPath();
60
61
void
init();
62
void
reset
();
63
void
calc();
64
void
changePoint(s16 idx, f32 distance);
65
67
void
resetDistance() {
68
m_distance = -1.0f;
69
}
70
71
[[nodiscard]] s16 incomingIdx()
const
{
72
return
m_incomingIdx;
73
}
74
75
[[nodiscard]]
const
EGG::Vector3f
&pullDirection()
const
{
76
return
m_pullDirection;
77
}
78
79
[[nodiscard]] f32 pullSpeed()
const
{
80
return
m_pullSpeed;
81
}
82
83
[[nodiscard]] f32 maxPullSpeed()
const
{
84
return
m_maxPullSpeed;
85
}
86
87
[[nodiscard]] f32 roadSpeedDecay()
const
{
88
return
m_roadSpeedDecay;
89
}
90
91
private
:
92
bool
calcArea();
93
void
calcPointChange();
94
void
calcTrackers();
95
[[nodiscard]]
EGG::Vector3f
getPullUnitNormal
()
const
;
96
void
setTrackerPointInfo(
System::MapdataPointInfo
*info);
97
98
f32 m_distance;
99
System::MapdataPointInfo
*m_pointInfo;
100
s16 m_incomingIdx;
101
s16 m_currentIdx;
102
EGG::Vector3f
m_pullDirection;
103
f32 m_pullSpeed;
104
f32 m_maxPullSpeed;
105
KartPullPathTracker
m_globalTracker;
106
KartPullPathTracker
m_regionalTracker;
107
f32 m_roadSpeedDecay;
108
s16 m_areaId;
109
};
110
111
}
// namespace Kinoko::Kart
Kinoko::Kart::KartPullPathTracker
Tracks the kart's progress along the pull path.
Definition
KartPullPath.hh:13
Kinoko::Kart::KartPullPathTracker::getDistance
f32 getDistance(const EGG::Vector3f &point, const EGG::Vector3f &dir) const
Gets the distance from the line formed by the point and direction.
Definition
KartPullPath.cc:68
Kinoko::Kart::KartPullPathTracker::m_type
Type m_type
Replaces inheritance for calc.
Definition
KartPullPath.hh:48
Kinoko::Kart::KartPullPath
Manages areas pulling the kart along a given path.
Definition
KartPullPath.hh:56
Kinoko::Kart::KartPullPath::reset
void reset()
Definition
KartPullPath.cc:160
Kinoko::Kart::KartPullPath::getPullUnitNormal
EGG::Vector3f getPullUnitNormal() const
Definition
KartPullPath.cc:267
Kinoko::System::MapdataPointInfo
Definition
MapdataPointInfo.hh:12
Kinoko::Kart
Pertains to kart-related functionality.
Definition
BoxColManager.hh:14
Kinoko::EGG::Vector3f
A 3D float vector.
Definition
Vector.hh:107
game
kart
KartPullPath.hh
Made by
Malleo
. Logo by
vabold
. Website generated by
Doxygen
1.17.0