Ball and Spring Toy
Chapter 4 of Ian Parberry's "Introduction to Game Physics with Box2D"
 All Classes Files Functions Variables Enumerations Pages
Public Member Functions | Friends | List of all members
CSpring Class Reference

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
 

Detailed Description

The spring.

Member Function Documentation

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.