Hermes
hermes::Transform2 Class Reference

Represents a 2-dimensional transformation. More...

Public Member Functions

HERMES_DEVICE_CALLABLE Transform2 ()
 Default constructor.
 
HERMES_DEVICE_CALLABLE Transform2 (const mat3 &mat)
 Constructs from matrix. More...
 
HERMES_DEVICE_CALLABLE Transform2 (const bbox2 &bbox)
 Constructs from bounding box. More...
 
HERMES_DEVICE_CALLABLE void operator() (const point2 &p, point2 *r) const
 Applies this transform to geometric point. More...
 
HERMES_DEVICE_CALLABLE void operator() (const vec2 &v, vec2 *r) const
 Applies this transform to geometric vector. More...
 
HERMES_DEVICE_CALLABLE vec2 operator() (const vec2 &v) const
 Applies this transform to geometric vector. More...
 
HERMES_DEVICE_CALLABLE point2 operator() (const point2 &p) const
 Applies this transform to geometric point. More...
 
HERMES_DEVICE_CALLABLE bbox2 operator() (const bbox2 &b) const
 Applies this transform to geometric box. More...
 
HERMES_DEVICE_CALLABLE Ray2 operator() (const Ray2 &r)
 Applies this transform to geometric ray. More...
 
HERMES_DEVICE_CALLABLE Transform2 operator* (const Transform2 &t) const
 Applies this transform to another transform. More...
 
HERMES_DEVICE_CALLABLE void reset ()
 Sets this transform back to identity.
 
HERMES_DEVICE_CALLABLE vec2 getTranslate () const
 Extracts translation vector. More...
 
HERMES_DEVICE_CALLABLE vec2 getScale () const
 Extracts scale vector. More...
 
HERMES_DEVICE_CALLABLE mat3 getMatrix () const
 Extracts rotation matrix. More...
 
HERMES_DEVICE_CALLABLE const real_toperator[] (u32 row_index) const
 Gets transform matrix row. More...
 
HERMES_DEVICE_CALLABLE real_toperator[] (u32 row_index)
 Gets transform matrix row. More...
 

Static Public Member Functions

static HERMES_DEVICE_CALLABLE Transform2 scale (const vec2 &s)
 Creates scale transform. More...
 
static HERMES_DEVICE_CALLABLE Transform2 rotate (real_t angle)
 Creates rotation transform. More...
 
static HERMES_DEVICE_CALLABLE Transform2 translate (const vec2 &v)
 Creates translation transform. More...
 
static MemoryDumper::RegionLayout memoryDumpLayout ()
 Gets memory layout. More...
 

Friends

Transform2 inverse (const Transform2 &t)
 Gets inverse transform from t. More...
 

Detailed Description

Represents a 2-dimensional transformation.

Constructor & Destructor Documentation

◆ Transform2() [1/2]

HERMES_DEVICE_CALLABLE hermes::Transform2::Transform2 ( const mat3 mat)

Constructs from matrix.

Parameters
mat

◆ Transform2() [2/2]

HERMES_DEVICE_CALLABLE hermes::Transform2::Transform2 ( const bbox2 bbox)

Constructs from bounding box.

Parameters
bbox

Member Function Documentation

◆ getMatrix()

HERMES_DEVICE_CALLABLE mat3 hermes::Transform2::getMatrix ( ) const
inline

Extracts rotation matrix.

Returns

◆ getScale()

HERMES_DEVICE_CALLABLE vec2 hermes::Transform2::getScale ( ) const
inline

Extracts scale vector.

Returns

◆ getTranslate()

HERMES_DEVICE_CALLABLE vec2 hermes::Transform2::getTranslate ( ) const
inline

Extracts translation vector.

Returns

◆ memoryDumpLayout()

static MemoryDumper::RegionLayout hermes::Transform2::memoryDumpLayout ( )
inlinestatic

Gets memory layout.

Returns

◆ operator()() [1/6]

HERMES_DEVICE_CALLABLE bbox2 hermes::Transform2::operator() ( const bbox2 b) const
inline

Applies this transform to geometric box.

Parameters
b
Returns

◆ operator()() [2/6]

HERMES_DEVICE_CALLABLE point2 hermes::Transform2::operator() ( const point2 p) const
inline

Applies this transform to geometric point.

Parameters
p
Returns

◆ operator()() [3/6]

HERMES_DEVICE_CALLABLE void hermes::Transform2::operator() ( const point2 p,
point2 r 
) const
inline

Applies this transform to geometric point.

Parameters
p
r

◆ operator()() [4/6]

HERMES_DEVICE_CALLABLE Ray2 hermes::Transform2::operator() ( const Ray2 r)
inline

Applies this transform to geometric ray.

Parameters
r
Returns

◆ operator()() [5/6]

HERMES_DEVICE_CALLABLE vec2 hermes::Transform2::operator() ( const vec2 v) const
inline

Applies this transform to geometric vector.

Parameters
v
Returns

◆ operator()() [6/6]

HERMES_DEVICE_CALLABLE void hermes::Transform2::operator() ( const vec2 v,
vec2 r 
) const
inline

Applies this transform to geometric vector.

Parameters
v
r

◆ operator*()

HERMES_DEVICE_CALLABLE Transform2 hermes::Transform2::operator* ( const Transform2 t) const
inline

Applies this transform to another transform.

Parameters
t
Returns

◆ operator[]() [1/2]

HERMES_DEVICE_CALLABLE real_t* hermes::Transform2::operator[] ( u32  row_index)
inline

Gets transform matrix row.

Parameters
row_index
Returns

◆ operator[]() [2/2]

HERMES_DEVICE_CALLABLE const real_t* hermes::Transform2::operator[] ( u32  row_index) const
inline

Gets transform matrix row.

Parameters
row_index
Returns

◆ rotate()

HERMES_DEVICE_CALLABLE Transform2 hermes::Transform2::rotate ( real_t  angle)
static

Creates rotation transform.

Parameters
angle
Returns

◆ scale()

HERMES_DEVICE_CALLABLE Transform2 hermes::Transform2::scale ( const vec2 s)
static

Creates scale transform.

Parameters
s
Returns

◆ translate()

HERMES_DEVICE_CALLABLE Transform2 hermes::Transform2::translate ( const vec2 v)
static

Creates translation transform.

Parameters
v
Returns

Friends And Related Function Documentation

◆ inverse

Transform2 inverse ( const Transform2 t)
friend

Gets inverse transform from t.

Parameters
t
Returns

The documentation for this class was generated from the following files: