Class EntityCollider
Namespace: ValveResourceFormat.Renderer.Entities
Assembly: Renderer.dll
A brush entity's collision shape: the built from its own model, plus the rigid transform placing it in the world. Sweeps and overlap tests are answered in the shape's local space and mapped back out, so the shape follows the entity as it moves without rebuilding.
public sealed class EntityColliderInheritance
Remarks
The player hull stays axis-aligned in the shape's local frame rather than being re-fitted to a world-axis-aligned box, matching how the engine traces against rotated brush models. Under rotation this is the same approximation Source makes.
Constructors
EntityCollider(PhysAggregateData)
Builds a collider from a brush entity's compiled physics.
public EntityCollider(PhysAggregateData physics)Parameters
physics PhysAggregateData
The entity model's physics aggregate.
Properties
IsEmpty
Gets a value indicating whether the shape has any geometry to trace against.
public bool IsEmpty { get; }Property Value
LocalBounds
Gets the shape's bounds in local space.
public AABB LocalBounds { get; }Property Value
Shape
Gets the collision shape, in the entity's local space.
public Rubikon Shape { get; }Property Value
Transform
Gets or sets the rigid transform from the shape's local space into the world.
public Matrix4x4 Transform { get; set; }Property Value
WorldBounds
Gets the shape's bounds in world space, refreshed whenever changes.
public AABB WorldBounds { get; }Property Value
Methods
LoadPhysics(Model?, IFileLoader)
Loads the physics of a brush entity model, following the model's referenced physics when it carries none inline.
public static PhysAggregateData? LoadPhysics(Model? model, IFileLoader fileLoader)Parameters
model Model?
The entity's model, already loaded.
fileLoader IFileLoader
Loader used for the referenced physics file.
Returns
The physics aggregate, or null when the model has none.
MightHit(Vector3, Vector3, Vector3)
Tests whether a world-space swept box could possibly reach this collider, so callers can skip the transform and descent entirely.
public bool MightHit(Vector3 from, Vector3 to, Vector3 halfExtents)Parameters
from Vector3
Sweep start.
to Vector3
Sweep end.
halfExtents Vector3
Half-extents of the swept box.
Returns
true when the sweep's bounds overlap .
Overlaps(Vector3, Vector3)
Tests a resting axis-aligned box for overlap with this shape.
public bool Overlaps(Vector3 center, Vector3 halfExtents)Parameters
center Vector3
Box centre in world space.
halfExtents Vector3
Half-extents of the box.
Returns
true when the box overlaps the shape.
TraceAABB(Vector3, Vector3, Vector3, bool)
Sweeps an axis-aligned box through this shape.
public Rubikon.TraceResult TraceAABB(Vector3 from, Vector3 to, Vector3 halfExtents, bool detectStartSolid = false)Parameters
from Vector3
Sweep start, the box centre in world space.
to Vector3
Sweep end in world space.
halfExtents Vector3
Half-extents of the swept box.
detectStartSolid bool
Whether an overlap at from reports as start-solid.
Returns
The hit, in world space.
TraceRay(Vector3, Vector3)
Traces a ray against this shape. Used by the player's reach test, which needs a point query rather than the swept hull movement uses.
public Rubikon.TraceResult TraceRay(Vector3 from, Vector3 to)Parameters
from Vector3
Ray start in world space.
to Vector3
Ray end in world space.
Returns
The hit, in world space.

