(
center: THREE.Vector3,
scales: THREE.Vector3,
quaternion: THREE.Quaternion,
opacity: number,
color: THREE.Color,
)
| 521 | // Effectively calls this.setSplat(this.numSplats++, center, ...), useful on |
| 522 | // construction where you just want to iterate and create a collection of Gsplats. |
| 523 | pushSplat( |
| 524 | center: THREE.Vector3, |
| 525 | scales: THREE.Vector3, |
| 526 | quaternion: THREE.Quaternion, |
| 527 | opacity: number, |
| 528 | color: THREE.Color, |
| 529 | ) { |
| 530 | const extArrays = this.ensureSplats(this.numSplats + 1); |
| 531 | encodeExtSplat( |
| 532 | extArrays, |
| 533 | this.numSplats, |
| 534 | center.x, |
| 535 | center.y, |
| 536 | center.z, |
| 537 | scales.x, |
| 538 | scales.y, |
| 539 | scales.z, |
| 540 | quaternion.x, |
| 541 | quaternion.y, |
| 542 | quaternion.z, |
| 543 | quaternion.w, |
| 544 | opacity, |
| 545 | color.r, |
| 546 | color.g, |
| 547 | color.b, |
| 548 | ); |
| 549 | ++this.numSplats; |
| 550 | } |
| 551 | |
| 552 | // Iterate over Gsplats index 0..=(this.numSplats-1), unpack each Gsplat |
| 553 | // and invoke the callback function with the Gsplat attributes. |
no test coverage detected