Unravel Engine C++ Reference
Loading...
Searching...
No Matches
math::transform_t< T, Q > Class Template Reference

General purpose transformation class designed to maintain each component of the transformation separate (translation, rotation, scale and shear) whilst providing much of the same functionality provided by standard matrices. More...

#include <transform.hpp>

Public Types

using mat3_t = mat<3, 3, T, Q>
 
using mat4_t = mat<4, 4, T, Q>
 
using vec2_t = vec<2, T, Q>
 
using vec3_t = vec<3, T, Q>
 
using vec4_t = vec<4, T, Q>
 
using quat_t = qua<T, Q>
 
using length_t = typename mat4_t::length_type
 
using col_t = typename mat4_t::col_type
 

Public Member Functions

 transform_t ()=default
 Default constructor.
 
 ~transform_t ()=default
 
 transform_t (const transform_t &t) noexcept=default
 Copy constructor.
 
 transform_t (transform_t &&t) noexcept=default
 Move constructor.
 
auto operator= (const transform_t &m) noexcept -> transform_t &=default
 Copy assignment operator.
 
auto operator= (transform_t &&m) noexcept -> transform_t &=default
 Move assignment operator.
 
 transform_t (const mat4_t &m) noexcept
 Constructor from a 4x4 matrix.
 
auto get_position () const noexcept -> const vec3_t &
 Get the position component.
 
auto get_translation () const noexcept -> const vec3_t &
 Get the translation component.
 
void set_translation (const vec3_t &position) noexcept
 Set the translation component.
 
void set_translation (T x, T y, T z=T(0)) noexcept
 Set the translation component.
 
void reset_translation () noexcept
 Reset the translation component to zero.
 
void set_position (const vec3_t &position) noexcept
 Set the position component.
 
void set_position (T x, T y, T z=T(0)) noexcept
 Set the position component.
 
void reset_position () noexcept
 Reset the position component to zero.
 
auto get_rotation_euler () const noexcept -> vec3_t
 Get the rotation component as Euler angles.
 
auto get_rotation_euler_degrees () const noexcept -> vec3_t
 Get the rotation component as Euler angles in degrees.
 
auto get_rotation_euler_degrees (vec3_t hint) const noexcept -> vec3_t
 Get the rotation component as Euler angles in degrees with a hint.
 
void set_rotation_euler (const vec3_t &euler_angles) noexcept
 Set the rotation component using Euler angles.
 
void set_rotation_euler (T x, T y, T z) noexcept
 Set the rotation component using Euler angles.
 
void set_rotation_euler_degrees (const vec3_t &euler_angles) noexcept
 Set the rotation component using Euler angles in degrees.
 
void set_rotation_euler_degrees (T x, T y, T z) noexcept
 Set the rotation component using Euler angles in degrees.
 
auto get_rotation () const noexcept -> const quat_t &
 Get the rotation component.
 
void set_rotation (const quat_t &rotation) noexcept
 Set the rotation component.
 
void set_rotation (const vec3_t &x, const vec3_t &y, const vec3_t &z) noexcept
 Set the rotation component using basis vectors.
 
void reset_rotation () noexcept
 Reset the rotation component to identity.
 
auto get_scale () const noexcept -> const vec3_t &
 Get the scale component.
 
void set_scale (const vec3_t &scale) noexcept
 Set the scale component.
 
void set_scale (T x, T y, T z=T(1)) noexcept
 Set the scale component.
 
void reset_scale () noexcept
 Reset the scale component to one.
 
auto get_skew () const noexcept -> const vec3_t &
 Get the skew component.
 
void set_skew (const vec3_t &skew) noexcept
 Set the skew component.
 
void set_skew (T x, T y, T z) noexcept
 Set the skew component.
 
void reset_skew () noexcept
 Reset the skew component to zero.
 
auto get_perspective () const noexcept -> const vec4_t &
 Get the perspective component.
 
void set_perspective (const vec4_t &perspective) noexcept
 Set the perspective component.
 
void set_perspective (T x, T y, T z, T w) noexcept
 Set the perspective component.
 
void reset_perspective () noexcept
 Reset the perspective component to default.
 
auto x_axis () const noexcept -> vec3_t
 Get the X axis of the transform.
 
auto y_axis () const noexcept -> vec3_t
 Get the Y axis of the transform.
 
auto z_axis () const noexcept -> vec3_t
 Get the Z axis of the transform.
 
auto x_unit_axis () const noexcept -> vec3_t
 Get the unit X axis of the transform.
 
auto y_unit_axis () const noexcept -> vec3_t
 Get the unit Y axis of the transform.
 
auto z_unit_axis () const noexcept -> vec3_t
 Get the unit Z axis of the transform.
 
void rotate_axis (T a, const vec3_t &v) noexcept
 Rotate the transform around an axis.
 
void rotate (const quat_t &q) noexcept
 Rotate the transform using a quaternion.
 
void rotate (T x, T y, T z) noexcept
 Rotate the transform using Euler angles.
 
void rotate (const vec3_t &v) noexcept
 Rotate the transform using Euler angles.
 
void rotate_local (T x, T y, T z) noexcept
 Rotate the transform locally using Euler angles.
 
void rotate_local (const vec3_t &v) noexcept
 Rotate the transform locally using Euler angles.
 
void scale (T x, T y, T z=T(1)) noexcept
 Scale the transform.
 
void scale (const vec3_t &v) noexcept
 Scale the transform.
 
void translate (T x, T y, T z=T(0)) noexcept
 Translate the transform.
 
void translate (const vec3_t &v) noexcept
 Translate the transform.
 
void translate_local (T x, T y, T z=T(0)) noexcept
 Translate the transform locally.
 
void translate_local (const vec3_t &v) noexcept
 Translate the transform locally.
 
auto compare (const transform_t &rhs) const noexcept -> int
 Compare this transform with another.
 
auto compare (const transform_t &rhs, T tolerance) const noexcept -> int
 Compare this transform with another within a tolerance.
 
auto transform_coord (const vec2_t &v) const noexcept -> vec2_t
 Transform a 2D coordinate.
 
auto inverse_transform_coord (const vec2_t &v) const noexcept -> vec2_t
 Inverse transform a 2D coordinate.
 
auto transform_normal (const vec2_t &v) const noexcept -> vec2_t
 Transform a 2D normal.
 
auto inverse_transform_normal (const vec2_t &v) const noexcept -> vec2_t
 Inverse transform a 2D normal.
 
auto transform_coord (const vec3_t &v) const noexcept -> vec3_t
 Transform a 3D coordinate.
 
auto inverse_transform_coord (const vec3_t &v) const noexcept -> vec3_t
 Inverse transform a 3D coordinate.
 
auto transform_normal (const vec3_t &v) const noexcept -> vec3_t
 Transform a 3D normal.
 
auto inverse_transform_normal (const vec3_t &v) const noexcept -> vec3_t
 Inverse transform a 3D normal.
 
 operator const mat4_t & () const noexcept
 Implicit conversion to a constant reference to the transformation matrix.
 
 operator const mat4_t * () const noexcept
 Implicit conversion to a constant pointer to the transformation matrix.
 
 operator const T * () const noexcept
 Implicit conversion to a constant pointer to the transformation matrix data.
 
auto operator* (const transform_t &t) const noexcept -> transform_t
 Multiply two transforms.
 
auto operator== (const transform_t &t) const noexcept -> bool
 Compare two transforms for equality.
 
auto operator!= (const transform_t &t) const noexcept -> bool
 Compare two transforms for inequality.
 
auto operator[] (length_t i) const noexcept -> const col_t &
 Get a column of the transform matrix.
 
auto operator* (const vec4_t &v) const noexcept -> vec4_t
 Transform a 4D vector.
 
auto get_matrix () const noexcept -> const mat4_t &
 Get the transform matrix.
 

Static Public Member Functions

static auto identity () noexcept -> const transform_t &
 Get the identity transform.
 
static auto scaling (const vec2_t &scale) noexcept -> transform_t
 Create a scaling transform.
 
static auto scaling (const vec3_t &scale) noexcept -> transform_t
 Create a scaling transform.
 
static auto rotation (const quat_t &rotation) noexcept -> transform_t
 Create a rotation transform.
 
static auto rotation_euler (const vec3_t &euler_angles) noexcept -> transform_t
 Create a rotation transform from Euler angles.
 
static auto translation (const vec2_t &trans) noexcept -> transform_t
 Create a translation transform.
 
static auto translation (const vec3_t &trans) noexcept -> transform_t
 Create a translation transform.
 

Detailed Description

template<typename T, precision Q = defaultp>
class math::transform_t< T, Q >

General purpose transformation class designed to maintain each component of the transformation separate (translation, rotation, scale and shear) whilst providing much of the same functionality provided by standard matrices.

Definition at line 26 of file transform.hpp.

Member Typedef Documentation

◆ col_t

template<typename T , precision Q = defaultp>
using math::transform_t< T, Q >::col_t = typename mat4_t::col_type

Definition at line 36 of file transform.hpp.

◆ length_t

template<typename T , precision Q = defaultp>
using math::transform_t< T, Q >::length_t = typename mat4_t::length_type

Definition at line 35 of file transform.hpp.

◆ mat3_t

template<typename T , precision Q = defaultp>
using math::transform_t< T, Q >::mat3_t = mat<3, 3, T, Q>

Definition at line 29 of file transform.hpp.

◆ mat4_t

template<typename T , precision Q = defaultp>
using math::transform_t< T, Q >::mat4_t = mat<4, 4, T, Q>

Definition at line 30 of file transform.hpp.

◆ quat_t

template<typename T , precision Q = defaultp>
using math::transform_t< T, Q >::quat_t = qua<T, Q>

Definition at line 34 of file transform.hpp.

◆ vec2_t

template<typename T , precision Q = defaultp>
using math::transform_t< T, Q >::vec2_t = vec<2, T, Q>

Definition at line 31 of file transform.hpp.

◆ vec3_t

template<typename T , precision Q = defaultp>
using math::transform_t< T, Q >::vec3_t = vec<3, T, Q>

Definition at line 32 of file transform.hpp.

◆ vec4_t

template<typename T , precision Q = defaultp>
using math::transform_t< T, Q >::vec4_t = vec<4, T, Q>

Definition at line 33 of file transform.hpp.

Constructor & Destructor Documentation

◆ transform_t() [1/4]

template<typename T , precision Q = defaultp>
math::transform_t< T, Q >::transform_t ( )
default

Default constructor.

◆ ~transform_t()

template<typename T , precision Q = defaultp>
math::transform_t< T, Q >::~transform_t ( )
default

◆ transform_t() [2/4]

template<typename T , precision Q = defaultp>
math::transform_t< T, Q >::transform_t ( const transform_t< T, Q > & t)
defaultnoexcept

Copy constructor.

◆ transform_t() [3/4]

template<typename T , precision Q = defaultp>
math::transform_t< T, Q >::transform_t ( transform_t< T, Q > && t)
defaultnoexcept

Move constructor.

◆ transform_t() [4/4]

template<typename T , precision Q>
TRANSFORM_INLINE math::transform_t< T, Q >::transform_t ( const mat4_t & m)
noexcept

Constructor from a 4x4 matrix.

Definition at line 743 of file transform.hpp.

Member Function Documentation

◆ compare() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::compare ( const transform_t< T, Q > & rhs) const -> int
noexcept

Compare this transform with another.

Parameters
tThe transform to compare with.
Returns
-1, 0, or 1 based on comparison.

Definition at line 1109 of file transform.hpp.

◆ compare() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::compare ( const transform_t< T, Q > & rhs,
T tolerance ) const -> int
noexcept

Compare this transform with another within a tolerance.

Parameters
tThe transform to compare with.
toleranceThe tolerance value.
Returns
-1, 0, or 1 based on comparison.

Definition at line 1115 of file transform.hpp.

◆ get_matrix()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::get_matrix ( ) const -> const mat4_t&
noexcept

Get the transform matrix.

Returns
A constant reference to the transform matrix.

Definition at line 1384 of file transform.hpp.

◆ get_perspective()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::get_perspective ( ) const -> const vec4_t&
noexcept

Get the perspective component.

Returns
A constant reference to the perspective vector.

Definition at line 947 of file transform.hpp.

◆ get_position()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::get_position ( ) const -> const vec3_t&
noexcept

Get the position component.

Returns
A constant reference to the position vector.

Definition at line 753 of file transform.hpp.

◆ get_rotation()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::get_rotation ( ) const -> const quat_t&
noexcept

Get the rotation component.

Returns
A constant reference to the quaternion rotation.

Definition at line 933 of file transform.hpp.

◆ get_rotation_euler()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::get_rotation_euler ( ) const -> vec3_t
noexcept

Get the rotation component as Euler angles.

Returns
The rotation component as Euler angles.

Definition at line 804 of file transform.hpp.

◆ get_rotation_euler_degrees() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::get_rotation_euler_degrees ( ) const -> vec3_t
noexcept

Get the rotation component as Euler angles in degrees.

Returns
The rotation component as Euler angles in degrees.

Definition at line 810 of file transform.hpp.

◆ get_rotation_euler_degrees() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::get_rotation_euler_degrees ( vec3_t hint) const -> vec3_t
noexcept

Get the rotation component as Euler angles in degrees with a hint.

Parameters
hintThe hint vector for calculating the Euler angles.
Returns
The rotation component as Euler angles in degrees.

Definition at line 818 of file transform.hpp.

◆ get_scale()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::get_scale ( ) const -> const vec3_t&
noexcept

Get the scale component.

Returns
A constant reference to the scale vector.

Definition at line 860 of file transform.hpp.

◆ get_skew()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::get_skew ( ) const -> const vec3_t&
noexcept

Get the skew component.

Returns
A constant reference to the skew vector.

Definition at line 940 of file transform.hpp.

◆ get_translation()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::get_translation ( ) const -> const vec3_t&
noexcept

Get the translation component.

Returns
A constant reference to the translation vector.

Definition at line 760 of file transform.hpp.

◆ identity()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::identity ( ) -> const transform_t&
staticnoexcept

Get the identity transform.

Returns
A constant reference to the identity transform.

Definition at line 1292 of file transform.hpp.

◆ inverse_transform_coord() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::inverse_transform_coord ( const vec2_t & v) const -> vec2_t
noexcept

Inverse transform a 2D coordinate.

Parameters
vThe 2D vector to inverse transform.
Returns
The inverse transformed 2D coordinate.

Definition at line 1187 of file transform.hpp.

◆ inverse_transform_coord() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::inverse_transform_coord ( const vec3_t & v) const -> vec3_t
noexcept

Inverse transform a 3D coordinate.

Parameters
vThe 3D vector to inverse transform.
Returns
The inverse transformed 3D coordinate.

Definition at line 1223 of file transform.hpp.

◆ inverse_transform_normal() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::inverse_transform_normal ( const vec2_t & v) const -> vec2_t
noexcept

Inverse transform a 2D normal.

Parameters
vThe 2D normal to inverse transform.
Returns
The inverse transformed 2D normal.

Definition at line 1201 of file transform.hpp.

◆ inverse_transform_normal() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::inverse_transform_normal ( const vec3_t & v) const -> vec3_t
noexcept

Inverse transform a 3D normal.

Parameters
vThe 3D normal to inverse transform.
Returns
The inverse transformed 3D normal.

Definition at line 1274 of file transform.hpp.

◆ operator const mat4_t &()

template<typename T , precision Q = defaultp>
math::transform_t< T, Q >::operator const mat4_t & ( ) const
noexcept

Implicit conversion to a constant reference to the transformation matrix.

Allows the transform to be used wherever a constant reference to a mat4_t is expected.

Returns
A constant reference to the transformation matrix.

◆ operator const mat4_t *()

template<typename T , precision Q = defaultp>
math::transform_t< T, Q >::operator const mat4_t * ( ) const
noexcept

Implicit conversion to a constant pointer to the transformation matrix.

Allows the transform to be used wherever a constant pointer to a mat4_t is expected.

Returns
A constant pointer to the transformation matrix.

◆ operator const T *()

template<typename T , precision Q>
TRANSFORM_INLINE math::transform_t< T, Q >::operator const T * ( ) const
noexcept

Implicit conversion to a constant pointer to the transformation matrix data.

Allows the transform to be used wherever a constant pointer to the underlying data is expected, facilitating interfacing with APIs that require raw matrix data.

Returns
A constant pointer to the transformation matrix data.

Definition at line 1493 of file transform.hpp.

◆ operator!=()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::operator!= ( const transform_t< T, Q > & t) const -> bool
noexcept

Compare two transforms for inequality.

Parameters
tThe transform to compare with.
Returns
True if not equal, false otherwise.

Definition at line 1378 of file transform.hpp.

◆ operator*() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::operator* ( const transform_t< T, Q > & t) const -> transform_t
noexcept

Multiply two transforms.

Parameters
tThe transform to multiply by.
Returns
The result of the multiplication.

Definition at line 1343 of file transform.hpp.

◆ operator*() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::operator* ( const vec4_t & v) const -> vec4_t
noexcept

Transform a 4D vector.

Parameters
vThe vector to transform.
Returns
The transformed 4D vector.

Definition at line 1486 of file transform.hpp.

◆ operator=() [1/2]

template<typename T , precision Q = defaultp>
auto math::transform_t< T, Q >::operator= ( const transform_t< T, Q > & m) -> transform_t &=default
defaultnoexcept

Copy assignment operator.

◆ operator=() [2/2]

template<typename T , precision Q = defaultp>
auto math::transform_t< T, Q >::operator= ( transform_t< T, Q > && m) -> transform_t &=default
defaultnoexcept

Move assignment operator.

◆ operator==()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::operator== ( const transform_t< T, Q > & t) const -> bool
noexcept

Compare two transforms for equality.

Parameters
tThe transform to compare with.
Returns
True if equal, false otherwise.

Definition at line 1372 of file transform.hpp.

◆ operator[]()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::operator[] ( length_t i) const -> const col_t&
noexcept

Get a column of the transform matrix.

Parameters
iThe column index.
Returns
The column of the matrix.

Definition at line 1480 of file transform.hpp.

◆ reset_perspective()

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::reset_perspective ( )
noexcept

Reset the perspective component to default.

Definition at line 927 of file transform.hpp.

◆ reset_position()

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::reset_position ( )
noexcept

Reset the position component to zero.

Definition at line 798 of file transform.hpp.

◆ reset_rotation()

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::reset_rotation ( )
noexcept

Reset the rotation component to identity.

Definition at line 969 of file transform.hpp.

◆ reset_scale()

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::reset_scale ( )
noexcept

Reset the scale component to one.

Definition at line 883 of file transform.hpp.

◆ reset_skew()

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::reset_skew ( )
noexcept

Reset the skew component to zero.

Definition at line 905 of file transform.hpp.

◆ reset_translation()

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::reset_translation ( )
noexcept

Reset the translation component to zero.

Definition at line 778 of file transform.hpp.

◆ rotate() [1/3]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::rotate ( const quat_t & q)
noexcept

Rotate the transform using a quaternion.

Parameters
qThe quaternion to rotate by.

Definition at line 1029 of file transform.hpp.

◆ rotate() [2/3]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::rotate ( const vec3_t & v)
noexcept

Rotate the transform using Euler angles.

Parameters
vThe Euler angles.

Definition at line 1049 of file transform.hpp.

◆ rotate() [3/3]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::rotate ( T x,
T y,
T z )
noexcept

Rotate the transform using Euler angles.

Parameters
xThe X component.
yThe Y component.
zThe Z component.

Definition at line 1043 of file transform.hpp.

◆ rotate_axis()

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::rotate_axis ( T a,
const vec3_t & v )
noexcept

Rotate the transform around an axis.

Parameters
aThe angle to rotate.
vThe axis to rotate around.

Definition at line 1036 of file transform.hpp.

◆ rotate_local() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::rotate_local ( const vec3_t & v)
noexcept

Rotate the transform locally using Euler angles.

Parameters
vThe Euler angles.

Definition at line 1063 of file transform.hpp.

◆ rotate_local() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::rotate_local ( T x,
T y,
T z )
noexcept

Rotate the transform locally using Euler angles.

Parameters
xThe X component.
yThe Y component.
zThe Z component.

Definition at line 1057 of file transform.hpp.

◆ rotation()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::rotation ( const quat_t & rotation) -> transform_t
staticnoexcept

Create a rotation transform.

Parameters
rotationThe quaternion rotation.
Returns
The rotation transform.

Definition at line 1313 of file transform.hpp.

◆ rotation_euler()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::rotation_euler ( const vec3_t & euler_angles) -> transform_t
staticnoexcept

Create a rotation transform from Euler angles.

Parameters
euler_anglesThe Euler angles.
Returns
The rotation transform.

Definition at line 1321 of file transform.hpp.

◆ scale() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::scale ( const vec3_t & v)
noexcept

Scale the transform.

Parameters
vThe scale vector.

Definition at line 1077 of file transform.hpp.

◆ scale() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::scale ( T x,
T y,
T z = T(1) )
noexcept

Scale the transform.

Parameters
xThe X component.
yThe Y component.
zThe Z component.

Definition at line 1071 of file transform.hpp.

◆ scaling() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::scaling ( const vec2_t & scale) -> transform_t
staticnoexcept

Create a scaling transform.

Parameters
scaleThe scale vector.
Returns
The scaling transform.

Definition at line 1299 of file transform.hpp.

◆ scaling() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::scaling ( const vec3_t & scale) -> transform_t
staticnoexcept

Create a scaling transform.

Parameters
scaleThe scale vector.
Returns
The scaling transform.

Definition at line 1305 of file transform.hpp.

◆ set_perspective() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::set_perspective ( const vec4_t & perspective)
noexcept

Set the perspective component.

Parameters
perspectiveThe new perspective vector.

Definition at line 911 of file transform.hpp.

◆ set_perspective() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::set_perspective ( T x,
T y,
T z,
T w )
noexcept

Set the perspective component.

Parameters
xThe X component.
yThe Y component.
zThe Z component.
wThe W component.

Definition at line 921 of file transform.hpp.

◆ set_position() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::set_position ( const vec3_t & position)
noexcept

Set the position component.

Parameters
positionThe new position vector.

Definition at line 784 of file transform.hpp.

◆ set_position() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::set_position ( T x,
T y,
T z = T(0) )
noexcept

Set the position component.

Parameters
xThe X component.
yThe Y component.
zThe Z component.

Definition at line 792 of file transform.hpp.

◆ set_rotation() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::set_rotation ( const quat_t & rotation)
noexcept

Set the rotation component.

Parameters
rotationThe quaternion rotation to set.

Definition at line 954 of file transform.hpp.

◆ set_rotation() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::set_rotation ( const vec3_t & x,
const vec3_t & y,
const vec3_t & z )
noexcept

Set the rotation component using basis vectors.

Parameters
xThe X basis vector.
yThe Y basis vector.
zThe Z basis vector.

Definition at line 962 of file transform.hpp.

◆ set_rotation_euler() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::set_rotation_euler ( const vec3_t & euler_angles)
noexcept

Set the rotation component using Euler angles.

Parameters
euler_anglesThe Euler angles to set.

Definition at line 836 of file transform.hpp.

◆ set_rotation_euler() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::set_rotation_euler ( T x,
T y,
T z )
noexcept

Set the rotation component using Euler angles.

Parameters
xThe X component.
yThe Y component.
zThe Z component.

Definition at line 842 of file transform.hpp.

◆ set_rotation_euler_degrees() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::set_rotation_euler_degrees ( const vec3_t & euler_angles)
noexcept

Set the rotation component using Euler angles in degrees.

Parameters
euler_anglesThe Euler angles in degrees to set.

Definition at line 848 of file transform.hpp.

◆ set_rotation_euler_degrees() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::set_rotation_euler_degrees ( T x,
T y,
T z )
noexcept

Set the rotation component using Euler angles in degrees.

Parameters
xThe X component.
yThe Y component.
zThe Z component.

Definition at line 854 of file transform.hpp.

◆ set_scale() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::set_scale ( const vec3_t & scale)
noexcept

Set the scale component.

Parameters
scaleThe new scale vector.

Definition at line 867 of file transform.hpp.

◆ set_scale() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::set_scale ( T x,
T y,
T z = T(1) )
noexcept

Set the scale component.

Parameters
xThe X component.
yThe Y component.
zThe Z component.

Definition at line 877 of file transform.hpp.

◆ set_skew() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::set_skew ( const vec3_t & skew)
noexcept

Set the skew component.

Parameters
skewThe new skew vector.

Definition at line 889 of file transform.hpp.

◆ set_skew() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::set_skew ( T x,
T y,
T z )
noexcept

Set the skew component.

Parameters
xThe X component.
yThe Y component.
zThe Z component.

Definition at line 899 of file transform.hpp.

◆ set_translation() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::set_translation ( const vec3_t & position)
noexcept

Set the translation component.

Parameters
positionThe new translation vector.

Definition at line 766 of file transform.hpp.

◆ set_translation() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::set_translation ( T x,
T y,
T z = T(0) )
noexcept

Set the translation component.

Parameters
xThe X component.
yThe Y component.
zThe Z component.

Definition at line 772 of file transform.hpp.

◆ transform_coord() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::transform_coord ( const vec2_t & v) const -> vec2_t
noexcept

Transform a 2D coordinate.

Parameters
vThe 2D vector to transform.
Returns
The transformed 2D coordinate.

Definition at line 1180 of file transform.hpp.

◆ transform_coord() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::transform_coord ( const vec3_t & v) const -> vec3_t
noexcept

Transform a 3D coordinate.

Parameters
vThe 3D vector to transform.
Returns
The transformed 3D coordinate.

Definition at line 1208 of file transform.hpp.

◆ transform_normal() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::transform_normal ( const vec2_t & v) const -> vec2_t
noexcept

Transform a 2D normal.

Parameters
vThe 2D normal to transform.
Returns
The transformed 2D normal.

Definition at line 1194 of file transform.hpp.

◆ transform_normal() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::transform_normal ( const vec3_t & v) const -> vec3_t
noexcept

Transform a 3D normal.

Parameters
vThe 3D normal to transform.
Returns
The transformed 3D normal.

Definition at line 1252 of file transform.hpp.

◆ translate() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::translate ( const vec3_t & v)
noexcept

Translate the transform.

Parameters
vThe translation vector.

Definition at line 1089 of file transform.hpp.

◆ translate() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::translate ( T x,
T y,
T z = T(0) )
noexcept

Translate the transform.

Parameters
xThe X component.
yThe Y component.
zThe Z component.

Definition at line 1083 of file transform.hpp.

◆ translate_local() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::translate_local ( const vec3_t & v)
noexcept

Translate the transform locally.

Parameters
vThe translation vector.

Definition at line 1101 of file transform.hpp.

◆ translate_local() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE void math::transform_t< T, Q >::translate_local ( T x,
T y,
T z = T(0) )
noexcept

Translate the transform locally.

Parameters
xThe X component.
yThe Y component.
zThe Z component.

Definition at line 1095 of file transform.hpp.

◆ translation() [1/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::translation ( const vec2_t & trans) -> transform_t
staticnoexcept

Create a translation transform.

Parameters
transThe translation vector.
Returns
The translation transform.

Definition at line 1329 of file transform.hpp.

◆ translation() [2/2]

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::translation ( const vec3_t & trans) -> transform_t
staticnoexcept

Create a translation transform.

Parameters
transThe translation vector.
Returns
The translation transform.

Definition at line 1335 of file transform.hpp.

◆ x_axis()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::x_axis ( ) const -> vec3_t
noexcept

Get the X axis of the transform.

Returns
The X axis vector.

Definition at line 975 of file transform.hpp.

◆ x_unit_axis()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::x_unit_axis ( ) const -> vec3_t
noexcept

Get the unit X axis of the transform.

Returns
The unit X axis vector.

Definition at line 1011 of file transform.hpp.

◆ y_axis()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::y_axis ( ) const -> vec3_t
noexcept

Get the Y axis of the transform.

Returns
The Y axis vector.

Definition at line 987 of file transform.hpp.

◆ y_unit_axis()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::y_unit_axis ( ) const -> vec3_t
noexcept

Get the unit Y axis of the transform.

Returns
The unit Y axis vector.

Definition at line 1017 of file transform.hpp.

◆ z_axis()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::z_axis ( ) const -> vec3_t
noexcept

Get the Z axis of the transform.

Returns
The Z axis vector.

Definition at line 999 of file transform.hpp.

◆ z_unit_axis()

template<typename T , precision Q>
TRANSFORM_INLINE auto math::transform_t< T, Q >::z_unit_axis ( ) const -> vec3_t
noexcept

Get the unit Z axis of the transform.

Returns
The unit Z axis vector.

Definition at line 1023 of file transform.hpp.


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