playcanvas
Version:
PlayCanvas WebGL game engine
53 lines (52 loc) • 2.26 kB
TypeScript
/**
* @import { Vec2 } from '../../core/math/vec2.js';
* @import { GraphicsDevice } from '../../platform/graphics/graphics-device.js'
* @import { GSplatData } from './gsplat-data.js';
* @import { GSplatCompressedData } from './gsplat-compressed-data.js';
* @import { GSplatSogsData } from './gsplat-sogs-data.js';
*/
/**
* Base class for a GSplat resource and defines common properties.
*
* @ignore
*/
export class GSplatResourceBase {
constructor(device: any, gsplatData: any);
/** @type {GraphicsDevice} */
device: GraphicsDevice;
/** @type {GSplatData | GSplatCompressedData | GSplatSogsData} */
gsplatData: GSplatData | GSplatCompressedData | GSplatSogsData;
/** @type {Float32Array} */
centers: Float32Array;
/** @type {BoundingBox} */
aabb: BoundingBox;
/** @type {Mesh} */
mesh: Mesh;
/** @type {VertexBuffer} */
instanceIndices: VertexBuffer;
destroy(): void;
get instanceSize(): number;
get numSplats(): any;
configureMaterial(material: any): void;
evalTextureSize(count: any): void;
/**
* Creates a new texture with the specified parameters.
*
* @param {string} name - The name of the texture to be created.
* @param {number} format - The pixel format of the texture.
* @param {Vec2} size - The size of the texture in a Vec2 object, containing width (x) and height (y).
* @param {Uint8Array|Uint16Array|Uint32Array} [data] - The initial data to fill the texture with.
* @returns {Texture} The created texture instance.
*/
createTexture(name: string, format: number, size: Vec2, data?: Uint8Array | Uint16Array | Uint32Array): Texture;
instantiate(): void;
}
import type { GraphicsDevice } from '../../platform/graphics/graphics-device.js';
import type { GSplatData } from './gsplat-data.js';
import type { GSplatCompressedData } from './gsplat-compressed-data.js';
import type { GSplatSogsData } from './gsplat-sogs-data.js';
import { BoundingBox } from '../../core/shape/bounding-box.js';
import { Mesh } from '../mesh.js';
import { VertexBuffer } from '../../platform/graphics/vertex-buffer.js';
import type { Vec2 } from '../../core/math/vec2.js';
import { Texture } from '../../platform/graphics/texture.js';