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 Matrix4x4 & | getMatrix () const |
Return the underlying matrix. More... | |
const Matrix4x4 & | getInverseMatrix () 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... | |
Encapsulates a 4x4 linear transformation and its inverse.
|
inline |
Create an identity transformation.
|
inline |
Unserialize a transformation from a stream.
|
inline |
Create a transform from the given matrix and calculate the inverse.
Create a transform from the given matrices.
|
inline |
Return the determinant of the upper left 3x3 submatrix.
Create an orthogonal transformation that takes the standard to the supplied frame.
|
inline |
Return the underlying inverse matrix (const version)
|
inline |
Return the underlying matrix.
|
static |
Create a perspective transformation for OpenGL.
left | Left clipping plane coordinate |
right | Right clipping plane coordinate |
top | Top clipping plane coordinate |
bottom | Bottom clipping plane coordinate |
nearVal | Near clipping plane distance |
farVal | Far clipping plane distance |
Create an orthographic transformation for OpenGL.
clipNear | Near clipping plane |
clipFar | Far clipping plane |
|
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 |
Create a perspective transformation for OpenGL. (Maps [-near, -far] to [-1, 1])
fov | Field of view in degrees |
clipNear | Near clipping plane distance |
clipFar | Far clipping plane distance |
|
inline |
Test for a scale component.
|
inline |
Return the inverse transform.
|
inline |
Test if this is the identity transformation.
|
inline |
Test if this is the zero transformation.
|
static |
Create a look-at camera transformation.
p | Camera position |
t | Target vector |
u | Up vector |
Inequality comparison operator.
Matrix-vector multiplication for points in 3d space.
mul
). Matrix-vector multiplication for points in 3d space (no temporaries)
Matrix-vector multiplication for vectors in 3d space.
mul
). Matrix-vector multiplication for vectors in 3d space (no temporaries)
Matrix-normal multiplication.
mul
). Matrix-normal multiplication (no temporaries)
4D matrix-vector multiplication
mul
). 4D matrix-vector multiplication (no temporaries)
Transform a ray. Assumes that there is no scaling (no temporaries)
Transform a ray.
mul
). Equality comparison operator.
Create an orthographic transformation, which maps Z to [0,1] and leaves the X and Y coordinates untouched.
clipNear | Near clipping plane |
clipFar | Far clipping plane |
|
static |
Create a perspective transformation. (Maps [near, far] to [0, 1])
fov | Field of view in degrees |
clipNear | Near clipping plane |
clipFar | Far clipping plane |
Create a rotation transformation around an arbitrary axis. The angle is specified in degrees.
Create a scale transformation.
|
inline |
Serialize a transformation to a stream.
std::string mitsuba::Transform::toString | ( | ) | const |
Return a string representation.
Transform a point by an affine / non-projective matrix.
Transform a point by a affine / non-projective matrix (no temporaries)
Transform a ray by an affine / non-projective matrix (no temporaries)
Transform a ray by an affine / non-projective matrix (no temporaries)
Create a translation transformation.