MouseManager
Methods
addEventListener
addEventListener ( type : string, listener: function ) : null
Adds a listener to an event type.
Parameters:
Name | Type | Required | Description |
---|---|---|---|
type | string | Yes | The type of event to listen to. |
listener | function | Yes | The function that gets called when the event is fired. |
Returns:
Type: null
hasEventListener
hasEventListener( type : string, listener: function ) : boolean
Checks if listener is added to an event type.
Parameters:
Name | Type | Required | Description |
---|---|---|---|
type | string | Yes | The type of event to listen to. |
listener | function | Yes | The function that gets called when the event is fired. |
Returns:
Type: null
removeEventListener
removeEventListener ( type : string, listener: function ) : null
Removes a listener from an event type.
Parameters:
Name | Type | Required | Description |
---|---|---|---|
type | string | Yes | The type of the listener that gets removed. |
listener | function | Yes | The listener function that gets removed. |
Returns:
Type: null
Events
MOUSE_EVENTS.click
The listener will receive the following parameters
Listener Parameters:
Name | Type | Description |
---|---|---|
data | object | |
data.intersects | Array | A list of intersect, ordered by distance |
data.intersects[] | object | An intersect |
data.intersects[].object | AdsumObject3D | The object intersected |
data.intersects[].distance | number | The distance to the intersected object |
MOUSE_EVENTS.dblClick
The listener will receive the following parameters
Listener Parameters:
Name | Type | Description |
---|---|---|
data | object | |
data.intersects | Array | A list of intersect, ordered by distance |
data.intersects[] | object | An intersect |
data.intersects[].object | AdsumObject3D | The object intersected |
data.intersects[].distance | number | The distance to the intersected object |