syncPhysics
syncPhysics(state : Object, mesh : THREE.Object3D, alpha : number)Sync physics state to a Three.js object with interpolation.
Works for all body types (dynamic, kinematic) that have position/quaternion and their previous frame values (prevPosition*, prevQuaternion*).
Parameters
stateObjectPhysics body state (from physics.player, getKinematicBody, etc.)
meshTHREE.Object3DTarget Three.js object to sync position/quaternion to
alphanumberInterpolation factor (0-1), typically from PhysicsController.getInterpolationAlpha()
Example
const alpha = physicsController.getInterpolationAlpha();
// Dynamic body
syncPhysics(physics.player, playerMesh, alpha);
// Kinematic body
const state = physics.getKinematicBody(index);
syncPhysics(state, platformMesh, alpha);