Appearance
firstPersonCameraControl ?
FirstPersonCameraControl ?
Kind: global class
new FirstPersonCameraControl(opts) ?
第一人稱控制(帶碰撞檢測)
| Param | Type | Description |
|---|---|---|
| opts | object | 參數(shù) |
| opts.viewer | Viewer | 場景類 |
| opts.isOctree | boolean | 是否開啟八叉樹碰撞,默認(rèn)射線檢測(大場景亦可)。八叉樹(碰撞較為流暢,超過 4 萬面場景建立八叉樹會有卡頓崩潰問題,目前適用于小場景) |
| opts.colliders | Array | 碰撞對象 |
| opts.moveSpeed | number | 移動速度 |
| opts.speedUp | number | 加速度(同時按 shift 后的速度倍數(shù)) |
| opts.lookSpeed | number | 轉(zhuǎn)向速度 |
| opts.distance | number | 前后碰撞的距離 |
| opts.personHeight | number | 人的高度 |
firstPersonCameraControl.colliders ?
Kind: instance property of FirstPersonCameraControl
| Param | Type | Description |
|---|---|---|
| colliders | object | set objects for collision detection |
firstPersonCameraControl.enabled ?
Kind: instance property of FirstPersonCameraControl
| Param | Type | Description |
|---|---|---|
| isEnabled | boolean | set if this camera control is enabled |
firstPersonCameraControl.enabled ?
Kind: instance property of FirstPersonCameraControl
Description:: getter if current camera control is enabled.
firstPersonCameraControl.rotateX(value) ?
Kind: instance method of FirstPersonCameraControl
Description:: rotate camera by left/right
Return:: null
| Param | Type |
|---|---|
| value | number |
firstPersonCameraControl.rotateY(value) ?
Kind: instance method of FirstPersonCameraControl
Description:: rotate camera by up/down
Return:: null
| Param | Type |
|---|---|
| value | number |
firstPersonCameraControl.update() ?
Kind: instance method of FirstPersonCameraControl
Description:: update current calcuate each frame.