#include "..\Headers\fastmath.h"#include <stdio.h>#include <stdlib.h>#include <math.h>#include <wtypes.h>Compounds | |
| union | FastSqrtUnion |
| struct | Vec3 |
Defines | |
| #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 | FP_INV(r, p) |
| #define | FP_INV2(r, p) |
| #define | FP_EXP(e, p) |
| #define | FP_NORM_TO_BYTE(i, p) |
Typedefs | |
| typedef 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) |
| float | CylTest_CapsFirst (const Vec3 &pt1, const Vec3 &pt2, float lengthsq, float radius_sq, const Vec3 &testpt) |
Variables | |
| float | two = 2.0f |
|
|
|
|
|
|
|
|
Value: { \
int _i; \
e = -1.44269504f * (float)0x00800000 * (p); \
_i = (int)e + 0x3F800000; \
e = *(float *)&_i; \
} |
|
|
Value: { \
int _i = 2 * FP_ONE_BITS - *(int *)&(p); \
r = *(float *)&_i; \
r = r * (2.0f - (p) * r); \
} |
|
|
Value: { \
__asm { mov eax,0x7F000000 }; \
__asm { sub eax,dword ptr [p] }; \
__asm { mov dword ptr [r],eax }; \
__asm { fld dword ptr [p] }; \
__asm { fmul dword ptr [r] }; \
__asm { fsubr [two] }; \
__asm { fmul dword ptr [r] }; \
__asm { fstp dword ptr [r] }; \
} |
|
|
Value: { \
float _n = (p) + 1.0f; \
i = *(int *)&_n; \
if (i >= 0x40000000) i = 0xFF; \
else if (i <=0x3F800000) i = 0; \
else i = ((i) >> 15) & 0xFF; \
} |
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001