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

PanelShapeConfig

PanelShapeConfig

open class PanelShapeConfig(var pivotOffsetHeight: Float = 0.5f, var pivotOffsetWidth: Float = 0.5f, var fractionOfScreen: Float = 0.5f, var height: Float = 1.0f * 3f / 4f, var width: Float = 1.0f, var radiusForCylinderOrSphere: Float = MAX_RADIUS, var unlit: Boolean = true, var includeGlass: Boolean = true, var stereoMode: StereoMode = StereoMode.None, var alphaMode: AlphaMode = AlphaMode.HOLE_PUNCH, var forceSceneTexture: Boolean = true, var panelShader: String = SceneMaterial.HOLE_PUNCH_PANEL_SHADER, var sceneMeshCreator: PanelShapeConfig.(texture: SceneTexture) -> SceneMesh? = null, var layerConfig: LayerConfig? = LayerConfig(), var panelShapeType: PanelShapeType = PanelShapeType.QUAD, var enableTransparent: Boolean = true, var enableLayer: Boolean = true)
This class defines the common properties used to configure the geometry and appearance of panels in 3D space. It serves as the base class for PanelConfigOptions, which provides additional parameters to intialize the Android Virtual Display.

Constructors

NameSummary
PanelShapeConfig
constructor(pivotOffsetHeight: Float = 0.5f, pivotOffsetWidth: Float = 0.5f, fractionOfScreen: Float = 0.5f, height: Float = 1.0f * 3f / 4f, width: Float = 1.0f, radiusForCylinderOrSphere: Float = MAX_RADIUS, unlit: Boolean = true, includeGlass: Boolean = true, stereoMode: StereoMode = StereoMode.None, alphaMode: AlphaMode = AlphaMode.HOLE_PUNCH, forceSceneTexture: Boolean = true, panelShader: String = SceneMaterial.HOLE_PUNCH_PANEL_SHADER, sceneMeshCreator: PanelShapeConfig.(texture: SceneTexture) -> SceneMesh? = null, layerConfig: LayerConfig? = LayerConfig(), panelShapeType: PanelShapeType = PanelShapeType.QUAD, enableTransparent: Boolean = true, enableLayer: Boolean = true)

Types

NameSummary
Companion
object Companion

Properties

NameSummary
alphaMode
open var alphaMode: AlphaMode

The AlphaMode to use for the panel.
enableLayer
open var enableLayer: Boolean

Enables Layers for the panel. Deprecated, use layerConfig instead.
enableTransparent
open var enableTransparent: Boolean

Need to enable this for layer panels to have working transparency. Side Effects: The SceneTexture will be created, and panelShader will be set to SceneMaterial.HOLE_PUNCH_PANEL_SHADER. This shader uses the SceneTexture to selectively holepunch transparent pixels.
forceSceneTexture
open var forceSceneTexture: Boolean

Forces the SceneTexture to be created when Layers are enabled. This can be useful for masks and shaders but comes at a performance cost.
fractionOfScreen
open var fractionOfScreen: Float

Percentage of screen that panel should fit in. Optimizes resolution of panel based on resolution of Quest device.
height
open var height: Float

The height of the panel in meters, used to calculate the size of the panel in the scene.
includeGlass
open var includeGlass: Boolean

If true, the panel will have glass frame effect rendered in the scene. Only applies to Quad panels, overriden by sceneMeshCreator.
layerConfig
open var layerConfig: LayerConfig?

Optional configuration for the panel’s layer. Setting this to non-null will enable Layers.
panelShader
open var panelShader: String

Optional path to a custom shader to use for the panel. SceneMaterial.Companion has default bundled shaders that can be used.
panelShapeType
open var panelShapeType: PanelShapeType

Sets the shape of the Panel. Options exist at PanelShapeType. This parameter is used alongside radius, height, and width, to determine the geometry of the Panel mesh and layer (if enabled).
pivotOffsetHeight
open var pivotOffsetHeight: Float

Panel offset from Entity origin relative to panel height (Quad panels only). Default of 0.5f places panel in center of Entity.
pivotOffsetWidth
open var pivotOffsetWidth: Float

Panel offset from Entity origin relative to panel width (Quad panels only). Default of 0.5f places panel in center of Entity.
radiusForCylinderOrSphere
open var radiusForCylinderOrSphere: Float

The radius of the panel in meters if PanelShapeType is set to Cylinder or Equirect.
sceneMeshCreator
open var sceneMeshCreator: PanelShapeConfig.(texture: SceneTexture) -> SceneMesh?

Optional function to create a custom mesh for the panel. Will override any values set for width, height, radius, etc.
stereoMode
open var stereoMode: StereoMode

The StereoMode to use for the panel.
unlit
open var unlit: Boolean

If true, the panel will ignore scene lighting.
width
open var width: Float

The width of the panel in meters, used to calculate the size of the panel in the scene.

Functions

NameSummary
generateSceneMeshCreator
fun generateSceneMeshCreator(): PanelShapeConfig.(texture: SceneTexture) -> SceneMesh

Generates a scene mesh creator function based on the current configuration.
init
fun init()

Companion

object Companion

Properties

NameSummary
MAX_RADIUS
const val MAX_RADIUS: Float = 100.0f

Maximum radius value for cylindrical and spherical panels
Did you find this page helpful?
Thumbs up icon
Thumbs down icon