s&box docs
API ReferenceSandbox.Volumes

public sealed struct Sandbox.Volumes.SceneVolume

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.

Constructors

Showing 1 constructors

Methods

Showing 6 methods

public void DrawGizmos(bool withControls)

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

public BBox GetBounds()

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

public float GetEdgeDistance(Transform worldTransform, Vector3 worldPosition)

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

Parameters

  • worldTransform: The world transform of the volume.
  • worldPosition: The position in world space to measure from.

Returns

The distance, in world units, from the position to the volume edge.

public float GetVolume()

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!

Metadata

FieldValue
NamespaceSandbox.Volumes
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.Volumes.SceneVolume

On this page