GaussianSplattingAsset
ClassAsset that contains Gaussian Splats.
- Available on all platforms
Asset that contains Gaussian Splats. Used with GaussianSplattingVisual.
Index
Properties
Methods
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
uniqueIdentifier
readonlyuniqueIdentifier:string
Since
Lens Scripting Version 176
Inherited from
Methods
createFromBuffers()
staticcreateFromBuffers(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
| Parameter | Type |
|---|---|
positionsXYZ | Float32Array |
scalesXYZ | Float32Array |
rotationsWXYZ | Float32Array |
colorsRGBA | Float32Array |
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()
staticgetTypeName():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
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
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
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean
Inherited from
setSplatColors()
setSplatColors(
rgbaArray):void
Sets the colors of all splats from an interleaved Float32Array (r, g, b, a for each splat).
Parameters
| Parameter | Type |
|---|---|
rgbaArray | Float32Array |
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
| Parameter | Type |
|---|---|
vec3Array | Float32Array |
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
| Parameter | Type |
|---|---|
quatsWxyzArray | Float32Array |
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
| Parameter | Type |
|---|---|
vec3Array | Float32Array |
Returns
void
Since
Lens Scripting Version 340