Update box validation and collision world logic

This commit is contained in:
2026-04-05 02:35:30 +02:00
parent 82664df74d
commit 8c46b8991a
2 changed files with 7 additions and 7 deletions

View File

@@ -56,12 +56,7 @@ function attachBrushCollider(world, collider) {
const body = world.createRigidBody(RAPIER.RigidBodyDesc.fixed()
.setTranslation(collider.center.x, collider.center.y, collider.center.z)
.setRotation(createRapierQuaternion(collider.rotationDegrees)));
const halfExtents = {
x: collider.size.x * 0.5,
y: collider.size.y * 0.5,
z: collider.size.z * 0.5
};
world.createCollider(RAPIER.ColliderDesc.cuboid(halfExtents.x, halfExtents.y, halfExtents.z), body);
world.createCollider(RAPIER.ColliderDesc.trimesh(collider.vertices, collider.indices), body);
}
function attachSimpleModelCollider(world, collider) {
const body = createFixedBodyForModelCollider(world, collider);