Open lazd opened 11 years ago
The same happens for Physijs.ConvexMesh, by the way.
physijs is not accounting for scaling concave mesh.
Scaling needs to be refactored to apply the object's scaling entirely in the worker, passing the object's scale and letting createShape
apply them as needed.
How can we use createShape() function of physijs_worker just before add scene?
mesh = new Physijs.ConvexMesh(geometry,ground_material,0);
mesh.scale.set(40,40,40); //work but collisions are not update
mesh = createShape(mesh._physijs); //don't work
or
var _worker = new Worker( Physijs.scripts.worker || 'physijs_worker.js' );
mesh = _worker.createShape(mesh._physijs); // don't work too
scene.add( mesh);
Because I use blender export model (three.js), and I have this problem to scale my model. Physijs don't use the "scale" attribut of my js file (model.js).
As a work around you could apply the scale directly to the geometry itself. Something like
geometry.vertices.forEach(function( v ){ v.multiplyScalar( the_scale ) });
Has there been any traction on this issue? Applying the scale directly to the geometry causes weird errors with the entire scene and modifying the original model isn't a great solution for me.
It's worth mentioning that I have the same problem with Physijs.SphereMesh. I'm not sure if that's related or another issue entirely.
It doesn't seem scaling works for Physijs.ConcaveMesh:
The mesh appears and can be collided with, but it is considered to be it's default size by the physics engine. I had a look at 1afa96be42ba2b879a9dbb92984e6296f8bb9f91, then added a breakpoint at line 784, and the ConcaveMesh doesn't seem to have
object._physijs.width
and friends. Setting those variables manually to 1 doesn't help either.Related to #20