载入中...
搜索中...
未找到
TransformEuler.h
浏览该文件的文档.
1#pragma once
2
3#include <glm/glm.hpp>
4#include <glm/gtc/quaternion.hpp>
5#ifndef GLM_ENABLE_EXPERIMENTAL
6#define GLM_ENABLE_EXPERIMENTAL
7#endif
8#include <glm/gtx/euler_angles.hpp>
9
10namespace eve {
11
41template <typename T>
42inline void eulerYxzFromMatrix(const glm::mat<4, 4, T, glm::defaultp>& m, T& yaw, T& pitch, T& roll) {
43 glm::extractEulerAngleYXZ(m, yaw, pitch, roll);
44}
45
47template <typename T>
48inline void eulerYxzFromQuat(const glm::qua<T, glm::defaultp>& q, T& yaw, T& pitch, T& roll) {
49 eulerYxzFromMatrix(glm::mat4_cast(glm::normalize(q)), yaw, pitch, roll);
50}
51
52} // namespace eve
double m[16]
float yaw
Definition BushMesh.cpp:37
std::array< double, 10 > q
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16
void eulerYxzFromQuat(const glm::qua< T, glm::defaultp > &q, T &yaw, T &pitch, T &roll)
Quaternion overload of eulerYxzFromMatrix(); float and double both work.
void eulerYxzFromMatrix(const glm::mat< 4, 4, T, glm::defaultp > &m, T &yaw, T &pitch, T &roll)
Yaw/pitch/roll for the engine's transform order T * Ry * Rx * Rz * S.