Closed alkavan closed 7 years ago
Looking into this; one thing to note is that the physics engine is tuned for the units to be in meters (thus you'd be creating 100x100x100 meters boxes.
That doesn't appear to be what's causing what you've observed to happen, but wanted to point it out. I'll respond with more info as I have it.
Tracked it down. You're rotating the floor's plane geometry directly with
geometry.applyMatrix( new THREE.Matrix4().makeRotationX( -Math.PI / 2 ) );
the physijs.Plane
object expects that the geometry passed to it is an unmodified THREE.PlaneGeometry; Physijs expects a plane spanning XY and you're passing an object spanning XZ.
Switching geometry.applyMatrix
for
mesh.quaternion.setFromRotationMatrix(new THREE.Matrix4().makeRotationX( -Math.PI / 2 ));
clears up the issue for me. Let me know if you have any questions about this, and thanks for checking out the v2 branch!
Yes! so that worked nicely! thanks.
Thanks for making that branch! just in time for me. I'll try bug report and maybe help if possible.
Issue is first 3 boxes seems to be "standing" on the plane, however other boxes created in look ignore it?
Plane is created like this:
Box is created like this:
First 3 boxes and floor:
Boxes in loop: