Spyro 1 Reverse Engineering
Decompilation of functions from Spyro 1 into human readable C
 
Loading...
Searching...
No Matches
vector.h
Go to the documentation of this file.
1#ifndef VECTOR_H
2#define VECTOR_H
3
4
5//~~~~~~~
6//Structs
7//~~~~~~~
8typedef struct Vec3
9{
10 int x;
11 int y;
12 int z;
13}Vec3;
14
15typedef struct Vec2
16{
17 int x;
18 int y;
19
20}Vec2;
21
22typedef struct Vec3Padding
23{
24 int x;
25 int y;
26 int z;
29
30typedef struct Vec3_u16
31{
32 unsigned short x;
33 unsigned short y;
34 unsigned short z;
36
37typedef struct Vec3_u8
38{
39 unsigned char x;
40 unsigned char y;
41 unsigned char z;
42}Vec3_u8;
43
44
45typedef struct Vec2_u16
46{
47 unsigned short x;
48 unsigned short y;
50
51typedef struct Vec2_u8
52{
53 unsigned char x;
54 unsigned char y;
55}Vec2_u8;
56
57typedef struct Angle
58{
59 int yaw;
60 int pitch;
61 int roll;
62}Angle;
63
64typedef struct Angle_u16
65{
66 short yaw;
67 short pitch;
68 short roll;
70
71typedef struct SpyroHeadAngle
72{
73 short roll;
74 short pad1;
75
76 short pitch;
77 short pad2;
78
79 short yaw;
80 short pad3;
82
83typedef struct CameraAngle
84{
85 short roll;
86 short pitch;
87 short yaw;
89
90typedef struct Angle_u8
91{
92 char yaw;
93 char pitch;
94 char roll;
96
97typedef struct MATRIX3BY3
98{
99
100 short matrix[3][3];
101
103
104
105//~~~~~~~~~
106//In Game Functions
107//~~~~~~~~~
108
109void Vec3Subtract(Vec3* destVector, Vec3* a, Vec3* b);
110
111void Vec3Scale(Vec3* result, Vec3* vector, int multiplier); //Scales the s
112
113void Vec3ScaleDownByPowerOfTwo(Vec3* vector, unsigned int pot);
114
115void Vec3ScaleDownBy4(Vec3_u16 result, Vec3* source); //Scales down the source vector by 4, then stores it in a short vector.
116
117void Vec3ScaleByFractionPowerOfTwo(Vec3* param_1, int numerator, unsigned int denominatorExponent); //80017614
118void Vec3ScaleByFraction(Vec3* param_1, int denominator, int numerator);
119
120unsigned int Vec3CalculateLengthE(Vec3* vector, bool flag3D);
121
122void Vec3ApplyRotationMatrix(int* rotationMatrix, unsigned int* inputVector, int* outputVector);
123
124void MatrixTranspose(unsigned int *dest, unsigned int *src);
125
126void Vec3Swap(int *param_1,int *param_2);
127
128
129
130
131#endif /* VECTOR_H */
short roll
Definition vector.h:68
short pitch
Definition vector.h:67
short yaw
Definition vector.h:66
char pitch
Definition vector.h:93
char yaw
Definition vector.h:92
char roll
Definition vector.h:94
Definition vector.h:58
int roll
Definition vector.h:61
int pitch
Definition vector.h:60
int yaw
Definition vector.h:59
short roll
Definition vector.h:85
short pitch
Definition vector.h:86
short yaw
Definition vector.h:87
short matrix[3][3]
Definition vector.h:100
short roll
Definition vector.h:73
short yaw
Definition vector.h:79
short pad1
Definition vector.h:74
short pad2
Definition vector.h:77
short pad3
Definition vector.h:80
short pitch
Definition vector.h:76
unsigned short y
Definition vector.h:48
unsigned short x
Definition vector.h:47
unsigned char y
Definition vector.h:54
unsigned char x
Definition vector.h:53
Definition vector.h:16
int x
Definition vector.h:17
int y
Definition vector.h:18
unsigned short y
Definition vector.h:33
unsigned short x
Definition vector.h:32
unsigned short z
Definition vector.h:34
unsigned char x
Definition vector.h:39
unsigned char y
Definition vector.h:40
unsigned char z
Definition vector.h:41
Definition vector.h:9
int x
Definition vector.h:10
int y
Definition vector.h:11
int z
Definition vector.h:12
int padding
Definition vector.h:27
void Vec3ScaleDownBy4(Vec3_u16 result, Vec3 *source)
void Vec3ScaleByFractionPowerOfTwo(Vec3 *param_1, int numerator, unsigned int denominatorExponent)
void Vec3ScaleDownByPowerOfTwo(Vec3 *vector, unsigned int pot)
void Vec3Subtract(Vec3 *destVector, Vec3 *a, Vec3 *b)
void Vec3Scale(Vec3 *result, Vec3 *vector, int multiplier)
void Vec3ScaleByFraction(Vec3 *param_1, int denominator, int numerator)
void Vec3Swap(int *param_1, int *param_2)
void Vec3ApplyRotationMatrix(int *rotationMatrix, unsigned int *inputVector, int *outputVector)
void MatrixTranspose(unsigned int *dest, unsigned int *src)
Definition vector.c:68
unsigned int Vec3CalculateLengthE(Vec3 *vector, bool flag3D)