|
11 | 11 | <h1>[name]</h1> |
12 | 12 |
|
13 | 13 | <p class="desc"> |
14 | | - |
15 | | - This class represents an abstraction of the WebXR Device API and is internally used by [page:WebGLRenderer]. |
16 | | - [name] also provides a public interface that allows users to enable/disable XR and perform XR related tasks like |
17 | | - for instance retrieving controllers. |
| 14 | + 此类表示WebXR设备API的抽象,并由[page:WebGLRenderer]在内部使用。 |
| 15 | + [name]还提供了一个公共接口,允许用户启用/禁用XR并执行XR相关任务,例如检索控制器。 |
18 | 16 | </p> |
19 | 17 |
|
20 | 18 | <h2>Properties</h2> |
21 | 19 |
|
22 | 20 | <h3>[property:Boolean cameraAutoUpdate]</h3> |
23 | 21 | <p> |
24 | | - Whether the manager's XR camera should be automatically updated or not. Default is *true*. |
| 22 | + manager的XR摄像头是否应自动更新。默认为*true*。 |
25 | 23 | </p> |
26 | 24 |
|
27 | 25 | <h3>[property:Boolean enabled]</h3> |
28 | 26 | <p> |
29 | | - This flag notifies the renderer to be ready for XR rendering. Default is *false*. Set it to *true* if you are going |
30 | | - to use XR in your app. |
| 27 | + 此标志通知渲染器准备好进行XR渲染。默认为假。 |
| 28 | + 如果您要在应用中使用XR,请将其设置为*true*。 |
31 | 29 | </p> |
32 | 30 |
|
33 | 31 | <h3>[property:Boolean isPresenting]</h3> |
34 | 32 | <p> |
35 | | - Whether XR presentation is active or not. Default is *false*. This flag is read-only and automatically set by [name]. |
| 33 | + XR演示是否处于活动状态。默认为*false*。该标志是只读的,由[name]自动设置。 |
36 | 34 | </p> |
37 | 35 |
|
38 | | - <h2>Methods</h2> |
| 36 | + <h2>方法(Methods)</h2> |
39 | 37 |
|
40 | 38 | <h3>[method:ArrayCamera getCamera]()</h3> |
41 | 39 | <p> |
42 | | - Returns an instance of [page:ArrayCamera] which represents the XR camera of the active XR session. |
43 | | - For each view it holds a separate camera object in its [page:ArrayCamera.cameras cameras] property. |
| 40 | + 返回表示活动XR会话的XR相机的[page:ArrayCamera]实例。 |
| 41 | + 对于每个视图,它在其[page:ArrayCamera.cameras cameras]属性中包含一个单独的相机对象。 |
44 | 42 | </p> |
45 | 43 | <p> |
46 | | - The camera's *fov* is currently not used and does not reflect the fov of the XR camera. If you need the fov on app level, |
47 | | - you have to compute in manually from the XR camera's projection matrices. |
| 44 | + 当前未使用相机的*fov*,不反映 XR 相机的 fov。 |
| 45 | + 如果您需要应用级别的fov,则必须从XR相机的投影矩阵中手动计算。 |
48 | 46 | </p> |
49 | 47 |
|
50 | 48 | <h3>[method:Group getController]( [param:Integer index] )</h3> |
51 | 49 | <p> |
52 | | - [page:Integer index] — The index of the controller. <br /><br /> |
53 | | - |
54 | | - Returns a [page:Group] representing the so called *target ray* space of the XR controller. |
55 | | - Use this space for visualizing 3D objects that support the user in pointing tasks like UI interaction. |
| 50 | + [page:Integer index] — 控制器的索引。<br /><br /> |
| 51 | + |
| 52 | + 返回表示XR控制器所谓的*目标光线*空间的[page:Group 组]。使用此空间可视化3D对象,支持用户完成UI交互等指向任务。 |
56 | 53 | </p> |
57 | 54 |
|
58 | 55 | <h3>[method:Group getControllerGrip]( [param:Integer index] )</h3> |
59 | 56 | <p> |
60 | | - [page:Integer index] — The index of the controller. <br /><br /> |
| 57 | + [page:Integer index] — 控制器的索引。<br /><br /> |
| 58 | + |
| 59 | + 返回一个[page:Group 组],代表所谓的XR控制器的*抓地力*空间。如果用户要握住其他3D对象(如光剑),请使用此空间。 |
61 | 60 |
|
62 | | - Returns a [page:Group] representing the so called *grip* space of the XR controller. |
63 | | - Use this space if the user is going to hold other 3D objects like a lightsaber. |
64 | 61 | </p> |
65 | 62 |
|
66 | 63 | <p> |
67 | | - Note: If you want to show something in the user's hand AND offer a pointing ray at the same time, you'll want to attached the handheld object to the |
68 | | - group returned by [page:.getControllerGrip]() and the ray to the group returned by [page:.getController](). The idea is to have two different groups |
69 | | - in two different coordinate spaces for the same WebXR controller. |
| 64 | + 注意:如果你想显示用户手中的东西并同时提供指向光线, |
| 65 | + 你需要将手持对象附加到[page:.getControllerGrip]()返回的组, |
| 66 | + 并将光线附加到[page:.getController]()返回的组. |
| 67 | + 这个想法是在同一个WebXR控制器的两个不同坐标空间中有两个不同的组。 |
70 | 68 | </p> |
71 | 69 |
|
72 | 70 | <h3>[method:Group getHand]( [param:Integer index] )</h3> |
73 | 71 | <p> |
74 | | - [page:Integer index] — The index of the controller. <br /><br /> |
| 72 | + [page:Integer index] — 控制器的索引。 <br /><br /> |
75 | 73 |
|
76 | | - Returns a [page:Group] representing the so called *hand* or *joint* space of the XR controller. |
77 | | - Use this space for visualizing the user's hands when no physical controllers are used. |
| 74 | + 返回代表XR控制器所谓的*手或关节*空间的[page:Group 组]。在不使用物理控制器时,使用此空间可视化用户的手。 |
78 | 75 | </p> |
79 | 76 |
|
80 | 77 | <h3>[method:Set getPlanes]()</h3> |
81 | 78 | <p> |
82 | | - Returns the set of planes detected by WebXR's plane detection API. |
| 79 | + 返回由 WebXR 的平面检测 API 检测到的平面集。 |
83 | 80 | </p> |
84 | 81 |
|
85 | 82 | <h3>[method:String getReferenceSpace]()</h3> |
86 | 83 | <p> |
87 | | - Returns the reference space. |
| 84 | + 返回参考空间。 |
88 | 85 | </p> |
89 | 86 |
|
90 | 87 | <h3>[method:XRSession getSession]()</h3> |
91 | 88 | <p> |
92 | | - Returns the *XRSession* object which allows a more fine-grained management of active WebXR sessions on application level. |
| 89 | + 返回*XRSession*对象,它允许在应用程序级别更细粒度地管理活动的WebXR会话。 |
93 | 90 | </p> |
94 | 91 |
|
95 | 92 | <h3>[method:undefined setFramebufferScaleFactor]( [param:Float factor], [param:Boolean limited] )</h3> |
96 | 93 | <p> |
97 | | - [page:Float factor] — The framebuffer scale factor to set.<br /> |
98 | | - [page:Boolean limited] — Whether the framebuffer scale factor should be reduced to the native limit if the value ends up being higher than the device's capabilities. Default is `false`.<br /><br /> |
| 94 | + [page:Float factor] — 要设置的帧缓冲区比例因子。<br /> |
| 95 | + [page:Boolean limited] — 如果值最终高于设备的能力,是否应将帧缓冲区比例因子减小到本机限制。默认为`false`。<br /><br /> |
99 | 96 |
|
100 | | - Specifies the scaling factor to use when determining the size of the framebuffer when rendering to a XR device. |
101 | | - The value is relative to the default XR device display resolution. Default is *1*. A value of *0.5* would specify |
102 | | - a framebuffer with 50% of the display's native resolution. |
| 97 | + 指定在渲染到XR设备时确定帧缓冲区大小时要使用的比例因子。 |
| 98 | + 该值是相对于默认XR设备显示分辨率的。默认为*1*。值0.5将指定具有显示器原始分辨率50%的帧缓冲区。 |
| 99 | + |
103 | 100 | </p> |
104 | 101 |
|
105 | 102 | <p> |
106 | | - Note: It is not possible to change the framebuffer scale factor while presenting XR content. |
| 103 | + 注意:在呈现XR内容时无法更改帧缓冲区比例因子。 |
107 | 104 | </p> |
108 | 105 |
|
109 | 106 | <h3>[method:undefined setReferenceSpace]( [param:XRReferenceSpace referenceSpace] )</h3> |
110 | 107 | <p> |
111 | | - [page:XRReferenceSpace referenceSpace] — A custom reference space.<br /><br /> |
| 108 | + [page:XRReferenceSpace referenceSpace] — 自定义参考空间。<br /><br /> |
112 | 109 |
|
113 | | - Can be used to configure a custom reference space which overwrites the default reference space. |
| 110 | + 可用于配置覆盖默认参考空间的自定义参考空间。 |
114 | 111 | </p> |
115 | 112 |
|
116 | 113 | <h3>[method:undefined setReferenceSpaceType]( [param:String referenceSpaceType] )</h3> |
117 | 114 | <p> |
118 | | - [page:String referenceSpaceType] — The reference space type to set.<br /><br /> |
| 115 | + [page:String referenceSpaceType] — 要设置的参考空间类型。<br /><br /> |
119 | 116 |
|
120 | | - Can be used to configure a spatial relationship with the user's physical environment. Depending on how the user moves in 3D space, setting an |
121 | | - appropriate reference space can improve tracking. Default is *local-floor*. |
122 | | - Please check out the [link:https://developer.mozilla.org/en-US/docs/Web/API/XRReferenceSpaceType MDN] for possible values and their use cases. |
| 117 | + 可用于配置与用户物理环境的空间关系。 |
| 118 | + 根据用户在3D空间中的移动方式,设置适当的参考空间可以改进跟踪。 |
| 119 | + 默认为*本层空间*。 |
| 120 | + 请查看[link:https://developer.mozilla.org/en-US/docs/Web/API/XRReferenceSpaceType MDN]以了解可能的值及其用例。 |
123 | 121 | </p> |
124 | 122 |
|
125 | 123 | <h3>[method:undefined updateCamera]( [param:PerspectiveCamera camera] )</h3> |
126 | 124 | <p> |
127 | | - Updates the state of the XR camera. Use this method on app level if you set [page:.cameraAutoUpdate] to *false*. |
128 | | - The method requires the non-XR camera of the scene as a parameter. The passed in camera's transformation is automatically |
129 | | - adjusted to the position of the XR camera when calling this method. |
| 125 | + 更新 XR 相机的状态。 |
| 126 | + 如果您将[page:.cameraAutoUpdate]设置为*false*,请在应用级别使用此方法。 |
| 127 | + 该方法需要场景的非 XR 相机作为参数。 |
| 128 | + 调用此方法时,传入的相机变换会自动调整到 XR 相机的位置。 |
130 | 129 | </p> |
131 | 130 |
|
132 | 131 | <p> |
133 | | - Note: It is not possible to change the reference space type while presenting XR content. |
| 132 | + 注意:在呈现 XR 内容时无法更改参考空间类型。 |
134 | 133 | </p> |
135 | 134 |
|
136 | | - <h2>Source</h2> |
| 135 | + <h2>源代码(Source)</h2> |
137 | 136 |
|
138 | 137 | <p> |
139 | 138 | [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] |
|
0 commit comments