You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/xr/xr_room_scale.rst
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ As a developer this introduces a number of interesting challenges.
11
11
In this document we will look at a number of the challenges you may face and outline some solutions.
12
12
We'll discuss the issues and challenges for seated XR games in another document.
13
13
14
-
.. note:
14
+
.. note::
15
15
Often developers sit behind their desk while building the foundation to their game.
16
16
In this mode the issues with developing for room scale don't show themselves until it is too late.
17
17
The advice here is to start testing while standing up and walking around as early as possible.
@@ -68,6 +68,9 @@ We use this to determine where our body center is.
68
68
69
69
Processing our character movement is now done in three steps.
70
70
71
+
.. note::
72
+
The `Origin centric movement demo <https://github.com/godotengine/godot-demo-projects/tree/master/xr/openxr_origin_centric_movement>`__ contains a more elaborate example of the technique described below.
73
+
71
74
Step 1
72
75
------
73
76
@@ -117,7 +120,7 @@ The second step is to handle rotation of the player as a result of user input.
117
120
As the input used can differ based on your needs we are simply calling the function ``_get_rotational_input``.
118
121
This function should obtain the necessary input and return the rotational speed in radians per second.
119
122
120
-
.. note:
123
+
.. note::
121
124
For our example we are going to keep this simple and straight forward.
122
125
We are not going to worry about comfort features such as snap turning and applying a vignette.
123
126
We highly recommend implementing such comfort features.
@@ -156,7 +159,7 @@ This function should obtain the necessary input and return the rotational speed
156
159
if !is_colliding:
157
160
_process_rotation_on_input(delta)
158
161
159
-
.. note:
162
+
.. note::
160
163
We've added the call for processing our rotation to our physics process but we are only executing this if we were able to move our player fully.
161
164
This means that if the player moves somewhere they shouldn't, we don't process further movement.
162
165
@@ -168,7 +171,7 @@ The third and final step is moving the player forwards, backwards or sideways as
168
171
Just like with the rotation the inputs differ from project to project so we are simply calling the function ``_get_movement_input``.
169
172
This function should obtain the necessary input and return a directional vector scaled to the required velocity.
170
173
171
-
.. note:
174
+
.. note::
172
175
Just like with rotation we're keeping it simple. Here too it is advisable to look at adding comfort settings.
173
176
174
177
.. code-block:: gdscript
@@ -216,6 +219,9 @@ We also have our neck helper node.
216
219
217
220
Processing our character movement is done in the same three steps but implemented slightly differently.
218
221
222
+
.. note::
223
+
The `Character centric movement demo <https://github.com/godotengine/godot-demo-projects/tree/master/xr/openxr_character_centric_movement>`__ contains a more elaborate example of the technique described below.
224
+
219
225
Step 1
220
226
------
221
227
@@ -381,6 +387,9 @@ Further improvements to the code presented could be:
381
387
- allowing controller input as long as this distance is still small,
382
388
- still applying gravity to the player even when controller input is disabled.
383
389
390
+
.. note::
391
+
The movement demos in our demo repository contain an example of blacking out the screen when a user walks into restricted areas.
0 commit comments