I’m writing a simulator of sailing boats. I need soft objects for simulate fenders (and sails, ropes etc). But I have a problem with joining them to RigidBodyControl. I did so But he behaves very strangely! It flies around the boat, and then all is lost. If I do not call addSoft() - everything works as it should.
Well i didn’t added support for hing/joint into the soft body binding yet.
Adding joint to the binding is high in my todo list but it will also be a huge piece of work because softbody joint doesn’t work like rigidbody one (in fact the entire code of bullet soft body is far away from rigid body).
Before adding joint I’ll add anchor to the binding and I thinks this will solve your problem at least for ropes and sails. An anchor is just a soft-node (or vertex) glued to a rigid body.
Thank’s! I’ve looked at the bullet code on the about anchor. I will wait.
If you need help, tell me where to start can be.
I implemented the appendAnchor() Patch
Well I’m not an expert on that, but … is ropes not very different than soft bodies?
It’s a modified particle physics I think (so you would not even need rigid bodies or soft bodies).
But it could be simulated by several hundred joints of rigid bodies too:
Take a joint every 5 centimeters (every 2 inches) and just throw that into the scene.
Should work… (in theory) ^^
In fact soft body ropes give a better feed back (imo) as they use springs & damps, this make them more dynamic.
thanks i looked to this patch and i really appreciate your interest for soft bodies but i found one little mistake (collisionBetweenLinkedBodies in jme → disableCollisionBetweenLinkedBodies in bullet you forgot a “!” ).
Also you used 3 differents natives methods and the less is better.
I added really quickly anchors support (see github), i let you try and tell me if this doesn’t work or if you have any questions.
Thank’s! Your version is more beautiful (: This is my first experience with JNI. I tried my version - it works. My boat came fenders! But I can not understand for what reason the boat fenders “flying in the wind”. They weigh 5 kg, but the “wind blows”. They have only SoftBodyControl. They have not any others force. Any ideas?
Is there no particle physics in the Bullet engine?
Particle physics use springs and damps too and are extremely simple to calculate.
I read that in a book that describes how to implement a physics engine.
Anyways … I wish you good luck and am very curious about future results.
Hello again! I’m getting a strange problem with anchors. If the node ID is less than 64 then it works. But if it is larger - the connection of the node not occurs, but occurs info some other. Sometimes it leads to a crash.
I tested the demo from Bullet distrib (Demos/SoftDemo/SoftDemo.cpp) with big cloth patch - work fine.
What is the mesh you are using ? The node ID map a vertex so make sure your mesh have at least 64 vertex (with different position).
I built my custom mesh. I tried to create it from 32 to 1024 triangles (it’s sail) - displayed incorrectly. Vertex of one side connected to the RigidBodyControl. I changed the color of connected vertices for check.
Green zones - should be connected, connected (id < 64, red texture)
Red zones - should be connected, incorrect (id > 64, white texture)
Blue zones - should not be connected (blue texture)
I thinked make a temporary workaround. I want grouping the id anchors were going they were all less than 64
Can you give me the code you used to generated to sail ? Also you can try with only the sail (no other body) to set mass to 0 to nodes instead of adding anchors, and see if you’ve got the right nodes.
Here’s my old code. I changed it. Now the ID of anchors is less than 64. Now everything works fine!
I figured out how it all works. And now ready to take part in development. I can begin work on joins. I need them. Immediately to check (;