Hermes
|
Represents a 3-dimensional transformation. More...
Public Member Functions | |
HERMES_DEVICE_CALLABLE | Transform () |
Default constructor. | |
HERMES_DEVICE_CALLABLE | Transform (const mat4 &mat) |
Constructs from matrix. More... | |
HERMES_DEVICE_CALLABLE | Transform (const real_t mat[4][4]) |
Constructs from array matrix. More... | |
HERMES_DEVICE_CALLABLE | Transform (const bbox3 &bbox) |
Constructs from geometric box. More... | |
HERMES_DEVICE_CALLABLE bbox3 | operator() (const bbox3 &b) const |
Applies this transform to geometric box. More... | |
HERMES_DEVICE_CALLABLE point3 | operator() (const point2 &p) const |
Applies this transform to geometric point. More... | |
HERMES_DEVICE_CALLABLE point3 | operator() (const point3 &p) const |
Applies this transform to geometric point. More... | |
HERMES_DEVICE_CALLABLE void | operator() (const point3 &p, point3 *r) const |
Applies this transform to geometric point. More... | |
HERMES_DEVICE_CALLABLE vec3 | operator() (const vec3 &v) const |
Applies this transform to geometric point. More... | |
HERMES_DEVICE_CALLABLE normal3 | operator() (const normal3 &n) const |
Applies this transform to geometric normal. More... | |
HERMES_DEVICE_CALLABLE Ray3 | operator() (const Ray3 &r) |
Applies this transform to geometric ray. More... | |
HERMES_DEVICE_CALLABLE void | operator() (const Ray3 &r, Ray3 *ret) const |
Applies this transform to geometric ray. More... | |
HERMES_DEVICE_CALLABLE Transform & | operator= (const Transform2 &t) |
Copy assign from 2d transform. More... | |
HERMES_DEVICE_CALLABLE Transform | operator* (const Transform &t) const |
Applies this transform to t. More... | |
HERMES_DEVICE_CALLABLE point3 | operator* (const point3 &p) const |
Applies this transform to geometric vector. More... | |
HERMES_DEVICE_CALLABLE bool | operator== (const Transform &t) const |
HERMES_DEVICE_CALLABLE bool | operator!= (const Transform &t) const |
HERMES_DEVICE_CALLABLE void | reset () |
Sets this transform back to identity. | |
HERMES_DEVICE_CALLABLE bool | swapsHandedness () const |
Checks if this transform swaps coordinate system handedness. More... | |
HERMES_DEVICE_CALLABLE vec3 | getTranslate () const |
Gets translation vector. More... | |
HERMES_DEVICE_CALLABLE bool | isIdentity () |
Checks if this transform is identity. More... | |
HERMES_DEVICE_CALLABLE void | applyToPoint (const real_t *p, real_t *r, size_t d=3) const |
Applies transform to point (array) More... | |
HERMES_DEVICE_CALLABLE const real_t * | c_matrix () const |
Gets raw matrix pointer. More... | |
HERMES_DEVICE_CALLABLE const mat4 & | matrix () const |
Gets transformation matrix. | |
HERMES_DEVICE_CALLABLE mat3 | upperLeftMatrix () const |
Gets upper left matrix. More... | |
HERMES_DEVICE_CALLABLE const real_t * | operator[] (u32 row_index) const |
Gets transformation matrix row. More... | |
HERMES_DEVICE_CALLABLE real_t * | operator[] (u32 row_index) |
Gets transformation matrix row. More... | |
HERMES_DEVICE_CALLABLE bool | hasNaNs () const |
Check for nans. More... | |
Static Public Member Functions | |
static HERMES_DEVICE_CALLABLE Transform | lookAt (const point3 &eye, const point3 &target={0, 0, 0}, const vec3 &up={0, 1, 0}, transform_options options=transform_options::left_handed) |
Creates a Look At Transform. More... | |
static HERMES_DEVICE_CALLABLE Transform | ortho (real_t left, real_t right, real_t bottom, real_t top, real_t near, real_t far, transform_options options=transform_options::left_handed) |
Creates an Orthographic Projection. More... | |
static HERMES_DEVICE_CALLABLE Transform | perspective (real_t fovy_in_degrees, real_t aspect_ratio, real_t near, real_t far, transform_options options=transform_options::left_handed) |
Creates a Perspective Projection. More... | |
static HERMES_DEVICE_CALLABLE Transform | scale (real_t x, real_t y, real_t z) |
Creates a scale transform. More... | |
static HERMES_DEVICE_CALLABLE Transform | translate (const vec3 &d) |
Creates a translation transform. More... | |
static HERMES_DEVICE_CALLABLE Transform | rotateX (real_t angle_in_radians) |
Creates a x-axis rotation transform. More... | |
static HERMES_DEVICE_CALLABLE Transform | rotateY (real_t angle_in_radians) |
Creates a y-axis rotation transform. More... | |
static HERMES_DEVICE_CALLABLE Transform | rotateZ (real_t angle_in_radians) |
Creates a z-axis rotation transform. More... | |
static HERMES_DEVICE_CALLABLE Transform | rotate (real_t angle_in_radians, const vec3 &axis) |
Creates a arbitrary-axis rotation transform. More... | |
static HERMES_DEVICE_CALLABLE Transform | alignVectors (const vec3 &a, const vec3 &b) |
Creates a transform that aligns vector a to vector b. More... | |
static MemoryDumper::RegionLayout | memoryDumpLayout () |
Gets memory layout. More... | |
Protected Attributes | |
mat4 | m |
transformation matrix | |
Friends | |
HERMES_DEVICE_CALLABLE friend Transform | inverse (const Transform &t) |
Computes inverse of a given transform. More... | |
Represents a 3-dimensional transformation.
HERMES_DEVICE_CALLABLE hermes::Transform::Transform | ( | const mat4 & | mat | ) |
Constructs from matrix.
mat |
|
explicit |
Constructs from array matrix.
mat |
HERMES_DEVICE_CALLABLE hermes::Transform::Transform | ( | const bbox3 & | bbox | ) |
Constructs from geometric box.
bbox |
|
static |
Creates a transform that aligns vector a to vector b.
a | source vector |
b | destination vector |
|
inline |
Applies transform to point (array)
p | |
r | |
d |
|
inline |
Gets raw matrix pointer.
|
inline |
Gets translation vector.
|
inline |
Check for nans.
|
inline |
Checks if this transform is identity.
|
static |
Creates a Look At Transform.
eye | |
target | |
up | |
options |
|
inlinestatic |
Gets memory layout.
|
inline |
Applies this transform to geometric box.
b |
|
inline |
Applies this transform to geometric normal.
n |
|
inline |
Applies this transform to geometric point.
p |
|
inline |
Applies this transform to geometric point.
p |
|
inline |
Applies this transform to geometric point.
p | |
r |
|
inline |
Applies this transform to geometric ray.
r |
|
inline |
Applies this transform to geometric ray.
r | |
ret |
|
inline |
Applies this transform to geometric point.
v |
|
inline |
Applies this transform to geometric vector.
p |
|
inline |
Applies this transform to t.
t |
|
inline |
Copy assign from 2d transform.
t |
|
inline |
Gets transformation matrix row.
row_index |
|
inline |
Gets transformation matrix row.
row_index |
|
static |
Creates an Orthographic Projection.
left | |
right | |
bottom | |
top | |
near | |
far | |
options |
|
static |
Creates a Perspective Projection.
fovy_in_degrees | |
aspect_ratio | |
near | |
far | |
options |
|
static |
Creates a arbitrary-axis rotation transform.
angle_in_radians | |
axis |
|
static |
Creates a x-axis rotation transform.
angle_in_radians |
|
static |
Creates a y-axis rotation transform.
angle_in_radians |
|
static |
Creates a z-axis rotation transform.
angle_in_radians |
|
static |
Creates a scale transform.
x | |
y | |
z |
HERMES_DEVICE_CALLABLE bool hermes::Transform::swapsHandedness | ( | ) | const |
Checks if this transform swaps coordinate system handedness.
|
static |
Creates a translation transform.
d |
|
inline |
Gets upper left matrix.
|
friend |
Computes inverse of a given transform.
t |