Update version references and refactor collider generation logic

This commit is contained in:
2026-04-04 07:57:32 +02:00
parent 6b1b6a3437
commit b85b295c5a
6 changed files with 136 additions and 13 deletions

View File

@@ -6,7 +6,6 @@ import {
Mesh,
Quaternion,
Vector3,
type BufferAttribute,
type BufferGeometry
} from "three";
@@ -206,7 +205,13 @@ function computeWorldBoundsFromLocalBox(localBounds: GeneratedColliderBounds, mo
return computeBoundsFromPoints(corners.map((corner) => corner.applyMatrix4(modelMatrix)));
}
function readIndexedVertex(position: BufferAttribute, index: number, matrix: Matrix4): Vector3 {
interface PositionLikeAttribute {
getX(index: number): number;
getY(index: number): number;
getZ(index: number): number;
}
function readIndexedVertex(position: PositionLikeAttribute, index: number, matrix: Matrix4): Vector3 {
return new Vector3(position.getX(index), position.getY(index), position.getZ(index)).applyMatrix4(matrix);
}