template<typename T>
bpf::math::Transform3 class

Template parameters
T the type of number

Utility to represent a transformation in 3D space

Public types

class MatrixBuilder

Constructors, destructors, conversion operators

Transform3(const Vector3<T>& pos = Vector3<T>::Zero, const Vector3<T>& scale = Vector3<T>::Identity, const Quaternion<T>& rotation = Quaternion<T>::Identity) explicit

Public functions

auto LocalToWorld(const Vector3<T>& local) -> Vector3<T>
auto WorldToLocal(const Vector3<T>& world) -> Vector3<T>
auto ToMatrix() const -> Matrix4<T> noexcept
auto operator+(const Transform3& other) const -> Transform3 noexcept
void operator+=(const Transform3& other)
void RotateArround(const Vector3<T>& pivot, const Quaternion<T>& rotation) noexcept
void LookAt(const Vector3<T>& target, const Vector3<T>& forward = Vector3<T>::Forward, const Vector3<T>& up = Vector3<T>::Up) noexcept

Public variables

Vector3<T> Position
Vector3<T> Scale
Quaternion<T> Rotation

Function documentation

template<typename T>
bpf::math::Transform3<T>::Transform3(const Vector3<T>& pos = Vector3<T>::Zero, const Vector3<T>& scale = Vector3<T>::Identity, const Quaternion<T>& rotation = Quaternion<T>::Identity) explicit

Parameters
pos transform position
scale transform scale
rotation transform rotation

Constructs a 3D transform

template<typename T>
Vector3<T> bpf::math::Transform3<T>::LocalToWorld(const Vector3<T>& local)

Parameters
local 3D point to transform
Returns new transformed 3D point

Transforms a point

template<typename T>
Vector3<T> bpf::math::Transform3<T>::WorldToLocal(const Vector3<T>& world)

Parameters
world 3D point to revert transformation
Returns new de-transformed 3D point

Revert transformation from a point

template<typename T>
Matrix4<T> bpf::math::Transform3<T>::ToMatrix() const noexcept

Returns order 4 square matrix

Computes the matrix of this transform

template<typename T>
Transform3 bpf::math::Transform3<T>::operator+(const Transform3& other) const noexcept

Parameters
other transform to add
Returns new transform

Adds two transforms

template<typename T>
void bpf::math::Transform3<T>::operator+=(const Transform3& other)

Parameters
other transform to add

Adds a transform to this transform

template<typename T>
void bpf::math::Transform3<T>::RotateArround(const Vector3<T>& pivot, const Quaternion<T>& rotation) noexcept

Parameters
pivot rotation origin
rotation unit quaternion

Rotates this transform around a point

template<typename T>
void bpf::math::Transform3<T>::LookAt(const Vector3<T>& target, const Vector3<T>& forward = Vector3<T>::Forward, const Vector3<T>& up = Vector3<T>::Up) noexcept

Parameters
target the target point to look at
forward the world's forward vector
up the world's up vector

Updates this transform to look at a given point

Variable documentation

template<typename T>
Vector3<T> bpf::math::Transform3<T>::Position

Transform position

template<typename T>
Vector3<T> bpf::math::Transform3<T>::Scale

Transform scale

template<typename T>
Quaternion<T> bpf::math::Transform3<T>::Rotation

Transform rotation as a unit quaternion