Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
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 <pmvmat4f.hpp>

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_type, std::is_floating_point_v< Value_type > > Mat4
 
typedef value_typepointer
 
typedef Ray3F< value_type, std::is_floating_point_v< Value_type > > Ray3
 
typedef value_typereference
 
typedef SyncMatrix4< value_type, std::is_floating_point_v< Value_type > > SyncMat4
 
typedef SyncMatrices4< value_type, std::is_floating_point_v< Value_type > > SyncMats4
 
typedef Value_type value_type
 
typedef Vector3F< value_type, std::is_floating_point_v< Value_type > > Vec3
 
typedef Vector4F< value_type, std::is_floating_point_v< Value_type > > Vec4
 

Public Member Functions

 PMVMatrix4 () noexcept
 Creates an instance of PMVMatrix4. More...
 
 PMVMatrix4 (int derivedMatrices) noexcept
 Creates an instance of PMVMatrix4. More...
 
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. More...
 
constexpr uint32_t getDirtyBits () noexcept
 Returns the dirty bits due to mutable operations, i.e. More...
 
jau::math::geom::Frustum getFrustum () noexcept
 Returns the frustum, derived from projection x modelview. More...
 
constexpr uint32_t getModifiedBits (const bool clear) noexcept
 Returns the modified bits due to mutable operations. More...
 
constexpr Mat4getMulMvP (Mat4 &result) noexcept
 Returns multiplication result of Mv and P matrix, i.e. More...
 
constexpr Mat4getMulPMv (Mat4 &result) noexcept
 Returns multiplication result of P and Mv matrix, i.e. More...
 
constexpr const Mat4getMv () const noexcept
 
constexpr Mat4getMv () noexcept
 Returns the modelview matrix (Mv). More...
 
Mat4getMvi ()
 Returns the inverse modelview matrix (Mvi) if requested. More...
 
Mat4getMvit ()
 Returns the inverse transposed modelview matrix (Mvit) if requested. More...
 
constexpr const Mat4getP () const noexcept
 
constexpr Mat4getP () noexcept
 Returns the projection matrix (P). More...
 
constexpr Mat4getPMv () noexcept
 Returns the pre-multiplied projection x modelview, P x Mv. More...
 
constexpr Mat4getPMvi () noexcept
 Returns the pre-multiplied inverse projection x modelview, if Mat4#invert(Mat4) succeeded, otherwise null. More...
 
constexpr uint32_t getReqBits () noexcept
 Returns the request bit mask, which uses bit values equal to the dirty mask and may contain. More...
 
constexpr const SyncMats4getSyncMv () const noexcept
 
constexpr SyncMat4getSyncMv () noexcept
 Returns the SyncMatrix of modelview matrix (Mv). More...
 
SyncMat4getSyncMvi ()
 Returns the SyncMatrix of inverse modelview matrix (Mvi) if requested. More...
 
SyncMat4getSyncMvit ()
 Returns the SyncMatrix of inverse transposed modelview matrix (Mvit) if requested. More...
 
constexpr const SyncMats4getSyncP () const noexcept
 
constexpr SyncMat4getSyncP () noexcept
 Returns the SyncMatrix of projection matrix (P). More...
 
constexpr const SyncMats4fgetSyncPMv () const noexcept
 
constexpr SyncMats4fgetSyncPMv () noexcept
 Returns SyncMatrices4f of 2 matrices within one FloatBuffer: P and Mv. More...
 
SyncMats4fgetSyncPMvMvi ()
 Returns SyncMatrices4f of 3 matrices within one FloatBuffer: P, Mv and Mvi if requested. More...
 
SyncMats4fgetSyncPMvMviMvit ()
 Returns SyncMatrices4f of 4 matrices within one FloatBuffer: P, Mv, Mvi and Mvit if requested. More...
 
constexpr const SyncMats4getSyncT () const noexcept
 
constexpr SyncMat4getSyncT () noexcept
 Returns the SyncMatrix of texture matrix (T). More...
 
constexpr const Mat4getT () const noexcept
 
constexpr Mat4getT () noexcept
 Returns the texture matrix (T). More...
 
constexpr bool isReqDirty () noexcept
 Returns true if the one of the requested bits are are set dirty due to mutable operations, i.e. More...
 
constexpr PMVMatrix4loadMv (const Mat4 &m) noexcept
 Load the modelview matrix with the values of the given Mat4. More...
 
constexpr PMVMatrix4loadMv (const Quat4f &quat) noexcept
 Load the modelview matrix with the values of the given Quaternion's rotation Quaternion::toMatrix() representation. More...
 
constexpr PMVMatrix4loadMv (float values[]) noexcept
 Load the modelview matrix with the provided values. More...
 
constexpr PMVMatrix4loadMvIdentity () noexcept
 Load the modelview matrix with the values of the given Mat4. More...
 
constexpr PMVMatrix4loadP (const Mat4 &m)
 Load the projection matrix with the values of the given Mat4. More...
 
constexpr PMVMatrix4loadP (const Quat4f &quat) noexcept
 Load the projection matrix with the values of the given Quaternion's rotation Quaternion::toMatrix() representation. More...
 
constexpr PMVMatrix4loadP (float values[]) noexcept
 Load the projection matrix with the provided values. More...
 
constexpr PMVMatrix4loadPIdentity () noexcept
 Load the projection matrix with the values of the given Mat4. More...
 
constexpr PMVMatrix4loadT (const Quat4f &quat) noexcept
 Load the texture matrix with the values of the given Quaternion's rotation Quaternion::toMatrix() representation. More...
 
constexpr PMVMatrix4loadT (float values[]) noexcept
 Load the texture matrix with the provided values. More...
 
constexpr PMVMatrix4loadT (Mat4 &m) noexcept
 Load the texture matrix with the values of the given Mat4. More...
 
constexpr PMVMatrix4loadTIdentity () noexcept
 Load the texture matrix with the values of the given Mat4. More...
 
constexpr PMVMatrix4lookAtP (const Vec3 &eye, const Vec3 &center, const Vec3 &up) noexcept
 Multiply the projection matrix with the eye, object and orientation, i.e. More...
 
bool mapObjToWin (const Vec3 &objPos, const Recti &viewport, Vec3 &winPos) noexcept
 Map object coordinates to window coordinates. More...
 
bool mapWinToObj (const float winx, const float winy, const float winz, const Recti &viewport, Vec3 &objPos) noexcept
 Map window coordinates to object coordinates. More...
 
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) noexcept
 Map window coordinates to object coordinates. More...
 
bool mapWinToRay (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. More...
 
constexpr PMVMatrix4mulMv (const Mat4 &m) noexcept
 Multiply the modelview matrix: [c] = [c] x [m]. More...
 
constexpr PMVMatrix4mulP (const Mat4 &m) noexcept
 Multiply the projection matrix: [c] = [c] x [m]. More...
 
constexpr PMVMatrix4mulT (const Mat4 &m) noexcept
 Multiply the texture matrix: [c] = [c] x [m]. More...
 
constexpr Vec3mulWithMv (const Vec3 &v_in, Vec3 &v_out) noexcept
 v_out = Mv * v_in More...
 
constexpr Vec4mulWithMv (const Vec4 &v_in, Vec4 &v_out) noexcept
 v_out = Mv * v_in More...
 
constexpr Vec4mulWithMv (Vec4 &v_inout) noexcept
 v_inout = Mv * v_inout More...
 
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. More...
 
PMVMatrix4perspectiveP (const float fovy_rad, const float aspect, const float zNear, const float zFar)
 Multiply the projection matrix with the perspective/frustum matrix. More...
 
constexpr_cxx20 PMVMatrix4popMv () noexcept
 Pop the modelview matrix from its stack. More...
 
constexpr_cxx20 PMVMatrix4popP () noexcept
 Pop the projection matrix from its stack. More...
 
constexpr_cxx20 PMVMatrix4popT () noexcept
 Pop the texture matrix from its stack. More...
 
constexpr_cxx20 PMVMatrix4pushMv () noexcept
 Push the modelview matrix to its stack, while preserving its values. More...
 
constexpr_cxx20 PMVMatrix4pushP () noexcept
 Push the projection matrix to its stack, while preserving its values. More...
 
constexpr_cxx20 PMVMatrix4pushT () noexcept
 Push the texture matrix to its stack, while preserving its values. More...
 
constexpr void reset () noexcept
 Issues Mat4#loadIdentity() on all matrices and resets all internal states. More...
 
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. More...
 
constexpr_cxx26 PMVMatrix4rotateMv (const float ang_rad, const Vec3 &axis) noexcept
 Rotate the modelview matrix by the given axis and angle in radians. More...
 
constexpr PMVMatrix4rotateMv (const Quat4f &quat) noexcept
 Rotate the modelview matrix with the given Quaternion's rotation matrix representation. More...
 
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. More...
 
constexpr_cxx26 PMVMatrix4rotateP (const float ang_rad, const Vec3 &axis) noexcept
 Rotate the projection matrix by the given axis and angle in radians. More...
 
constexpr PMVMatrix4rotateP (const Quat4f &quat) noexcept
 Rotate the projection matrix with the given Quaternion's rotation matrix representation. More...
 
constexpr PMVMatrix4scaleMv (const Vec3 &s) noexcept
 Scale the modelview matrix. More...
 
constexpr PMVMatrix4scaleMv (float x, float y, float z) noexcept
 Scale the modelview matrix. More...
 
constexpr PMVMatrix4scaleP (const Vec3 &s) noexcept
 Scale the projection matrix. More...
 
constexpr PMVMatrix4scaleP (float x, float y, float z) noexcept
 Scale the projection matrix. More...
 
constexpr void setModelviewDirty () noexcept
 Sets the Modelview (Mv) matrix dirty and modified, i.e. More...
 
constexpr void setProjectionDirty () noexcept
 Sets the Projection (P) matrix dirty and modified, i.e. More...
 
constexpr void setTextureDirty () noexcept
 Sets the Texture (T) matrix modified. More...
 
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. More...
 
constexpr PMVMatrix4translateMv (float x, float y, float z) noexcept
 Translate the modelview matrix. More...
 
constexpr PMVMatrix4translateP (const Vec3 &t) noexcept
 Translate the projection matrix. More...
 
constexpr PMVMatrix4translateP (float x, float y, float z) noexcept
 Translate the projection matrix. More...
 
bool update ()
 Update the derived inverse modelview (Mvi), inverse transposed modelview (Mvit) matrices if they are dirty and requested via the constructor PMVMatrix4(int). More...
 

Static Public Attributes

static constexpr const uint32_t FRUSTUM = 1 << 3
 Bit value for frustum and updated by getFrustum(). More...
 
static constexpr const uint32_t INVERSE_MODELVIEW = 1 << 1
 Bit value for inverse modelview matrix (Mvi), updated via update(). More...
 
static constexpr const uint32_t INVERSE_TRANSPOSED_MODELVIEW = 1 << 2
 Bit value for inverse transposed modelview matrix (Mvit), updated via update(). More...
 
static constexpr const uint32_t MANUAL_BITS = FRUSTUM | PREMUL_PMV | PREMUL_PMVI
 Manual bits not covered by update() but getFrustum(), FRUSTUM, getPMv(), PREMUL_PMV, getPMvi(), PREMUL_PMVI, etc. More...
 
static constexpr const uint32_t MODIFIED_ALL = MODIFIED_PROJECTION | MODIFIED_MODELVIEW | MODIFIED_TEXTURE
 Bit value stating all is modified. More...
 
static constexpr const uint32_t MODIFIED_MODELVIEW = 1 << 1
 Bit value stating a modified modelview matrix (Mv), since last update() call. More...
 
static constexpr const uint32_t MODIFIED_PROJECTION = 1 << 0
 Bit value stating a modified projection matrix (P), since last update() call. More...
 
static constexpr const uint32_t MODIFIED_TEXTURE = 1 << 2
 Bit value stating a modified texture matrix (T), since last update() call. More...
 
static constexpr const uint32_t PREMUL_PMV = 1 << 4
 Bit value for pre-multiplied P * Mv, updated by getPMv(). More...
 
static constexpr const uint32_t PREMUL_PMVI = 1 << 5
 Bit value for pre-multiplied invert(P * Mv), updated by getPMvi(). More...
 

Detailed Description

template<typename Value_type, std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
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.

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 84 of file pmvmat4f.hpp.

Member Typedef Documentation

◆ value_type

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
typedef Value_type jau::math::util::PMVMatrix4< Value_type, >::value_type

Definition at line 86 of file pmvmat4f.hpp.

◆ pointer

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
typedef value_type* jau::math::util::PMVMatrix4< Value_type, >::pointer

Definition at line 87 of file pmvmat4f.hpp.

◆ const_pointer

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
typedef const value_type* jau::math::util::PMVMatrix4< Value_type, >::const_pointer

Definition at line 88 of file pmvmat4f.hpp.

◆ reference

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
typedef value_type& jau::math::util::PMVMatrix4< Value_type, >::reference

Definition at line 89 of file pmvmat4f.hpp.

◆ const_reference

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
typedef const value_type& jau::math::util::PMVMatrix4< Value_type, >::const_reference

Definition at line 90 of file pmvmat4f.hpp.

◆ iterator

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
typedef value_type* jau::math::util::PMVMatrix4< Value_type, >::iterator

Definition at line 91 of file pmvmat4f.hpp.

◆ const_iterator

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
typedef const value_type* jau::math::util::PMVMatrix4< Value_type, >::const_iterator

Definition at line 92 of file pmvmat4f.hpp.

◆ Vec3

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
typedef Vector3F<value_type, std::is_floating_point_v<Value_type> > jau::math::util::PMVMatrix4< Value_type, >::Vec3

Definition at line 94 of file pmvmat4f.hpp.

◆ Vec4

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
typedef Vector4F<value_type, std::is_floating_point_v<Value_type> > jau::math::util::PMVMatrix4< Value_type, >::Vec4

Definition at line 95 of file pmvmat4f.hpp.

◆ Ray3

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
typedef Ray3F<value_type, std::is_floating_point_v<Value_type> > jau::math::util::PMVMatrix4< Value_type, >::Ray3

Definition at line 96 of file pmvmat4f.hpp.

◆ Mat4

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
typedef Matrix4<value_type, std::is_floating_point_v<Value_type> > jau::math::util::PMVMatrix4< Value_type, >::Mat4

Definition at line 97 of file pmvmat4f.hpp.

◆ SyncMat4

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
typedef SyncMatrix4<value_type, std::is_floating_point_v<Value_type> > jau::math::util::PMVMatrix4< Value_type, >::SyncMat4

Definition at line 98 of file pmvmat4f.hpp.

◆ SyncMats4

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
typedef SyncMatrices4<value_type, std::is_floating_point_v<Value_type> > jau::math::util::PMVMatrix4< Value_type, >::SyncMats4

Definition at line 99 of file pmvmat4f.hpp.

Constructor & Destructor Documentation

◆ PMVMatrix4() [1/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
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 or INVERSE_TRANSPOSED_MODELVIEW matrices.

See also
PMVMatrix4(int)

Definition at line 209 of file pmvmat4f.hpp.

◆ PMVMatrix4() [2/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
jau::math::util::PMVMatrix4< Value_type, >::PMVMatrix4 ( int  derivedMatrices)
inlinenoexcept

Creates an instance of PMVMatrix4.

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

  • INVERSE_MODELVIEW
  • 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. getSyncMvi(), to the actual Mat4 instances.

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

Definition at line 228 of file pmvmat4f.hpp.

Member Function Documentation

◆ reset()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr void jau::math::util::PMVMatrix4< Value_type, >::reset ( )
inlineconstexprnoexcept

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

Definition at line 238 of file pmvmat4f.hpp.

Here is the caller graph for this function:

◆ getT() [1/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 260 of file pmvmat4f.hpp.

◆ getT() [2/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const Mat4 & jau::math::util::PMVMatrix4< Value_type, >::getT ( ) const
inlineconstexprnoexcept

Definition at line 261 of file pmvmat4f.hpp.

◆ getSyncT() [1/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr SyncMat4 & jau::math::util::PMVMatrix4< Value_type, >::getSyncT ( )
inlineconstexprnoexcept

Returns the SyncMatrix of texture matrix (T).

See matrix storage details.

Definition at line 269 of file pmvmat4f.hpp.

◆ getSyncT() [2/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const SyncMats4 & jau::math::util::PMVMatrix4< Value_type, >::getSyncT ( ) const
inlineconstexprnoexcept

Definition at line 270 of file pmvmat4f.hpp.

◆ getP() [1/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 281 of file pmvmat4f.hpp.

Here is the caller graph for this function:

◆ getP() [2/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const Mat4 & jau::math::util::PMVMatrix4< Value_type, >::getP ( ) const
inlineconstexprnoexcept

Definition at line 282 of file pmvmat4f.hpp.

◆ getSyncP() [1/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr SyncMat4 & jau::math::util::PMVMatrix4< Value_type, >::getSyncP ( )
inlineconstexprnoexcept

Returns the SyncMatrix of projection matrix (P).

See matrix storage details.

Definition at line 290 of file pmvmat4f.hpp.

◆ getSyncP() [2/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const SyncMats4 & jau::math::util::PMVMatrix4< Value_type, >::getSyncP ( ) const
inlineconstexprnoexcept

Definition at line 291 of file pmvmat4f.hpp.

◆ getMv() [1/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 302 of file pmvmat4f.hpp.

Here is the caller graph for this function:

◆ getMv() [2/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const Mat4 & jau::math::util::PMVMatrix4< Value_type, >::getMv ( ) const
inlineconstexprnoexcept

Definition at line 303 of file pmvmat4f.hpp.

◆ getSyncMv() [1/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr SyncMat4 & jau::math::util::PMVMatrix4< Value_type, >::getSyncMv ( )
inlineconstexprnoexcept

Returns the SyncMatrix of modelview matrix (Mv).

See matrix storage details.

Definition at line 311 of file pmvmat4f.hpp.

◆ getSyncMv() [2/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const SyncMats4 & jau::math::util::PMVMatrix4< Value_type, >::getSyncMv ( ) const
inlineconstexprnoexcept

Definition at line 312 of file pmvmat4f.hpp.

◆ getSyncPMv() [1/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr SyncMats4f & jau::math::util::PMVMatrix4< Value_type, >::getSyncPMv ( )
inlineconstexprnoexcept

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

See matrix storage details.

Definition at line 320 of file pmvmat4f.hpp.

◆ getSyncPMv() [2/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const SyncMats4f & jau::math::util::PMVMatrix4< Value_type, >::getSyncPMv ( ) const
inlineconstexprnoexcept

Definition at line 321 of file pmvmat4f.hpp.

◆ getMvi()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
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 330 of file pmvmat4f.hpp.

◆ getSyncMvi()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
SyncMat4 & jau::math::util::PMVMatrix4< Value_type, >::getSyncMvi ( )
inline

Returns the 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 345 of file pmvmat4f.hpp.

◆ getMvit()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
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 359 of file pmvmat4f.hpp.

◆ getSyncMvit()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
SyncMat4 & jau::math::util::PMVMatrix4< Value_type, >::getSyncMvit ( )
inline

Returns the 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 374 of file pmvmat4f.hpp.

◆ getSyncPMvMvi()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
SyncMats4f & jau::math::util::PMVMatrix4< Value_type, >::getSyncPMvMvi ( )
inline

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

See matrix storage details.

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

Definition at line 388 of file pmvmat4f.hpp.

◆ getSyncPMvMviMvit()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
SyncMats4f & jau::math::util::PMVMatrix4< Value_type, >::getSyncPMvMviMvit ( )
inline

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

See matrix storage details.

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

Definition at line 402 of file pmvmat4f.hpp.

◆ getMulPMv()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 421 of file pmvmat4f.hpp.

Here is the caller graph for this function:

◆ getMulMvP()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 433 of file pmvmat4f.hpp.

◆ mulWithMv() [1/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr Vec4 & jau::math::util::PMVMatrix4< Value_type, >::mulWithMv ( const Vec4 v_in,
Vec4 v_out 
)
inlineconstexprnoexcept

v_out = Mv * 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 443 of file pmvmat4f.hpp.

◆ mulWithMv() [2/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr Vec4 & jau::math::util::PMVMatrix4< Value_type, >::mulWithMv ( Vec4 v_inout)
inlineconstexprnoexcept

v_inout = Mv * v_inout

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

Definition at line 452 of file pmvmat4f.hpp.

◆ mulWithMv() [3/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr Vec3 & jau::math::util::PMVMatrix4< Value_type, >::mulWithMv ( const Vec3 v_in,
Vec3 v_out 
)
inlineconstexprnoexcept

v_out = Mv * 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 465 of file pmvmat4f.hpp.

◆ loadMv() [1/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type, >::loadMv ( float  values[])
inlineconstexprnoexcept

Load the modelview matrix with the provided values.

Definition at line 476 of file pmvmat4f.hpp.

◆ loadMv() [2/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 484 of file pmvmat4f.hpp.

◆ loadMv() [3/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 492 of file pmvmat4f.hpp.

◆ loadP() [1/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type, >::loadP ( float  values[])
inlineconstexprnoexcept

Load the projection matrix with the provided values.

Definition at line 501 of file pmvmat4f.hpp.

◆ loadP() [2/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 509 of file pmvmat4f.hpp.

◆ loadP() [3/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 517 of file pmvmat4f.hpp.

◆ loadT() [1/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type, >::loadT ( float  values[])
inlineconstexprnoexcept

Load the texture matrix with the provided values.

Definition at line 526 of file pmvmat4f.hpp.

◆ loadT() [2/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 534 of file pmvmat4f.hpp.

◆ loadT() [3/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 542 of file pmvmat4f.hpp.

◆ loadMvIdentity()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type, >::loadMvIdentity ( )
inlineconstexprnoexcept

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

Definition at line 551 of file pmvmat4f.hpp.

◆ loadPIdentity()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type, >::loadPIdentity ( )
inlineconstexprnoexcept

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

Definition at line 560 of file pmvmat4f.hpp.

◆ loadTIdentity()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type, >::loadTIdentity ( )
inlineconstexprnoexcept

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

Definition at line 569 of file pmvmat4f.hpp.

◆ mulMv()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 580 of file pmvmat4f.hpp.

Here is the caller graph for this function:

◆ mulP()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 591 of file pmvmat4f.hpp.

Here is the caller graph for this function:

◆ mulT()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 602 of file pmvmat4f.hpp.

◆ translateMv() [1/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 615 of file pmvmat4f.hpp.

◆ translateMv() [2/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 624 of file pmvmat4f.hpp.

◆ translateP() [1/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 636 of file pmvmat4f.hpp.

◆ translateP() [2/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 645 of file pmvmat4f.hpp.

◆ scaleMv() [1/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 657 of file pmvmat4f.hpp.

◆ scaleMv() [2/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 666 of file pmvmat4f.hpp.

◆ scaleP() [1/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 678 of file pmvmat4f.hpp.

◆ scaleP() [2/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 687 of file pmvmat4f.hpp.

◆ rotateMv() [1/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
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 702 of file pmvmat4f.hpp.

◆ rotateMv() [2/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
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 716 of file pmvmat4f.hpp.

◆ rotateMv() [3/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 725 of file pmvmat4f.hpp.

◆ rotateP() [1/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
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 740 of file pmvmat4f.hpp.

◆ rotateP() [2/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
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 754 of file pmvmat4f.hpp.

◆ rotateP() [3/3]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 763 of file pmvmat4f.hpp.

◆ popMv()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr_cxx20 PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type, >::popMv ( )
inlinenoexcept

Pop the modelview matrix from its stack.

Definition at line 769 of file pmvmat4f.hpp.

◆ popP()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr_cxx20 PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type, >::popP ( )
inlinenoexcept

Pop the projection matrix from its stack.

Definition at line 775 of file pmvmat4f.hpp.

◆ popT()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr_cxx20 PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type, >::popT ( )
inlinenoexcept

Pop the texture matrix from its stack.

Definition at line 781 of file pmvmat4f.hpp.

◆ pushMv()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr_cxx20 PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type, >::pushMv ( )
inlinenoexcept

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

Definition at line 787 of file pmvmat4f.hpp.

◆ pushP()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr_cxx20 PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type, >::pushP ( )
inlinenoexcept

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

Definition at line 792 of file pmvmat4f.hpp.

◆ pushT()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr_cxx20 PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type, >::pushT ( )
inlinenoexcept

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

Definition at line 797 of file pmvmat4f.hpp.

◆ orthoP()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 812 of file pmvmat4f.hpp.

Here is the caller graph for this function:

◆ frustumP()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
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 824 of file pmvmat4f.hpp.

◆ perspectiveP()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
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 843 of file pmvmat4f.hpp.

◆ lookAtP()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr PMVMatrix4 & jau::math::util::PMVMatrix4< Value_type, >::lookAtP ( const Vec3 eye,
const Vec3 center,
const Vec3 up 
)
inlineconstexprnoexcept

Multiply the projection matrix with the eye, object and orientation, i.e.

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

Definition at line 853 of file pmvmat4f.hpp.

◆ mapObjToWin()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
bool jau::math::util::PMVMatrix4< Value_type, >::mapObjToWin ( const Vec3 objPos,
const Recti viewport,
Vec3 winPos 
)
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 871 of file pmvmat4f.hpp.

Here is the caller graph for this function:

◆ mapWinToObj()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
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 888 of file pmvmat4f.hpp.

◆ mapWinToObj4()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
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 
)
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 913 of file pmvmat4f.hpp.

◆ mapWinToRay()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
bool jau::math::util::PMVMatrix4< Value_type, >::mapWinToRay ( 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.

The resulting Ray maybe used for picking using a bounding box.

Notes for picking winz0 and winz1:

Parameters
winx
winy
winz0
winz1
viewport
raystorage for the resulting Ray
Returns
true if successful, otherwise false (failed to invert matrix, or becomes z is infinity)

Definition at line 942 of file pmvmat4f.hpp.

◆ toString() [1/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
std::string & jau::math::util::PMVMatrix4< Value_type, >::toString ( std::string &  sb,
const std::string &  f 
) const
inlinenoexcept

Definition at line 947 of file pmvmat4f.hpp.

◆ toString() [2/2]

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
std::string jau::math::util::PMVMatrix4< Value_type, >::toString ( ) const
inlinenoexcept

Definition at line 1008 of file pmvmat4f.hpp.

Here is the caller graph for this function:

◆ getModifiedBits()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr uint32_t 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
MODIFIED_PROJECTION
MODIFIED_MODELVIEW
MODIFIED_TEXTURE
getDirtyBits()
isReqDirty()

Definition at line 1028 of file pmvmat4f.hpp.

◆ getDirtyBits()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr uint32_t 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()
INVERSE_MODELVIEW
INVERSE_TRANSPOSED_MODELVIEW
FRUSTUM
PMVMatrix4(int)
getMvi()
getMvit()
getSyncPMvMvi()
getSyncPMvMviMvit()
getFrustum()

Definition at line 1061 of file pmvmat4f.hpp.

◆ isReqDirty()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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_TRANSPOSED_MODELVIEW
PMVMatrix4(int)
getMvi()
getMvit()
getSyncPMvMvi()
getSyncPMvMviMvit()

Definition at line 1086 of file pmvmat4f.hpp.

◆ setModelviewDirty()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr void jau::math::util::PMVMatrix4< Value_type, >::setModelviewDirty ( )
inlineconstexprnoexcept

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

adds requested bits and MANUAL_BITS to dirty bits.

See also
isReqDirty()

Definition at line 1095 of file pmvmat4f.hpp.

Here is the caller graph for this function:

◆ setProjectionDirty()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr void jau::math::util::PMVMatrix4< Value_type, >::setProjectionDirty ( )
inlineconstexprnoexcept

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

adds MANUAL_BITS to dirty bits.

Definition at line 1104 of file pmvmat4f.hpp.

Here is the caller graph for this function:

◆ setTextureDirty()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr void jau::math::util::PMVMatrix4< Value_type, >::setTextureDirty ( )
inlineconstexprnoexcept

Sets the Texture (T) matrix modified.

Definition at line 1112 of file pmvmat4f.hpp.

Here is the caller graph for this function:

◆ getReqBits()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr uint32_t jau::math::util::PMVMatrix4< Value_type, >::getReqBits ( )
inlineconstexprnoexcept

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

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

See also
INVERSE_MODELVIEW
INVERSE_TRANSPOSED_MODELVIEW
PMVMatrix4(int)
getMvi()
getMvit()
getSyncPMvMvi()
getSyncPMvMviMvit()
getFrustum()

Definition at line 1134 of file pmvmat4f.hpp.

◆ getPMv()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 1151 of file pmvmat4f.hpp.

Here is the caller graph for this function:

◆ getPMvi()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr 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 1173 of file pmvmat4f.hpp.

Here is the caller graph for this function:

◆ getFrustum()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
jau::math::geom::Frustum jau::math::util::PMVMatrix4< Value_type, >::getFrustum ( )
inlinenoexcept

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 1195 of file pmvmat4f.hpp.

◆ update()

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
bool jau::math::util::PMVMatrix4< Value_type, >::update ( )
inline

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.

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. getSyncMvit(). 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()
INVERSE_MODELVIEW
INVERSE_TRANSPOSED_MODELVIEW
PMVMatrix4(int)
getMvi()
getMvit()
getSyncPMvMvi()
getSyncPMvMviMvit()

Definition at line 1249 of file pmvmat4f.hpp.

Member Data Documentation

◆ MODIFIED_PROJECTION

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const uint32_t jau::math::util::PMVMatrix4< Value_type, >::MODIFIED_PROJECTION = 1 << 0
staticconstexpr

Bit value stating a modified projection matrix (P), since last update() call.

Definition at line 182 of file pmvmat4f.hpp.

◆ MODIFIED_MODELVIEW

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const uint32_t jau::math::util::PMVMatrix4< Value_type, >::MODIFIED_MODELVIEW = 1 << 1
staticconstexpr

Bit value stating a modified modelview matrix (Mv), since last update() call.

Definition at line 184 of file pmvmat4f.hpp.

◆ MODIFIED_TEXTURE

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const uint32_t jau::math::util::PMVMatrix4< Value_type, >::MODIFIED_TEXTURE = 1 << 2
staticconstexpr

Bit value stating a modified texture matrix (T), since last update() call.

Definition at line 186 of file pmvmat4f.hpp.

◆ MODIFIED_ALL

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const uint32_t jau::math::util::PMVMatrix4< Value_type, >::MODIFIED_ALL = MODIFIED_PROJECTION | MODIFIED_MODELVIEW | MODIFIED_TEXTURE
staticconstexpr

Bit value stating all is modified.

Definition at line 188 of file pmvmat4f.hpp.

◆ INVERSE_MODELVIEW

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const uint32_t jau::math::util::PMVMatrix4< Value_type, >::INVERSE_MODELVIEW = 1 << 1
staticconstexpr

Bit value for inverse modelview matrix (Mvi), updated via update().

Definition at line 190 of file pmvmat4f.hpp.

◆ INVERSE_TRANSPOSED_MODELVIEW

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const uint32_t jau::math::util::PMVMatrix4< Value_type, >::INVERSE_TRANSPOSED_MODELVIEW = 1 << 2
staticconstexpr

Bit value for inverse transposed modelview matrix (Mvit), updated via update().

Definition at line 192 of file pmvmat4f.hpp.

◆ FRUSTUM

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const uint32_t jau::math::util::PMVMatrix4< Value_type, >::FRUSTUM = 1 << 3
staticconstexpr

Bit value for frustum and updated by getFrustum().

Definition at line 194 of file pmvmat4f.hpp.

◆ PREMUL_PMV

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const uint32_t jau::math::util::PMVMatrix4< Value_type, >::PREMUL_PMV = 1 << 4
staticconstexpr

Bit value for pre-multiplied P * Mv, updated by getPMv().

Definition at line 196 of file pmvmat4f.hpp.

◆ PREMUL_PMVI

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const uint32_t jau::math::util::PMVMatrix4< Value_type, >::PREMUL_PMVI = 1 << 5
staticconstexpr

Bit value for pre-multiplied invert(P * Mv), updated by getPMvi().

Definition at line 198 of file pmvmat4f.hpp.

◆ MANUAL_BITS

template<typename Value_type , std::enable_if_t< std::is_floating_point_v< Value_type >, bool > = true>
constexpr const uint32_t jau::math::util::PMVMatrix4< Value_type, >::MANUAL_BITS = FRUSTUM | PREMUL_PMV | PREMUL_PMVI
staticconstexpr

Manual bits not covered by update() but getFrustum(), FRUSTUM, getPMv(), PREMUL_PMV, getPMvi(), PREMUL_PMVI, etc.

Definition at line 200 of file pmvmat4f.hpp.


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