How to create Cloth Simulation?

Hello, clothes models does it work on playcanvas? If yes, does anyone ever used that in a game? Tnx

Could you be a bit more specific about your question. Are you asking if you can import models with clothes - then sure, why not.
Or you are asking about cloth physics simulation? Then there is no implementation for such on engine level, but there are some solutions around and you always can some minimalistic your own one. And ammo.js does have soft bodies and stuff like that internally, you could go and ā€œhack outā€ some cloth simulation using ammo.js.

1 Like

Yes i guess my question was not well specified but itā€™s coz iā€™m not sure myself how to pose it, i mean that 3d programs has clothes support that allow you to use cloth models that take the shape of the character, and i guess i have to study the ammo.js coz i donā€™t know what it does :stuck_out_tongue: My question was because i wondered if i could use the same model for an armor that can be used for both male and female.character.

Cloth Simulation - is the term you are looking for.
There is loads of docs around the web, including ammo.js examples of implementations.

Thanks a lot Max i will look for that :smile:

1 Like

When instructing PlayCanvas to use Physics Simulation in a Scene, that causes it to include ammo.js in the build, correct? If true, does that include the latest version, which appears to include a few different soft-body dynamics features, including cloth sim?

It doesnā€™t bring in the latest, it uses PlayCanvas forked version.

Thereā€™s a danger of adding too much to ammo.js and bloating the size as itā€™s pretty big already.

It could be worth integrating one of the other Java script written physics libraries instead as I thi I some of them support soft bodies.

I tried doing cloth simulation with ammo.js But there are examples on only 2d plane simuated into cloth. I had imported a 3d model using three.js and I need to use it as cloth model how can I acheive that . I tried using createSoftVolume but they donā€™t really appear like cloth they appear to be like push balloons can you help me acheive cloth simulation with loaded objsā€¦
Thanks

This may be related: Using Ammo To Create Soft Body Entities

Even more related :wink: How to Implement Cloth Simulation with PlayCanvas