Maya 1.0
Matrix4Float Class Reference

Matrix representation for the GPU. More...

#include <evectorfloat.h>

Public Member Functions

 Matrix4Float ()
 Create a matrix.
 
 Matrix4Float (float)
 Create a diagonal matrix.
 
 Matrix4Float (float[16])
 Create a matrix from coeficients.
 
 Matrix4Float (const Matrix4 &)
 Create a matrix of float from a matrix of double.
 
float & operator() (int, int)
 Accessor.
 
Matrix4Float Inverse () const
 Create the inverse of a Matrix.
 

Static Public Member Functions

static Matrix4Float LookAt (const Vector &eye, const Vector &at, const Vector &up)
 Create a look-at matrix from (eye, at, up) vectors.
 
static Matrix4Float Perspective (float fovy, float zNear, float zFar, float width, float height)
 Create a perspective projection matrix.
 
static Matrix4Float Orthographic (float left, float right, float bottom, float top, float zNear, float zFar)
 Create an orthographic projection matrix.
 

Public Attributes

float r [16] = { 1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0 }
 Coefficients, set to identity matrix. In column major.
 

Friends

Matrix4Float operator* (const Matrix4Float &u, const Matrix4Float &v)
 Matrix multiplication.
 
bool operator!= (const Matrix4Float &u, const Matrix4Float &v)
 Matrix comparison.
 
std::ostream & operator<< (std::ostream &s, const Matrix4Float &matrix)
 Overloaded.
 

Detailed Description

Matrix representation for the GPU.

Member Function Documentation

◆ Inverse()

Matrix4Float Matrix4Float::Inverse ( ) const

Create the inverse of a Matrix.

Parameters
m: the matrix to invert

References Matrix4::Inverse(), and Matrix4Float().

Referenced by SphereTracingWidget::RenderSDF().

◆ LookAt()

Matrix4Float Matrix4Float::LookAt ( const Vector & eye,
const Vector & at,
const Vector & up )
static

Create a look-at matrix from (eye, at, up) vectors.

Parameters
eyecamera eye
atcamera look-at point
upcamera up vector

References Matrix4Float().

Referenced by SphereTracingWidget::RenderPoints(), and SphereTracingWidget::RenderSDF().

◆ Orthographic()

Matrix4Float Matrix4Float::Orthographic ( float l,
float r,
float b,
float t,
float n,
float f )
static

Create an orthographic projection matrix.

Parameters
lcoordinate of the left vertical clipping plane
rcoordinate of the right vertical clipping plane
bcoordinate of the bottom horizontal clipping plane
tcoordinate of the top horizontal clipping plane
n,fcamera near and far plane

References Matrix4Float(), and r.

Referenced by SphereTracingWidget::RenderPoints(), and SphereTracingWidget::RenderSDF().

◆ Perspective()

Matrix4Float Matrix4Float::Perspective ( float fovy,
float zNear,
float zFar,
float width,
float height )
static

Create a perspective projection matrix.

Parameters
fovyCamera vertical fov (in degrees).
zNear,zFarPlanes.
width,heightCamera dimension.

References Math::DegreeToRadian(), and Matrix4Float().

Referenced by SphereTracingWidget::RenderPoints(), and SphereTracingWidget::RenderSDF().

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & s,
const Matrix4Float & matrix )
friend

Overloaded.

Parameters
sStream.
matrixThe matrix.

References Matrix4Float(), and operator<<.

Referenced by operator<<.