Initial Prey Game integration support.

This commit is contained in:
Justin Marshall
2026-05-05 15:01:01 -07:00
parent a6c6f1ed26
commit 8d5f678b25
552 changed files with 265551 additions and 209 deletions
+36
View File
@@ -213,6 +213,42 @@ idMat3 idVec3::ToMat3( void ) const {
return mat;
}
#ifdef PREY
// HUMANHEAD nla
/*
=============
idVec3::hhToMat3
=============
*/
idMat3 idVec3::hhToMat3(void) const {
idVec3 left;
idVec3 down;
// NormalVectors actually returns left and down
NormalVectors(left, down);
return idMat3(*this, left, -down);
}
// HUMANHEAD PDM: Vector conversion to/from axis aligned direction masks (6-bit vector compression)
int idVec3::DirectionMask() const {
int mask = 0;
for (int term = 0; term < 3; term++) {
mask += (*this)[term] < 0 ? 1 << (term << 1) : (*this)[term]>0 ? 1 << ((term << 1) + 1) : 0;
}
return mask;
}
idVec3::idVec3(int directionMask) {
int negativeMask, positiveMask;
for (int term = 0; term < 3; term++) {
negativeMask = 1 << (term << 1);
positiveMask = 1 << ((term << 1) + 1);
(*this)[term] = (directionMask & negativeMask) ? -1 : (directionMask & positiveMask) ? 1 : 0;
}
}
// HUMANHEAD END
#endif
/*
=============
idVec3::ToString