How to simulate a elastic stick?

How can I simulate the collision between a elastic stick and a soft body?

After collision, the stick would turn to be arc.

Is there any demo?

Thanks for any suggestion~~~

I think looking through these examples you will have an idea.
https://www.panda3d.org/download/noversion/bullet-samples.zip

Thanks for kindly reply. The 21_SoftbodyRope is similar to a elastic stick. But, how can I set the stiffness coefficient for the rope?

In fact, I would have done it differently. Created several segments from solids, such as capsules, and would connect them with a spherical constraint. Accordingly, I would further adjust the rotation restriction and stiffness. Visualization can be done through the bones of the skeleton by attaching a capsule to each bone.

https://docs.panda3d.org/1.9/cpp/programming/physics/bullet/constraints

1 Like

How to apply the rotation restriction and stiffness? Could you please provide more details? I could not find the relative api.

These are not function names, but actions that I would do with the help of this class for example.

https://docs.panda3d.org/1.10/python/reference/panda3d.bullet.BulletConeTwistConstraint

The BulletConeTwistConstraint.setLimit may help. But the BulletSphericalConstraint do not provide any method for stiffness.

In addition, the class document is a bit simple. For example:

setLimit(swing1: float , swing2: float , twist: float , softness: float , bias: float , relaxation: float )

There is no explanation for swing1/swing2/twise/softness/bias/relaxation. For example, what is the unit, and what is the range of the value.

Does the softness indicates the stiffness?

It’s the same thing, BulletConeTwistConstraint has an additional set of constraints. If I’m not mistaken, the examples show how the constraint is configured.