Skip to main content

SimpleCamera

A basic camera that uses yomotsu's cameracontrols to control the camera in 2D and 3D. Check out it's API to find out what features it offers.

Extends

Extended by

Implements

Properties

currentWorld

currentWorld: null | World = null

The current world this item is associated with. It can be null if no world is currently active.

Inherited from

BaseCamera . currentWorld


onAfterUpdate

readonly onAfterUpdate: Event <SimpleCamera>

Updateable.onAfterUpdate

Implementation of

Updateable . onAfterUpdate


onAspectUpdated

readonly onAspectUpdated: Event<unknown>

Event that is triggered when the aspect of the camera has been updated. This event is useful when you need to perform actions after the aspect of the camera has been changed.


onBeforeUpdate

readonly onBeforeUpdate: Event <SimpleCamera>

Updateable.onBeforeUpdate

Implementation of

Updateable . onBeforeUpdate


onDisposed

readonly onDisposed: Event<string>

Disposable.onDisposed

Implementation of

Disposable . onDisposed


onWorldChanged

readonly onWorldChanged: Event<object>

Event that is triggered when a world is added or removed from the worlds map. The event payload contains the world instance and the action ("added" or "removed").

Type declaration

action

action: "added" | "removed"

world

world: World

Inherited from

BaseCamera . onWorldChanged


three

three: PerspectiveCamera | OrthographicCamera

A three.js PerspectiveCamera or OrthographicCamera instance. This camera is used for rendering the scene.

Overrides

BaseCamera . three

Accessors

controls

get controls(): CameraControls

The object that controls the camera. An instance of yomotsu's cameracontrols. Transforming the camera directly will have no effect: you need to use this object to move, rotate, look at objects, etc.

Returns

CameraControls


enabled

get enabled(): boolean

Getter for the enabled state of the camera controls. If the current world is null, it returns false. Otherwise, it returns the enabled state of the camera controls.

set enabled(enabled): void

Setter for the enabled state of the camera controls. If the current world is not null, it sets the enabled state of the camera controls to the provided value.

Parameters

ParameterTypeDescription
enabledbooleanThe new enabled state of the camera controls.

Returns

boolean

The enabled state of the camera controls.

Methods

dispose()

dispose(): void

Disposable.dispose

Returns

void

Implementation of

Disposable . dispose


hasCameraControls()

hasCameraControls(): this is CameraControllable

Checks whether the instance is CameraControllable.

Returns

this is CameraControllable

True if the instance is controllable, false otherwise.

Inherited from

BaseCamera . hasCameraControls


isConfigurable()

isConfigurable(): this is Configurable<any, any>

Whether is component is Configurable.

Returns

this is Configurable<any, any>

Inherited from

BaseCamera . isConfigurable


isDisposeable()

isDisposeable(): this is Disposable

Whether is component is Disposable.

Returns

this is Disposable

Inherited from

BaseCamera . isDisposeable


isHideable()

isHideable(): this is Hideable

Whether is component is Hideable.

Returns

this is Hideable

Inherited from

BaseCamera . isHideable


isResizeable()

isResizeable(): this is Resizeable

Whether is component is Resizeable.

Returns

this is Resizeable

Inherited from

BaseCamera . isResizeable


isUpdateable()

isUpdateable(): this is Updateable

Whether is component is Updateable.

Returns

this is Updateable

Inherited from

BaseCamera . isUpdateable


update()

update(_delta): void

Updateable.update

Parameters

ParameterType
_deltanumber

Returns

void

Implementation of

Updateable . update


updateAspect()

updateAspect(): void

Updates the aspect of the camera to match the size of the Components.renderer.

Returns

void