Skip to main content

GaussianSplattingAsset

Class

Asset that contains Gaussian Splats.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Asset that contains Gaussian Splats. Used with GaussianSplattingVisual.

Index

Extends

Properties

assetTransform

assetTransform: mat4

The internal transform matrix of the asset.

Since

Lens Scripting Version 357

Default Value

(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)

Example

// @input Component.GaussianSplattingVisual gsVisual
script.gsVisual.asset.assetTransform = mat4.fromScale(new vec3(-1, -1, 1)); // flip both X and Y axes

name

name: string

The name of the Asset in Lens Studio.

Default Value

""

Inherited from

Asset.name


uniqueIdentifier

readonly uniqueIdentifier: string

Since

Lens Scripting Version 176

Inherited from

Asset.uniqueIdentifier

Methods

createFromBuffers()

static createFromBuffers(positionsXYZ, scalesXYZ, rotationsWXYZ, colorsRGBA): GaussianSplattingAsset

Static factory method. that creates a new GaussianSplattingAsset using the provided data buffers:

  • PositionsXYZ: an interleaved Float32Array of 3D positions (px, py, pz for each splat),
  • ScalesXYZ: an interleaved Float32Array of 3D scales (sx, sy, sz for each splat),
  • RotationsWXYZ: an interleaved Float32Array of quaternions (qw, qx, qy, qz for each splat),
  • ColorsRGBA: an interleaved Float32Array of colors (r, g, b, a for each splat).

Parameters

ParameterType
positionsXYZFloat32Array
scalesXYZFloat32Array
rotationsWXYZFloat32Array
colorsRGBAFloat32Array

Returns

GaussianSplattingAsset

Since

Lens Scripting Version 345


getNumberOfFrames()

getNumberOfFrames(): number

The number of frames in the asset (in case of GSAF)

Returns

number

Since

Lens Scripting Version 274


getSplatColors()

getSplatColors(): Float32Array

Returns the colors of all splats as an interleaved Float32Array (r, g, b, a for each splat).

Returns

Float32Array

Since

Lens Scripting Version 340


getSplatCount()

getSplatCount(): number

The number of splats in the asset. For GSAF, it's the total number of splats across all frames.

Returns

number

Since

Lens Scripting Version 320


getSplatPositions()

getSplatPositions(): Float32Array

Returns the 3D positions of all splats as an interleaved Float32Array (x, y, z for each splat).

Returns

Float32Array

Since

Lens Scripting Version 340


getSplatRotations()

getSplatRotations(): Float32Array

Returns the rotations of all splats as an interleaved Float32Array of quaternions (w, x, y, z for each splat).

Returns

Float32Array

Since

Lens Scripting Version 340


getSplatScales()

getSplatScales(): Float32Array

Returns the 3D scale values of all splats as an interleaved Float32Array (x, y, z for each splat).

Returns

Float32Array

Since

Lens Scripting Version 340


getTypeName()

static getTypeName(): TypeName<GaussianSplattingAsset>

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<GaussianSplattingAsset>

Overrides

Asset.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

Asset.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

Asset.isOfType


isSame()

isSame(other): boolean

Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

Asset.isSame


setSplatColors()

setSplatColors(rgbaArray): void

Sets the colors of all splats from an interleaved Float32Array (r, g, b, a for each splat).

Parameters

ParameterType
rgbaArrayFloat32Array

Returns

void

Since

Lens Scripting Version 340


setSplatPositions()

setSplatPositions(vec3Array): void

Sets the 3D positions of all splats from an interleaved Float32Array (x, y, z for each splat).

Parameters

ParameterType
vec3ArrayFloat32Array

Returns

void

Since

Lens Scripting Version 340


setSplatRotations()

setSplatRotations(quatsWxyzArray): void

Sets the rotations of all splats from an interleaved Float32Array of quaternions (w, x, y, z for each splat).

Parameters

ParameterType
quatsWxyzArrayFloat32Array

Returns

void

Since

Lens Scripting Version 340


setSplatScales()

setSplatScales(vec3Array): void

Sets the 3D scale values of all splats from an interleaved Float32Array (x, y, z for each splat).

Parameters

ParameterType
vec3ArrayFloat32Array

Returns

void

Since

Lens Scripting Version 340