Documentation
    Preparing search index...

    Function createPoseTargetCaptureSystem

    • Builds the SimulationSystem that calls PhysicsWorld.capturePoseTargets on every world in worlds, once per fixed step, before §39 step 3 (plan D5: features register systems, nothing edits the scheduler; plan P7-4).

      const physics = new PhysicsSystem({ worlds: [world] });
      app.systems.register(createPoseTargetCaptureSystem(physics.worlds));
      app.systems.register(physics);

      worlds is iterated every step, not copied, so passing PhysicsSystem.worlds — the system's own live array — makes the capture follow track/untrack with nothing to keep in sync. A plain array literal works just as well for an application that steps its worlds itself.

      This is the one part of §19's pipeline PhysicsWorld cannot run from inside its own step (see PhysicsWorld.capturePoseTargets), so it is the one part an application has to wire up. Without it every PoseTarget keeps previous === current forever: blending still works — it reads the target's current pose — but setBodyControlMode's inheritVelocityFrom inherits zero velocity, which is §19's ragdoll dropping from rest instead of continuing the animation's motion.

      Returns a plain object rather than a class instance: it holds no state of its own beyond the two arguments, and dispose deliberately does nothing — the worlds outlive the system.

      Parameters

      Returns SimulationSystem