14#include <glm/gtc/quaternion.hpp>
43int syncModeFromString(
const std::string &mode) {
44 return mode ==
"body" ? 1 : 0;
48glm::quat nodeQuaternion(
const SceneNode &
n) {
50 return glm::angleAxis(
n.yaw, glm::vec3(0.f, 1.f, 0.f)) *
52 glm::angleAxis(
n.pitch, glm::vec3(1.f, 0.f, 0.f)) *
54 glm::angleAxis(
n.roll, glm::vec3(0.f, 0.f, 1.f));
65void decomposeWorld(
const glm::mat4 &
w, glm::vec3 &
pos, glm::vec3 &euler,
67 pos = glm::vec3(
w[3]);
69 glm::vec3 c0(
w[0]), c1(
w[1]), c2(
w[2]);
70 scale = glm::vec3(glm::length(c0), glm::length(c1), glm::length(c2));
75 glm::mat3 rot(c0, c1, c2);
#define EVENGINE_API_PLATFORM
std::array< float, 3 > scale
EVENGINE_API_PLATFORM void exposeScriptLinkBindings(ssq::Class &cls)
Register eve.Scene's script-link surface.
int findLinkKind(const char *kind)
Finds link kind.
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.
EVEngine ECS 集成层:底层实现使用 sunxfancy/ECS.hpp https://github.com/sunxfancy/ECS.hpp