Appearance
firstPersonCameraControl
FirstPersonCameraControl
Kind: global class
new FirstPersonCameraControl(opts)
第一人称控制(带碰撞检测)
Param | Type | Description |
---|---|---|
opts | object | 参数 |
opts.viewer | Viewer | 场景类 |
opts.isOctree | boolean | 是否开启八叉树碰撞,默认射线检测(大场景亦可)。八叉树(碰撞较为流畅,超过 4 万面场景建立八叉树会有卡顿崩溃问题,目前适用于小场景) |
opts.colliders | Array | 碰撞对象 |
opts.moveSpeed | number | 移动速度 |
opts.speedUp | number | 加速度(同时按 shift 后的速度倍数) |
opts.lookSpeed | number | 转向速度 |
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.