Transform¶
-
template<IsFloatingPoint T>
struct Transform¶ Rigid body transform with position, rotation, scale, and kinematic quantities.
Represents a 3D transformation including translation, rotation, scale, velocity, and angular velocity. Provides methods for conversion to matrix, inversion, composition, and application to points, directions, and velocities.
- Template Parameters:
T – Floating point type (float or double)
Public Functions
-
template<IsFloatingPoint U>
explicit operator Transform<U>() const¶ Convert this Transform to another floating point type.
- Template Parameters:
U – Target floating point type
- Returns:
-
Mat4<T> to_matrix() const¶
Convert the transform to a 4x4 matrix (T * R * S).
- Returns:
Mat4<T> Transformation matrix
-
Transform<T> inverse() const¶
Compute the inverse of the transform.
- Returns:
Transform<T> Inverse transform
-
Transform<T> operator*(const Transform<T> &b) const¶
Compose this transform with another.
- Parameters:
b – Other transform
- Returns:
Transform<T> Composed transform
-
Vec3<T> apply_to_point(const Vec3<T> &point) const¶
Apply the transform to a point (scale, rotate, translate).
- Parameters:
point – Point to transform
- Returns:
Vec3<T> Transformed point
-
Vec3<T> apply_to_direction(const Vec3<T> &dir) const¶
Apply the transform to a direction (scale, rotate).
- Parameters:
dir – Direction to transform
- Returns:
Vec3<T> Transformed direction
-
Vec3<T> apply_to_velocity(const Vec3<T> &vel) const¶
Apply the transform to a velocity (scale, rotate, add velocity).
- Parameters:
vel – Velocity to transform
- Returns:
Vec3<T> Transformed velocity
-
Vec3<T> apply_to_angular_velocity(const Vec3<T> &ang_vel) const¶
Apply the transform to an angular velocity (rotate, add angular velocity).
- Parameters:
ang_vel – Angular velocity to transform
- Returns:
Vec3<T> Transformed angular velocity