Macros | |
#define | MATH_VECTOR |
#define | MATH_COLOR |
#define | MATH_MATRIX |
#define | MATH_SQUAREMATRIX |
#define | MATH_VECTOR2 |
#define | MATH_MATRIX2 |
#define | MATH_SQUAREMATRIX2 |
#define | SIZEOF(...) |
#define | COORDINATESYSTEM_LEFT_HANDED |
Enumerations | |
enum class | ROTATIONORDER { ZXYGLOBAL , ZYXGLOBAL , YXZGLOBAL , YZXGLOBAL , XZYGLOBAL , XYZGLOBAL , YXZLOCAL , XYZLOCAL , ZXYLOCAL , XZYLOCAL , YZXLOCAL , ZYXLOCAL } |
enum class | TIMEFORMAT { SECONDS , FRAMES , SMPTE , SMPTE_DROPFRAMES } |
enum class | METRICUNIT { NONE , KM , M , CM , MM , UM , NM , MILE , YARD , FEET , INCH } |
enum class | ANGLEUNIT { DEGREE , RADIANS } |
#define MATH_VECTOR |
#define MATH_COLOR |
#define MATH_MATRIX |
#define MATH_SQUAREMATRIX |
#define MATH_VECTOR2 |
#define MATH_MATRIX2 |
#define MATH_SQUAREMATRIX2 |
#define SIZEOF | ( | ... | ) |
Calculates the size of a datatype or element.
#define COORDINATESYSTEM_LEFT_HANDED |
Major control to define the used coordinate system. So far C4D runs only with left-handed coordinates.
using UIntegerBase = UInt32 |
using NativeUInteger = UInteger<SIZEOF(Int) * 8> |
using TransformColorDelegate32 = Delegate<Color32(const Color32&)> |
using TransformColorDelegate64 = Delegate<Color64(const Color64&)> |
using TransformValueDelegate32 = Delegate<Float32(const Float32&)> |
using TransformValueDelegate64 = Delegate<Float64(const Float64&)> |
using SquareMatrix32 = SqrMat3<Vector32> |
Single-precision 3×3 matrix.
using SquareMatrix64 = SqrMat3<Vector64> |
Double-precision 3×3 matrix.
using SquareMatrix = SqrMat3<Vector> |
3×3 matrix with the precision of Float.
Single-Precision Matrix.
The matrix has a dimension of 4×4 and consists of four rows and four columns. The first row is always "1, 0, 0, 0" and not stored in the class, which means that there are 12 actual numbers used. These numbers are grouped into four vectors, one for the remaining numbers in each column. The four vectors are called off, v1, v2 and v3, together these four vectors can be used to represent the coordinate system. A coordinate system consists of three axes, one for each coordinate (X, Y and Z). The system also has a base position, from which the three axes originate. This base position is stored in off, and the three axis vectors are stored in v1, v2 and v3 respectively. For a rectangular, normalized matrix v3 equals the cross product of v1 and v2 (v1v2). C4D by default uses a left-handed coordinate system (see define COORDINATESYSTEM_LEFT_HANDED).
Double-Precision Matrix.
The matrix has a dimension of 4×4 and consists of four rows and four columns. The first row is always "1, 0, 0, 0" and not stored in the class, which means that there are 12 actual numbers used. These numbers are grouped into four vectors, one for the remaining numbers in each column. The four vectors are called off, v1, v2 and v3, together these four vectors can be used to represent the coordinate system. A coordinate system consists of three axes, one for each coordinate (X, Y and Z). The system also has a base position, from which the three axes originate. This base position is stored in off, and the three axis vectors are stored in v1, v2 and v3 respectively. For a rectangular, normalized matrix v3 equals the cross product of v1 and v2 (v1v2). C4D by default uses a left-handed coordinate system (see define COORDINATESYSTEM_LEFT_HANDED).
Matrix with the precision of Float.
The matrix has a dimension of 4×4 and consists of four rows and four columns. The first row is always "1, 0, 0, 0" and not stored in the class, which means that there are 12 actual numbers used. These numbers are grouped into four vectors, one for the remaining numbers in each column. The four vectors are called off, v1, v2 and v3, together these four vectors can be used to represent the coordinate system. A coordinate system consists of three axes, one for each coordinate (X, Y and Z). The system also has a base position, from which the three axes originate. This base position is stored in off, and the three axis vectors are stored in v1, v2 and v3 respectively. For a rectangular, normalized matrix v3 equals the cross product of v1 and v2 (v1v2). C4D by default uses a left-handed coordinate system (see define COORDINATESYSTEM_LEFT_HANDED).
using SquareMatrix2d32 = SqrMat2<Vector2d32> |
Single-precision 2×2 matrix.
using SquareMatrix2d64 = SqrMat2<Vector2d64> |
Double-precision 2×2 matrix.
using SquareMatrix2d = SqrMat2<Vector2d> |
2×2 matrix with the precision of Float.
using Matrix2d32 = Mat2<Vector2d32> |
Single-Precision Matrix. The matrix has a dimension of 3×3 and consists of three rows and three columns. The first row is always "1, 0, 0" and not stored in the class, which means that there are 6 actual numbers used. These numbers are grouped into three vectors, one for the remaining numbers in each column. The three vectors are called off, v1 and v2, together these three vectors can be used to represent the coordinate system. A coordinate system consists of two axes, one for each coordinate (X and Y). The system also has a base position, from which the two axes originate. This base position is stored in off, and the two axis vectors are stored in v1 and v2 respectively
using Matrix2d64 = Mat2<Vector2d64> |
Double-Precision Matrix. The matrix has a dimension of 3×3 and consists of three rows and three columns. The first row is always "1, 0, 0" and not stored in the class, which means that there are 6 actual numbers used. These numbers are grouped into three vectors, one for the remaining numbers in each column. The three vectors are called off, v1 and v2, together these three vectors can be used to represent the coordinate system. A coordinate system consists of two axes, one for each coordinate (X and Y). The system also has a base position, from which the two axes originate. This base position is stored in off, and the two axis vectors are stored in v1 and v2 respectively
Matrix with the precision of Float. The matrix has a dimension of 3×3 and consists of three rows and three columns. The first row is always "1, 0, 0" and not stored in the class, which means that there are 6 actual numbers used. These numbers are grouped into three vectors, one for the remaining numbers in each column. The three vectors are called off, v1 and v2, together these three vectors can be used to represent the coordinate system. A coordinate system consists of two axes, one for each coordinate (X and Y). The system also has a base position, from which the two axes originate. This base position is stored in off, and the two axis vectors are stored in v1 and v2 respectively
using SquareMatrix4d32 = SqrMat4<Vector4d32> |
Single-Precision Matrix.
using SquareMatrix4d64 = SqrMat4<Vector4d64> |
Double-Precision Matrix.
using SquareMatrix4d = SqrMat4<Vector4d> |
Matrix with the precision of Float.
using IntFrame = Range<IntVector2d> |
Range with the precision of Int.
Single-Precision Vector. A vector contains three components X, Y and Z
Double-Precision Vector. A vector contains three components X, Y and Z
Vector with the precision of Float. A vector contains three components X, Y and Z
using IntVector32 = Vec3<Int32, 1> |
32-bit Int Vector. A vector contains three components X, Y and Z
using UIntVector32 = Vec3<UInt32, 1> |
32-bit UInt Vector. A vector contains three components X, Y and Z
using IntVector64 = Vec3<Int64, 1> |
64-bit Int Vector. A vector contains three components X, Y and Z
Single-Precision Color. A color contains three components R, G and B
Double-Precision Color. A color contains three components R, G and B
Color with the precision of Float. A color contains three components R, G and B
using GenericVector = Vec3<GenericArithmetic, 1> |
Generic arithmetic vector type.
using Vector2d32 = Vec2<Float32, 1> |
Single-Precision Vector. A vector contains two components X and Y
using Vector2d64 = Vec2<Float64, 1> |
Double-Precision Vector. A vector contains two components X and Y
Vector with the precision of Float. A vector contains two components X and Y
using IntVector2d32 = Vec2<Int32, 1> |
32-bit Int Vector. A vector contains three components X, Y and Z
using UIntVector2d32 = Vec2<UInt32, 1> |
32-bit UInt Vector. A vector contains three components X, Y and Z
using IntVector2d64 = Vec2<Int64, 1> |
64-bit Int Vector. A vector contains three components X, Y and Z
using UIntVector2d64 = Vec2<UInt64, 1> |
64-bit UInt Vector. A vector contains three components X, Y and Z
using IntVector2d = Vec2<Int, 1> |
Vector of Int. A vector contains three components X, Y and Z
using GenericVector2d = Vec2<GenericArithmetic, 1> |
Generic arithmetic vector type.
using Vector4d32 = Vec4<Float32, 1> |
Single-Precision Vector. A vector contains three components X, Y, Z and W
using Vector4d64 = Vec4<Float64, 1> |
Double-Precision Vector. A vector contains three components X, Y, Z and W
Vector with the precision of Float. A vector contains four components X, Y, Z and W
using IntVector4d32 = Vec4<Int32, 1> |
32-bit Int Vector. A vector contains four components X, Y, Z and W
using IntVector4d64 = Vec4<Int64, 1> |
64-bit Int Vector. A vector contains four components X, Y, Z and W
using IntVector4d = Vec4<Int, 1> |
Vector of Int. A vector contains four components X, Y, Z and W
Single-Precision Color with Alpha. A color contains three components R, G, B and A
Double-Precision Color with Alpha. A color contains three components R, G, B and A
Color with Alpha with the precision of Float. A color contains four components R, G, B and A
using GenericVector4d = Vec4<GenericArithmetic, 1> |
Generic arithmetic vector type.
using FbmTableRef = OpaqueRef |
using FbmTablePtr = OpaqueBase const* |
|
strong |
Defines in which order rotations are executed. Global means that the rotation will always be done around the world axes. Local means that the rotation will always be done around an already rotated axis of an axis system. For each global rotation there is a local counterpart and vice versa. All rotations are done so that a positive angle rotates counter-clockwise (when the rotation axis is facing towards the viewer).
Enumerator | |
---|---|
ZXYGLOBAL | |
ZYXGLOBAL | |
YXZGLOBAL | |
YZXGLOBAL | |
XZYGLOBAL | |
XYZGLOBAL | |
YXZLOCAL | |
XYZLOCAL | |
ZXYLOCAL | |
XZYLOCAL | |
YZXLOCAL | |
ZYXLOCAL |
|
strong |
format in which time values are displayed
Enumerator | |
---|---|
SECONDS | display time in seconds |
FRAMES | display time as a frame number |
SMPTE | display time as SMPTE time code |
SMPTE_DROPFRAMES | display clock time as SMPTE time code (see here for information on drop frames) |
|
strong |
|
strong |
Int maxon::Clz | ( | T | x | ) |
Counts the number of leading zero bits of x
. If x
is zero, the bit width of T
is returned. Note that the result depends on the bit width, i.e., Clz((Int16) 0xff) will return 8, while Clz((Int32) 0xff) will return 24.
[in] | x | Value of which leading zero bits shall be counted. |
T | Type of x , this has to be an integral type. |
x
. Int maxon::Ctz | ( | T | x | ) |
Counts the number of trailing zero bits of x
. If x
is zero, the 0 is returned.
[in] | x | Value of which trailing zero bits shall be counted. |
T | Type of x , this has to be an integral type. |
x
. Compare two floating point values according to a given epsilon.
Compare two floating point values according to a given epsilon.
Compare two floating point values.
Compare two floating point values.
Tests if a floating point number is valid.
Tests if a floating point number is valid.
Repair floating point number. Only NANs and Infinity are corrected - denormalized numbers stay unchanged
Repair floating point number. Only NANs and Infinity are corrected - denormalized numbers stay unchanged
calculates the relative position of x in the range [lowerLimit..upperLimit]. if x <= lowerLimit the return value is 0.0, if x >= upperLimit it is 1.0, otherwise the relative position: (x - lowerLimit) / (upperLimit - lowerLimit)
calculates the relative position of x in the range [lowerLimit..upperLimit]. if x <= lowerLimit the return value is 0.0, if x >= upperLimit it is 1.0, otherwise the relative position: (x - lowerLimit) / (upperLimit - lowerLimit)
identical to Boxstep, but with a soft curve instead of linear behaviour in the range of [lowerLimit..upperLimit].
identical to Boxstep, but with a soft curve instead of linear behaviour in the range of [lowerLimit..upperLimit].
Calculates the modulo of two floating point values. If the first value is positive, it behaves like a regular C++ modulo. Below zero the results are different though as the modulo continues to operate like in the positive domain: e.g. -1 % 7 = 6 or -8 % 7 = 6.
[in] | a | Positive or negative value. |
[in] | b | This value must be positive, otherwise the return value will be zero. |
Calculates the modulo of two floating point values. If the first value is positive, it behaves like a regular C++ modulo. Below zero the results are different though as the modulo continues to operate like in the positive domain: e.g. -1 % 7 = 6 or -8 % 7 = 6.
[in] | a | Positive or negative value. |
[in] | b | This value must be positive, otherwise the return value will be zero. |
Calculates the modulo of two integer values. If the first value is positive, it behaves like a regular C++ modulo. Below zero the results are different though as the modulo continues to operate like in the positive domain: e.g. -1 % 7 = 6 or -8 % 7 = 6.
[in] | a | Positive or negative value. |
[in] | b | This value must be positive, otherwise the return value will be zero. |
Calculates the modulo of two integer values. If the first value is positive, it behaves like a regular C++ modulo. Below zero the results are different though as the modulo continues to operate like in the positive domain: e.g. -1 % 7 = 6 or -8 % 7 = 6.
[in] | a | Positive or negative value. |
[in] | b | This value must be positive, otherwise the return value will be zero. |
returns Floor for positive values and zero or Ceil for negative values
returns Floor for positive values and zero or Ceil for negative values
Returns true if a1*a2
is less than b1*b2
. The products and the comparison are carried out with the double bit width of Int
so that no overflow occurs.
[in] | a1 | First factor of first comparison operand. |
[in] | a2 | Second factor of first comparison operand. |
[in] | b1 | First factor of second comparison operand. |
[in] | b2 | Second factor of second comparison operand. |
a1*a2 < b1*b2
. SqrMat3<Vec3<FLOAT> > maxon::VectorToSquareMatrix | ( | const Vec3< FLOAT > & | dirVector, |
const Vec3< FLOAT > & | upVector | ||
) |
Convert a facing direction and up direction to a square matrix.
FLOAT | The vector's internal type. |
[in] | dirVector | The matrix's z axis. |
[in] | upVector | World's up vector used to calculate matrix. |
SqrMat3<Vec3<FLOAT> > maxon::CheckedVectorToSquareMatrix | ( | const Vec3< FLOAT > & | dirVector, |
const Vec3< FLOAT > & | upVector | ||
) |
Mat3<Vec3<FLOAT> > maxon::VectorToMatrix | ( | const Vec3< FLOAT > & | dirVector, |
const Vec3< FLOAT > & | upVector | ||
) |
Convert a facing direction and up direction to a matrix.
FLOAT | The vector's internal type. |
[in] | dirVector | The matrix's z axis. |
[in] | upVector | World's up vector used to calculate matrix. |
Calculates a matrix to move / translate.
Calculates a matrix to scale.
Calculates a matrix to rotate around the X axis. A positive angle rotates counter-clockwise (when the rotation axis is facing towards the viewer).
Calculates a matrix to rotate around the Y axis. A positive angle rotates counter-clockwise (when the rotation axis is facing towards the viewer).
Calculates a matrix to rotate around the Z axis. A positive angle rotates counter-clockwise (when the rotation axis is facing towards the viewer).
Calculates a matrix to move / translate.
Calculates a matrix to scale.
Calculates a rotation matrix. A positive angle rotates counter-clockwise. Note that the 2d rotation is different from the GetRotationMatrixZ rotation in 3d - the latter one rotates looking onto the axis, thus clockwise if you look from the front.
enum maxon::ROTATIONORDER maxon::MAXON_ENUM_LIST | ( | ROTATIONORDER | ) |
Vec3<FLOAT> maxon::GetRotationAngles | ( | const SqrMat3< Vec3< FLOAT >> & | m, |
ROTATIONORDER | rotationOrder | ||
) |
Calculates rotation values of a matrix.
[in] | m | Matrix. The axes do not need to be normalized, but should be perpendicular. The 'offset' component has no influence on the outcome. |
[in] | rotationOrder | Rotation order in which the rotations shall be executed. |
Vec3<FLOAT> maxon::GetRotationAngles | ( | const Vec3< FLOAT > & | direction, |
ROTATIONORDER | rotationOrder | ||
) |
Calculates a rotation from a given direction vector.
[in] | direction | Direction vector, does not need to be normalized. The direction vector defines the first rotation axis of any (global) rotation order. So, e.g. for ROTATIONORDER::XYZGLOBAL 'direction' defines the +X direction. |
[in] | rotationOrder | Rotation order in which the rotations shall be executed. |
SqrMat3<Vec3<FLOAT> > maxon::GetRotationMatrix | ( | const Vec3< FLOAT > & | rotation, |
ROTATIONORDER | rotationOrder | ||
) |
Constructs a rotation matrix from a given rotation. A positive angle rotates counter-clockwise (when the rotation axis is facing towards the viewer).
[in] | rotation | Rotation value that is interpreted depending on the rotation order. |
[in] | rotationOrder | Rotation order in which the rotations shall be executed. |
Mat3<Vec3<FLOAT> > maxon::GetPSRMatrix | ( | const Vec3< FLOAT > & | position, |
const Vec3< FLOAT > & | scale, | ||
const Vec3< FLOAT > & | rotation, | ||
ROTATIONORDER | rotationOrder | ||
) |
Constructs a matrix from a given position, scale and rotation. A positive angle rotates counter-clockwise (when the rotation axis is facing towards the viewer).
[in] | position | Translation value (offset of the resulting matrix). |
[in] | scale | Scale value (length of the resulting axes). |
[in] | rotation | Rotation value that is interpreted depending on the rotation order. |
[in] | rotationOrder | Rotation order in which the rotations shall be executed. |
Vec3<FLOAT> maxon::GetOptimumRotation | ( | const Vec3< FLOAT > & | oldRotation, |
const Vec3< FLOAT > & | newRotation, | ||
ROTATIONORDER | rotationOrder | ||
) |
Corrects a new rotational value to match an old one as close as possible. This will avoid singularity effects (sudden 'flips' when a rotation jumps from 360 to 0 degrees).
[in] | oldRotation | Last rotation value. |
[in] | newRotation | New rotation value that needs to be corrected. |
[in] | rotationOrder | Rotation order in which the rotations shall be executed. |
Vec3<FLOAT> maxon::GetClosestPointOnLine | ( | const Vec3< FLOAT > & | lineOrigin, |
const Vec3< FLOAT > & | lineDirection, | ||
const Vec3< FLOAT > & | point | ||
) |
Calculates the closest point on a line.
[in] | lineOrigin | The starting point of the line. |
[in] | lineDirection | The direction vector of the line (does not need to be normalized) |
[in] | point | The point. |
FLOAT maxon::GetPointLineDistance | ( | const Vec3< FLOAT > & | lineOrigin, |
const Vec3< FLOAT > & | lineDirection, | ||
const Vec3< FLOAT > & | point | ||
) |
Calculates the distance of a point and a line.
[in] | lineOrigin | The starting point of the line. |
[in] | lineDirection | The direction vector of the line (does not need to be normalized) |
[in] | point | The point. |
Reflects a ray on a surface.
[in] | direction | The direction of the ray, must be normalized. |
[in] | normal | Surface normal, must be normalized. |
Converts RGB into HSV color space.
[in] | color | The RGB color (with r/g/b >= 0.0) |
Converts HSV into RGB color space.
[in] | color | The HSV (hue, saturation, value) color (with h/s/v >= 0.0) |
Converts RGB into HSL color space.
[in] | color | The RGB color (with r/g/b >= 0.0) |
Converts HSL into RGB color space.
[in] | color | The HSL (hue, saturation, lightness) color (with h/s/l >= 0.0) |
void maxon::GetRotationAxis | ( | const SqrMat3< Vec3< FLOAT >> & | m, |
Vec3< FLOAT > & | axisVector, | ||
FLOAT & | axisRotation | ||
) |
Calculates axis and rotation from a matrix. A positive angle rotates counter-clockwise (when the rotation axis is facing towards the viewer).
[in] | m | Matrix with perpendicular vectors. Its vectors do not need to be normalized. |
[out] | axisVector | The calculated axis (normalized vector) |
[out] | axisRotation | The calculated rotation. If the matrix was singular a null vector will be returned for axisVector. |
SqrMat3<Vec3<FLOAT> > maxon::GetRotationMatrixFromAxis | ( | const Vec3< FLOAT > & | axisVector, |
FLOAT | axisRotation | ||
) |
Calculates matrix from axis and rotation. A positive angle rotates counter-clockwise (when the rotation axis is facing towards the viewer).
[in] | axisVector | Axis vector, does not need to be normalized. |
[in] | axisRotation | The rotation. |
Bool maxon::IsMatrixRectangular | ( | const MATRIXTYPE & | m, |
typename MATRIXTYPE::ValueType | epsilon = 1e-10_f |
||
) |
Verify if matrix is orthogonal.
MATRIXTYPE | The Matrix type, 32 or 64. |
[in] | m | Matrix to verify. |
[in] | epsilon | Allowed epsilon. |
MAXON_ATTRIBUTE_FORCE_INLINE std::remove_reference<ITERABLETYPE>::type::ValueType maxon::GetSum | ( | ITERABLETYPE && | array | ) |
Returns the sum of all elements.
MAXON_ATTRIBUTE_FORCE_INLINE std::remove_reference<ITERABLETYPE>::type::ValueType maxon::GetAverage | ( | ITERABLETYPE && | array | ) |
Returns the average of all elements.
Mat3<typename MultiplicativePromotion<V, typename V2::ValueType>::type> maxon::operator* | ( | const SqrMat3< V > & | m, |
const Mat3< V2 > & | m2 | ||
) |
Multiplies two matrices. The rule is m1 AFTER m2 If you transform a point with the result matrix this is identical to first transforming with m2 and then with m1
Mat2<typename MultiplicativePromotion<V, typename V2::ValueType>::type> maxon::operator* | ( | const SqrMat2< V > & | m, |
const Mat2< V2 > & | m2 | ||
) |
Multiplies two matrices. The rule is m1 AFTER m2 If you transform a point with the result matrix this is identical to first transforming with m2 and then with m1
T maxon::PrivateRangeValueTypeHelper | ( | OverloadRank0 | ) |
T::ValueType maxon::PrivateRangeValueTypeHelper | ( | OverloadRank1 | ) |
Result<DataType> maxon::PrivateGetDataType | ( | Range< T > ** | , |
OverloadRank0 | |||
) |
enum maxon::TIMEFORMAT maxon::MAXON_ENUM_LIST | ( | TIMEFORMAT | ) |
Literal to allow definition of hours.
Literal to allow definition of minutes.
Literal to allow definition of seconds.
|
constexpr |
Literal to allow definition of milliseconds.
|
constexpr |
Literal to allow definition of microseconds.
|
constexpr |
Literal to allow definition of nanoseconds.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Clamp01 | ( | Float32 | a | ) |
Clip a floating point number against the lower limit 0 and the upper limit 1. The result will be returned.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Clamp01 | ( | Float64 | a | ) |
Clip a floating point number against the lower limit 0 and the upper limit 1. The result will be returned.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Sin | ( | Float32 | val | ) |
Calculates the sine of a value.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Sin | ( | Float64 | val | ) |
Calculates the sine of a value.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Cos | ( | Float32 | val | ) |
Calculates the cosine of a value.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Cos | ( | Float64 | val | ) |
Calculates the cosine of a value.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Tan | ( | Float32 | val | ) |
Calculates the tangent of a value. Note that the input needs to be checked for proper range, so that no exceptions will be generated.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Tan | ( | Float64 | val | ) |
Calculates the tangent of a value. Note that the input needs to be checked for proper range, so that no exceptions will be generated.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::ATan | ( | Float32 | val | ) |
Calculates the arcustangens of a value.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::ATan | ( | Float64 | val | ) |
Calculates the arcustangens of a value.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::ATan2 | ( | Float32 | valY, |
Float32 | valX | ||
) |
Calculates the arcustangens2 of a value. Returns the principal value of the arc tangent of y/x, expressed in radians. To compute the value, the function takes into account the sign of both arguments in order to determine the quadrant. If x is zero, depending on the sign of y +/- PI05 is returned. If x and y are both zero the function returns zero.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::ATan2 | ( | Float64 | valY, |
Float64 | valX | ||
) |
Calculates the arcustangens2 of a value. Returns the principal value of the arc tangent of y/x, expressed in radians. To compute the value, the function takes into account the sign of both arguments in order to determine the quadrant. If x is zero, depending on the sign of y +/- PI05 is returned. If x and y are both zero the function returns zero.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Exp | ( | Float32 | val | ) |
Calculates e^value.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Exp | ( | Float64 | val | ) |
Calculates e^value.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Exp2 | ( | Float32 | val | ) |
Returns the base-2 exponential function of x, which is 2 raised to the power x: 2x.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Exp2 | ( | Float64 | val | ) |
Returns the base-2 exponential function of x, which is 2 raised to the power x: 2x.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Ln | ( | Float32 | val | ) |
Calculates logarithm of a value. Note that the input needs to be positive, so that no exceptions will be generated.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Ln | ( | Float64 | val | ) |
Calculates logarithm of a value. Note that the input needs to be positive, so that no exceptions will be generated.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Log10 | ( | Float32 | val | ) |
Calculates logarithm with base 10 of a value. Note that the input needs to be positive, so that no exceptions will be generated.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Log10 | ( | Float64 | val | ) |
Calculates logarithm with base 10 of a value. Note that the input needs to be positive, so that no exceptions will be generated.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Log2 | ( | Float32 | val | ) |
Calculates logarithm with base 2 of a value. Note that the input needs to be positive, so that no exceptions will be generated.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Log2 | ( | Float64 | val | ) |
Calculates logarithm with base 2 of a value. Note that the input needs to be positive, so that no exceptions will be generated.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Sqrt | ( | Float32 | val | ) |
Calculates square root of a value. Note that the input must not be be negative, so that no exceptions will be generated.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Sqrt | ( | Float64 | val | ) |
Calculates square root of a value. Note that the input must not be be negative, so that no exceptions will be generated.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Floor | ( | Float32 | val | ) |
Rounds to the largest previous integer number.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Floor | ( | Float64 | val | ) |
Rounds to the largest previous integer number.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Ceil | ( | Float32 | val | ) |
Rounds to the smallest following integer number.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Ceil | ( | Float64 | val | ) |
Rounds to the smallest following integer number.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Round | ( | Float32 | val | ) |
Rounds to the nearest integer number.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Round | ( | Float64 | val | ) |
Rounds to the nearest integer number.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Pow | ( | Float32 | v1, |
Float32 | v2 | ||
) |
Calculates v1^v2.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Pow | ( | Float64 | v1, |
Float64 | v2 | ||
) |
Calculates v1^v2.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Sinh | ( | Float32 | val | ) |
Calculates hyperbolic sine.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Sinh | ( | Float64 | val | ) |
Calculates hyperbolic sine.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Cosh | ( | Float32 | val | ) |
Calculates hyperbolic cosine.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Cosh | ( | Float64 | val | ) |
Calculates hyperbolic cosine.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Tanh | ( | Float32 | val | ) |
Calculates hyperbolic tangent.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Tanh | ( | Float64 | val | ) |
Calculates hyperbolic tangent.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::FMod | ( | Float32 | v1, |
Float32 | v2 | ||
) |
Calculates floating point modulo.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::FMod | ( | Float64 | v1, |
Float64 | v2 | ||
) |
Calculates floating point modulo.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Abs | ( | Float32 | val | ) |
Calculates the absolute value of a floating point number.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Abs | ( | Float64 | val | ) |
Calculates the absolute value of a floating point number.
|
constexpr |
Calculates the reciprocal value (multiplicative inverse). If the input value is zero, zero will be returned for safety to avoid exceptions.
|
constexpr |
Calculates the reciprocal value (multiplicative inverse). If the input value is zero, zero will be returned for safety to avoid exceptions.
|
constexpr |
Calculates the absolute value of any data type.
|
constexpr |
Calculates the minimum of two values and return it.
|
constexpr |
Calculates the maximum of two values and return it.
MAXON_ATTRIBUTE_FORCE_INLINE void maxon::Swap | ( | X & | a, |
X & | b | ||
) |
Swaps two values. If available, move semantics will be used.
MAXON_ATTRIBUTE_FORCE_INLINE X maxon::ClampValue | ( | X | value, |
X | lowerLimit, | ||
X | upperLimit | ||
) |
Clips a value against a lower and upper limit. The new value is returned.
MAXON_ATTRIBUTE_FORCE_INLINE X maxon::Blend | ( | const X & | value1, |
const X & | value2, | ||
Y | blendValue | ||
) |
Blends two values. If blendValue is 0.0 value1 is returned, if blendValue is 1.0 value2 is returned. No clipping below 0.0 or 1.0 takes place (in that case use BoxStep).
MAXON_ATTRIBUTE_FORCE_INLINE X maxon::Sqr | ( | X | a, |
X | b | ||
) |
Calculates square difference of two values.
MAXON_ATTRIBUTE_FORCE_INLINE X maxon::Sqr | ( | X | a | ) |
Calculates square of a value.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Gamma | ( | Float32 | value, |
Float32 | gamma | ||
) |
Calculates the gamma correction. The input value is clipped to [0.0, 1.0] for safety to avoid exceptions.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Gamma | ( | Float64 | value, |
Float64 | gamma | ||
) |
Calculates the gamma correction. The input value is clipped to [0.0, 1.0] for safety to avoid exceptions.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Si | ( | Float32 | val | ) |
Calculates si (the unnormalized sinc function). The input value is checked for 0 to avoid exceptions.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Si | ( | Float64 | val | ) |
Calculates si (the unnormalized sinc function). The input value is checked for 0 to avoid exceptions.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::Sinc | ( | Float32 | val | ) |
Calculates sinc. The input value is checked for 0 to avoid exceptions.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::Sinc | ( | Float64 | val | ) |
Calculates sinc. The input value is checked for 0 to avoid exceptions.
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::ASin | ( | Float32 | val | ) |
Calculates arcsine. The input value is clipped for safety to avoid exceptions.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::ASin | ( | Float64 | val | ) |
Calculates arcsine. The input value is clipped for safety to avoid exceptions. @MAXON_ANNOTATION{reflection="net.maxon.ASin"}
MAXON_ATTRIBUTE_FORCE_INLINE Float32 maxon::ACos | ( | Float32 | val | ) |
Calculates arccosine. The input value is clipped for safety to avoid exceptions.
MAXON_ATTRIBUTE_FORCE_INLINE Float64 maxon::ACos | ( | Float64 | val | ) |
Calculates arccosine. The input value is clipped for safety to avoid exceptions.
|
constexpr |
Converts float value from degrees to radians.
|
constexpr |
Converts float value from degrees to radians.
|
constexpr |
Converts float value from radians to degrees.
|
constexpr |
Converts float value from radians to degrees.
MAXON_ATTRIBUTE_FORCE_INLINE void maxon::SinCos | ( | Float32 | val, |
Float32 & | sn, | ||
Float32 & | cs | ||
) |
Calculates both sine and cosine of a value.
MAXON_ATTRIBUTE_FORCE_INLINE void maxon::SinCos | ( | Float64 | val, |
Float64 & | sn, | ||
Float64 & | cs | ||
) |
Calculates both sine and cosine of a value.
MAXON_ATTRIBUTE_FORCE_INLINE DEST maxon::SafeConvert | ( | Float64 | src | ) |
Safely converts a 64 bit float value into another scalar value. The resulting value will be clipped against its boundaries, without raising an exception.
MAXON_ATTRIBUTE_FORCE_INLINE DEST maxon::SafeConvert | ( | Float32 | src | ) |
Safely converts a 32 bit float value into another scalar value. The resulting value will be clipped against its boundaries, without raising an exception.
MAXON_ATTRIBUTE_FORCE_INLINE void maxon::SetMax | ( | T & | a, |
const typename SFINAEHelper< T >::type & | b | ||
) |
Assigns the maximum of two values to the first value.
[in,out] | a | First value. |
[in] | b | Second value. |
MAXON_ATTRIBUTE_FORCE_INLINE void maxon::SetMin | ( | T & | a, |
const typename SFINAEHelper< T >::type & | b | ||
) |
Assigns the minimum of two values to the first value.
[in,out] | a | First value. |
[in] | b | Second value. |
MAXON_ATTRIBUTE_FORCE_INLINE Int maxon::Sign | ( | X | f | ) |
Calculates the sign of a value.
[in] | f | Value to test. |
MAXON_ATTRIBUTE_FORCE_INLINE T maxon::Mod | ( | T | a, |
T | b | ||
) |
Calculates the modulo (non-negative remainder of division) value for integer values. It works continuously for negative dividends, e.g. Mod(-1, 9) == 8 and Mod(1, 9) == 1.
[in] | a | Dividend. |
[in] | b | Divisor, must be > 0 (positive). |
|
constexpr |
Returns true if x
is a power of two, i.e., if it has exactly one bit set.
[in] | x | Value to check. |
x
is a power of two.
|
constexpr |
Returns true if x
is a power of two, i.e., if it has exactly one bit set.
[in] | x | Value to check. |
x
is a power of two.
|
constexpr |
Converts RGBA UInt [0, 255] values to a ColorA.
[in] | r | Red value. |
[in] | g | Green value |
[in] | b | Blue value. |
[in] | a | Alpha value. |
|
constexpr |
Converts RGB UInt [0, 255] values to a ColorA.
[in] | r | Red value. |
[in] | g | Green value |
[in] | b | Blue value. |
|
constexpr |
Converts RGBA Float [0.0, 1.0] values to a ColorA.
[in] | r | Red value. |
[in] | g | Green value |
[in] | b | Blue value. |
[in] | a | Alpha value. |
|
constexpr |
Converts RGB Float [0.0, 1.0] values to a ColorA.
[in] | r | Red value. |
[in] | g | Green value |
[in] | b | Blue value. |
|
constexpr |
Sets the alpha value of a ColorA.
[in] | col | Given ColorA. |
[in] | alpha | Alpha value. |
|
constexpr |
Multiplies a ColorA with an alpha value.
[in] | col | Given ColorA. |
[in] | alpha | Multiply alpha value. |
|
constexpr |
Blends two colors based on an alpha factor.
[in] | col1 | First color. |
[in] | col2 | Second color. |
[in] | alpha | Alpha blending factor. Valid range goes from 0.0 (Col1) to 1.0 (Col2). |
|
constexpr |
Blends two colors based on an alpha factor. Note: only RGB values are used, color alpha values are ignored.
[in] | col1 | First color. Alpha is ignored. |
[in] | col2 | Second color. Alpha is ignored. |
[in] | alpha | Alpha blending factor. Valid range goes from 0.0 (Col1) to 1.0 (Col2). |
|
constexpr |
Blend linear between two CanvasColors.
[in] | col1 | First ColorA. |
[in] | col2 | Second ColorA. |
[in] | blendValue | Blend value [0.0, 1.0]. |
MAXON_ATTRIBUTE_FORCE_INLINE Float maxon::GetPerceivedBrightness | ( | const ColorA & | color | ) |
Gets the perceived brightness from the color. Source: http://stackoverflow.com/a/596243/1577282
[in] | color | The color whose perceived brightness will be calculated. |
MAXON_ATTRIBUTE_FORCE_INLINE Bool maxon::IsColorPerceivedAsDark | ( | const ColorA & | color | ) |
Checks if a color is perceived as dark by the human eye. Source: http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx Source: https://robots.thoughtbot.com/closer-look-color-lightness
[in] | color | The color whose darkness will be evaluated. |
maxon::MAXON_REGISTRY | ( | Class< RenderNoise > | , |
RenderNoiseClasses | , | ||
"net.maxon.render.registry.rendernoiseclasses" | |||
) |
enum maxon::METRICUNIT maxon::MAXON_ENUM_LIST | ( | METRICUNIT | ) |
enum maxon::ANGLEUNIT maxon::MAXON_ENUM_LIST | ( | ANGLEUNIT | ) |
const Float64 FRAMERATE_DEFAULT |
Default frame rate of 30 fps.
const Float64 FRAMERATE_NTSC |
NTSC frame rate is approximately 29.97 fps.
const Float64 FRAMERATE_PAL |
PAL frame rate is 25 fps.
const Float64 FRAMERATE_FILM |
Movie frame rate is 24 fps.
const Float64 FRAMERATE_FILM_NTSC |
Modified movie frame rate to avoid frame roll when transfering video to NTSC, approx. 23.976 fps.
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
the minimum value a Float32 can represent
|
staticconstexpr |
the maximum value a Float32 can represent
|
staticconstexpr |
the minimum value a Float64 can represent
|
staticconstexpr |
the maximum value a Float64 can represent
|
staticconstexpr |
minimum Float32 value that can be represented by Int32 (-0x7FFFFF80). Lower values will results in an overflow
|
staticconstexpr |
maximum Float32 value that can be represented by Int32 ( 0x7FFFFF80). Higher values will results in an overflow
|
staticconstexpr |
minimum Float64 value that can be represented by Int64 (-0x7ffffffffffffdff). Lower values will results in an overflow
|
staticconstexpr |
maximum Float64 value that can be represented by Int64 ( 0x7ffffffffffffdff). Higher values will results in an overflow
|
staticconstexpr |
'safe' minimum range for Float32. Guarantees that multiplication of two numbers doesn't produce an overflow
|
staticconstexpr |
'safe' maximum range for Float32. Guarantees that multiplication of two numbers doesn't produce an overflow
|
staticconstexpr |
'safe' minimum range for Float. Guarantees that multiplication of two numbers doesn't produce an overflow
|
staticconstexpr |
'safe' maximum range for Float. Guarantees that multiplication of two numbers doesn't produce an overflow
|
staticconstexpr |
the minimum value a Float can represent
|
staticconstexpr |
the maximum value a Float can represent
|
staticconstexpr |
'safe' minimum range for Float64. Guarantees that multiplication of two numbers doesn't produce an overflow
|
staticconstexpr |
'safe' maximum range for Float64. Guarantees that multiplication of two numbers doesn't produce an overflow
|
staticconstexpr |
constant used for special cases
|
staticconstexpr |
floating point constant: PI
|
staticconstexpr |
floating point constant: 1.0 / PI
|
staticconstexpr |
floating point constant: 2.0 * PI
|
staticconstexpr |
floating point constant: 1.0 / (2.0 * PI)
|
staticconstexpr |
floating point constant: 0.5 * PI
|
staticconstexpr |
floating point constant: 1.0 / (0.5 * PI)
|
staticconstexpr |
floating point constant: Sqrt(2.0)
|
staticconstexpr |
floating point constant: Sqrt(2.0 * PI)
|
staticconstexpr |
floating point constant: 1.0 / Sqrt(2.0)
|
staticconstexpr |
floating point constant: Sqrt(3.0)
|
staticconstexpr |
floating point constant: Log(2.0)
|
static |
|
static |
|
static |
|
static |