-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
227 changed files
with
33,077 additions
and
26,012 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<base href="../../../" /> | ||
<script src="page.js"></script> | ||
<link type="text/css" rel="stylesheet" href="page.css" /> | ||
</head> | ||
<body> | ||
[page:EventDispatcher] → | ||
|
||
<h1>[name]</h1> | ||
|
||
<p class="desc"> | ||
Abstract base class for controls. | ||
</p> | ||
|
||
<h2>Constructor</h2> | ||
|
||
<h3>[name]( [param:Object3D object], [param:HTMLDOMElement domElement] )</h3> | ||
|
||
<p> | ||
[page:Object3D object] - The object the controls should manage (usually the camera). | ||
</p> | ||
<p> | ||
[page:HTMLDOMElement domElement]: The HTML element used for event listeners. (optional) | ||
</p> | ||
<p> | ||
Creates a new instance of [name]. | ||
</p> | ||
|
||
<h2>Properties</h2> | ||
|
||
<h3>[property:HTMLDOMElement domElement]</h3> | ||
<p> | ||
The HTML element used for event listeners. If not provided via the constructor, [page:.connect]() must be called after `domElement` has been set. | ||
</p> | ||
|
||
<h3>[property:Boolean enabled]</h3> | ||
<p> | ||
When set to `false`, the controls will not respond to user input. Default is `true`. | ||
</p> | ||
|
||
<h3>[property:Object keys]</h3> | ||
<p> | ||
This object defines the keyboard input of the controls. | ||
Default is `{}`. | ||
</p> | ||
|
||
<h3>[property:Object mouseButtons]</h3> | ||
<p> | ||
This object defines what type of actions are assigned to the available mouse buttons. | ||
It depends on the control implementation what kind of mouse buttons and actions are supported. | ||
Default is `{ LEFT: null, MIDDLE: null, RIGHT: null }`. | ||
</p> | ||
<p> | ||
Possible buttons are: `LEFT`, `MIDDLE`, `RIGHT`. | ||
</p> | ||
<p> | ||
Possible actions are defined in the [page:Core Constants] page. | ||
</p> | ||
|
||
<h3>[property:Object3D object]</h3> | ||
<p> | ||
The 3D object that is managed by the controls. | ||
</p> | ||
|
||
<h3>[property:Integer state]</h3> | ||
<p> | ||
The internal state of the controls. Default is `-1` (`NONE`). | ||
</p> | ||
|
||
<h3>[property:Object touches]</h3> | ||
<p> | ||
This object defines what type of actions are assigned to what kind of touch interaction. | ||
It depends on the control implementation what kind of touch interaction and actions are supported. | ||
Default is `{ ONE: null, TWO: null }`. | ||
</p> | ||
<p> | ||
Possible buttons are: `ONE`, `TWO`. | ||
</p> | ||
<p> | ||
Possible actions are defined in the [page:Core Constants] page. | ||
</p> | ||
|
||
<h2>Methods</h2> | ||
|
||
<p>See the base [page:EventDispatcher] class for common methods.</p> | ||
|
||
<h3>[method:undefined connect] ()</h3> | ||
<p> | ||
Connects the controls to the DOM. This method has so called "side effects" since it adds the module's event listeners to the DOM. | ||
</p> | ||
|
||
<h3>[method:undefined disconnect] ()</h3> | ||
<p> | ||
Disconnects the controls from the DOM. | ||
</p> | ||
|
||
<h3>[method:undefined dispose] ()</h3> | ||
<p> | ||
Call this method if you no longer want use to the controls. It frees all internal resources and removes all event listeners. | ||
</p> | ||
|
||
<h3>[method:undefined update] ( [param:Number delta] )</h3> | ||
<p> | ||
Controls should implement this method if they have to update their internal state per simulation step. | ||
</p> | ||
|
||
<h2>Source</h2> | ||
|
||
<p> | ||
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | ||
</p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
<!DOCTYPE html> | ||
<html lang="zh"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<base href="../../../" /> | ||
<script src="page.js"></script> | ||
<link type="text/css" rel="stylesheet" href="page.css" /> | ||
</head> | ||
<body> | ||
[page:EventDispatcher] → | ||
|
||
<h1>控制器([name])</h1> | ||
|
||
<p class="desc"> | ||
控制器的抽象基类。 | ||
</p> | ||
|
||
<h2>构造函数</h2> | ||
|
||
<h3>[name]( [param:Object3D object], [param:HTMLDOMElement domElement] )</h3> | ||
|
||
<p> | ||
[page:Object3D object] - 控件应该管理的对象(通常是相机)。 | ||
</p> | ||
<p> | ||
[page:HTMLDOMElement domElement]: 用于添加事件侦听器的 HTML 元素。(可选) | ||
</p> | ||
<p> | ||
创建一个 [name] 实例。 | ||
</p> | ||
|
||
<h2>属性</h2> | ||
|
||
<h3>[property:HTMLDOMElement domElement]</h3> | ||
<p> | ||
用于添加事件侦听器的 HTML 元素。 如果没有在构造函数中提供,[page:.connect]() 必须在 `domElement` 设置后才能调用。 | ||
</p> | ||
|
||
<h3>[property:Boolean enabled]</h3> | ||
<p> | ||
如果设置为 `false`,控制器将不再响应用户设备输入。 默认值为 `true`。 | ||
</p> | ||
|
||
<h3>[property:Object keys]</h3> | ||
<p> | ||
该对象用于定义控制器的键盘输入。 | ||
默认值为 `{}`。 | ||
</p> | ||
|
||
<h3>[property:Object mouseButtons]</h3> | ||
<p> | ||
此对象定义分配给可用鼠标按键的操作类型。 | ||
支持哪些鼠标按键和操作取决于控制器的具体实现。 | ||
默认值为 `{ LEFT: null, MIDDLE: null, RIGHT: null }`。 | ||
</p> | ||
<p> | ||
按键可能为: `LEFT`, `MIDDLE`, `RIGHT`。 | ||
</p> | ||
<p> | ||
可能的操作是定义在 [page:Core Constants] 中。 | ||
</p> | ||
|
||
<h3>[property:Object3D object]</h3> | ||
<p> | ||
由控制器管理的 Object3D 对象。 | ||
</p> | ||
|
||
<h3>[property:Integer state]</h3> | ||
<p> | ||
控制器的内部状态。默认值为 `-1` (`NONE`)。 | ||
</p> | ||
|
||
<h3>[property:Object touches]</h3> | ||
<p> | ||
此对象定义将哪种类型的操作分配给哪种触摸交互。 | ||
支持哪种触摸交互和操作取决于控制器的具体实现。 | ||
默认值为 `{ ONE: null, TWO: null }`。 | ||
</p> | ||
<p> | ||
可能触摸点操作有: `ONE`, `TWO`. | ||
</p> | ||
<p> | ||
可能的操作是定义在 [page:Core Constants] 中。 | ||
</p> | ||
|
||
<h2>方法</h2> | ||
|
||
<p>共有方法请参见其基类[page:EventDispatcher]。</p> | ||
|
||
<h3>[method:undefined connect] ()</h3> | ||
<p> | ||
将控制器连接到 DOM。此方法具有所谓的“副作用”,因为它将模块的事件侦听器添加到 DOM。 | ||
</p> | ||
|
||
<h3>[method:undefined disconnect] ()</h3> | ||
<p> | ||
断开控制器与 DOM 的连接。 | ||
</p> | ||
|
||
<h3>[method:undefined dispose] ()</h3> | ||
<p> | ||
如果您不再需要使用这些控制器,请调用此方法。它将释放所有内部资源并删除所有事件侦听器。 | ||
</p> | ||
|
||
<h3>[method:undefined update] ( [param:Number delta] )</h3> | ||
<p> | ||
如果控制器必须在每个模拟步骤中更新其内部状态,则应实现此方法。 | ||
</p> | ||
|
||
<h2>源代码</h2> | ||
|
||
<p> | ||
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] | ||
</p> | ||
</body> | ||
</html> |
Oops, something went wrong.