npm package: @gov.nasa.jpl.honeycomb/view-cube
Description: View cube to convey the cameras current orientation relative to world cooridnates.
Latest version: 0.0.6

# View Cube

View cube to convey the cameras current orientation relative to world cooridnates.

See also https://github.com/nasa-jpl/ViewCubeHelper

# Use

```js
import { ViewCube } from '@gov.nasa.jpl.honeycomb/view-cube';
import { OrbitControls } from '@gov.nasa.jpl.honeycomb/view-cube';
import { PerspectiveCamera } from 'three';

// ...

const camera = new PerspectiveCamera();
const controls = new OrbitControls( camera, renderer.domElement );
const viewCube = new ViewCube(camera);

document.body.appendChild( viewCube.domElement );
```

# API

<!-- START_AUTOGENERATED_DOCS -->
## ViewCubeHelper

Class that renders a 3d cube for camera control manipulation.

### camera<a name="ViewCubeHelper#camera"></a>

```js
camera : Camera
```


The camera to mirror the angle of and control the transformation of.


### domElement<a name="ViewCubeHelper#domElement"></a>

```js
domElement : Canvas
```


The dom element that the view cube is rendered to.


### onLerpInitialize<a name="ViewCubeHelper#onLerpInitialize"></a>

```js
onLerpInitialize : ( atTopOrBottomFace : Boolean ) => void = null
```


Called before initializing the lerp (before recording start/end poses)
supplies one boolean parameter: atTopOrBottomFace


### onLerpStart<a name="ViewCubeHelper#onLerpStart"></a>

```js
onLerpStart : (  ) => void = null
```


Called after initializing the lerp (after recording start/end poses)
supplies no parameters


### onLerping<a name="ViewCubeHelper#onLerping"></a>

```js
onLerping : ( lerpFactor : Number ) => void = null
```


Called each frame after we've done some lerping
supplies one parameter: the lerp factor (between 0 to 1)


### onLerpFinished<a name="ViewCubeHelper#onLerpFinished"></a>

```js
onLerpFinished : (  ) => void = null
```


Called after all lerping is finished
supplies no parameters


### getOrbitDistance<a name="ViewCubeHelper#getOrbitDistance"></a>

```js
getOrbitDistance : (  ) => void = null
```


Function that can be used for applications to manually specify the orbit distance to use.
it's useful for if the camera is panning and we need to maintain a certain orbit distance
even though the actual distance to this.orbitCenter may be large/small due to panning.


### constructor

```js
constructor( camera : Camera ) : void
```

### setAxesOrientation<a name="ViewCubeHelper#setAxesOrientation"></a>

```js
setAxesOrientation( quatOrEuler : Quaternion | Euler ) : void
```

Set the axes orientation relative to the cube. This affects how the RGB
lines representing the XYZ axes are rotated.

### setFaceOrientation<a name="ViewCubeHelper#setFaceOrientation"></a>

```js
setFaceOrientation( quatOrEuler : Quaternion | Euler ) : void
```

Set the face orientation so top, bottom, left, right, etc are aligned to the
notional directions of the scene.

### setTargetOrientation<a name="ViewCubeHelper#setTargetOrientation"></a>

```js
setTargetOrientation( quatOrEuler : Quaternion | Euler ) : void
```

Sets the scene orientation to match a scene target that is not necessarily world
axis aligned.

### dispose<a name="ViewCubeHelper#dispose"></a>

```js
dispose(  ) : void
```

Disposes of the renderer used for the ViewCube.


<!-- END_AUTOGENERATED_DOCS -->