# URDFViewer

class in `urdf-loader`

```js
import { URDFViewer } from 'urdf-loader';
```

A custom HTML element that loads and displays a URDF robot model in a THREE.js scene.

## Properties

### .package: string

Corresponds to the `package` parameter in `URDFLoader.load`.

### .urdf: string

Corresponds to the `urdfpath` parameter in `URDFLoader.load`.

### .ignoreLimits: boolean

Whether or not the display should ignore the joint limits specified in the model when updating angles.

### .up: string

The axis to associate with "up" in THREE.js. Values can be [+-][XYZ].

### .displayShadow: boolean

Whether or not to render the shadow under the robot.

### .ambientColor: string

The color of the ambient light specified with css colors.

### .autoRedraw: boolean

Automatically redraw the model every frame instead of waiting to be dirtied.

### .noAutoRecenter: boolean

Recenter the camera only after loading the model.

### .jointValues: Object

Sets or gets the jointValues of the robot as a dictionary of `joint-name` to `radian` pairs.

## Methods

### .redraw

```js
.redraw(  ): void
```

Dirty the renderer so the element will redraw next frame.

### .recenter

```js
.recenter(  ): void
```

Recenter the camera to the model and redraw.

### .setJointValue

```js
.setJointValue( jointName: string, ...jointValues: number | null ): void
```

Sets the given joint to the provided value(s). See URDFJoint.setJointValue.

- `jointName`, `string`: The name of the joint to set
- `jointValues`, `number | null`: The value(s) to set

### .setJointValues

```js
.setJointValues( jointValueDictionary: Object ): void
```

Sets all joint names specified as keys to radian angle value.

- `jointValueDictionary`, `Object`: A dictionary of joint names to values

## Events

### urdf-change

Fires when the URDF has changed and a new one is starting to load.

### ignore-limits-change

Fires when the `ignore-limits` attribute changes.

### urdf-processed

Fires when the URDF has finished loading and getting processed.

### geometry-loaded

Fires when all the geometry has been fully loaded.
