Look-At Controller with Constraints and Smoothing.
Rotates objects to face targets with natural motion, angular limits, dead zones, and smooth damping.
Perfect for character heads, eyes, cameras, turrets, or any tracking behavior.
Features:
Maximum angle constraints (prevent unrealistic rotations)
Dead zone (ignore small movements)
Smooth damping (no instant snapping)
Exponential smoothing for natural feel
Use Cases:
Character head tracking player
Eyes following cursor
Camera smooth follow
Turret tracking enemies
NPCs watching interesting objects
Example
// Character head tracking player constheadController = newLookAtController({ maxAngle:Math.PI / 3, // Can't turn head more than 60° speed:5, // Tracking speed deadzone:0.05, // Ignore tiny movements smoothing:0.1// Smooth interpolation });
Look-At Controller with Constraints and Smoothing.
Rotates objects to face targets with natural motion, angular limits, dead zones, and smooth damping. Perfect for character heads, eyes, cameras, turrets, or any tracking behavior.
Features:
Use Cases:
Example
Example
Example