Learn to create smooth animations by interpolating between model updates for better user experience
"oncePerFrame"
to limit view updates efficientlyMultisynq.Constants
contributes to the hash used to generate a session ID. Use a short alias like Q
to make your code more readable.No External Dependencies
No Parameter Modification
No State Persistence
Consistent Results
RootModel
spawns an Actor
, which tells RootView
to spawn a Pawn
RootModel
removes the Actor
, which tells RootView
to remove the Pawn
goto
method calculates movement vectors:
Q.CLOSE
distance)"oncePerFrame"
to optimize event handling"oncePerFrame"
discards all but the last event of this type during each frame. This is crucial for high-frequency updates where only the latest position matters.Q.SMOOTH
value (0 < SMOOTH ≤ 1) controls interpolation behavior:
Q.SMOOTH
so the pawn spends about half its time behind the actor’s position and half ahead. This provides optimal balance between smoothness and responsiveness.tps
(ticks per second) option controls reflector heartbeat frequency:
Q.TICK_MS = 500
means the reflector sends heartbeat ticks twice per second maximum. Set heartbeat rate to match your model’s update frequency.Model Tick Rate
Smoothing Factor
Movement Speed
Proximity Threshold
Q.SMOOTH
to 0 (causes no movement)