SplatData constructor
SplatData({
- required int count,
- required Float32List positions,
- required Float32List scales,
- required Float32List rotations,
- required Float32List colors,
- required Float32List opacities,
- Float32List? sh,
- int shDegree = 0,
Wraps existing arrays without copying. Every array's length must match
count times its per-splat stride.
Implementation
SplatData({
required this.count,
required this.positions,
required this.scales,
required this.rotations,
required this.colors,
required this.opacities,
this.sh,
this.shDegree = 0,
}) : assert(positions.length == count * 3),
assert(scales.length == count * 3),
assert(rotations.length == count * 4),
assert(colors.length == count * 3),
assert(opacities.length == count),
assert(shDegree >= 0 && shDegree <= 2),
assert(
(shDegree == 0) == (sh == null),
'sh must be provided exactly when shDegree > 0',
),
assert(
sh == null || sh.length == count * shRestCoeffCount(shDegree) * 3,
);