After a long time, here is the next step in my BGE cloth. I have two patches. One makes the cloth modifier work in the BGE (lots of thanks to Moguri for helping on that one), the other adds a new solver (Verlet) that can be selected in the simulation options. This new solver is less “accurate” but it is faster, and therefore more appropriate for real-time use.
I will updated this post with new patch versions and builds. I am looking for some feedback to polish these up.
Change Log
cloth_in_game_v4 *Removed the need for a flag in KX_Scene
*Collisions now work when the collision object moves
*Restored the cloth panel for the “Blender Game” renderer
verlet_solver_v6 *Fixed the patch so that properties_physics_cloth.py is pep8 compliant again, and should cause less conflicts now
Doesn’t the Bullet engine in the BGE already have softbody simulation that can be used for cloth simulation, does this expose a bit more of the functionality within Bullet and removes limitations when it comes to logic, or is this something completely different?
In my opinion, the bullet soft bodies are a little limited, or at least their implementation into blender are. This patch simply makes the cloth modifier available for use in the BGE. Some benefits of the cloth modifier:
*Decent pinning
*Effectors (Sort of working)
*Presets
*Possibly more documentation available
EDIT:
Found some bugs testing effectors. The verlet solver simply crashes with effectors. But the implicit solver works with effectors, and in the BGE. But I forgot to clean up after myself in the bge, so running the bge actually edits the cloth mesh, and leaves it in an edited state. This is bad
Well it is true there is almost no limits in the BGE if you know the C/C++ code and thus able to code your own needed features, providing you give it back to the community in the form of patches to be included into trunk.
Don’t ask me how to apply a patch because you need to have skill with a compiler to do this, for most of us who don’t have compiling skills we just wait for builds already compiled with the patch.
dude, sounds like a pretty cool thing.
i’d like to know how it affect the frame rate.
also like to know if any linux 32 bit build is available.
btw will it be available on the official 2.5x build, when it is stable or in 2.6?
thanks.
I haven’t tested the frame rate impact much, but a simple simulation with the verlet solver doesn’t drop below 60fps on my computer. The implicit solver however, performs much worse. I have some ideas on improving the performance of the verlet solver some more, but I don’t know when I will get around to that.
As far as a 32bit linux build, I have no plans to make one at this time. If some one makes a Linux 32 bit build and sends it to me, I can mirror it and put a link to it in the first post.
I have not talked to anyone yet about getting this patch into trunk, so I have no idea if/when that may happen.
Why haven’t i recognized this thread earlier? I am wondering if it is possible to bake the cloth somehow? I really have to play with your patch asap. Thanks a million!