Class: OrbitController
Orbit Camera Controller
Hierarchy
↳
OrbitController
Constructors
Properties
Accessors
- eventDispatcher
- isStart
- transform
- enable
- target
- smooth
- minDistance
- maxDistance
- minPolarAngle
- maxPolarAngle
- spherical
Methods
- init
- stop
- onLateUpdate
- onBeforeUpdate
- onCompute
- onGraphic
- onParentChange
- onAddChild
- onRemoveChild
- cloneTo
- copyComponent
- beforeDestroy
- destroy
Constructors
constructor
• new OrbitController(): OrbitController
Returns
Overrides
Defined in
src/components/controller/OrbitController.ts:57
Properties
object3D
• object3D: Object3D
= null
owner object3D
Inherited from
Defined in
src/components/ComponentBase.ts:17
isDestroyed
• Optional
isDestroyed: boolean
Inherited from
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
Inherited from
ComponentBase.eventDispatcher
Defined in
src/components/ComponentBase.ts:23
• set
eventDispatcher(value
): void
Parameters
Name | Type |
---|---|
value | CEventDispatcher |
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
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
Name | Type |
---|---|
value | boolean |
Returns
void
Inherited from
ComponentBase.enable
Defined in
src/components/ComponentBase.ts:54
target
• get
target(): Vector3
Get the target position
Returns
Defined in
src/components/controller/OrbitController.ts:63
• set
target(v
): void
Set the target position
Parameters
Name | Type |
---|---|
v | Vector3 |
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
Name | Type |
---|---|
v | number |
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
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
Name | Type |
---|---|
v | number |
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
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
Name | Type |
---|---|
v | number |
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
-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
Name | Type |
---|---|
v | number |
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
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
Name | Type |
---|---|
v | number |
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
Name | Type |
---|---|
param? | any |
Returns
void
Inherited from
Defined in
src/components/ComponentBase.ts:112
stop
▸ stop(): void
Returns
void
Inherited from
Defined in
src/components/ComponentBase.ts:114
onLateUpdate
▸ onLateUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:118
onBeforeUpdate
▸ onBeforeUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:119
onCompute
▸ onCompute(view?
, command?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
command? | GPUCommandEncoder |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:120
onGraphic
▸ onGraphic(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:121
onParentChange
▸ onParentChange(lastParent?
, currentParent?
): any
Parameters
Name | Type |
---|---|
lastParent? | Object3D |
currentParent? | Object3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:122
onAddChild
▸ onAddChild(child
): any
Parameters
Name | Type |
---|---|
child | Object3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:123
onRemoveChild
▸ onRemoveChild(child
): any
Parameters
Name | Type |
---|---|
child | Object3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:124
cloneTo
▸ cloneTo(obj
): void
clone component data to target object3D
Parameters
Name | Type | Description |
---|---|---|
obj | Object3D | target object3D |
Returns
void
Inherited from
Defined in
src/components/ComponentBase.ts:131
copyComponent
▸ copyComponent(from
): this
Parameters
Name | Type |
---|---|
from | this |
Returns
this
Inherited from
Defined in
src/components/ComponentBase.ts:133
beforeDestroy
▸ beforeDestroy(force?
): void
before release this component, object refrences are not be set null now.
Parameters
Name | Type |
---|---|
force? | boolean |
Returns
void
Inherited from
Defined in
src/components/ComponentBase.ts:200
destroy
▸ destroy(force?
): void
release this component
Parameters
Name | Type |
---|---|
force? | boolean |
Returns
void