SetSolid(): Difference between revisions
Jump to navigation
Jump to search
Note:Behaviour can change subtly depending on whether the object is colliding or being collided with.
TomEdwards (talk | contribs) No edit summary |
Grande1900 (talk | contribs) m (→SolidTypes: redlink) |
||
Line 6: | Line 6: | ||
; <code>SOLID_NONE</code> | ; <code>SOLID_NONE</code> | ||
: The entity does not generate its own collisions. Depending on the [[ | : The entity does not generate its own collisions. Depending on the [[MoveType]], its [[origin]] may still collide with [[brush]]es but will <code>[[Touch()]]</code> unreliably. {{tip|Use <code>SetMoveType(MOVETYPE_NOCLIP)</code> to completely disable all movement collision.}} | ||
; <code>SOLID_BSP</code> | ; <code>SOLID_BSP</code> | ||
: The entity has a [[brush]] model defined by the map. Does not collide with other <code>SOLID_BSP</code> entities. | : The entity has a [[brush]] model defined by the map. Does not collide with other <code>SOLID_BSP</code> entities. |
Revision as of 14:48, 1 February 2023
SetSolid()
defines the manner in which this entity's collisions are handled. SetSolidFlags()
can be used to tweak behaviour further.

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:Use
SetMoveType(MOVETYPE_NOCLIP)
to completely disable all movement collision. SOLID_BSP
- The entity has a brush model defined by the map. Does not collide with other
SOLID_BSP
entities. SOLID_BBOX
- The entity collides with an axis-aligned bounding box. Collides with everything. Required for hitbox tests.
- Use
UTIL_SetSize()
to define the extents of the box.Bug:Stop calling SetSize if the entity changes to another SolidType, or you will get a crash that disappears when a debugger is attached! [todo tested in ?]
SOLID_OBB
SOLID_OBB_YAW
- The entity collides with an object-aligned bounding box.
OBB_YAW
restricts orientation to the Z-axis.UTIL_SetSize()
can be used to define the box's extents. SOLID_CUSTOM
TestCollision()
is called every frame to handle collisions.Todo: Relationship withFSOLID_CUSTOMRAYTEST
andFSOLID_CUSTOMBOXTEST
?SOLID_VPHYSICS
- Loads a collision mesh from the entity's model. This results in the same collision shape as VPhysics would have, without actually enabling VPhysics collisions or simulation.