Eidolon
|
#include <RenderTypes.h>
Public Member Functions | |
transform (const vec3 &trans=vec3(), const vec3 &scale=vec3(1.0), const rotator &rot=rotator(), bool isInv=false) | |
Define a transform with translation and scale vectors and a rotator, default values define the identity transform. More... | |
transform (const transform &t) | |
transform (real x, real y, real z, real sx, real sy, real sz, real yaw, real pitch, real roll, bool isInv=false) | |
Define a transform with translation, scale, and Euler angle values. More... | |
vec3 | getTranslation () const |
vec3 | getScale () const |
rotator | getRotation () const |
bool | isInverse () const |
void | setTranslation (const vec3 &v) |
void | setScale (const vec3 &v) |
void | setRotation (const rotator &r) |
vec3 | operator* (const vec3 &v) const |
Transforms `v' by scaling->rotating->translating if not an inverse transform, otherwise by translating->rotating->scaling. More... | |
vec3 | operator/ (const vec3 &v) const |
Transform `v' by the inverse of `this'. More... | |
Ray | operator* (const Ray &r) const |
Transforms `r' by transforming its position by `this' but it direction by the directional components only of `this'. More... | |
transform | operator* (const transform &t) const |
bool | operator== (const transform &t) const |
transform | inverse () const |
Get the inverse transform of `this', ie. for any transform t and vec3 v (t.inverse()*(t*v)) is a no-op. More... | |
transform | directional () const |
Get the directional version of this transform which is suitable for transforming directional vectors correctly, ie. no translation component. More... | |
void | toMatrix (real *mat) const |
Fill in the 4x4 matrix representing this transform. This assumes `mat' has length 16. More... | |
mat4 | toMatrix () const |
Public Attributes | |
vec3 | trans |
vec3 | scale |
rotator | rot |
bool | _isInverse |
Friends | |
vec3 | operator* (const vec3 &v, const transform &t) |
Commutative version of the above. More... | |
vec3 | operator/ (const vec3 &v, const transform &t) |
Commutative version of the above. More... | |
vec3 & | operator*= (vec3 &v, const transform &t) |
Ray | operator* (const Ray &r, const transform &t) |
Commutative version of the above. More... | |
std::ostream & | operator<< (std::ostream &out, const transform &t) |
Represents the combination of translation, scale, and rotation operations. When multiplying a vector v by a transform t, the order of operations is to scale, rotate, then translate. If isInverse() is true then the order is reversed. This type doesn't allow arbitrary operation orders or other transforms like shear thus isn't as general as a 4x4 matrix. The advantage is that the translation, scale, and rotation components are defined separately and can be accessed or modified independently. A transform has an matrix equivalent, transforms can thus be compounded through matrix multiplication.
|
inline |
Define a transform with translation and scale vectors and a rotator, default values define the identity transform.
|
inline |
Define a transform with translation, scale, and Euler angle values.
|
inline |
Get the directional version of this transform which is suitable for transforming directional vectors correctly, ie. no translation component.
|
inline |
|
inline |
|
inline |
|
inline |
Get the inverse transform of `this', ie. for any transform t and vec3 v (t.inverse()*(t*v)) is a no-op.
|
inline |
Transforms `v' by scaling->rotating->translating if not an inverse transform, otherwise by translating->rotating->scaling.
Transforms `r' by transforming its position by `this' but it direction by the directional components only of `this'.
Calculate the transform representing the application of `t' followed by `this'. This transform isn't always equivalent to applying `t' to an object followed by `this'. If a combination of rotation and scaling values in `t' or `this' results skew then the transform produced by this operator will scale and rotate in unexpected ways. Skew is the result of applying affine operations in an order which produces a non-affine total result.
This method operates by producing a transform whose position that of `t' plus that of `this' transformed by the directional components of `t', with a scale and rotation values which are the products of those from `t' and `this'.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Fill in the 4x4 matrix representing this transform. This assumes `mat' has length 16.
|
inline |
|
friend |
bool _isInverse |
rotator rot |
vec3 scale |
vec3 trans |