Skip to main content

Class: MovingCamera

Defined in: core/CameraExtensions.ts:39

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:57

Create a new MovingCamera.

Parameters

options

MovingCameraOptions = {}

Camera configuration options

Returns

MovingCamera

Overrides

Camera2D.constructor

Accessors

aspectMode

Get Signature

get aspectMode(): Camera2DAspectMode

Defined in: core/Camera.ts:345

Get the current aspect-mode (see Camera2DAspectMode).

Returns

Camera2DAspectMode

Set Signature

set aspectMode(mode): void

Defined in: core/Camera.ts:353

Set the aspect-mode. Re-applies the current aspect ratio so the projection updates immediately.

Parameters
mode

Camera2DAspectMode

Returns

void

Inherited from

Camera2D.aspectMode


frame

Get Signature

get frame(): Camera2DFrame

Defined in: core/Camera.ts:416

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:329

Get the frame height in world units.

Returns

number

Set Signature

set frameHeight(height): void

Defined in: core/Camera.ts:336

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:313

Get the frame width in world units.

Returns

number

Set Signature

set frameWidth(width): void

Defined in: core/Camera.ts:320

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:363

Get the camera position.

Returns

Vector3

Inherited from

Camera2D.position


zoom

Get Signature

get zoom(): number

Defined in: core/CameraExtensions.ts:76

Get the current zoom level.

Returns

number

Set Signature

set zoom(zoom): void

Defined in: core/CameraExtensions.ts:84

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:123

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:156

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:380

Get the underlying Three.js OrthographicCamera.

Returns

OrthographicCamera

The OrthographicCamera instance

Inherited from

Camera2D.getCamera


isAnimating()

isAnimating(): boolean

Defined in: core/CameraExtensions.ts:174

Check if an animation is in progress.

Returns

boolean


moveTo()

moveTo(point): void

Defined in: core/Camera.ts:371

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:233

Reset all animation state.

Returns

this

this for chaining


setAspectRatio()

setAspectRatio(aspectRatio): void

Defined in: core/Camera.ts:389

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:103

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:113

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:166

Stop following any mobject.

Returns

this

this for chaining


update()

update(dt): void

Defined in: core/CameraExtensions.ts:185

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:428

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