Skip to content

Latest commit

 

History

History
135 lines (90 loc) · 5.79 KB

README.md

File metadata and controls

135 lines (90 loc) · 5.79 KB

Oculus Quest Hands

A set of components meant to emulate the behavior and controls of the virtual hands as seen in the First Steps app for the Oculus Quest.

These components enable the ability to pick up, move and drop virtual items with the Oculus Touch controllers. This module includes all the components necessary to enable this functionality.

These components should not be used in conjunction with other hand-control modules or components, such as hand-controls or super-hands components. The prescribed model may, however, be modified to replace the default hand model for the hand-controls component.

The design file for the hand model can be found in ./src/assets. The model may be edited in Autodesk Maya to add additional gestures or customize alignment targets. Additional 3D editors such as Blender may be supported in the future. Please refrain from adding crude or insulting gestures to the model.

Support may eventually be added for Oculus Hand Tracking.

oculus-quest-hands

A wrapper for oculus-touch-controls that adds additional events, methods and a prescribed hand model. This model supports a range of pre-animated poses and gestures to accommodate common gestures a user might make in VR.

The appearance can be modified with 'material' component.

Examples

<!--     with url(path/to/asset);    -->
<a-entity id="leftHand" 
	 oculus-quest-hands="model: url(./handLeft.glb); hand: left; camera: #vr-camera;"
	 material="color: blue;">
</a-entity>
<!--     with asset-item   -->

<a-asset-item id="md-hand" src="path/to/handLeft.glb"></a-asset-item>

<a-entity id="leftHand" 
	 oculus-quest-hands="model: #md-hand hand: left; camera: #vr-camera;"
	 material="color: blue;">
</a-entity>

Properties

Property Property Type Default Value Description
model asset ./handRight.glb The path to the prescribed hand model in glb format.
hand string right The hand this entity represents. Can be one of 'right' or 'left'
camera selector null The height of the rectangle.
debug boolean false Show debug information and log all events to console.

Gestures

Gestures are stored as animation targets in the prescribed hand model.

Alignments

The presribed hand model includes a number of transforms which assist in aligning objects to different hand gestures when they are picked up. Which alignment a grabbed item aligns to may be configured with the 'grabbable' component.

collider

A simple AABB collision detection system.

Example

<a-entity collider="
    interval: 40; 
	 collidesWith: bar; 
	 bounds: auto; 
	 size: 0 0 0;
	 static: false; 
	 enabled: true; 
	 autoRefesh: false;">
</a-entity>

Properties

Property Property Type Default Value Description
interval number 40 number of miliseconds between bounds updates & collision tests.
collidesWith string 'none' A group that this entity considers for collisions if autoRefresh is true. Group membership is determined by the group component.
bounds string auto How the boundaries of the AABB are computed. Can be one of auto,proxy,box or mesh.
static boolean true Whether or not to update the bounds and position on each interval.
enabled boolean true Whether this entity should be by other collider components.
autoRefresh boolean false Whether or not this entity should check for intersections on each interval.

Bounds

Name Description
auto Requires a 3D model component. Creates a proxy object whose bounds are fit to the bounding volume of a mesh. The AABB is computed from the proxy object.
proxy Requires the proxy component. The AABB is computed from the proxy object.
box The AABB is computed from the size property where size is the desired width, depth and height of the bounding volume.
mesh Requires a 3D model component. The AABB is computed from a mesh.

Events

Name Description
hitstart Emitted from both intersecting entities when their AABBs overlap.
hitend Emitted from both intersecting entities when their AABBs no longer overlap.

constraint

Attaches one entity to another using THREE.Object3D.attach(). Removing this attribute restores the entity to its original parent. Used by oculus-quest-hands to pick up and hold objects. This component is not a dynamic constraint.

Example

<a-entity id="foo"></a-entity>
<a-entity constraint="parent: #foo"></a-entity>

Properties

Property Property Type Default Value Description
parent selector null Another entity to attach this one to. May not be the same entity.

grp

A utility for grouping and selecting entities which does not use DOM query methods. Used by collider, grabbable, draggable, droppable and pokeable components to select and filter other collidable objects. A group is defined by grp__<NAME_OF_GROUP>.

Use <a-entity />.setAttribute('grp__foo') to add an entity to a group.

Use <a-entity grp__foo />.removeAttribute('grp__foo') to remove an entity from a group.

Example

<a-entity grp__foo grp__bar></a-entity>