SpatialModeChangeListener


fun interface SpatialModeChangeListener


The SpatialModeChangeListener is used to handle scenegraph updates when the spatial mode for the scene changes.

Summary

Public functions

Unit
onSpatialModeChanged(recommendedPose: Pose, recommendedScale: Float)

Callback that provides a new recommended pose and scale for placing content.

Public functions

onSpatialModeChanged

Added in 1.0.0-alpha05
fun onSpatialModeChanged(recommendedPose: Pose, recommendedScale: Float): Unit

Callback that provides a new recommended pose and scale for placing content.

This is called whenever the activity encounters a spatial mode change or re-center. The most common app behavior is to set the pose and scale of an entity relative to the ActivitySpace origin. The default behavior is equivalent to:

Scene.keyEntity.setPose(recommendedPose, relativeTo = Space.ACTIVITY);
Scene.keyEntity.setScale(recommendedScale, relativeTo = Space.ACTIVITY);
Parameters
recommendedPose: Pose

the recommended pose for the keyEntity. The pose is relative to ActivitySpace origin, not relative to the keyEntity's parent.

recommendedScale: Float

the recommended scale for the keyEntity. The scale value is the accumulated scale for this entity i.e. accumulated scale in ActivitySpace, not relative to the keyEntity's parent.