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/*
7These are some very good videos about splines/Bezier curves in general
8
9The Beauty of Bezier Curves
10https://www.youtube.com/watch?v=aVwxzDHniEw
11
12The Continuity of Splines
13https://www.youtube.com/watch?v=jvPPXbo87ds
14*/
15
16/*
17This stuff is all about the b-splines used objects like Lakitu and the Boos on Banshee Boardwalk
18For splines used during the award ceremony and credits, see src/ending/ceremony_and_credits.h
19*/
20
21typedef 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
31typedef 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.
35 // This has to be an array for this to work, so just make it size 1
36 SplineControlPoint controlPoints[1];
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
45typedef struct {
47 SplineControlPoint controlPoints[23];
49
50// Ghosts in BansheeBoardwalk x 2
51// Seagulls in KoopaTroopaBeach x 1
52typedef struct {
54 SplineControlPoint controlPoints[24];
56
57
58// Ghosts in BansheeBoardwalk x 1
59// Seagulls in KoopaTroopaBeach x 1
60// Penguins in Sherbet Land x 1
61typedef struct {
63 SplineControlPoint controlPoints[25];
65
66// Data of this type is unreferenced or only referenced in an unused function
67typedef struct {
69 SplineControlPoint controlPoints[4];
71
72// Lakitu Countdown
73typedef struct {
75 SplineControlPoint controlPoints[15];
77
78// Lakitu Checkered Flag
79typedef struct {
81 SplineControlPoint controlPoints[21];
83
84typedef struct {
86 SplineControlPoint controlPoints[13];
88
89// Lakitu Second/Final Lap
90typedef struct {
92 SplineControlPoint controlPoints[12];
94
95// Lakitu Reverse
96typedef struct {
98 SplineControlPoint controlPoints[8];
100
101#endif
s16 Vec3s[3]
Definition common_structs.h:11
Definition spline.h:21
s16 velocity
Definition spline.h:25
Vec3s pos
Definition spline.h:22
Definition spline.h:90
s16 numControlPoints
Definition spline.h:91
Definition spline.h:73
s16 numControlPoints
Definition spline.h:74
Definition spline.h:79
s16 numControlPoints
Definition spline.h:80
Definition spline.h:45
s16 numControlPoints
Definition spline.h:46
Definition spline.h:52
s16 numControlPoints
Definition spline.h:53
Definition spline.h:61
s16 numControlPoints
Definition spline.h:62
Definition spline.h:96
s16 numControlPoints
Definition spline.h:97
Definition spline.h:84
s16 numControlPoints
Definition spline.h:85
Definition spline.h:67
s16 numControlPoints
Definition spline.h:68
Definition spline.h:31
s16 numControlPoints
Definition spline.h:34
signed short int s16
Definition ultratypes.h:13