Object3D

THREE. Object3D

new Object3D()

The AltspaceSDK adds Behavior capabilites to Three.js' Object3D class.

Methods

addBehavior(behavior)

Adds the given behavior to this object.

Parameters:
Name Type Description
behavior Behavior

Behavior to add.

addBehaviors(…behavior)

Adds the given behaviors to this object.

Parameters:
Name Type Attributes Description
behavior Behavior <repeatable>

Behavior to add.

getBehaviorByType(type) → {Behavior}

Retrieve a behavior by type.

Parameters:
Name Type Description
type String

removeAllBehaviors()

Removes all behaviors from this object. The behaviors are disposed if possible.

removeBehavior(…behavior)

Removes the given behavior from this object. The behavior is disposed if possible.

Parameters:
Name Type Attributes Description
behavior Behavior <repeatable>

Behavior to remove.

updateBehaviors(deltaTime)

Update behaviors on this object.

Parameters:
Name Type Description
deltaTime Number

Elapsed time in milliseconds

Type Definitions

ThreeJSCursorEvent

The ThreeJSCursorEvent interface represents events that occur due to the user interacting with three.js objects using the cursor

Properties:
Name Type Description
ray THREE.Ray

The ray that was used to project the cursor. Will often come from either the user's center eye or a motion controller they are holding.

point THREE.Vector3

The point in world space where the ray intersected an object.

bubbles Boolean

Whether this event will bubble up the three.js hierarchy. True for all ThreeJSCursorEvents. Roughly matches DOM bubbling (does not have a capture step).

target THREE.Object3D

The THREE.Object3D the event originally fired on.

currentTarget THREE.Object3D

The THREE.Object3D the event is currently firing on as it bubbles.

stopPropagation function

Allows the remaining event listeners for this event on this THREE.Object3D to fire and then stops.

stopImmediatePropagation function

Stops the firing of any more event listeners for this event.

Events

cursordown

The cursordown event is fired from an THREE.Object3D when the user's primary cursor button is pressed down over an object

Type:

cursorup

The cursorup event is fired from an THREE.Object3D when the user's primary cursor button is lifted up over an object

Type: