openTRI 0.1
|
Data Structures | |
struct | triVec4 |
4D float Vector (quaternion) More... | |
struct | triVec4S32 |
4D signed int Vector (quaternion) More... | |
struct | triVec4U32 |
4D unsigned int Vector More... | |
struct | triVec4S16 |
4D signed short Vector More... | |
struct | triVec4U16 |
4D unsigned short Vector More... | |
struct | triVec4S8 |
4D signed char Vector More... | |
struct | triVec4U8 |
4D unsigned char Vector More... | |
Typedefs | |
typedef struct triVec4 | triVec4 |
4D float Vector (quaternion) | |
typedef struct triVec4 | triVec4f |
typedef struct triVec4 | triQuat |
typedef struct triVec4S32 | triVec4S32 |
4D signed int Vector (quaternion) | |
typedef struct triVec4S32 | triVec4i |
typedef struct triVec4S32 | triQuati |
typedef struct triVec4U32 | triVec4U32 |
4D unsigned int Vector | |
typedef struct triVec4S16 | triVec4S16 |
4D signed short Vector | |
typedef struct triVec4U16 | triVec4U16 |
4D unsigned short Vector | |
typedef struct triVec4S8 | triVec4S8 |
4D signed char Vector | |
typedef struct triVec4U8 | triVec4U8 |
4D unsigned char Vector | |
Functions | |
triVec4f * | triVec4Set (triVec4f *a, const triFloat x, const triFloat y, const triFloat z, const triFloat w) |
triVec4f * | triVec4Set3 (triVec4f *a, const triFloat x, const triFloat y, const triFloat z) |
triVec4i * | triVec4Ceil (triVec4i *a, const triVec4f *b) |
triVec4i * | triVec4Trunc (triVec4i *a, const triVec4f *b) |
triVec4i * | triVec4Round (triVec4i *a, const triVec4f *b) |
triVec4i * | triVec4Floor (triVec4i *a, const triVec4f *b) |
triVec4f * | triVec4i2f (triVec4f *a, const triVec4i *b) |
triVec4f * | triVec4Rndn3 (triVec4f *a) |
Random normal vector. | |
triVec4f * | triVec4Rndn (triVec4f *a) |
Random normal vector. | |
triVec4f * | triVec4Rnd (triVec4f *a) |
Random vector. | |
triVec4f * | triVec4Rnd2 (triVec4f *a) |
Random vector. | |
triVec4f * | triVec4Add (triVec4f *a, const triVec4f *b, const triVec4f *c) |
Add Vectors. | |
triVec4f * | triVec4Add3 (triVec4f *a, const triVec4f *b, const triVec4f *c) |
Add Vectors. | |
triVec4f * | triVec4Sub (triVec4f *a, const triVec4f *b, const triVec4f *c) |
Subtract Vectors. | |
triVec4f * | triVec4Sub3 (triVec4f *a, const triVec4f *b, const triVec4f *c) |
Subtract Vectors. | |
triVec4f * | triVec4Mul (triVec4f *a, const triVec4f *b, const triVec4f *c) |
Multiply Vectors. | |
triVec4f * | triVec4Mul3 (triVec4f *a, const triVec4f *b, const triVec4f *c) |
Multiply Vectors. | |
triVec4f * | triVec4Div (triVec4f *a, const triVec4f *b, const triVec4f *c) |
Divide Vectors. | |
triVec4f * | triVec4Div3 (triVec4f *a, const triVec4f *b, const triVec4f *c) |
Divide Vectors. | |
triVec4f * | triVec4Neg (triVec4f *a, const triVec4f *b) |
Negate Vector. | |
triVec4f * | triVec4Neg3 (triVec4f *a, const triVec4f *b) |
Negate Vector. | |
triVec4f * | triVec4Abs (triVec4f *a, const triVec4f *b) |
Absolute of Vector. | |
triVec4f * | triVec4Clamp (triVec4f *a, const triVec4f *b, triFloat min, triFloat max) |
Clamp Vector. | |
triVec4f * | triVec4Clamp3 (triVec4f *a, const triVec4f *b, triFloat min, triFloat max) |
Clamp Vector. | |
triVec4f * | triVec4Min (triVec4f *a, const triVec4f *b, const triVec4f *c) |
Minimum of Vectors. | |
triVec4f * | triVec4Max (triVec4f *a, const triVec4f *b, const triVec4f *c) |
Maximum of Vectors. | |
triFloat | triVec4Sum (const triVec4f *a) |
Sum of components. | |
triFloat | triVec4Sum3 (const triVec4f *a) |
Sum of components. | |
triFloat | triVec4Avg (const triVec4f *a) |
Average of components. | |
triFloat | triVec4Avg3 (const triVec4f *a) |
Average of components. | |
triVec4f * | triVec4Sgn (triVec4f *a, const triVec4f *b) |
Vector sign. | |
triVec4f * | triVec4Normalize (triVec4f *a, const triVec4f *b) |
Normalize Vector. | |
triVec4f * | triVec4Normalize3 (triVec4f *a, const triVec4f *b) |
Normalize Vector. | |
triFloat | triVec4Length (const triVec4f *a) |
Length of Vector. | |
triFloat | triVec4Length3 (const triVec4f *a) |
Length of Vector. | |
triFloat | triVec4SquareLength (const triVec4f *a) |
Square length of Vector. | |
triFloat | triVec4SquareLength3 (const triVec4f *a) |
Square length of Vector. | |
triFloat | triVec4Dist (const triVec4f *a, const triVec4f *b) |
Distance between Vectors. | |
triFloat | triVec4Dist3 (const triVec4f *a, const triVec4f *b) |
Distance between Vectors. | |
triFloat | triVec4SquareDist (const triVec4f *a, const triVec4f *b) |
Square distance between Vectors. | |
triFloat | triVec4SquareDist3 (const triVec4f *a, const triVec4f *b) |
Square distance between Vectors. | |
triVec4f * | triVec4Lerp (triVec4f *a, const triVec4f *b, const triVec4f *c, triFloat t) |
Linear interpolate between Vectors. | |
triVec4f * | triVec4Lerp3 (triVec4f *a, const triVec4f *b, const triVec4f *c, triFloat t) |
Linear interpolate between Vectors. | |
triVec4f * | triVec4Scale (triVec4f *a, const triVec4f *b, triFloat t) |
Scale Vector. | |
triVec4f * | triVec4Scale3 (triVec4f *a, const triVec4f *b, triFloat t) |
Scale Vector. | |
triFloat | triVec4Dot (const triVec4f *a, const triVec4f *b) |
Calculate Vector dotproduct. | |
triFloat | triVec4Dot3 (const triVec4f *a, const triVec4f *b) |
Calculate Vector dotproduct. | |
triVec4f * | triVec4Cross (triVec4f *a, const triVec4f *b, const triVec4f *c) |
Calculate Vector crossproduct. | |
triVec4f * | triVec4Reflect (triVec4f *a, const triVec4f *b, const triVec4f *c) |
Reflect Vector. | |
triVec4f * | triVec4Refract (triVec4f *a, const triVec4f *b, const triVec4f *c, const triFloat eta) |
Refract Vector. | |
Random normal vector.
Creates a random unit vector lying on the 3D unit sphere. The fourth component lies in range [-1.0, 1.0[
a | - Pointer to destination vector |
Random normal vector.
Creates a random unit vector lying on the unit sphere.
a | - Pointer to destination vector |
Random vector.
Creates random components in range [0.0, 1.0[
a | - Pointer to destination vector |
Random vector.
Creates random components in range [-1.0, 1.0[
a | - Pointer to destination vector |
Add Vectors.
a = b.x+c.x | b.y+c.y | b.z+c.z | b.w+c.w
a | - Pointer to destination vector |
b | - Pointer to first source vector |
c | - Pointer to second source vector |
Add Vectors.
a = b.x+c.x | b.y+c.y | b.z+c.z | b.w
Vectors are treated as 3D vectors.
a | - Pointer to destination vector |
b | - Pointer to first source vector |
c | - Pointer to second source vector |
Subtract Vectors.
a = b.x-c.x | b.y-c.y | b.z-c.z | b.w-c.w
a | - Pointer to destination vector |
b | - Pointer to first source vector |
c | - Pointer to second source vector |
Subtract Vectors.
a = b.x-c.x | b.y-c.y | b.z-c.z | b.w
Vectors are treated as 3D vectors.
a | - Pointer to destination vector |
b | - Pointer to first source vector |
c | - Pointer to second source vector |
Multiply Vectors.
a = b.x*c.x | b.y*c.y | b.z*c.z | b.w*c.w
a | - Pointer to destination vector |
b | - Pointer to first source vector |
c | - Pointer to second source vector |
Multiply Vectors.
a = b.x*c.x | b.y*c.y | b.z*c.z | b.w
Vectors are treated as 3D vectors.
a | - Pointer to destination vector |
b | - Pointer to first source vector |
c | - Pointer to second source vector |
Divide Vectors.
a = b.x/c.x | b.y/c.y | b.z/c.z | b.w/c.w
a | - Pointer to destination vector |
b | - Pointer to first source vector |
c | - Pointer to second source vector |
Divide Vectors.
a = b.x/c.x | b.y/c.y | b.z/c.z | b.w
Vectors are treated as 3D vectors.
a | - Pointer to destination vector |
b | - Pointer to first source vector |
c | - Pointer to second source vector |
Negate Vector.
a = -b
a | - Pointer to destination vector |
b | - Pointer to source vector |
Negate Vector.
a = -b
Vectors are treated as 3D vectors.
a | - Pointer to destination vector |
b | - Pointer to source vector |
Absolute of Vector.
a = abs(b.x) | abs(b.y) | abs(b.z) | abs(b.w)
a | - Pointer to destination vector |
b | - Pointer to source vector |
Clamp Vector.
a = clamp(b.x,min,max) | clamp(b.y,min,max) | clamp(b.z,min,max) | clamp(b.w,min,max)
a | - Pointer to destination vector |
b | - Pointer to source vector |
min | - Minimum to clamp to |
max | - Maximum to clamp to |
Clamp Vector.
a = clamp(b.x,min,max) | clamp(b.y,min,max) | clamp(b.z,min,max) | b.w
a | - Pointer to destination vector |
b | - Pointer to source vector |
min | - Minimum to clamp to |
max | - Maximum to clamp to |
Minimum of Vectors.
a = min(b.x,c.x) | min(b.y,c.y) | min(b.z,c.z) | min(b.w,c.w)
a | - Pointer to destination vector |
b | - Pointer to first source vector |
c | - Pointer to second source vector |
Maximum of Vectors.
a = max(b.x,c.x) | max(b.y,c.y) | max(b.z,c.z) | max(b.w,c.w)
a | - Pointer to destination vector |
b | - Pointer to first source vector |
c | - Pointer to second source vector |
triFloat triVec4Sum | ( | const triVec4f * | a | ) |
Sum of components.
return (a.x + a.y + a.z + a.w)
a | - Pointer to source vector |
triFloat triVec4Sum3 | ( | const triVec4f * | a | ) |
Sum of components.
return (a.x + a.y + a.z)
Vectors are treated as 3D vectors.
a | - Pointer to source vector |
triFloat triVec4Avg | ( | const triVec4f * | a | ) |
Average of components.
return (a.x + a.y + a.z + a.w)/4
a | - Pointer to source vector |
triFloat triVec4Avg3 | ( | const triVec4f * | a | ) |
Average of components.
return (a.x + a.y + a.z)/3
Vectors are treated as 3D vectors.
a | - Pointer to source vector |
Vector sign.
a = sgn(b.x) | sgn(b.y) | sgn(b.z) | sgn(b.w)
a | - Pointer to destination vector |
b | - Pointer to source vector |
Normalize Vector.
a = b / sqrt(b.b)
a | - Pointer to destination vector |
b | - Pointer to source vector |
Normalize Vector.
a = b / sqrt(b.b)
Vectors are treated as 3D vectors.
a | - Pointer to destination vector |
b | - Pointer to source vector |
triFloat triVec4Length | ( | const triVec4f * | a | ) |
Length of Vector.
return sqrt( a.a )
a | - Pointer to source vector |
triFloat triVec4Length3 | ( | const triVec4f * | a | ) |
Length of Vector.
return sqrt( a.a )
Vectors are treated as 3D vectors.
a | - Pointer to source vector |
triFloat triVec4SquareLength | ( | const triVec4f * | a | ) |
Square length of Vector.
return a.a
a | - Pointer to source vector |
triFloat triVec4SquareLength3 | ( | const triVec4f * | a | ) |
Square length of Vector.
return a.a
Vectors are treated as 3D vectors.
a | - Pointer to source vector |
Distance between Vectors.
return sqrt( (b-a).(b-a) )
a | - Pointer to first source vector |
b | - Pointer to second source vector |
Distance between Vectors.
return sqrt( (b-a).(b-a) )
Vectors are treated as 3D vectors.
a | - Pointer to first source vector |
b | - Pointer to second source vector |
Square distance between Vectors.
return (b-a).(b-a)
a | - Pointer to first source vector |
b | - Pointer to second source vector |
Square distance between Vectors.
return (b-a).(b-a)
Vectors are treated as 3D vectors.
a | - Pointer to first source vector |
b | - Pointer to second source vector |
Linear interpolate between Vectors.
a = b * (1 - t) + c * t
a | - Pointer to destination vector |
b | - Pointer to first source vector |
c | - Pointer to second source vector |
t | - Scalar to interpolate with |
Linear interpolate between Vectors.
a = b * (1 - t) + c * t
Vectors are treated as 3D vectors.
a | - Pointer to destination vector |
b | - Pointer to first source vector |
c | - Pointer to second source vector |
t | - Scalar to interpolate with |
Scale Vector.
a = b * t
a | - Pointer to destination vector |
b | - Pointer to source vector |
t | - Scalar to scale b with |
Scale Vector.
a = b * t
Vectors are treated as 3D vectors.
a | - Pointer to destination vector |
b | - Pointer to source vector |
t | - Scalar to scale b with |
Calculate Vector dotproduct.
return a.b
a | - Pointer to first source vector |
b | - Pointer to second source vector |
Calculate Vector dotproduct.
return a.b
Vectors are treated as 3D vectors.
a | - Pointer to first source vector |
b | - Pointer to second source vector |
Calculate Vector crossproduct.
a = b x c
Vectors are treated as 3D vectors.
a | - Pointer to destination vector |
b | - Pointer to first source vector |
c | - Pointer to second source vector |
Reflect Vector.
Reflect b on the normale c. a = b - 2*(b.c)*c
Vectors are treated as 3D vectors.
a | - Pointer to destination vector |
b | - Pointer to incoming vector |
c | - Pointer to surface normale |
triVec4f * triVec4Refract | ( | triVec4f * | a, |
const triVec4f * | b, | ||
const triVec4f * | c, | ||
const triFloat | eta ) |
Refract Vector.
Refract b on the normale c as in Snell's law - eta = n1/n2.
Vectors are treated as 3D vectors.
a | - Pointer to destination vector |
b | - Pointer to incoming vector |
c | - Pointer to surface normale |
eta | - Relative refraction index n1/n2 |