mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-15 07:40:44 +02:00
Initial Prey Game integration support.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user