Nebula
Loading...
Searching...
No Matches
mat4.h File Reference
#include "core/types.h"
#include "math/scalar.h"
#include "math/vec4.h"
#include "math/quat.h"
#include "math/point.h"
#include "math/vector.h"
#include "math/sse.h"

Go to the source code of this file.

Classes

struct  Math::mat4
 A 4x4 single point precision float matrix. More...
 

Namespaces

namespace  Math
 Different curves.
 

Macros

#define mm_ror_ps(vec, i)
 

Functions

mat4 Math::rotationquat (const quat &q)
 TODO: rewrite using SSE.
 
mat4 Math::reflect (const vec4 &p)
 based on this http://www.opengl.org/discussion_boards/showthread.php/169605-reflection-matrix-how-to-derive
 
void Math::decompose (const mat4 &mat, vec3 &outScale, quat &outRotation, vec3 &outTranslation)
 
mat4 Math::affine (const vec3 &scale, const vec3 &rotationCenter, const quat &rotation, const vec3 &translation)
 
mat4 Math::affine (const vec3 &scale, const quat &rotation, const vec3 &translation)
 
mat4 Math::affine (const vec3 &scale, const vec3 &rotation, const vec3 &translation)
 
mat4 Math::affinetransformation (scalar scale, const vec3 &rotationCenter, const quat &rotation, const vec3 &translation)
 
mat4 Math::transformation (const vec3 &scalingCenter, const quat &scalingRotation, const vec3 &scale, const vec3 &rotationCenter, const quat &rotation, const vec3 &trans)
 
bool Math::ispointinside (const vec4 &p, const mat4 &m)
 
mat4 Math::skewsymmetric (const vec3 &v)
 
mat4 Math::fromeuler (const vec3 &v)
 
vec3 Math::aseuler (const mat4 &m)
 
__forceinline bool Math::isidentity (const mat4 &m)
 
__forceinline scalar Math::determinant (const mat4 &m)
 
__forceinline mat4 Math::inverse (const mat4 &m)
 
__forceinline mat4 Math::lookatlh (const point &eye, const point &at, const vector &up)
 
__forceinline mat4 Math::lookatrh (const point &eye, const point &at, const vector &up)
 
__forceinline mat4 Math::operator* (const mat4 &m0, const mat4 &m1)
 
__forceinline vec4 Math::operator* (const mat4 &m, const vec4 &v)
 
__forceinline vec4 Math::operator* (const mat4 &m, const vec3 &v)
 
__forceinline vec4 Math::operator* (const mat4 &m, const point &p)
 
__forceinline vector Math::operator* (const mat4 &m, const vector &v)
 
__forceinline mat4 Math::ortholh (scalar w, scalar h, scalar zn, scalar zf)
 
__forceinline mat4 Math::orthorh (scalar w, scalar h, scalar zn, scalar zf)
 
__forceinline mat4 Math::orthooffcenterlh (scalar l, scalar r, scalar t, scalar b, scalar zn, scalar zf)
 
__forceinline mat4 Math::orthooffcenterrh (scalar l, scalar r, scalar t, scalar b, scalar zn, scalar zf)
 
__forceinline mat4 Math::perspfovlh (scalar fovy, scalar aspect, scalar zn, scalar zf)
 
__forceinline mat4 Math::perspfovrh (scalar fovy, scalar aspect, scalar zn, scalar zf)
 
__forceinline mat4 Math::persplh (scalar w, scalar h, scalar zn, scalar zf)
 
__forceinline mat4 Math::persprh (scalar w, scalar h, scalar zn, scalar zf)
 
__forceinline mat4 Math::perspoffcenterlh (scalar l, scalar r, scalar b, scalar t, scalar zn, scalar zf)
 
__forceinline mat4 Math::perspoffcenterrh (scalar l, scalar r, scalar b, scalar t, scalar zn, scalar zf)
 
__forceinline mat4 Math::rotationaxis (const vec3 &axis, scalar angle)
 
__forceinline mat4 Math::rotationx (scalar angle)
 
__forceinline mat4 Math::rotationy (scalar angle)
 
__forceinline mat4 Math::rotationz (scalar angle)
 
__forceinline mat4 Math::rotationyawpitchroll (scalar yaw, scalar pitch, scalar roll)
 
__forceinline mat4 Math::scaling (scalar scale)
 
__forceinline mat4 Math::scaling (scalar sx, scalar sy, scalar sz)
 
__forceinline mat4 Math::scaling (const vec3 &s)
 
__forceinline mat4 Math::translation (scalar x, scalar y, scalar z)
 
__forceinline mat4 Math::translation (const vec3 &t)
 
__forceinline mat4 Math::trs (const vec3 &position, const quat &rotation, const vec3 &scale)
 A short hand for creating a TRS (translation, rotation, scale) matrix from pos, rot and scale.
 
__forceinline mat4 Math::transpose (const mat4 &m)
 

Variables

static const __m128i Math::maskX = _mm_setr_epi32( -1,0,0,0 )
 
static const __m128i Math::maskY = _mm_setr_epi32( 0,-1,0,0 )
 
static const __m128i Math::maskZ = _mm_setr_epi32( 0,0,-1,0 )
 
static const __m128i Math::maskW = _mm_setr_epi32( 0,0,0,-1 )
 

Macro Definition Documentation

◆ mm_ror_ps

#define mm_ror_ps ( vec,
i )
Value:
(((i)%4) ? (_mm_shuffle_ps(vec,vec, _MM_SHUFFLE((unsigned char)(i+3)%4,(unsigned char)(i+2)%4,(unsigned char)(i+1)%4,(unsigned char)(i+0)%4))) : (vec))