Class: FlyCameraController
Free camera controller. Move forward, backward, left, and right in the direction of W A S D. Control the camera's movement direction by holding down the left mouse button
Hierarchy
↳
FlyCameraController
Constructors
Properties
Accessors
Methods
- init
- stop
- onEnable
- onDisable
- onLateUpdate
- onBeforeUpdate
- onCompute
- onGraphic
- onParentChange
- onAddChild
- onRemoveChild
- cloneTo
- copyComponent
- beforeDestroy
- setCamera
- onUpdate
Constructors
constructor
• new FlyCameraController(): FlyCameraController
Returns
Overrides
Defined in
src/components/controller/FlyCameraController.ts:54
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
moveSpeed
• moveSpeed: number
= 2
Camera movement speed
Defined in
src/components/controller/FlyCameraController.ts:20
targetPos
• targetPos: Vector3
Coordinates of specific objects
Defined in
src/components/controller/FlyCameraController.ts:25
lookAtPos
• lookAtPos: Vector3
Camera orientation coordinates
Defined in
src/components/controller/FlyCameraController.ts:30
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
factory
• get
factory(): number
Get the smoothness of the camera by keyboard control
Returns
number
Defined in
src/components/controller/FlyCameraController.ts:176
• set
factory(value
): void
Set the smoothness of the camera by keyboard control
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Defined in
src/components/controller/FlyCameraController.ts:184
mouseFactory
• get
mouseFactory(): number
Get the smoothness of the camera by mouse control
Returns
number
Defined in
src/components/controller/FlyCameraController.ts:192
• set
mouseFactory(value
): void
Set the smoothness of the camera by mouse control
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Defined in
src/components/controller/FlyCameraController.ts:200
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
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
setCamera
▸ setCamera(cameraPos
, lookAt
): void
Initialize camera data
Parameters
Name | Type | Description |
---|---|---|
cameraPos | Vector3 | source position |
lookAt | Vector3 | target position |
Returns
void
Defined in
src/components/controller/FlyCameraController.ts:74
onUpdate
▸ onUpdate(): void
Returns
void