// assumes "src" is normalized
void PerpendicularVector( vec3_t dst, const vec3_t src )
{
- // LordHavoc: optimized to death and beyond
+ // LadyHavoc: optimized to death and beyond
int pos;
float minelem;
#endif
-// LordHavoc: like AngleVectors, but taking a forward vector instead of angles, useful!
+// LadyHavoc: like AngleVectors, but taking a forward vector instead of angles, useful!
void VectorVectors(const vec3_t forward, vec3_t right, vec3_t up)
{
// NOTE: this is consistent to AngleVectors applied to AnglesFromVectors
}
}
-// LordHavoc: calculates pitch/yaw/roll angles from forward and up vectors
-void AnglesFromVectors (vec3_t angles, const vec3_t forward, const vec3_t up, qboolean flippitch)
+// LadyHavoc: calculates pitch/yaw/roll angles from forward and up vectors
+void AnglesFromVectors (vec3_t angles, const vec3_t forward, const vec3_t up, qbool flippitch)
{
if (forward[0] == 0 && forward[1] == 0)
{
#endif
-// LordHavoc: renamed this to Length, and made the normal one a #define
+// LadyHavoc: renamed this to Length, and made the normal one a #define
float VectorNormalizeLength (vec3_t v)
{
- float length, ilength;
+ float length;
- length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
- length = sqrt (length);
+ length = sqrt(DotProduct(v,v));
if (length)
- {
- ilength = 1/length;
- v[0] *= ilength;
- v[1] *= ilength;
- v[2] *= ilength;
- }
+ VectorScale(v, 1 / length, v);
return length;
-
}
{
int a;
- // LordHavoc: setup 1.0f / N table for quick recipricols of integers
+ // LadyHavoc: setup 1.0f / N table for quick recipricols of integers
ixtable[0] = 0;
for (a = 1;a < 4096;a++)
ixtable[a] = 1.0f / a;
}
}
-// LordHavoc: this has to be done right or you get severe precision breakdown
+// LadyHavoc: this has to be done right or you get severe precision breakdown
int LoopingFrameNumberFromDouble(double t, int loopframes)
{
if (loopframes)
static void mul128(const unsigned int a[], const unsigned int b[], unsigned int dest[4])
{
-#if defined(__GNUC__) && defined(__x86_64__)
+#if 0 //defined(__GNUC__) && defined(__x86_64__)
unsigned __int128 ia = ((__int128)a[0] << 96) | ((__int128)a[1] << 64) | ((__int128)a[2] << 32) | (a[3]);
unsigned __int128 ib = ((__int128)b[0] << 96) | ((__int128)b[1] << 64) | ((__int128)b[2] << 32) | (b[3]);
unsigned __int128 id = ia * ib;