lv_gltf_math.hpp

API reference for lv_gltf_math.hpp

Report on GitHub

GLTF math utilities and helper functions.

Functions

lv_gltf_math_look_at_rh

cpp
fastgltf::math::fmat4x4 lv_gltf_math_look_at_rh(const fastgltf::math::fvec3 &eye, const fastgltf::math::fvec3 &center, const fastgltf::math::fvec3 &up) noexcept
Parameters
NameType
eyeconst fastgltf::math::fvec3 &
centerconst fastgltf::math::fvec3 &
upconst fastgltf::math::fvec3 &

lv_gltf_math_perspective_rh

cpp
fastgltf::math::fmat4x4 lv_gltf_math_perspective_rh(float fov, float ratio, float z_near, float z_far) noexcept
Parameters
NameType
fovfloat
ratiofloat
z_nearfloat
z_farfloat

lv_gltf_math_euler_to_quaternion

Build a rotation quaternion from Euler angles given in radians. The angles are the rotations around the X, Y and Z axis, in that order.

cpp
template <typename T>
fastgltf::math::quat< T > lv_gltf_math_euler_to_quaternion(T x, T y, T z)
Parameters
NameType
xT
yT
zT

Template Parameters:

NameTypeDescription
Ttypename

lv_gltf_math_quaternion_to_euler

Decompose a rotation quaternion into Euler angles in radians. The result holds the rotations around the X, Y and Z axis, in that order, so that it can be passed back to lv_gltf_math_euler_to_quaternion().

cpp
template <typename T>
fastgltf::math::vec< T, 3 > lv_gltf_math_quaternion_to_euler(fastgltf::math::quat< T > q)
Parameters
NameType
qfastgltf::math::quat< T >

Template Parameters:

NameTypeDescription
Ttypename

Macros

M_PI

 
#define M_PI 3.14159265358979323846264338327950288

Dependencies

  • lvgl_public.h
  • math.hpp

Last updated on

On this page