new FlyControlComponent()
第一人称/第三人称飞行控制器组件构造函数
Methods
-
enableChangeDirecetionByMouseMove(enable)
-
设置是否可以通过鼠标移动改变方向
Parameters:
Name Type Description enableboolean 设置是否可以通过鼠标移动改变方向 -
enableLockPointerByMouseDown(enable)
-
设置是否可以通过鼠标按下锁定指针,仅在指针锁定模式下有效
Parameters:
Name Type Description enableboolean 设置是否可以通过鼠标按下锁定指针 -
getHotKey(type) → {THING.CodeType}
-
获取热键
Parameters:
Name Type Description typeTHING.FlyControlKeyType 键类型;表示该键的用途 Returns:
THING.CodeType - 键码;表示键盘上的实际按键 -
getPickedObject() → {object}
-
获取当前被拾取的对象
Returns:
object - 返回被focusUI拾取的对象 -
setAttachCamera(attachCamera, cameraNear)
-
设置附加相机
Parameters:
Name Type Default Description attachCameraThing.Camera 附加的相机 cameraNearnumber 0.1 附加相机的近平面距离 -
setClearInteractWhenFocusOut(clear)
-
设置当失去3D窗口焦点时是否清除交互效果目前效果包括移动和转向,但不包括重力
Parameters:
Name Type Description clearboolean true表示当失去3D窗口焦点时清除交互效果 -
setEyeHeight(height)
-
设置相机高度
Parameters:
Name Type Description heightnumber 相机高于地板的高度 -
setFloorObject(floorobj)
-
设置地板对象
Parameters:
Name Type Description floorobjobject 我们必须站立的地板 -
setFocusUI(focus_ui)
-
设置焦点UI
Parameters:
Name Type Description focus_uiHTMLElement 焦点UI的div元素 -
setHotKey(type, code)
-
设置热键
Parameters:
Name Type Description typeTHING.FlyControlKeyType 键类型;表示该键的用途 codeTHING.CodeType 键码;表示键盘上的实际按键 -
setInteractActionName(type, actionName)
-
设置交互动作名称
Parameters:
Name Type Description typestring 交互类型,可能是InteractType中的一个元素 actionNamestring 交互动作名称 -
setInteractActionSpeed(type, actionSpeed)
-
设置交互动作速度
Parameters:
Name Type Description typestring 交互类型,可能是InteractType中的一个元素 actionSpeednumber 交互动作动画速度 -
setInteractSpeed(type, speed)
-
设置交互速度
Parameters:
Name Type Description typestring 交互类型,可能是InteractType中的一个元素 但只有walk\run\jump\fly\flyup\flydown有意义 speednumber 交互速度,如行走速度 -
setMaxPitch(pitch)
-
设置最大俯仰角
Parameters:
Name Type Description pitchnumber 最大俯仰角值 -
setMinPitch(pitch)
-
设置最小俯仰角
Parameters:
Name Type Description pitchnumber 最小俯仰角值 -
setPlayerTurning(turning)
-
设置玩家转向
Parameters:
Name Type Description turningnumber 玩家Y轴转向角度 -
setPointerLockEnable(enable)
-
设置指针锁定模式是否启用
Parameters:
Name Type Description enableboolean 是否启用指针锁定模式 -
setThirdPersonCameraDis(dis)
-
设置对象和相机之间的距离
Parameters:
Name Type Description disnumber 第三人称视角下对象和相机之间的距离 -
setUseLocalUp(use)
-
设置是否使用对象的up向量
Parameters:
Name Type Description useboolean 是否使用对象的up向量