/** * The GSplatComponent enables an {@link Entity} to render 3D Gaussian Splats. Splats are always * loaded from {@link Asset}s rather than being created programmatically. The asset type is * `gsplat` which are in the `.ply` file format. * * Relevant examples: * * - [Loading a Splat](https://playcanvas.github.io/#/loaders/gsplat) * - [Custom Splat Shaders](https://playcanvas.github.io/#/loaders/gsplat-many) * * @category Graphics */ export class GSplatComponent extends Component { /** * Create a new GSplatComponent. * * @param {import('./system.js').GSplatComponentSystem} system - The ComponentSystem that * created this Component. * @param {import('../../entity.js').Entity} entity - The Entity that this Component is * attached to. */ constructor(system: import("./system.js").GSplatComponentSystem, entity: import("../../entity.js").Entity); /** @private */ private _layers; /** * @type {import('../../../scene/gsplat/gsplat-instance.js').GSplatInstance|null} * @private */ private _instance; /** * @type {import('../../../core/shape/bounding-box.js').BoundingBox|null} * @private */ private _customAabb; /** * @type {AssetReference} * @private */ private _assetReference; /** * @type {import('../../../scene/gsplat/gsplat-material.js').SplatMaterialOptions|null} * @private */ private _materialOptions; /** * @type {import('../../../core/event-handle.js').EventHandle|null} * @private */ private _evtLayersChanged; /** * @type {import('../../../core/event-handle.js').EventHandle|null} * @private */ private _evtLayerAdded; /** * @type {import('../../../core/event-handle.js').EventHandle|null} * @private */ private _evtLayerRemoved; /** * Sets a custom object space bounding box for visibility culling of the attached gsplat. * * @type {import('../../../core/shape/bounding-box.js').BoundingBox|null} */ set customAabb(value: import("../../../core/shape/bounding-box.js").BoundingBox | null); /** * Gets the custom object space bounding box for visibility culling of the attached gsplat. * * @type {import('../../../core/shape/bounding-box.js').BoundingBox|null} */ get customAabb(): import("../../../core/shape/bounding-box.js").BoundingBox | null; /** * Sets a {@link GSplatInstance} on the component. If not set or loaded, it returns null. * * @type {import('../../../scene/gsplat/gsplat-instance.js').GSplatInstance|null} * @ignore */ set instance(value: import("../../../scene/gsplat/gsplat-instance.js").GSplatInstance | null); /** * Gets the {@link GSplatInstance} on the component. * * @type {import('../../../scene/gsplat/gsplat-instance.js').GSplatInstance|null} * @ignore */ get instance(): import("../../../scene/gsplat/gsplat-instance.js").GSplatInstance | null; set materialOptions(value: import("../../../scene/gsplat/gsplat-material.js").SplatMaterialOptions); get materialOptions(): import("../../../scene/gsplat/gsplat-material.js").SplatMaterialOptions; /** * Gets the material used to render the gsplat. * * @type {import('../../../scene/materials/material.js').Material|undefined} */ get material(): import("../../../scene/materials/material.js").Material | undefined; /** * Sets an array of layer IDs ({@link Layer#id}) to which this gsplat should belong. Don't * push, pop, splice or modify this array. If you want to change it, set a new one instead. * * @type {number[]} */ set layers(value: number[]); /** * Gets the array of layer IDs ({@link Layer#id}) to which this gsplat belongs. * * @type {number[]} */ get layers(): number[]; /** * Sets the gsplat asset for this gsplat component. Can also be an asset id. * * @type {Asset|number} */ set asset(value: Asset | number); /** * Gets the gsplat asset id for this gsplat component. * * @type {Asset|number} */ get asset(): Asset | number; /** * Assign asset id to the component, without updating the component with the new asset. * This can be used to assign the asset id to already fully created component. * * @param {Asset|number} asset - The gsplat asset or asset id to assign. * @ignore */ assignAsset(asset: Asset | number): void; /** @private */ private destroyInstance; /** @private */ private addToLayers; removeFromLayers(): void; /** @private */ private onRemoveChild; /** @private */ private onInsertChild; onRemove(): void; onLayersChanged(oldComp: any, newComp: any): void; onLayerAdded(layer: any): void; onLayerRemoved(layer: any): void; /** * Stop rendering this component without removing its mesh instance from the scene hierarchy. */ hide(): void; /** * Enable rendering of the component if hidden using {@link GSplatComponent#hide}. */ show(): void; _onGSplatAssetAdded(): void; _onGSplatAssetLoad(): void; _onGSplatAssetUnload(): void; _onGSplatAssetRemove(): void; } import { Component } from '../component.js'; import { Asset } from '../../asset/asset.js';