> ## Documentation Index
> Fetch the complete documentation index at: https://docs.speckle.systems/llms.txt
> Use this file to discover all available pages before exploring further.

# BatchObject

## Constructors

### constructor

```typescript theme={null}
constructor(renderView: NodeRenderView, batchIndex: number)
```

Populates/constructs this batch object.

**Parameters**

* **renderView**: [*NodeRenderView*](/developers/viewer/render-view-api)
* **batchIndex**: The object's index within its batch. Objects are placed in order inside the batch as they get processed

## Properties

### transform

```typescript theme={null}
transform: Matrix4;
```

The batch object's immediate transformation

**Returns**: [Matrix4](https://threejs.org/docs/index.html?q=matr#api/en/math/Matrix4)

### transformInv

```typescript theme={null}
transformInv: Matrix4;
```

The batch object's immediate inverse transformation

**Returns**: [Matrix4](https://threejs.org/docs/index.html?q=matr#api/en/math/Matrix4)

## Accessors

### aabb

```typescript theme={null}
get aabb(): Box3
```

Gets the axis aligned bounding box of this object.

<Tip>
  If you want to work with object dimensions and positioning, this is the bounds to use. This is the *transformed* aabb, unlike [*NodeRenderView's aabb*](/developers/viewer/render-view-api#aabb) which does not take any transformation into account.
</Tip>

**Returns**: [*Box3*](https://threejs.org/docs/index.html?q=box#api/en/math/Box3)

### accelerationStructure

```typescript theme={null}
get accelerationStructure(): AccelerationStructure
```

Gets the object's bottom level BVH.

**Returns**: [*AccelerationStructure*](/developers/viewer/acceleration-structure-api)

### batchIndex

```typescript theme={null}
get batchIndex(): number
```

Gets the object's index inside its batch.

**Returns**: number

### localOrigin

```typescript theme={null}
get localOrigin(): Vector3
```

Gets local origin of the object. i.e the render view's aabb center.

**Returns**: [*Vector3*](https://threejs.org/docs/index.html?q=vec#api/en/math/Vector3)

### renderView

```typescript theme={null}
get renderView(): NodeRenderView
```

Gets the start index inside the batch's index buffer.

**Returns**: [*NodeRenderView*](/developers/viewer/render-view-api)

## Methods

### buildAccelerationStructure

```typescript theme={null}
buildAccelerationStructure(bvh?: MeshBVH)
```

Build this object's [*AccelerationStructure*](/developers/viewer/acceleration-structure-api) either from scratch, using the render view's geometry, either by using the optional bvh argument. BVH's can be shared between objects as long as it makes sense like for example for instances.

<Tip>
  The speckle viewer uses the [three-mesh-bvh](https://github.com/gkjohnson/three-mesh-bvh) library as the backbone for any BVH related operations.
</Tip>

**Parameters**

* *optional* **bvh**: [*MeshBVH*](https://github.com/gkjohnson/three-mesh-bvh)

**Returns**: void

### transformTRS

```typescript theme={null}
public transformTRS(
    translation: VectorLike,
    euler?: VectorLike,
    scale?: VectorLike,
    pivot?: VectorLike
  )
```

Used for transforming the object by using translation, rotation, scale and rotation pivot values.

**Parameters**

* **translation**: The translation component of the transformation
* *optional* **euler**: Rotation component as euler angles in XYZ order
* *optional* **scale**: Scale component of the transformation
* *optional* **pivot**: The rotation pivot

**Returns**: void

## Typedefs

### VectorLike

```typescript theme={null}
type VectorLike = { x: number; y: number; z?: number; w?: number };
```

Archtype for Vector2, Vector3 and Vector4.

### InstancedBatchObject

```typescript theme={null}
class InstancedBatchObject extends BatchObject
```

Child class used for instanced objects. No additional functionality, just some additional required logic wrapped.
