Skip to content

Commit 8e98fd2

Browse files
Merge branch 'vNEXT-Teleportation' into vNEXT-ControllerRenderwithTeleport
2 parents e393a1a + f2f8480 commit 8e98fd2

File tree

6 files changed

+27
-5
lines changed

6 files changed

+27
-5
lines changed

Assets/MixedRealityToolkit-SDK/Features/Input/MixedRealityInputManager.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ public override void Initialize()
9191

9292
private void InitializeInternal()
9393
{
94+
if (CameraCache.Main.transform.parent == null)
95+
{
96+
var cameraParent = new GameObject("Body");
97+
CameraCache.Main.transform.SetParent(cameraParent.transform);
98+
}
99+
94100
focusProvider = CameraCache.Main.gameObject.EnsureComponent<FocusProvider>();
95101
gazeProvider = CameraCache.Main.gameObject.EnsureComponent<GazeProvider>();
96102

Assets/MixedRealityToolkit-SDK/Features/UX/Prefabs/Cursors/TeleportCursor.prefab

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ Animator:
267267
m_PrefabParentObject: {fileID: 0}
268268
m_PrefabInternal: {fileID: 100100000}
269269
m_GameObject: {fileID: 1466073170848862}
270-
m_Enabled: 1
270+
m_Enabled: 0
271271
m_Avatar: {fileID: 9000000, guid: 6e9e603a0869edf45a8a4fea496c6d9b, type: 3}
272272
m_Controller: {fileID: 9100000, guid: 65931ac36f624f549a6fe2c27af849ab, type: 2}
273273
m_CullingMode: 0
@@ -341,11 +341,11 @@ MonoBehaviour:
341341
- name: Valid
342342
cursorState: 1
343343
parameter:
344-
parameterType: 0
344+
parameterType: 4
345345
defaultInt: 0
346346
defaultFloat: 0
347347
defaultBool: 0
348-
name:
348+
name: Valid
349349
inputEnabledParameter:
350350
parameterType: 0
351351
defaultInt: 0

Assets/MixedRealityToolkit-SDK/Features/UX/Scripts/Pointers/BaseControllerPointer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public abstract class BaseControllerPointer : ControllerPoseSynchronizer, IMixed
7373
/// </summary>
7474
/// <remarks>This <see cref="GameObject"/> must have a <see cref="IMixedRealityCursor"/> attached to it.</remarks>
7575
/// <param name="newCursor"></param>
76-
public void SetCursor(GameObject newCursor = null)
76+
public virtual void SetCursor(GameObject newCursor = null)
7777
{
7878
if (cursorInstance != null)
7979
{

Assets/MixedRealityToolkit-SDK/Features/UX/Scripts/Pointers/TeleportPointer.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ protected override void OnEnable()
7575
BaseCursor?.SetVisibility(false);
7676
}
7777

78+
/// <inheritdoc />
79+
public override void SetCursor(GameObject newCursor = null)
80+
{
81+
base.SetCursor(newCursor);
82+
BaseCursor?.SetVisibility(false);
83+
}
7884
#region IMixedRealityPointer Implementation
7985

8086
/// <inheritdoc />
@@ -287,22 +293,32 @@ public override void OnPositionInputChanged(InputEventData<Vector2> eventData)
287293
/// <inheritdoc />
288294
public override void OnTeleportRequest(TeleportEventData eventData)
289295
{
296+
// Only turn off the pointer if we're not the one sending the request
290297
if (eventData.Pointer.PointerId == PointerId)
291298
{
299+
IsTeleportRequestActive = false;
292300
BaseCursor?.SetVisibility(true);
293301
}
302+
else
303+
{
304+
IsTeleportRequestActive = true;
305+
BaseCursor?.SetVisibility(false);
306+
}
294307
}
295308

296309
/// <inheritdoc />
297310
public override void OnTeleportStarted(TeleportEventData eventData)
298311
{
299-
base.OnTeleportStarted(eventData);
312+
// Turn off all pointers while we teleport.
313+
IsTeleportRequestActive = true;
314+
BaseCursor?.SetVisibility(false);
300315
}
301316

302317
/// <inheritdoc />
303318
public override void OnTeleportCompleted(TeleportEventData eventData)
304319
{
305320
IsTeleportRequestActive = false;
321+
BaseCursor?.SetVisibility(false);
306322
}
307323

308324
/// <inheritdoc />

Assets/MixedRealityToolkit-SDK/Features/UX/Scripts/Utilities/InteractibleHighlight.cs renamed to Assets/MixedRealityToolkit-SDK/Features/UX/Scripts/Utilities/InteractableHighlight.cs

File renamed without changes.

Assets/MixedRealityToolkit-SDK/Features/UX/Scripts/Utilities/InteractibleHighlight.cs.meta renamed to Assets/MixedRealityToolkit-SDK/Features/UX/Scripts/Utilities/InteractableHighlight.cs.meta

File renamed without changes.

0 commit comments

Comments
 (0)