Repository

Clickable

Extends:

Component → Clickable

Constructor Summary

Public Constructor
public

Makes a Mesh clickable

Member Summary

Public Members
public

camera: *

public

canvas: *

public
public
public

mesh: *

public
public
public
public
public
public

Method Summary

Public Methods
public

Setup for this clickable instance

Inherited Summary

From class Component
public
public
public

events: *

public

id: *

public

name: *

private

_nexts: *[]

private
public
public

chain(component: Component)

Adds a component to this chained component array

public

Returns the array of attached children components

public

off()

Deactivate the component

public

on()

Activate the component A call to this method calls the setup method if it has not been run yet

public

Run code after the update of all components is run This empty method is usually overriden to perform post-update actions for the component It is called periodically by an internal Mobilizing mechanism

public

preLoad the component This empty method is usually overriden to perform preLoad actions for the component.

public

Run code before the update of all components is run This empty method is usually overriden to perform pre-update actions for the component It is called once per component by an internal Mobilizing mechanism

public

prepare the component This empty method is usually overriden to perform preparation actions for the component, from external process as a server.

public

Set's up the component This empty method is usually overriden to perform setup actions for the component This is where all the initialization (such as adding event listeners)should be done It is called automatically by an internal Mobilizing mechanism and should thus not be called directly

public

Update the component This empty method is usually overriden to perform update actions for the component It is called periodically by an internal Mobilizing mechanism

Public Constructors

public constructor(params: Object) source

Makes a Mesh clickable

Override:

Component#constructor

Params:

NameTypeAttributeDescription
paramsObject

Parameters object, given by the constructor.

params.pointerPointer

a Pointer input object to use for the interaction. If none provided, a Pointer is created internally by this class, but it needs a canvas reference (i.e the canvas uses by the renderer)

params.cameraCamera

the camera used in the scene to compute the pick on the mesh

params.meshMesh

the target mesh to make clickable

params.canvasCanvas

the canvas to use for the Pointer input to work (i.e the canvas uses by the renderer)

params.continuousBoolean

set the hover (enter) behavious continuous (i.e not only once on the mesh entering, but at each pointer's move)

params.onPressonPress

onPress Handler

params.onReleaseonRelease

onRelease Handler

params.continuouscontinuous

defines if the events triggered by this clickable should be conituous (every frame) or not (on event only)

params.onEnteronEnter

Handler

params.onLeaveonLeave

Handler

Public Members

public camera: * source

public canvas: * source

public continuous: * source

public hovered: boolean source

public mesh: * source

public onEnter: * source

public onLeave: * source

public onPress: * source

public onRelease: * source

public picked: boolean source

public pointer: * source

Public Methods

public setup() source

Setup for this clickable instance

Override:

Component#setup