#include <pointMass.hpp>
Public Methods | |
pointMass () | |
pointMass (float DRAG) | |
~pointMass () | |
void | update (float seconds=1.0f) |
Update location based on forces and current velocity. | |
void | collisionTest (void) |
Static Public Methods | |
float | planeTest (vector3f &location, vector3f &newLocation, vector3f &triangleVertex, vector3f &surfaceNorm) |
See if a line intersects a plane determine by a normal and a point. | |
float | triangleTest (vector3f &intersection, vector3f &tri1, vector3f &tri2, vector3f &tri3) |
See if a point on a plane lies within a triangle on that plane. | |
Public Attributes | |
float | mass |
vector3f | force |
Summed up force vectors. | |
vector3f | location |
The particle's current position. | |
vector3f | velocity |
The particle's current velocity. | |
vector3f | newLocation |
The particle's position in the next time step. | |
std::list< void * > | springs |
Void pointers (to avoid circular includes) to attached springs. | |
float | DRAG |
The springs are updated first based on the masses location, and then the masses are updated with the locations set by the springs forces in the last time step. The forces on the spring then are used to compute the newLocations.
It's possible the springs should take account of the newLocations rather than the current (which will just be updated to the contents of newLocation in the same timestep). This may fix some stability problems at the cost of less springlike behaviour (due to more instantaneous spring action).