Fixed many casting issues.

This commit is contained in:
2021-08-21 12:18:01 -07:00
parent d660d732b9
commit fabb35b7cf
25 changed files with 133 additions and 212 deletions

View File

@ -5,6 +5,8 @@
#pragma once
#define MATH_PI ((float)M_PI)
/**
* Returns the modulous a result for b. Consdiders negative numbers correctly.
* @param a Number to modulo against. (a % b)
@ -48,18 +50,18 @@
* @param n Degrees to convert.
* @returns The number in radians.
*/
#define mathDeg2Rad(n) (n * M_PI / 180.0)
#define mathDeg2Rad(n) (n * MATH_PI / 180.0f)
/**
* Convert radians to degrees.
* @param n Radians to convert.
* @returns The number in degrees.
*/
#define mathRad2Deg(n) (n * 180 / M_PI)
#define mathRad2Deg(n) (n * 180.0f / MATH_PI)
/**
* Sign the given number, essentially clamps > 0 to 1, and < 0 to -1.
* @param n Number to sign.
* @returns The signed number.
*/
#define mathSign(n) (n>=0 ? 1 : -1)
#define mathSign(n) (n>=0 ? 1.0f : -1.0f)

View File

@ -19,7 +19,7 @@
* Generates a random floating point number.
* @returns A random floating point number.
*/
#define randFloat() (((float)randInt32()) * M_PI)
#define randFloat() (((float)randInt32()) * MATH_PI)
/**
* Generates a random uint32_t