// Returns rotational matrix for vector rotations about the z-axis
// Precompute this matrix in pairs, passing it the angle of revolutions X and 360-X to achieve left-right rotation matrices
// Store into a matrix variable for use later
CMatrix3 computeRotationalMatrix(float angle);
// precomputes trig tables at start of program
void computeTrigTables();
// computes sin
// can pass any number in, automatically mods by 360 and rounds off to nearest half degree
float sinC(float x);
// computes cos
// can pass any number in, automatically mods by 360 and rounds off to nearest half degree
float cosC(float x);
// computes tan
// can pass any number in, automatically mods by 360 and rounds off to nearest half degree
float tanC(float x);
// Determines sphere-sphere collision
bool SphereSphereCollision(CSphere3 sphere1, CSphere3 sphere2);
// finds basic polygonal center
// very simplistic, can only be used for shapes with regular vertices
// complex shape centers must be found by hand and passed into the constructor
CVector3 findPolygonCenter(CVector3 polygon[], int arrayLength);
// This returns a perpendicular vector from 2 given vectors by taking the cross product.
CVector3 Cross(CVector3 vVector1, CVector3 vVector2);
// This returns the magnitude of a normal (or any other vector)
float Magnitude(CVector3 vNormal);
// This returns a normalize vector (A vector exactly of length 1)
CVector3 Normalize(CVector3 vNormal);
// This returns the normal of a polygon (The direction the polygon is facing)
CVector3 Normal(CVector3 vPolygon[]);
// This returns the distance between 2 3D points
float Distance(CVector3 vPoint1, CVector3 vPoint2);
// This returns the point on the line segment vA_vB that is closest to point vPoint
CVector3 ClosestPointOnLine(CVector3 vA, CVector3 vB, CVector3 vPoint);
// This returns the distance the plane is from the origin (0, 0, 0)
// It takes the normal to the plane, along with ANY point that lies on the plane (any corner)
float PlaneDistance(CVector3 Normal, CVector3 Point);
// This takes a triangle (plane) and line and returns true if they intersected
// For optimal use call first when testing for collisions between line and plane
// If there is an intersection then call IntersectionPoint and InsidePolygon
bool IntersectedPlane(CPolygon polygon, CVector3 vLine[], float &originDistance);
// This returns the dot product between 2 vectors
float Dot(CVector3 vVector1, CVector3 vVector2);
// This returns the angle between 2 vectors
float AngleBetweenVectors(CVector3 Vector1, CVector3 Vector2);
// This returns an intersection point of a polygon and a line (assuming intersects the plane)
CVector3 IntersectionPoint(CVector3 vNormal, CVector3 vLine[], float distance);
// This returns true if the intersection point is inside of the polygon
bool InsidePolygon(CVector3 vIntersection, CVector3 Poly[], long verticeCount);
// Use this function to test collision between a line and polygon
bool IntersectedPolygon(CPolygon polygon, CVector3 vLine[], int verticeCount);
// This returns the absolute value of num - a simple if/else check
float absolute(float num);
// This function classifies a sphere according to a plane. The information returned
// tells us if the sphere is BEHIND, in FRONT, or INTERSECTS the plane. This takes
// the sphere's center, the plane's normal, a point on the plane, the sphere's radius
// and a referenced variable to hold the distance. This way we can return the distance
// and the sphere's relationship to the plane. The distance is from the plane to the center
// of the sphere. With this information it enables us to offset the sphere if needed.
int ClassifySphere(CVector3 vCenter, CVector3 vNormal, CVector3 vPoint, float radius, float &distance);
// This takes in the sphere center, radius, polygon vertices and vertex count.
// This function is only called if the intersection point failed. The sphere
// could still possibly be intersecting the polygon, but on it's edges.
bool EdgeSphereCollision(CVector3 vCenter, CVector3 vPolygon[], int vertexCount, float radius);
// This returns true if the sphere is intersecting with the polygon.
bool SpherePolygonCollision(CPolygon polygon, CSphere3 sphere);