Drag[en]gine Game Engine  1.0
decMath Namespace Reference

Functions

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

Function Documentation

◆ clamp() [1/3]

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

◆ clamp() [2/3]

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

Clamp value to range.

◆ clamp() [3/3]

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

Clamp value to range.

◆ linearStep() [1/4]

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

Linear map x to the range from 0 to 1.

◆ linearStep() [2/4]

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

Linear map x to the range from 0 to 1.

◆ linearStep() [3/4]

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

Linear map x from one range to another range.

◆ linearStep() [4/4]

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

Linear map x from one range to another range.

◆ max() [1/3]

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

Larger of two values.

◆ max() [2/3]

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

Larger of two values.

◆ max() [3/3]

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

Larger of two values.

◆ min() [1/3]

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

Smaller of two values.

◆ min() [2/3]

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

Smaller of two values.

◆ min() [3/3]

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

Smaller of two values.

◆ mix() [1/2]

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.

◆ mix() [2/2]

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.

◆ normalize() [1/5]

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

Normalize value.

◆ normalize() [2/5]

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

Normalize value.

◆ normalize() [3/5]

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

Normalize value.

◆ normalize() [4/5]

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

Normalize value.

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

◆ normalize() [5/5]

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

Normalize value.

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

◆ smoothStep() [1/4]

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

Smooth map x to the range from 0 to 1.

◆ smoothStep() [2/4]

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

Smooth map x to the range from 0 to 1.

◆ smoothStep() [3/4]

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

Smooth map x from one range to another range.

◆ smoothStep() [4/4]

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

Smooth map x from one range to another range.