Drag[en]gine Game Engine  1.0
decMath.h File Reference

Class for mathematical calculations. More...

#include <math.h>
#include "decVector.h"
#include "decVector2.h"
#include "decVector4.h"
#include "decDVector.h"
#include "decDVector4.h"
#include "decQuaternion.h"
#include "decPoint.h"
#include "decPoint3.h"
#include "decColor.h"
#include "decMatrix.h"
#include "decDMatrix.h"
#include "decTexMatrix.h"
#include "decTexMatrix2.h"
#include "decColorMatrix.h"
#include "decColorMatrix3.h"
#include "decBoundary.h"

Namespaces

 decMath
 

Macros

#define COLOR_THRESHOLD   1e-5f
 
#define CURVE_THRESHOLD   1e-6f
 
#define DOUBLE_EPSILON   2.220446049250313e-16
 
#define DOUBLE_SAFE_EPSILON   1e-15
 
#define DVECTOR_THRESHOLD   1e-6
 
#define FLOAT_EPSILON   1.1929093e-7f
 
#define FLOAT_SAFE_EPSILON   1e-6f
 
#define HALF_PI   (PI / 2.0f)
 
#define ONE_PI   (PI / 180.0f)
 
#define PI   3.14159265f
 
#define QUATERNION_THRESHOLD   1e-5f
 
#define TEXEL_THRESHOLD   1e-5f
 
#define VECTOR_THRESHOLD   1e-6f
 

Functions

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

Detailed Description

Class for mathematical calculations.

Author
Pl├╝ss Roland
Version
1.0
Date
2008

Macro Definition Documentation

◆ COLOR_THRESHOLD

#define COLOR_THRESHOLD   1e-5f

◆ CURVE_THRESHOLD

#define CURVE_THRESHOLD   1e-6f

◆ DOUBLE_EPSILON

#define DOUBLE_EPSILON   2.220446049250313e-16

◆ DOUBLE_SAFE_EPSILON

#define DOUBLE_SAFE_EPSILON   1e-15

◆ DVECTOR_THRESHOLD

#define DVECTOR_THRESHOLD   1e-6

◆ FLOAT_EPSILON

#define FLOAT_EPSILON   1.1929093e-7f

Floating point thresholds (epsilons).

◆ FLOAT_SAFE_EPSILON

#define FLOAT_SAFE_EPSILON   1e-6f

◆ HALF_PI

#define HALF_PI   (PI / 2.0f)

Value of half pi.

◆ ONE_PI

#define ONE_PI   (PI / 180.0f)

One degree in radians.

◆ PI

#define PI   3.14159265f

Value of pi.

◆ QUATERNION_THRESHOLD

#define QUATERNION_THRESHOLD   1e-5f

◆ TEXEL_THRESHOLD

#define TEXEL_THRESHOLD   1e-5f

◆ VECTOR_THRESHOLD

#define VECTOR_THRESHOLD   1e-6f