Skip to content

Class: OrbitController

Orbit Camera Controller

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

constructor

new OrbitController(): OrbitController

Returns

OrbitController

Overrides

ComponentBase.constructor

Defined in

src/components/controller/OrbitController.ts:57

Properties

object3D

object3D: Object3D = null

owner object3D

Inherited from

ComponentBase.object3D

Defined in

src/components/ComponentBase.ts:17


isDestroyed

Optional isDestroyed: boolean

Inherited from

ComponentBase.isDestroyed

Defined in

src/components/ComponentBase.ts:38


autoRotate

autoRotate: boolean = false

Whether to enable automatic rotation

Defined in

src/components/controller/OrbitController.ts:21


autoRotateSpeed

autoRotateSpeed: number = 0.1

Automatic rotation speed coefficient

Defined in

src/components/controller/OrbitController.ts:25


rotateFactor

rotateFactor: number = 0.5

Rotation speed coefficient

Defined in

src/components/controller/OrbitController.ts:29


zoomFactor

zoomFactor: number = 0.1

Scale speed coefficient

Defined in

src/components/controller/OrbitController.ts:33


panFactor

panFactor: number = 0.25

Angle translation velocity coefficient

Defined in

src/components/controller/OrbitController.ts:37

Accessors

eventDispatcher

get eventDispatcher(): CEventDispatcher

Returns

CEventDispatcher

Inherited from

ComponentBase.eventDispatcher

Defined in

src/components/ComponentBase.ts:23

set eventDispatcher(value): void

Parameters

NameType
valueCEventDispatcher

Returns

void

Inherited from

ComponentBase.eventDispatcher

Defined in

src/components/ComponentBase.ts:28


isStart

get isStart(): boolean

Returns

boolean

Inherited from

ComponentBase.isStart

Defined in

src/components/ComponentBase.ts:40


transform

get transform(): Transform

Return the Transform component attached to the Object3D.

Returns

Transform

Inherited from

ComponentBase.transform

Defined in

src/components/ComponentBase.ts:47


enable

get enable(): boolean

Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.

Returns

boolean

Inherited from

ComponentBase.enable

Defined in

src/components/ComponentBase.ts:68

set enable(value): void

Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.

Parameters

NameType
valueboolean

Returns

void

Inherited from

ComponentBase.enable

Defined in

src/components/ComponentBase.ts:54


target

get target(): Vector3

Get the target position

Returns

Vector3

Defined in

src/components/controller/OrbitController.ts:63

set target(v): void

Set the target position

Parameters

NameType
vVector3

Returns

void

Defined in

src/components/controller/OrbitController.ts:69


smooth

get smooth(): number

Set smoothing coefficient of controller

Returns

number

Defined in

src/components/controller/OrbitController.ts:76

set smooth(v): void

Get smoothing coefficient of controller

Parameters

NameType
vnumber

Returns

void

Defined in

src/components/controller/OrbitController.ts:82


minDistance

get minDistance(): number

Get the minimum distance between the camera and the target coordinate

Returns

number

Default Value

ts
1

Defined in

src/components/controller/OrbitController.ts:89

set minDistance(v): void

Set the minimum distance between the camera and the target position min value: 0.000002 max value: this._maxDistance maxDistance

Parameters

NameType
vnumber

Returns

void

Defined in

src/components/controller/OrbitController.ts:97


maxDistance

get maxDistance(): number

Get the max distance between the camera and the target position

Returns

number

Default Value

ts
100000

Defined in

src/components/controller/OrbitController.ts:104

set maxDistance(v): void

Set the max distance between the camera and the target position min - this._maxDistance max - Infinity

Parameters

NameType
vnumber

Returns

void

Defined in

src/components/controller/OrbitController.ts:112


minPolarAngle

get minPolarAngle(): number

Get the lower elevation limit of the camera from the xz plane

Returns

number

Default Value

ts
-90

Defined in

src/components/controller/OrbitController.ts:120

set minPolarAngle(v): void

Set the lower elevation limit of the camera from the xz plane min - -90 max - maxPolarAngle

Parameters

NameType
vnumber

Returns

void

Defined in

src/components/controller/OrbitController.ts:128


maxPolarAngle

get maxPolarAngle(): number

Get the upper elevation limit of the camera from the xz plane

Returns

number

Default Value

ts
90

Defined in

src/components/controller/OrbitController.ts:135

set maxPolarAngle(v): void

Set the upper elevation limit of the camera to the xz plane min - less than minPolarAngle
max - 90

Parameters

NameType
vnumber

Returns

void

Defined in

src/components/controller/OrbitController.ts:143


spherical

get spherical(): Spherical

Returns

Spherical

Defined in

src/components/controller/OrbitController.ts:147

Methods

init

init(param?): void

Parameters

NameType
param?any

Returns

void

Inherited from

ComponentBase.init

Defined in

src/components/ComponentBase.ts:112


stop

stop(): void

Returns

void

Inherited from

ComponentBase.stop

Defined in

src/components/ComponentBase.ts:114


onLateUpdate

onLateUpdate(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

ComponentBase.onLateUpdate

Defined in

src/components/ComponentBase.ts:118


onBeforeUpdate

onBeforeUpdate(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

ComponentBase.onBeforeUpdate

Defined in

src/components/ComponentBase.ts:119


onCompute

onCompute(view?, command?): any

Parameters

NameType
view?View3D
command?GPUCommandEncoder

Returns

any

Inherited from

ComponentBase.onCompute

Defined in

src/components/ComponentBase.ts:120


onGraphic

onGraphic(view?): any

Parameters

NameType
view?View3D

Returns

any

Inherited from

ComponentBase.onGraphic

Defined in

src/components/ComponentBase.ts:121


onParentChange

onParentChange(lastParent?, currentParent?): any

Parameters

NameType
lastParent?Object3D
currentParent?Object3D

Returns

any

Inherited from

ComponentBase.onParentChange

Defined in

src/components/ComponentBase.ts:122


onAddChild

onAddChild(child): any

Parameters

NameType
childObject3D

Returns

any

Inherited from

ComponentBase.onAddChild

Defined in

src/components/ComponentBase.ts:123


onRemoveChild

onRemoveChild(child): any

Parameters

NameType
childObject3D

Returns

any

Inherited from

ComponentBase.onRemoveChild

Defined in

src/components/ComponentBase.ts:124


cloneTo

cloneTo(obj): void

clone component data to target object3D

Parameters

NameTypeDescription
objObject3Dtarget object3D

Returns

void

Inherited from

ComponentBase.cloneTo

Defined in

src/components/ComponentBase.ts:131


copyComponent

copyComponent(from): this

Parameters

NameType
fromthis

Returns

this

Inherited from

ComponentBase.copyComponent

Defined in

src/components/ComponentBase.ts:133


beforeDestroy

beforeDestroy(force?): void

before release this component, object refrences are not be set null now.

Parameters

NameType
force?boolean

Returns

void

Inherited from

ComponentBase.beforeDestroy

Defined in

src/components/ComponentBase.ts:200


destroy

destroy(force?): void

release this component

Parameters

NameType
force?boolean

Returns

void

Inherited from

ComponentBase.destroy

Defined in

src/components/ComponentBase.ts:207