class

PhysicsSystem

Module
Physics
Header
#include "Physics/PhysicsSystem.h"
Namespace
Mowo

Public functions

ReturnsNameDescription
voidInitialize
voidShutdown
voidUpdate
PhysicsWorld&GetPhysicsWorld
FPhysicsSnapshotRing&GetSnapshotRingThe whole-world snapshots gameplay captures for rollback and resimulation.
floatGetDiscardedSimulationTimeSimulation time the substep cap (p.MaxSubsteps) refused to run, and how many frames hit the cap.
uint32_tGetSubstepCapHits
floatGetFixedTimestep
voidSetFixedTimestep
uint32_tGetAsyncStepsInFlightp.AsyncTick: fixed steps this Update handed to a worker and has not yet joined.
boolIsAsyncStepInFlight
boolIsDuringPhysicsOverlapEnabledp.OverlapDuringPhysics (on by default): UE's StartPhysics / EndPhysics.
boolBeginFrameStep
voidEndFrameStep
MulticastDelegate<const FConstraintBreakInfo&>&OnConstraintBrokenRaised the fixed step a ConstraintComponent crossed its break threshold, after the joint is gone and broken is set.
voidReleaseConstraint
voidSetSimulationFocusSimulation LOD: dynamic bodies beyond the sleep radius around the focus are force-deactivated; they wake when the focus comes back within the (smaller) wake radius.
voidClearSimulationFocus
size_tGetLodFrozenCountBodies currently frozen by the simulation LOD.
uint32_tGetLodBodiesExaminedLastUpdateBodies the last LOD pass looked at: the active ones, plus the frozen set on a frame the focus moved.
voidShiftOriginOrigin rebasing: translate every Jolt body and character controller by -shift, velocities untouched.
boolStepCharacterAdvance ONE character controller by dt outside the fixed-step loop: integrates gravity into the component's linearVelocity, runs the Jolt ExtendedUpdate against the live collision world, and writes the result back to the component + transform.
boolSetCharacterPositionTeleport a character controller (and its transform) — the rewind half of the prediction reconcile.
const CharacterController*GetCharacterControllerThe live controller behind an entity, nullptr when none — diagnostics and the self-tests (capsule shape state isn't mirrored on the component).
FPhysicsBodyIdGetQueryBodyForEntityThe body a query originating ON this entity must exclude: its rigid body if it has one, otherwise its character controller's inner body.
uint64_tGetEntityForBodyLook up EntityID for a physics body (returns INVALID_ENTITY if not found)
size_tGetRegisteredBodyCountBodies this system has registered — RigidBody bodies, character inner bodies and implicit statics alike.
boolGetBodyInterpolation
floatGetInterpolationAlpha
MulticastDelegate<uint64_t, const CollisionInfo&>&OnCollisionEnterEventsThe single-slot callbacks above belong to whichever system claimed them (the interactable system owns collision enter).
voidSetOnCollisionEnter
voidSetOnCollisionStay
voidSetOnCollisionExit
voidSetOnTriggerEnter
voidSetOnTriggerStay
voidSetOnTriggerExit
FPhysicsBodyIdGetImplicitStaticBodyThe static body this system created for a collider that carries no RigidBody, if any.
size_tGetImplicitStaticBodyCount
uint64_tGetImplicitStaticPoseReadCountHow many times an implicit static's world pose has been re-derived from its transform since the system started.

Function details

Initialize

C++
void Initialize(World* world) override

Shutdown

C++
void Shutdown() override

Update

C++
void Update(float deltaTime) override

GetPhysicsWorld

C++
PhysicsWorld& GetPhysicsWorld()

GetSnapshotRing

C++
FPhysicsSnapshotRing& GetSnapshotRing()

The whole-world snapshots gameplay captures for rollback and resimulation. Empty and unsized until first asked for: its capacity comes from p.SnapshotFrames, and nothing is recorded unless something captures.

GetDiscardedSimulationTime

C++
float GetDiscardedSimulationTime() const

Simulation time the substep cap (p.MaxSubsteps) refused to run, and how many frames hit the cap. Both stay zero on a healthy frame budget.

GetSubstepCapHits

C++
uint32_t GetSubstepCapHits() const

GetFixedTimestep

C++
float GetFixedTimestep() const

SetFixedTimestep

C++
void SetFixedTimestep(float timestep)

GetAsyncStepsInFlight

C++
uint32_t GetAsyncStepsInFlight() const

p.AsyncTick: fixed steps this Update handed to a worker and has not yet joined. Non-zero between one Update's return and the next one's start; every PhysicsWorld entry point that reaches Jolt joins on its own.

IsAsyncStepInFlight

C++
bool IsAsyncStepInFlight() const

IsDuringPhysicsOverlapEnabled

C++
static bool IsDuringPhysicsOverlapEnabled()

p.OverlapDuringPhysics (on by default): UE's StartPhysics / EndPhysics. The scene kicks the frame's steps onto a worker after the PrePhysics tick group, ticks DuringPhysics while Jolt runs, then joins — instead of the step running inside Update with the game thread waiting. EndFrameStep runs Update's post-step half, so the Update that follows in the same frame does nothing. BeginFrameStep returns false (Update does it all) when the overlap is off or p.AsyncTick owns the step. The scene runs the world systems ordered ahead of this one (World::UpdateBefore) before the kick, so movement input still lands on this frame's step.

BeginFrameStep

C++
bool BeginFrameStep(float deltaTime)

EndFrameStep

C++
void EndFrameStep()

OnConstraintBroken

C++
MulticastDelegate<const FConstraintBreakInfo&>& OnConstraintBroken()

Raised the fixed step a ConstraintComponent crossed its break threshold, after the joint is gone and broken is set. The same payload rides the EventBus as ConstraintBrokenEvent for listeners that never see this system (audio, VFX, replication).

ReleaseConstraint

C++
void ReleaseConstraint(ConstraintComponent& constraint, bool clearBroken)

SetSimulationFocus

C++
void SetSimulationFocus(const Vec3& position)

Simulation LOD: dynamic bodies beyond the sleep radius around the focus are force-deactivated; they wake when the focus comes back within the (smaller) wake radius. No focus = no LOD. Radii override via p.LODSleepRadius / p.LODWakeRadius, kill switch via p.LOD.

ClearSimulationFocus

C++
void ClearSimulationFocus()

GetLodFrozenCount

C++
size_t GetLodFrozenCount() const

Bodies currently frozen by the simulation LOD. Diagnostic (and the self-tests pin that destroyed entities don't linger here).

GetLodBodiesExaminedLastUpdate

C++
uint32_t GetLodBodiesExaminedLastUpdate() const

Bodies the last LOD pass looked at: the active ones, plus the frozen set on a frame the focus moved. Diagnostic — a settled world reads zero.

ShiftOrigin

C++
void ShiftOrigin(const Vec3& shift)

Origin rebasing: translate every Jolt body and character controller by -shift, velocities untouched. Callers (Scene) shift the transform components; this keeps the physics mirror aligned.

StepCharacter

C++
bool StepCharacter(uint64_t entityId, float dt)

Advance ONE character controller by dt outside the fixed-step loop: integrates gravity into the component's linearVelocity, runs the Jolt ExtendedUpdate against the live collision world, and writes the result back to the component + transform. Game-thread only, never while Update is running — the client-prediction replay path steps a rewound character through the still-unacked inputs with this.

SetCharacterPosition

C++
bool SetCharacterPosition(uint64_t entityId, const Vec3& position)

Teleport a character controller (and its transform) — the rewind half of the prediction reconcile.

GetCharacterController

C++
const CharacterController* GetCharacterController(uint64_t entityId) const

The live controller behind an entity, nullptr when none — diagnostics and the self-tests (capsule shape state isn't mirrored on the component).

GetQueryBodyForEntity

C++
FPhysicsBodyId GetQueryBodyForEntity(uint64_t entityId) const

The body a query originating ON this entity must exclude: its rigid body if it has one, otherwise its character controller's inner body. Looking up RigidBodyComponent alone misses characters entirely, and a ray that starts inside a convex shape reports a hit at fraction 0 — which is how an AI standing in its own capsule goes blind, or a foot-IK probe lands on its own knee. Anything tracing from a pawn wants this, not the component.

GetEntityForBody

C++
uint64_t GetEntityForBody(FPhysicsBodyId bodyID) const

Look up EntityID for a physics body (returns INVALID_ENTITY if not found)

GetRegisteredBodyCount

C++
size_t GetRegisteredBodyCount() const

Bodies this system has registered — RigidBody bodies, character inner bodies and implicit statics alike. Diagnostic, and the self-tests read it to pin that a torn-down entity leaves nothing behind.

GetBodyInterpolation

C++
bool GetBodyInterpolation(uint64_t entityId, FBodyInterp& out) const

GetInterpolationAlpha

C++
float GetInterpolationAlpha() const

OnCollisionEnterEvents

C++
MulticastDelegate<uint64_t, const CollisionInfo&>& OnCollisionEnterEvents()

The single-slot callbacks above belong to whichever system claimed them (the interactable system owns collision enter). Anything else that wants contact begins — an actor's OnHit event — subscribes here and is told about the same pairs, once per side, after the slot callback ran.

SetOnCollisionEnter

C++
void SetOnCollisionEnter(CollisionCallback cb)

SetOnCollisionStay

C++
void SetOnCollisionStay(CollisionCallback cb)

SetOnCollisionExit

C++
void SetOnCollisionExit(CollisionCallback cb)

SetOnTriggerEnter

C++
void SetOnTriggerEnter(CollisionCallback cb)

SetOnTriggerStay

C++
void SetOnTriggerStay(CollisionCallback cb)

SetOnTriggerExit

C++
void SetOnTriggerExit(CollisionCallback cb)

GetImplicitStaticBody

C++
FPhysicsBodyId GetImplicitStaticBody(uint64_t entityId) const

The static body this system created for a collider that carries no RigidBody, if any. Diagnostics and the self-tests — nothing is stored on the component, because the body is derived state and must not survive a save/load round trip as authored data.

GetImplicitStaticBodyCount

C++
size_t GetImplicitStaticBodyCount() const

GetImplicitStaticPoseReadCount

C++
uint64_t GetImplicitStaticPoseReadCount() const

How many times an implicit static's world pose has been re-derived from its transform since the system started. Diagnostic — a frame in which no prop's transform was rebuilt adds nothing.

Generated from Physics/PhysicsSystem.h via physics.json · Nov 4, 2026Version 1.0.0