forked from zeldaret/oot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathz64math.h
71 lines (55 loc) · 983 Bytes
/
z64math.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef _Z64MATH_H_
#define _Z64MATH_H_
#include <ultra64.h>
#define VEC_SET(V,X,Y,Z) V.x=X;V.y=Y;V.z=Z
typedef struct {
f32 x, y;
} Vec2f;
typedef struct {
f32 x, y, z;
} Vec3f;
typedef struct {
s16 x, y, z;
} Vec3s;
typedef struct {
s32 x, y, z;
} Vec3i;
typedef struct {
Vec3s center;
s16 radius;
} Sphere16;
typedef struct {
Vec3f center;
f32 radius;
} Spheref;
typedef struct {
Vec3f normal;
f32 originDist;
} Plane;
typedef struct {
Vec3f vtx[3];
Plane plane;
} TriNorm; //size = 0x34
typedef struct {
s16 radius;
s16 height;
s16 yShift;
Vec3s pos;
} Cylinder16;
typedef struct {
f32 radius;
f32 height;
f32 yShift;
Vec3f pos;
} Cylinderf;
typedef struct {
Vec3f a;
Vec3f b;
} Linef;
// Defines a point in the spherical coordinate system
typedef struct {
f32 r; // radius
s16 phi; // polar (zenith) angle
s16 theta; // azimuthal angle
} VecSph;
#endif