namespace CCL::TransformUtils3D

Overview

3D Transformation Utilities More…

namespace TransformUtils3D {

// global functions

Transform3D perspectiveFovLH (
    float fovY,
    float aspect,
    float nearClipDistance,
    float farClipDistance
);

void screenSpaceToCameraSpace (PointF& coordinates, float fovY, float aspect);
Transform3D lookAt (PointF3DRef eye, PointF3DRef at, PointF3DRef up);
Transform3D rotateYawPitchRoll (float yaw, float pitch, float roll);

void getYawPitchRollAngles (
    float& yaw,
    float& pitch,
    float& roll,
    Transform3DRef transform
);

Transform3D rotateAroundAxis (PointF3DRef axis, float angle);

} // namespace TransformUtils3D

Detailed Documentation

3D Transformation Utilities

Global Functions

Transform3D perspectiveFovLH (
    float fovY,
    float aspect,
    float nearClipDistance,
    float farClipDistance
)

Create a left-handed perspective projection matrix based on a field of view.

void screenSpaceToCameraSpace (PointF& coordinates, float fovY, float aspect)

Transform coordinates in screen space (range -1 to 1) to coordinates in camera space.

Transform3D lookAt (PointF3DRef eye, PointF3DRef at, PointF3DRef up)

Create a perspective transform of a camera looking at the specified point.

Transform3D rotateYawPitchRoll (float yaw, float pitch, float roll)

Create a rotation transform using yaw, pitch, roll coordinate axes.

void getYawPitchRollAngles (
    float& yaw,
    float& pitch,
    float& roll,
    Transform3DRef transform
)

Extract yaw, pitch, roll angles form a transform matrix.

Transform3D rotateAroundAxis (PointF3DRef axis, float angle)

Create a rotation transform using a fixed axis and an angle around this axis (radians).