Euphoria
|
4x4 matrix More...
Public Member Functions | |
float * | get_column_major_data_ptr () |
Get a direct pointer to the data in column major format, for API integration. | |
const float * | get_column_major_data_ptr () const |
Get a direct pointer to the const data in column major format, for API integration. | |
bool | invert () |
Invert the current matrix. | |
m4 | get_inverted () const |
Return the inverted matrix. | |
float | get (int row, int col) const |
Return a single value given a row and column. | |
v4 | get_transformed (const v4 &p) const |
Get a transformed vec4. | |
v3 | get_transformed_point (const v3 &p) const |
Get a transformed vec3 assuming it's a point. | |
v3 | get_transformed_vec (const v3 &p) const |
Get a transformed vec3, assuming it's a normal vector. | |
n3 | get_transformed_vec (const n3 &p) const |
Get a transformed unit3. | |
v4 | get_row (int r) const |
Get a row as a vec4. | |
v4 | get_column (int c) const |
Get a column as vec4. | |
m4 | get_translated (const v3 &t) const |
Combine this with a translation matrix. | |
m4 | get_rotated (const AA &aa) const |
Combine this with a rotation matrix. | |
v3 | get_translation () const |
Get the current translation of the transformation matrix. | |
v4 | get_major () const |
Get the major vector. | |
n3 | get_x_axis () const |
Get the local X axis. | |
n3 | get_y_axis () const |
Get the local Y axis. | |
n3 | get_z_axis () const |
Get the local Z azis. | |
m4 | get_transposed () const |
Gets the transpose of a matrix. | |
void | operator+= (const m4 &rhs) |
void | operator-= (const m4 &rhs) |
Static Public Member Functions | |
static m4 | from_col_major (float t00, float t01, float t02, float t03, float t10, float t11, float t12, float t13, float t20, float t21, float t22, float t23, float t30, float t31, float t32, float t33) |
Create a new matrix from column major format. | |
static constexpr m4 | from_row_major (float t00, float t10, float t20, float t30, float t01, float t11, float t21, float t31, float t02, float t12, float t22, float t32, float t03, float t13, float t23, float t33) |
Create a new matrix from row major format. | |
static m4 | from_major (const v4 &major) |
Create a matrix from the major, aka the diagonal. | |
static constexpr m4 | from_scalar (float scalar) |
Create a matrix from a single scalar. | |
static m4 | from_translation (const v3 &v) |
Create a translation matrix. | |
static m4 | from_rot_x (const An &a) |
Create a rotation matrix, around the X axis. | |
static m4 | from_rot_y (const An &a) |
Create a rotation matrix, around the Y axis. | |
static m4 | from_rot_z (const An &a) |
Create a rotation matrix, around the Z axis. | |
static m4 | from (const AA &aa) |
Create a rotation matrix, from an axis angle. | |
static std::optional< m4 > | from (const Q &q) |
Create a rotation matrix, from a quaternion. | |
static m4 | create_ortho_lrud (float l, float r, float t, float b, float n, float f) |
Create an orthographic projection matrix. | |
static m4 | create_perspective (const An &fov, float aspect_ratio, float near, float far) |
Create a perspective projection matrix. | |
Create an orthographic projection matrix.
Also known as a clip_from_view
transformation. Clip Space is in OpenGL NDC (-1 to +1) z range.
l | the left side |
r | the right side |
t | the up side |
b | the down side |
n | near |
f | far |
|
static |
Create a perspective projection matrix.
Create a rotation matrix, from a quaternion.
|
static |
Create a new matrix from column major format.
Create a matrix from the major, aka the diagonal.
float * eu::m4::get_column_major_data_ptr | ( | ) |
Get a direct pointer to the data in column major format, for API integration.
Get a direct pointer to the const data in column major format, for API integration.
m4 eu::m4::get_inverted | ( | ) | const |
Return the inverted matrix.
v4 eu::m4::get_major | ( | ) | const |
Get the major vector.
Get a transformed vec3 assuming it's a point.
Get a transformed vec3, assuming it's a normal vector.
v3 eu::m4::get_translation | ( | ) | const |
Get the current translation of the transformation matrix.
m4 eu::m4::get_transposed | ( | ) | const |
Gets the transpose of a matrix.
If the matrix is a rotation matrix, then the transpose is guaranteed to be the inverse of the matrix.
n3 eu::m4::get_x_axis | ( | ) | const |
Get the local X axis.
n3 eu::m4::get_y_axis | ( | ) | const |
Get the local Y axis.
n3 eu::m4::get_z_axis | ( | ) | const |
Get the local Z azis.
bool eu::m4::invert | ( | ) |
Invert the current matrix.