#

API Docs for: 0.6.0
Show: Inherited Protected Private Deprecated

# Box Class

Extends Shape
Defined in: `src/shapes/Box.js:7`

A 3d box shape.

## Constructor

### `Box`

(

- `halfExtents`

)

Defined in `src/shapes/Box.js:7`

#### Parameters:

- `halfExtents` Vec3

- Index
- Methods
- Properties

## Item Index

### Methods

- calculateLocalInertia
- getSideNormals
- updateBoundingSphereRadius
- updateConvexPolyhedronRepresentation
- volume

### Properties

- boundingSphereRadius
- collisionResponse
- convexPolyhedronRepresentation
- halfExtents
- type

## Methods

### `calculateLocalInertia`

(

- `mass`
- `target`

)
Vec3

Inherited from Shape but overwritten in `src/shapes/Box.js:73`

#### Parameters:

- `mass` Number
- `target` Vec3

#### Returns:

Vec3:

### `getSideNormals`

(

- `includeNegative`
- `quat`

)
Array

Defined in `src/shapes/Box.js:92`

Get the box 6 side normals

#### Parameters:

- `includeNegative` Boolean

  If true, this function returns 6 vectors. If false, it only returns 3 (but you get 6 by reversing those 3)

- `quat` Quaternion

  Orientation to apply to the normal vectors. If not provided, the vectors will be in respect to the local frame.

#### Returns:

Array:

### `updateBoundingSphereRadius`

() Number

Inherited from Shape: `src/shapes/Shape.js:38`

Computes the bounding sphere radius. The result is stored in the property .boundingSphereRadius

#### Returns:

Number:

### `updateConvexPolyhedronRepresentation`

()

Defined in `src/shapes/Box.js:39`

Updates the local convex polyhedron representation used for some collisions.

### `volume`

() Number

Inherited from Shape: `src/shapes/Shape.js:47`

Get the volume of this shape

#### Returns:

Number:

## Properties

### `boundingSphereRadius`

Number

Inherited from Shape: `src/shapes/Shape.js:25`

The local bounding sphere radius of this shape.

### `collisionResponse`

Boolean

Inherited from Shape: `src/shapes/Shape.js:31`

### `convexPolyhedronRepresentation`

ConvexPolyhedron

Defined in `src/shapes/Box.js:26`

Used by the contact generator to make contacts with other convex polyhedra for example

### `halfExtents`

Vec3

Defined in `src/shapes/Box.js:20`

### `type`

Number

Inherited from Shape: `src/shapes/Shape.js:17`

The type of this shape. Must be set to an int > 0 by subclasses.