chandlerprall / Physijs

Physics plugin for Three.js
MIT License
2.77k stars 455 forks source link

ConcaveMesh() has "holes" when used on imported meshes (JSON, STL, from Blender) #271

Open riccardolardi opened 8 years ago

riccardolardi commented 8 years ago

As you can see in this screenshot: http://i.imgur.com/oET82vM.png - I am trying to get this red cubes to collide correctly on this polygonal terrain which I've imported using STLloader.js - this is how I make the terrain in code:

    var stlLoader = new THREE.STLLoader();

    stlLoader.load('elements/landscape.stl', function(geometry) {

        var material = Physijs.createMaterial(new THREE.MeshPhongMaterial({
            shading: THREE.FlatShading
        }), 0.4, 0.6);

        // meshes fall through the floor, as if there were holes...
        var floor = new Physijs.ConcaveMesh(geometry, material, 0);
        module.scene.add(floor);

    });

Using BoxMesh works but then the colliding box is obviously just a cubic box and not the desired mesh shape... is there any clue on this?

riccardolardi commented 8 years ago

Same goes for imported mesh as JSON (exported from Blender) ... seems the issue is with ConcaveMesh() in physi.js when handling imported meshes

ghost commented 8 years ago

Any news about this? Did you solved it? I'm having the same problem.

riccardolardi commented 8 years ago

No, sadly couldn't find any solution yet