UFO: Alien Invasion
Toggle main menu visibility
Loading...
Searching...
No Matches
mathlib_extra.h
Go to the documentation of this file.
1
18
19
/*
20
Copyright (C) 2002-2025 UFO: Alien Invasion.
21
22
This program is free software; you can redistribute it and/or
23
modify it under the terms of the GNU General Public License
24
as published by the Free Software Foundation; either version 2
25
of the License, or (at your option) any later version.
26
27
This program is distributed in the hope that it will be useful,
28
but WITHOUT ANY WARRANTY; without even the implied warranty of
29
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
30
31
See the GNU General Public License for more details.
32
33
You should have received a copy of the GNU General Public License
34
along with this program; if not, write to the Free Software
35
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
36
*/
37
38
#pragma once
39
40
#include "
ufotypes.h
"
41
#include "
mathlib.h
"
42
52
#ifndef DENORM
53
#define DENORM 0.0000000001
54
#endif
55
#ifndef DENORM_INV
56
#define DENORM_INV (1.0 - (DENORM))
57
#endif
58
66
#ifndef ChkDNorm
67
#define ChkDNorm(fpVal) ((fpVal) == 0.0 ? (DENORM) : (fpVal) )
68
#endif
69
77
#ifndef ChkDNorm_Inv
78
#define ChkDNorm_Inv(fpVal) ( ((fpVal) == 1.0) ? (DENORM_INV) : (fpVal) )
79
#endif
80
82
83
/* Basic curves */
84
double
FpCurveUp
(
double
fpVal,
double
mEffect);
85
double
FpCurveDn
(
double
fpVal,
double
mEffect);
86
87
/* "RS" = "Rapid Start", curve has a different, skewed shape */
88
double
FpCurveUpRs
(
double
fpVal,
double
mEffect);
89
double
FpCurveDnRs
(
double
fpVal,
double
mEffect);
90
98
/* "cntPnt" = center point, function curves "fpVal" TOWARD "cntPnt" */
99
double
FpCurve1D_u_in
(
double
fpVal,
double
mEffect,
double
cntPnt);
100
/* "cntPnt" = center point, function curves "fpVal" AWAY FROM "cntPnt" */
101
double
FpCurve1D_u_out
(
double
fpVal,
double
mEffect,
double
cntPnt);
102
104
105
/* Function curves "fpVal" AWAY FROM 0.0, toward 1.0f or -1.0f */
106
double
FpCurve1D_s_out
(
double
fpVal,
double
mEffect);
107
114
float
FpUcurve_f
(
const
float
inpVal,
const
float
hard);
115
double
FpUcurve_d
(
const
double
inpVal,
const
double
hard);
116
117
float
FpUcurveSc_f
(
const
float
inpVal,
const
float
hard,
const
float
scale
);
118
double
FpUcurveSc_d
(
const
double
inpVal,
const
double
hard,
const
double
scale
);
mathlib.h
FpCurveUpRs
double FpCurveUpRs(double fpVal, double mEffect)
Takes a floating-point value (double) between 0.0 and 1.0 and returns a new value within the same ran...
Definition
mathlib_extra.cpp:85
FpCurve1D_s_out
double FpCurve1D_s_out(double fpVal, double mEffect)
Takes a floating-point value (double) between -1.0 and +1.0 and returns a new value within the same r...
Definition
mathlib_extra.cpp:218
FpCurveDn
double FpCurveDn(double fpVal, double mEffect)
Takes a floating-point value (double) between 0.0 and 1.0 and returns a new value within the same ran...
Definition
mathlib_extra.cpp:59
FpUcurveSc_f
float FpUcurveSc_f(const float inpVal, const float hard, const float scale)
Takes a (float) of any value and outputs a value from -1.f to +1.f, along a curve,...
Definition
mathlib_extra.cpp:270
FpCurve1D_u_in
double FpCurve1D_u_in(double fpVal, double mEffect, double cntPnt)
Takes a floating-point value (double) between 0.0 and 1.0 and returns a new value within the same ran...
Definition
mathlib_extra.cpp:137
FpUcurve_f
float FpUcurve_f(const float inpVal, const float hard)
Takes a (float) of any value and outputs a value from -1.f to +1.f, along a curve,...
Definition
mathlib_extra.cpp:241
FpCurveUp
double FpCurveUp(double fpVal, double mEffect)
Takes a floating-point value (double) between 0.0 and 1.0 and returns a new value within the same ran...
Definition
mathlib_extra.cpp:36
FpUcurveSc_d
double FpUcurveSc_d(const double inpVal, const double hard, const double scale)
Takes a (float) of any value and outputs a value from -1.f to +1.f, along a curve,...
Definition
mathlib_extra.cpp:285
FpUcurve_d
double FpUcurve_d(const double inpVal, const double hard)
Takes a (float) of any value and outputs a value from -1.f to +1.f, along a curve,...
Definition
mathlib_extra.cpp:255
FpCurve1D_u_out
double FpCurve1D_u_out(double fpVal, double mEffect, double cntPnt)
Takes a floating-point value (double) between 0.0 and 1.0 and returns a new value within the same ran...
Definition
mathlib_extra.cpp:178
FpCurveDnRs
double FpCurveDnRs(double fpVal, double mEffect)
Takes a floating-point value (double) between 0.0 and 1.0 and returns a new value within the same ran...
Definition
mathlib_extra.cpp:110
ufotypes.h
Cross-platform type definitions.
scale
static const vec3_t scale
Definition
ui_node_baseinventory.cpp:238
src
shared
mathlib_extra.h
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.17.0