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

PanelSceneObject

PanelSceneObject

class PanelSceneObject : SceneObject
PanelSceneObject combines several components to create an interactive 2D surface in 3D space in the following order:
  1. A PanelSurface that holds the pixels of the panel
  2. A PanelDisplay that renders content on the surface
  3. A PanelInputListener that handles input events
  4. A PanelShape that defines the geometry (quad, cylinder, etc.)
Example: Retrieving a PanelSceneObject from an entity using SceneObjectSystem
// Get the SceneObject associated with the entity (returns a CompletableFuture)
systemManager.findSystem<SceneObjectSystem>().getSceneObject(entity)?.thenAccept { sceneObject ->
    if (sceneObject is PanelSceneObject) {
        // Now you can work with the panel
    }
}

Constructors

NameSummary
PanelSceneObject
constructor(scene: Scene?, ctx: SpatialContext, intent: <Error class: unknown class>, ent: Entity?, config: PanelConfigOptions = PanelConfigOptions(), displayCreator: (ctx: SpatialContext, panelSurface: PanelSurface, <Error class: unknown class>, config: PanelConfigOptions) -> PanelDisplay = { ctx_, panelSurface_, intent_, config_ -> PanelDisplay(ctx_, panelSurface_, config_.calcDPI(), intent = intent_) })constructor(scene: Scene?, ctx: SpatialContext, id: Class<*>?, ent: Entity?, config: PanelConfigOptions = PanelConfigOptions(), displayCreator: (ctx: SpatialContext, panelSurface: PanelSurface, <Error class: unknown class>, config: PanelConfigOptions) -> PanelDisplay = { ctx_, panelSurface_, intent_, config_ -> PanelDisplay(ctx_, panelSurface_, config_.calcDPI(), intent = intent_) })constructor(scene: Scene?, ctx: SpatialContext, ent: Entity?, config: PanelConfigOptions = PanelConfigOptions(), getView: (<Error class: unknown class>) -> <Error class: unknown class>, displayCreator: (ctx: SpatialContext, panelSurface: PanelSurface, getView: (<Error class: unknown class>) -> <Error class: unknown class>, config: PanelConfigOptions) -> PanelDisplay = { ctx_, panelSurface_, getView_, config_ -> PanelDisplay( ctx_, panelSurface_, config_.calcDPI(), getView = getView_, themeResourceId = config_.themeResourceId, ) })constructor(scene: Scene?, ctx: SpatialContext, id: Int, ent: Entity?, config: PanelConfigOptions = PanelConfigOptions(), displayCreator: (ctx: SpatialContext, panelSurface: PanelSurface, getView: (<Error class: unknown class>) -> <Error class: unknown class>, config: PanelConfigOptions) -> PanelDisplay = { ctx_, panelSurface_, getView_, config_ -> PanelDisplay( ctx_, panelSurface_, config_.calcDPI(), getView = getView_, themeResourceId = config_.themeResourceId, ) })constructor(scene: Scene?, ent: Entity?, config: PanelConfigOptions = PanelConfigOptions())constructor(scene: Scene?, ent: Entity?, opts: PanelConfigOptions2)constructor(scene: Scene?, ctx: SpatialContext, ent: Entity?, opts: PanelConfigOptions2, displayCreator: (ctx: SpatialContext, panelSurface: PanelSurface, options: PanelConfigOptions2) -> PanelDisplay = { ctx_, panelSurface_, options_ -> val style = options_.style() ?: StyleConfigOptions2() val resolution = options_.resolution() ?: ResolutionConfigOptions2() val layout = options_.get(LayoutOptions::class.java)!! when (layout) { is ContentViewConfigOptions2 -> PanelDisplay( ctx_, panelSurface_, resolution.dpi, getView = (layout as ContentViewConfigOptions2).getView(), themeResourceId = style.themeResourceId, ) is ActivityConfigOptions2 -> PanelDisplay( ctx_, panelSurface_, resolution.dpi, intent = ((layout as ActivityConfigOptions2).getIntent())(ctx_)) else -> throw IllegalArgumentException( "Missing panel layout config options, use activity or contentView API to setup the panel layout.") } })

Types

NameSummary
Companion
object Companion

Properties

NameSummary
entity
val entity: Entity?
handle
var handle: Long
materials
var materials: Array<SceneMaterial>?

Array of SceneMaterials created from this SceneObject’s mesh property. Changes to the materials in this array will be unique to this SceneObject, but these materials will inhererit any changes made in the SceneMesh they come from.
mesh
var mesh: SceneMesh?

Reference to the SceneMesh used by this SceneObject. This property is a reference to the underlying mesh resource. Changes to the SceneMesh or its SceneMaterials will be reflected across all SceneObjects that reference it.
options
var options: PanelConfigOptions2
rootView
val rootView: <Error class: unknown class>?

Gets the root View of the panel’s display.
shapeType
val PanelSceneObject.shapeType: PanelShapeType

Functions

NameSummary
addInputListener
fun addInputListener(listener: InputListener): Long

Add an input listener to this SceneObject.
attachDisplay
fun attachDisplay(ctxt: SpatialContext, clickButtons: Int, displayCreator: (PanelSurface) -> PanelDisplay)
createIsdkComponents
fun PanelSceneObject.createIsdkComponents(entity: Entity)
destroy
fun destroy()

Destory this SceneObject.
destroyInternal
open override fun destroyInternal()

Destroy this SceneObject’s native components.
detachDisplay
fun detachDisplay()
getDisplay
fun getDisplay(): PanelDisplay

Gets the PanelDisplay associated with this panel.
getLayer
fun getLayer(): SceneLayer?

Gets the layer used by this panel.
getPanelConfigOptions2
fun getPanelConfigOptions2(): PanelConfigOptions2
getPanelShapeConfig
fun getPanelShapeConfig(): PanelShapeConfig?

Gets the config used used to create this panel.
getSurface
fun getSurface(): <Error class: unknown class>

Gets the PanelSurface associated with this panel.
getSwapchain
fun getSwapchain(): SceneSwapchain?

Gets the SceneSwapchain associated with this panel.
getTexture
fun getTexture(): SceneTexture?

Gets the texture used by this panel.
onClick
open fun onClick(hitInfo: HitInfo, sourceOfInput: Entity)

Handler for clicks on this SceneObject.
onClickDown
fun onClickDown(hitInfo: HitInfo, sourceOfInput: Entity)

Handler for click downs on this SceneObject. Use onClick() to ensure user releases the click on the SceneObject.
onHoverStart
open fun onHoverStart(sourceOfInput: Entity)

Handler for the start of hovers on this SceneObject.
onHoverStop
open fun onHoverStop(sourceOfInput: Entity)

Handler for the termination of hovers on this SceneObject.
onInput
open fun onInput(hitInfo: HitInfo, sourceOfInput: Entity, changed: Int, buttonState: Int, downTime: Long): Boolean

Handler to handle generic input.
onPointerEvent
open fun onPointerEvent(hitInfo: HitInfo, type: Int, sourceOfInput: Entity, scrollInfo: Vector2, semanticType: Int = SemanticType.Unknown.id)

Handler to handle pointer events on this SceneObject.
removeInputListener
fun removeInputListener(id: Long)

Remove an input listener by id.
reshape
fun reshape(shapeConfig: PanelShapeConfig)

Destroy and recreate the PanelShape with the given config.



fun reshape(options: PanelConfigOptions2)
setIsVisible
fun setIsVisible(isVisible: Boolean)

Set whether this SceneObject is visible.
setLocalNodePose
fun setLocalNodePose(node: Int, pose: Pose)

Sets the local transform of the node (relative to it’s parent) to the input pose
setPosition
fun setPosition(position: Vector3)

fun setPosition(x: Float, y: Float, z: Float)

Set the 3D position of this SceneObject.
setRotation
fun setRotation(pitch: Float, yaw: Float, roll: Float)

Set the rotation of this SceneObject.
setRotationQuat
fun setRotationQuat(quat: Quaternion)

fun setRotationQuat(x: Float, y: Float, z: Float, w: Float)

Set the rotation of this SceneObject.
setScale
open override fun setScale(scale: Vector3)

Set the scale of the model. The default value is 1.0f.
setSceneMesh
open fun setSceneMesh(mesh: SceneMesh, name: String)

Set the SceneMesh for this SceneObject.
shouldFrustumCull
fun shouldFrustumCull(cull: Boolean)

Whether this SceneObject can be frustum culled (default is true)
stopInput
open fun stopInput(sourceOfInput: Entity, downTime: Long)

This function calls the stopInput function on all InputListener for this SceneObject. This is called automatically by Scene when handling inputs.
updateAnimationTrackToTime
fun updateAnimationTrackToTime(track: Int, timeInSeconds: Float)

Update the local transforms of the model to match the given animation track at the specified time (matching keyframe time in the glTF).
updateIsdkComponentProperties
fun PanelSceneObject.updateIsdkComponentProperties(entity: Entity)
updateNodeLocalPoseToObjectPose
fun updateNodeLocalPoseToObjectPose(node: Int, pose: Pose)

Sets the local transform of a node (relative to it’s parent) such that the resulting object transform (relative to the model) is placed at the input pose
updateSceneMesh
fun updateSceneMesh(meshModifier: SceneMesh.() -> Unit)

Modify and update this SceneObject’s mesh.

Companion

object Companion
Did you find this page helpful?
Thumbs up icon
Thumbs down icon