API ReferenceSandbox.Volumes

SceneVolumeclass

A generic way to represent volumes in a scene. If we all end up using this instead of defining our own version in everything, we can improve this and improve everything at the same time.

objectSceneVolume
Namespace
Sandbox.Volumes
Assembly
Sandbox.Engine
Declaration
public sealed struct Sandbox.Volumes.SceneVolume

Constructors1

Showing 1 constructors

Methods6

Showing 6 methods

public void DrawGizmos(bool withControls)PUBLIC

Draws an editable sphere/box gizmo, for adjusting the volume

ParameterTypeDescription
withControlsbool
Returns:void

public BBox GetBounds()PUBLIC

Returns the axis-aligned bounding box that encloses the current volume.

Returns:BBox

public float GetEdgeDistance(Transform worldTransform, Vector3 worldPosition)PUBLIC

Calculates the shortest distance from the specified world position to the edge of this volume.

ParameterTypeDescription
worldTransformTransformThe world transform of the volume.
worldPositionVector3The position in world space to measure from.
Returns:floatThe distance, in world units, from the position to the volume edge.

public float GetVolume()PUBLIC

Get the actual amount of volume in this shape. This is useful if you want to make a system where you prioritize by volume size. Don't forget to multiply by scale!

Returns:float

On this page