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" instead.

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

Methods

DoesRoomSetupExist ( requestedAnchorClassifications )
Check if a room setup exists with specified anchors classifications.
Signature
OVRTask< bool > 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 LoadSceneModel()
Returns
bool  Returns true if the query was successfully initiated.
RequestSceneCapture ()
Requests scene capture from the Room Setup.
Signature
bool RequestSceneCapture()
Returns
bool  Returns true if scene capture succeeded, otherwise false.

Inner Classes

Classification Class

Represents the available classifications for each OVRSceneAnchor.
Classifications can be useful for functionally describing the contents of an OVRSceneRoom. By iterating all OVRSceneAnchors and comparing their Classifications with those needed, your application can determine whether a room meets its minimum requirements and/or can adjust its behavior to fit the physical surroundings.
OVRSceneManager and associated classes are deprecated (v65), please use MR Utility Kit" instead.

Static Fields

Bed : const string
Represents an OVRSceneAnchor that is classified as a bed.
Signature
const string Bed
Ceiling : const string
Represents an OVRSceneAnchor that is classified as a ceiling.
Signature
const string Ceiling
Couch : const string
Represents an OVRSceneAnchor that is classified as a couch.
Signature
const string 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 Desk
DoorFrame : const string
Represents an OVRSceneAnchor that is classified as a door frame.
Signature
const string DoorFrame
Floor : const string
Represents an OVRSceneAnchor that is classified as a floor.
Signature
const string Floor
GlobalMesh : const string
Represents an OVRSceneAnchor that is classified as a global mesh.
Signature
const string 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 InvisibleWallFace
Lamp : const string
Represents an OVRSceneAnchor that is classified as a lamp.
Signature
const string Lamp
Other : const string
Represents an OVRSceneAnchor that is classified as other.
Signature
const string Other
Plant : const string
Represents an OVRSceneAnchor that is classified as a plant.
Signature
const string Plant
Screen : const string
Represents an OVRSceneAnchor that is classified as a screen (e.g., TV, computer monitor).
Signature
const string Screen
Storage : const string
Represents an OVRSceneAnchor that is classified as a storage (e.g., cabinet, shelf).
Signature
const string Storage
Table : const string
Represents an OVRSceneAnchor that is classified as a table.
Signature
const string Table
WallArt : const string
Represents an OVRSceneAnchor that is classified as wall art.
Signature
const string WallArt
WallFace : const string
Represents an OVRSceneAnchor that is classified as a wall face.
Signature
const string WallFace
WindowFrame : const string
Represents an OVRSceneAnchor that is classified as a window frame.
Signature
const string WindowFrame

Properties

List : IReadOnlyList< string >
[Get]
The list of all possible semantic labels that can be applied to an OVRSceneAnchor.
Set exposes this list as a HashSet.
Signature
IReadOnlyList<string> List
Set : HashSet< string >
[Get]
The set of possible semantic labels that can be applied to an OVRSceneAnchor.
This is the same as List but allows for faster lookup.
Signature
HashSet<string> Set

RoomLayoutInformation Class

A container for the set of OVRSceneAnchors representing a room's Walls, Floor, and Ceiling as OVRScenePlanes, which provide detailed geometry for each.
OVRSceneManager and associated classes are deprecated (v65), please use MR Utility Kit" instead.

Fields

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

Inner Enum

LoadSceneModelResult Enum

Enumeration Constants

MemberValue
Success
0
NoSceneModelToLoad
1
FailureScenePermissionNotGranted
-1
FailureUnexpectedError
-2