Ammo.js meshimposter collision offset?

We experiencing an offset when creating a mesh imposter for the physics, ammo.js.
The 3d models we use have around 1000 polygons each and are not too complicated, mostly convex.

It seems that the collsion shape of the mesh seems to be correct but it has an offset along the normals, like it is inflated around 50% or so.
The image is just showing the meshes, NOT the offset, just you have an idea of the geometry.

Is there a ‘feature’ how ammo.js handles the collision on the mesh impostores with a precision or an offest or similar parameters?

Unfortunately we dont do playground dev. right now so I cant post a link.

Another thing might be that the meshes we created have some flaws, which would be weird but might be.
As a test I tried simplified versions of these meshes, but I might create completely new ones as well to try…


pinging @Cedric

I’ve never experienced such issue.
It will be difficult to debug without a PG repro.
Are you using mesh impostor or convex hull?

mesh imposter.
This is the distance between the meshes.

Or is it, that collision between meshes is not working correctly?

this.mesh.position = initialPos;
        this.mesh.physicsImpostor = new PhysicsImpostor(this.mesh, PhysicsImpostor.MeshImpostor, 
                mass : Coral.fixedMass,
                friction : 0,
                damping : 0.1,          
            }, scene);

Here are 2 simple spheres …

There is an offset as well…

Is there a rule, in terms of units for the physic?

is Coral.fixedMass value 0 ? ammojs mesh impostor must be static.

ups. That I missed… Is that documented?

So for these kind of shapes I need to build some sompound objects using standard collision shapes then?

… similar to that?

I can confirm a mesh impostor with a mass > 0 will create a convex hull instead. That’s why you see some inflation.
I guess the impostor you want to create are concave. So, in that case, yes, you have to create compounds.

That all makes sense now!!
Thank you so much!

We are going to build compounds now.


1 Like