REFERENCESUBSYSTEMS AND LIBRARIES
UCFDebrisSubsystem
Client-side pool of cosmetic debris pieces thrown by breaking units.
Never created on a dedicated server: debris is presentation only and is not replicated. Pieces collide with the world, intact props and each other, never with pawns (the Debris Collision Profile setting; with none a piece is physics-only, so no trace, sweep or overlap finds it); a definition with bDebrisCollidesWithDebris off makes its pieces ignore the profile's own object type instead. Vehicles pass through them too unless the definition sets bDebrisPushedByVehicles: then a vehicle body pushes the piece one-way, and a body without CCD keeps its speed, as the piece uses no CCD (Chaos resolves CCD outside one-way). The push lasts the definition's DebrisVehicleContactSeconds from the break, after which vehicles pass through the piece again; a piece still lying on a vehicle then keeps being pushed until it is off it, so it neither hangs where the vehicle leaves it nor falls through it. A pushed piece that lies on a vehicle when its sink begins shrinks away riding the vehicle instead of sinking through it. A pushed piece whose centre stays inside a vehicle (a dented body cut into collision blocks can trap a thin piece pressed into it) stops feeling vehicles and falls out. Lying on and lying inside a vehicle are queries for the Vehicle object type around the piece, so only vehicle bodies with query collision count. A pushed piece never counts as a hit on the vehicle: hit consumers such as impact feedback skip it, see GetPoolActor.
Functions
The debris subsystem of WorldContext's world; nullptr when there is none.
Whether a world in NetMode simulates debris: everything but a dedicated server.
Throws Definition's baked pieces from UnitWorldTransform: pieces near Impact.Location inherit more of the impact velocity, far ones mostly topple. Seed makes the throw repeatable. Owner and OwnerKey tag the pieces for ReleaseOwnedPieces; pass them for any definition whose debris lasts until respawn. Returns the pieces spawned (0 beyond the debris distance from the local view, on a dedicated server, or for an unbaked definition). Every piece also moves with CarrierVelocity, the velocity of whatever carried the unit.
The velocities a piece at PieceLocation is thrown with, from Impact: a share of the impact's velocity and an outward throw, both weaker the farther the piece lies from Impact.Location, plus a random scatter and CarrierVelocity. The spin is a random share of the definition's fastest, weaker the same way. Draws from Random in a fixed order, so one stream throws the same pieces again.
Returns Owner's pieces to the pool at once, without sinking: only those spawned with OwnerKey, or all of them for INDEX_NONE.
Every live piece goes back to the pool, owned, ownerless and persistent alike. Local to this machine.
How many pieces are live now, persistent ones included.
Live pieces of definitions whose debris lasts until respawn; GetLivePieceCount includes them.
Live pieces that vehicles still push and whose push ends after a set time.
Live pieces that vehicles push now, whether their push ends after a set time or lasts for as long as they lie.
Fills OutPieces with the component of every live piece.
The transient actor that owns every pooled piece; nullptr before the first piece. Hit consumers that must not react to debris ignore it.
Whether Location lies within UCFBreakableSettings::DebrisMaxSpawnDistanceCm of the viewer: the point SetViewerOverride sets, else the view location the host reports. True when there is no viewer to measure from, so nothing is culled.
Distance culling measures from this point instead of the local camera while set.
The game's side of the pool: the camera the distance cull measures from and the feedback of a piece hit. Not owned.
The intensity of a piece hit in [0, 1] from its impulse and mass, or -1 when the hit is too soft to play.