Orbital camera that rotates around a point. Useful for boss introductions, cinematic reveals, and menu screens.
Usage:
const orbital = new OrbitalCamera(scene, { centerX: 400, centerY: 300, radius: 200, angularSpeed: 0.5,});orbital.start();// In update:orbital.update(delta);// Transition back to follow:await orbital.transitionToFollow(player, 1000); Copy
const orbital = new OrbitalCamera(scene, { centerX: 400, centerY: 300, radius: 200, angularSpeed: 0.5,});orbital.start();// In update:orbital.update(delta);// Transition back to follow:await orbital.transitionToFollow(player, 1000);
Set angular speed
Set the orbital center
Set the orbital radius
Start orbiting
Stop orbiting
Smoothly transition from orbital to following a target
Update the orbital camera. Call each frame.
Orbital camera that rotates around a point. Useful for boss introductions, cinematic reveals, and menu screens.
Usage: