API reference
API reference
Select your platform
No SDKs available
No versions available

OVRSceneManager Class

Extends MonoBehaviour
A manager for OVRSceneAnchors created using the Room Setup feature.
"OVRSceneManager and associated classes are deprecated (v65), please use [MR Utility Kit](https://developer.oculus.com/documentation/unity/unity-mr-utility-kit-overview)" instead.

Member Enumerations

Enumeration LoadSceneModelResult

Success
= 0
NoSceneModelToLoad
= 1
FailureScenePermissionNotGranted
= -1
FailureUnexpectedError
= -2

Fields

A prefab that will be used to instantiate any Plane found when querying the Scene model.
If the anchor contains both Volume and Plane elements, VolumePrefab will be used instead. If null, no object will be instantiated, unless a prefab override is provided.
A prefab that will be used to instantiate any Volume found when querying the Scene model.
This anchor may also contain Plane elements. If null, no object will be instantiated, unless a prefab override is provided.
Overrides the instantiation of the generic Plane and Volume prefabs with specialized ones.
If null is provided, no object will be instantiated for that label.
When enabled, only rooms the user is currently in will be instantiated.
When True, OVRSceneManager will instantiate an OVRSceneRoom and all of its child scene anchors (walls, floor, ceiling, and furniture) only if the user is located in the room when LoadSceneModel is called.When False, the OVRSceneManager will instantiate an OVRSceneRoom for each room, regardless of the user's location.The 2D boundary points of the room's floor are used to determine whether the user is inside a room.If a room exists, but the user is not inside it, then the NoSceneModelToLoad event is invoked as if the user had not yet run Space Setup.
When true, verbose debug logs will be emitted.
The maximum number of scene anchors that will be updated each frame.
This event fires when the OVRSceneManager has instantiated prefabs for the Scene Anchors in a Scene Model.
Wait until this event has been fired before accessing any OVRSceneAnchors, as this event waits for any additional initialization logic to be executed first. Access OVRSceneAnchors using OVRSceneAnchor.GetSceneAnchors(List<OVRSceneAnchor>).
This event fires when a query load the Scene Model returns no result.
It can indicate that the, user never used the Room Setup in the space they are in.
This event will fire after the Room Setup successfully returns.
It can be trapped to load the scene Model.
This event will fire if an error occurred while trying to send the user to Room Setup.
This event fires when the Scene Manager detects a change in the room layout.
It indicates that the user performed Room Setup while the application was paused. Upon receiving this event, user can call LoadSceneModel to reload the scene model.
Describes the room layout of a room in the scene model.

Properties

The parent transform to which each new OVRSceneAnchor or OVRSceneRoom will be parented upon instantiation.
if null, OVRSceneRoom(s) instantiated by OVRSceneManager will have no parent, and OVRSceneAnchor(s) will have either a OVRSceneRoom as their parent or null, that is they will be instantiated at the scene root. If non-null, OVRSceneAnchor(s) that do not belong to any OVRSceneRoom, and OVRSceneRoom(s) along with its child OVRSceneAnchor(s) will be parented to InitialAnchorParent.Changing this value does not affect existing OVRSceneAnchor(s) or OVRSceneRoom(s).
LogForwarder? Verbose[Get]

Events

Unable to load the scene model because the user has not granted permission to use Scene.
Apps that wish to use Scene must have "Spatial data" sharing permission. This is a runtime permission that must be granted before loading the scene model. If the permission has not been granted, then calling LoadSceneModel will result in this event.The permission string is "com.oculus.permission.USE_SCENE". See Unity's Android Permission API for more information on interacting with permissions.

Member Functions

Loads the scene model.
The "scene model" consists of all the anchors (i.e., floor, ceiling, walls, and furniture) for all the rooms defined during Space Setup.When running on Quest, Scene is queried to retrieve the entities describing the Scene Model. In the Editor, the Scene Model is loaded over Link.
Returns
Returns true if the query was successfully initiated.
Requests scene capture from the Room Setup.
Returns
Returns true if scene capture succeeded, otherwise false.
Check if a room setup exists with specified anchors classifications.
Parameters
requestedAnchorClassifications
Anchors classifications to check.
Returns
OVRTask that gives a boolean answer if the room setup exists upon completion.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon