FS2_Open
Open source remastering of the Freespace 2 engine
|
Go to the source code of this file.
Macros | |
#define | fl_is_nan(fl) _isnan((double)(fl)) |
#define | fl_sqrt(fl) sqrtf(fl) |
#define | fl_isqrt(fl) (1.0f/sqrtf(fl)) |
#define | fl_abs(fl) fabsf(fl) |
#define | i2fl(i) ((float)(i)) |
#define | fl2i(fl) ((int)(fl)) |
#define | fl2ir(fl) ((int)(fl + ((fl < 0.0f) ? -0.5f : 0.5f))) |
#define | flceil(fl) (int)ceil(fl) |
#define | flfloor(fl) (int)floor(fl) |
#define | f2fl(fx) ((float)(fx)/65536.0f) |
#define | fl2f(fl) (int)((fl)*65536.0f) |
#define | fl_tan(fl) tanf(fl) |
#define | fl_radians(fl) ((float)((fl) * (PI / 180.0f))) |
#define | fl_degrees(fl) ((float)((fl) * (180.0f / PI))) |
Functions | |
float | frand () |
Return random value in range 0.0..1.0- (1.0- means the closest number less than 1.0) More... | |
int | rand_chance (float frametime, float chance=1.0f) |
Call this in the frame interval to get TRUE chance times per second. More... | |
float | frand_range (float min, float max) |
Return a floating point number in the range min..max. More... | |
bool | fl_equal (float a, float b) |
float | fl_roundoff (float x, int multiple) |
Rounds off a floating point number to a multiple of some number. More... | |
#define f2fl | ( | fx | ) | ((float)(fx)/65536.0f) |
Definition at line 37 of file floating.h.
Definition at line 38 of file floating.h.
Definition at line 33 of file floating.h.
Definition at line 34 of file floating.h.
Definition at line 31 of file floating.h.
Definition at line 45 of file floating.h.
Definition at line 25 of file floating.h.
#define fl_isqrt | ( | fl | ) | (1.0f/sqrtf(fl)) |
Definition at line 30 of file floating.h.
Definition at line 29 of file floating.h.
Definition at line 39 of file floating.h.
Definition at line 35 of file floating.h.
Definition at line 36 of file floating.h.
Definition at line 32 of file floating.h.
Definition at line 94 of file floating.h.
Rounds off a floating point number to a multiple of some number.
x | Input floating point number |
multiple | Multiple to round to |
Definition at line 21 of file floating.cpp.
float frand | ( | ) |
Return random value in range 0.0..1.0- (1.0- means the closest number less than 1.0)
Definition at line 35 of file floating.cpp.
Return a floating point number in the range min..max.
min | Minimum (inclusive) |
max | Maxiumum (inclusive) |
Definition at line 50 of file floating.cpp.
Call this in the frame interval to get TRUE chance times per second.
If you want it to return TRUE 3 times per second, call it in the frame interval like so: rand_chance(flFrametime, 3.0f);
frametime | |
chance |
Definition at line 66 of file floating.cpp.