Confused on what they mean or having trouble tuning them for your application?
The rigid body controller works by applying a spring force & torque to the rigid body that moves it to the location & orientation of the tracker (physical position & orientation). This is known as virtual coupling, a very popular approach to haptics. Additionally the -force may be rendered back to the device to feel it.
It exists for contact. If you directly render forces back to the user they are often unsmooth because of discretized integration in the rigid body model. Not always, but virtual coupling is flexible. Additionally you the issue of infinite stiffness in static objects. With virtual coupling, the force grows from 0 until it reaches equilibrium, stopping your hand. It also allows virtual & physical locations to differ such that you can push your hand past a wall, but the hand stay at the wall.
It may also be used for smoothing. For instance, directly setting the haptic position & orientation to a camera will make it jittery & very jarring. With virtual coupling there is no jitter.
Integration & Forces:
The rigid body model uses a very basic semi implicit euler integration to apply a force:
velocity += force / mass * dt;
pos += velocity * dt;
The force for the spring is computed as
Force = Spring Force (fS) + Damper Force (fD)
Force is then applied to the rigid body & -Force rendered back to your hand (only spring and damping is applied, not other external forces the body may experience).
Spring Force:
This force is computed from the difference between the virtual (rigid body) and physical (haptic) position.
This exerts a force on the body in the direction of the haptic position causing it to move to that position.
fS = (haptic position - virtual position) * KS;
Where KS scales the spring. (Larger force, tighter spring)
Damping Force
This force is computed from the velocity.
This exerts a force on the body in the opposite direction of velocity. Creates a drag & is for stability.
fD = (-currVelocity) * KD;
Where KD scales the damping.
Stability
What’s largely important here is your force size which relates to your timestep (dt), body mass & inertia, & spring parameters. If ks or dt is too high, you get a large force & you will overshoot the haptic position resulting in an even larger force next time. It will explode instead of converge. It could also not explode & just take longer to converge. This is why damping exists!