// 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)
uint16m_nObjectSetMask;// set of RnQueryObjectSet bits
uint8m_nCollisionGroup;// one of the registered collision groups
boolm_bHitSolid:1;// if true, then query will hit solid
boolm_bHitSolidRequiresGenerateContacts:1;// if true, the FCOLLISION_FUNC_ENABLE_SOLID_CONTACT flag will be checked to hit solid
boolm_bHitTrigger:1;// if true, then query will hit tirgger
boolm_bShouldIgnoreDisabledPairs:1;// if true, then ignores if the query and shape entity IDs are in collision pairs
boolm_bIgnoreIfBothInteractWithHitboxes:1;// if true, then ignores if both query and shape interact with LAYER_INDEX_CONTENTS_HITBOX
boolm_bForceHitEverything:1;// if true, will hit any objects without any conditions
boolm_bUnknown:1;// haven't found where this is used yet
// 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