mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-16 08:10:32 +02:00
Initial Prey Game integration support.
This commit is contained in:
@@ -313,6 +313,18 @@ ID_INLINE float *idVec2::ToFloatPtr( void ) {
|
||||
//
|
||||
//===============================================================
|
||||
|
||||
#ifdef PREY
|
||||
// HUMANHEAD pdm: support for 6 bit vector compression, direction masks
|
||||
#define INDEX_IN_MASK(mask, index) ( ((mask) & (1<<(index)) ) != 0 )
|
||||
#define MASK_NEGX 0x0001
|
||||
#define MASK_POSX 0x0002
|
||||
#define MASK_NEGY 0x0004
|
||||
#define MASK_POSY 0x0008
|
||||
#define MASK_NEGZ 0x0010
|
||||
#define MASK_POSZ 0x0020
|
||||
// HUMANHEAD END
|
||||
#endif
|
||||
|
||||
class idVec3 {
|
||||
public:
|
||||
float x;
|
||||
@@ -384,11 +396,29 @@ public:
|
||||
|
||||
void Lerp( const idVec3 &v1, const idVec3 &v2, const float l );
|
||||
void SLerp( const idVec3 &v1, const idVec3 &v2, const float l );
|
||||
|
||||
idVec3 ToNormal() const;
|
||||
#ifdef PREY
|
||||
// HUMANHEAD nla - Returns a Mat3 with Z up instead of down
|
||||
idMat3 hhToMat3(void) const; // vector should be normalized
|
||||
int DirectionMask() const; // calculate direction bitmask
|
||||
idVec3(int directionMask); // construct from direction bitmask
|
||||
// HUMANHEAD END
|
||||
#endif
|
||||
};
|
||||
|
||||
extern idVec3 vec3_origin;
|
||||
#define vec3_zero vec3_origin
|
||||
|
||||
|
||||
ID_INLINE idVec3 idVec3::ToNormal() const {
|
||||
float sqrLength, invLength;
|
||||
|
||||
sqrLength = x * x + y * y + z * z;
|
||||
invLength = idMath::InvSqrt(sqrLength);
|
||||
return *this * invLength;
|
||||
}
|
||||
|
||||
ID_INLINE idVec3::idVec3( void ) {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user