SplatData.zeroed constructor

SplatData.zeroed(
  1. int count, {
  2. int shDegree = 0,
})

Allocates a zero-filled splat set for count splats, for callers that fill the arrays in place (procedural construction).

Implementation

factory SplatData.zeroed(int count, {int shDegree = 0}) {
  return SplatData(
    count: count,
    positions: Float32List(count * 3),
    scales: Float32List(count * 3),
    rotations: Float32List(count * 4),
    colors: Float32List(count * 3),
    opacities: Float32List(count),
    sh: shDegree > 0
        ? Float32List(count * shRestCoeffCount(shDegree) * 3)
        : null,
    shDegree: shDegree,
  );
}