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
Scatterer
chevron_left Classes
class
Scatterer

Constructors

lockScatterer

Properties

lockRandom

Methods

lockCalculatePointCountlockGeneratelockGetRandomEntryfunctionsScatter

Static Methods

functionsGenerateSeedlockGetAlignedRotationlockTraceGround
Scatterer
Base class to override if you want to create custom scatterer logic. Provides utility methods for entry selection and common operations.
class Sandbox.Clutter .
abstractSandbox.Engine

build Constructors 1

Scatterer ()

data_object Properties 1

Random
Random

functions Methods 4

CalculatePointCount (bounds, density, maxPoints)
int
Calculates the number of points to scatter based on density and area. Caps at maxPoints to prevent engine freezing.
Generate (bounds, clutter, scene)
List`1
Generates clutter instances for the given bounds. The Random property is initialized before this is called.
GetRandomEntry (clutter)
ClutterEntry
Selects a random entry from the clutter based on weights. Returns null if no valid entries exist.
Scatter (bounds, clutter, seed, scene)
List`1
Public entry point for scattering. Creates Random from seed and calls Generate().

functions Static Methods 3

GenerateSeed (baseSeed, x, y)
int
Generates a deterministic seed from tile coordinates and base seed. Use this to create unique seeds for different tiles.
GetAlignedRotation (normal, yawDegrees)
Rotation
Creates a rotation aligned to a surface normal with random yaw.
TraceGround (scene, position)
SceneTraceResult
Helper to perform a ground trace at a position.

Inheritance

Scatterer
SimpleScatterer
SlopeScatterer
TerrainMaterialScatterer
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