Class Rubikon
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Ray tracing against Rubikon physics collision shapes including meshes and hulls.
public class RubikonInheritance
Constructors
Rubikon(PhysAggregateData)
Initializes by parsing the mesh and hull shapes from the first part of the physics aggregate data.
public Rubikon(PhysAggregateData physicsData)Parameters
physicsData PhysAggregateData
Source physics aggregate containing shapes and collision attributes.
Fields
DefaultGeometry
Solid untagged geometry that closely resembles the render mesh.
public const string DefaultGeometry = "default"Field Value
Epsilon
Degenerate-geometry cutoff used throughout the tracer. Sweeps shorter than this are rejected as invalid rays (reported as a miss with unset), so callers that apply movement must not treat sub-epsilon deltas as traced.
public const float Epsilon = 1E-06Field Value
GrenadeCollisionName
Collision name for thrown grenades.
public const string GrenadeCollisionName = "grenade"Field Value
PlayerCollisionName
Collision name for the player.
public const string PlayerCollisionName = "player"Field Value
Properties
HullTree
Gets the BVH acceleration structure built over .
public Mesh.Node[] HullTree { get; }Property Value
Hulls
Gets the convex hull collision shapes available for tracing.
public Rubikon.PhysicsHullData[] Hulls { get; }Property Value
Meshes
Gets the triangle mesh collision shapes available for tracing.
public Rubikon.PhysicsMeshData[] Meshes { get; }Property Value
Methods
ContainsPoint(Vector3)
Tests whether a point lies inside any convex hull of this shape.
public bool ContainsPoint(Vector3 point)Parameters
point Vector3
The point to test, in this shape's local space.
Returns
true when the point is inside a hull.
IntersectsAABB(Vector3, Vector3, string)
Tests a box at rest for overlap against the physics shapes it collides with, without sweeping. Unlike this accepts a pure position, so it can answer "am I stuck here" without a probe direction.
public bool IntersectsAABB(Vector3 center, Vector3 halfExtents, string collisionName)Parameters
center Vector3
Center of the box.
halfExtents Vector3
Half-extents of the box.
collisionName string
Collision interaction name used to filter shapes.
Returns
true if any physics triangle overlaps the box.
IntersectsOrContainsAABB(Vector3, Vector3, string)
Tests a box at rest against the solid volume of this shape, rather than against its surface.
public bool IntersectsOrContainsAABB(Vector3 center, Vector3 halfExtents, string collisionName)Parameters
center Vector3
Center of the box.
halfExtents Vector3
Half-extents of the box.
collisionName string
Collision interaction name used to filter shapes.
Returns
true if the box is inside or touching one of the hulls.
Remarks
What a trigger volume asks, and the difference from is a box that has gone all the way inside a hull: no surface is in contact there, so the surface test calls it a miss and a trigger driven by it would let go of anything that walked far enough in.
TraceAABB(Vector3, Vector3, AABB, string, bool, bool)
Sweeps an axis-aligned bounding box through the physics world and returns the closest hit.
public Rubikon.TraceResult TraceAABB(Vector3 from, Vector3 to, AABB aabb, string collisionName, bool detectStartSolid = false, bool computeContactPoint = false)Parameters
from Vector3
Sweep start position (center of the AABB).
to Vector3
Sweep end position.
aabb AABB
Box whose size determines the half-extents of the swept volume.
collisionName string
Collision group name used to filter shapes (e.g. "player").
detectStartSolid bool
Whether to also test for overlap at the start position (see ).
computeContactPoint bool
Whether hits also compute .
Returns
The closest , or an empty result if nothing was hit.
TraceAABB(Vector3, Vector3, Vector3, string, bool, bool)
Sweeps a box given by its half-extents from from to to and returns the closest hit.
public Rubikon.TraceResult TraceAABB(Vector3 from, Vector3 to, Vector3 halfExtents, string collisionName, bool detectStartSolid = false, bool computeContactPoint = false)Parameters
from Vector3
Sweep start position (center of the box).
to Vector3
Sweep end position.
halfExtents Vector3
Half-extents of the swept box.
collisionName string
Collision interaction name used to filter shapes.
detectStartSolid bool
Whether to report overlaps at the start position as start-solid hits.
computeContactPoint bool
Whether hits also compute .
Returns
The closest , or an empty result if nothing was hit.
TraceRay(Vector3, Vector3)
Traces a ray against all physics shapes and returns the closest hit.
public Rubikon.TraceResult TraceRay(Vector3 from, Vector3 to)Parameters
from Vector3
Ray start position.
to Vector3
Ray end position.
Returns
The closest , or an empty result if nothing was hit.

