DSC
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Public Types | Public Member Functions | List of all members
CGLA::ArithSqMat4x4Float< VT, M > Class Template Reference

4 by 4 float matrix template. More...

#include <ArithSqMat4x4Float.h>

Inheritance diagram for CGLA::ArithSqMat4x4Float< VT, M >:
CGLA::ArithSqMatFloat< VT, M, 4 > CGLA::ArithMatFloat< VT, VT, M, ROWS >

Public Types

typedef VT VectorType
 Vector type.
 
typedef VT::ScalarType ScalarType
 The type of a matrix element.
 
- Public Types inherited from CGLA::ArithSqMatFloat< VT, M, 4 >
typedef VT VectorType
 Vector type.
 
typedef VT::ScalarType ScalarType
 The type of a matrix element.
 
- Public Types inherited from CGLA::ArithMatFloat< VT, VT, M, ROWS >
typedef VT HVectorType
 Horizontal vector type.
 
typedef VT VVectorType
 Vertical vector type.
 
typedef VT::ScalarType ScalarType
 The type of a matrix element.
 

Public Member Functions

 ArithSqMat4x4Float (VT a, VT b, VT c, VT d) noexcept
 Construct a Mat4x4f from four V vectors.
 
 ArithSqMat4x4Float () noexcept
 Construct the NAN matrix.
 
 ArithSqMat4x4Float (ScalarType _a) noexcept
 Construct matrix where all values are equal to constructor argument.
 
template<class T , class VecT >
const VecT mul_3D_vector (const ArithVec3Float< T, VecT > &v_in) const
 
template<class T , class VecT >
const VecT mul_3D_point (const ArithVec3Float< T, VecT > &v_in) const
 
template<class T , class VecT >
const VecT project_3D_point (const ArithVec3Float< T, VecT > &v_in) const
 
- Public Member Functions inherited from CGLA::ArithSqMatFloat< VT, M, 4 >
const M & operator*= (const M &m2) noexcept
 
const M & operator*= (ScalarType k) noexcept
 
void identity ()
 
- Public Member Functions inherited from CGLA::ArithMatFloat< VT, VT, M, ROWS >
const ScalarTypeget () const
 
ScalarTypeget ()
 
const VT & operator[] (unsigned int i) const
 Const index operator. Returns i'th row of matrix.
 
VT & operator[] (unsigned int i)
 Non-const index operator. Returns i'th row of matrix.
 
bool operator== (const M &v) const
 Equality operator.
 
bool operator!= (const M &v) const
 Inequality operator.
 
const M operator* (ScalarType k) const
 Multiply scalar onto matrix. All entries are multiplied by scalar.
 
const M operator/ (ScalarType k) const
 Divide all entries in matrix by scalar.
 
const M & operator*= (ScalarType k)
 Assignment multiplication of matrix by scalar.
 
const M & operator/= (ScalarType k)
 Assignment division of matrix by scalar.
 
const M operator+ (const M &m1) const
 Add two matrices.
 
const M operator- (const M &m1) const
 Subtract two matrices.
 
const M operator- () const
 Negate matrix.
 
const M & operator+= (const M &v)
 Assigment addition of matrices.
 
const M & operator-= (const M &v)
 Assigment subtraction of matrices.
 

Additional Inherited Members

- Static Public Member Functions inherited from CGLA::ArithMatFloat< VT, VT, M, ROWS >
static unsigned int get_v_dim ()
 Get vertical dimension of matrix.
 
static unsigned int get_h_dim ()
 Get horizontal dimension of matrix.
 
- Protected Member Functions inherited from CGLA::ArithSqMatFloat< VT, M, 4 >
 ArithSqMatFloat () noexcept
 Construct 0 matrix.
 
 ArithSqMatFloat (ScalarType _a) noexcept
 Construct matrix where all values are equal to constructor argument.
 
 ArithSqMatFloat (VT _a, VT _b) noexcept
 Construct 2x2 Matrix from two vectors.
 
 ArithSqMatFloat (VT _a, VT _b, VT _c) noexcept
 Construct 3x3 Matrix from three vectors.
 
 ArithSqMatFloat (VT _a, VT _b, VT _c, VT _d) noexcept
 Construct 4x4 Matrix from four vectors.
 
- Protected Member Functions inherited from CGLA::ArithMatFloat< VT, VT, M, ROWS >
 ArithMatFloat ()
 Construct 0 matrix.
 
 ArithMatFloat (ScalarType x)
 Construct a matrix where all entries are the same.
 
 ArithMatFloat (VT_a)
 Construct a matrix where all rows are the same.
 
 ArithMatFloat (VT_a, VT_b)
 Construct a matrix with two rows.
 
 ArithMatFloat (VT_a, VT_b, VT_c)
 Construct a matrix with three rows.
 
 ArithMatFloat (VT_a, VT_b, VT_c, VT_d)
 Construct a matrix with four rows.
 
- Protected Attributes inherited from CGLA::ArithMatFloat< VT, VT, M, ROWS >
VT data [ROWS]
 The actual contents of the matrix.
 

Detailed Description

template<class VT, class M>
class CGLA::ArithSqMat4x4Float< VT, M >

4 by 4 float matrix template.

this class template is useful for transformations such as perspective projections or translation where 3x3 matrices do not suffice.

Member Function Documentation

template<class VT, class M>
template<class T , class VecT >
const VecT CGLA::ArithSqMat4x4Float< VT, M >::mul_3D_point ( const ArithVec3Float< T, VecT > &  v_in) const
inline

Multiply 3D point onto matrix. Here the fourth coordinate becomes 1 to ensure that the point is translated. Note that the vector is converted back into a Vec3f without any division by w. This is deliberate: Typically, w=1 except for projections. If we are doing projection, we can use project_3D_point instead

template<class VT, class M>
template<class T , class VecT >
const VecT CGLA::ArithSqMat4x4Float< VT, M >::mul_3D_vector ( const ArithVec3Float< T, VecT > &  v_in) const
inline

Multiply vector onto matrix. Here the fourth coordinate is se to 0. This removes any translation from the matrix. Useful if one wants to transform a vector which does not represent a point but a direction. Note that this is not correct for transforming normal vectors if the matric contains anisotropic scaling.

template<class VT, class M>
template<class T , class VecT >
const VecT CGLA::ArithSqMat4x4Float< VT, M >::project_3D_point ( const ArithVec3Float< T, VecT > &  v_in) const
inline

Multiply 3D point onto matrix. We set w=1 before multiplication and divide by w after multiplication.


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