Physics-Simulator
v1.4.0-beta.2
|
Functions | |
void | addNew (LOC, LOC, double) |
void | clean_up (void) |
void | checkCollisons (uint) |
bool | checkOverlap (BOX, BOX) |
void | doCollide (uint, uint) |
Variables | |
uint | intCannonBallNum = 0 |
uint | intRopeNum = 0 |
VectorCannon | balls |
VectorRope | ropes |
Will add a new cannonball based on the mouse start and mouse end. Mass of the ball will vary based on Hold Time
mouseC | = Current Mouse Location in X and Y |
mouseO | = Old (start of mouse click) Mouse Location in X and Y |
HoldTime | = Time (in seconds) that the mouse button was held down for |
void cannonballs::checkCollisons | ( | uint | j | ) |
Checks ball number j is colliding with another ball and then do collisions.
j | = the number in the array that ball we are checking is. |
Checks if two boxes overlap
A | = Box for ball A |
B | = Box for ball B |
void cannonballs::clean_up | ( | void | ) |
Removes any "dead" balls/rope from the balls/rope vector and shrinks it to reduce memory usage
Will calculate the new velocities of two balls that are colliding
numA | = the number in the array ball A is |
numB | = the number in the array ball B is |
VectorCannon cannonballs::balls |
uint cannonballs::intCannonBallNum = 0 |
uint cannonballs::intRopeNum = 0 |
VectorRope cannonballs::ropes |