#include <math.h>
#include "quakedef.h"
-void Sys_Error (char *error, ...);
-
vec3_t vec3_origin = {0,0,0};
float ixtable[4096];
{-0.500000, 0.809017, -0.309017}, {-0.525731, 0.850651, 0.000000},
{0.000000, 0.850651, -0.525731}, {-0.238856, 0.864188, -0.442863},
{0.000000, 0.955423, -0.295242}, {-0.262866, 0.951056, -0.162460},
-{0.000000, 1.000000, 0.000000}, {0.000000, 0.955423, 0.295242},
+{0.000000, 1.000000, 0.000000}, {0.000000, 0.955423, 0.295242},
{-0.262866, 0.951056, 0.162460}, {0.238856, 0.864188, 0.442863},
{0.262866, 0.951056, 0.162460}, {0.500000, 0.809017, 0.309017},
{0.238856, 0.864188, -0.442863}, {0.262866, 0.951056, -0.162460},
{0.716567, 0.681718, 0.147621}, {0.716567, 0.681718, -0.147621},
{0.525731, 0.850651, 0.000000}, {0.425325, 0.688191, 0.587785},
{0.864188, 0.442863, 0.238856}, {0.688191, 0.587785, 0.425325},
-{0.809017, 0.309017, 0.500000}, {0.681718, 0.147621, 0.716567},
+{0.809017, 0.309017, 0.500000}, {0.681718, 0.147621, 0.716567},
{0.587785, 0.425325, 0.688191}, {0.955423, 0.295242, 0.000000},
{1.000000, 0.000000, 0.000000}, {0.951056, 0.162460, 0.262866},
{0.850651, -0.525731, 0.000000}, {0.955423, -0.295242, 0.000000},
{0.309017, 0.500000, -0.809017}, {0.425325, 0.688191, -0.587785},
{0.442863, 0.238856, -0.864188}, {0.587785, 0.425325, -0.688191},
{0.688191, 0.587785, -0.425325}, {-0.147621, 0.716567, -0.681718},
-{-0.309017, 0.500000, -0.809017}, {0.000000, 0.525731, -0.850651},
-{-0.525731, 0.000000, -0.850651}, {-0.442863, 0.238856, -0.864188},
+{-0.309017, 0.500000, -0.809017}, {0.000000, 0.525731, -0.850651},
+{-0.525731, 0.000000, -0.850651}, {-0.442863, 0.238856, -0.864188},
{-0.295242, 0.000000, -0.955423}, {-0.162460, 0.262866, -0.951056},
{0.000000, 0.000000, -1.000000}, {0.295242, 0.000000, -0.955423},
{0.162460, 0.262866, -0.951056}, {-0.442863, -0.238856, -0.864188},
{-0.500000, -0.809017, 0.309017}, {-0.238856, -0.864188, 0.442863},
{-0.262866, -0.951056, 0.162460}, {-0.864188, -0.442863, 0.238856},
{-0.809017, -0.309017, 0.500000}, {-0.688191, -0.587785, 0.425325},
-{-0.681718, -0.147621, 0.716567}, {-0.442863, -0.238856, 0.864188},
-{-0.587785, -0.425325, 0.688191}, {-0.309017, -0.500000, 0.809017},
-{-0.147621, -0.716567, 0.681718}, {-0.425325, -0.688191, 0.587785},
-{-0.162460, -0.262866, 0.951056}, {0.442863, -0.238856, 0.864188},
-{0.162460, -0.262866, 0.951056}, {0.309017, -0.500000, 0.809017},
-{0.147621, -0.716567, 0.681718}, {0.000000, -0.525731, 0.850651},
-{0.425325, -0.688191, 0.587785}, {0.587785, -0.425325, 0.688191},
-{0.688191, -0.587785, 0.425325}, {-0.955423, 0.295242, 0.000000},
-{-0.951056, 0.162460, 0.262866}, {-1.000000, 0.000000, 0.000000},
-{-0.850651, 0.000000, 0.525731}, {-0.955423, -0.295242, 0.000000},
-{-0.951056, -0.162460, 0.262866}, {-0.864188, 0.442863, -0.238856},
-{-0.951056, 0.162460, -0.262866}, {-0.809017, 0.309017, -0.500000},
+{-0.681718, -0.147621, 0.716567}, {-0.442863, -0.238856, 0.864188},
+{-0.587785, -0.425325, 0.688191}, {-0.309017, -0.500000, 0.809017},
+{-0.147621, -0.716567, 0.681718}, {-0.425325, -0.688191, 0.587785},
+{-0.162460, -0.262866, 0.951056}, {0.442863, -0.238856, 0.864188},
+{0.162460, -0.262866, 0.951056}, {0.309017, -0.500000, 0.809017},
+{0.147621, -0.716567, 0.681718}, {0.000000, -0.525731, 0.850651},
+{0.425325, -0.688191, 0.587785}, {0.587785, -0.425325, 0.688191},
+{0.688191, -0.587785, 0.425325}, {-0.955423, 0.295242, 0.000000},
+{-0.951056, 0.162460, 0.262866}, {-1.000000, 0.000000, 0.000000},
+{-0.850651, 0.000000, 0.525731}, {-0.955423, -0.295242, 0.000000},
+{-0.951056, -0.162460, 0.262866}, {-0.864188, 0.442863, -0.238856},
+{-0.951056, 0.162460, -0.262866}, {-0.809017, 0.309017, -0.500000},
{-0.864188, -0.442863, -0.238856}, {-0.951056, -0.162460, -0.262866},
{-0.809017, -0.309017, -0.500000}, {-0.681718, 0.147621, -0.716567},
-{-0.681718, -0.147621, -0.716567}, {-0.850651, 0.000000, -0.525731},
-{-0.688191, 0.587785, -0.425325}, {-0.587785, 0.425325, -0.688191},
-{-0.425325, 0.688191, -0.587785}, {-0.425325, -0.688191, -0.587785},
-{-0.587785, -0.425325, -0.688191}, {-0.688191, -0.587785, -0.425325},
+{-0.681718, -0.147621, -0.716567}, {-0.850651, 0.000000, -0.525731},
+{-0.688191, 0.587785, -0.425325}, {-0.587785, 0.425325, -0.688191},
+{-0.425325, 0.688191, -0.587785}, {-0.425325, -0.688191, -0.587785},
+{-0.587785, -0.425325, -0.688191}, {-0.688191, -0.587785, -0.425325},
};
qbyte NormalToByte(const vec3_t n)
void PerpendicularVector( vec3_t dst, const vec3_t src )
{
// LordHavoc: optimized to death and beyond
- int pos;
+ int pos;
float minelem;
if (src[0])
void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point, float degrees )
{
- float t0, t1;
- float angle, c, s;
- vec3_t vr, vu, vf;
+ float t0, t1;
+ float angle, c, s;
+ vec3_t vr, vu, vf;
angle = DEG2RAD(degrees);
}
-// LordHavoc: renamed these to Length, and made the normal ones #define
+// LordHavoc: renamed this to Length, and made the normal one a #define
float VectorNormalizeLength (vec3_t v)
{
- float length, ilength;
+ float length, ilength;
length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
- length = sqrt (length); // FIXME
+ length = sqrt (length);
if (length)
{
*/
void R_ConcatRotations (const float in1[3*3], const float in2[3*3], float out[3*3])
{
- out[0*3+ 0] = in1[0*3+0] * in2[0*3+0] + in1[0*3+1] * in2[1*3+0] + in1[0*3+2] * in2[2*3+0];
- out[0*3+ 1] = in1[0*3+0] * in2[0*3+1] + in1[0*3+1] * in2[1*3+1] + in1[0*3+2] * in2[2*3+1];
- out[0*3+ 2] = in1[0*3+0] * in2[0*3+2] + in1[0*3+1] * in2[1*3+2] + in1[0*3+2] * in2[2*3+2];
- out[1*3+ 0] = in1[1*3+0] * in2[0*3+0] + in1[1*3+1] * in2[1*3+0] + in1[1*3+2] * in2[2*3+0];
- out[1*3+ 1] = in1[1*3+0] * in2[0*3+1] + in1[1*3+1] * in2[1*3+1] + in1[1*3+2] * in2[2*3+1];
- out[1*3+ 2] = in1[1*3+0] * in2[0*3+2] + in1[1*3+1] * in2[1*3+2] + in1[1*3+2] * in2[2*3+2];
- out[2*3+ 0] = in1[2*3+0] * in2[0*3+0] + in1[2*3+1] * in2[1*3+0] + in1[2*3+2] * in2[2*3+0];
- out[2*3+ 1] = in1[2*3+0] * in2[0*3+1] + in1[2*3+1] * in2[1*3+1] + in1[2*3+2] * in2[2*3+1];
- out[2*3+ 2] = in1[2*3+0] * in2[0*3+2] + in1[2*3+1] * in2[1*3+2] + in1[2*3+2] * in2[2*3+2];
+ out[0*3+0] = in1[0*3+0] * in2[0*3+0] + in1[0*3+1] * in2[1*3+0] + in1[0*3+2] * in2[2*3+0];
+ out[0*3+1] = in1[0*3+0] * in2[0*3+1] + in1[0*3+1] * in2[1*3+1] + in1[0*3+2] * in2[2*3+1];
+ out[0*3+2] = in1[0*3+0] * in2[0*3+2] + in1[0*3+1] * in2[1*3+2] + in1[0*3+2] * in2[2*3+2];
+ out[1*3+0] = in1[1*3+0] * in2[0*3+0] + in1[1*3+1] * in2[1*3+0] + in1[1*3+2] * in2[2*3+0];
+ out[1*3+1] = in1[1*3+0] * in2[0*3+1] + in1[1*3+1] * in2[1*3+1] + in1[1*3+2] * in2[2*3+1];
+ out[1*3+2] = in1[1*3+0] * in2[0*3+2] + in1[1*3+1] * in2[1*3+2] + in1[1*3+2] * in2[2*3+2];
+ out[2*3+0] = in1[2*3+0] * in2[0*3+0] + in1[2*3+1] * in2[1*3+0] + in1[2*3+2] * in2[2*3+0];
+ out[2*3+1] = in1[2*3+0] * in2[0*3+1] + in1[2*3+1] * in2[1*3+1] + in1[2*3+2] * in2[2*3+1];
+ out[2*3+2] = in1[2*3+0] * in2[0*3+2] + in1[2*3+1] * in2[1*3+2] + in1[2*3+2] * in2[2*3+2];
}