s&
About
The Project
infoAbout s&box mapRoadmap monitoringMetricsEngine startup and usage numbers
Updates
newspaperLatest News published_with_changesChangesRelease-by-release changelog
Games
Browse Games Discover Games
gamejams
Workshop
Playable
sports_esportsGamesStandalone games and gamemodes
Assets
landscapeMaps view_in_arModels textureMaterials apparelClothing
appsEverythingEvery asset type in one list
Forum
Learn
Documentation
rocket_launchGetting Started docsDocumentation apiAPI Reference
Resources
schoolTutorials manage_searchCode Search
Get s&box
Sign in with Steam
Api
Classes
SceneVolume
chevron_left Classes
struct
SceneVolume

Constructors

functionsSceneVolume

Fields

crop_dinBoxcrop_dinCapsulecrop_dinSpherecrop_dinType

Properties

data_objectCenter

Methods

functionsDrawGizmosfunctionsGetBoundsfunctionsGetEdgeDistancefunctionsGetVolumefunctionsTest
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.
struct Sandbox.Volumes .
sealedSandbox.Engine

build Constructors 1

SceneVolume ()
Creates a box volume with editable defaults for every shape.

crop_din Fields 4

Box
BBox
Bounds of a box in local space.
Capsule
Capsule
Capsule endpoints and radius in local space.
Sphere
Sphere
Sphere center and radius in local space.
Type
VolumeTypes
Active primitive.

data_object Properties 1

Center
Vector3
Center of the active primitive; the origin for infinite volumes.

functions Methods 5

DrawGizmos (withControls)
Draws the volume and optionally its standard shape controls.
GetBounds ()
BBox
Returns the axis-aligned bounding box that encloses the current volume.
GetEdgeDistance (worldTransform, worldPosition)
float
Calculates the shortest distance from the specified world position to the edge of this volume.
GetVolume ()
float
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!
Test (volumeTransform, position)
bool
Is this point within the volume
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.
Facepunch
  • News
  • Docs
  • Metrics
  • FAQ
  • Forum
  • Discord
  • Twitter