Touch()

From Valve Developer Community
Revision as of 15:02, 1 June 2011 by TomEdwards (talk | contribs) (Created page with 'Entities will '''touch''' each other when their bounding boxes collide or intersect. Touching is a Quake-era concept unrelated to VPhysics, and happens regardless of [[co…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Entities will touch each other when their bounding boxes collide or intersect. Touching is a Quake-era concept unrelated to VPhysics, and happens regardless of collision models or hitboxes.

Touching occurs on the server only and results in calls to the Touch(CBaseEntity* pOther) functions of both entities involved.

Controlling touches

Touching can be disabled selectively by setting an appropriate collision group, or altogether by disabling QPhysics collisions.

There is however no known call into entity code when deciding whether a touch should occur. The closest it gets is CCollisionProperty::ShouldTouchTrigger(), but as the name suggests that only applies to trigger touches. Other functions in game code deal only with collision groups; the guts of the system seem to be locked away in the engine.

Triggers

To make an entity touch others without colliding with them, call AddSolidFlags( FSOLID_NOT_SOLID | FSOLID_TRIGGER ).