|
|
@@ -7,6 +7,8 @@
|
|
|
<link type="text/css" rel="stylesheet" href="page.css" />
|
|
|
</head>
|
|
|
<body>
|
|
|
+ [page:Controls] →
|
|
|
+
|
|
|
<h1>轨道控制器([name])</h1>
|
|
|
|
|
|
<p class="desc">
|
|
|
@@ -67,7 +69,7 @@
|
|
|
<p>
|
|
|
[page:Camera object]: (必须)将要被控制的相机。该相机不允许是其他任何对象的子级,除非该对象是场景自身。<br><br>
|
|
|
|
|
|
- [page:HTMLDOMElement domElement]: 用于事件监听的HTML元素。
|
|
|
+ [page:HTMLDOMElement domElement]: 用于事件监听的HTML元素。(可选)
|
|
|
</p>
|
|
|
|
|
|
<h2>Events</h2>
|
|
|
@@ -89,12 +91,13 @@
|
|
|
|
|
|
<h2>属性</h2>
|
|
|
|
|
|
+ <p>共有属性请参见其基类[page:Controls]。</p>
|
|
|
+
|
|
|
<h3>[property:Boolean autoRotate]</h3>
|
|
|
<p>
|
|
|
将其设为true,以自动围绕目标旋转。<br>
|
|
|
请注意,如果它被启用,你必须在你的动画循环里调用[page:.update]()。
|
|
|
- Set to true to automatically rotate around the target.<br> Note that if this is enabled, you must call [page:.update]
|
|
|
- () in your animation loop. If you want the auto-rotate speed to be independent of the frame rate (the refresh rate of the display), you must pass the time `deltaTime`, in seconds, to [page:.update]().
|
|
|
+ 如果希望自动旋转速度与帧速率(显示器的刷新率)无关,则必须将时间 `deltaTime`(以秒为单位)传递给 [page:.update]()。
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Float autoRotateSpeed]</h3>
|
|
|
@@ -110,16 +113,6 @@
|
|
|
请注意,要使得这一值生效,你必须在你的动画循环里调用[page:.update]()。
|
|
|
</p>
|
|
|
|
|
|
- <h3>[property:HTMLDOMElement domElement]</h3>
|
|
|
- <p>
|
|
|
- 该 HTMLDOMElement 用于监听鼠标/触摸事件,该属性必须在构造函数中传入。在此处改变它将不会设置新的事件监听。
|
|
|
- </p>
|
|
|
-
|
|
|
- <h3>[property:Boolean enabled]</h3>
|
|
|
- <p>
|
|
|
- 当设置为false时,控制器将不会响应用户的操作。默认值为true。
|
|
|
- </p>
|
|
|
-
|
|
|
<h3>[property:Boolean enableDamping]</h3>
|
|
|
<p>
|
|
|
将其设置为true以启用阻尼(惯性),这将给控制器带来重量感。默认值为false。<br>
|
|
|
@@ -177,6 +170,11 @@ controls.keys = {
|
|
|
你能够垂直旋转的角度的上限,范围是0到Math.PI,其默认值为Math.PI。
|
|
|
</p>
|
|
|
|
|
|
+ <h3>[property:Float maxTargetRadius]</h3>
|
|
|
+ <p>
|
|
|
+ 你能够让目标移动离 [page:.cursor] 有多远,其默认值为Infinity。
|
|
|
+ </p>
|
|
|
+
|
|
|
<h3>[property:Float maxZoom]</h3>
|
|
|
<p>
|
|
|
你能够将相机缩小多少(仅适用于[page:OrthographicCamera]),其默认值为Infinity。
|
|
|
@@ -197,6 +195,11 @@ controls.keys = {
|
|
|
你能够垂直旋转的角度的下限,范围是0到Math.PI,其默认值为0。
|
|
|
</p>
|
|
|
|
|
|
+ <h3>[property:Float minTargetRadius]</h3>
|
|
|
+ <p>
|
|
|
+ 你能够让目标移动离 [page:.cursor] 有多近,其默认值为0。
|
|
|
+ </p>
|
|
|
+
|
|
|
<h3>[property:Float minZoom]</h3>
|
|
|
<p>
|
|
|
你能够将相机放大多少(仅适用于[page:OrthographicCamera]),其默认值为0。
|
|
|
@@ -215,11 +218,6 @@ controls.mouseButtons = {
|
|
|
</code>
|
|
|
</p>
|
|
|
|
|
|
- <h3>[property:Camera object]</h3>
|
|
|
- <p>
|
|
|
- 正被控制的摄像机。
|
|
|
- </p>
|
|
|
-
|
|
|
<h3>[property:Float panSpeed]</h3>
|
|
|
<p>
|
|
|
位移的速度,其默认值为1。
|
|
|
@@ -253,6 +251,11 @@ controls.mouseButtons = {
|
|
|
它可以在任何时候被手动更新,以更改控制器的焦点。
|
|
|
</p>
|
|
|
|
|
|
+ <h3>[property:Vector3 cursor]</h3>
|
|
|
+ <p>
|
|
|
+ 被 [page:.minTargetRadius] 和 [page:.maxTargetRadius] 限制的焦点。可随时手动更新以更改 [page:.target] 的兴趣中心。
|
|
|
+ </p>
|
|
|
+
|
|
|
<h3>[property:Object touches]</h3>
|
|
|
<p>
|
|
|
该对象包含由控件所使用的触摸操作的引用。
|
|
|
@@ -276,15 +279,12 @@ controls.touches = {
|
|
|
|
|
|
<h3>[property:Boolean zoomToCursor]</h3>
|
|
|
<p>
|
|
|
- Setting this property to `true` allows to zoom to the cursor's position. Default is `false`.
|
|
|
+ 将此属性设置为 `true` 可以缩放至光标位置。默认值为 `false`。
|
|
|
</p>
|
|
|
|
|
|
- <h2>Methods</h2>
|
|
|
+ <h2>方法</h2>
|
|
|
|
|
|
- <h3>[method:undefined dispose] ()</h3>
|
|
|
- <p>
|
|
|
- 移除所有的事件监听。
|
|
|
- </p>
|
|
|
+ <p>共有方法请参见其基类[page:Controls]。</p>
|
|
|
|
|
|
<h3>[method:radians getAzimuthalAngle] ()</h3>
|
|
|
<p>
|
|
|
@@ -298,7 +298,7 @@ controls.touches = {
|
|
|
|
|
|
<h3>[method:Float getDistance] ()</h3>
|
|
|
<p>
|
|
|
- Returns the distance from the camera to the target.
|
|
|
+ 返回从相机到目标的距离。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:undefined listenToKeyEvents] ( [param:HTMLDOMElement domElement] )</h3>
|
|
|
@@ -323,11 +323,7 @@ controls.touches = {
|
|
|
|
|
|
<h3>[method:Boolean update] ( [param:Number deltaTime] )</h3>
|
|
|
<p>
|
|
|
- 更新控制器。必须在摄像机的变换发生任何手动改变后调用,
|
|
|
- 或如果[page:.autoRotate]或[page:.enableDamping]被设置时,在update循环里调用。
|
|
|
- Update the controls. Must be called after any manual changes to the camera's transform,
|
|
|
- or in the update loop if [page:.autoRotate] or [page:.enableDamping] are set. `deltaTime`, in seconds, is optional,
|
|
|
- and is only required if you want the auto-rotate speed to be independent of the frame rate (the refresh rate of the display).
|
|
|
+ 更新控制器。必须在摄像机的变换发生任何手动改变后调用,或如果[page:.autoRotate]或[page:.enableDamping]被设置时,在update循环里调用。`deltaTime` 以秒为单位,是可选的,并且仅当您希望自动旋转速度独立于帧速率(显示器的刷新率)时才是必需的。
|
|
|
</p>
|
|
|
|
|
|
<h2>源代码</h2>
|