Class PhysicsWorld
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
The static collision of one world group: the world physics of every map loaded into it, each placed where its spawn group put it.
public sealed class PhysicsWorldInheritance
Remarks
Queries are moved into each shape's local space, so a swept box stays axis-aligned to the shape rather than to the world. That is exact for a shape that is only moved, as nearly every spawn group is, and only approximate for one that is also rotated.
Properties
IsEmpty
Gets whether any collision has been added.
public bool IsEmpty { get; }Property Value
Methods
Add(Scene, Rubikon, Matrix4x4)
Adds a shape, placed by a rigid transform.
public void Add(Scene owner, Rubikon shape, Matrix4x4 transform)Parameters
owner Scene
The scene of the spawn group the shape belongs to, for .
shape Rubikon
The collision shape, in its own local space.
transform Matrix4x4
The rigid transform placing it in the world.
Clear()
Removes every shape.
public void Clear()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.
Remove(Scene)
Removes every shape added for owner.
public void Remove(Scene owner)Parameters
owner Scene
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, string)
Traces a ray against all physics shapes and returns the closest hit.
public Rubikon.TraceResult TraceRay(Vector3 from, Vector3 to, string collisionName)Parameters
from Vector3
Ray start position.
to Vector3
Ray end position.
collisionName string
Collision interaction name used to filter shapes.
Returns
The closest , or an empty result if nothing was hit.

