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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
/*
GameSpy GT2 SDK
GT2Action - sample app
Dan "Mr. Pants" Schoenblum
dan@gamespy.com
Copyright 2000 GameSpy Industries, Inc
*/
#ifndef _GT2AMATH_H_
#define _GT2AMATH_H_
#include <stdlib.h>
#include "gt2aMain.h"
byte * CopyV3b
(
V3b dest,
const V3b src
);
byte * SetV3b
(
V3b dest,
byte src0,
byte src1,
byte src2
);
float * CopyV2f
(
V2f dest,
const V2f src
);
float * SetV2f
(
V2f dest,
float src0,
float src1
);
float * ScaleV2f
(
V2f dest,
const V2f src,
float scale
);
float * AddV2f
(
V2f dest,
const V2f src0,
const V2f src1
);
float * SubV2f
(
V2f dest,
const V2f src0,
const V2f src1
);
float * SubScalarV2f
(
V2f dest,
const V2f src,
float scalar
);
float LenV2f
(
const V2f src
);
float DistanceV2f
(
const V2f src0,
const V2f src1
);
float * ClampV2f
(
V2f dest,
const V2f src,
float min,
float max
);
float ClampRotation
(
float rotation
);
int ClampInt
(
int num,
int min,
int max
);
float * RotationToVector
(
V2f dest,
float rotation
);
float * ComputeNewPosition
(
V2f dest,
const V2f position,
int motion,
float rotation,
unsigned long diff,
int unitsPerMilliSec,
GT2Bool clamp
);
float ComputeNewRotation
(
float rotation,
int turning,
unsigned long diff,
float degreesPerMilliSec
);
float RandomFloat
(
float minFloat,
float maxFloat,
GT2Bool maxInclusive
);
int RandomInt
(
int minInt,
int maxInt
);
unsigned short RotationToUnsignedShort
(
float rotation
);
float UnsignedShortToRotation
(
unsigned short packedRotation
);
unsigned short PositionToUnsignedShort
(
float position
);
float UnsignedShortToPosition
(
unsigned short packedPosition
);
#endif
|