# GSplatResourceBase

Class · category: Graphics

Source: https://github.com/playcanvas/engine/blob/95c49bde59c2bfca2928a8ab38dd6e1b6fb4057e/src/scene/gsplat/gsplat-resource-base.js#L28

Base class for Gaussian splat resources, with the properties all of them share. The resource of
a loaded gsplat [Asset](https://api.playcanvas.com/engine/classes/Asset.md) is one of its subclasses, except for streamed level-of-detail data,
which uses [GSplatOctreeResource](https://api.playcanvas.com/engine/classes/GSplatOctreeResource.md). [GSplatContainer](https://api.playcanvas.com/engine/classes/GSplatContainer.md) creates one procedurally.

## Properties

### _aabb

```ts
protected _aabb: BoundingBox
```

### _centers

```ts
protected _centers: Float32Array<ArrayBufferLike> | null
```

### _format

```ts
protected _format: GSplatFormat = null
```

Format descriptor for this resource. Assigned by derived classes.

## Accessors

### aabb

```ts
get aabb(): BoundingBox
```

Gets the bounding box of the splats, in the local space of the resource. It is computed from
the splat data; use [GSplatComponent#customAabb](https://api.playcanvas.com/engine/classes/GSplatComponent.md#customaabb) to override the bounds of a component.

### antiAlias

```ts
get antiAlias(): boolean
set antiAlias(value: boolean)
```

Gets whether the splats were trained with anti-aliasing.

### centers

```ts
set centers(value: Float32Array<ArrayBufferLike> | null)
```

CPU-side splat center positions (xyz per splat), or null when not built for this resource.

### extras

```ts
get extras(): any
```

Application-defined data stored with the splat file, as in glTF's `extras`: the `extras`
value of a SOG's meta.json. The engine attaches no meaning to it. Undefined when the file
has none, and for formats that cannot carry it.

### format

```ts
get format(): GSplatFormat
```

Gets the format descriptor for this resource. The format defines texture streams and
shader code for reading splat data. Use this to add extra streams.

### numSplats

```ts
get numSplats(): number
```

Gets the number of splats in the resource.

### textureDimensions

```ts
get textureDimensions(): Vec2
```

Gets the texture dimensions (width and height) used by this resource's data textures.

## Methods

### _actualDestroy

```ts
protected _actualDestroy(): void
```

Actually destroys this resource and releases all GPU resources.
Derived classes should override this method instead of destroy().

### destroy

```ts
destroy(): void
```

Destroys this resource. If the resource is still in use by the sorter, destruction is
automatically deferred until it's safe.

### getTexture

```ts
getTexture(name: string): Texture | null
```

Gets a texture by name.

**Parameters**

- `name` (`string`): The name of the texture.

**Returns** [`Texture`](https://api.playcanvas.com/engine/classes/Texture.md) `| null`: The texture, or null if not found.
