3D Math routines
More...
|
#define | M_PI (3.14159265358979323846) |
|
#define | M_PI_2 (1.57079632679489661923) |
|
3D Math routines
All of the 3D Math goes here.
- See Also
- http://www.amuletsandarmor.com/AALicense.txt
#define M_PI (3.14159265358979323846) |
I want my own constants for pi and pi/2.
#define M_PI_2 (1.57079632679489661923) |
MathArcTangent takes the given x and y deltas and determines the atan (using this system's theta values).
- Parameters
-
y | – Numerator of tangent fraction |
x | – Denomator of tangent fraction |
- Returns
- Angle result
MathArcTangent32 is a 32 bit version of MathArcTangent
- Parameters
-
y | – Numerator of tangent fraction |
x | – Denomator of tangent fraction |
- Returns
- Angle result
Calculates 32768 * cos(angle) and returns in integer format.
NOTE: This routine is only called during the trig initialization process.
- Parameters
-
angle | – Degrees of angle to report sine of |
MathFinish is called when the lookup tables are no longer needed. They are all unloaded.
MathInitialize creates all the lookup tables used by the math routines. Some of the tables (well, one) needs the width of the screen as well. Pass this in to the routine. This routine MUST be called before all other routines are used.
- Parameters
-
screenWidth | – Width of view screen. |
MathInitializeInvDistTable calculates the inverse distance table based on the given width of the screen. All perspective calculations are based on this table instead of using division during the rendering process. Call this routine at any time the width of the view is changed.
- Parameters
-
screenWidth | – Width of the screen |
Calculates 1/(65536 * cos(angle)) and returns in integer format.
NOTE: This routine is only called during the trig initialization process.
- Parameters
-
angle | – Degrees of angle to report sine of |
- Returns
- 1/(65536 * cos(angle))
Calculates 32768 * sin(angle) and returns in integer format.
NOTE: This routine is only called during the trig initialization process.
- Parameters
-
angle | – Degrees of angle to report sine of |
Calculates 32768 * tan(angle) and returns in integer format.
NOTE: This routine is only called during the trig initialization process.
- Parameters
-
angle | – Degrees of angle to report sine of |
Computes x * cos(angle)
- Parameters
-
x | – Multiplier |
angle | – Angle |
- Returns
- x * cos(angle)
Computes x * sin(angle)
- Parameters
-
x | – Multiplier |
angle | – Angle |
- Returns
- x * sin(angle)
T_byte8 G_translucentTable[256][256] |