Updates body facing direction with smooth rotation
Performs smooth rotation toward target angle at specified speed. Handles:
Current body facing state
Desired facing angle in degrees
Time elapsed since last update in seconds
Current timestamp in milliseconds
Updated body facing state
const facing = createDefaultBodyFacing(0);const updated = updateBodyFacing(facing, 90, 0.016, Date.now());// Rotates ~0.72° toward 90° (45°/sec * 0.016s) Copy
const facing = createDefaultBodyFacing(0);const updated = updateBodyFacing(facing, 90, 0.016, Date.now());// Rotates ~0.72° toward 90° (45°/sec * 0.016s)
몸향하기업데이트
Updates body facing direction with smooth rotation
Performs smooth rotation toward target angle at specified speed. Handles: