Skip to main content

Orbit Camera

The orbit camera moves the camera around a target object.

You can manually rotate around the object by clicking and dragging. This behaviour can be toggled when creating the orbit camera component.

this.world.addSystem(new TOrbitCameraSystem(this.world, engine.inputManager));
this.world.addSystem(new TMouseInputSystem(this.world, engine.inputManager));

this.world.createEntity([
new TCameraComponent({ type: TProjectionType.Perspective, fov: 45 }),
new TOrbitCameraComponent({ distance: 15, speed: 1, enableDrag: true }),
]);