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.
object→SceneVolume
Constructors1
Showing 1 constructors
public SceneVolume()
No results match this filter.
Methods6
Showing 6 methods
public void DrawGizmos(bool withControls)
Draws an editable sphere/box gizmo, for adjusting the volume
| Parameter | Type | Description |
|---|---|---|
| withControls | bool | — |
Returns:
void—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.
| Parameter | Type | Description |
|---|---|---|
| worldTransform | Transform | The world transform of the volume. |
| worldPosition | Vector3 | The position in world space to measure from. |
Returns:
floatThe 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!
Returns:
float—No results match this filter.