Physijs Load model three.js collisions don't work

1.4k views Asked by At

When I load my model(map) with JSONLoader I have a problem with collisions. If I load with BoxMesh it's work but the geometry collisions is like a cube, and my model is not a cube, the middle of my model is empty. And I put an other object (cube) on the top of my map the object stop on the top of this map not inside.

After search, I have load my model with Convex, and the object ont the top , fall on the plane of my map but I think the size (40) is not load correctly because if I move the object very little he fall in the space.

I load my model like this:

 var loader = new THREE.JSONLoader();
 loader.load( "essai/lobby3.js", function( lobby_geometry, lobby_materials ) {
 console.log(lobby_geometry);
 var ground_material = Physijs.createMaterial(
            new THREE.MeshFaceMaterial(lobby_materials),
            .8, // high friction
            0 // low restitution
        );

    mesh = new Physijs.Mesh ( //I try with BoxMesh / Convex / Concav
                    lobby_geometry,
                    ground_material,
                    0
                );
       mesh.scale.set(40,40,40);
       scene.add(mesh);    
});

I don't know if it's very easy to understand the problem.

BoxMesh: Here the object is stop. sans titre3

Convex: Don't detect collisions sans titre

I upload my tests, I think maybe is better to undestand : http://www.hebergeurfichier.com/download/a97e3ae31c36dfe98525213cde90165f.html

PS: I create my models with blender and export in three.js extension.

0

There are 0 answers