s&
newspaperAbout
infoAbout s&box newspaperLatest News published_with_changesChanges mapRoadmap monitoringMetrics
gamesGames
sports_esportsBrowse Games rocketDiscover Games
business_centerWorkshop
sports_esportsGames landscapeMaps chairModels textureMaterials apparelClothing constructionMore..
forumForum docsDocs
docsDocumentation dashboardApi Reference schoolTutorials
inputLog in with Steam chevron_leftChange Language
简体中文EnglishРусскийEspañolPortuguês-BrasilDeutsch日本語FrançaisPolskiTürkçe한국어PirateItalianoไทย繁體中文УкраїнськаČeštinaNederlandsMagyarDanskSuomiSvenskaNorskΕλληνικάRomânăБългарскиTiếng ViệtBahasa IndonesiaEspañol-Latinoaméricaالعربية
Api
Classes
SceneVolume
chevron_left Classes
struct
SceneVolume

Constructors

functionsSceneVolume

Fields

crop_dinBoxcrop_dinCapsulecrop_dinSpherecrop_dinType

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 ()

crop_din Fields 4

Box
BBox
Capsule
Capsule
Sphere
Sphere
Type
VolumeTypes

functions Methods 5

DrawGizmos (withControls)
Draws an editable sphere/box gizmo, for adjusting the volume
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.
  • News
  • Docs
  • Metrics
  • FAQ
  • Forum
  • Discord
  • Twitter