Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
Go to the source code of this file.
Classes | |
union | FastSqrtUnion |
struct | Vec3 |
Macros | |
#define | FP_BITS(fp) ( ( *(DWORD*) &(fp) ) ) |
#define | FP_ABS_BITS(fp) ( (FP_BITS( fp )&0x7FFFFFFF) ) |
#define | FP_SIGN_BIT(fp) ( (FP_BITS( fp )&0x80000000) ) |
#define | FP_ONE_BITS ( (0x3F800000) ) |
#define | __forceinline inline |
#define | FP_INV(r, p) |
#define | FP_INV2(r, p) |
#define | FP_EXP(e, p) |
#define | FP_NORM_TO_BYTE(i, p) |
Typedefs | |
typedef int | DWORD |
typedef union FastSqrtUnion | FastSqrtUnion |
Functions | |
unsigned long | FP_NORM_TO_BYTE2 (float p) |
unsigned long | FP_NORM_TO_BYTE3 (float p) |
void | build_sqrt_table () |
float | fastsqrt (float n) |
__forceinline void | FloatToInt (int *int_pointer, float f) |
int | Stupodmain (int argc, char *argv[]) |
float | CylTest_CapsFirst (const Vec3 &pt1, const Vec3 &pt2, float lengthsq, float radius_sq, const Vec3 &testpt) |
Variables | |
float | two = 2.0f |
static unsigned int | fast_sqrt_table [0x10000] |
#define __forceinline inline |
Definition at line 23 of file fastmath.cpp.
#define FP_ABS_BITS | ( | fp) | ( (FP_BITS( fp )&0x7FFFFFFF) ) |
Definition at line 20 of file fastmath.cpp.
#define FP_BITS | ( | fp) | ( ( *(DWORD*) &(fp) ) ) |
Definition at line 19 of file fastmath.cpp.
Referenced by fastsqrt().
#define FP_EXP | ( | e, | |
p | |||
) |
Definition at line 59 of file fastmath.cpp.
#define FP_INV | ( | r, | |
p | |||
) |
Definition at line 27 of file fastmath.cpp.
Referenced by Stupodmain().
#define FP_INV2 | ( | r, | |
p | |||
) |
Definition at line 44 of file fastmath.cpp.
#define FP_NORM_TO_BYTE | ( | i, | |
p | |||
) |
Definition at line 68 of file fastmath.cpp.
#define FP_ONE_BITS ( (0x3F800000) ) |
Definition at line 22 of file fastmath.cpp.
#define FP_SIGN_BIT | ( | fp) | ( (FP_BITS( fp )&0x80000000) ) |
Definition at line 21 of file fastmath.cpp.
Definition at line 16 of file fastmath.cpp.
typedef union FastSqrtUnion FastSqrtUnion |
void build_sqrt_table | ( | ) |
Definition at line 98 of file fastmath.cpp.
References FastSqrtUnion::f, fast_sqrt_table, float, FastSqrtUnion::i, i, and UniverseUtil::sqrt().
Referenced by Stupodmain().
float CylTest_CapsFirst | ( | const Vec3 & | pt1, |
const Vec3 & | pt2, | ||
float | lengthsq, | ||
float | radius_sq, | ||
const Vec3 & | testpt | ||
) |
Definition at line 124 of file fastmath.cpp.
References fast_sqrt_table, and FP_BITS.
Referenced by Stupodmain().
__forceinline void FloatToInt | ( | int * | int_pointer, |
float | f | ||
) |
Definition at line 136 of file fastmath.cpp.
Referenced by Stupodmain().
|
inline |
Definition at line 79 of file fastmath.cpp.
|
inline |
Definition at line 85 of file fastmath.cpp.
Definition at line 141 of file fastmath.cpp.
References build_sqrt_table(), fastsqrt(), FloatToInt(), FP_INV, i, and UniverseUtil::sqrt().
|
static |
Definition at line 91 of file fastmath.cpp.
Referenced by build_sqrt_table(), and fastsqrt().
float two = 2.0f |
Definition at line 42 of file fastmath.cpp.
Referenced by Unit::LoadRow().