Implements common/useful functions. More...
#include <assert.h>
#include <ctime>
#include <SDL_opengl.h>
#include "Math/MathCommon.h"
#include "Common/Globals.h"
Functions | |
float | ClosestPoints (const Line &l1, const Line &l2, Point2f &out1, Point2f &out2) |
Computes the closest points between the two given lines. | |
int | Intersect (const Ray &r, const Circle &c, float &t1, float &t2) |
Intersects a Ray with a Circle and finds the enter and exit time. | |
int | Intersect (const Line &l, const Circle &c, float &t1, float &t2) |
Intersects a Line with a Circle and finds the enter and exit time. | |
Point2f | ScreenToNormCoords (const Point2f &p) |
Converts a point in absolute Screen coordinates to normalized device coordinates. | |
Point2f | NormToScreenCoords (const Point2f &p) |
Converts a point in normalized device coordinates to absolute Screen coordinates. | |
uint | TimeSeed () |
Computes a pretty good seed for a random number generator using the system time. |
Implements common/useful functions.
Computes the closest points between the two given lines.
[in] | l1 | the first line. |
[in] | l2 | the second line. |
[out] | out1 | the closest point on the first line. |
[out] | out2 | the closest point on the second line. |
pg 149
int Intersect | ( | const Line & | l, | |
const Circle & | c, | |||
float & | t1, | |||
float & | t2 | |||
) |
Intersects a Line with a Circle and finds the enter and exit time.
[in] | l | the Line. |
[in] | c | the circle. |
[out] | t1 | the time the Line l enters the Circle c. |
[out] | t2 | the time the Line l exits the Circle c. |
int Intersect | ( | const Ray & | r, | |
const Circle & | c, | |||
float & | t1, | |||
float & | t2 | |||
) |
Intersects a Ray with a Circle and finds the enter and exit time.
[in] | r | the Ray. |
[in] | c | the circle. |
[out] | t1 | the time the Ray r enters the Circle c. |
[out] | t2 | the time the Ray r exits the Circle c. |
pg 178
Converts a point in normalized device coordinates to absolute Screen coordinates.
[in] | p | the point to convert. |
Converts a point in absolute Screen coordinates to normalized device coordinates.
[in] | p | the point to convert. |
uint TimeSeed | ( | ) |
Computes a pretty good seed for a random number generator using the system time.