How to add physical collision to imported model characters

I have enabled the havok physics engine.
I imported a scene model and then imported a character. How do I add physical collision to this character.

const root: AbstractMesh = meshes[0]

root.getChildMeshes().map(mesh => {
    new PhysicsAggregate(mesh, PhysicsShapeType.MESH, {mass: 100})
})

I add it like this and the character will fly into the sky

Making a ragdoll needs a little bit more work.
There must be a shape per bone that bounds the entirety of the mesh and then, between dynamic bodies, there must be joints.

Check this PG:

1 Like

Recently I found very good Havok Character Controller, demo here - Ergoudan
Source code is here - GitHub - armomu/ergoudan: Havok physics character controller demo using Babylon.js 6

7 Likes

I see that PhysicsImpostor is still used in the code. Are the current documents written in PhysicsAggregate-related writing methods?

Physics impostor is still in the code because some users still use V1 physics for now and need updated Babylon.js