|
Gamp v0.0.7-36-g24b1eb6
Gamp: Graphics, Audio, Multimedia and Processing
|
Basic 4x4 value_type matrix implementation using fields for intensive use-cases (host operations). More...
#include <mat4f.hpp>
Public Types | |
| typedef const value_type * | const_iterator |
| typedef const value_type * | const_pointer |
| typedef const value_type & | const_reference |
| typedef value_type * | iterator |
| typedef value_type * | pointer |
| typedef Quaternion< value_type, std::is_floating_point_v< Value_type > > | Quat |
| typedef Ray3F< value_type > | Ray3 |
| typedef value_type & | reference |
| typedef Value_type | value_type |
| typedef Vector3F< value_type > | Vec3 |
| typedef Vector4F< value_type > | Vec4 |
Public Member Functions | |
| constexpr | Matrix4 () noexcept |
| Creates a new identity matrix. | |
| constexpr | Matrix4 (const Matrix4 &o) noexcept |
Creates a new matrix copying the values of the given src matrix. | |
| constexpr | Matrix4 (const_iterator m) noexcept |
| Creates a new matrix based on given value_type[4*4] column major order. | |
| constexpr | Matrix4 (std::initializer_list< value_type > m) noexcept |
| Creates a new matrix based on given value_type initializer list in column major order. | |
| constexpr iterator | begin () noexcept |
| constexpr const_iterator | cbegin () const noexcept |
| value_type | determinant () const noexcept |
| Returns the determinant of this matrix. | |
| constexpr bool | equals (const Matrix4 &o, const value_type epsilon=std::numeric_limits< value_type >::epsilon()) const noexcept |
| constexpr value_type | get (const jau::nsize_t i) const noexcept |
Returns the ith component of the given column-major order matrix, 0 <= i < 16, w/o boundary check. | |
| constexpr iterator | get (iterator dst) const noexcept |
| Get this matrix into the given value_type[16] array in column major order w/o boundary check. | |
| constexpr std::vector< value_type > & | get (std::vector< value_type > &dst, size_t dst_off) const noexcept |
Get this matrix into the given FloatBuffer in column major order. | |
| constexpr Vec4 | getColumn (const jau::nsize_t column) const noexcept |
| Get the named column of the given column-major matrix to v_out w/o boundary check. | |
| constexpr Vec3 & | getColumn (const jau::nsize_t column, Vec3 &v_out) const noexcept |
| Get the named column of the given column-major matrix to v_out w/o boundary check. | |
| constexpr Vec4 & | getColumn (const jau::nsize_t column, Vec4 &v_out) const noexcept |
| Get the named column of the given column-major matrix to v_out w/o boundary check. | |
| Quat & | getRotation (Quat &res) const noexcept |
| Returns the rotation [m00 . | |
| constexpr Vec4 | getRow (const jau::nsize_t row) const noexcept |
| Get the named column of the given column-major matrix to v_out w/o boundary check. | |
| constexpr Vec3 & | getRow (const jau::nsize_t row, Vec3 &v_out) const noexcept |
| Get the named row of the given column-major matrix to v_out w/o boundary check. | |
| constexpr Vec4 & | getRow (const jau::nsize_t row, Vec4 &v_out) const noexcept |
| Get the named row of the given column-major matrix to v_out w/ boundary check. | |
| bool | invert () noexcept |
| Invert this matrix. | |
| bool | invert (const Matrix4 &src) noexcept |
Invert the src matrix values into this matrix. | |
| constexpr Matrix4 & | load (const Matrix4 &src) noexcept |
Load the values of the given matrix src to this matrix w/o boundary check. | |
| constexpr Matrix4 & | load (const_iterator src) noexcept |
Load the values of the given matrix src to this matrix w/o boundary check. | |
| constexpr Matrix4 & | loadIdentity () noexcept |
| Set this matrix to identity. | |
| constexpr Matrix4 & | mul (const Matrix4 &a, const Matrix4 &b) noexcept |
| Multiply matrix: [this] = [a] x [b]. | |
| constexpr Matrix4 & | mul (const Matrix4 &b) noexcept |
| Multiply matrix: [this] = [this] x [b]. | |
| constexpr Vec3 & | mulVec3 (const Vec3 &v_in, Vec3 &v_out) const noexcept |
| Affine 3f-vector transformation by 4x4 matrix. | |
| constexpr Vec3 & | mulVec3 (Vec3 &v_inout) const noexcept |
| Affine 3f-vector transformation by 4x4 matrix: v_inout = this * v_inout. | |
| constexpr Vec4 & | mulVec4 (const Vec4 &v_in, Vec4 &v_out) const noexcept |
| constexpr Vec4 & | mulVec4 (Vec4 &v_inout) const noexcept |
| operator const_pointer () const noexcept | |
| operator pointer () noexcept | |
| constexpr Vec3 | operator* (const Vec3 &rhs) const noexcept |
| Returns new Vec3, with affine 3f-vector transformation by this 4x4 matrix: this x v_in. | |
| constexpr Vec4 | operator* (const Vec4 &rhs) const noexcept |
| Returns new Vec4, with this x v_in. | |
| constexpr Matrix4 & | operator*= (const Matrix4 &rhs) noexcept |
| Multiply matrix: [this] = [this] x [b]. | |
| constexpr Matrix4 & | operator*= (const value_type s) noexcept |
| Multiply matrix with scalar: [this] = [this] x [s]. | |
| constexpr Matrix4 & | operator= (const Matrix4 &o) noexcept |
Copy assignment using the the values of the given src matrix. | |
| constexpr bool | operator== (const Matrix4 &rhs) const noexcept |
| constexpr value_type | operator[] (size_t i) const noexcept |
Returns read-only ith component of the given column-major order matrix, 0 <= i < 16 w/o boundary check. | |
| constexpr reference | operator[] (size_t i) noexcept |
Returns writable reference to the ith component of this column-major order matrix, 0 <= i < 16 w/o boundary check. | |
| Matrix4 & | rotate (const Quat &quat) noexcept |
Rotate this matrix with the given Quaternion, i.e. | |
| constexpr_cxx26 Matrix4 & | rotate (const value_type ang_rad, const value_type x, const value_type y, const value_type z) noexcept |
| Rotate this matrix about give axis and angle in radians, i.e. | |
| constexpr_cxx26 Matrix4 & | rotate (const value_type ang_rad, const Vec3 &axis) noexcept |
| Rotate this matrix about give axis and angle in radians, i.e. | |
| constexpr Matrix4 & | scale (const value_type s) noexcept |
| Scale this matrix, i.e. | |
| constexpr Matrix4 & | scale (const value_type x, const value_type y, const value_type z) noexcept |
| Scale this matrix, i.e. | |
| constexpr Matrix4 & | scale (const Vec3 &sxyz) noexcept |
| Scale this matrix, i.e. | |
| constexpr void | set (const jau::nsize_t i, const value_type v) noexcept |
Sets the ith component of this column-major order matrix with value_type v, 0 <= i < 16 w/o boundary check. | |
| Matrix4 & | setToFrustum (const value_type left, const value_type right, const value_type bottom, const value_type top, const value_type zNear, const value_type zFar) |
| Set this matrix to frustum. | |
| constexpr Matrix4 & | setToLookAt (const Vec3 &eye, const Vec3 ¢er, const Vec3 &up) noexcept |
| Set this matrix to the look-at matrix based on given parameters. | |
| constexpr Matrix4 & | setToOrtho (const value_type left, const value_type right, const value_type bottom, const value_type top, const value_type zNear, const value_type zFar) noexcept |
| Set this matrix to orthogonal projection. | |
| Matrix4 & | setToPerspective (const FovHVHalves &fovhv, const value_type zNear, const value_type zFar) |
Set this matrix to perspective frustum projection. | |
| Matrix4 & | setToPerspective (const value_type fovy_rad, const value_type aspect, const value_type zNear, const value_type zFar) |
Set this matrix to perspective frustum projection. | |
| constexpr bool | setToPick (const value_type x, const value_type y, const value_type deltaX, const value_type deltaY, const Recti &viewport) noexcept |
| Set this matrix to the pick matrix based on given parameters. | |
| Matrix4 & | setToRotation (const Quat &q) |
| Set this matrix to rotation using the given Quaternion. | |
| constexpr_cxx26 Matrix4 & | setToRotationAxis (const value_type ang_rad, const Vec3 &axis) noexcept |
| Set this matrix to rotation from the given axis and angle in radians. | |
| constexpr_cxx26 Matrix4 & | setToRotationAxis (const value_type ang_rad, value_type x, value_type y, value_type z) noexcept |
| Set this matrix to rotation from the given axis and angle in radians. | |
| constexpr_cxx26 Matrix4 & | setToRotationEuler (const value_type bankX, const value_type headingY, const value_type attitudeZ) noexcept |
| Set this matrix to rotation from the given Euler rotation angles in radians. | |
| constexpr_cxx26 Matrix4 & | setToRotationEuler (const Vec3 &angradXYZ) noexcept |
| Set this matrix to rotation from the given Euler rotation angles in radians. | |
| constexpr Matrix4 & | setToScale (const value_type x, const value_type y, const value_type z) noexcept |
| Set this matrix to scale. | |
| constexpr Matrix4 & | setToScale (const Vec3 &s) noexcept |
| Set this matrix to scale. | |
| constexpr Matrix4 & | setToTranslation (const value_type x, const value_type y, const value_type z) noexcept |
| Set this matrix to translation. | |
| constexpr Matrix4 & | setToTranslation (const Vec3 &t) noexcept |
| Set this matrix to translation. | |
| std::string | toString () const noexcept |
| std::string | toString (const std::string &rowPrefix) const noexcept |
| Returns a formatted string representation of this matrix. | |
| std::string | toString (const std::string &rowPrefix, const std::string &f) const noexcept |
| Returns a formatted string representation of this matrix. | |
| constexpr Matrix4 & | translate (const value_type x, const value_type y, const value_type z) noexcept |
| Translate this matrix, i.e. | |
| constexpr Matrix4 & | translate (const Vec3 &t) noexcept |
| Translate this matrix, i.e. | |
| Matrix4 & | transpose () noexcept |
| Transpose this matrix. | |
| Matrix4 & | transpose (const Matrix4 &src) noexcept |
Transpose the given src matrix into this matrix. | |
Static Public Member Functions | |
| static bool | mapObjToWin (const Vec3 &obj, const Matrix4 &mMv, const Matrix4 &mP, const Recti &viewport, Vec3 &winPos) noexcept |
| Map object coordinates to window coordinates. | |
| static bool | mapObjToWin (const Vec3 &obj, const Matrix4 &mPMv, const Recti &viewport, Vec3 &winPos) noexcept |
| Map object coordinates to window coordinates. | |
| static bool | mapViewToWin (const Vec3 &view, const Matrix4 &mP, const Recti &viewport, Vec3 &winPos) noexcept |
| Map view coordinates ( Mv x object ) to window coordinates. | |
| static bool | mapWinToAny (const value_type winx, const value_type winy, const value_type winz, const Matrix4 &invAny, const Recti &viewport, Vec3 &objPos) noexcept |
Map window coordinates to object, world or view coordinates, depending on invAny argument. | |
| static bool | mapWinToAny (const value_type winx, const value_type winy, const value_type winz1, const value_type winz2, const Matrix4 &invAny, const Recti &viewport, Vec3 &objPos1, Vec3 &objPos2) noexcept |
Map two window coordinates to two to object, world or view coordinates, depending on invAny argument. | |
| static bool | mapWinToAnyRay (const value_type winx, const value_type winy, const value_type winz0, const value_type winz1, const Matrix4 &invAny, const Recti &viewport, Ray3 &ray) noexcept |
Map two window coordinates w/ shared X/Y and distinctive Z to a Ray in object, world or view coordinates, depending on invAny argument. | |
| static bool | mapWinToObj (const value_type winx, const value_type winy, const value_type winz, const Matrix4 &mMv, const Matrix4 &mP, const Recti &viewport, Vec3 &objPos) noexcept |
| Map window coordinates to object coordinates. | |
| static bool | mapWinToObj4 (const value_type winx, const value_type winy, const value_type winz, const value_type clipw, const Matrix4 &invPMv, const Recti &viewport, const value_type near, const value_type far, Vec4 &objPos) noexcept |
| Map window coordinates to object coordinates. | |
| static bool | mapWinToObj4 (const value_type winx, const value_type winy, const value_type winz, const value_type clipw, const Matrix4 &mMv, const Matrix4 &mP, const Recti &viewport, const value_type near, const value_type far, Vec4 &objPos) noexcept |
| Map window coordinates to object coordinates. | |
| static bool | mapWinToObjRay (const value_type winx, const value_type winy, const value_type winz0, const value_type winz1, const Matrix4 &mMv, const Matrix4 &mP, const Recti &viewport, Ray3 &ray) noexcept |
Map two window coordinates w/ shared X/Y and distinctive Z to a Ray in object space. | |
| static bool | mapWinToView (const value_type winx, const value_type winy, const value_type winz, const Matrix4 &mP, const Recti &viewport, Vec3 &viewPos) noexcept |
| Map window coordinates to view coordinates. | |
| static bool | mapWinToViewRay (const value_type winx, const value_type winy, const value_type winz0, const value_type winz1, const Matrix4 &mP, const Recti &viewport, Ray3 &ray) noexcept |
Map two window coordinates w/ shared X/Y and distinctive Z to a Ray in view space. | |
| static bool | mapWorldToWin (const Vec3 &world, const Matrix4 &mV, const Matrix4 &mP, const Recti &viewport, Vec3 &winPos) noexcept |
| Map world coordinates ( M x object ) to window coordinates. | |
Static Public Attributes | |
| static constexpr const value_type | half = one/two |
| static constexpr const value_type | inv_deviation = value_type(84) * std::numeric_limits<value_type>::epsilon() |
| Inversion Epsilon, used with equals method to determine if two inverted matrices are close enough to be considered equal. | |
| static constexpr const value_type | one = value_type(1) |
| static constexpr const value_type | two = value_type(2) |
| static constexpr const value_type | zero = value_type(0) |
Basic 4x4 value_type matrix implementation using fields for intensive use-cases (host operations).
Implementation covers FloatUtil matrix functionality, exposed in an object oriented manner.
Unlike PMVmat4f, this class only represents one single matrix.
For array operations the layout is expected in column-major order matching OpenGL's implementation, illustration:
Row-Major Column-Major (OpenGL):
| 0 1 2 tx |
| |
| 4 5 6 ty |
M = | |
| 8 9 10 tz |
| |
| 12 13 14 15 |
R C R C
m[0*4+3] = tx; m[0+4*3] = tx;
m[1*4+3] = ty; m[1+4*3] = ty;
m[2*4+3] = tz; m[2+4*3] = tz;
RC (std subscript order) RC (std subscript order)
m03 = tx; m03 = tx;
m13 = ty; m13 = ty;
m23 = tz; m23 = tz;
Implementation utilizes unrolling of small vertices and matrices wherever possible while trying to access memory in a linear fashion for performance reasons, see:
| typedef Value_type jau::math::Matrix4< Value_type, >::value_type |
| typedef value_type* jau::math::Matrix4< Value_type, >::pointer |
| typedef const value_type* jau::math::Matrix4< Value_type, >::const_pointer |
| typedef value_type& jau::math::Matrix4< Value_type, >::reference |
| typedef const value_type& jau::math::Matrix4< Value_type, >::const_reference |
| typedef value_type* jau::math::Matrix4< Value_type, >::iterator |
| typedef const value_type* jau::math::Matrix4< Value_type, >::const_iterator |
| typedef Vector3F<value_type> jau::math::Matrix4< Value_type, >::Vec3 |
| typedef Vector4F<value_type> jau::math::Matrix4< Value_type, >::Vec4 |
| typedef Ray3F<value_type> jau::math::Matrix4< Value_type, >::Ray3 |
| typedef Quaternion<value_type, std::is_floating_point_v<Value_type> > jau::math::Matrix4< Value_type, >::Quat |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Creates a new matrix based on given value_type[4*4] column major order.
| m | 4x4 matrix in column-major order |
|
inlineconstexprnoexcept |
Creates a new matrix based on given value_type initializer list in column major order.
| m | source initializer list value_type data to be copied into this new instance, implied size must be >= 16 |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Sets the ith component of this column-major order matrix with value_type v, 0 <= i < 16 w/o boundary check.
|
inlineexplicitnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Set this matrix to identity.
Translation matrix (Column Order): 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
Definition at line 240 of file mat4f.hpp.
|
inlineconstexprnoexcept |
Load the values of the given matrix src to this matrix w/o boundary check.
| src | 4x4 matrix value_type[16] in column-major order |
Definition at line 254 of file mat4f.hpp.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineexplicitnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Get this matrix into the given value_type[16] array in column major order w/o boundary check.
| dst | value_type[16] array storage in column major order |
dst for chaining
|
inlineconstexprnoexcept |
Get this matrix into the given FloatBuffer in column major order.
| dst | 4x4 matrix std::vector in column-major order starting at dst_off |
| dst_off | offset for matrix dst |
dst for chaining
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Affine 3f-vector transformation by 4x4 matrix.
4x4 matrix multiplication with 3-component vector, using 1 for for v_in.w and dropping v_out.w, which shall be 1.
| v_in | 3-component column-vector vec3f, can be v_out for in-place transformation |
| v_out | m_in x v_in, 3-component column-vector vec3f |
Definition at line 851 of file mat4f.hpp.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Affine 3f-vector transformation by 4x4 matrix: v_inout = this * v_inout.
4x4 matrix multiplication with 3-component vector, using 1 for for v_inout.w and dropping v_inout.w, which shall be 1.
| v_inout | 3-component column-vector vec3f input and output, i.e. in-place transformation |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
Set this matrix to rotation from the given axis and angle in radians.
Rotation matrix (Column Order): xx(1-c)+c xy(1-c)+zs xz(1-c)-ys 0 xy(1-c)-zs yy(1-c)+c yz(1-c)+xs 0 xz(1-c)+ys yz(1-c)-xs zz(1-c)+c 0 0 0 0 1
| ang_rad | angle in radians |
| x | x of rotation axis |
| y | y of rotation axis |
| z | z of rotation axis |
Definition at line 999 of file mat4f.hpp.
|
inlinenoexcept |
Set this matrix to rotation from the given axis and angle in radians.
Rotation matrix (Column Order): xx(1-c)+c xy(1-c)+zs xz(1-c)-ys 0 xy(1-c)-zs yy(1-c)+c yz(1-c)+xs 0 xz(1-c)+ys yz(1-c)-xs zz(1-c)+c 0 0 0 0 1
| ang_rad | angle in radians |
| axis | rotation axis |
|
inlinenoexcept |
Set this matrix to rotation from the given Euler rotation angles in radians.
The rotations are applied in the given order:
| bankX | the Euler pitch angle in radians. (rotation about the X axis) |
| headingY | the Euler yaw angle in radians. (rotation about the Y axis) |
| attitudeZ | the Euler roll angle in radians. (rotation about the Z axis) |
Implementation does not use Quaternion and hence is exposed to Gimbal-Lock, consider using Quaternion::toMatrix().
Definition at line 1077 of file mat4f.hpp.
|
inlinenoexcept |
Set this matrix to rotation from the given Euler rotation angles in radians.
The rotations are applied in the given order:
| angradXYZ | euler angle vector in radians holding x-bank, y-heading and z-attitude |
Implementation does not use Quaternion and hence is exposed to Gimbal-Lock, consider using Quaternion::toMatrix().
|
inlineconstexprnoexcept |
|
inline |
Set this matrix to frustum.
Frustum matrix (Column Order): 2*zNear/dx 0 0 0 0 2*zNear/dy 0 0 A B C -1 0 0 D 0
| left | |
| right | |
| bottom | |
| top | |
| zNear | |
| zFar |
| IllegalArgumentException | if zNear <= 0 or zFar <= zNear or left == right, or bottom == top. |
Definition at line 1226 of file mat4f.hpp.
|
inline |
Set this matrix to perspective frustum projection.
| fovy_rad | angle in radians |
| aspect | aspect ratio width / height |
| zNear | |
| zFar |
| IllegalArgumentException | if zNear <= 0 or zFar <= zNear |
Definition at line 1275 of file mat4f.hpp.
|
inline |
Set this matrix to perspective frustum projection.
| fovhv | FovHVHalves field of view in both directions, may not be centered, either in radians or tangent |
| zNear | |
| zFar |
| IllegalArgumentException | if zNear <= 0 or zFar <= zNear |
|
inlineconstexprnoexcept |
Set this matrix to the look-at matrix based on given parameters.
Consist out of two matrix multiplications:
R = L x T,
with L for look-at matrix and
T for eye translation.
Result R can be utilized for projection or modelview multiplication, i.e.
M = M x R,
with M being the projection or modelview matrix.
| eye | 3 component eye vector |
| center | 3 component center vector |
| up | 3 component up vector |
Definition at line 1322 of file mat4f.hpp.
|
inlineconstexprnoexcept |
Set this matrix to the pick matrix based on given parameters.
Traditional gluPickMatrix implementation.
Consist out of two matrix multiplications:
R = T x S,
with T for viewport translation matrix and
S for viewport scale matrix.
Result R can be utilized for projection multiplication, i.e.
P = P x R,
with P being the projection matrix.
To effectively use the generated pick matrix for picking, call setToPick(..) and multiply a custom perspective matrix by this pick matrix. Then you may load the result onto the perspective matrix stack.
| x | the center x-component of a picking region in window coordinates |
| y | the center y-component of a picking region in window coordinates |
| deltaX | the width of the picking region in window coordinates. |
| deltaY | the height of the picking region in window coordinates. |
| viewport | Rect4i viewport |
|
inlinenoexcept |
Rotate this matrix about give axis and angle in radians, i.e.
multiply by axis-rotation matrix.
| angrad | angle in radians |
| x | x of rotation axis |
| y | y of rotation axis |
| z | z of rotation axis |
|
inlinenoexcept |
Rotate this matrix about give axis and angle in radians, i.e.
multiply by axis-rotation matrix.
| angrad | angle in radians |
| axis | rotation axis |
|
noexcept |
Rotate this matrix with the given Quaternion, i.e.
multiply by Quaternion's rotation matrix.
| tmp | temporary Matrix4f used for multiplication |
|
inlineconstexprnoexcept |
Translate this matrix, i.e.
multiply by translation matrix.
| x | x translation |
| y | y translation |
| z | z translation |
|
inlineconstexprnoexcept |
Translate this matrix, i.e.
multiply by translation matrix.
| t | translation vec3f |
|
inlineconstexprnoexcept |
Scale this matrix, i.e.
multiply by scale matrix.
| x | x scale |
| y | y scale |
| z | z scale |
|
inlineconstexprnoexcept |
Scale this matrix, i.e.
multiply by scale matrix.
| sxyz | scale factor for each component |
|
inlineconstexprnoexcept |
Scale this matrix, i.e.
multiply by scale matrix.
| s | scale for x-, y- and z-axis |
|
inlinestaticnoexcept |
Map object coordinates to window coordinates.
Traditional gluProject implementation.
| obj | object position, 3 component vector |
| mPMv | [projection] x [modelview] matrix, i.e. P x Mv |
| viewport | Rect4i viewport |
| winPos | 3 component window coordinate, the result |
|
inlinestaticnoexcept |
Map object coordinates to window coordinates.
Traditional gluProject implementation.
| obj | object position, 3 component vector |
| mMv | modelview matrix |
| mP | projection matrix |
| viewport | Rect4i viewport |
| winPos | 3 component window coordinate, the result |
|
inlinestaticnoexcept |
Map world coordinates ( M x object ) to window coordinates.
| world | world position, 3 component vector |
| mV | view matrix |
| mP | projection matrix |
| viewport | Rect4i viewport |
| winPos | 3 component window coordinate, the result |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
Map window coordinates to object coordinates.
Traditional gluUnProject implementation.
| winx | |
| winy | |
| winz | |
| mMv | 4x4 modelview matrix |
| mP | 4x4 projection matrix |
| viewport | Rect4i viewport |
| objPos | 3 component object coordinate, the result |
|
inlinestaticnoexcept |
Map window coordinates to view coordinates.
| winx | |
| winy | |
| winz | |
| mP | 4x4 projection matrix |
| viewport | Rect4i viewport |
| viewPos | 3 component view coordinate, the result |
|
inlinestaticnoexcept |
Map window coordinates to object, world or view coordinates, depending on invAny argument.
Traditional gluUnProject implementation.
invAny maybe set as follows for
to world: inverse(P x V) =([projection] x [view])'to view: inverse(P) =[projection]'`| winx | |
| winy | |
| winz | |
| invAny | inverse matrix, either Inv(P x Mv) to object, Inv(P x V) to world or Inv(P) ‘[projection]’` to view |
| viewport | Rect4i viewport |
| objPos | 3 component object coordinate, the result |
Definition at line 1660 of file mat4f.hpp.
|
inlinestaticnoexcept |
Map two window coordinates to two to object, world or view coordinates, depending on invAny argument.
Both coordinates are distinguished by their z component.
Traditional gluUnProject implementation.
invAny maybe set as follows for
to world: inverse(P x V) =([projection] x [view])'to view: inverse(P) =[projection]'`| winx | |
| winy | |
| winz1 | |
| winz2 | |
| invAny | inverse matrix, either Inv(P x Mv) to object, Inv(P x V) to world or Inv(P) ‘[projection]’` to view |
| viewport | Rect4i viewport vector |
| objPos1 | 3 component object coordinate, the result |
|
inlinestaticnoexcept |
Map window coordinates to object coordinates.
Traditional gluUnProject4 implementation.
| winx | |
| winy | |
| winz | |
| clipw | |
| mMv | 4x4 modelview matrix |
| mP | 4x4 projection matrix |
| viewport | Rect4i viewport vector |
| near | |
| far | |
| obj_pos | 4 component object coordinate, the result |
Definition at line 1761 of file mat4f.hpp.
|
inlinestaticnoexcept |
Map window coordinates to object coordinates.
Traditional gluUnProject4 implementation.
| winx | |
| winy | |
| winz | |
| clipw | |
| invPMv | inverse [projection] x [modelview] matrix, i.e. Inv(P x Mv), if null method returns false |
| viewport | Rect4i viewport vector |
| near | |
| far | |
| obj_pos | 4 component object coordinate, the result |
|
inlinestaticnoexcept |
Map two window coordinates w/ shared X/Y and distinctive Z to a Ray in object space.
The resulting Ray maybe used for picking using a AABBox#getRayIntersection(vec3f, Ray, value_type, boolean) of a shape also in object space.
Notes for picking winz0 and winz1:
| winx | |
| winy | |
| winz0 | |
| winz1 | |
| mMv | 4x4 modelview matrix |
| mP | 4x4 projection matrix |
| viewport | Rect4i viewport |
| ray | storage for the resulting Ray in object space |
|
inlinestaticnoexcept |
Map two window coordinates w/ shared X/Y and distinctive Z to a Ray in view space.
The resulting Ray maybe used for picking using a AABBox#getRayIntersection(vec3f, Ray, value_type, boolean) of a shape also in view space.
Notes for picking winz0 and winz1:
| winx | |
| winy | |
| winz0 | |
| winz1 | |
| mMv | 4x4 modelview matrix |
| mP | 4x4 projection matrix |
| viewport | Rect4i viewport |
| ray | storage for the resulting Ray in view space |
|
inlinestaticnoexcept |
Map two window coordinates w/ shared X/Y and distinctive Z to a Ray in object, world or view coordinates, depending on invAny argument.
The resulting Ray maybe used for picking using a AABBox#getRayIntersection(vec3f, Ray, value_type, boolean) of a shape also in object, world or view space, see invAny.
invAny maybe set as follows for
to world: inverse(P x V) =([projection] x [view])'to view: inverse(P) =[projection]'`Notes for picking winz0 and winz1:
| winx | |
| winy | |
| winz0 | |
| winz1 | |
| invAny | inverse matrix, either Inv(P x Mv) to object, Inv(P x V) to world or Inv(P) ‘[projection]’` to view |
| viewport | Rect4i viewport |
| ray | storage for the resulting Ray in object space |
|
inlinenoexcept |
Returns a formatted string representation of this matrix.
| rowPrefix | prefix for each row |
| f | format string for each value_type element, e.g. "%10.5f" |
Definition at line 1933 of file mat4f.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
Inversion Epsilon, used with equals method to determine if two inverted matrices are close enough to be considered equal.
Using {@value}, which is ~84 times std::numeric_limits<value_type>::epsilon().