Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

PhysicsHandle

A world’s physics scene once it holds a body: the Rapier world and what the engine keeps beside it.

Property Type Description
actors Map<Entity, PhysicsActor> A kinematic capsule per actor, made the first step it moves.
bodies Map<Entity, RigidBody> A body per entity with a ColliderTrait, made the first step it is seen.
brokenJoints Set<Entity> The joints that broke at the last step, whose entities the next step destroys.
changedBodies Set<Entity> The entities whose CharacterCapsuleTrait or ColliderTrait changed since the bodies were last matched to them, each edited in place then.
fallen Set<Entity> The dynamic bodies that fell below the scene’s destroyBelowHeight at the last step and emitted FellOutOfWorldEvent: destroyed at the next step unless they stand above it again.
fixedChanges number Changes a walker’s sweep would meet, counted: one for each body built or dropped, each change of a body’s kind, shapes, places, scale, trigger flags, layers or ignore list, and each rebuild of a terrain or its hulls; a change of material, damping or mass counts none. A step’s sweep record holds the count it ran under, so a replay of the step tells the geometry changed.
forcedBodies Set<Entity> The bodies a force or a torque was added to since the last step, whose forces the next step clears once it has applied them.
joints Map<Entity, BuiltJoint> A Rapier joint per joint entity this world simulates, built the first step both its bodies stand built.
navMesh NavMeshHandle | null The bake the actors’ polygons belong to, so a new bake is told from the old by reference.
placedAlone Entity | null The one actor whose own bodies and colliders are all that was set in place, added or removed since then, or null: her own casts leave her out, so her next lone move needs no refresh.
placedSinceStep boolean Whether a body was set in place, or a collider added or removed, since the Rapier world last stepped, where the sweeps’ queries do not see it yet.
preparedPass number The step pass the movers last readied the scene for, so they ready it once a step.
slidBodies Map<Entity, SlidStart | null> The kinematic bodies moveAndSlide placed since the last step, each with where it stood before its first move of the tick, which the step puts it back at and hands the solver its end as a target, so it pushes what it meets with the move’s velocity; null for one teleported this tick, which takes no target and pushes nothing.
terrains Map<Entity, TerrainBody> A terrain body per ground entity, built the first step that finds the ground and rebuilt alone when its surface changes.
unsubscribers () => void[] The koota subscriptions the handle made, dropped when it is freed.
world World -