class Scene(val spatialInterface: SpatialInterface)
| Name | Summary |
|---|---|
Scene | constructor(spatialInterface: SpatialInterface) |
| Name | Summary |
|---|---|
Companion | object Companion |
| Name | Summary |
|---|---|
handle | val handle: Long |
spatialInterface | val spatialInterface: SpatialInterface |
| Name | Summary |
|---|---|
addObject | |
createCylinderLayer | fun createCylinderLayer(sceneSwapChain: SceneSwapchain, radius: Float, centralAngle: Float, aspectRatio: Float, pivotX: Float, pivotY: Float, stereoMode: StereoMode, sceneObject: SceneObject): Int Create a Layer that is shaped like a cylinder. |
createEquirectLayer | fun createEquirectLayer(sceneSwapChain: SceneSwapchain, radius: Float, centralHorizontalAngle: Float, upperVerticalAngle: Float, lowerVerticalAngle: Float, pivotX: Float, pivotY: Float, stereoMode: StereoMode, sceneObject: SceneObject): Int Create a Layer that maps equirectangular images onto a sphere. |
createQuadLayer | fun createQuadLayer(sceneSwapChain: SceneSwapchain, dimW: Float, dimH: Float, pivotX: Float, pivotY: Float, stereoMode: StereoMode, sceneObject: SceneObject): Int Create a Layer that is shaped like a quad. |
destroyObject | |
discoverSpaces | fun discoverSpaces(fetchOptions: Anchor.FetchOptions): CompletableFuture<Array<Anchor>> Find all the space. |
drawDebugLine | |
enableEnvironmentDepth | fun enableEnvironmentDepth(enabled: Boolean) Experimental: Enable environment depth. May not work. |
enableHolePunching | fun enableHolePunching(enabled: Boolean) Tells the renderer to render poseable layers before rendering out the scene. This means the app will be responsible for hole-punching the layers. |
enableMrPlaneTracker | fun enableMrPlaneTracker(enabled: Boolean) Enable the MR plane tracker. |
enablePassthrough | fun enablePassthrough(enabled: Boolean) Enable pass through of the real world into the scene. |
enableVirtualCamera | fun enableVirtualCamera(enable: Boolean) Enable the virtual camera. |
getAnchorBoundary2D | |
getAnchorBoundingBox2D | |
getAnchorBoundingBox3D | |
getAnchorPose | |
getAnchorSemanticLabels | fun getAnchorSemanticLabels(index: Int): String Get the semantic labels for an anchor by index. fun getAnchorSemanticLabels(anchorHandle: Long): List<String> Get the semantic lables for an anchor. |
getConfirmedFrameRate | fun getConfirmedFrameRate(): Float |
getControllerPoseAtTime | fun getControllerPoseAtTime(isLeftHandle: Boolean, time: Long): ControllerPose Get the pose of the controller at a given time. |
getNumberOfObjects | fun getNumberOfObjects(): Int Get the number of SceneObjects in the scene. |
getSessionStartPose | fun getSessionStartPose(): Pose Returns the pose that was set at the beginning of the session. This is useful for setting the starting position of entities so that they are placed relative to the user. |
getSpaceContainer | fun getSpaceContainer(anchorHandle: Long): Array<UUID> Get the space container from an anchor. |
getSpaceRoomLayout | fun getSpaceRoomLayout(anchorHandle: Long): Anchor.RoomLayout Get the RoomLayout from an anchor handle. |
getSpaceTriangleMesh | fun getSpaceTriangleMesh(anchorHandle: Long): Anchor.SpaceTriangleMesh Get the space triangle mesh associated with an anchor handle. |
getViewerPose | |
getViewOrigin | |
getViewSceneRotation | fun getViewSceneRotation(): Float Get the last rotation of the viewer, with X+ being 0 degrees. |
hasObject | |
isSystemPassthroughEnabled | fun isSystemPassthroughEnabled(): Boolean Is the passthrough system enabled. Returns true if the app is launched in passthrough mode and false if in immersive mode. This value is set at the app launch and will not change during the app’s lifetime. |
lineSegmentIntersect | |
loadRenderModelMesh | fun loadRenderModelMesh(path: String): SceneMesh? Load a render model mesh given a path to a device. This uses the XR_FB_render_model OpenXR extension. |
onClick | |
onClickDown | |
onHoverStart | fun onHoverStart(sceneObjectHandle: Long, sourceOfInput: Entity) Handler for when a pointer start to hover over a SceneObject. |
onHoverStop | fun onHoverStop(sceneObjectHandle: Long, sourceOfInput: Entity) Handler for when a pointer stops hovering over a SceneObject. |
onInput | |
onNoIntersectionInput | fun onNoIntersectionInput(sourceOfInput: Entity, changedIn: Int, buttonState: Int) Handler for when we receive input that does not intersect with any SceneObjects. |
playBackgroundSound | fun playBackgroundSound(soundAsset: SceneAudioAsset, volume: Float, looping: Boolean) Plays a sound which attached to the user pose, there is ony one background sound. The sound equivalent to an environment box |
playSound | fun playSound(soundAsset: SceneAudioAsset, volume: Float = 1.0f) Plays a sound which is attached to the user pose fun playSound(soundfile: SceneAudioAsset, entity: Entity, volume: Float = 1.0f) Plays a sound within the 3d environment. The sound spatialization will update depending on head movement fun playSound(soundAsset: SceneAudioAsset, position: Vector3, volume: Float = 1.0f) Plays a sound within the 3d environment. The sound spatialization will update depending on head movement. |
processQueries | |
rayArcIntersect | |
removeLayer | fun removeLayer(id: Int) Remove a Layer form the Scene. |
requestSceneCapture | fun requestSceneCapture(): CompletableFuture<Unit> Request scene capture. |
resetSessionStartPose | fun resetSessionStartPose() This function resets the session start pose to the current pose. This can be used to reset the session start pose when the user moves around. |
setDepthParams | fun setDepthParams(minDepth: Float, maxDepth: Float) Set the depth parameters on the Scene. |
setLayerAlphaBlend | fun setLayerAlphaBlend(id: Int, srcFactorColor: Int, dstFactorColor: Int, srcFactorAlpha: Int, dstFactorAlpha: Int) Set the alpha blend factors on a Layer. The integers correspond to the different layer alpha blend factors. |
setLayerClip | fun setLayerClip(id: Int, minLeftU: Float, minLeftV: Float, maxLeftU: Float, maxLeftV: Float, minRightU: Float = minLeftU, minRightV: Float = minLeftV, maxRightU: Float = maxLeftU, maxRightV: Float = maxLeftV) Set clip bounds on a Layer in UV space. |
setLayerColorScaleBias | fun setLayerColorScaleBias(id: Int, scaleR: Float, scaleG: Float, scaleB: Float, scaleA: Float, biasR: Float, biasG: Float, biasB: Float, biasA: Float) Set the scale and bias on the color of a Layer. |
setLayerFilters | fun setLayerFilters(id: Int, filters: Int) Applies the specified layer filters |
setLayerScale | fun setLayerScale(id: Int, x: Float, y: Float, z: Float) Set the scale of a Layer in the Scene. |
setLayerSecure | fun setLayerSecure(id: Int, secureLayer: Boolean) When set to true ensures the layer can not be copied or captured by other apps. |
fun setLayerZIndex(id: Int, zIndex: Int) Set a Layer’s Z index in depth ordering (default 0). If layers have the same z index, we will try to sort by distance to viewer. | |
setLightingEnvironment | |
setPassthroughLUT | fun setPassthroughLUT(lut: Lut?) Sets a custom lookup table for color grading passthrough rendering. Passing null will remove any existing LUT, resetting passthrough to default colors. |
setPreferredDisplayRate | fun setPreferredDisplayRate(rate: Float): Boolean Set the preferred display rate. |
setReferenceSpace | fun setReferenceSpace(space: ReferenceSpace) Sets the current OpenXR reference space. This may be wanted if you are working on a Mixed Reality vs purely Virtual Reality app. |
setSecureLayers | fun setSecureLayers(secureLayers: Boolean) When set to true ensures the layers can not be copied or captured by other apps. |
setSkipRender | fun setSkipRender(skipRender: Boolean) UNSTABLE API. When set to true skips the rendering of the scene |
setSpaceComponentStatus | fun setSpaceComponentStatus(anchorHandle: Long, type: Anchor.SpaceComponentType, enable: Boolean, timeoutNs: Long = 0): CompletableFuture<Void> Set the component status of a space. |
setViewOrigin | fun setViewOrigin(x: Float, y: Float, z: Float) Moves the viewer to the specified location. fun setViewOrigin(x: Float, y: Float, z: Float, degRotation: Float) Moves the viewer to the specified location, facing the specified direction. |
setVirtualCameraPose | |
stopBackgroundSound | fun stopBackgroundSound() Stop playing the background sound. |
tickMRScene | fun tickMRScene() Process one tick of the Scene. |
updateCylinderLayer | fun updateCylinderLayer(id: Int, radius: Float, centralAngle: Float, aspectRatio: Float, pivotX: Float, pivotY: Float, stereoMode: Int) Update a cylinder layer with new parameters. |
updateEquirectLayer | fun updateEquirectLayer(id: Int, radius: Float, centralHorizontalAngle: Float, upperVerticalAngle: Float, lowerVerticalAngle: Float, pivotX: Float, pivotY: Float, stereoMode: Int) Update an equirectangular layer with new parameters. |
updateIBLEnvironment | fun updateIBLEnvironment(envFilename: String) Update IBL environment with an image filename. |
updateQuadLayer | fun updateQuadLayer(id: Int, dimW: Float, dimH: Float, pivotX: Float, pivotY: Float, stereoMode: Int) Update a quad layer with new parameters. |
updateViewOrigin | fun updateViewOrigin(deltaMove: Float, deltaRotation: Float) Offset the viewer by a certain amount. |
object Companion