Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Commit

Permalink
Fix/spatial awareness (#70)
Browse files Browse the repository at this point in the history
* updated reference

* added WMR Camera Data Provider

* updated WMR Camera Data Provider

* updated camera rig reference

* updated icon

* moved WMR Camera data provider into correct file location

* updated data provider constructors

* added service parent reference

* Added rig reset override

* reverted changes

* removed unused reference

* added camera profile

* updated observer origin to work with camera system updates
  • Loading branch information
StephenHodgson committed Apr 24, 2020
1 parent fb9afd5 commit e095036
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions SpatialObservers/WindowsMixedRealitySpatialMeshObserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using UnityEngine.XR.WSA;
using XRTK.Definitions.SpatialAwarenessSystem;
using XRTK.Extensions;
using XRTK.Services;
using XRTK.Utilities;
#endif // UNITY_WSA

Expand Down Expand Up @@ -58,7 +59,9 @@ public override void Update()
// Update the observer location if it is not stationary
if (!IsStationaryObserver)
{
ObserverOrigin = CameraCache.Main.transform.position;
ObserverOrigin = MixedRealityToolkit.CameraSystem != null
? MixedRealityToolkit.CameraSystem.MainCameraRig.CameraTransform.localPosition
: CameraCache.Main.transform.position;
}

// The application can update the observer volume at any time, make sure we are using the latest.
Expand Down Expand Up @@ -158,7 +161,7 @@ void OnDataReady(SurfaceData cookedData, bool outputWritten, float elapsedCookTi
{
if (!outputWritten)
{
Debug.LogWarning($"No output for {cookedData.id.handle}");
Debug.LogWarning($"No output for {cookedData.id.handle.ToString()}");
return;
}

Expand Down

0 comments on commit e095036

Please sign in to comment.