JointCollisionEvents

altspace/utilities/behaviors. JointCollisionEvents

The JointCollisionEvents behavior dispatches collision events which have been triggered by TrackingJoints intersecting with the object that has this behavior.

Constructor

new JointCollisionEvents(configopt)

Parameters:
Name Type Attributes Description
config Object <optional>

Optional parameters.

Properties
Name Type Attributes Default Description
joints Array.<JointId> <optional>
HAND_JOINTS

Array of JointIds to track.

jointCubeSize Number <optional>
15

Size of dummy cube used to track each joint. For optimal results, it is recommended that the value provided is scaled according to your enclosure scaling factor.

Extends

Members

(static, constant) HAND_JOINTS :Array.<JointId>

An array of JointIds describing the tip of every finger on both hands.

type :string

The string name of this class. This is used for THREE.Object3D#getBehaviorByType.

Overrides:

Methods

Type Definitions

JointId

An array in the form of [bodyPart, side, subIndex] identifying a joint in the tracking skeleton. E.g. ['Index', 'Left', 0] identifies the first joint on the index finger of the left hand. See TrackingSkeleton#getJoint for available joint names.

Events

jointcollision

Fires a continuous event while any joints are colliding with the object.

Properties:
Name Type Description
detail Object

Event details

Properties
Name Type Description
intersect THREE.Box3

A union of all joint bounding boxes which intersected with the object.

joints Array.<module:altspace~TrackingJoint>

An array of joints which which were involved in the intersection union.

target THREE.Object3D

The object which was intersected.

jointcollisionenter

Fires a single event when any specified joints initially collide with the object.

Properties:
Name Type Description
detail Object

Event details

Properties
Name Type Description
intersect THREE.Box3

A union of all joint bounding boxes which intersected with object.

joints Array.<module:altspace~TrackingJoint>

An array of joints which which were involved in the intersection union.

target THREE.Object3D

The object which was intersected.

jointcollisionleave

Fires a single event when all joints are no longer colliding with the object.

Properties:
Name Type Description
detail Object

Event details

Properties
Name Type Description
intersect THREE.Box3

A union of all joint bounding boxes which last intersected with the object.

joints Array.<module:altspace~TrackingJoint>

An array of joints which which were involved in the intersection union.

target THREE.Object3D

The object which was intersected.