Meaning of softbody anchor hardness

User avatar
jarno
Posts: 57
Joined: Tue Mar 16, 2010 1:42 am

Meaning of softbody anchor hardness

Post by jarno »

I'm investigating some issues with the softbody anchor solving. I think there is a bug in the formulae used, but I have some difficulty trying to understand what the intention behind the code is.

I understand that setting anchor hardness (softbody->m_cfg.m_kAHR) to 1 means that the node is expected to stick to the anchor position. But what should setting it to 0 supposed to mean?

I can see two possible answers based on what the code sort of attempts to do:
  1. Have the node track the velocity of the anchor but let the position drift.
  2. Disable the anchor entirely.
In the first case, changing the hardness interpolates between tracking the velocity and tracking the position. That would act like having an offset between the anchor position and the node position.
The second case acts more like a soft anchor.

I suspect a soft anchor is what people mostly want, but that removes the option to track the velocity (without tracking the position), which may be important to some. And a soft anchor can be implemented by using a link with a low linear stiffness attached to a hard anchor. On the other hand that introduces extra complexity and extra parameters in setting up the scene.

Currently the code tracks the velocity when the hardness is set to 0, and it does something nonsensical and wrong involving doubling up the velocity and position tracking when set to 1.

---JvdL---