Classes | |
struct | FPConst |
Floating point constant template class. More... | |
class | NoiseGenerator_Base |
Noise generator base class. More... | |
class | NoiseGenerator_Perlin |
Ken Perlin's famous noise function. More... | |
class | OMatrix |
3x4 object transform matrix class. More... | |
class | Plane3 |
3dim plane class template for types flt and dbl. More... | |
class | PolyRootSolver |
Base class for all polynomial root solvers. More... | |
class | PolyRootSolver_Bairstow |
Polynomial root solver based on the Bairstow method. More... | |
struct | PolyRootSolver_Bairstow::Params |
Tuning parameters:. More... | |
class | PolyRootSolver_Direct |
Direct polynomial root solver based on explicit formulas. More... | |
struct | PolyRootSolver_Direct::Params |
Tuning parameters:. More... | |
class | PolyRootSolver_Sturm |
Polynomial root solver based on the Sturm series of polynoms. More... | |
struct | PolyRootSolver_Sturm::Params |
Tuning parameters:. More... | |
struct | PolyRootSolver_Sturm::poly |
Structure for representing a polynomial. More... | |
class | RandomNumberGenerator |
Random number generator class for the end user. More... | |
class | RandomNumberGenerator_Base |
Random number generator base class. More... | |
class | RandomNumberGenerator_LibCRandom |
Interface to standard libc random() PRNG. More... | |
class | RandomNumberGenerator_MersenneTwister19937 |
Fast Mersenne Twister pseudorandom number generator with period 2^19937-1. More... | |
class | Vector2 |
2dim vector class template for types flt and dbl. More... | |
class | Vector3 |
3dim vector class template for types flt and dbl. More... | |
Functions | |
template<typename T> Vector2< T > | operator+ (const Vector2< T > &a, const Vector2< T > &b) |
Add 2 vectors:. | |
template<typename T> Vector2< T > | operator- (const Vector2< T > &a, const Vector2< T > &b) |
Subract 2 vectors:. | |
template<typename T> Vector2< T > | operator * (const Vector2< T > &a, T b) |
Multiply vector with scalar:. | |
template<typename T> Vector2< T > | operator * (T b, const Vector2< T > &a) |
template<typename T> Vector2< T > | operator/ (const Vector2< T > &a, T b) |
template<typename T> T | len2 (const Vector2< T > &v) |
Compute square of length (Euclidic norm) of a vector:. | |
template<typename T> T | len (const Vector2< T > &v) |
Compute length of a vector (Euclidic norm):. | |
template<typename T> T | dist2 (const Vector2< T > &a, const Vector2< T > &b) |
Compute (Euclidic) squared distance between two points. | |
template<typename T> T | dist (const Vector2< T > &a, const Vector2< T > &b) |
Compute (Euclidic) distance between two points. | |
template<typename T> Vector2< T > | normalize (const Vector2< T > &v) |
Return a normalized vector (length 1):. | |
template<typename T> Vector2< T > | normalize (const Vector2< T > &v, T l) |
Return a normalized vector with length l:. | |
template<typename T> T | dot (const Vector2< T > &a, const Vector2< T > &b) |
Compute the scalar (dot) product of two vectors. | |
template<typename T> T | angle (const Vector2< T > &a, const Vector2< T > &b) |
Compute angle between 2 vectors:. | |
template<typename T> bool | equal (const Vector2< T > &a, const Vector2< T > &b, T epsilon) |
template<typename T> Vector2< T > | LinComb (const Vector2< T > &va, T ca, const Vector2< T > &vb) |
Compute linear combination va*ca + vb. | |
template<typename T> Vector2< T > | LinComb (const Vector2< T > &va, T ca, const Vector2< T > &vb, T cb) |
Compute linear combination va+ca + vb*cb. | |
template<typename T> Vector2< T > | LinComb (const Vector2< T > &va, T ca, const Vector2< T > &vb, T cb, const Vector2< T > &vc) |
Compute linear combination va+ca + vb*cb + vc. | |
template<typename T> Vector2< T > | LinComb (const Vector2< T > &va, T ca, const Vector2< T > &vb, T cb, const Vector2< T > &vc, T cc) |
Compute linear combination va+ca + vb*cb + vc*cc. | |
template<typename T> Vector2< T > | average (const Vector2< T > &a, const Vector2< T > &b) |
Compute the average (arithmetic) of two vectors, i.e. (a+b)/2. | |
void | _OMatrixInstantiationDummy () |
template<typename T> OMatrix< T > | operator+ (const OMatrix< T > &a, const OMatrix< T > &b) |
Add 2 matrices:. | |
template<typename T> OMatrix< T > | operator- (const OMatrix< T > &a, const OMatrix< T > &b) |
Subract 2 matrices:. | |
template<typename T> OMatrix< T > | operator * (const OMatrix< T > &a, T b) |
Multiply matrix with scalar:. | |
template<typename T> OMatrix< T > | operator * (T b, const OMatrix< T > &a) |
Multiply matrix with scalar:. | |
template<typename T> OMatrix< T > | operator * (const OMatrix< T > &a, const OMatrix< T > &b) |
Multiply matrix with matrix:. | |
template<typename T> OMatrix< T > | operator/ (const OMatrix< T > &a, T b) |
template<typename T> Vector3< T > | operator * (const OMatrix< T > &a, const Vector3< T > &b) |
Multiply matrix with vector. | |
template<typename T> bool | equal (const OMatrix< T > &a, const OMatrix< T > &b, T epsilon) |
template<typename T> OMatrix< T > | inverse (const OMatrix< T > &a) |
Invert matrix. | |
template<typename T> OMatrix< T > | transpose (const OMatrix< T > &a) |
Transpose matrix (see transpose() member function!). | |
template<typename T, typename V> int | IntersectTriangle (const Vector3< T > &orig, const Vector3< T > &dir, const Vector3< V > &vert0, const Vector3< V > &vert1, const Vector3< V > &vert2, T *t, T *u, T *v) |
Intersection of triangle with ray. | |
template<typename T> Vector3< T > | operator+ (const Vector3< T > &a, const Vector3< T > &b) |
Add 2 vectors:. | |
template<typename T> Vector3< T > | operator- (const Vector3< T > &a, const Vector3< T > &b) |
Subract 2 vectors:. | |
template<typename T> Vector3< T > | operator * (const Vector3< T > &a, T b) |
Multiply vector with scalar:. | |
template<typename T> Vector3< T > | operator * (T b, const Vector3< T > &a) |
template<typename T> Vector3< T > | operator/ (const Vector3< T > &a, T b) |
template<typename T> T | len2 (const Vector3< T > &v) |
Compute square of length (Euclidic norm) of a vector:. | |
template<typename T> T | len (const Vector3< T > &v) |
Compute length of a vector (Euclidic norm):. | |
template<typename T> T | dist2 (const Vector3< T > &a, const Vector3< T > &b) |
Compute (Euclidic) squared distance between two points. | |
template<typename T> T | dist (const Vector3< T > &a, const Vector3< T > &b) |
Compute (Euclidic) distance between two points. | |
template<typename T> Vector3< T > | normalize (const Vector3< T > &v) |
Return a normalized vector (length 1):. | |
template<typename T> Vector3< T > | normalize (const Vector3< T > &v, T l) |
Return a normalized vector with length l:. | |
template<typename T> T | dot (const Vector3< T > &a, const Vector3< T > &b) |
Compute the scalar (dot) product of two vectors. | |
template<typename T> Vector3< T > | cross (const Vector3< T > &a, const Vector3< T > &b) |
Compute the vector (cross) product of two vectors. | |
template<typename T> T | angle (const Vector3< T > &a, const Vector3< T > &b) |
Compute angle between 2 vectors:. | |
template<typename T> bool | equal (const Vector3< T > &a, const Vector3< T > &b, T epsilon) |
template<typename T> Vector3< T > | LinComb (const Vector3< T > &va, T ca, const Vector3< T > &vb) |
Compute linear combination va*ca + vb. | |
template<typename T> Vector3< T > | LinComb (const Vector3< T > &va, T ca, const Vector3< T > &vb, T cb) |
Compute linear combination va+ca + vb*cb. | |
template<typename T> Vector3< T > | LinComb (const Vector3< T > &va, T ca, const Vector3< T > &vb, T cb, const Vector3< T > &vc) |
Compute linear combination va+ca + vb*cb + vc. | |
template<typename T> Vector3< T > | LinComb (const Vector3< T > &va, T ca, const Vector3< T > &vb, T cb, const Vector3< T > &vc, T cc) |
Compute linear combination va+ca + vb*cb + vc*cc. | |
template<typename T> Vector3< T > | average (const Vector3< T > &a, const Vector3< T > &b) |
Compute the average (arithmetic) of two vectors, i.e. (a+b)/2. | |
template<class T, class U> T | cosinterp (U x, T v0, T v1) |
linear cosine interpolation | |
template<class T, class U> T | cubinterp (U x, T v0, T v1, T v2, T v3) |
cubic interpolation | |
template<class T> T | step (const T a, const T b) |
step function | |
template<class T> T | pulse (const T x, const T a, const T b) |
the pulse function | |
template<class T> T | bias (T b, T x) |
bias function | |
template<class T> T | sbias (T b, T x) |
schlick's optimized bias function | |
template<class T> T | gain (T g, T x) |
gain function | |
template<class T> T | sgain (T g, T x) |
schlick's optimized gain function | |
template<typename T> volatile void | _CME_add1 (T x, volatile T *res) |
template<typename T> volatile T | _ComputeMachEps1 () |
template<typename T> T | _ComputeMachEps1_Prec () |
void | _NoiseGenerator_PerlinInstantiationDummy () |
template<typename T> _constfn_ int | sgn (T x) |
Return sign, i.e. -1, 0 or 1. | |
template<typename T> _constfn_ int | sgn11 (T x) |
Return sign -1 or +1 with 0 being positive. | |
template<typename T> _constfn_ bool | is_negative (T x) |
_constfn_ bool | is_negative (double x) |
_constfn_ bool | is_negative (float x) |
_constfn_ bool | is_negative (long double x) |
template<typename T> _constfn_ T | sqr (T x) |
Returns x*x. | |
template<typename T> T | fabs (T x) |
template<typename T> T | max (T a, T b) |
Return the larger one of the two passed values. FP specialisation below. | |
template<typename T> T | min (T a, T b) |
Return the smaller one of the two passed values. FP specialisation below. | |
NUM_OVERLOADED (sqrt) NUM_OVERLOADED2(pow) NUM_OVERLOADED(sin) NUM_OVERLOADED(asin) NUM_OVERLOADED(cos) NUM_OVERLOADED(acos) NUM_OVERLOADED(sinh) NUM_OVERLOADED(asinh) NUM_OVERLOADED(cosh) NUM_OVERLOADED(acosh) NUM_OVERLOADED(tan) NUM_OVERLOADED(atan) NUM_OVERLOADED2(atan2) NUM_OVERLOADED(tanh) NUM_OVERLOADED(atanh) NUM_OVERLOADED(exp) NUM_OVERLOADED(log) NUM_OVERLOADED(ceil) NUM_OVERLOADED(floor) extern _deprecated_ dbl fmax(dbl x | |
_deprecated_ flt | fmaxf (flt x, flt y) |
_deprecated_ dbl | fmin (dbl x, dbl y) |
_deprecated_ flt | fminf (flt x, flt y) |
_deprecated_ dbl | rint (dbl x) |
_deprecated_ dbl | nearbyint (dbl x) |
_deprecated_ dbl | round (dbl x) |
template<typename I, typename FP> I | iroundc (FP x) |
template<> int32 | iroundc< int32, double > (double x) |
template<> int32 | iroundc< int32, float > (float x) |
template<> int32 | iroundc< int32, long double > (long double x) |
template<> int64 | iroundc< int64, double > (double x) |
template<> int64 | iroundc< int64, float > (float x) |
template<> int64 | iroundc< int64, long double > (long double x) |
IROUND_OVERLOADED (iroundc, int8) | |
IROUND_OVERLOADED (iroundc, uint8) | |
IROUND_OVERLOADED (iroundc, int16) | |
IROUND_OVERLOADED (iroundc, uint16) | |
template<typename I, typename FP> I | iroundc (I *d, FP x) |
template<typename I, typename FP> I | iround (FP x) |
template<> int32 | iround< int32, double > (double x) |
template<> int32 | iround< int32, float > (float x) |
template<> int32 | iround< int32, long double > (long double x) |
template<> int64 | iround< int64, double > (double x) |
template<> int64 | iround< int64, float > (float x) |
template<> int64 | iround< int64, long double > (long double x) |
template<typename I, typename FP> I | iround (I *d, FP x) |
template<typename T> T | cbrt (T x) |
template<typename T> T | exp10 (T x) |
template<typename T> T | log10 (T x) |
template<typename T> T | exp2 (T x) |
template<typename T> T | log2 (T x) |
_deprecated_ dbl | logb (dbl x) |
_deprecated_ flt | logbf (flt x) |
template<typename T> int | ilog2 (T x) |
_deprecated_ int | ilogb (dbl x) |
_deprecated_ int | ilogbf (flt x) |
template<typename T> T | expm1 (T x) |
template<typename T> T | log1p (T x) |
template<typename T> T | copysign (T x, T y) |
template<typename T> T | fdim (T x, T y) |
template<typename T> T | fma (T x, T y, T z) |
template<typename T> void | sincos (T x, T *sinx, T *cosx) |
double | ldexp (double x, int exp) |
float | ldexp (float x, int exp) |
long double | ldexp (long double x, int exp) |
_deprecated_ dbl | scalbn (dbl x, int exp) |
_deprecated_ dbl | scalb (dbl x, int exp) |
double | modf (double x, double *iptr) |
float | modf (float x, float *iptr) |
long double | modf (long double x, long double *iptr) |
double | frexp (double x, int *exp) |
float | frexp (float x, int *exp) |
long double | frexp (long double x, int *exp) |
_deprecated_ dbl | drem (dbl x, dbl y) |
_deprecated_ flt | drem (flt x, flt y) |
_deprecated_ flt | dremf (flt x, flt y) |
template<typename T> T | dabs (T x, T y) |
Return absolute value of difference. | |
_deprecated_ int | signbit (dbl x) |
_deprecated_ int | isinf (dbl x) |
_deprecated_ int | isnan (dbl x) |
_deprecated_ int | finite (dbl x) |
_deprecated_ int | isfinite (dbl x) |
_deprecated_ int | fpclassify (dbl x) |
_deprecated_ dbl | significand (dbl x) |
template<typename T> T | max (T a, T b, T c) |
Return the largest one of the 3 passed values. | |
template<typename T> T | min (T a, T b, T c) |
Return the smallest one of the 3 passed values. | |
_constfn_ int | powii (int x, int y) |
x^y in integer arithmetic. y MUST BE >=0. | |
template<typename T> _constfn_ T | powi (T x, int y) |
x^y for FP x and integer y. | |
template<typename T> _constfn_ T | clamp2 (T x, T low, T high) |
Clamp value x between low and high. | |
template<typename T> T | clamp1 (T x, T b) |
Clamp value x between -b and b:. | |
template<typename T> T | hypot2 (T a, T b) |
Numerically stable version of hypot(). | |
template<typename T, typename P> T | lerp2 (T l, T r, P p, P p1) |
Linear interpolation. | |
template<typename T, typename P> T | lerp (T l, T r, P p) |
Linear interpolation. | |
template<typename T, typename P> T | bilerp2 (T lt, T rt, T lb, T rb, P px, P py, P px1, P py1) |
Bi-linear interpolation. | |
template<typename T, typename P> T | bilerp (T lt, T rt, T lb, T rb, P px, P py) |
Bi-linear interpolation. | |
template<typename T> T | FermiDirac (T x) |
Compute Fermi-Dirac (smooth) step function. | |
template<typename T> T | FermiDirac (T x, T t) |
Compute Fermi-Dirac (smooth) step function. | |
template<typename T> T | StepLinear (T x, T a, T b) |
Linear interpolating step function. | |
template<typename T> T | StepCubic (T x, T a, T b) |
Cubic interpolating step function. | |
template<typename T> T | NormEuclidic2 (const T *x, int dim) |
Returns square of Euclidic norm of passed vector. | |
template<typename T> T | NormEuclidic (const T *x, int dim) |
Returns Euclidic norm of passed vector. | |
template<typename T> T | DistEuclidic2 (const T *x, const T *y, int dim) |
Returns the squared distance between two points (Euclidic norm):. | |
template<typename T> T | DistEuclidic (const T *x, const T *y, int dim) |
Returns the distance between two points (Euclidic norm):. | |
template<typename T> T | FindMaximum (const T *a, int dim) |
Return maximum entry, i.e. max{ a[0],...,a[dim-1] }. | |
template<class T> T | FindMinimum (const T *a, int dim) |
Find minimum entry, i.e. min{ a[0],...,a[dim-1] }. | |
template<class T> int | FindMinimumIdx (const T *a, int dim) |
Find index of smallest element. | |
template<typename T> T | NormalizeVector (T *x, int dim) |
Normalize vector in-place, i.e. scale it to length 1:. | |
template<typename T> T | NormalizeVector (T *dest, const T *src, int dim) |
Normalize vector, i.e. scale it to length 1:. | |
template<typename T> T | NormalizeVector2D (T *x) |
Special version to normalize a 2D vector. | |
template<typename T> void | CrossProduct (T *dest, const T *a, const T *b) |
Calculate cross product res=a x b. All vectors are 3dim, of course. | |
template<typename T> T | DotProduct (const T *a, const T *b, int dim) |
Calculate dot product res=<a,b>. | |
template<typename T> T | DotProduct3D (const T *a, const T *b) |
(Faster) 3D version of DotProduct(). | |
template<typename T> T | PolvEval (T x, const T *c, int n) |
Evaluate polynomial of degree n. | |
template<typename T> int | ArrayBinsearchInterval (T *array, int size, T value) |
Perform binary search on a sorted (FP) array. | |
template<typename T> int | TestOrderAscenting (const T *array, int n, T val_eps=1e-7) |
Check if the passed t values are increasing steadily. | |
char | _StartupCheck () |
Variables | |
const FPConst< dbl > | fpconst_dbl |
Global constant definition for dbl values. | |
const FPConst< flt > | fpconst_flt |
Global constant definition for flt values. | |
dbl | y |
char | _startup_check = _StartupCheck() |
|
Definition at line 38 of file macheps.cc. Referenced by _ComputeMachEps1(). |
|
Definition at line 25 of file macheps.cc. References _CME_add1(). |
|
Definition at line 44 of file macheps.cc. |
|
Definition at line 223 of file perlin.cc. References NUM::NoiseGenerator_Perlin< T >::noise1(), NUM::NoiseGenerator_Perlin< T >::noise2(), and NUM::NoiseGenerator_Perlin< T >::noise3(). |
|
Definition at line 25 of file omatrix.cc. |
|
Definition at line 30 of file libc.cc. References CritAssert. |
|
Compute angle between 2 vectors:.
Definition at line 325 of file vector3.h. References dot(), and NUM::Vector3< T >::len2(). |
|
Compute angle between 2 vectors:.
Definition at line 198 of file vector2.h. References dot(), and NUM::Vector2< T >::len2(). Referenced by NUM::OMatrix< T >::OMatrix(). |
|
Perform binary search on a sorted (FP) array.
array[0..size-1] is an array of elements sorted in ascenting order.
Definition at line 1326 of file num_math.h. References Assert. |
|
Compute the average (arithmetic) of two vectors, i.e. (a+b)/2.
|
|
Compute the average (arithmetic) of two vectors, i.e. (a+b)/2.
|
|
bias function
Definition at line 70 of file functions.h. References log2(). |
|
Bi-linear interpolation. There is another version available which is faster when 1-px,1-py is available or needed for several identical coordinates. Please see the other version bilerp2() for more information about the parameters. Definition at line 1050 of file num_math.h. |
|
Bi-linear interpolation. lt,rt,lb,rb define the left/top, right/top, left/bottom, right/bottom values, respectively; the bilinear interpolation will interpolate the value at the point px,py where px,py are in range 0..1.
The following values will be returned in followind special cases: px1,py1 must be set to 1-px and 1-py, respectively. There is another version available which calculates px1,py1. Definition at line 1036 of file num_math.h. |
|
Definition at line 381 of file num_math.h. References is_negative(). Referenced by NUM::PolyRootSolver_Direct::Solve_3(), and NUM::PolyRootSolver_Direct::Solve_4(). |
|
Clamp value x between -b and b:. See also clamp(). Definition at line 970 of file num_math.h. References fabs(). |
|
Clamp value x between low and high.
For symmetric border (ala -b..b), use clamp1() which is faster. Definition at line 962 of file num_math.h. References _constfn_. |
|
Definition at line 450 of file num_math.h. References is_negative(), and y. |
|
linear cosine interpolation
Definition at line 29 of file functions.h. |
|
Compute the vector (cross) product of two vectors.
Definition at line 317 of file vector3.h. Referenced by IntersectTriangle(). |
|
Calculate cross product res=a x b. All vectors are 3dim, of course.
Definition at line 1269 of file num_math.h. |
|
cubic interpolation
Definition at line 40 of file functions.h. |
|
Return absolute value of difference. Calculates fabs(x-y). See also: fabs(), fdim(), signbit(). Definition at line 882 of file num_math.h. |
|
Compute (Euclidic) distance between two points.
Definition at line 302 of file vector3.h. References dist2(). |
|
Compute (Euclidic) distance between two points.
|
|
Compute (Euclidic) squared distance between two points.
Definition at line 299 of file vector3.h. References sqr(). |
|
Compute (Euclidic) squared distance between two points.
Definition at line 180 of file vector2.h. References sqr(). Referenced by dist(). |
|
Returns the distance between two points (Euclidic norm):. Points x,y specified as arrays of size dim. See also DistEuclidic2(). Definition at line 1170 of file num_math.h. |
|
Returns the squared distance between two points (Euclidic norm):. Points x,y specified as arrays of size dim. See also DistEuclidic(). Definition at line 1156 of file num_math.h. |
|
Compute the scalar (dot) product of two vectors.
|
|
Compute the scalar (dot) product of two vectors.
Definition at line 194 of file vector2.h. Referenced by angle(), NUM::Plane3< T >::compute(), NUM::Plane3< T >::distance(), and IntersectTriangle(). |
|
Calculate dot product res=<a,b>.
Both vectors have the specified dimension dim. Definition at line 1283 of file num_math.h. |
|
(Faster) 3D version of DotProduct().
Definition at line 1290 of file num_math.h. |
|
|
|
|
|
|
|
Compare two vectors using specified epsilon value:
Definition at line 330 of file vector3.h. References fabs(). |
|
Compare two matrices using specified epsilon value:
Definition at line 373 of file omatrix.h. References fabs(). |
|
Compare two vectors using specified epsilon value:
Definition at line 203 of file vector2.h. References fabs(). |
|
Definition at line 390 of file num_math.h. |
|
Definition at line 404 of file num_math.h. |
|
Definition at line 436 of file num_math.h. |
|
|
Definition at line 457 of file num_math.h. References is_negative(), and y. |
|
Compute Fermi-Dirac (smooth) step function.
The Fermi-Dirac function is defined as:
The values are in range 0..1 with 0.5 for x=0. This function here uses t=1/T instead of T: FermiDirac(x,t) = 1/( 1 + exp(-x*t)) For t=0, the function is infinitly smooth (0.5 everywhere) while for t=infinity it is like the Heavyside function. There is another version which does not use t or T. Definition at line 1085 of file num_math.h. References FermiDirac(). |
|
Compute Fermi-Dirac (smooth) step function. FermiDirac(x) = 1/( 1 + exp(-x)) There is another version which provides a smoothness parameter t and an x-value; see there for more info. Definition at line 1064 of file num_math.h. Referenced by FermiDirac(). |
|
Return maximum entry, i.e. max{ a[0],...,a[dim-1] }. Returns 0 if dim=0. See also FindMinimum(), max(), min(). Definition at line 1186 of file num_math.h. References max(). |
|
Find minimum entry, i.e. min{ a[0],...,a[dim-1] }. See also FindMaximum(), max(), min(), FindMinimumIdx(). Definition at line 1200 of file num_math.h. References min(). |
|
Find index of smallest element. This is similar to FindMinimum() but returns the index instead of the value. Returns -1 of dim=0. Definition at line 1216 of file num_math.h. References min(). |
|
|
|
Definition at line 467 of file num_math.h. References y. |
|
|
|
|
|
|
|
|
|
Definition at line 509 of file num_math.h. |
|
Definition at line 508 of file num_math.h. |
|
Definition at line 507 of file num_math.h. Referenced by _Float2String(). |
|
gain function
Definition at line 86 of file functions.h. |
|
Numerically stable version of hypot().
Don't know if it is really needed or if hypot() is clever enough. Definition at line 980 of file num_math.h. |
|
Definition at line 426 of file num_math.h. |
|
|
|
|
|
Intersection of triangle with ray.
We present a clean algorithm for determining whether a ray intersects a triangle. The algorithm translates the origin of the ray and then changes the base to yield a vector (t u v)^T, where t is the distance to the plane in which the triangle lies and (u,v) represents the coordinates inside the triangle. One advantage of this method is that the plane equation need not be computed on the fly nor be stored, which can amount to significant memory savings for triangle meshes. As we found our method to be comparable in speed to previous methods, we believe it is the fastest ray-triangle intersection routine for triangles that do not have precomputed plane equations.
Definition at line 45 of file triangle.cc. |
|
Invert matrix.
|
|
Definition at line 374 of file num_math.h. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 354 of file num_math.h. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 210 of file num_math.h. |
|
Definition at line 208 of file num_math.h. |
|
Definition at line 206 of file num_math.h. |
|
Definition at line 199 of file num_math.h. References _constfn_. Referenced by cbrt(), copysign(), and fdim(). |
|
|
|
|
|
|
|
Definition at line 490 of file num_math.h. |
|
Definition at line 489 of file num_math.h. |
|
Definition at line 488 of file num_math.h. |
|
Compute length of a vector (Euclidic norm):.
Definition at line 295 of file vector3.h. References len2(). |
|
Compute length of a vector (Euclidic norm):.
Definition at line 176 of file vector2.h. Referenced by NUM::Plane3< T >::compute(), NormalizeVector(), and NormalizeVector2D(). |
|
Compute square of length (Euclidic norm) of a vector:.
|
|
Compute square of length (Euclidic norm) of a vector:.
Definition at line 173 of file vector2.h. Referenced by len(). |
|
Linear interpolation. There is another version available which is faster when 1-p is available or needed for several identical coordinates. Please see the other version lerp2() for more information about the parameters. Definition at line 1013 of file num_math.h. Referenced by NUM::NoiseGenerator_Perlin< T >::noise1(), NUM::NoiseGenerator_Perlin< T >::noise2(), and NUM::NoiseGenerator_Perlin< T >::noise3(). |
|
Linear interpolation. l,r define the left, right values, respectively; the linear interpolation will interpolate the value at the point p where p is in range 0..1. In case p=0, l will be returned, for p=1, r will be returned. p1 must be set to 1-p. There is another version available which calculates p1. Definition at line 1001 of file num_math.h. |
|
Compute linear combination va+ca + vb*cb + vc*cc.
|
|
Compute linear combination va+ca + vb*cb + vc.
|
|
Compute linear combination va+ca + vb*cb.
|
|
Compute linear combination va*ca + vb.
|
|
Compute linear combination va+ca + vb*cb + vc*cc.
|
|
Compute linear combination va+ca + vb*cb + vc.
|
|
Compute linear combination va+ca + vb*cb.
|
|
Compute linear combination va*ca + vb.
|
|
Definition at line 397 of file num_math.h. |
|
Definition at line 443 of file num_math.h. |
|
Definition at line 413 of file num_math.h. Referenced by bias(). |
|
|
|
|
|
Return the largest one of the 3 passed values.
Definition at line 923 of file num_math.h. References max(). |
|
Return the larger one of the two passed values. FP specialisation below.
Definition at line 268 of file num_math.h. Referenced by FindMaximum(), max(), NUM::PolyRootSolver_Sturm::sbisect(), and NUM::PolyRootSolver_Sturm::solve(). |
|
Return the smallest one of the 3 passed values.
Definition at line 926 of file num_math.h. References min(). |
|
Return the smaller one of the two passed values. FP specialisation below.
Definition at line 271 of file num_math.h. Referenced by FindMinimum(), FindMinimumIdx(), min(), NUM::PolyRootSolver_Sturm::sbisect(), and NUM::PolyRootSolver_Sturm::solve(). |
|
Definition at line 502 of file num_math.h. |
|
Definition at line 500 of file num_math.h. |
|
Definition at line 498 of file num_math.h. |
|
|
|
Return a normalized vector with length l:.
Definition at line 309 of file vector3.h. References NUM::Vector3< T >::len(). |
|
Return a normalized vector (length 1):.
Definition at line 306 of file vector3.h. References NUM::Vector3< T >::len(). |
|
Return a normalized vector with length l:.
Definition at line 190 of file vector2.h. References NUM::Vector2< T >::len(). |
|
Return a normalized vector (length 1):.
Definition at line 187 of file vector2.h. References NUM::Vector2< T >::len(). |
|
Normalize vector, i.e. scale it to length 1:. Normalisation is done by copying the vector array src[] to dest[] while dividing the components by the length.
Definition at line 1256 of file num_math.h. References len(), and NormEuclidic(). |
|
Normalize vector in-place, i.e. scale it to length 1:. The passed vector in array x[] of specified dimension is normalized thereby replacing the values in x[].
Definition at line 1239 of file num_math.h. References len(), and NormEuclidic(). |
|
Special version to normalize a 2D vector.
Definition at line 1265 of file num_math.h. References len(). |
|
Returns Euclidic norm of passed vector. Passed vector has dimenstion dim. The function calculates the square root of the sum of the squared elements of x[], i.e. the (Euclidic) length of the vector. See also: NormEuclidic2(). Definition at line 1141 of file num_math.h. Referenced by NormalizeVector(). |
|
Returns square of Euclidic norm of passed vector. Passed vector has dimenstion dim. The function calculates the the sum of the squared elements of x[], i.e. the squared (Euclidic) length of the vector. See also: NormEuclidic(). Definition at line 1125 of file num_math.h. References sqr(). |
|
|
|
|
|
Multiply vector with scalar:.
|
|
Multiply matrix with vector.
|
|
Multiply matrix with matrix:.
|
|
Multiply matrix with scalar:.
|
|
Multiply matrix with scalar:.
|
|
|
|
Multiply vector with scalar:.
|
|
Add 2 vectors:.
|
|
Add 2 matrices:.
|
|
Add 2 vectors:.
|
|
Subract 2 vectors:.
|
|
Subract 2 matrices:.
|
|
Subract 2 vectors:.
|
|
Divide vector by scalar. Better do multiplication with 1/b. |
|
Divide matrix by scalar. Better do multiplication with 1/b. |
|
Divide vector by scalar. Better do multiplication with 1/b. |
|
Evaluate polynomial of degree n.
I.e. compute
NOTE! Array c[] needs to be dimensioned c[n+1] since c[0]..c[n] are used. Definition at line 1304 of file num_math.h. Referenced by NUM::PolyRootSolver_Sturm::numchanges(), and NUM::PolyRootSolver_Sturm::sbisect(). |
|
x^y for FP x and integer y.
Definition at line 938 of file num_math.h. |
|
x^y in integer arithmetic. y MUST BE >=0.
Definition at line 930 of file num_math.h. |
|
the pulse function
Definition at line 62 of file functions.h. References step(). |
|
|
|
|
|
schlick's optimized bias function
Definition at line 78 of file functions.h. |
|
|
|
|
|
schlick's optimized gain function
Definition at line 96 of file functions.h. |
|
Return sign, i.e. -1, 0 or 1.
This is a relatively slow function. Better use something else. Definition at line 180 of file num_math.h. References _constfn_. |
|
Return sign -1 or +1 with 0 being positive.
Use sgn11() if you want to treat 0 as positive or if the value x is known not to be 0. Definition at line 191 of file num_math.h. References _constfn_. |
|
Referenced by is_negative(). |
|
|
|
Definition at line 482 of file num_math.h. Referenced by NUM::OMatrix< T >::OMatrix(). |
|
Returns x*x.
Definition at line 255 of file num_math.h. References _constfn_. Referenced by NUM::NoiseGenerator_Perlin< T >::_init(), dist2(), DistEuclidic(), DistEuclidic2(), hypot2(), NormEuclidic(), NormEuclidic2(), NUM::OMatrix< T >::OMatrix(), NUM::PolyRootSolver_Direct::Solve_2(), NUM::PolyRootSolver_Direct::Solve_3(), and NUM::PolyRootSolver_Direct::Solve_4(). |
|
step function
Definition at line 56 of file functions.h. Referenced by pulse(). |
|
Cubic interpolating step function.
Definition at line 1112 of file num_math.h. References StepLinear(). |
|
Linear interpolating step function.
Definition at line 1099 of file num_math.h. Referenced by StepCubic(). |
|
Check if the passed t values are increasing steadily. Actually, it checks if array[i]-array[i-1] <= val_eps.
Definition at line 1357 of file num_math.h. |
|
Transpose matrix (see transpose() member function!).
|
|
|
|
Initial value: { INIT_FIELD(macheps1) _ComputeMachEps1<dbl>(), INIT_FIELD(sqrt_macheps1) sqrt(_ComputeMachEps1<dbl>()), INIT_FIELD(macheps1_prec) _ComputeMachEps1_Prec<dbl>() }
Definition at line 55 of file macheps.cc. |
|
Initial value: { INIT_FIELD(macheps1) _ComputeMachEps1<flt>(), INIT_FIELD(sqrt_macheps1) sqrt(_ComputeMachEps1<flt>()), INIT_FIELD(macheps1_prec) _ComputeMachEps1_Prec<flt>() }
Definition at line 62 of file macheps.cc. |
|
Definition at line 316 of file num_math.h. Referenced by NUM::RandomNumberGenerator_MersenneTwister19937::_rand32(), copysign(), dabs(), DistEuclidic(), DistEuclidic2(), fdim(), fma(), NUM::NoiseGenerator_Base< T >::noise2(), NUM::NoiseGenerator_Base< T >::noise3(), powi(), powii(), NUM::Vector2< T >::Vector2(), and NUM::Vector3< T >::Vector3(). |