Raven Engine v0.1
A modern 3D Game Engine
Loading...
Searching...
No Matches
Crux::Interop Namespace Reference

Functions

constexpr Matrix< f32, 4, 4 > ToGLSpace_View (const Matrix< f32, 4, 4 > &mat)
 Converts a row-major view matrix to OpenGL column-major space.
constexpr Matrix< f32, 4, 4 > ToGLSpace_Projection (const Matrix< f32, 4, 4 > &mat)
 Converts a row-major projection matrix to OpenGL column-major space.
constexpr Matrix< f32, 4, 4 > ToGLSpace_Object (const Matrix< f32, 4, 4 > &mat)
 Converts an object/world matrix to OpenGL column-major space.
constexpr Matrix< f32, 4, 4 > FromGLSpace_Object (const Matrix< f32, 4, 4 > &mat)
 Converts an OpenGL column-major object/world matrix back to Crux row-major space.

Function Documentation

◆ FromGLSpace_Object()

Matrix< f32, 4, 4 > Crux::Interop::FromGLSpace_Object ( const Matrix< f32, 4, 4 > & mat)
constexpr

Converts an OpenGL column-major object/world matrix back to Crux row-major space.

Reverses the Z-axis flip and transposes the matrix, returning it to Crux’s internal coordinate system. Useful for taking the result from ImGuizmo and applying it to the engine.

Parameters
matThe OpenGL column-major object/world matrix.
Returns
Matrix in Crux row-major layout.

◆ ToGLSpace_Object()

Matrix< f32, 4, 4 > Crux::Interop::ToGLSpace_Object ( const Matrix< f32, 4, 4 > & mat)
constexpr

Converts an object/world matrix to OpenGL column-major space.

Transposes the matrix and flips the Z axis to match OpenGL conventions, preparing it for manipulation with ImGuizmo or rendering.

Parameters
matThe row-major object/world matrix.
Returns
Transformed matrix in OpenGL column-major layout.

◆ ToGLSpace_Projection()

Matrix< f32, 4, 4 > Crux::Interop::ToGLSpace_Projection ( const Matrix< f32, 4, 4 > & mat)
constexpr

Converts a row-major projection matrix to OpenGL column-major space.

Transposes the matrix and flips the Y axis to match OpenGL’s clip space convention.

Parameters
matThe row-major projection matrix.
Returns
Transformed matrix in OpenGL column-major layout.

◆ ToGLSpace_View()

Matrix< f32, 4, 4 > Crux::Interop::ToGLSpace_View ( const Matrix< f32, 4, 4 > & mat)
constexpr

Converts a row-major view matrix to OpenGL column-major space.

Transposes the matrix to account for Crux's camera convention vs OpenGL’s coordinate system. This ensures the camera does not move incorrectly when passed to ImGuizmo or OpenGL.

Parameters
matThe row-major view matrix.
Returns
Transformed matrix in OpenGL column-major layout.