Topaz 5.0
Topaz Game Engine
Loading...
Searching...
No Matches
tz::trs Struct Reference

Description

Encapsulates a combination of a Translation, Rotation, and Scale in 3D space.

#include "trs.hpp"

Public Member Functions

trs lerp (const trs &rhs, float factor) const
 Linearly interpolate between this transform and another based on a factor, and return that result.
 
m4f matrix () const
 Create a matrix that performs an identical transformation.
 
trs inverse () const
 Return an inverse transform that does the exact opposite (such that multiplying a transform by its inverse yields no transformation).
 
trs combine (const trs &rhs)
 Combine one transform with another, and return the result.
 

Static Public Member Functions

static trs from_matrix (m4f mat)
 Create a new TRS that performs the identical transformation to the given matrix.
 

Public Attributes

tz::v3f translate = tz::v3f::zero()
 Translation Component.
 
tz::quat rotate = tz::quat::iden()
 Rotation Component.
 
tz::v3f scale = tz::v3f::filled(1.0f)
 Scale Component.
 

Member Function Documentation

◆ lerp()

trs tz::trs::lerp ( const trs & rhs,
float factor ) const

Linearly interpolate between this transform and another based on a factor, and return that result.

◆ matrix()

m4f tz::trs::matrix ( ) const

Create a matrix that performs an identical transformation.

◆ from_matrix()

static trs tz::trs::from_matrix ( m4f mat)
static

Create a new TRS that performs the identical transformation to the given matrix.

◆ inverse()

trs tz::trs::inverse ( ) const

Return an inverse transform that does the exact opposite (such that multiplying a transform by its inverse yields no transformation).

◆ combine()

trs tz::trs::combine ( const trs & rhs)

Combine one transform with another, and return the result.

Note
TRS combine operations, like matrix multiplications, are not commutative.

Member Data Documentation

◆ translate

tz::v3f tz::trs::translate = tz::v3f::zero()

Translation Component.

◆ rotate

tz::quat tz::trs::rotate = tz::quat::iden()

Rotation Component.

◆ scale

tz::v3f tz::trs::scale = tz::v3f::filled(1.0f)

Scale Component.