Class EntityCollider
Namespace: ValveResourceFormat.Renderer.Entities
Assembly: Renderer.dll
A brush entity's collision shape: the Rubikon built from its model, plus a rigid transform placing it in the world. Queries run in the shape's local space and are mapped back out.
public sealed class EntityColliderInheritance
object ← EntityCollider
Remarks
The swept hull stays axis-aligned in the shape's local frame instead of being re-fitted to a world-axis box, so a rotated shape is only approximated.
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
bool
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 EntityCollider.Transform changes.
public AABB WorldBounds { get; }Property Value
Methods
ContainsPoint(Vector3)
Tests whether a world-space point is inside this shape's solid volume.
public bool ContainsPoint(Vector3 point)Parameters
point Vector3
Returns
bool
LoadPhysics(Model?, IFileLoader)
Loads a brush entity model's physics, from the referenced physics file when none is embedded.
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)
Cheap broad-phase test of whether a world-space swept box could reach this collider.
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
bool
true when the sweep's bounds overlap EntityCollider.WorldBounds.
OverlapsVolume(Vector3, Vector3)
Tests a resting axis-aligned box against this shape's solid volume, containment included.
public bool OverlapsVolume(Vector3 center, Vector3 halfExtents)Parameters
center Vector3
halfExtents Vector3
Returns
bool
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, string)
Traces a ray against this shape, for point queries such as the player's reach test.
public Rubikon.TraceResult TraceRay(Vector3 from, Vector3 to, string collisionName)Parameters
from Vector3
Ray start in world space.
to Vector3
Ray end in world space.
collisionName string
Collision interaction name used to filter shapes.
Returns
The hit, in world space.

