Edit: This is closed because it needs more details, yet people keep upvoting it. So I'll do my best to add some. This question was poorly formatted, as it was really 2 questions. 1) How do I fix this code from the documentation? 2) How do I align the unity scene to the player's physical space?
I feel like #1 was focused on the answer, but #2 was the title question. My main issues were that the occlusion mesh being created was bumpy/not flat, making collisions between holograms and the floor very wonky. I ended up creating a basic menu with the hologram of a cube in front of the player. The player was then instructed to lower the cube until it sat evenly on the floor. I then made sure all holograms didn't fall lower than that set value, either with collision planes, or via code. Hope that idea can help anyone. Thanks!
When the player loads into a unity scene in the Hololens2, the Unity Floor plane does not match the physical floor. With the hololens2 and MRTK, the Unity scene origin is locked to the players head being 0,0,0.
I am trying to use the Microsoft Scene Understanding SDK to set the Unity Scene environment Y position to the floor in the physical room. I am currently able to access the floor scene object, but when I try to do the SpatialCoordinateSystem portion, I am unable to use the .ToUnity() method to convert the 4x4 Matrix. I had to change the vector3 .ToUnity() call to .ToUnityVector3(); but I am unable to find a similar method for the matrix.
Are the .ToUnity() methods mentioned in this documentation deprecated? Am I missing a reference to something? (see images for references)
I greatly appreciate any assistance here, either in this specific issue, or the overall challenge of aligning a unity scene to a Hololens2 user's physical environment.
I'm following the information provided here https://learn.microsoft.com/en-us/windows/mixed-reality/develop/platform-capabilities-and-apis/scene-understanding-sdk