/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/EnginePlugins/OpenXRPlugin/Utils/Implementation/OpenXRConversionUtils.inl.h
36 строк
1020 B
Sanakan8472
OpenXR plugin fixes (#1800)
30 янв 2026, 18:51
Не верифицирован
30 янв 2026, 18:51
52fc455
Код
Авторство
О чём код?
EZ_ALWAYS_INLINE XrPosef ezOpenXRConversionUtils::ConvertTransform(const ezTransform& tr) { XrPosef pose; pose.orientation = ConvertOrientation(tr.m_qRotation); pose.position = ConvertPosition(tr.m_vPosition); return pose; } EZ_ALWAYS_INLINE XrQuaternionf ezOpenXRConversionUtils::ConvertOrientation(const ezQuat& q) { return {q.y, q.z, -q.x, -q.w}; } EZ_ALWAYS_INLINE XrVector3f ezOpenXRConversionUtils::ConvertPosition(const ezVec3& vPos) { return {vPos.y, vPos.z, -vPos.x}; } EZ_ALWAYS_INLINE ezQuat ezOpenXRConversionUtils::ConvertOrientation(const XrQuaternionf& q) { return {-q.z, q.x, q.y, -q.w}; } EZ_ALWAYS_INLINE ezVec3 ezOpenXRConversionUtils::ConvertPosition(const XrVector3f& pos) { return {-pos.z, pos.x, pos.y}; } EZ_ALWAYS_INLINE ezMat4 ezOpenXRConversionUtils::ConvertPoseToMatrix(const XrPosef& pose) { ezMat4 m; ezMat3 rot = ConvertOrientation(pose.orientation).GetAsMat3(); ezVec3 pos = ConvertPosition(pose.position); m.SetTransformationMatrix(rot, pos); return m; }