Options
All
  • Public
  • Public/Protected
  • All
Menu

Class used to create an interactable object. It's a touchable 3D button using a mesh coming from the current scene

since

5.0.0

Hierarchy

Index

Constructors

  • Creates a new 3D button based on a mesh

    Parameters

    • mesh: Mesh

      mesh to become a 3D button. By default this is also the mesh for near interaction collision checking

    • Optional name: string

      defines the control name

    Returns TouchMeshButton3D

Properties

name?: string

Defines the control name

onPointerClickObservable: Observable<Vector3WithInfo>

An event triggered when a control is clicked on (with a mouse)

onPointerDownObservable: Observable<Vector3WithInfo>

An event triggered when the pointer taps the control

onPointerEnterObservable: Observable<Control3D>

An event triggered when pointer enters the control

onPointerMoveObservable: Observable<Vector3>

An event triggered when the pointer moves over the control

onPointerOutObservable: Observable<Control3D>

An event triggered when the pointer moves out of the control

onPointerUpObservable: Observable<Vector3WithInfo>

An event triggered when pointer is up

onToggleObservable: Observable<boolean>

An event triggered when the button is toggled. Only fired if 'isToggleButton' is true

Gets or sets the parent container

pointerDownAnimation: (() => void)

Type declaration

    • (): void
    • Callback used to start pointer down animation

      Returns void

pointerEnterAnimation: (() => void)

Type declaration

    • (): void
    • Callback used to start pointer enter animation

      Returns void

pointerOutAnimation: (() => void)

Type declaration

    • (): void
    • Callback used to start pointer out animation

      Returns void

pointerUpAnimation: (() => void)

Type declaration

    • (): void
    • Callback used to start pointer up animation

      Returns void

Accessors

  • get collidableFrontDirection(): Vector3
  • set collidableFrontDirection(frontWorldDir: Vector3): void
  • Returns the front-facing direction of the button, or BABYLON.Vector3.Zero if there is no 'front'

    Returns Vector3

  • Sets the front-facing direction of the button. Pass in BABYLON.Vector3.Zero to allow interactions from any direction

    Parameters

    • frontWorldDir: Vector3

      the forward direction of the button

    Returns void

  • set collisionMesh(collisionMesh: Mesh): void
  • Sets the mesh used for testing input collision

    Parameters

    • collisionMesh: Mesh

      the new collision mesh for the button

    Returns void

  • Gets or sets the GUI 2D content used to display the button's facade

    Returns Control

  • Gets or sets the GUI 2D content used to display the button's facade

    Parameters

    Returns void

  • get contentResolution(): number
  • set contentResolution(value: number): void
  • Gets or sets the texture resolution used to render content (512 by default)

    Returns number

  • Gets or sets the texture resolution used to render content (512 by default)

    Parameters

    • value: number

    Returns void

  • get isActiveNearInteraction(): boolean
  • Whether the current interaction is caused by near interaction or not

    Returns boolean

  • get isToggleButton(): boolean
  • set isToggleButton(value: boolean): void
  • Setter for if this TouchButton3D should be treated as a toggle button

    Returns boolean

  • Setter for if this TouchButton3D should be treated as a toggle button

    Parameters

    • value: boolean

      If this TouchHolographicButton should act like a toggle button

    Returns void

  • get isToggled(): boolean
  • set isToggled(newState: boolean): void
  • A public entrypoint to set the toggle state of the TouchHolographicButton. Only works if 'isToggleButton' is true

    Returns boolean

  • A public entrypoint to set the toggle state of the TouchHolographicButton. Only works if 'isToggleButton' is true

    Parameters

    • newState: boolean

      The new state to set the TouchHolographicButton's toggle state to

    Returns void

  • get isVisible(): boolean
  • set isVisible(value: boolean): void
  • Gets or sets a boolean indicating if the control is visible

    Returns boolean

  • Gets or sets a boolean indicating if the control is visible

    Parameters

    • value: boolean

    Returns void

  • Gets the mesh used to render this control

    Returns Nullable<AbstractMesh>

  • Gets the transform node used by this control

    Returns Nullable<TransformNode>

  • Gets or sets the control position in world space

    Returns Vector3

  • Gets or sets the control position in world space

    Parameters

    Returns void

  • Gets or sets the control scaling in world space

    Returns Vector3

  • Gets or sets the control scaling in world space

    Parameters

    Returns void

  • get typeName(): string
  • Gets a string representing the class name

    Returns string

Methods

  • _prepareNode(scene: Scene): void
  • dispose(): void
  • Releases all associated resources

    Returns void

  • getClassName(): string
  • Get the current class name of the control.

    Returns string

    current class name

  • getPressDepth(touchPoint: Vector3): number
  • Get the height of the touchPoint from the collidable part of the button

    Parameters

    • touchPoint: Vector3

      the point to compare to the button, in absolute position

    Returns number

    the depth of the touch point into the front of the button

Legend

  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Static method

Settings

Theme