Ball and Springs
This project showcases the use of collision response among nodes and using the penalty method for collision response. Simulated springs between bodies, which push each other apart through force and acceleration. This method is used for soft body and cloth simulation.
- Collision Response - Penalty Methods.
- Spring - Soft body.
Cloth - Structure :
The cloth is a 2D array structure, and acts of type Physics Node which already encapsulates the physical attributes (such as mass, force and collision detection and radius). Each individual node is connected to the nearby node and its tries to pull the connected node with a certain amount of force – hence ultimately the forces cancel out and all the connected nodes come to rest. Force is calculated by directional vector multiplied by the resting length.
F = KS * directional_Normal * Vector3(distance_apart);
Where KS = Elasticity by Hook's law.
directional_Normal = p1 - p2
distance_apart = Minimum distance between node when at rest.