OpenMoHAA 0.82.1
Loading...
Searching...
No Matches
gt2aMath.h
1/*
2GameSpy GT2 SDK
3GT2Action - sample app
4Dan "Mr. Pants" Schoenblum
5dan@gamespy.com
6
7Copyright 2000 GameSpy Industries, Inc
8
9*/
10
11#ifndef _GT2AMATH_H_
12#define _GT2AMATH_H_
13
14#include <stdlib.h>
15#include "gt2aMain.h"
16
17byte * CopyV3b
18(
19 V3b dest,
20 const V3b src
21);
22
23byte * SetV3b
24(
25 V3b dest,
26 byte src0,
27 byte src1,
28 byte src2
29);
30
31float * CopyV2f
32(
33 V2f dest,
34 const V2f src
35);
36
37float * SetV2f
38(
39 V2f dest,
40 float src0,
41 float src1
42);
43
44float * ScaleV2f
45(
46 V2f dest,
47 const V2f src,
48 float scale
49);
50
51float * AddV2f
52(
53 V2f dest,
54 const V2f src0,
55 const V2f src1
56);
57
58float * SubV2f
59(
60 V2f dest,
61 const V2f src0,
62 const V2f src1
63);
64
65float * SubScalarV2f
66(
67 V2f dest,
68 const V2f src,
69 float scalar
70);
71
72float LenV2f
73(
74 const V2f src
75);
76
77float DistanceV2f
78(
79 const V2f src0,
80 const V2f src1
81);
82
83float * ClampV2f
84(
85 V2f dest,
86 const V2f src,
87 float min,
88 float max
89);
90
91float ClampRotation
92(
93 float rotation
94);
95
96int ClampInt
97(
98 int num,
99 int min,
100 int max
101);
102
103float * RotationToVector
104(
105 V2f dest,
106 float rotation
107);
108
109float * ComputeNewPosition
110(
111 V2f dest,
112 const V2f position,
113 int motion,
114 float rotation,
115 unsigned long diff,
116 int unitsPerMilliSec,
117 GT2Bool clamp
118);
119
120float ComputeNewRotation
121(
122 float rotation,
123 int turning,
124 unsigned long diff,
125 float degreesPerMilliSec
126);
127
128float RandomFloat
129(
130 float minFloat,
131 float maxFloat,
132 GT2Bool maxInclusive
133);
134
135int RandomInt
136(
137 int minInt,
138 int maxInt
139);
140
141unsigned short RotationToUnsignedShort
142(
143 float rotation
144);
145
146float UnsignedShortToRotation
147(
148 unsigned short packedRotation
149);
150
151unsigned short PositionToUnsignedShort
152(
153 float position
154);
155
156float UnsignedShortToPosition
157(
158 unsigned short packedPosition
159);
160
161#endif