Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
Add API documentation for ARAnchorManager
Browse files Browse the repository at this point in the history
  • Loading branch information
jsantell committed Mar 2, 2018
1 parent dff81db commit 74ba1de
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions API.md
Expand Up @@ -8,6 +8,28 @@ Creates an ARView with a [VRDisplay] and a [THREE.WebGLRenderer]. Handles the pa

Renders the pass through camera. Usually called on every frame in a render loop before rendering other objects in the scene.

## new THREE.ARAnchorManager(vrDisplay)

Creates an ARAnchorManager with a [VRDisplay]. Allows the adding of [THREE.Object3D]s to be tracked and updated accurately as scene understanding improves via anchors. Extends `EventTarget`, so subscribe to events via:

```js
anchorManager.addEventListener('anchorsupdated', e => {
e.anchors.forEach(obj => console.log('updated', obj));
});
```

Currently there's only the `anchorsupdated` event has an `anchors` property containing an array
of all updated [THREE.Object3D]s when an anchor update occurs.

### ARAnchorManager THREE.ARAnchorManager#add(object)

Takes a [THREE.Object3D] and sets an anchor at its current position. If anchor is updated, the
object will be updated accordingly, and a `anchorsupdated` event will be fired on the ARAnchorManager. Returns the ARAnchorManager.

### boolean THREE.ARAnchorManager#remove(object)

Removes the anchor from [THREE.Object3D] and will no longer be updated when an anchor changes. Returns a boolean indicating if the object was being tracked initially.

## new THREE.ARReticle(vrDisplay, innerRadius, outerRadius, color, easing)

Creates a [THREE.Mesh] reticle to render via hit tests with the [VRDisplay].
Expand Down

0 comments on commit 74ba1de

Please sign in to comment.