MCPcopy Create free account
hub / github.com/sparkjsdev/spark / forEachSplat

Method forEachSplat

src/ExtSplats.ts:554–578  ·  view source on GitHub ↗
(
    callback: (
      index: number,
      center: THREE.Vector3,
      scales: THREE.Vector3,
      quaternion: THREE.Quaternion,
      opacity: number,
      color: THREE.Color,
    ) => void,
  )

Source from the content-addressed store, hash-verified

552 // Iterate over Gsplats index 0..=(this.numSplats-1), unpack each Gsplat
553 // and invoke the callback function with the Gsplat attributes.
554 forEachSplat(
555 callback: (
556 index: number,
557 center: THREE.Vector3,
558 scales: THREE.Vector3,
559 quaternion: THREE.Quaternion,
560 opacity: number,
561 color: THREE.Color,
562 ) => void,
563 ) {
564 if (!this.numSplats) {
565 return;
566 }
567 for (let i = 0; i < this.numSplats; ++i) {
568 const unpacked = decodeExtSplat(this.extArrays, i);
569 callback(
570 i,
571 unpacked.center,
572 unpacked.scales,
573 unpacked.quaternion,
574 unpacked.opacity,
575 unpacked.color,
576 );
577 }
578 }
579
580 // Check if source texture needs to be created/updated
581 private updateTextures() {

Callers

nothing calls this directly

Calls 1

decodeExtSplatFunction · 0.90

Tested by

no test coverage detected