Bowls
|
Functions | |
float | distanceBetweenTwoSpheres (cgg::Vec3 sphere1Pos, cgg::Vec3 sphere2Pos) |
bool | collisionCheck (Ball *sphere1, Ball *sphere2, float dt) |
bool | collisionCheck (Ball *sphere, Box *wall, float dt) |
void | newCollisionVelocities (Ball *sphere1, Ball *sphere2) |
void | newCollisionVelocities (Ball *sphere, Box *wall) |
void | applyFriction (Ball *sphere) |
float | kinectInputVelocity (float distance, float time) |
Physics functions.
A Namespace that contains functions for the physics in the game. Code by Jamie Slowgrove
void Physics::applyFriction | ( | Ball * | sphere | ) |
Applies Friction to the sphere
Takes in the sphere and adds friction to its velocities
Ball* | the sphere to be updated |
Checks if 2 spheres collide
Takes in two spheres and a delta time and uses this to detect if the spheres collide
Ball* | one of the spheres to be used in the collision |
Ball* | one of the spheres to be used in the collision |
float | the current delta time |
Checks if a sphere collides with a wall
Takes in a sphere, a wall and a delta time and uses this to detect if the two collide
Ball* | the sphere to be used in the collision |
Box* | the wall to be used in the collision |
float | the current delta time |
float Physics::distanceBetweenTwoSpheres | ( | cgg::Vec3 | sphere1Pos, |
cgg::Vec3 | sphere2Pos | ||
) |
Works out the distance between two spheres
Takes in two sphere positions and works out the distance between them
cgg::Vec3 | one of the position of the spheres to be used in the collision |
cgg::Vec3 | one of the position of the spheres to be used in the collision |
float | the current delta time |
float Physics::kinectInputVelocity | ( | float | distance, |
float | time | ||
) |
Works out the velocity from the kinect input
Takes in the change in distance and change in time from the kinect output and converts it to a velocity
float | the change in distance |
float | the change in time |
Works out the new velocities after the spheres collide
Takes in two spheres works out the new velocities of the spheres
Ball* | one of the spheres to be updated |
Ball* | one of the spheres to be updated |