BABYLON.PhysicsImpostor.NoImpostor with actual geometry... good or bad?

Yo @Deltakosh, @sebavan and @bghgary

In the docs its to create an empty mesh as the physics root and add the MESH and COLLIDER as a child of the empty physics root. But i have tried to use and actual mesh with geometry as NO IMPOSTER then i added a sphere collider as a child with a sphere collider and it works perfectly.

My question is that good or bad ???

Is there any performace impact of the NO IMPOSTER object to actually have geometry since the CHILD sphere with a sphere collider is doing all the collision NOT the NO IMPOSTER mesh that has geometry … OR AM I TOTALLY OFF and NO IMPOSTERS with actual geometry is BAD ???

What say you :slight_smile:

This is not good:)
Either you add meshes with no parent (like I mentioned in your other post) or everyone in the hierarchy must have an impostor (and you need to start by the children to finish with the parent so then the system will build a compound)

Yo @Deltakosh … I see about the physics imposter create order making sure the no imposter is last to create the compound chain.

I guess what i am asking is what is the performance impact of using the NoPoster compound chain for physics if i ONLY have 1 collider inside the physics root… say a single box mesh setup as box imposter.

This is ok from a perf standpoint because there will be only on compound at the end

Yo @Deltakosh

What if the root physics node that has the NO IMPOSTER physics impostor happens to have a little bit of geometry on it. Are there any performance issues with that. I would think not since it has is a no imposter, none of it’s geometry should impact physics calculations . Only meshes that have other physics imposters should effect performance… is that about right

Yo @trevordev or @Deltakosh what is the calculation to set center of mass using compound colliders … I think it says the start position of the root physics object and the stating position of the child collision meshes are used to set center of mass to root object… you have to set these before you add the child collision meshes to root physics object … then you create the posters. In the example you set physicsRoot.poisition.y = -0.9

How the heck did you come up with number as start position

What are the calculations I need to prop set up center of mass. I am trying create the stuff for the exporter I need to know to calculate the center of mass starting positions… I can’t just use some arbitrary value

By the way … if I use 0 as child mesh stat position everything is fine … but when I offset those child colliders with anything other than zero the center point for the compound is way offf

Can you please explain how I need to calculate the proper root physics start position shen the child collision meshes are none zero :worried:

That is correct. The noImpostor will have no impact

I leave the second question to @trevordev :slight_smile:

Is this the same as Compound Physics Setup ?

You can put the center of mass anywhere using the parent no impostor as described there. You could do a weighted avg of all the child meshes positions to place it but that may not be what you prefer.

Yo @trevordev … I got a situation where i need a MeshImposter in the compound collision setup.

I can set it up, but apparently when using NoImposter as a physics root, it ignores child MeshImpostors… Why is that. I really need a child MeshImportor especially when i only have 1 collider. BUT that collider is a CHILD of the physics root… Thats why i jumped on the NoImpostor band wagon because you can define your collision volume as a child of a ROOT object and move that ROOT object around using that ROOT object physics impostor. But the CHILD object defined the collision volume. The compounding of mutiple child objects just made things even better when setting up a complex compound collision volume from simple primitives. But MOST of time in unity to babylon export you will only have a single child collision volume and that single collision volume MIGHT be a MeshImposter. But it still need to handle all its physics as a CHILD of the PHYSICS ROOT that is ALWAYS A NO IMPOSTER.

Please Help :slight_smile:

Yo @trevordev … Please let me know if MeshImpostors NOT SUPPORTED as compound collision chain BY DESIGN. If so, i can make MeshImposters the actual parent node using standard non compound physics and other volume coverage type impostors as the child nodes like described above. Just let me know what the deal with Mesh Impostors and Compound Collision Setups.

UPDATE: Got going WITHOUT Mesh Impostors in Compound Chain. But it would nice to know the reason they are not supported… Is just a performance thing… All compound should ONLY be Simple primitives or what ???

Thanks again dude, for all your help thus far :slight_smile:

I would expect this to work but finding in depth ammo docs can be a bit tricky. Based on the answer here: physics - Build a convex hull from a given mesh in Bullet - Game Development Stack Exchange. It sounds like having a compound shape containing a convex shape should work.

Do you have a playground you are trying to get this to work in, I could take a look.