Ocean
|
This class implements a 4x4 square matrix. More...
Public Types | |
typedef T | Type |
Definition of the used data type. More... | |
Public Member Functions | |
SquareMatrixT4 () | |
Creates a new SquareMatrixT4 object with undefined elements. More... | |
SquareMatrixT4 (const SquareMatrixT4< T > &matrix)=default | |
Copy constructor. More... | |
template<typename U > | |
SquareMatrixT4 (const SquareMatrixT4< U > &matrix) | |
Copy constructor for a matrix with difference element data type than T. More... | |
SquareMatrixT4 (const bool setToIdentity) | |
Creates a new SquareMatrixT4 object. More... | |
template<typename U > | |
SquareMatrixT4 (const U *arrayValues) | |
Creates a new SquareMatrixT4 object by an array of at least sixteen elements of float type U. More... | |
SquareMatrixT4 (const T *arrayValues) | |
Creates a new SquareMatrixT4 object by an array of at least sixteen elements. More... | |
template<typename U > | |
SquareMatrixT4 (const U *arrayValues, const bool valuesRowAligned) | |
Creates a new SquareMatrixT4 object by an array of at least sixteen elements of float type U. More... | |
SquareMatrixT4 (const T *arrayValues, const bool valuesRowAligned) | |
Creates a new SquareMatrixT4 object by an array of at least sixteen elements. More... | |
SquareMatrixT4 (const HomogenousMatrixT4< T > &transformation) | |
Creates a new SquareMatrixT4 object by given transformation matrix. More... | |
SquareMatrixT4 (const SquareMatrixT3< T > &subMatrix) | |
Creates a new SquareMatrixT4 object by given 3x3 sub matrix. More... | |
SquareMatrixT4 (const VectorT4< T > &diagonal) | |
Creates a new SquareMatrixT4 object by a given diagonal vector. More... | |
SquareMatrixT4< T > | transposed () const |
Returns the transposed of this matrix. More... | |
void | transpose () |
Transposes the matrix. More... | |
SquareMatrixT4< T > | inverted () const |
Returns the inverted matrix of this matrix. More... | |
bool | invert () |
Inverts this matrix in place. More... | |
bool | invert (SquareMatrixT4< T > &invertedMatrix) const |
Inverts the matrix and returns the result. More... | |
T | determinant () const |
Returns the determinant of the matrix. More... | |
T | trace () const |
Returns the trace of the matrix which is the sum of the diagonal elements. More... | |
void | toIdentity () |
Sets the matrix to the identity matrix. More... | |
void | toNull () |
Sets the matrix to a zero matrix. More... | |
bool | isNull () const |
Returns whether this matrix is a null matrix. More... | |
bool | isIdentity () const |
Returns whether this matrix is the identity matrix. More... | |
bool | isSingular () const |
Returns whether this matrix is singular (and thus cannot be inverted). More... | |
bool | isSymmetric (const T epsilon=NumericT< T >::eps()) const |
Returns whether this matrix is symmetric. More... | |
bool | isEqual (const SquareMatrixT4< T > &matrix, const T eps=NumericT< T >::eps()) const |
Returns whether two matrices are almost identical up to a specified epsilon. More... | |
bool | eigenSystem (VectorT4< T > &eigenValues, SquareMatrixT4< T > &eigenVectors) |
Performs an eigen value analysis. More... | |
const T * | data () const |
Returns a pointer to the internal values. More... | |
T * | data () |
Returns a pointer to the internal values. More... | |
template<typename U > | |
void | copyElements (U *arrayValues) const |
Copies the elements of this matrix to an array with floating point values of type U. More... | |
void | copyElements (T *arrayValues) const |
Copies the elements of this matrix to an array with floating point values. More... | |
SquareMatrixT4< T > & | operator= (const SquareMatrixT4< T > &)=default |
Default assign operator. More... | |
bool | operator== (const SquareMatrixT4< T > &matrix) const |
Returns whether two matrices are identical up to a small epsilon. More... | |
bool | operator!= (const SquareMatrixT4< T > &matrix) const |
Returns whether two matrices are not identical up to a small epsilon. More... | |
SquareMatrixT4< T > | operator+ (const SquareMatrixT4< T > &matrix) const |
Adds two matrices. More... | |
SquareMatrixT4< T > & | operator+= (const SquareMatrixT4< T > &matrix) |
Adds and assigns two matrices. More... | |
SquareMatrixT4< T > | operator- (const SquareMatrixT4< T > &matrix) const |
Subtracts two matrices. More... | |
SquareMatrixT4< T > & | operator-= (const SquareMatrixT4< T > &matrix) |
Subtracts and assigns two matrices. More... | |
SquareMatrixT4< T > | operator- () const |
Returns the negative matrix of this matrix (all matrix elements are multiplied by -1). More... | |
OCEAN_FORCE_INLINE SquareMatrixT4< T > | operator* (const SquareMatrixT4< T > &matrix) const |
Multiplies two matrices. More... | |
OCEAN_FORCE_INLINE SquareMatrixT4< T > | operator* (const HomogenousMatrixT4< T > &matrix) const |
Multiplies two matrices. More... | |
OCEAN_FORCE_INLINE SquareMatrixT4< T > & | operator*= (const SquareMatrixT4< T > &matrix) |
Multiplies and assigns two matrices. More... | |
OCEAN_FORCE_INLINE SquareMatrixT4< T > & | operator*= (const HomogenousMatrixT4< T > &matrix) |
Multiplies and assigns two matrices. More... | |
OCEAN_FORCE_INLINE VectorT3< T > | operator* (const VectorT3< T > &vector) const |
Multiply operator for a 3D vector. More... | |
OCEAN_FORCE_INLINE VectorT4< T > | operator* (const VectorT4< T > &vector) const |
Multiply operator for a 4D vector. More... | |
SquareMatrixT4< T > | operator* (const T value) const |
Multiplies this matrix with a scalar value. More... | |
SquareMatrixT4< T > & | operator*= (const T value) |
Multiplies and assigns this matrix with a scalar value. More... | |
T | operator[] (const unsigned int index) const |
Element operator. More... | |
T & | operator[] (const unsigned int index) |
Element operator. More... | |
T | operator() (const unsigned int row, const unsigned int column) const |
Element operator. More... | |
T & | operator() (const unsigned int row, const unsigned int column) |
Element operator. More... | |
T | operator() (const unsigned int index) const |
Element operator. More... | |
T & | operator() (const unsigned int index) |
Element operator. More... | |
const T * | operator() () const |
Access operator. More... | |
T * | operator() () |
Access operator. More... | |
size_t | operator() (const SquareMatrixT4< T > &matrix) const |
Hash function. More... | |
OCEAN_FORCE_INLINE SquareMatrixT4< double > | operator* (const SquareMatrixT4< double > &matrix) const |
OCEAN_FORCE_INLINE SquareMatrixT4< float > | operator* (const SquareMatrixT4< float > &matrix) const |
OCEAN_FORCE_INLINE SquareMatrixT4< float > | operator* (const SquareMatrixT4< float > &matrix) const |
OCEAN_FORCE_INLINE VectorT4< double > | operator* (const VectorT4< double > &vector) const |
OCEAN_FORCE_INLINE VectorT4< double > | operator* (const VectorT4< double > &vector) const |
OCEAN_FORCE_INLINE VectorT4< double > | operator* (const VectorT4< double > &vector) const |
OCEAN_FORCE_INLINE VectorT4< float > | operator* (const VectorT4< float > &vector) const |
OCEAN_FORCE_INLINE VectorT4< float > | operator* (const VectorT4< float > &vector) const |
OCEAN_FORCE_INLINE VectorT4< double > | operator* (const VectorT4< double > &vector) const |
OCEAN_FORCE_INLINE VectorT4< float > | operator* (const VectorT4< float > &vector) const |
void | multiply (const SquareMatrixT4< double > &matrix, const VectorT4< double > *vectors, VectorT4< double > *results, const size_t number) |
void | multiply (const SquareMatrixT4< float > &matrix, const VectorT4< float > *vectors, VectorT4< float > *results, const size_t number) |
void | multiply (const SquareMatrixT4< double > &matrix, const VectorT4< double > *vectors, VectorT4< double > *results, const size_t number) |
void | multiply (const SquareMatrixT4< float > &matrix, const VectorT4< float > *vectors, VectorT4< float > *results, const size_t number) |
void | multiply (const SquareMatrixT4< double > &matrix, const VectorT4< double > *vectors, VectorT4< double > *results, const size_t number) |
void | multiply (const SquareMatrixT4< float > &matrix, const VectorT4< float > *vectors, VectorT4< float > *results, const size_t number) |
std::vector< SquareMatrixT4< float > > | matrices2matrices (const std::vector< SquareMatrixT4< float > > &matrices) |
std::vector< SquareMatrixT4< double > > | matrices2matrices (const std::vector< SquareMatrixT4< double > > &matrices) |
Static Public Member Functions | |
static size_t | elements () |
Returns the number of elements this matrix has. More... | |
static void | multiply (const SquareMatrixT4< T > &matrix, const VectorT4< T > *vectors, VectorT4< T > *results, const size_t number) |
Multiplies several 4D vectors with a given matrix. More... | |
static SquareMatrixT4< T > | projectionMatrix (const T fovX, const T aspectRatio, const T nearDistance, const T farDistance) |
Creates a projection matrix defined by the horizontal field of view, the aspect ratio and the near and far clipping plane. More... | |
static SquareMatrixT4< T > | projectionMatrix (const AnyCameraT< T > &anyCamera, const T nearDistance, const T farDistance) |
Creates a projection matrix defined by a camera profile of a pinhole camera and the near and far clipping plane. More... | |
static SquareMatrixT4< T > | frustumMatrix (const T left, const T right, const T top, const T bottom, const T nearDistance, const T farDistance) |
Creates a projection matrix defined by an asymmetric viewing frustum. More... | |
static SquareMatrixT4< T > | frustumMatrix (const T width, const T height, const HomogenousMatrixT4< T > &viewingMatrix, const T nearDistance, const T farDistance) |
Creates a project matrix defined by an asymmetric viewing frustum. More... | |
template<typename U > | |
static std::vector< SquareMatrixT4< T > > | matrices2matrices (const std::vector< SquareMatrixT4< U > > &matrices) |
Converts matrices with specific data type to matrices with different data type. More... | |
template<typename U > | |
static std::vector< SquareMatrixT4< T > > | matrices2matrices (const SquareMatrixT4< U > *matrices, const size_t size) |
Converts matrices with specific data type to matrices with different data type. More... | |
Protected Member Functions | |
void | swapRows (const unsigned int row0, const unsigned int row1) |
Swaps two rows of this matrix. More... | |
void | multiplyRow (const unsigned int row, const T scalar) |
Multiplies a row with a scalar value. More... | |
void | addRows (const unsigned int targetRow, const unsigned int sourceRow, const T scalar) |
Multiplies elements from a specific row with a scalar and adds them to another row. More... | |
Protected Attributes | |
T | values [16] |
The sixteen values of the matrix. More... | |
Friends | |
template<typename U > | |
class | SquareMatrixT4 |
This class implements a 4x4 square matrix.
The values are stored in a column aligned order with indices:
| 0 4 8 12 | | 1 5 9 13 | | 2 6 10 14 | | 3 7 11 15 |
T | Data type of matrix elements |
typedef T Ocean::SquareMatrixT4< T >::Type |
Definition of the used data type.
|
inline |
Creates a new SquareMatrixT4 object with undefined elements.
Beware: This matrix is neither a zero nor an entity matrix!
|
default |
Copy constructor.
matrix | The matrix to copy |
|
inlineexplicit |
Copy constructor for a matrix with difference element data type than T.
matrix | The matrix to copy |
U | The element data type of the second matrix |
|
explicit |
Creates a new SquareMatrixT4 object.
setToIdentity | Determines whether a entity matrix will be created |
|
explicit |
Creates a new SquareMatrixT4 object by an array of at least sixteen elements of float type U.
arrayValues | The sixteen matrix elements defining the new matrix, must be valid |
U | The floating point type of the given elements |
|
explicit |
Creates a new SquareMatrixT4 object by an array of at least sixteen elements.
arrayValues | The sixteen matrix elements defining the new matrix, must be valid |
Ocean::SquareMatrixT4< T >::SquareMatrixT4 | ( | const U * | arrayValues, |
const bool | valuesRowAligned | ||
) |
Creates a new SquareMatrixT4 object by an array of at least sixteen elements of float type U.
arrayValues | The sixteen matrix elements defining the new matrix, must be valid |
valuesRowAligned | True, if the given values are stored in a row aligned order; False, if the values are stored in a column aligned order (which is the default case for this matrix) |
U | The floating point type of the given elements |
Ocean::SquareMatrixT4< T >::SquareMatrixT4 | ( | const T * | arrayValues, |
const bool | valuesRowAligned | ||
) |
Creates a new SquareMatrixT4 object by an array of at least sixteen elements.
valuesRowAligned | True, if the given values are stored in a row aligned order; False, if the values are stored in a column aligned order (which is the default case for this matrix) |
arrayValues | The sixteen matrix elements defining the new matrix, must be valid |
|
explicit |
Creates a new SquareMatrixT4 object by given transformation matrix.
transformation | The transformation matrix to copy |
|
explicit |
Creates a new SquareMatrixT4 object by given 3x3 sub matrix.
The lower and right elements of the 4x4 square matrix are set to zero.
subMatrix | 3x3 subMatrix defining the upper left elements of the new matrix |
|
explicit |
Creates a new SquareMatrixT4 object by a given diagonal vector.
diagonal | The diagonal vector for the new matrix |
|
protected |
Multiplies elements from a specific row with a scalar and adds them to another row.
targetRow | The index of the target row, with range [0, 3] |
sourceRow | The index of the source row, with range [0, 3] |
scalar | The scalar to multiply the source elements with |
void Ocean::SquareMatrixT4< T >::copyElements | ( | T * | arrayValues | ) | const |
Copies the elements of this matrix to an array with floating point values.
arrayValues | Array with floating point values receiving the elements of this matrix |
void Ocean::SquareMatrixT4< T >::copyElements | ( | U * | arrayValues | ) | const |
Copies the elements of this matrix to an array with floating point values of type U.
arrayValues | Array with 16 floating point values of type U receiving the elements of this matrix |
U | Floating point type |
|
inline |
Returns a pointer to the internal values.
|
inline |
Returns a pointer to the internal values.
T Ocean::SquareMatrixT4< T >::determinant |
Returns the determinant of the matrix.
bool Ocean::SquareMatrixT4< T >::eigenSystem | ( | VectorT4< T > & | eigenValues, |
SquareMatrixT4< T > & | eigenVectors | ||
) |
Performs an eigen value analysis.
eigenValues | Vector holding the three eigen values |
eigenVectors | Matrix holding the three corresponding eigen vectors |
Computation of the characteristic polynomial [ a b c d ] A = [ e f g h ] [ i j k l ] [ m n o p ] [ a-x b c d ] A - x * E = [ e f-x g h ] [ i j k-x l ] [ m n o p-x ] Polynomial = Det|A - x * E| = 0 = x^4 + (-a - f - k - p)x^3 + (-be + af - ci - gj + ak + fk - dm - hn - lo + ap + fp + kp)x^2 + (cfi - bgi - cej + agj + bek - afk + dfm - bhm + dkm - clm - den + ahn + hkn - gln - dio - hjo + alo + flo + bep - afp + cip + gjp - akp - fkp)x + (dgjm - chjm - dfkm + bhkm + cflm - bglm) + (-dgin + chin + dekn - ahkn - celn + agln) + (dfio - bhio - dejo + ahjo + belo - aflo) + (-cfip + bgip + cejp - agjp - bekp + afkp) = a1x^4 + a2x^3 + a3x^2 + a4x + a5 = 0
|
inlinestatic |
Returns the number of elements this matrix has.
|
static |
Creates a projection matrix defined by an asymmetric viewing frustum.
The shape of the frustum is defined by the rectangle on the near plane.
Afterwards, the field of view is defined by the (positive) distance to the near clipping plane.
Followed by the (positive) far clipping plane to determine the entire frustum.
left | Position of the left border of the rectangle on the near plane |
right | Position of the right border of the rectangle on the near plane |
top | Position of the top border of the rectangle on the near plane |
bottom | Position of the bottom border of the rectangle on the near plane |
nearDistance | Positive distance to the near clipping plane |
farDistance | Positive distance to the far clipping plane |
Creates the following frustum projection matrix: -------------------------------------------------- | 2n/(r-l) 0 (r+l)/(r-l) 0 | | 0 2n/(t-b) (t+b)/(t-b) 0 | | 0 0 -(f+n)/(f-n) -2fn/(f-n) | | 0 0 -1 0 | --------------------------------------------------
|
static |
Creates a project matrix defined by an asymmetric viewing frustum.
The shape of the frustum is defined by the rectangle on the near plane.
The viewing position is defined by the given view matrix while the near plane is expected to lie in the origin of the coordinate system.
width | The width of the near plane, with range (0, infinity) |
height | The height of the near plane, with range (0, infinity) |
viewingMatrix | Viewing matrix transforming point defined in the camera coordinate system into points defined in the world coordinate system, must be invertible |
nearDistance | Positive distance to the near clipping plane, with range (0, infinity) |
farDistance | Positive distance to the far clipping plane, with range (nearDistance, infinity) |
bool Ocean::SquareMatrixT4< T >::invert |
Inverts this matrix in place.
bool Ocean::SquareMatrixT4< T >::invert | ( | SquareMatrixT4< T > & | invertedMatrix | ) | const |
Inverts the matrix and returns the result.
invertedMatrix | The resulting inverted matrix |
SquareMatrixT4< T > Ocean::SquareMatrixT4< T >::inverted |
Returns the inverted matrix of this matrix.
This matrix must not be singular.
Beware: This function does not throw an exception if the matrix cannot be inverted.
Thus, ensure that the matrix is invertible before calling this function.
Even better: avoid the usage of this function and call invert() instead.
In case, this matrix is not invertible, this matrix will be returned instead.
|
inline |
Returns whether two matrices are almost identical up to a specified epsilon.
matrix | Second matrix that will be checked |
eps | The epsilon threshold to be used, with range [0, infinity) |
bool Ocean::SquareMatrixT4< T >::isIdentity |
Returns whether this matrix is the identity matrix.
bool Ocean::SquareMatrixT4< T >::isNull |
Returns whether this matrix is a null matrix.
|
inline |
Returns whether this matrix is singular (and thus cannot be inverted).
A matrix is singular if the determinant of a matrix is 0.
bool Ocean::SquareMatrixT4< T >::isSymmetric | ( | const T | epsilon = NumericT<T>::eps() | ) | const |
Returns whether this matrix is symmetric.
epsilon | The epsilon threshold to be used, with range [0, infinity) |
|
inlinestatic |
Converts matrices with specific data type to matrices with different data type.
matrices | The matrices to convert |
size | The number of matrices to convert |
U | The element data type of the matrices to convert |
|
inline |
|
inline |
|
inlinestatic |
Converts matrices with specific data type to matrices with different data type.
matrices | The matrices to convert |
U | The element data type of the matrices to convert |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
Multiplies several 4D vectors with a given matrix.
matrix | The matrix to be used for multiplication, may be nullptr if number is 0 |
vectors | The input vectors that will be multiplied, may be nullptr if number is 0 |
results | The resulting output (multiplied/transformed) vectors, with same number as the provided input vectors |
number | The number of provided vectors (input and output), with range [0, infinity) |
|
protected |
Multiplies a row with a scalar value.
row | The index of the row to multiply, with range [0, 3] |
scalar | The scalar to multiply |
|
inline |
Returns whether two matrices are not identical up to a small epsilon.
matrix | Right operand |
|
inline |
Access operator.
|
inline |
Access operator.
|
inline |
Hash function.
matrix | The matrix for which the hash value will be determined |
|
inline |
Element operator.
Beware: No range check will be done!
index | The index of the element to return [0, 15] |
|
inline |
Element operator.
Beware: No range check will be done!
index | The index of the element to return [0, 15] |
|
inline |
Element operator.
Beware: No range check will be done!
row | The row of the element to return [0, 3] |
column | The column of the element to return [0, 3] |
|
inline |
Element operator.
Beware: No range check will be done!
row | The row of the element to return [0, 3] |
column | The column of the element to return [0, 3] |
OCEAN_FORCE_INLINE SquareMatrixT4< T > Ocean::SquareMatrixT4< T >::operator* | ( | const HomogenousMatrixT4< T > & | matrix | ) | const |
Multiplies two matrices.
matrix | Right operand |
OCEAN_FORCE_INLINE SquareMatrixT4< double > Ocean::SquareMatrixT4< double >::operator* | ( | const SquareMatrixT4< double > & | matrix | ) | const |
OCEAN_FORCE_INLINE SquareMatrixT4< float > Ocean::SquareMatrixT4< float >::operator* | ( | const SquareMatrixT4< float > & | matrix | ) | const |
OCEAN_FORCE_INLINE SquareMatrixT4< float > Ocean::SquareMatrixT4< float >::operator* | ( | const SquareMatrixT4< float > & | matrix | ) | const |
OCEAN_FORCE_INLINE SquareMatrixT4< T > Ocean::SquareMatrixT4< T >::operator* | ( | const SquareMatrixT4< T > & | matrix | ) | const |
Multiplies two matrices.
matrix | Right operand |
SquareMatrixT4< T > Ocean::SquareMatrixT4< T >::operator* | ( | const T | value | ) | const |
Multiplies this matrix with a scalar value.
value | Right operand |
OCEAN_FORCE_INLINE VectorT3< T > Ocean::SquareMatrixT4< T >::operator* | ( | const VectorT3< T > & | vector | ) | const |
Multiply operator for a 3D vector.
The 3D vector is interpreted as a 4D vector with fourth component equal to 1.
The final result will be de-homogenizated to provide a 3D vector result.
Beware the dot product of the last row with the vector must not be zero!
vector | Right operand |
OCEAN_FORCE_INLINE VectorT4< double > Ocean::SquareMatrixT4< double >::operator* | ( | const VectorT4< double > & | vector | ) | const |
OCEAN_FORCE_INLINE VectorT4< double > Ocean::SquareMatrixT4< double >::operator* | ( | const VectorT4< double > & | vector | ) | const |
OCEAN_FORCE_INLINE VectorT4< double > Ocean::SquareMatrixT4< double >::operator* | ( | const VectorT4< double > & | vector | ) | const |
OCEAN_FORCE_INLINE VectorT4< double > Ocean::SquareMatrixT4< double >::operator* | ( | const VectorT4< double > & | vector | ) | const |
OCEAN_FORCE_INLINE VectorT4< float > Ocean::SquareMatrixT4< float >::operator* | ( | const VectorT4< float > & | vector | ) | const |
OCEAN_FORCE_INLINE VectorT4< float > Ocean::SquareMatrixT4< float >::operator* | ( | const VectorT4< float > & | vector | ) | const |
OCEAN_FORCE_INLINE VectorT4< float > Ocean::SquareMatrixT4< float >::operator* | ( | const VectorT4< float > & | vector | ) | const |
OCEAN_FORCE_INLINE VectorT4< T > Ocean::SquareMatrixT4< T >::operator* | ( | const VectorT4< T > & | vector | ) | const |
Multiply operator for a 4D vector.
vector | Right operand |
|
inline |
Multiplies and assigns two matrices.
matrix | Right operand |
|
inline |
Multiplies and assigns two matrices.
matrix | Right operand |
SquareMatrixT4< T > & Ocean::SquareMatrixT4< T >::operator*= | ( | const T | value | ) |
Multiplies and assigns this matrix with a scalar value.
value | right operand |
SquareMatrixT4< T > Ocean::SquareMatrixT4< T >::operator+ | ( | const SquareMatrixT4< T > & | matrix | ) | const |
Adds two matrices.
matrix | Right operand |
SquareMatrixT4< T > & Ocean::SquareMatrixT4< T >::operator+= | ( | const SquareMatrixT4< T > & | matrix | ) |
Adds and assigns two matrices.
matrix | Right operand |
|
inline |
Returns the negative matrix of this matrix (all matrix elements are multiplied by -1).
SquareMatrixT4< T > Ocean::SquareMatrixT4< T >::operator- | ( | const SquareMatrixT4< T > & | matrix | ) | const |
Subtracts two matrices.
matrix | Right operand |
SquareMatrixT4< T > & Ocean::SquareMatrixT4< T >::operator-= | ( | const SquareMatrixT4< T > & | matrix | ) |
Subtracts and assigns two matrices.
matrix | Right operand |
|
default |
Default assign operator.
bool Ocean::SquareMatrixT4< T >::operator== | ( | const SquareMatrixT4< T > & | matrix | ) | const |
Returns whether two matrices are identical up to a small epsilon.
matrix | Right operand |
|
inline |
Element operator.
Beware: No range check will be done!
index | The index of the element to return [0, 15] |
|
inline |
Element operator.
Beware: No range check will be done!
index | The index of the element to return [0, 15] |
|
static |
Creates a projection matrix defined by a camera profile of a pinhole camera and the near and far clipping plane.
anyCamera | The camera profile of a pinhole camera, without distortion parameters, must be valid |
nearDistance | Positive distance to the near clipping plane |
farDistance | Positive distance to the far clipping lane |
|
static |
Creates a projection matrix defined by the horizontal field of view, the aspect ratio and the near and far clipping plane.
fovX | Horizontal field of view, in radian and a range of [0, Pi] |
aspectRatio | View aspect ratio which is width divided by the height of the projection window |
nearDistance | Positive distance to the near clipping plane |
farDistance | Positive distance to the far clipping lane |
|
protected |
Swaps two rows of this matrix.
row0 | The index of the first row ,with range [0, 3] |
row1 | The index of the second row, with range [0, 3] |
|
inline |
Sets the matrix to the identity matrix.
|
inline |
Sets the matrix to a zero matrix.
T Ocean::SquareMatrixT4< T >::trace |
Returns the trace of the matrix which is the sum of the diagonal elements.
void Ocean::SquareMatrixT4< T >::transpose |
Transposes the matrix.
SquareMatrixT4< T > Ocean::SquareMatrixT4< T >::transposed |
Returns the transposed of this matrix.
|
protected |
The sixteen values of the matrix.