Nebula
|
#include <mat4.h>
A 4x4 single point precision float matrix.
Public Member Functions | |
mat4 () | |
default constructor. returns identity matrix | |
mat4 (const mat4 &rhs)=default | |
copy constructor | |
mat4 (const vec4 &row0, const vec4 &row1, const vec4 &row2, const vec4 &row3) | |
construct from components | |
mat4 (float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33) | |
construct from individual values | |
bool | operator== (const mat4 &rhs) const |
equality operator | |
bool | operator!= (const mat4 &rhs) const |
inequality operator | |
void | load (const scalar *ptr) |
load content from 16-byte-aligned memory | |
void | loadu (const scalar *ptr) |
load content from unaligned memory | |
void | store (scalar *ptr) const |
write content to 16-byte-aligned memory through the write cache | |
void | store3 (scalar *ptr) const |
write 3 columns to 16-byte aligned memory through the write cache | |
void | storeu (scalar *ptr) const |
write content to unaligned memory through the write cache | |
void | stream (scalar *ptr) const |
stream content to 16-byte-aligned memory circumventing the write-cache | |
void | set (const vec4 &r0, const vec4 &r1, const vec4 &r2, const vec4 &r3) |
set content from row vectors | |
void | set (float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33) |
set content from individual values | |
void | get_scale (vec4 &scale) const |
extracts scale components to target vector | |
void | translate (const vec3 &t) |
add a translation to pos_component | |
void | translate (const float x, const float y, const float z) |
add a translation to pos_component | |
vec4 | get_x () const |
vec4 | get_y () const |
vec4 | get_z () const |
vec4 | get_w () const |
void | scale (const vec3 &v) |
scale matrix | |
void | scale (const float x, const float y, const float z) |
scale matrix | |
Public Attributes | ||
union { | ||
struct { | ||
vec4 x_axis | ||
vec4 y_axis | ||
vec4 z_axis | ||
vec4 position | ||
} | ||
struct { | ||
float _11 | ||
float _12 | ||
float _13 | ||
float _14 | ||
float _21 | ||
float _22 | ||
float _23 | ||
float _24 | ||
float _31 | ||
float _32 | ||
float _33 | ||
float _34 | ||
float _41 | ||
float _42 | ||
float _43 | ||
float _44 | ||
} | ||
float accessors | ||
float m [4][4] | ||
vec4 r [4] | ||
as a two-dimensional array More... | ||
struct { | ||
vec4 row0 | ||
vec4 row1 | ||
vec4 row2 | ||
vec4 row3 | ||
} | ||
array accessible rows | ||
}; | ||
we use aliasing to represent the matrix in may different ways | ||
Static Public Attributes | |
static const mat4 | identity = mat4(_id_x, _id_y, _id_z, _id_w) |
__forceinline Math::mat4::mat4 | ( | ) |
default constructor. returns identity matrix
|
default |
copy constructor
__forceinline Math::mat4::mat4 | ( | const vec4 & | row0, |
const vec4 & | row1, | ||
const vec4 & | row2, | ||
const vec4 & | row3 ) |
construct from components
__forceinline Math::mat4::mat4 | ( | float | m00, |
float | m01, | ||
float | m02, | ||
float | m03, | ||
float | m10, | ||
float | m11, | ||
float | m12, | ||
float | m13, | ||
float | m20, | ||
float | m21, | ||
float | m22, | ||
float | m23, | ||
float | m30, | ||
float | m31, | ||
float | m32, | ||
float | m33 ) |
construct from individual values
__forceinline void Math::mat4::get_scale | ( | vec4 & | scale | ) | const |
extracts scale components to target vector
__forceinline vec4 Math::mat4::get_w | ( | ) | const |
__forceinline vec4 Math::mat4::get_x | ( | ) | const |
__forceinline vec4 Math::mat4::get_y | ( | ) | const |
__forceinline vec4 Math::mat4::get_z | ( | ) | const |
__forceinline void Math::mat4::load | ( | const scalar * | ptr | ) |
load content from 16-byte-aligned memory
__forceinline void Math::mat4::loadu | ( | const scalar * | ptr | ) |
load content from unaligned memory
__forceinline bool Math::mat4::operator!= | ( | const mat4 & | rhs | ) | const |
inequality operator
__forceinline bool Math::mat4::operator== | ( | const mat4 & | rhs | ) | const |
equality operator
void Math::mat4::scale | ( | const float | x, |
const float | y, | ||
const float | z ) |
scale matrix
__forceinline void Math::mat4::scale | ( | const vec3 & | v | ) |
scale matrix
__forceinline void Math::mat4::set | ( | const vec4 & | r0, |
const vec4 & | r1, | ||
const vec4 & | r2, | ||
const vec4 & | r3 ) |
set content from row vectors
__forceinline void Math::mat4::set | ( | float | m00, |
float | m01, | ||
float | m02, | ||
float | m03, | ||
float | m10, | ||
float | m11, | ||
float | m12, | ||
float | m13, | ||
float | m20, | ||
float | m21, | ||
float | m22, | ||
float | m23, | ||
float | m30, | ||
float | m31, | ||
float | m32, | ||
float | m33 ) |
set content from individual values
__forceinline void Math::mat4::store | ( | scalar * | ptr | ) | const |
write content to 16-byte-aligned memory through the write cache
__forceinline void Math::mat4::store3 | ( | scalar * | ptr | ) | const |
write 3 columns to 16-byte aligned memory through the write cache
__forceinline void Math::mat4::storeu | ( | scalar * | ptr | ) | const |
write content to unaligned memory through the write cache
__forceinline void Math::mat4::stream | ( | scalar * | ptr | ) | const |
stream content to 16-byte-aligned memory circumventing the write-cache
void Math::mat4::translate | ( | const float | x, |
const float | y, | ||
const float | z ) |
add a translation to pos_component
__forceinline void Math::mat4::translate | ( | const vec3 & | t | ) |
add a translation to pos_component
union { ... } Math::mat4 |
we use aliasing to represent the matrix in may different ways
float Math::mat4::_11 |
float Math::mat4::_12 |
float Math::mat4::_13 |
float Math::mat4::_14 |
float Math::mat4::_21 |
float Math::mat4::_22 |
float Math::mat4::_23 |
float Math::mat4::_24 |
float Math::mat4::_31 |
float Math::mat4::_32 |
float Math::mat4::_33 |
float Math::mat4::_34 |
float Math::mat4::_41 |
float Math::mat4::_42 |
float Math::mat4::_43 |
float Math::mat4::_44 |
float Math::mat4::m[4][4] |
vec4 Math::mat4::position |
vec4 Math::mat4::r[4] |
as a two-dimensional array
SIMD accessors
vec4 Math::mat4::row0 |
vec4 Math::mat4::row1 |
vec4 Math::mat4::row2 |
vec4 Math::mat4::row3 |
vec4 Math::mat4::x_axis |
vec4 Math::mat4::y_axis |
vec4 Math::mat4::z_axis |