Gamp v0.0.7-54-gccdc599
Gamp: Graphics, Audio, Multimedia and Processing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
jau::math::util::PMVMatrix4< Value_type > Class Template Reference

PMVMatrix4 implements the basic computer graphics Matrix4 pack using projection (P), modelview (Mv) and texture (T) Matrix4 operations. More...

#include <pmvmat4.hpp>

Inheritance diagram for jau::math::util::PMVMatrix4< Value_type >:
Collaboration diagram for jau::math::util::PMVMatrix4< Value_type >:

Public Types

typedef const value_typeconst_iterator
 
typedef const value_typeconst_pointer
 
typedef const value_typeconst_reference
 
typedef value_typeiterator
 
typedef Matrix4< value_typeMat4
 
typedef value_typepointer
 
typedef Ray3F< value_typeRay3
 
typedef value_typereference
 
typedef SyncMatrices4< value_typeSyncMats4
 
typedef Value_type value_type
 
typedef Vector3F< value_typeVec3
 
typedef Vector4F< value_typeVec4
 

Public Member Functions

 PMVMatrix4 () noexcept
 Creates an instance of PMVMatrix4.
 
 PMVMatrix4 (PMVData derivedMatrices) noexcept
 Creates an instance of PMVMatrix4.
 
const jau::type_infocompSignature () const noexcept
 Returns the component's value_type signature.
 
void frustumP (const float left, const float right, const float bottom, const float top, const float zNear, const float zFar)
 Multiply the projection matrix with the frustum matrix.
 
constexpr PMVData getDirtyBits () noexcept
 Returns the dirty bits due to mutable operations, i.e.
 
jau::math::geom::Frustum getFrustum () noexcept
 Returns the frustum, derived from projection x modelview.
 
constexpr PMVMod getModifiedBits (const bool clear) noexcept
 Returns the modified bits due to mutable operations.
 
constexpr Mat4getMulMvP (Mat4 &result) noexcept
 Returns multiplication result of Mv and P matrix, i.e.
 
constexpr Mat4getMulPMv (Mat4 &result) noexcept
 Returns multiplication result of P and Mv matrix, i.e.
 
constexpr const Mat4getMv () const noexcept
 
constexpr Mat4getMv () noexcept
 Returns the modelview matrix (Mv).
 
const Mat4getMvi ()
 Returns the inverse modelview matrix (Mvi) if requested.
 
const Mat4getMvit ()
 Returns the inverse transposed modelview matrix (Mvit) if requested.
 
constexpr const Mat4getP () const noexcept
 
constexpr Mat4getP () noexcept
 Returns the projection matrix (P).
 
const Mat4getPi ()
 Returns the inverse modelview matrix (Pi) if requested.
 
constexpr Mat4getPMv () noexcept
 Returns the pre-multiplied projection x modelview, P x Mv.
 
constexpr Mat4getPMvi () noexcept
 Returns the pre-multiplied inverse projection x modelview, if Mat4#invert(Mat4) succeeded, otherwise null.
 
constexpr const Mat4getT () const noexcept
 
constexpr Mat4getT () noexcept
 Returns the texture matrix (T).
 
constexpr bool isReqDirty () noexcept
 Returns true if the one of the requested bits are are set dirty due to mutable operations, i.e.
 
constexpr PMVMatrix4loadMv (const Mat4 &m) noexcept
 Load the modelview matrix with the values of the given Mat4.
 
constexpr PMVMatrix4loadMv (const Quat4f &quat) noexcept
 Load the modelview matrix with the values of the given Quaternion's rotation Quaternion::toMatrix() representation.
 
constexpr PMVMatrix4loadMv (float values[]) noexcept
 Load the modelview matrix with the provided values.
 
constexpr PMVMatrix4loadMvIdentity () noexcept
 Load the modelview matrix with the values of the given Mat4.
 
constexpr PMVMatrix4loadP (const Mat4 &m)
 Load the projection matrix with the values of the given Mat4.
 
constexpr PMVMatrix4loadP (const Quat4f &quat) noexcept
 Load the projection matrix with the values of the given Quaternion's rotation Quaternion::toMatrix() representation.
 
constexpr PMVMatrix4loadP (float values[]) noexcept
 Load the projection matrix with the provided values.
 
constexpr PMVMatrix4loadPIdentity () noexcept
 Load the projection matrix with the values of the given Mat4.
 
constexpr PMVMatrix4loadT (const Quat4f &quat) noexcept
 Load the texture matrix with the values of the given Quaternion's rotation Quaternion::toMatrix() representation.
 
constexpr PMVMatrix4loadT (float values[]) noexcept
 Load the texture matrix with the provided values.
 
constexpr PMVMatrix4loadT (Mat4 &m) noexcept
 Load the texture matrix with the values of the given Mat4.
 
constexpr PMVMatrix4loadTIdentity () noexcept
 Load the texture matrix with the values of the given Mat4.
 
constexpr PMVMatrix4lookAtMv (const Vec3 &eye, const Vec3 &center, const Vec3 &up) noexcept
 Multiply the modelview matrix with the eye, object and orientation (camera), i.e.
 
constexpr SyncMats4 makeSyncMv () noexcept
 Returns a new SyncMatrix of modelview matrix (Mv).
 
SyncMats4 makeSyncMvi ()
 Returns a new SyncMatrix of inverse modelview matrix (Mvi) if requested.
 
SyncMats4 makeSyncMvit ()
 Returns a new SyncMatrix of inverse transposed modelview matrix (Mvit) if requested.
 
constexpr SyncMats4 makeSyncP () noexcept
 Returns a new SyncMatrix of projection matrix (P).
 
SyncMats4f makeSyncPMv () noexcept
 Returns a new SyncMatrices4f of 2 matrices within one FloatBuffer: P and Mv.
 
SyncMats4f makeSyncPMvMvi ()
 Returns a new SyncMatrices4f of 3 matrices within one FloatBuffer: P, Mv and Mvi if requested.
 
SyncMats4f makeSyncPMvMviMvit ()
 Returns a new SyncMatrices4f of 4 matrices within one FloatBuffer: P, Mv, Mvi and Mvit if requested.
 
SyncMats4f makeSyncPMvReq ()
 Returns a new SyncMatrices4f of either 4 matrices makeSyncPMvMviMvit(), 3 matrices makeSyncPMvMvi() or 2 matrices makeSyncPMv() depending on requestedBits().
 
SyncMats4 makeSyncT () noexcept
 Returns a new SyncMatrix of texture matrix (T).
 
bool mapObjToWin (const Vec3 &objPos, const Recti &viewport, Vec3 &winPos) const noexcept
 Map object coordinates to window coordinates.
 
bool mapViewToWin (const Vec3 &view, const Recti &viewport, Vec3 &winPos) const noexcept
 Map view coordinates ( Mv x object ) to window coordinates.
 
bool mapWinToObj (const float winx, const float winy, const float winz, const Recti &viewport, Vec3 &objPos) noexcept
 Map window coordinates to object coordinates.
 
bool mapWinToObj4 (const float winx, const float winy, const float winz, const float clipw, const Recti &viewport, const float near, const float far, Vec4 &objPos) const noexcept
 Map window coordinates to object coordinates.
 
bool mapWinToObjRay (const float winx, const float winy, const float winz0, const float winz1, const Recti &viewport, Ray3f &ray) noexcept
 Map two window coordinates w/ shared X/Y and distinctive Z to a Ray in object space.
 
bool mapWinToView (const float winx, const float winy, const float winz, const Recti &viewport, Vec3 &objPos) noexcept
 Map window coordinates to view coordinates.
 
bool mapWinToViewRay (const float winx, const float winy, const float winz0, const float winz1, const Recti &viewport, Ray3f &ray) noexcept
 Map two window coordinates w/ shared X/Y and distinctive Z to a Ray in view space.
 
bool mapWinToWorld (const float winx, const float winy, const float winz, const Mat4 &matVi, const Recti &viewport, Vec3 &objPos) noexcept
 Map window coordinates to object coordinates.
 
bool mapWinToWorldRay (const float winx, const float winy, const float winz0, const float winz1, const Mat4 &matVi, const Recti &viewport, Ray3f &ray) noexcept
 Map two window coordinates w/ shared X/Y and distinctive Z to a Ray in world space.
 
bool mapWorldToWin (const Vec3 &objPos, const Mat4 &matV, const Recti &viewport, Vec3 &winPos) const noexcept
 Map world coordinates to window coordinates.
 
size_t matrixCount () const noexcept
 Return the number of Mat4 referenced by matrices()
 
constexpr PMVMatrix4mulMv (const Mat4 &m) noexcept
 Multiply the modelview matrix: [c] = [c] x [m].
 
constexpr PMVMatrix4mulP (const Mat4 &m) noexcept
 Multiply the projection matrix: [c] = [c] x [m].
 
constexpr PMVMatrix4mulT (const Mat4 &m) noexcept
 Multiply the texture matrix: [c] = [c] x [m].
 
constexpr Vec3mulWithMv (const Vec3 &v_in, Vec3 &v_out) noexcept
 v_out = Mv x v_in
 
constexpr Vec4mulWithMv (const Vec4 &v_in, Vec4 &v_out) noexcept
 v_out = Mv x v_in
 
constexpr Vec4mulWithMv (Vec4 &v_inout) noexcept
 v_inout = Mv x v_inout
 
constexpr void orthoP (const float left, const float right, const float bottom, const float top, const float zNear, const float zFar) noexcept
 Multiply the projection matrix with the orthogonal matrix.
 
PMVMatrix4perspectiveP (const float fovy_rad, const float aspect, const float zNear, const float zFar)
 Multiply the projection matrix with the perspective/frustum matrix.
 
constexpr_cxx20 PMVMatrix4popMv () noexcept
 Pop the modelview matrix from its stack.
 
constexpr_cxx20 PMVMatrix4popP () noexcept
 Pop the projection matrix from its stack.
 
constexpr_cxx20 PMVMatrix4popT () noexcept
 Pop the texture matrix from its stack.
 
constexpr_cxx20 PMVMatrix4pushMv () noexcept
 Push the modelview matrix to its stack, while preserving its values.
 
constexpr_cxx20 PMVMatrix4pushP () noexcept
 Push the projection matrix to its stack, while preserving its values.
 
constexpr_cxx20 PMVMatrix4pushT () noexcept
 Push the texture matrix to its stack, while preserving its values.
 
constexpr PMVData requestedBits () noexcept
 Returns the request bit mask, which uses bit values equal to the dirty mask and may contain.
 
constexpr void reset () noexcept
 Issues Mat4#loadIdentity() on all matrices and resets all internal states.
 
constexpr_cxx26 PMVMatrix4rotateMv (const float ang_rad, const float x, const float y, const float z) noexcept
 Rotate the modelview matrix by the given axis and angle in radians.
 
constexpr_cxx26 PMVMatrix4rotateMv (const float ang_rad, const Vec3 &axis) noexcept
 Rotate the modelview matrix by the given axis and angle in radians.
 
constexpr PMVMatrix4rotateMv (const Quat4f &quat) noexcept
 Rotate the modelview matrix with the given Quaternion's rotation matrix representation.
 
constexpr_cxx26 PMVMatrix4rotateP (const float ang_rad, const float x, const float y, const float z) noexcept
 Rotate the projection matrix by the given axis and angle in radians.
 
constexpr_cxx26 PMVMatrix4rotateP (const float ang_rad, const Vec3 &axis) noexcept
 Rotate the projection matrix by the given axis and angle in radians.
 
constexpr PMVMatrix4rotateP (const Quat4f &quat) noexcept
 Rotate the projection matrix with the given Quaternion's rotation matrix representation.
 
constexpr PMVMatrix4scaleMv (const Vec3 &s) noexcept
 Scale the modelview matrix.
 
constexpr PMVMatrix4scaleMv (float x, float y, float z) noexcept
 Scale the modelview matrix.
 
constexpr PMVMatrix4scaleP (const Vec3 &s) noexcept
 Scale the projection matrix.
 
constexpr PMVMatrix4scaleP (float x, float y, float z) noexcept
 Scale the projection matrix.
 
constexpr void setModelviewDirty () noexcept
 Sets the Modelview (Mv) matrix dirty and modified, i.e.
 
constexpr void setProjectionDirty () noexcept
 Sets the Projection (P) matrix dirty and modified, i.e.
 
constexpr void setTextureDirty () noexcept
 Sets the Texture (T) matrix modified.
 
constexpr PMVMatrix4setToLookAtMv (const Vec3 &eye, const Vec3 &center, const Vec3 &up) noexcept
 Set the modelview matrix to the eye, object and orientation (camera), i.e.
 
PMVMatrix4setToPerspective (const float fovy_rad, const float aspect, const float zNear, const float zFar)
 Set the projection matrix to the perspective/frustum matrix.
 
std::string toString () const noexcept
 
std::string & toString (std::string &sb, const std::string &f) const noexcept
 
constexpr PMVMatrix4translateMv (const Vec3 &t) noexcept
 Translate the modelview matrix.
 
constexpr PMVMatrix4translateMv (float x, float y, float z) noexcept
 Translate the modelview matrix.
 
constexpr PMVMatrix4translateP (const Vec3 &t) noexcept
 Translate the projection matrix.
 
constexpr PMVMatrix4translateP (float x, float y, float z) noexcept
 Translate the projection matrix.
 
bool update () noexcept
 Update the derived inverse modelview (Mvi), inverse transposed modelview (Mvit) matrices if they are dirty and requested via the constructor PMVMatrix4(int).
 

Static Public Member Functions

static size_t matrixCount (PMVData derivedMatrices) noexcept
 Return the number of Mat4 referenced by matrices()
 

Detailed Description

template<jau::req::packed_floating_point Value_type>
class jau::math::util::PMVMatrix4< Value_type >

PMVMatrix4 implements the basic computer graphics Matrix4 pack using projection (P), modelview (Mv) and texture (T) Matrix4 operations.

PMVMatrix4 provides the inverse modelview matrix (Mvi) and inverse transposed modelview matrix (Mvit). Frustum is also provided by getFrustum().

To keep these derived values synchronized after mutable Mv operations like rotateMv(Quaternion) users have to call update() before using Mvi and Mvit.

All matrices are provided in column-major order, as specified in the OpenGL fixed function pipeline, i.e. compatibility profile. See Matrix4.

Maintaining the inverse projection provides conversion to and from view space.

Passing the view or inverse-view matrix to map-functions allows conversion to and from world space.

  • view = V x M x Obj = Mv x Obj
  • world = V' x Mv x Obj = V' x V x M x Obj = M x Obj
  • clip = P x V x M x Obj = P x Mv x Obj etc ..

PMVMatrix4 can supplement GL2ES2 applications w/ the lack of the described matrix functionality.

Matrix storage details

The native data layout of the matrices are preserved, linear and can be utilized by GLUniformData directly to be pushed to the GPU eventually via SyncMatrix4 and SyncMatrices4, both SyncBuffer specializations for Matrix4.

SyncBuffer's provided sync_action_t ensures that derived matrices, e.g. getMvi(), are updated before use.

SyncBuffer's sync_action_t is called by GLUniformData::getBuffer() i.e. before the data is pushed to the GPU.

Definition at line 116 of file pmvmat4.hpp.

Member Typedef Documentation

◆ value_type

Definition at line 118 of file pmvmat4.hpp.

◆ pointer

Definition at line 119 of file pmvmat4.hpp.

◆ const_pointer

template<jau::req::packed_floating_point Value_type>
typedef const value_type* jau::math::util::PMVMatrix4< Value_type >::const_pointer

Definition at line 120 of file pmvmat4.hpp.

◆ reference

Definition at line 121 of file pmvmat4.hpp.

◆ const_reference

template<jau::req::packed_floating_point Value_type>
typedef const value_type& jau::math::util::PMVMatrix4< Value_type >::const_reference

Definition at line 122 of file pmvmat4.hpp.

◆ iterator

Definition at line 123 of file pmvmat4.hpp.

◆ const_iterator

template<jau::req::packed_floating_point Value_type>
typedef const value_type* jau::math::util::PMVMatrix4< Value_type >::const_iterator

Definition at line 124 of file pmvmat4.hpp.

◆ Vec3

Definition at line 126 of file pmvmat4.hpp.

◆ Vec4

Definition at line 127 of file pmvmat4.hpp.

◆ Ray3

Definition at line 128 of file pmvmat4.hpp.

◆ Mat4

Definition at line 129 of file pmvmat4.hpp.

◆ SyncMats4

Definition at line 130 of file pmvmat4.hpp.

Constructor & Destructor Documentation

◆ PMVMatrix4() [1/2]

template<jau::req::packed_floating_point Value_type>
jau::math::util::PMVMatrix4< Value_type >::PMVMatrix4 ( )
inlinenoexcept

Creates an instance of PMVMatrix4.

This constructor only sets up an instance w/o additional derived INVERSE_MODELVIEW, INVERSE_PROJECTION or INVERSE_TRANSPOSED_MODELVIEW matrices.

See also
#PMVMatrix4(int)

Definition at line 176 of file pmvmat4.hpp.

◆ PMVMatrix4() [2/2]

template<jau::req::packed_floating_point Value_type>
jau::math::util::PMVMatrix4< Value_type >::PMVMatrix4 ( PMVData derivedMatrices)
inlinenoexcept

Creates an instance of PMVMatrix4.

Additional derived matrices can be requested via derivedMatrices, i.e.

  • INVERSE_MODELVIEW
  • INVERSE_PROJECTION
  • INVERSE_TRANSPOSED_MODELVIEW

Implementation uses native Matrix4 elements using column-order fields. Derived matrices are updated at retrieval, e.g. getMvi(), or via synchronized access, e.g. makeSyncMvi(), to the actual Mat4 instances.

Parameters
derivedMatricesadditional matrices can be requested by passing bits INVERSE_MODELVIEW, INVERSE_PROJECTION and INVERSE_TRANSPOSED_MODELVIEW.
See also
#getReqBits()
isReqDirty()
getDirtyBits()
update()

Definition at line 196 of file pmvmat4.hpp.

Member Function Documentation

◆ compSignature()

template<jau::req::packed_floating_point Value_type>
const jau::type_info & jau::math::util::PMVMatrix4< Value_type >::compSignature ( ) const
inlinenoexcept

Returns the component's value_type signature.

Definition at line 204 of file pmvmat4.hpp.

◆ matrixCount() [1/2]

template<jau::req::packed_floating_point Value_type>
static size_t jau::math::util::PMVMatrix4< Value_type >::matrixCount ( PMVData derivedMatrices)
inlinestaticnoexcept

Return the number of Mat4 referenced by matrices()

Definition at line 207 of file pmvmat4.hpp.

◆ matrixCount() [2/2]

template<jau::req::packed_floating_point Value_type>
size_t jau::math::util::PMVMatrix4< Value_type >::matrixCount ( ) const
inlinenoexcept

Return the number of Mat4 referenced by matrices()

Definition at line 224 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ reset()

template<jau::req::packed_floating_point Value_type>
void jau::math::util::PMVMatrix4< Value_type >::reset ( )
inlineconstexprnoexcept

Issues Mat4#loadIdentity() on all matrices and resets all internal states.

Definition at line 229 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ getT() [1/2]

template<jau::req::packed_floating_point Value_type>
Mat4 & jau::math::util::PMVMatrix4< Value_type >::getT ( )
inlineconstexprnoexcept

Returns the texture matrix (T).

Consider using setTextureDirty() if modifying the returned Mat4.

See matrix storage details.

Definition at line 251 of file pmvmat4.hpp.

◆ getT() [2/2]

template<jau::req::packed_floating_point Value_type>
const Mat4 & jau::math::util::PMVMatrix4< Value_type >::getT ( ) const
inlineconstexprnoexcept

Definition at line 252 of file pmvmat4.hpp.

◆ getP() [1/2]

template<jau::req::packed_floating_point Value_type>
Mat4 & jau::math::util::PMVMatrix4< Value_type >::getP ( )
inlineconstexprnoexcept

Returns the projection matrix (P).

Consider using setProjectionDirty() if modifying the returned Mat4.

See matrix storage details.

Definition at line 263 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ getP() [2/2]

template<jau::req::packed_floating_point Value_type>
const Mat4 & jau::math::util::PMVMatrix4< Value_type >::getP ( ) const
inlineconstexprnoexcept

Definition at line 264 of file pmvmat4.hpp.

◆ getMv() [1/2]

template<jau::req::packed_floating_point Value_type>
Mat4 & jau::math::util::PMVMatrix4< Value_type >::getMv ( )
inlineconstexprnoexcept

Returns the modelview matrix (Mv).

Consider using setModelviewDirty() if modifying the returned Mat4.

See matrix storage details.

Definition at line 275 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ getMv() [2/2]

template<jau::req::packed_floating_point Value_type>
const Mat4 & jau::math::util::PMVMatrix4< Value_type >::getMv ( ) const
inlineconstexprnoexcept

Definition at line 276 of file pmvmat4.hpp.

◆ getPi()

template<jau::req::packed_floating_point Value_type>
const Mat4 & jau::math::util::PMVMatrix4< Value_type >::getPi ( )
inline

Returns the inverse modelview matrix (Pi) if requested.

See matrix storage details.

Exceptions
IllegalArgumentExceptionif INVERSE_PROJECTION has not been requested in ctor PMVMatrix4(int).

Definition at line 285 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ getMvi()

template<jau::req::packed_floating_point Value_type>
const Mat4 & jau::math::util::PMVMatrix4< Value_type >::getMvi ( )
inline

Returns the inverse modelview matrix (Mvi) if requested.

See matrix storage details.

Exceptions
IllegalArgumentExceptionif INVERSE_MODELVIEW has not been requested in ctor PMVMatrix4(int).

Definition at line 300 of file pmvmat4.hpp.

◆ getMvit()

template<jau::req::packed_floating_point Value_type>
const Mat4 & jau::math::util::PMVMatrix4< Value_type >::getMvit ( )
inline

Returns the inverse transposed modelview matrix (Mvit) if requested.

See matrix storage details.

Exceptions
IllegalArgumentExceptionif INVERSE_TRANSPOSED_MODELVIEW has not been requested in ctor PMVMatrix4(int).

Definition at line 315 of file pmvmat4.hpp.

◆ makeSyncP()

template<jau::req::packed_floating_point Value_type>
SyncMats4 jau::math::util::PMVMatrix4< Value_type >::makeSyncP ( )
inlineconstexprnoexcept

Returns a new SyncMatrix of projection matrix (P).

See matrix storage details.

Definition at line 329 of file pmvmat4.hpp.

◆ makeSyncMv()

template<jau::req::packed_floating_point Value_type>
SyncMats4 jau::math::util::PMVMatrix4< Value_type >::makeSyncMv ( )
inlineconstexprnoexcept

Returns a new SyncMatrix of modelview matrix (Mv).

See matrix storage details.

Definition at line 337 of file pmvmat4.hpp.

◆ makeSyncPMv()

template<jau::req::packed_floating_point Value_type>
SyncMats4f jau::math::util::PMVMatrix4< Value_type >::makeSyncPMv ( )
inlinenoexcept

Returns a new SyncMatrices4f of 2 matrices within one FloatBuffer: P and Mv.

See matrix storage details.

Definition at line 345 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ makeSyncT()

template<jau::req::packed_floating_point Value_type>
SyncMats4 jau::math::util::PMVMatrix4< Value_type >::makeSyncT ( )
inlinenoexcept

Returns a new SyncMatrix of texture matrix (T).

See matrix storage details.

Definition at line 353 of file pmvmat4.hpp.

◆ makeSyncMvi()

template<jau::req::packed_floating_point Value_type>
SyncMats4 jau::math::util::PMVMatrix4< Value_type >::makeSyncMvi ( )
inline

Returns a new SyncMatrix of inverse modelview matrix (Mvi) if requested.

See matrix storage details.

Exceptions
IllegalArgumentExceptionif INVERSE_MODELVIEW has not been requested in ctor PMVMatrix4(int).

Definition at line 362 of file pmvmat4.hpp.

◆ makeSyncMvit()

template<jau::req::packed_floating_point Value_type>
SyncMats4 jau::math::util::PMVMatrix4< Value_type >::makeSyncMvit ( )
inline

Returns a new SyncMatrix of inverse transposed modelview matrix (Mvit) if requested.

See matrix storage details.

Exceptions
IllegalArgumentExceptionif INVERSE_TRANSPOSED_MODELVIEW has not been requested in ctor PMVMatrix4(int).

Definition at line 376 of file pmvmat4.hpp.

◆ makeSyncPMvMvi()

template<jau::req::packed_floating_point Value_type>
SyncMats4f jau::math::util::PMVMatrix4< Value_type >::makeSyncPMvMvi ( )
inline

Returns a new SyncMatrices4f of 3 matrices within one FloatBuffer: P, Mv and Mvi if requested.

See matrix storage details.

Exceptions
IllegalArgumentExceptionif PMVData::inv_mv has not been requested in ctor.

Definition at line 390 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ makeSyncPMvMviMvit()

template<jau::req::packed_floating_point Value_type>
SyncMats4f jau::math::util::PMVMatrix4< Value_type >::makeSyncPMvMviMvit ( )
inline

Returns a new SyncMatrices4f of 4 matrices within one FloatBuffer: P, Mv, Mvi and Mvit if requested.

See matrix storage details.

Exceptions
IllegalArgumentExceptionif PMVData::inv_mv or PMVData::inv_tps_mv has not been requested in ctor.

Definition at line 404 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ makeSyncPMvReq()

template<jau::req::packed_floating_point Value_type>
SyncMats4f jau::math::util::PMVMatrix4< Value_type >::makeSyncPMvReq ( )
inline

Returns a new SyncMatrices4f of either 4 matrices makeSyncPMvMviMvit(), 3 matrices makeSyncPMvMvi() or 2 matrices makeSyncPMv() depending on requestedBits().

See matrix storage details.

Definition at line 419 of file pmvmat4.hpp.

◆ getMulPMv()

template<jau::req::packed_floating_point Value_type>
Mat4 & jau::math::util::PMVMatrix4< Value_type >::getMulPMv ( Mat4 & result)
inlineconstexprnoexcept

Returns multiplication result of P and Mv matrix, i.e.

   result = P x Mv
Parameters
result4x4 matrix storage for result
Returns
given result matrix for chaining

Definition at line 447 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ getMulMvP()

template<jau::req::packed_floating_point Value_type>
Mat4 & jau::math::util::PMVMatrix4< Value_type >::getMulMvP ( Mat4 & result)
inlineconstexprnoexcept

Returns multiplication result of Mv and P matrix, i.e.

   result = Mv x P
Parameters
result4x4 matrix storage for result
Returns
given result matrix for chaining

Definition at line 459 of file pmvmat4.hpp.

◆ mulWithMv() [1/3]

template<jau::req::packed_floating_point Value_type>
Vec4 & jau::math::util::PMVMatrix4< Value_type >::mulWithMv ( const Vec4 & v_in,
Vec4 & v_out )
inlineconstexprnoexcept

v_out = Mv x v_in

Parameters
v_ininput vector, can be v_out for in-place transformation
v_outoutput vector
Returns
v_out for chaining

Definition at line 469 of file pmvmat4.hpp.

◆ mulWithMv() [2/3]

template<jau::req::packed_floating_point Value_type>
Vec4 & jau::math::util::PMVMatrix4< Value_type >::mulWithMv ( Vec4 & v_inout)
inlineconstexprnoexcept

v_inout = Mv x v_inout

Parameters
v_inoutinput and output vector, i.e. in-place transformation
Returns
v_inout for chaining

Definition at line 478 of file pmvmat4.hpp.

◆ mulWithMv() [3/3]

template<jau::req::packed_floating_point Value_type>
Vec3 & jau::math::util::PMVMatrix4< Value_type >::mulWithMv ( const Vec3 & v_in,
Vec3 & v_out )
inlineconstexprnoexcept

v_out = Mv x v_in

Affine 3f-vector transformation by 4x4 matrix, see Mat4#mulVec3(Vec3, Vec3).

Parameters
v_ininput vector, can be v_out for in-place transformation
v_outoutput vector
Returns
v_out for chaining

Definition at line 491 of file pmvmat4.hpp.

◆ loadMv() [1/3]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::loadMv ( float values[])
inlineconstexprnoexcept

Load the modelview matrix with the provided values.

Definition at line 502 of file pmvmat4.hpp.

◆ loadMv() [2/3]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::loadMv ( const Mat4 & m)
inlineconstexprnoexcept

Load the modelview matrix with the values of the given Mat4.

Definition at line 510 of file pmvmat4.hpp.

◆ loadMv() [3/3]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::loadMv ( const Quat4f & quat)
inlineconstexprnoexcept

Load the modelview matrix with the values of the given Quaternion's rotation Quaternion::toMatrix() representation.

Definition at line 518 of file pmvmat4.hpp.

◆ loadP() [1/3]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::loadP ( float values[])
inlineconstexprnoexcept

Load the projection matrix with the provided values.

Definition at line 527 of file pmvmat4.hpp.

◆ loadP() [2/3]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::loadP ( const Mat4 & m)
inlineconstexpr

Load the projection matrix with the values of the given Mat4.

Definition at line 535 of file pmvmat4.hpp.

◆ loadP() [3/3]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::loadP ( const Quat4f & quat)
inlineconstexprnoexcept

Load the projection matrix with the values of the given Quaternion's rotation Quaternion::toMatrix() representation.

Definition at line 543 of file pmvmat4.hpp.

◆ loadT() [1/3]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::loadT ( float values[])
inlineconstexprnoexcept

Load the texture matrix with the provided values.

Definition at line 552 of file pmvmat4.hpp.

◆ loadT() [2/3]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::loadT ( Mat4 & m)
inlineconstexprnoexcept

Load the texture matrix with the values of the given Mat4.

Definition at line 560 of file pmvmat4.hpp.

◆ loadT() [3/3]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::loadT ( const Quat4f & quat)
inlineconstexprnoexcept

Load the texture matrix with the values of the given Quaternion's rotation Quaternion::toMatrix() representation.

Definition at line 568 of file pmvmat4.hpp.

◆ loadMvIdentity()

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::loadMvIdentity ( )
inlineconstexprnoexcept

Load the modelview matrix with the values of the given Mat4.

Definition at line 577 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ loadPIdentity()

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::loadPIdentity ( )
inlineconstexprnoexcept

Load the projection matrix with the values of the given Mat4.

Definition at line 586 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ loadTIdentity()

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::loadTIdentity ( )
inlineconstexprnoexcept

Load the texture matrix with the values of the given Mat4.

Definition at line 595 of file pmvmat4.hpp.

◆ mulMv()

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::mulMv ( const Mat4 & m)
inlineconstexprnoexcept

Multiply the modelview matrix: [c] = [c] x [m].

Parameters
mthe right hand Mat4
Returns
*this instance of chaining

Definition at line 606 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ mulP()

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::mulP ( const Mat4 & m)
inlineconstexprnoexcept

Multiply the projection matrix: [c] = [c] x [m].

Parameters
mthe right hand Mat4
Returns
*this instance of chaining

Definition at line 617 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ mulT()

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::mulT ( const Mat4 & m)
inlineconstexprnoexcept

Multiply the texture matrix: [c] = [c] x [m].

Parameters
mthe right hand Mat4
Returns
*this instance of chaining

Definition at line 628 of file pmvmat4.hpp.

◆ translateMv() [1/2]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::translateMv ( float x,
float y,
float z )
inlineconstexprnoexcept

Translate the modelview matrix.

Parameters
x
y
z
Returns
*this instance of chaining

Definition at line 641 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ translateMv() [2/2]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::translateMv ( const Vec3 & t)
inlineconstexprnoexcept

Translate the modelview matrix.

Parameters
ttranslation vec3
Returns
*this instance of chaining

Definition at line 650 of file pmvmat4.hpp.

◆ translateP() [1/2]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::translateP ( float x,
float y,
float z )
inlineconstexprnoexcept

Translate the projection matrix.

Parameters
x
y
z
Returns
*this instance of chaining

Definition at line 662 of file pmvmat4.hpp.

◆ translateP() [2/2]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::translateP ( const Vec3 & t)
inlineconstexprnoexcept

Translate the projection matrix.

Parameters
ttranslation vec3
Returns
*this instance of chaining

Definition at line 671 of file pmvmat4.hpp.

◆ scaleMv() [1/2]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::scaleMv ( float x,
float y,
float z )
inlineconstexprnoexcept

Scale the modelview matrix.

Parameters
x
y
z
Returns
*this instance of chaining

Definition at line 683 of file pmvmat4.hpp.

◆ scaleMv() [2/2]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::scaleMv ( const Vec3 & s)
inlineconstexprnoexcept

Scale the modelview matrix.

Parameters
sscale vec4f
Returns
*this instance of chaining

Definition at line 692 of file pmvmat4.hpp.

◆ scaleP() [1/2]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::scaleP ( float x,
float y,
float z )
inlineconstexprnoexcept

Scale the projection matrix.

Parameters
x
y
z
Returns
*this instance of chaining

Definition at line 704 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ scaleP() [2/2]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::scaleP ( const Vec3 & s)
inlineconstexprnoexcept

Scale the projection matrix.

Parameters
sscale vec4f
Returns
*this instance of chaining

Definition at line 713 of file pmvmat4.hpp.

◆ rotateMv() [1/3]

template<jau::req::packed_floating_point Value_type>
constexpr_cxx26 PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::rotateMv ( const float ang_rad,
const float x,
const float y,
const float z )
inlinenoexcept

Rotate the modelview matrix by the given axis and angle in radians.

Consider using rotateMv(Quaternion)

Parameters
ang_radangle in radians
axisrotation axis
Returns
*this instance of chaining
See also
#rotateMv(Quaternion)

Definition at line 728 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ rotateMv() [2/3]

template<jau::req::packed_floating_point Value_type>
constexpr_cxx26 PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::rotateMv ( const float ang_rad,
const Vec3 & axis )
inlinenoexcept

Rotate the modelview matrix by the given axis and angle in radians.

Consider using rotateMv(Quaternion)

Parameters
ang_radangle in radians
axisrotation axis
Returns
*this instance of chaining
See also
#rotateMv(Quaternion)

Definition at line 742 of file pmvmat4.hpp.

◆ rotateMv() [3/3]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::rotateMv ( const Quat4f & quat)
inlineconstexprnoexcept

Rotate the modelview matrix with the given Quaternion's rotation matrix representation.

Parameters
quatthe Quaternion
Returns
*this instance of chaining

Definition at line 751 of file pmvmat4.hpp.

◆ rotateP() [1/3]

template<jau::req::packed_floating_point Value_type>
constexpr_cxx26 PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::rotateP ( const float ang_rad,
const float x,
const float y,
const float z )
inlinenoexcept

Rotate the projection matrix by the given axis and angle in radians.

Consider using rotateP(Quaternion)

Parameters
ang_radangle in radians
axisrotation axis
Returns
*this instance of chaining
See also
#rotateP(Quaternion)

Definition at line 766 of file pmvmat4.hpp.

◆ rotateP() [2/3]

template<jau::req::packed_floating_point Value_type>
constexpr_cxx26 PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::rotateP ( const float ang_rad,
const Vec3 & axis )
inlinenoexcept

Rotate the projection matrix by the given axis and angle in radians.

Consider using rotateP(Quaternion)

Parameters
ang_radangle in radians
axisrotation axis
Returns
*this instance of chaining
See also
#rotateP(Quaternion)

Definition at line 780 of file pmvmat4.hpp.

◆ rotateP() [3/3]

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::rotateP ( const Quat4f & quat)
inlineconstexprnoexcept

Rotate the projection matrix with the given Quaternion's rotation matrix representation.

Parameters
quatthe Quaternion
Returns
*this instance of chaining

Definition at line 789 of file pmvmat4.hpp.

◆ popMv()

Pop the modelview matrix from its stack.

Definition at line 795 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ popP()

Pop the projection matrix from its stack.

Definition at line 801 of file pmvmat4.hpp.

◆ popT()

Pop the texture matrix from its stack.

Definition at line 807 of file pmvmat4.hpp.

◆ pushMv()

Push the modelview matrix to its stack, while preserving its values.

Definition at line 813 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ pushP()

Push the projection matrix to its stack, while preserving its values.

Definition at line 818 of file pmvmat4.hpp.

◆ pushT()

Push the texture matrix to its stack, while preserving its values.

Definition at line 823 of file pmvmat4.hpp.

◆ orthoP()

template<jau::req::packed_floating_point Value_type>
void jau::math::util::PMVMatrix4< Value_type >::orthoP ( const float left,
const float right,
const float bottom,
const float top,
const float zNear,
const float zFar )
inlineconstexprnoexcept

Multiply the projection matrix with the orthogonal matrix.

Parameters
left
right
bottom
top
zNear
zFar
See also
Mat4#setToOrtho(float, float, float, float, float, float)

Definition at line 838 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ frustumP()

template<jau::req::packed_floating_point Value_type>
void jau::math::util::PMVMatrix4< Value_type >::frustumP ( const float left,
const float right,
const float bottom,
const float top,
const float zNear,
const float zFar )
inline

Multiply the projection matrix with the frustum matrix.

Exceptions
IllegalArgumentExceptionif zNear <= 0 or zFar <= zNear or left == right, or bottom == top.
See also
Mat4#setToFrustum(float, float, float, float, float, float)

Definition at line 850 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ setToPerspective()

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::setToPerspective ( const float fovy_rad,
const float aspect,
const float zNear,
const float zFar )
inline

Set the projection matrix to the perspective/frustum matrix.

Parameters
fovy_radfov angle in radians
aspectaspect ratio width / height
zNear
zFar
Exceptions
IllegalArgumentExceptionif zNear <= 0 or zFar <= zNear
See also
Mat4#setToPerspective(float, float, float, float)

Definition at line 869 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ perspectiveP()

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::perspectiveP ( const float fovy_rad,
const float aspect,
const float zNear,
const float zFar )
inline

Multiply the projection matrix with the perspective/frustum matrix.

Parameters
fovy_radfov angle in radians
aspectaspect ratio width / height
zNear
zFar
Exceptions
IllegalArgumentExceptionif zNear <= 0 or zFar <= zNear
See also
Mat4#setToPerspective(float, float, float, float)

Definition at line 885 of file pmvmat4.hpp.

◆ setToLookAtMv()

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::setToLookAtMv ( const Vec3 & eye,
const Vec3 & center,
const Vec3 & up )
inlineconstexprnoexcept

Set the modelview matrix to the eye, object and orientation (camera), i.e.

Mat4#setToLookAt(Vec3, Vec3, Vec3, Mat4).

Definition at line 895 of file pmvmat4.hpp.

◆ lookAtMv()

template<jau::req::packed_floating_point Value_type>
PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type >::lookAtMv ( const Vec3 & eye,
const Vec3 & center,
const Vec3 & up )
inlineconstexprnoexcept

Multiply the modelview matrix with the eye, object and orientation (camera), i.e.

Mat4#setToLookAt(Vec3, Vec3, Vec3, Mat4).

Definition at line 905 of file pmvmat4.hpp.

◆ mapObjToWin()

template<jau::req::packed_floating_point Value_type>
bool jau::math::util::PMVMatrix4< Value_type >::mapObjToWin ( const Vec3 & objPos,
const Recti & viewport,
Vec3 & winPos ) const
inlinenoexcept

Map object coordinates to window coordinates.

Traditional gluProject implementation.

Parameters
objPos3 component object coordinate
viewportRect4i viewport
winPos3 component window coordinate, the result
Returns
true if successful, otherwise false (z is 1)

Definition at line 921 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ mapWorldToWin()

template<jau::req::packed_floating_point Value_type>
bool jau::math::util::PMVMatrix4< Value_type >::mapWorldToWin ( const Vec3 & objPos,
const Mat4 & matV,
const Recti & viewport,
Vec3 & winPos ) const
inlinenoexcept

Map world coordinates to window coordinates.

  • world = M x Obj
  • win = P x V x World = P x V' x Mv
  • V' x V x M = M, with Mv = V x M
Parameters
objPos3 component object coordinate
matVthe view matrix
viewportRect4i viewport
winPos3 component window coordinate, the result
Returns
true if successful, otherwise false (z is 1)

Definition at line 938 of file pmvmat4.hpp.

◆ mapViewToWin()

template<jau::req::packed_floating_point Value_type>
bool jau::math::util::PMVMatrix4< Value_type >::mapViewToWin ( const Vec3 & view,
const Recti & viewport,
Vec3 & winPos ) const
inlinenoexcept

Map view coordinates ( Mv x object ) to window coordinates.

Parameters
viewview position, 3 component vector
mPprojection matrix
viewportRect4i viewport
winPos3 component window coordinate, the result
Returns
true if successful, otherwise false (z is 1)

Definition at line 951 of file pmvmat4.hpp.

◆ mapWinToObj()

template<jau::req::packed_floating_point Value_type>
bool jau::math::util::PMVMatrix4< Value_type >::mapWinToObj ( const float winx,
const float winy,
const float winz,
const Recti & viewport,
Vec3 & objPos )
inlinenoexcept

Map window coordinates to object coordinates.

Traditional gluUnProject implementation.

Parameters
winx
winy
winz
viewportRect4i viewport
objPos3 component object coordinate, the result
Returns
true if successful, otherwise false (failed to invert matrix, or becomes infinity due to zero z)

Definition at line 968 of file pmvmat4.hpp.

◆ mapWinToWorld()

template<jau::req::packed_floating_point Value_type>
bool jau::math::util::PMVMatrix4< Value_type >::mapWinToWorld ( const float winx,
const float winy,
const float winz,
const Mat4 & matVi,
const Recti & viewport,
Vec3 & objPos )
inlinenoexcept

Map window coordinates to object coordinates.

The INVERSE_PROJECTION must have been request in the constructor.

  • Pv' = P' x V', using getPi()
  • V' x V x M = M, with Mv = V x M
Parameters
winx
winy
winz
matVithe inverse view matrix
viewportRect4i viewport
objPos3 component object coordinate, the result
Returns
true if successful, otherwise false (failed to invert matrix, or becomes infinity due to zero z)

Definition at line 993 of file pmvmat4.hpp.

◆ mapWinToView()

template<jau::req::packed_floating_point Value_type>
bool jau::math::util::PMVMatrix4< Value_type >::mapWinToView ( const float winx,
const float winy,
const float winz,
const Recti & viewport,
Vec3 & objPos )
inlinenoexcept

Map window coordinates to view coordinates.

Parameters
winx
winy
winz
viewportRect4i viewport
objPos3 component object coordinate, the result
Returns
true if successful, otherwise false (failed to invert matrix, or becomes infinity due to zero z)

Definition at line 1014 of file pmvmat4.hpp.

◆ mapWinToObj4()

template<jau::req::packed_floating_point Value_type>
bool jau::math::util::PMVMatrix4< Value_type >::mapWinToObj4 ( const float winx,
const float winy,
const float winz,
const float clipw,
const Recti & viewport,
const float near,
const float far,
Vec4 & objPos ) const
inlinenoexcept

Map window coordinates to object coordinates.

Traditional gluUnProject4 implementation.

Parameters
winx
winy
winz
clipw
viewportRect4i viewport
near
far
objPos4 component object coordinate, the result
Returns
true if successful, otherwise false (failed to invert matrix, or becomes infinity due to zero z)

Definition at line 1039 of file pmvmat4.hpp.

◆ mapWinToObjRay()

template<jau::req::packed_floating_point Value_type>
bool jau::math::util::PMVMatrix4< Value_type >::mapWinToObjRay ( const float winx,
const float winy,
const float winz0,
const float winz1,
const Recti & viewport,
Ray3f & ray )
inlinenoexcept

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 bounding box of a shape also in object space.

Notes for picking winz0 and winz1:

Definition at line 1068 of file pmvmat4.hpp.

◆ mapWinToWorldRay()

template<jau::req::packed_floating_point Value_type>
bool jau::math::util::PMVMatrix4< Value_type >::mapWinToWorldRay ( const float winx,
const float winy,
const float winz0,
const float winz1,
const Mat4 & matVi,
const Recti & viewport,
Ray3f & ray )
inlinenoexcept

Map two window coordinates w/ shared X/Y and distinctive Z to a Ray in world space.

The resulting Ray maybe used for picking using a bounding box of a shape also in world space.

The INVERSE_PROJECTION must have been request in the constructor.

  • Pv' = P' x V', using getPi()
  • V' x V x M = M, with Mv = V x M

Notes for picking winz0 and winz1:

Definition at line 1102 of file pmvmat4.hpp.

◆ mapWinToViewRay()

template<jau::req::packed_floating_point Value_type>
bool jau::math::util::PMVMatrix4< Value_type >::mapWinToViewRay ( const float winx,
const float winy,
const float winz0,
const float winz1,
const Recti & viewport,
Ray3f & ray )
inlinenoexcept

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 bounding box of a shape also in view space.

Notes for picking winz0 and winz1:

Definition at line 1129 of file pmvmat4.hpp.

◆ toString() [1/2]

template<jau::req::packed_floating_point Value_type>
std::string & jau::math::util::PMVMatrix4< Value_type >::toString ( std::string & sb,
const std::string & f ) const
inlinenoexcept

Definition at line 1134 of file pmvmat4.hpp.

◆ toString() [2/2]

template<jau::req::packed_floating_point Value_type>
std::string jau::math::util::PMVMatrix4< Value_type >::toString ( ) const
inlinenoexcept

Definition at line 1174 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ getModifiedBits()

template<jau::req::packed_floating_point Value_type>
PMVMod jau::math::util::PMVMatrix4< Value_type >::getModifiedBits ( const bool clear)
inlineconstexprnoexcept

Returns the modified bits due to mutable operations.

A modified bit is set, if the corresponding matrix had been modified by a mutable operation since last update() or getModifiedBits(true) call.

Parameters
clearif true, clears the modified bits, otherwise leaves them untouched.
See also
PMVState::MODIFIED_PROJECTION
PMVState::MODIFIED_MODELVIEW
PMVState::MODIFIED_TEXTURE
getDirtyBits()
isReqDirty()

Definition at line 1194 of file pmvmat4.hpp.

◆ getDirtyBits()

template<jau::req::packed_floating_point Value_type>
PMVData jau::math::util::PMVMatrix4< Value_type >::getDirtyBits ( )
inlineconstexprnoexcept

Returns the dirty bits due to mutable operations, i.e.

A dirty bit is set, if the corresponding matrix had been modified by a mutable operation since last update() call and requested in the constructor PMVMatrix4(int).

update() clears the dirty state for the matrices and getFrustum() for FRUSTUM.

See also
isReqDirty()
PMVMats::INVERSE_MODELVIEW
PMVMats::INVERSE_PROJECTION
PMVMats::INVERSE_TRANSPOSED_MODELVIEW
PMVMats::FRUSTUM
PMVMatrix4(PMVMats)
getMvi()
getMvit()
makeSyncPMvMvi()
makeSyncPMvMviMvit()
getFrustum()

Definition at line 1229 of file pmvmat4.hpp.

◆ isReqDirty()

template<jau::req::packed_floating_point Value_type>
bool jau::math::util::PMVMatrix4< Value_type >::isReqDirty ( )
inlineconstexprnoexcept

Returns true if the one of the requested bits are are set dirty due to mutable operations, i.e.

at least one of

A dirty bit is set, if the corresponding matrix had been modified by a mutable operation since last update() call and requested in the constructor PMVMatrix4(int).

update() clears the dirty state for the matrices and getFrustum() for FRUSTUM.

See also
#INVERSE_MODELVIEW
#INVERSE_PROJECTION
#INVERSE_TRANSPOSED_MODELVIEW
#PMVMatrix4(int)
getMvi()
getMvit()
makeSyncPMvMvi()
makeSyncPMvMviMvit()

Definition at line 1256 of file pmvmat4.hpp.

◆ setModelviewDirty()

template<jau::req::packed_floating_point Value_type>
void jau::math::util::PMVMatrix4< Value_type >::setModelviewDirty ( )
inlineconstexprnoexcept

Sets the Modelview (Mv) matrix dirty and modified, i.e.

adds INVERSE_MODELVIEW | INVERSE_TRANSPOSED_MODELVIEW | MANUAL_BITS to dirty bits.

See also
isReqDirty()

Definition at line 1265 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ setProjectionDirty()

template<jau::req::packed_floating_point Value_type>
void jau::math::util::PMVMatrix4< Value_type >::setProjectionDirty ( )
inlineconstexprnoexcept

Sets the Projection (P) matrix dirty and modified, i.e.

adds INVERSE_PROJECTION | MANUAL_BITS to dirty bits.

Definition at line 1274 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ setTextureDirty()

template<jau::req::packed_floating_point Value_type>
void jau::math::util::PMVMatrix4< Value_type >::setTextureDirty ( )
inlineconstexprnoexcept

Sets the Texture (T) matrix modified.

Definition at line 1282 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ requestedBits()

template<jau::req::packed_floating_point Value_type>
PMVData jau::math::util::PMVMatrix4< Value_type >::requestedBits ( )
inlineconstexprnoexcept

Returns the request bit mask, which uses bit values equal to the dirty mask and may contain.

  • PMVMats::INVERSE_MODELVIEW
  • PMVMats::INVERSE_PROJECTION
  • PMVMats::INVERSE_TRANSPOSED_MODELVIEW

The request bit mask is set by in the constructor PMVMatrix4(PMVMats).

See also
PMVMats::INVERSE_MODELVIEW
PMVMats::INVERSE_PROJECTION
PMVMats::INVERSE_TRANSPOSED_MODELVIEW
PMVMatrix4(PMVMats)
getMvi()
getMvit()
makeSyncPMvMvi()
makeSyncPMvMviMvit()
getFrustum()

Definition at line 1305 of file pmvmat4.hpp.

◆ getPMv()

template<jau::req::packed_floating_point Value_type>
Mat4 & jau::math::util::PMVMatrix4< Value_type >::getPMv ( )
inlineconstexprnoexcept

Returns the pre-multiplied projection x modelview, P x Mv.

This Mat4 instance should be re-fetched via this method and not locally stored to have it updated from a potential modification of underlying projection and/or modelview matrix. update() has no effect on this Mat4.

This pre-multipled P x Mv is considered dirty, if its corresponding P matrix or Mv matrix has been modified since its last update.

See also
update()

Definition at line 1320 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ getPMvi()

template<jau::req::packed_floating_point Value_type>
Mat4 & jau::math::util::PMVMatrix4< Value_type >::getPMvi ( )
inlineconstexprnoexcept

Returns the pre-multiplied inverse projection x modelview, if Mat4#invert(Mat4) succeeded, otherwise null.

This Mat4 instance should be re-fetched via this method and not locally stored to have it updated from a potential modification of underlying projection and/or modelview matrix. update() has no effect on this Mat4.

This pre-multipled invert(P x Mv) is considered dirty, if its corresponding P matrix or Mv matrix has been modified since its last update.

See also
update()

Definition at line 1342 of file pmvmat4.hpp.

Here is the caller graph for this function:

◆ getFrustum()

Returns the frustum, derived from projection x modelview.

This Frustum instance should be re-fetched via this method and not locally stored to have it updated from a potential modification of underlying projection and/or modelview matrix. update() has no effect on this Frustum.

The Frustum is considered dirty, if its corresponding P matrix or Mv matrix has been modified since its last update.

See also
update()

Definition at line 1364 of file pmvmat4.hpp.

◆ update()

template<jau::req::packed_floating_point Value_type>
bool jau::math::util::PMVMatrix4< Value_type >::update ( )
inlinenoexcept

Update the derived inverse modelview (Mvi), inverse transposed modelview (Mvit) matrices if they are dirty and requested via the constructor PMVMatrix4(int).


Hence updates the following dirty bits.

  • PMVMats::INVERSE_MODELVIEW
  • PMVMats::INVERSE_PROJECTION
  • PMVMats::INVERSE_TRANSPOSED_MODELVIEW

The Frustum is updated only via getFrustum() separately.

The Mvi and Mvit matrices are considered dirty, if their corresponding Mv matrix has been modified since their last update.

Method is automatically called by SyncMat4 and SyncMatrices4f instances SyncAction as retrieved by e.g. makeSyncMvit(). This ensures an automatic update cycle if used with com.jogamp.opengl.GLUniformData.

Method may be called manually in case mutable operations has been called and caller operates on already fetched references, i.e. not calling getMvi(), getMvit() anymore.

Method clears the modified bits like getModifiedBits(true), which are set by any mutable operation. The modified bits have no impact on this method, but the return value.

Returns
true if any matrix has been modified since last update call or if the derived matrices Mvi and Mvit were updated, otherwise false. In other words, method returns true if any matrix used by the caller must be updated, e.g. uniforms in a shader program.
See also
getModifiedBits(bool)
isReqDirty()
PMVMats::INVERSE_MODELVIEW
PMVMats::INVERSE_PROJECTION
PMVMats::INVERSE_TRANSPOSED_MODELVIEW
PMVMatrix4(PMVMats)
getMvi()
getMvit()
makeSyncPMvMvi()
makeSyncPMvMviMvit()

Definition at line 1415 of file pmvmat4.hpp.


The documentation for this class was generated from the following file: