SetSolid(): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(object-aligned bounding boxes DO work!)
Line 13: Line 13:
; <code>SOLID_OBB</code>
; <code>SOLID_OBB</code>
; <code>SOLID_OBB_YAW</code>
; <code>SOLID_OBB_YAW</code>
: The entity collides with an [[object-aligned bounding box]]. <code>OBB_YAW</code> restricts orientation to Z-axis. {{bug|"Not implemented yet". {{confirm|Functions like <code>SOLID_NONE</code> right now.}}}}
: The entity collides with an [[object-aligned bounding box]]. Call <code>[[VPhysicsInitShadow()]]</code> if you use this ({{todo|Is it genuine VPhys collision, or a hybrid, or what?}}).
: <code>OBB_YAW</code> restricts orientation to the Z-axis.
; <code>SOLID_CUSTOM</code>
; <code>SOLID_CUSTOM</code>
: <code>[[TestCollision()]]</code> is called every frame to handle collisions. {{todo|Relationship with <code>FSOLID_CUSTOMRAYTEST</code> and <code>FSOLID_CUSTOMBOXTEST</code>?}}
: <code>[[TestCollision()]]</code> is called every frame to handle collisions. {{todo|Relationship with <code>FSOLID_CUSTOMRAYTEST</code> and <code>FSOLID_CUSTOMBOXTEST</code>?}}

Revision as of 13:54, 18 October 2009

SetSolid() defines the manner in which collisions between this entity and others are handled. SetSolidFlags() can be used to tweak behaviour further.

Note.pngNote:Behaviour can change subtly depending on whether the object is colliding or being collided with.

SolidTypes

SOLID_NONE
The entity does not generate its own collisions. Depending on the MoveType, its origin may still collide with brushes but will Touch() unreliably.
Tip.pngTip:Use SetMoveType(MOVETYPE_NOCLIP) to completely disable all movement collision.
SOLID_BSP
The entity has a brush model defined by the map. Collides with SOLID_BBOX and SOLID_VPHYSICS objects, but not other SOLID_BSPs.
SOLID_BBOX
The entity collides with an axis-aligned bounding box. Collides with everything. Required for hitbox tests.
Tip.pngTip:Use UTIL_SetSize() to define the extents of the box. But remember to stop calling it if the entity changes to another SolidType, or you will get a crash that disappears when a debugger is attached!
SOLID_OBB
SOLID_OBB_YAW
The entity collides with an object-aligned bounding box. Call VPhysicsInitShadow() if you use this (
Todo: Is it genuine VPhys collision, or a hybrid, or what?
).
OBB_YAW restricts orientation to the Z-axis.
SOLID_CUSTOM
TestCollision() is called every frame to handle collisions.
Todo: Relationship with FSOLID_CUSTOMRAYTEST and FSOLID_CUSTOMBOXTEST?
SOLID_VPHYSICS
Use VPhysics for collisions. Collides with everything. Call VPhysicsInitNormal() or VPhysicsInitShadow() if you use this!

See also