Defines | |
#define | BOUNDS(num, min, max) ((num) < (min) ? (min) : ((num) > (max) ? (max) : (num))) |
#define | math_sin(deg) ((deg) >= 0 ? _sin_table[deg] : -_sin_table[-(deg)]) |
#define | math_cos(deg) ((deg) >= 0 ? _cos_table[deg] : _cos_table[-(deg)]) |
Functions | |
fixed | math_atan2 (fixed y, fixed x) |
void | math_fastdiv (s32 n, s32 d, s32 *result, s32 *remainder) |
void | math_rand_set_seed (u32 seed) |
u32 | math_rand_get_seed () |
u16 | math_rand (u16 max) |
|
Returns num if it is in between min and max, otherwise num is clipped to min or max |
|
|
|
|
|
|
|
eg. math_fastdiv(129, 10, &result, &remainder); |
|
A good way to set this is to run a timer and then use the value of the timer when the user presses a button. This only needs to be set once. |
|
This value will change each time you call math_rand(). |
|
Eg. math_rand(255) will return a random number from 0 to 255. math_rand_set_seed() should be called before using this. |