Creating physics for an object (gltf)

I faced the problem of creating the physics of objects, I realized that in order to determine collisions, it is necessary to create the physics of the object itself, in most of the examples that I looked at, special libraries were highlighted, oimo.js and cannon.js, it was told about the simplest shapes - spheres and boxes … But not a word about complex objects such as gltf, I tried instead of the words sphere and box - in the setPhysicsState ((BABYLON.PhysicsEngine. … Imposter, {mass: 4}) method, substitute the word Mesh, but nothing worked, besides I don’t understand how to apply physics to the imported object in functions -
BABYLON.SceneLoader.ImportMesh ("", “./”, “rinoseronte.gltf”, scene, function (Meshes, particleSystems, skeletons) {
Meshes [0] .position.x = 0
Meshes [0] .position.z = 25
Meshes [0] .position.y = 5
Meshes [0] .setPhysicsState (BABYLON.PhysicsEngine.MeshImposter, {mass: 4})
// Meshes [0] .checkCollisions = true
Meshes [0] .rotation = new BABYLON.Vector3 (0, -Math.PI / 2, 0)
for (var i = 1; i <Meshes.length; i ++) {
if (Meshes [i] .animations.length! = 0) {
scene.beginAnimation (Meshes [i], 0, 0, true, 1.0)
}
}
Help me. you are welcome
thanks

Adding @RaananW

should I add it to the topic?

First of all, do you need to check only collisions ot you need more complex physics?

Hi. You can use complex meshes with Ammo.js. Look at this playground from line 689.
https://www.babylonjs-playground.com/#5MJ1X9#13
And read docs, my russian friend))

But be aware, you need simplified version of your mesh because meshImpostor has poor performance. For skeleton I think you need something like capsule as parent of your mesh.

well, it would not be bad, probably first to study physics and, starting from know physics, already go on to collisions)

Hi, I read this article, well, as I read it, I rather skimmed over it with my eyes, it seemed to me that very little has been said about Ammo, not in detail … Or, as I understand it, it is better to look for information not here, but on the official website of Ammo? Hmmm, if you advise Ammo, then I can be sure that she will reveal to me all about the physics of objects in Babylon? I understood you correctly?)
And I read the dock a lot, I just ran into an incomprehensible moment, on which there is very little information, and if they write about the physics of objects, then on the forums, to which I have almost no access, so I turned here)

By the way, I beg your pardon for spreading. Do you already have experience with collision physics, etc.? Can I show you some parts of the code where you use Ammo? To at least understand the structure of how and when to use this Ammo. I’ll be very thankful)

Best way to get help with engine - create playground on https://playground.babylonjs.com/
And you can write me private message with you contacts and we will be able to communicate in Russian. rather funny when two Russian speakers communicate in English

seems to me like you are in very good hands :slight_smile:
if anything is not answered, let us know!