Drag[en]gine Game Engine  1.21
decMath Namespace Reference

Functions

DE_DLL_EXPORT double clamp (double x, double lower, double upper)
 Clamp value to range. More...
 
DE_DLL_EXPORT float clamp (float x, float lower, float upper)
 Clamp value to range. More...
 
DE_DLL_EXPORT int clamp (int x, int lower, int upper)
 Clamp value to range. More...
 
DE_DLL_EXPORT double linearStep (double x, double lower, double upper)
 Linear map x to the range from 0 to 1. More...
 
DE_DLL_EXPORT double linearStep (double x, double lower, double upper, double mapLower, double mapUpper)
 Linear map x from one range to another range. More...
 
DE_DLL_EXPORT float linearStep (float x, float lower, float upper)
 Linear map x to the range from 0 to 1. More...
 
DE_DLL_EXPORT float linearStep (float x, float lower, float upper, float mapLower, float mapUpper)
 Linear map x from one range to another range. More...
 
DE_DLL_EXPORT double max (double a, double b)
 Larger of two values. More...
 
DE_DLL_EXPORT double max (double a, double b, double c)
 Larger of three values. More...
 
DE_DLL_EXPORT double max (double a, double b, double c, double d)
 Larger of four values. More...
 
DE_DLL_EXPORT float max (float a, float b)
 Larger of two values. More...
 
DE_DLL_EXPORT float max (float a, float b, float c)
 Larger of three values. More...
 
DE_DLL_EXPORT float max (float a, float b, float c, float d)
 Larger of four values. More...
 
DE_DLL_EXPORT int max (int a, int b)
 Larger of two values. More...
 
DE_DLL_EXPORT int max (int a, int b, int c)
 Larger of three values. More...
 
DE_DLL_EXPORT int max (int a, int b, int c, int d)
 Larger of four values. More...
 
DE_DLL_EXPORT double min (double a, double b)
 Smaller of two values. More...
 
DE_DLL_EXPORT double min (double a, double b, double c)
 Smaller of three values. More...
 
DE_DLL_EXPORT double min (double a, double b, double c, double d)
 Smaller of four values. More...
 
DE_DLL_EXPORT float min (float a, float b)
 Smaller of two values. More...
 
DE_DLL_EXPORT float min (float a, float b, float c)
 Smaller of three values. More...
 
DE_DLL_EXPORT float min (float a, float b, float c, float d)
 Smaller of four values. More...
 
DE_DLL_EXPORT int min (int a, int b)
 Smaller of two values. More...
 
DE_DLL_EXPORT int min (int a, int b, int c)
 Smaller of three values. More...
 
DE_DLL_EXPORT int min (int a, int b, int c, int d)
 Smaller of four values. More...
 
DE_DLL_EXPORT double mix (double a, double b, double blend)
 Blend between two values. More...
 
DE_DLL_EXPORT float mix (float a, float b, float blend)
 Blend between two values. More...
 
DE_DLL_EXPORT double normalize (double x, double lower, double upper)
 Normalize value. More...
 
DE_DLL_EXPORT double normalize (double x, double upper)
 Normalize value. More...
 
DE_DLL_EXPORT float normalize (float x, float lower, float upper)
 Normalize value. More...
 
DE_DLL_EXPORT float normalize (float x, float upper)
 Normalize value. More...
 
DE_DLL_EXPORT int normalize (int x, int lower, int upper)
 Normalize value. More...
 
DE_DLL_EXPORT float random (float lower, float upper)
 Random value. More...
 
DE_DLL_EXPORT int random (int lower, int upper)
 Random value. More...
 
DE_DLL_EXPORT double smoothStep (double x, double lower, double upper)
 Smooth map x to the range from 0 to 1. More...
 
DE_DLL_EXPORT double smoothStep (double x, double lower, double upper, double mapLower, double mapUpper)
 Smooth map x from one range to another range. More...
 
DE_DLL_EXPORT float smoothStep (float x, float lower, float upper)
 Smooth map x to the range from 0 to 1. More...
 
DE_DLL_EXPORT float smoothStep (float x, float lower, float upper, float mapLower, float mapUpper)
 Smooth map x from one range to another range. More...
 

Function Documentation

◆ clamp() [1/3]

DE_DLL_EXPORT double decMath::clamp ( double  x,
double  lower,
double  upper 
)
inline

Clamp value to range.

◆ clamp() [2/3]

DE_DLL_EXPORT float decMath::clamp ( float  x,
float  lower,
float  upper 
)
inline

Clamp value to range.

Referenced by random().

◆ clamp() [3/3]

DE_DLL_EXPORT int decMath::clamp ( int  x,
int  lower,
int  upper 
)
inline

Clamp value to range.

◆ linearStep() [1/4]

DE_DLL_EXPORT double decMath::linearStep ( double  x,
double  lower,
double  upper 
)
inline

Linear map x to the range from 0 to 1.

◆ linearStep() [2/4]

DE_DLL_EXPORT double decMath::linearStep ( double  x,
double  lower,
double  upper,
double  mapLower,
double  mapUpper 
)
inline

Linear map x from one range to another range.

◆ linearStep() [3/4]

DE_DLL_EXPORT float decMath::linearStep ( float  x,
float  lower,
float  upper 
)
inline

Linear map x to the range from 0 to 1.

◆ linearStep() [4/4]

DE_DLL_EXPORT float decMath::linearStep ( float  x,
float  lower,
float  upper,
float  mapLower,
float  mapUpper 
)
inline

Linear map x from one range to another range.

◆ max() [1/9]

DE_DLL_EXPORT double decMath::max ( double  a,
double  b 
)
inline

Larger of two values.

◆ max() [2/9]

DE_DLL_EXPORT double decMath::max ( double  a,
double  b,
double  c 
)
inline

Larger of three values.

References max().

◆ max() [3/9]

DE_DLL_EXPORT double decMath::max ( double  a,
double  b,
double  c,
double  d 
)
inline

Larger of four values.

References max().

◆ max() [4/9]

DE_DLL_EXPORT float decMath::max ( float  a,
float  b 
)
inline

Larger of two values.

Referenced by max().

◆ max() [5/9]

DE_DLL_EXPORT float decMath::max ( float  a,
float  b,
float  c 
)
inline

Larger of three values.

References max().

◆ max() [6/9]

DE_DLL_EXPORT float decMath::max ( float  a,
float  b,
float  c,
float  d 
)
inline

Larger of four values.

References max().

◆ max() [7/9]

DE_DLL_EXPORT int decMath::max ( int  a,
int  b 
)
inline

Larger of two values.

◆ max() [8/9]

DE_DLL_EXPORT int decMath::max ( int  a,
int  b,
int  c 
)
inline

Larger of three values.

References max().

◆ max() [9/9]

DE_DLL_EXPORT int decMath::max ( int  a,
int  b,
int  c,
int  d 
)
inline

Larger of four values.

References max().

◆ min() [1/9]

DE_DLL_EXPORT double decMath::min ( double  a,
double  b 
)
inline

Smaller of two values.

◆ min() [2/9]

DE_DLL_EXPORT double decMath::min ( double  a,
double  b,
double  c 
)
inline

Smaller of three values.

References min().

◆ min() [3/9]

DE_DLL_EXPORT double decMath::min ( double  a,
double  b,
double  c,
double  d 
)
inline

Smaller of four values.

References min().

◆ min() [4/9]

DE_DLL_EXPORT float decMath::min ( float  a,
float  b 
)
inline

Smaller of two values.

Referenced by min().

◆ min() [5/9]

DE_DLL_EXPORT float decMath::min ( float  a,
float  b,
float  c 
)
inline

Smaller of three values.

References min().

◆ min() [6/9]

DE_DLL_EXPORT float decMath::min ( float  a,
float  b,
float  c,
float  d 
)
inline

Smaller of four values.

References min().

◆ min() [7/9]

DE_DLL_EXPORT int decMath::min ( int  a,
int  b 
)
inline

Smaller of two values.

◆ min() [8/9]

DE_DLL_EXPORT int decMath::min ( int  a,
int  b,
int  c 
)
inline

Smaller of three values.

References min().

◆ min() [9/9]

DE_DLL_EXPORT int decMath::min ( int  a,
int  b,
int  c,
int  d 
)
inline

Smaller of four values.

References min().

◆ mix() [1/2]

DE_DLL_EXPORT double decMath::mix ( double  a,
double  b,
double  blend 
)
inline

Blend between two values.

blend is clamped to the range between 0 and 1 before mixing.

◆ mix() [2/2]

DE_DLL_EXPORT float decMath::mix ( float  a,
float  b,
float  blend 
)
inline

Blend between two values.

blend is clamped to the range between 0 and 1 before mixing.

◆ normalize() [1/5]

DE_DLL_EXPORT double decMath::normalize ( double  x,
double  lower,
double  upper 
)
inline

Normalize value.

◆ normalize() [2/5]

DE_DLL_EXPORT double decMath::normalize ( double  x,
double  upper 
)
inline

Normalize value.

Same as normalize(double,double,double) with lower set to 0.

◆ normalize() [3/5]

DE_DLL_EXPORT float decMath::normalize ( float  x,
float  lower,
float  upper 
)
inline

Normalize value.

◆ normalize() [4/5]

DE_DLL_EXPORT float decMath::normalize ( float  x,
float  upper 
)
inline

Normalize value.

Same as normalize(float,float,float) with lower set to 0.

◆ normalize() [5/5]

DE_DLL_EXPORT int decMath::normalize ( int  x,
int  lower,
int  upper 
)
inline

Normalize value.

◆ random() [1/2]

DE_DLL_EXPORT float decMath::random ( float  lower,
float  upper 
)
inline

Random value.

References clamp().

◆ random() [2/2]

DE_DLL_EXPORT int decMath::random ( int  lower,
int  upper 
)
inline

Random value.

References clamp().

◆ smoothStep() [1/4]

DE_DLL_EXPORT double decMath::smoothStep ( double  x,
double  lower,
double  upper 
)
inline

Smooth map x to the range from 0 to 1.

◆ smoothStep() [2/4]

DE_DLL_EXPORT double decMath::smoothStep ( double  x,
double  lower,
double  upper,
double  mapLower,
double  mapUpper 
)
inline

Smooth map x from one range to another range.

◆ smoothStep() [3/4]

DE_DLL_EXPORT float decMath::smoothStep ( float  x,
float  lower,
float  upper 
)
inline

Smooth map x to the range from 0 to 1.

◆ smoothStep() [4/4]

DE_DLL_EXPORT float decMath::smoothStep ( float  x,
float  lower,
float  upper,
float  mapLower,
float  mapUpper 
)
inline

Smooth map x from one range to another range.