Class: HoverCameraController
Hovering camera controller
Hierarchy
↳
HoverCameraController
Constructors
Properties
- object3D
- isDestroyed
- camera
- minDistance
- maxDistance
- rollSmooth
- dragSmooth
- wheelSmooth
- wheelStep
- mouseRightFactor
- mouseLeftFactor
- smooth
- distance
- roll
- pitch
Accessors
Methods
- init
- stop
- onEnable
- onDisable
- onUpdate
- onLateUpdate
- onCompute
- onGraphic
- onParentChange
- onAddChild
- onRemoveChild
- cloneTo
- copyComponent
- beforeDestroy
- flowTarget
- getFlowTarget
- setCamera
- focusByBounds
- onBeforeUpdate
Constructors
constructor
• new HoverCameraController(): HoverCameraController
Returns
Overrides
Defined in
src/components/controller/HoverCameraController.ts:130
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
camera
• camera: Camera3D
camera controlling
Defined in
src/components/controller/HoverCameraController.ts:22
minDistance
• minDistance: number
= 0.1
The closest distance that the mouse wheel can operate
Defined in
src/components/controller/HoverCameraController.ts:27
maxDistance
• maxDistance: number
= 500
The farthest distance that the mouse wheel can operate
Defined in
src/components/controller/HoverCameraController.ts:32
rollSmooth
• rollSmooth: number
= 15.0
Smoothing coefficient of rolling angle
Defined in
src/components/controller/HoverCameraController.ts:37
dragSmooth
• dragSmooth: number
= 20
Smoothing coefficient of dragging
Defined in
src/components/controller/HoverCameraController.ts:42
wheelSmooth
• wheelSmooth: number
= 10
Smoothing coefficient of rolling
Defined in
src/components/controller/HoverCameraController.ts:47
wheelStep
• wheelStep: number
= 0.002
Mouse scrolling step coefficient
Defined in
src/components/controller/HoverCameraController.ts:52
mouseRightFactor
• mouseRightFactor: number
= 0.25
Right mouse movement coefficient
Defined in
src/components/controller/HoverCameraController.ts:57
mouseLeftFactor
• mouseLeftFactor: number
= 20
Left mouse movement coefficient
Defined in
src/components/controller/HoverCameraController.ts:62
smooth
• smooth: boolean
= true
Whether to enable smooth mode
Defined in
src/components/controller/HoverCameraController.ts:67
distance
• distance: number
= 10
Distance between camera and target
Defined in
src/components/controller/HoverCameraController.ts:79
roll
• roll: number
= 0
Roll angle around y-axis
Defined in
src/components/controller/HoverCameraController.ts:85
pitch
• pitch: number
= 0
Pitch angle around x-axis
Defined in
src/components/controller/HoverCameraController.ts:91
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
bottomClamp
• get
bottomClamp(): number
Max angle of pitch
Returns
number
Defined in
src/components/controller/HoverCameraController.ts:109
• set
bottomClamp(value
): void
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Defined in
src/components/controller/HoverCameraController.ts:112
topClamp
• get
topClamp(): number
Min angle of pitch
Returns
number
Defined in
src/components/controller/HoverCameraController.ts:118
• set
topClamp(value
): void
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Defined in
src/components/controller/HoverCameraController.ts:121
target
• get
target(): Vector3
Get target position
Returns
Defined in
src/components/controller/HoverCameraController.ts:192
• set
target(target
): void
Set target position
Parameters
Name | Type |
---|---|
target | Vector3 |
Returns
void
Defined in
src/components/controller/HoverCameraController.ts:184
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
onEnable
▸ onEnable(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:115
onDisable
▸ onDisable(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:116
onUpdate
▸ onUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:117
onLateUpdate
▸ onLateUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:118
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
flowTarget
▸ flowTarget(target
, offset?
): void
Parameters
Name | Type | Default value |
---|---|---|
target | Object3D | undefined |
offset | Vector3 | Vector3.ZERO |
Returns
void
Defined in
src/components/controller/HoverCameraController.ts:147
getFlowTarget
▸ getFlowTarget(): Object3D
Returns
Defined in
src/components/controller/HoverCameraController.ts:153
setCamera
▸ setCamera(roll
, pitch
, distance
, target?
): void
Initialize Camera
Parameters
Name | Type | Description |
---|---|---|
roll | number | Roll angle around y-axis |
pitch | number | Pitch angle around x-axis |
distance | number | max distance to target |
target? | Vector3 | coordinates of the target |
Returns
void
Defined in
src/components/controller/HoverCameraController.ts:164
focusByBounds
▸ focusByBounds(obj
): void
Parameters
Name | Type |
---|---|
obj | Object3D |
Returns
void
Defined in
src/components/controller/HoverCameraController.ts:176
onBeforeUpdate
▸ onBeforeUpdate(view?
): void
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
void