OrthographicCamera
A camera using an orthographic (parallel) projection.
Orthographic projection has no perspective foreshortening, so object size is independent of distance from the camera. This is the camera to use for 2D image viewing, where it pairs naturally with PanZoomControls. The initial frame is given in world coordinates; zoom and pan are applied as scale and translation on top of that frame.
Extends Camera and inherits all public properties and methods.
Constructor
Creates an orthographic camera framing the given world-space rectangle.
ts
new OrthographicCamera(props): OrthographicCamera;| Parameter | Type | Description |
|---|---|---|
props | OrthographicCameraProps | The view frame edges in world units, near/far clipping plane distances (default -1e6 and 1e6), and the slice orientation the camera faces (default "XY"). |
Accessors
viewportSize [number, number]
ts
get viewportSize(): [number, number];type CameraType overrides
ts
get type(): CameraType;orientation SliceOrientation
ts
get orientation(): SliceOrientation;Methods
setAspectRatio() void overrides
ts
setAspectRatio(aspectRatio): void;| Parameter | Type |
|---|---|
aspectRatio | number |
setFrame() void
ts
setFrame(__namedParameters): void;| Parameter | Type |
|---|---|
__namedParameters | OrthographicCameraFrame |
setOrientation() void
Changes the slice orientation the camera faces. The current frame and zoom carry over numerically to the new plane axes. Call setFrame to reframe the view for the new plane.
ts
setOrientation(orientation): void;| Parameter | Type |
|---|---|
orientation | SliceOrientation |
zoom() void overrides
ts
zoom(factor): void;| Parameter | Type |
|---|---|
factor | number |
getWorldViewRect() Box2
ts
getWorldViewRect(): Box2;updateProjectionMatrix() void overrides
ts
protected updateProjectionMatrix(): void;