Skip to content

Commit cef5a13

Browse files
authored
Update WebXRManager.html (#25794)
Update the Chinese translation of WebXRManager's documentation.
1 parent f342395 commit cef5a13

File tree

1 file changed

+45
-46
lines changed

1 file changed

+45
-46
lines changed

docs/api/zh/renderers/webxr/WebXRManager.html

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -11,129 +11,128 @@
1111
<h1>[name]</h1>
1212

1313
<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相关任务,例如检索控制器。
1816
</p>
1917

2018
<h2>Properties</h2>
2119

2220
<h3>[property:Boolean cameraAutoUpdate]</h3>
2321
<p>
24-
Whether the manager's XR camera should be automatically updated or not. Default is *true*.
22+
manager的XR摄像头是否应自动更新。默认为*true*
2523
</p>
2624

2725
<h3>[property:Boolean enabled]</h3>
2826
<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*。
3129
</p>
3230

3331
<h3>[property:Boolean isPresenting]</h3>
3432
<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]自动设置。
3634
</p>
3735

38-
<h2>Methods</h2>
36+
<h2>方法(Methods)</h2>
3937

4038
<h3>[method:ArrayCamera getCamera]()</h3>
4139
<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]属性中包含一个单独的相机对象。
4442
</p>
4543
<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相机的投影矩阵中手动计算。
4846
</p>
4947

5048
<h3>[method:Group getController]( [param:Integer index] )</h3>
5149
<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交互等指向任务。
5653
</p>
5754

5855
<h3>[method:Group getControllerGrip]( [param:Integer index] )</h3>
5956
<p>
60-
[page:Integer index] — The index of the controller. <br /><br />
57+
[page:Integer index] — 控制器的索引。<br /><br />
58+
59+
返回一个[page:Group 组],代表所谓的XR控制器的*抓地力*空间。如果用户要握住其他3D对象(如光剑),请使用此空间。
6160

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.
6461
</p>
6562

6663
<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控制器的两个不同坐标空间中有两个不同的组。
7068
</p>
7169

7270
<h3>[method:Group getHand]( [param:Integer index] )</h3>
7371
<p>
74-
[page:Integer index] — The index of the controller. <br /><br />
72+
[page:Integer index] — 控制器的索引。 <br /><br />
7573

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 组]。在不使用物理控制器时,使用此空间可视化用户的手。
7875
</p>
7976

8077
<h3>[method:Set getPlanes]()</h3>
8178
<p>
82-
Returns the set of planes detected by WebXR's plane detection API.
79+
返回由 WebXR 的平面检测 API 检测到的平面集。
8380
</p>
8481

8582
<h3>[method:String getReferenceSpace]()</h3>
8683
<p>
87-
Returns the reference space.
84+
返回参考空间。
8885
</p>
8986

9087
<h3>[method:XRSession getSession]()</h3>
9188
<p>
92-
Returns the *XRSession* object which allows a more fine-grained management of active WebXR sessions on application level.
89+
返回*XRSession*对象,它允许在应用程序级别更细粒度地管理活动的WebXR会话。
9390
</p>
9491

9592
<h3>[method:undefined setFramebufferScaleFactor]( [param:Float factor], [param:Boolean limited] )</h3>
9693
<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 />
9996

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+
103100
</p>
104101

105102
<p>
106-
Note: It is not possible to change the framebuffer scale factor while presenting XR content.
103+
注意:在呈现XR内容时无法更改帧缓冲区比例因子。
107104
</p>
108105

109106
<h3>[method:undefined setReferenceSpace]( [param:XRReferenceSpace referenceSpace] )</h3>
110107
<p>
111-
[page:XRReferenceSpace referenceSpace] — A custom reference space.<br /><br />
108+
[page:XRReferenceSpace referenceSpace] — 自定义参考空间。<br /><br />
112109

113-
Can be used to configure a custom reference space which overwrites the default reference space.
110+
可用于配置覆盖默认参考空间的自定义参考空间。
114111
</p>
115112

116113
<h3>[method:undefined setReferenceSpaceType]( [param:String referenceSpaceType] )</h3>
117114
<p>
118-
[page:String referenceSpaceType] — The reference space type to set.<br /><br />
115+
[page:String referenceSpaceType] — 要设置的参考空间类型。<br /><br />
119116

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]以了解可能的值及其用例。
123121
</p>
124122

125123
<h3>[method:undefined updateCamera]( [param:PerspectiveCamera camera] )</h3>
126124
<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 相机的位置。
130129
</p>
131130

132131
<p>
133-
Note: It is not possible to change the reference space type while presenting XR content.
132+
注意:在呈现 XR 内容时无法更改参考空间类型。
134133
</p>
135134

136-
<h2>Source</h2>
135+
<h2>源代码(Source)</h2>
137136

138137
<p>
139138
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

0 commit comments

Comments
 (0)