Nebula
Loading...
Searching...
No Matches
Math::mat4 Struct Reference

#include <mat4.h>

Detailed Description

A 4x4 single point precision float matrix.

Classes

union  [union].__unnamed0__
 we use aliasing to represent the matrix in may different ways More...

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
vec4 & operator[] (size_t const i)
 row element accessor
vec4 const & operator[] (size_t const i) const
 readonly row element accessor
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  

Static Public Attributes

static const mat4 identity = mat4(_id_x, _id_y, _id_z, _id_w)

Constructor & Destructor Documentation

◆ mat4() [1/4]

__forceinline Math::mat4::mat4 ( )

default constructor. returns identity matrix

◆ mat4() [2/4]

Math::mat4::mat4 ( const mat4 & rhs)
default

copy constructor

◆ mat4() [3/4]

__forceinline Math::mat4::mat4 ( const vec4 & row0,
const vec4 & row1,
const vec4 & row2,
const vec4 & row3 )

construct from components

◆ mat4() [4/4]

__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

Member Function Documentation

◆ get_scale()

__forceinline void Math::mat4::get_scale ( vec4 & scale) const

extracts scale components to target vector

◆ get_w()

__forceinline vec4 Math::mat4::get_w ( ) const

◆ get_x()

__forceinline vec4 Math::mat4::get_x ( ) const

◆ get_y()

__forceinline vec4 Math::mat4::get_y ( ) const

◆ get_z()

__forceinline vec4 Math::mat4::get_z ( ) const

◆ load()

__forceinline void Math::mat4::load ( const scalar * ptr)

load content from 16-byte-aligned memory

◆ loadu()

__forceinline void Math::mat4::loadu ( const scalar * ptr)

load content from unaligned memory

◆ operator!=()

__forceinline bool Math::mat4::operator!= ( const mat4 & rhs) const

inequality operator

◆ operator==()

__forceinline bool Math::mat4::operator== ( const mat4 & rhs) const

equality operator

◆ operator[]() [1/2]

__forceinline vec4 & Math::mat4::operator[] ( size_t const i)

row element accessor

◆ operator[]() [2/2]

__forceinline vec4 const & Math::mat4::operator[] ( size_t const i) const

readonly row element accessor

◆ scale() [1/2]

void Math::mat4::scale ( const float x,
const float y,
const float z )

scale matrix

◆ scale() [2/2]

__forceinline void Math::mat4::scale ( const vec3 & v)

scale matrix

◆ set() [1/2]

__forceinline void Math::mat4::set ( const vec4 & r0,
const vec4 & r1,
const vec4 & r2,
const vec4 & r3 )

set content from row vectors

◆ set() [2/2]

__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

◆ store()

__forceinline void Math::mat4::store ( scalar * ptr) const

write content to 16-byte-aligned memory through the write cache

◆ store3()

__forceinline void Math::mat4::store3 ( scalar * ptr) const

write 3 columns to 16-byte aligned memory through the write cache

◆ storeu()

__forceinline void Math::mat4::storeu ( scalar * ptr) const

write content to unaligned memory through the write cache

◆ stream()

__forceinline void Math::mat4::stream ( scalar * ptr) const

stream content to 16-byte-aligned memory circumventing the write-cache

◆ translate() [1/2]

void Math::mat4::translate ( const float x,
const float y,
const float z )

add a translation to pos_component

◆ translate() [2/2]

__forceinline void Math::mat4::translate ( const vec3 & t)

add a translation to pos_component

Member Data Documentation

◆ @023176260230173356044020135364006204100335234020

◆ identity

const mat4 Math::mat4::identity = mat4(_id_x, _id_y, _id_z, _id_w)
static

The documentation for this struct was generated from the following files:
  • /github/workspace/code/foundation/math/mat4.h
  • /github/workspace/code/foundation/math/mat4.cc