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.

Fields

ActiveRoomsOnly : bool
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.
Signature
bool OVRSceneManager.ActiveRoomsOnly
MaxSceneAnchorUpdatesPerFrame : int
The maximum number of scene anchors that will be updated each frame.
Signature
int OVRSceneManager.MaxSceneAnchorUpdatesPerFrame
NewSceneModelAvailable : Action
This event fires when the OVR 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.
Signature
Action OVRSceneManager.NewSceneModelAvailable
NoSceneModelToLoad : Action
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.
Signature
Action OVRSceneManager.NoSceneModelToLoad
PlanePrefab : OVRSceneAnchor
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.
Signature
OVRSceneAnchor OVRSceneManager.PlanePrefab
PrefabOverrides : List< OVRScenePrefabOverride >
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.
Signature
List<OVRScenePrefabOverride> OVRSceneManager.PrefabOverrides
RoomLayout : RoomLayoutInformation
Describes the room layout of a room in the scene model.
Signature
RoomLayoutInformation OVRSceneManager.RoomLayout
SceneCaptureReturnedWithoutError : Action
This event will fire after the Room Setup successfully returns.
It can be trapped to load the scene Model.
Signature
Action OVRSceneManager.SceneCaptureReturnedWithoutError
SceneModelLoadedSuccessfully : Action
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>).
Signature
Action OVRSceneManager.SceneModelLoadedSuccessfully
UnexpectedErrorWithSceneCapture : Action
This event will fire if an error occurred while trying to send the user to Room Setup.
Signature
Action OVRSceneManager.UnexpectedErrorWithSceneCapture
VerboseLogging : bool
When true, verbose debug logs will be emitted.
Signature
bool OVRSceneManager.VerboseLogging
VolumePrefab : OVRSceneAnchor
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.
Signature
OVRSceneAnchor OVRSceneManager.VolumePrefab

Properties

InitialAnchorParent : Transform
[Get][Set]
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).
Signature
Transform OVRSceneManager.InitialAnchorParent

Events

LoadSceneModelFailedPermissionNotGranted : Action
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.
Signature
Action OVRSceneManager.LoadSceneModelFailedPermissionNotGranted

Methods

DoesRoomSetupExist ( requestedAnchorClassifications )
Check if a room setup exists with specified anchors classifications.
Signature
OVRTask< bool > OVRSceneManager.DoesRoomSetupExist(IEnumerable< string > requestedAnchorClassifications)
Parameters
requestedAnchorClassifications: IEnumerable< string >  Anchors classifications to check.
Returns
OVRTask< bool > OVRTask that gives a boolean answer if the room setup exists upon completion.
LoadSceneModel ()
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.
Signature
bool OVRSceneManager.LoadSceneModel()
Returns
bool  Returns true if the query was successfully initiated.
RequestSceneCapture ()
Requests scene capture from the Room Setup.
Signature
bool OVRSceneManager.RequestSceneCapture()
Returns
bool  Returns true if scene capture succeeded, otherwise false.
RequestSceneCapture ( requestedAnchorClassifications )
Requests scene capture with specified types of OVRSceneAnchor
Signature
bool OVRSceneManager.RequestSceneCapture(IEnumerable< string > requestedAnchorClassifications)
Parameters
requestedAnchorClassifications: IEnumerable< string >  A list of OVRSceneManager.Classification.
Returns
bool  Returns true if scene capture succeeded, otherwise false.

Inner Classes

Classification Class

Represents the available classifications for each OVRSceneAnchor.

Static Fields

Bed : const string
Represents an OVRSceneAnchor that is classified as a bed.
Signature
const string OVRSceneManager.Classification.Bed
Ceiling : const string
Represents an OVRSceneAnchor that is classified as a ceiling.
Signature
const string OVRSceneManager.Classification.Ceiling
Couch : const string
Represents an OVRSceneAnchor that is classified as a couch.
Signature
const string OVRSceneManager.Classification.Couch
Desk : const string
Represents an OVRSceneAnchor that is classified as a desk.
This label has been deprecated in favor of Table.
Signature
const string OVRSceneManager.Classification.Desk
DoorFrame : const string
Represents an OVRSceneAnchor that is classified as a door frame.
Signature
const string OVRSceneManager.Classification.DoorFrame
Floor : const string
Represents an OVRSceneAnchor that is classified as a floor.
Signature
const string OVRSceneManager.Classification.Floor
GlobalMesh : const string
Represents an OVRSceneAnchor that is classified as a global mesh.
Signature
const string OVRSceneManager.Classification.GlobalMesh
InvisibleWallFace : const string
Represents an OVRSceneAnchor that is classified as an invisible wall face.
All invisible wall faces are also classified as a WallFace in order to provide backwards compatibility for apps that expect closed rooms to only consist of wall faces, instead of a sequence composed of either invisible wall faces or wall faces.
Signature
const string OVRSceneManager.Classification.InvisibleWallFace
Lamp : const string
Represents an OVRSceneAnchor that is classified as a lamp.
Signature
const string OVRSceneManager.Classification.Lamp
Other : const string
Represents an OVRSceneAnchor that is classified as other.
Signature
const string OVRSceneManager.Classification.Other
Plant : const string
Represents an OVRSceneAnchor that is classified as a plant.
Signature
const string OVRSceneManager.Classification.Plant
Screen : const string
Represents an OVRSceneAnchor that is classified as a screen (e.g., TV, computer monitor).
Signature
const string OVRSceneManager.Classification.Screen
Storage : const string
Represents an OVRSceneAnchor that is classified as a storage (e.g., cabinet, shelf).
Signature
const string OVRSceneManager.Classification.Storage
Table : const string
Represents an OVRSceneAnchor that is classified as a table.
Signature
const string OVRSceneManager.Classification.Table
WallArt : const string
Represents an OVRSceneAnchor that is classified as wall art.
Signature
const string OVRSceneManager.Classification.WallArt
WallFace : const string
Represents an OVRSceneAnchor that is classified as a wall face.
Signature
const string OVRSceneManager.Classification.WallFace
WindowFrame : const string
Represents an OVRSceneAnchor that is classified as a window frame.
Signature
const string OVRSceneManager.Classification.WindowFrame

Properties

List : IReadOnlyList< string >
[Get]
The list of possible semantic labels.
Signature
IReadOnlyList<string> OVRSceneManager.Classification.List
Set : HashSet< string >
[Get]
The set of possible semantic labels.
This is the same as List but allows for faster lookup.
Signature
HashSet<string> OVRSceneManager.Classification.Set

RoomLayoutInformation Class

A container for the set of OVRSceneAnchors representing a room.

Fields

Ceiling : OVRScenePlane
The OVRScenePlane representing the ceiling of the room.
Signature
OVRScenePlane OVRSceneManager.RoomLayoutInformation.Ceiling
The OVRScenePlane representing the floor of the room.
Signature
OVRScenePlane OVRSceneManager.RoomLayoutInformation.Floor
Walls : List< OVRScenePlane >
The set of OVRScenePlane representing the walls of the room.
Signature
List<OVRScenePlane> OVRSceneManager.RoomLayoutInformation.Walls