Skip to content

FMjRenderSnapshot

Single-frame snapshot of MuJoCo state for game-thread consumers.

Produced once per step on the physics thread inside UMjPhysicsEngine::PushRenderState while CallbackMutex is held. Consumed on the game thread via UMjPhysicsEngine::WithRenderState, which holds RenderStateMutex for the entire visitor body so every consumer in one UE frame observes the same coherent physics frame. All arrays are sized once on model load when nbody / ngeom / nsite / ncam / nq / nv / nu / nsensordata / ntree / nflexvert change; steady-state push reuses the existing storage. Lifetime is bound to the owning UMjPhysicsEngine.

Attribute Value
Kind Struct

Properties

Public Properties

Property Type Description
XPos TArray<mjtNum> Body world position. 3 * nbody (mjtNum).
XQuat TArray<mjtNum> Body world rotation (unit quaternion, mjtNum order w, x, y, z). 4 * nbody.
CVel TArray<mjtNum> Body spatial velocity (angular xyz, linear xyz, body frame). 6 * nbody.
XfrcApplied TArray<mjtNum> Applied wrench on each body (linear xyz, angular xyz). 6 * nbody.
GeomXPos TArray<mjtNum>
GeomXMat 3 * ngeom TArray<mjtNum>
SiteXPos 9 * ngeom TArray<mjtNum>
SiteXMat 3 * nsite TArray<mjtNum>
CamXPos TArray<mjtNum>
CamXMat 3 * ncam TArray<mjtNum>
QPos TArray<mjtNum>
QVel nq TArray<mjtNum>
QAcc nv TArray<mjtNum>
ActuatorForce nv TArray<mjtNum>
SensorData nu TArray<mjtNum>
TreeAsleep nbody TArray<int32>
TreeAwake ntree TArray<int32>
FlexvertXPos TArray<mjtNum>
SimTime mjtNum MuJoCo simulation time at the moment of the snapshot.
FrameId uint64 Monotonic frame counter. Incremented every successful push.

XPos

Body world position. 3 * nbody (mjtNum).

  • Type: TArray

XQuat

Body world rotation (unit quaternion, mjtNum order w, x, y, z). 4 * nbody.

  • Type: TArray

CVel

Body spatial velocity (angular xyz, linear xyz, body frame). 6 * nbody.

  • Type: TArray

XfrcApplied

Applied wrench on each body (linear xyz, angular xyz). 6 * nbody.

  • Type: TArray

GeomXPos

  • Type: TArray

GeomXMat

  • Type: 3 * ngeom TArray

SiteXPos

  • Type: 9 * ngeom TArray

SiteXMat

  • Type: 3 * nsite TArray

CamXPos

  • Type: TArray

CamXMat

  • Type: 3 * ncam TArray

QPos

  • Type: TArray

QVel

  • Type: nq TArray

QAcc

  • Type: nv TArray

ActuatorForce

  • Type: nv TArray

SensorData

  • Type: nu TArray

TreeAsleep

  • Type: nbody TArray

TreeAwake

  • Type: ntree TArray

FlexvertXPos

  • Type: TArray

SimTime

MuJoCo simulation time at the moment of the snapshot.

  • Type: mjtNum

FrameId

Monotonic frame counter. Incremented every successful push.

  • Type: uint64