cancel
Showing results for 
Search instead for 
Did you mean: 

MRUK Create a new Scene

IseTM
Explorer

The documentation (Docs Link) says:

  • Using Mixed Reality Utility Kit, the function MRUKRoom.IsPositionInRoom(Vector3 pos) can be used to check whether the camera rig pose is present in the loaded scene or not. If it is not, offer users to capture a new scene.

How can I create a new room with MRUK? 

7 REPLIES 7

neurograph
Explorer

Hi, any update from Meta about this???

Nothing yet

RM1181
Protege

Note: I am an Unreal developer, so I apologize if any of this is slightly different to Unity.

You do not create rooms with MRUK, rather MRUK helps get access to rooms that are saved on your headset via the Space Setup app (Settings -> Physical Space -> Space Setup).  Setting up the room includes scanning the room to create a 3D mesh representation as well as adjusting planes and adding volumes to represent semantically labelled objects, like walls, floor, tables, etc.  This is a completely separate process from your app and can be done prior to running your app.  If your app finds no saved room during runtime (i.e. Load Scene fails), you can launch the Space Setup app from inside your app, complete the process, and it will return control to your app, at which time you can use MRUK to access the data.

MRUK also has helper functions to convert a loaded Scene (i.e. room) to a JSON string and load the JSON back again into a Scene, as if it came from the headset.  This can be useful for debugging or learning, and the MRUtilityKitSample project has examples of this.  I highly recommend checking out the sample, as it also shows how to request the necessary user permissions to access the Scene data.

Once your app has received permission and loaded the Scene from the device, you can do something like MRUKSubsystem.GetCurrentRoom.IsPositionInRoom() to check if a position is inside the walls/floor/ceiling volume.

With the OVRSceneManager there is a method to do the scan of the room during tha game. With MRUK I didn’t find anything like that. 

RM1181
Protege

In Unreal, using MRUK v64, it is as simple as calling MRUKSubsystem.LaunchSceneCapture().  Sorry, I don't know the equivalent in Unity.  But maybe the function is named similarly.

Edited:

Looking at the Unity documentation, it says you should have an MRUK prefab in your scene.  I'm guessing that MRUK singleton is equivalent to Unreal's MRUKSubsystem.  If so, I'd think you would call something akin to LaunchSceneCapture on that singleton.  Hopefully some knowledgeable Unity developers will jump in here and clear things up!  🙂 

neurograph
Explorer

Hi, I have a scene that is working in one room and I would like it to rescan the scene or load a new scene from the device if I move into a new physical room (scanned and present on the device).

I am debugging the efficiency of  MRUKRoom.IsPositionInRoom(Vector3 pos) by recoloring the EffectMesh...

But the below code does not what it should... Any Meta ppl can help??? Please...

 

 

  if (!isInRoom)
                {
                    _effectMesh.MeshMaterial.color = Color.green;
                    MRUK.Instance.ClearScene();
                    MRUK.Instance.LoadSceneFromDevice();
}

 

 

 Thank you.

GL

neurograph
Explorer

Hi,

I have a scene that is working in one room and I would like it to rescan the scene or load a new scene from the device if I move into a new physical room (scanned and present on the device).

I am debugging the efficiency of  MRUKRoom.IsPositionInRoom(Vector3 pos) by recoloring the EffectMesh...

But the below code does not what it should... Any Meta ppl can help??? Please...

 

 

  if (!isInRoom)
                {
                    _effectMesh.MeshMaterial.color = Color.green;
                    MRUK.Instance.ClearScene();
                    MRUK.Instance.LoadSceneFromDevice();
}

 

 

 Thank you.

GL