# GSplatComponentElement

Class · extends [`ComponentElement`](https://api.playcanvas.com/web-components/classes/ComponentElement.md)`<GSplatComponent>` · category: Components

Source: https://github.com/playcanvas/web-components/blob/252f001881302c266c8d727044408c32be2bb5e7/src/components/gsplat-component.ts#L22

The GSplatComponentElement interface provides properties and methods for manipulating
[`<pc-gsplat>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-gsplat/) elements.
The GSplatComponentElement interface also inherits the properties and methods of the
[HTMLElement](https://developer.mozilla.org/docs/Web/API/HTMLElement) interface.

Engine component: [GSplatComponent](https://api.playcanvas.com/engine/classes/GSplatComponent.html) (`gsplat`).

**elementSummary** The `<pc-gsplat>` element renders the 3D Gaussian splats of a `gsplat` asset at
its entity, with attributes for shadow casting and level of detail. Must be a child of a
`<pc-entity>`, `<pc-model>` or `<pc-node>`.

## Accessors

### asset

```ts
get asset(): string
set asset(value: string)
```

Gets the id of the `pc-asset` to use for the splat.

### castShadows

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

Gets whether the splat casts shadows.

### component

```ts
get component(): GSplatComponent | null
```

Gets the underlying PlayCanvas gsplat component. `null` until the element is
ready — see [ComponentElement.component](https://api.playcanvas.com/web-components/classes/ComponentElement.md#component).

### lodBaseDistance

```ts
get lodBaseDistance(): number
set lodBaseDistance(value: number)
```

Gets the camera distance of the first LOD transition.

### lodMultiplier

```ts
get lodMultiplier(): number
set lodMultiplier(value: number)
```

Gets the multiplier between successive LOD transition distances.

### lodRangeMax

```ts
get lodRangeMax(): number
set lodRangeMax(value: number)
```

Gets the maximum allowed LOD index.

### lodRangeMin

```ts
get lodRangeMin(): number
set lodRangeMin(value: number)
```

Gets the minimum allowed LOD index.

## Methods

### getInitialComponentData

```ts
protected getInitialComponentData(): { asset: Asset<string> | null | undefined; castShadows: boolean; lodBaseDistance: number; lodMultiplier: number; lodRangeMax: number; lodRangeMin: number }
```

Returns the data the component is created with. Overridden by subclasses to supply the
initial values of their cached properties. The element's `enabled` state is not among them:
the base class adds it when it creates the component.

**Returns** `{ asset: Asset<string> | null | undefined; castShadows: boolean; lodBaseDistance: number; lodMultiplier: number; lodRangeMax: number; lodRangeMin: number }`: The initial component data.

## Inherited from [ComponentElement](https://api.playcanvas.com/web-components/classes/ComponentElement.md)

- `get closestApp(): AppElement | null`
- `get closestEntity(): EntityBaseElement | null`
- `get enabled(): boolean` · `set enabled(value: boolean)`
- `protected _onReady(): void`
- `protected _resetReady(): void`
- `protected initComponent(): void`
- `ready(): Promise<GSplatComponentElement>`
