Xonotic
|
#include "lib/float.qh"
Go to the source code of this file.
Macros | |
#define | crandom() (2 * (random() - 0.5)) |
Returns a random number between -1.0 and 1.0. More... | |
#define | MEAN_ACCUMULATE(s, prefix, v, w) mean_accumulate(s, prefix##_accumulator, prefix##_count, prefix##_mean, v, w) |
#define | MEAN_DECLARE(prefix, m) float prefix##_mean = m; .float prefix##_count, prefix##_accumulator |
#define | MEAN_EVALUATE(s, prefix) mean_evaluate(s, prefix##_accumulator, prefix##_count, prefix##_mean) |
#define | power2of(e) (2 ** e) |
#define crandom | ( | ) | (2 * (random() - 0.5)) |
Returns a random number between -1.0 and 1.0.
Definition at line 27 of file math.qh.
Referenced by ctf_Handle_Throw(), Item_ScheduleRespawn(), and ka_DropEvent().
#define MEAN_ACCUMULATE | ( | s, | |
prefix, | |||
v, | |||
w | |||
) | mean_accumulate(s, prefix##_accumulator, prefix##_count, prefix##_mean, v, w) |
Definition at line 22 of file math.qh.
Referenced by anticheat_physics().
#define MEAN_EVALUATE | ( | s, | |
prefix | |||
) | mean_evaluate(s, prefix##_accumulator, prefix##_count, prefix##_mean) |
Definition at line 229 of file math.qh.
References ERASEABLE, fabs(), FLOAT_EPSILON, and max().
Referenced by DamageText::DamageText_update(), and MUTATOR_HOOKFUNCTION().
Definition at line 236 of file math.qh.
References ERASEABLE, max(), and median().
Referenced by Slider_draw(), Slider_keyDown(), Slider_mouseDrag(), and Slider_valueToText().
Definition at line 129 of file math.qh.
References ERASEABLE.
Referenced by SUB_CalcMove_controller_think().
Definition at line 138 of file math.qh.
References ERASEABLE.
Referenced by set_platmovetype().
continuous function mapping all reals into 0..1
Definition at line 210 of file math.qh.
References ERASEABLE, and float2range11().
continuous function mapping all reals into -1..1
Definition at line 203 of file math.qh.
References ERASEABLE, and fabs().
Referenced by float2range01(), and GetCurrentFov().
Definition at line 57 of file math.qh.
References ERASEABLE, and rint().
Referenced by pathlib_astar(), pathlib_flynode(), pathlib_nodeatpoint(), pathlib_swimnode(), pathlib_walknode(), and pathlib_wateroutnode().
Definition at line 81 of file math.qh.
References ERASEABLE, and lerpratio().
Definition at line 87 of file math.qh.
References ERASEABLE, f1, and lerpratio().
Definition at line 75 of file math.qh.
References ERASEABLE.
Referenced by lerp(), and lerp3ratio().
Definition at line 108 of file math.qh.
References ERASEABLE.
Referenced by antilag_takebackorigin().
Definition at line 101 of file math.qh.
References ERASEABLE, f1, and lerpvratio().
Definition at line 95 of file math.qh.
References ERASEABLE.
Referenced by lerpv3ratio().
ERASEABLE float map_bound_ranges | ( | float | value, |
float | src_min, | ||
float | src_max, | ||
float | dest_min, | ||
float | dest_max | ||
) |
Same as map_ranges
except that values outside the source range are clamped to min or max.
Definition at line 375 of file math.qh.
References map_ranges().
Referenced by DamageText::DamageText_update(), and determine_force().
ERASEABLE float map_ranges | ( | float | value, |
float | src_min, | ||
float | src_max, | ||
float | dest_min, | ||
float | dest_max | ||
) |
Maps values between the src and dest range: src_min to dest_min, src_max to dest_max, values between them to the corresponding values between and extrapolates for values outside the range.
src_min and src_max must not be the same or division by zero occurs.
dest_max can be smaller than dest_min if you want the resulting range to be inverted, all values can be negative.
Definition at line 366 of file math.qh.
References ERASEABLE.
Referenced by map_bound_ranges().
Definition at line 216 of file math.qh.
References bound(), and ERASEABLE.
Referenced by almost_in_bounds(), Slider_keyDown(), Slider_mouseDrag(), XonoticSliderCheckBox_configureXonoticSliderCheckBox(), XonoticSliderCheckBox_draw(), and XonoticSliderCheckBox_setChecked().
ax^2 + bx + c = 0
Definition at line 307 of file math.qh.
References ERASEABLE, sqrt(), v, and vector().
Referenced by get_shotvelocity(), solve_shotdirection(), StartFrame(), and trigger_push_calculatevelocity().