Mario Kart 64
Loading...
Searching...
No Matches
spline.h
Go to the documentation of this file.
1
#ifndef SPLINE_H
2
#define SPLINE_H
3
4
#include "
common_structs.h
"
5
6
/*
7
These are some very good videos about splines/Bezier curves in general
8
9
The Beauty of Bezier Curves
10
https://www.youtube.com/watch?v=aVwxzDHniEw
11
12
The Continuity of Splines
13
https://www.youtube.com/watch?v=jvPPXbo87ds
14
*/
15
16
/*
17
This stuff is all about the b-splines used objects like Lakitu and the Boos on Banshee Boardwalk
18
For splines used during the award ceremony and credits, see src/ending/ceremony_and_credits.h
19
*/
20
21
typedef
struct
{
22
/* 0x0 */
Vec3s
pos
;
23
// Don't really know what to call this member.
24
// It somehow controls the speed of travel along a segment of the spline but I don't really get how it works
25
/* 0x6 */
s16
velocity
;
26
}
SplineControlPoint
;
// size = 0x8
27
28
// WARNING!!!
29
// You really, really shouldn't use this type for actual spline data. This is intended as a generic SplineData
30
// type. I would use a union, but that would cause significant ugliness elsewhere in the codebase
31
typedef
struct
{
32
// This name is a little misleading
33
// The control point arrays have more control points in them than this number indicates. Not sure why though.
34
s16
numControlPoints
;
35
// This has to be an array for this to work, so just make it size 1
36
SplineControlPoint
controlPoints[1];
37
}
SplineData
;
38
39
// All other SplineDataXX types are for use as data only. The size of the array in them matters a lot.
40
// But object structs should never have members with these types, just use the plain SplineData type
41
42
// Ghosts in BansheeBoardwalk x 2
43
// Seagulls in KoopaTroopaBeach x 2
44
// Penguins in Sherbet Land x 1
45
typedef
struct
{
46
s16
numControlPoints
;
47
SplineControlPoint
controlPoints[23];
48
}
SplineData23
;
49
50
// Ghosts in BansheeBoardwalk x 2
51
// Seagulls in KoopaTroopaBeach x 1
52
typedef
struct
{
53
s16
numControlPoints
;
54
SplineControlPoint
controlPoints[24];
55
}
SplineData24
;
56
57
58
// Ghosts in BansheeBoardwalk x 1
59
// Seagulls in KoopaTroopaBeach x 1
60
// Penguins in Sherbet Land x 1
61
typedef
struct
{
62
s16
numControlPoints
;
63
SplineControlPoint
controlPoints[25];
64
}
SplineData25
;
65
66
// Data of this type is unreferenced or only referenced in an unused function
67
typedef
struct
{
68
s16
numControlPoints
;
69
SplineControlPoint
controlPoints[4];
70
}
SplineDataUnused4
;
71
72
// Lakitu Countdown
73
typedef
struct
{
74
s16
numControlPoints
;
75
SplineControlPoint
controlPoints[15];
76
}
SplineData15
;
77
78
// Lakitu Checkered Flag
79
typedef
struct
{
80
s16
numControlPoints
;
81
SplineControlPoint
controlPoints[21];
82
}
SplineData21
;
83
84
typedef
struct
{
85
s16
numControlPoints
;
86
SplineControlPoint
controlPoints[13];
87
}
SplineDataUnused13
;
88
89
// Lakitu Second/Final Lap
90
typedef
struct
{
91
s16
numControlPoints
;
92
SplineControlPoint
controlPoints[12];
93
}
SplineData12
;
94
95
// Lakitu Reverse
96
typedef
struct
{
97
s16
numControlPoints
;
98
SplineControlPoint
controlPoints[8];
99
}
SplineData8
;
100
101
#endif
common_structs.h
Vec3s
s16 Vec3s[3]
Definition
common_structs.h:11
SplineControlPoint
Definition
spline.h:21
SplineControlPoint::velocity
s16 velocity
Definition
spline.h:25
SplineControlPoint::pos
Vec3s pos
Definition
spline.h:22
SplineData12
Definition
spline.h:90
SplineData12::numControlPoints
s16 numControlPoints
Definition
spline.h:91
SplineData15
Definition
spline.h:73
SplineData15::numControlPoints
s16 numControlPoints
Definition
spline.h:74
SplineData21
Definition
spline.h:79
SplineData21::numControlPoints
s16 numControlPoints
Definition
spline.h:80
SplineData23
Definition
spline.h:45
SplineData23::numControlPoints
s16 numControlPoints
Definition
spline.h:46
SplineData24
Definition
spline.h:52
SplineData24::numControlPoints
s16 numControlPoints
Definition
spline.h:53
SplineData25
Definition
spline.h:61
SplineData25::numControlPoints
s16 numControlPoints
Definition
spline.h:62
SplineData8
Definition
spline.h:96
SplineData8::numControlPoints
s16 numControlPoints
Definition
spline.h:97
SplineDataUnused13
Definition
spline.h:84
SplineDataUnused13::numControlPoints
s16 numControlPoints
Definition
spline.h:85
SplineDataUnused4
Definition
spline.h:67
SplineDataUnused4::numControlPoints
s16 numControlPoints
Definition
spline.h:68
SplineData
Definition
spline.h:31
SplineData::numControlPoints
s16 numControlPoints
Definition
spline.h:34
s16
signed short int s16
Definition
ultratypes.h:13
include
spline.h
Generated by
1.10.0