(
index: number,
center: THREE.Vector3,
scales: THREE.Vector3,
quaternion: THREE.Quaternion,
opacity: number,
color: THREE.Color,
)
| 489 | // (can be the same objects returned by getSplat). Ensures there is capacity |
| 490 | // for at least index+1 Gsplats. |
| 491 | setSplat( |
| 492 | index: number, |
| 493 | center: THREE.Vector3, |
| 494 | scales: THREE.Vector3, |
| 495 | quaternion: THREE.Quaternion, |
| 496 | opacity: number, |
| 497 | color: THREE.Color, |
| 498 | ) { |
| 499 | const extArrays = this.ensureSplats(index + 1); |
| 500 | encodeExtSplat( |
| 501 | extArrays, |
| 502 | index, |
| 503 | center.x, |
| 504 | center.y, |
| 505 | center.z, |
| 506 | scales.x, |
| 507 | scales.y, |
| 508 | scales.z, |
| 509 | quaternion.x, |
| 510 | quaternion.y, |
| 511 | quaternion.z, |
| 512 | quaternion.w, |
| 513 | opacity, |
| 514 | color.r, |
| 515 | color.g, |
| 516 | color.b, |
| 517 | ); |
| 518 | this.numSplats = Math.max(this.numSplats, index + 1); |
| 519 | } |
| 520 | |
| 521 | // Effectively calls this.setSplat(this.numSplats++, center, ...), useful on |
| 522 | // construction where you just want to iterate and create a collection of Gsplats. |
no test coverage detected