Skip to main content

Class: MovingCamera

Defined in: core/CameraExtensions.ts:33

MovingCamera - A camera that supports animated position and zoom changes. Extends Camera2D with animation capabilities for smooth camera movements.

Extends

Constructors

Constructor

new MovingCamera(options): MovingCamera

Defined in: core/CameraExtensions.ts:51

Create a new MovingCamera.

Parameters

options

MovingCameraOptions = {}

Camera configuration options

Returns

MovingCamera

Overrides

Camera2D.constructor

Accessors

frame

Get Signature

get frame(): Camera2DFrame

Defined in: core/Camera.ts:289

Lazy-created Camera2DFrame for Manim-style camera.frame API. The frame is a VMobject whose position and scale drive the camera, enabling animations like Restore, MoveToTarget, and updaters.

Returns

Camera2DFrame

Inherited from

Camera2D.frame


frameHeight

Get Signature

get frameHeight(): number

Defined in: core/Camera.ts:237

Get the frame height in world units.

Returns

number

Set Signature

set frameHeight(height): void

Defined in: core/Camera.ts:244

Set the frame height in world units.

Parameters
height

number

Returns

void

Inherited from

Camera2D.frameHeight


frameWidth

Get Signature

get frameWidth(): number

Defined in: core/Camera.ts:222

Get the frame width in world units.

Returns

number

Set Signature

set frameWidth(width): void

Defined in: core/Camera.ts:229

Set the frame width in world units.

Parameters
width

number

Returns

void

Inherited from

Camera2D.frameWidth


position

Get Signature

get position(): Vector3

Defined in: core/Camera.ts:252

Get the camera position.

Returns

Vector3

Inherited from

Camera2D.position


zoom

Get Signature

get zoom(): number

Defined in: core/CameraExtensions.ts:70

Get the current zoom level.

Returns

number

Set Signature

set zoom(zoom): void

Defined in: core/CameraExtensions.ts:78

Set the zoom level immediately.

Parameters
zoom

number

Zoom level (1 = default, >1 = zoomed in)

Returns

void

Methods

animateTo()

animateTo(options): this

Defined in: core/CameraExtensions.ts:117

Configure and start an animation to the target state.

Parameters

options

CameraAnimationOptions

Animation options including position, zoom, duration, and easing

Returns

this

this for chaining


follow()

follow(target, offset): this

Defined in: core/CameraExtensions.ts:150

Set a mobject to follow. The camera will continuously track this mobject's position.

Parameters

target

Mobject

Mobject to follow, or null to stop following

offset

Vector3Tuple = ...

Optional offset from the target's center [x, y, z]

Returns

this

this for chaining


getCamera()

getCamera(): OrthographicCamera

Defined in: core/Camera.ts:269

Get the underlying Three.js OrthographicCamera.

Returns

OrthographicCamera

The OrthographicCamera instance

Inherited from

Camera2D.getCamera


isAnimating()

isAnimating(): boolean

Defined in: core/CameraExtensions.ts:168

Check if an animation is in progress.

Returns

boolean


moveTo()

moveTo(point): void

Defined in: core/Camera.ts:260

Move the camera to a specific point.

Parameters

point

[number, number, number]

Target position [x, y, z]

Returns

void

Inherited from

Camera2D.moveTo


resetAnimation()

resetAnimation(): this

Defined in: core/CameraExtensions.ts:227

Reset all animation state.

Returns

this

this for chaining


setAspectRatio()

setAspectRatio(aspectRatio): void

Defined in: core/Camera.ts:278

Update the frame dimensions to match an aspect ratio. Useful for responsive layouts.

Parameters

aspectRatio

number

Width / height ratio

Returns

void

Inherited from

Camera2D.setAspectRatio


setTargetPosition()

setTargetPosition(position): this

Defined in: core/CameraExtensions.ts:97

Set the target position for animation.

Parameters

position

Vector3Tuple

Target position [x, y, z]

Returns

this

this for chaining


setTargetZoom()

setTargetZoom(zoom): this

Defined in: core/CameraExtensions.ts:107

Set the target zoom level for animation.

Parameters

zoom

number

Target zoom level

Returns

this

this for chaining


stopFollowing()

stopFollowing(): this

Defined in: core/CameraExtensions.ts:160

Stop following any mobject.

Returns

this

this for chaining


update()

update(dt): void

Defined in: core/CameraExtensions.ts:179

Update the camera animation and follow target. Should be called each frame with delta time.

Parameters

dt

number

Delta time in seconds

Returns

void


updateFrame()

updateFrame(dt): void

Defined in: core/Camera.ts:301

Run updaters on the camera frame (if it exists). Called by Scene after the timeline update so camera updaters see the latest positions set by animations.

Parameters

dt

number

Returns

void

Inherited from

Camera2D.updateFrame