Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::Transform Struct Reference

Encapsulates a 4x4 linear transformation and its inverse. More...

#include <mitsuba/core/transform.h>

Public Member Functions

 Transform ()
 Create an identity transformation. More...
 
 Transform (Stream *stream)
 Unserialize a transformation from a stream. More...
 
 Transform (const Matrix4x4 &trafo)
 Create a transform from the given matrix and calculate the inverse. More...
 
 Transform (const Matrix4x4 &trafo, const Matrix4x4 &invTrafo)
 Create a transform from the given matrices. More...
 
Transform inverse () const
 Return the inverse transform. More...
 
Transform operator* (const Transform &t) const
 Matrix-matrix multiplication. More...
 
Float det3x3 () const
 Return the determinant of the upper left 3x3 submatrix. More...
 
bool hasScale () const
 Test for a scale component. More...
 
bool isIdentity () const
 Test if this is the identity transformation. More...
 
bool isZero () const
 Test if this is the zero transformation. More...
 
Point operator() (const Point &p) const
 Matrix-vector multiplication for points in 3d space. More...
 
Point transformAffine (const Point &p) const
 Transform a point by an affine / non-projective matrix. More...
 
void transformAffine (const Point &p, Point &dest) const
 Transform a point by a affine / non-projective matrix (no temporaries) More...
 
void operator() (const Point &p, Point &dest) const
 Matrix-vector multiplication for points in 3d space (no temporaries) More...
 
Vector operator() (const Vector &v) const
 Matrix-vector multiplication for vectors in 3d space. More...
 
void operator() (const Vector &v, Vector &dest) const
 Matrix-vector multiplication for vectors in 3d space (no temporaries) More...
 
Normal operator() (const Normal &v) const
 Matrix-normal multiplication. More...
 
void operator() (const Normal &v, Normal &dest) const
 Matrix-normal multiplication (no temporaries) More...
 
Vector4 operator() (const Vector4 &v) const
 4D matrix-vector multiplication More...
 
void operator() (const Vector4 &v, Vector4 &dest) const
 4D matrix-vector multiplication (no temporaries) More...
 
void operator() (const Ray &a, Ray &b) const
 Transform a ray. Assumes that there is no scaling (no temporaries) More...
 
Ray operator() (const Ray &ray) const
 Transform a ray. More...
 
void transformAffine (const Ray &a, Ray &b) const
 Transform a ray by an affine / non-projective matrix (no temporaries) More...
 
Ray transformAffine (const Ray &ray) const
 Transform a ray by an affine / non-projective matrix (no temporaries) More...
 
const Matrix4x4getMatrix () const
 Return the underlying matrix. More...
 
const Matrix4x4getInverseMatrix () const
 Return the underlying inverse matrix (const version) More...
 
void serialize (Stream *stream) const
 Serialize a transformation to a stream. More...
 
bool operator== (const Transform &trafo) const
 Equality comparison operator. More...
 
bool operator!= (const Transform &trafo) const
 Inequality comparison operator. More...
 
std::string toString () const
 Return a string representation. More...
 

Static Public Member Functions

static Transform translate (const Vector &v)
 Create a translation transformation. More...
 
static Transform rotate (const Vector &axis, Float angle)
 Create a rotation transformation around an arbitrary axis. The angle is specified in degrees. More...
 
static Transform scale (const Vector &v)
 Create a scale transformation. More...
 
static Transform perspective (Float fov, Float clipNear, Float clipFar)
 Create a perspective transformation. (Maps [near, far] to [0, 1]) More...
 
static Transform glPerspective (Float fov, Float clipNear, Float clipFar)
 Create a perspective transformation for OpenGL. (Maps [-near, -far] to [-1, 1]) More...
 
static Transform glFrustum (Float left, Float right, Float bottom, Float top, Float nearVal, Float farVal)
 Create a perspective transformation for OpenGL. More...
 
static Transform orthographic (Float clipNear, Float clipFar)
 Create an orthographic transformation, which maps Z to [0,1] and leaves the X and Y coordinates untouched. More...
 
static Transform glOrthographic (Float clipNear, Float clipFar)
 Create an orthographic transformation for OpenGL. More...
 
static Transform glOrthographic (Float clipLeft, Float clipRight, Float clipBottom, Float clipTop, Float clipNear, Float clipFar)
 Create an orthographic transformation for OpenGL. More...
 
static Transform lookAt (const Point &p, const Point &t, const Vector &u)
 Create a look-at camera transformation. More...
 
static Transform fromFrame (const Frame &frame)
 Create an orthogonal transformation that takes the standard to the supplied frame. More...
 

Detailed Description

Encapsulates a 4x4 linear transformation and its inverse.

Constructor & Destructor Documentation

mitsuba::Transform::Transform ( )
inline

Create an identity transformation.

mitsuba::Transform::Transform ( Stream stream)
inline

Unserialize a transformation from a stream.

mitsuba::Transform::Transform ( const Matrix4x4 trafo)
inline

Create a transform from the given matrix and calculate the inverse.

mitsuba::Transform::Transform ( const Matrix4x4 trafo,
const Matrix4x4 invTrafo 
)
inline

Create a transform from the given matrices.

Member Function Documentation

Float mitsuba::Transform::det3x3 ( ) const
inline

Return the determinant of the upper left 3x3 submatrix.

static Transform mitsuba::Transform::fromFrame ( const Frame frame)
static

Create an orthogonal transformation that takes the standard to the supplied frame.

const Matrix4x4& mitsuba::Transform::getInverseMatrix ( ) const
inline

Return the underlying inverse matrix (const version)

const Matrix4x4& mitsuba::Transform::getMatrix ( ) const
inline

Return the underlying matrix.

static Transform mitsuba::Transform::glFrustum ( Float  left,
Float  right,
Float  bottom,
Float  top,
Float  nearVal,
Float  farVal 
)
static

Create a perspective transformation for OpenGL.

Parameters
leftLeft clipping plane coordinate
rightRight clipping plane coordinate
topTop clipping plane coordinate
bottomBottom clipping plane coordinate
nearValNear clipping plane distance
farValFar clipping plane distance
static Transform mitsuba::Transform::glOrthographic ( Float  clipNear,
Float  clipFar 
)
static

Create an orthographic transformation for OpenGL.

Parameters
clipNearNear clipping plane
clipFarFar clipping plane
static Transform mitsuba::Transform::glOrthographic ( Float  clipLeft,
Float  clipRight,
Float  clipBottom,
Float  clipTop,
Float  clipNear,
Float  clipFar 
)
static

Create an orthographic transformation for OpenGL.

Slightly extended variant which also handles non-unity clipping planes on the X and Y axes and matches the 'glOrtho' spec.

static Transform mitsuba::Transform::glPerspective ( Float  fov,
Float  clipNear,
Float  clipFar 
)
static

Create a perspective transformation for OpenGL. (Maps [-near, -far] to [-1, 1])

Parameters
fovField of view in degrees
clipNearNear clipping plane distance
clipFarFar clipping plane distance
bool mitsuba::Transform::hasScale ( ) const
inline

Test for a scale component.

Transform mitsuba::Transform::inverse ( ) const
inline

Return the inverse transform.

bool mitsuba::Transform::isIdentity ( ) const
inline

Test if this is the identity transformation.

bool mitsuba::Transform::isZero ( ) const
inline

Test if this is the zero transformation.

static Transform mitsuba::Transform::lookAt ( const Point p,
const Point t,
const Vector u 
)
static

Create a look-at camera transformation.

Parameters
pCamera position
tTarget vector
uUp vector
bool mitsuba::Transform::operator!= ( const Transform trafo) const
inline

Inequality comparison operator.

Point mitsuba::Transform::operator() ( const Point p) const
inline

Matrix-vector multiplication for points in 3d space.

Remarks
In the Python bindings, this is function implemented as the multiplication operator (mul).
void mitsuba::Transform::operator() ( const Point p,
Point dest 
) const
inline

Matrix-vector multiplication for points in 3d space (no temporaries)

Remarks
This function is not available in the Python bindings
Vector mitsuba::Transform::operator() ( const Vector v) const
inline

Matrix-vector multiplication for vectors in 3d space.

Remarks
In the Python bindings, this is function implemented as the multiplication operator (mul).
void mitsuba::Transform::operator() ( const Vector v,
Vector dest 
) const
inline

Matrix-vector multiplication for vectors in 3d space (no temporaries)

Remarks
This function is not available in the Python bindings
Normal mitsuba::Transform::operator() ( const Normal v) const
inline

Matrix-normal multiplication.

Remarks
In the Python bindings, this is function implemented as the multiplication operator (mul).
void mitsuba::Transform::operator() ( const Normal v,
Normal dest 
) const
inline

Matrix-normal multiplication (no temporaries)

Remarks
This function is not available in the Python bindings
Vector4 mitsuba::Transform::operator() ( const Vector4 v) const
inline

4D matrix-vector multiplication

Remarks
In the Python bindings, this is function implemented as the multiplication operator (mul).
void mitsuba::Transform::operator() ( const Vector4 v,
Vector4 dest 
) const
inline

4D matrix-vector multiplication (no temporaries)

Remarks
This function is not available in the Python bindings
void mitsuba::Transform::operator() ( const Ray a,
Ray b 
) const
inline

Transform a ray. Assumes that there is no scaling (no temporaries)

Remarks
This function is not available in the Python bindings
Ray mitsuba::Transform::operator() ( const Ray ray) const
inline

Transform a ray.

Remarks
In the Python bindings, this is function implemented as the multiplication operator (mul).
Transform mitsuba::Transform::operator* ( const Transform t) const

Matrix-matrix multiplication.

bool mitsuba::Transform::operator== ( const Transform trafo) const
inline

Equality comparison operator.

static Transform mitsuba::Transform::orthographic ( Float  clipNear,
Float  clipFar 
)
static

Create an orthographic transformation, which maps Z to [0,1] and leaves the X and Y coordinates untouched.

Parameters
clipNearNear clipping plane
clipFarFar clipping plane
static Transform mitsuba::Transform::perspective ( Float  fov,
Float  clipNear,
Float  clipFar 
)
static

Create a perspective transformation. (Maps [near, far] to [0, 1])

Parameters
fovField of view in degrees
clipNearNear clipping plane
clipFarFar clipping plane
static Transform mitsuba::Transform::rotate ( const Vector axis,
Float  angle 
)
static

Create a rotation transformation around an arbitrary axis. The angle is specified in degrees.

static Transform mitsuba::Transform::scale ( const Vector v)
static

Create a scale transformation.

void mitsuba::Transform::serialize ( Stream stream) const
inline

Serialize a transformation to a stream.

std::string mitsuba::Transform::toString ( ) const

Return a string representation.

Point mitsuba::Transform::transformAffine ( const Point p) const
inline

Transform a point by an affine / non-projective matrix.

void mitsuba::Transform::transformAffine ( const Point p,
Point dest 
) const
inline

Transform a point by a affine / non-projective matrix (no temporaries)

void mitsuba::Transform::transformAffine ( const Ray a,
Ray b 
) const
inline

Transform a ray by an affine / non-projective matrix (no temporaries)

Ray mitsuba::Transform::transformAffine ( const Ray ray) const
inline

Transform a ray by an affine / non-projective matrix (no temporaries)

static Transform mitsuba::Transform::translate ( const Vector v)
static

Create a translation transformation.


The documentation for this struct was generated from the following file: