// RNQUERY_OBJECTS_STATIC | RNQUERY_OBJECTS_KEYFRAMED (0x3) is used in
// when decoy hit entity isn't player pawn
// RNQUERY_OBJECTS_KEYFRAMED | RNQUERY_OBJECTS_DYNAMIC (0x6) is used in
// checking if a grenade projectile has hit any player
// filtering bullet trace result
// checking if hit entity is a *_door_rotating
// checking if player is aiming at a CPointCommentaryNode
// RNQUERY_OBJECTS_LOCATABLE (0x8) is used in
// checking if a CSmokeGrenadeProjectile is exploded from inferno
// CGamePhysicsQueryInterface::EntitiesAlong* to add g_LocatableEntities to results
// RNQUERY_OBJECTS_KEYFRAMED | RNQUERY_OBJECTS_DYNAMIC | RNQUERY_OBJECTS_LOCATABLE (0xE) is used in
// CBotBreakableEnumerator
// CInferno::Think damage
// CBombTarget
// UTIL_EntitiesAlongRay
// CEnvShake::ApplyShake with type rumble
// CBaseFilter Think
// RNQUERY_OBJECTS_STATIC | RNQUERY_OBJECTS_KEYFRAMED | RNQUERY_OBJECTS_DYNAMIC | RNQUERY_OBJECTS_LOCATABLE (0xF) is used in pretty much every trace filter
RNQUERY_OBJECTS_STATIC=(1<<0),// static body
RNQUERY_OBJECTS_KEYFRAMED=(1<<1),// keyframed body
// Which interaction layers do I interact or collide with? (e.g. I collide with LAYER_INDEX_CONTENTS_PASS_BULLETS because I am not a bullet)
// NOTE: This is analogous to the "solid mask" or "trace mask" in source 1 (bit mask of CONTENTS_* or 1<<LAYER_INDEX_*)
uint64m_nInteractsWith;
// Which interaction layers do I _not_ interact or collide with? If my exclusion layers match m_nInteractsAs on the other object then no interaction happens.
uint64m_nInteractsExclude;
// Which interaction layers do I represent? (e.g. I am a LAYER_INDEX_CONTENTS_PLAYER_CLIP volume)
// NOTE: This is analogous to "contents" in source 1 (bit mask of CONTENTS_* or 1<<LAYER_INDEX_*)
uint64m_nInteractsAs;
uint32m_nEntityIdsToIgnore[2];// this is the ID of the game entity which should be ignored
uint32m_nOwnerIdsToIgnore[2];// this is the ID of the owner of the game entity which should be ignored
uint16m_nHierarchyIds[2];// this is an ID for the hierarchy of game entities (used to disable collision among objects in a hierarchy)
// Which interaction layers do I represent? (e.g. I am a LAYER_INDEX_CONTENTS_PLAYER_CLIP volume)
// NOTE: This is analogous to "contents" in source 1 (bit mask of CONTENTS_* or 1<<LAYER_INDEX_*)
uint64m_nInteractsAs;
// Which interaction layers do I interact or collide with? (e.g. I collide with LAYER_INDEX_CONTENTS_PASS_BULLETS because I am not a bullet)
// NOTE: This is analogous to the "solid mask" or "trace mask" in source 1 (bit mask of CONTENTS_* or 1<<LAYER_INDEX_*)
uint64m_nInteractsWith;
// Which interaction layers do I _not_ interact or collide with? If my exclusion layers match m_nInteractsAs on the other object then no interaction happens.
uint64m_nInteractsExclude;
uint32m_nEntityId;// this is the ID of the game entity
uint32m_nOwnerId;// this is the ID of the owner of the game entity
uint16m_nHierarchyId;// this is an ID for the hierarchy of game entities (used to disable collision among objects in a hierarchy)
uint8m_nCollisionGroup;// one of the registered collision groups
uint8m_nCollisionFunctionMask;// set of CollisionFunctionMask_t bits
};
classCGameTrace
{
public:
CGameTrace()
{
Init();
}
voidInit()
{
m_pSurfaceProperties=NULL;
m_pEnt=NULL;
m_pHitbox=NULL;
m_hBody=NULL;
m_hShape=NULL;
m_nContents=0;
m_BodyTransform.SetToIdentity();
m_vHitNormal.Init();
m_vHitPoint.Init();
m_flHitOffset=0.0f;
m_flFraction=1.0f;
m_nTriangle=-1;
m_nHitboxBoneIndex=-1;
m_eRayType=RAY_TYPE_LINE;
m_bStartInSolid=false;
m_bExactHitPoint=false;
}
// Returns true if there was any kind of impact at all
boolDidHit()const
{
returnm_flFraction<1||m_bStartInSolid;
}
public:
constCPhysSurfaceProperties*m_pSurfaceProperties;
CEntityInstance*m_pEnt;
constCHitBox*m_pHitbox;
HPhysicsBodym_hBody;
HPhysicsShapem_hShape;
uint64m_nContents;// contents on other side of surface hit
CTransformm_BodyTransform;
RnCollisionAttr_tm_ShapeAttributes;
Vectorm_vStartPos;// start position
Vectorm_vEndPos;// final position
Vectorm_vHitNormal;// surface normal at impact
Vectorm_vHitPoint;// exact hit point if m_bExactHitPoint is true, otherwise equal to m_vEndPos
floatm_flHitOffset;// surface normal hit offset
floatm_flFraction;// time completed, 1.0 = didn't hit anything
int32m_nTriangle;// the index of the triangle that was hit
int16m_nHitboxBoneIndex;// the index of the hitbox bone that was hit
RayType_tm_eRayType;
boolm_bStartInSolid;// if true, the initial point was in a solid area
boolm_bExactHitPoint;// if true, then m_vHitPoint is the exact hit point of the query and the shape