Math Class Reference
#include <Math.h>
Description
Utility providing some additional math operations.
Static Functions | |
static float | Step (float &f, float dest, float stepSize) |
static float | GetHypotenuse (float a, float b) |
static float | Pi () |
static bool | IsVectorWithinBounds (const Dynacoe::Vector &src, const Dynacoe::Vector &boundPos, float boundW, float boundH) |
static bool | IsVectorWithinRange (const Dynacoe::Vector &p1, const Dynacoe::Vector &p2, float range) |
Clamp functions | |
Clamping bounds the first argument, i, to be within min and max. If i is less than min, it is set to min. If it is greater than max, i is set to max. | |
static void | Clamp (double &i, double min, double max) |
static void | Clamp (int &, int min, int max) |
static void | Clamp (float &i, float min, float max) |
Snapping functions | |
Snapping binds a value, i, to the nearest multiple of a value, subdiv. | |
static void | SnapToNearest (int &i, int subdiv) |
static void | SnapToNearest (float &i, float subdiv) |
static void | SnapToNearest (double &i, double subdiv) |
Radian <-> degree conversion. | |
static float | RadsToDegrees (float rads) |
static float | DegreesToRads (float degrees) |
Member Function Documentation
|
static |
Makes a value approach another.
- Parameters
-
f The value to modify. dest The value to approach. stepSize The rate at which to approach dest.
|
static |
Returns sqrt((pow(a, 2) + pow(b, 2)).
|
static |
Returns a standard pi value.
|
static |
Returns whether or not a point is within a rectangle bounding box. The edge of the bounding box is considered within bounds.
- Parameters
-
src The point to test. boundPos The topleft corner of the box. boundW The width of the bounding box. boundH The height of the bounding box.
|
static |
Checks to see if a point is within a certain distance.
The documentation for this class was generated from the following file:
- /home/jc/git/Dynacoe/DynacoeSrc/includes/Dynacoe/Util/Math.h