Ball and Spring Toy
Chapter 4 of Ian Parberry's "Introduction to Game Physics with Box2D"
|
The spring. More...
#include <Springs.h>
Public Member Functions | |
CSpring () | |
Constructor. | |
void | Relax () |
Gauss-Seidel relaxation. | |
void | ComputeCenter () |
Compute spring center. | |
Friends | |
class | CAbstractList< CSpring > |
class | CSpringManager |
class | CBody |
The spring.
void CSpring::ComputeCenter | ( | ) |
Compute spring center.
The particles at the ends of the spring are moved and relaxed like any sensible object should be. The center of the spring just gets dragged around. This is where it catches up.
void CSpring::Relax | ( | ) |
Gauss-Seidel relaxation.
Perform a single iteration of Gauss-Seidel relaxation to the spring.