diff --git a/openVulkanoCpp/AR/ArFrame.cpp b/openVulkanoCpp/AR/ArFrame.cpp index 989b713..3bb6b70 100644 --- a/openVulkanoCpp/AR/ArFrame.cpp +++ b/openVulkanoCpp/AR/ArFrame.cpp @@ -7,6 +7,8 @@ #include "ArFrame.hpp" #include "ArSession.hpp" #include "ArRecorder.hpp" +#include +#include namespace OpenVulkano::AR { @@ -26,6 +28,11 @@ namespace OpenVulkano::AR void ArFrame::SaveToFile(const std::filesystem::path& path, bool downsample) { m_session->GetRecorder().SaveToFile(shared_from_this(), path, downsample); + std::string metaContent = GetFrameMetadata().ToXML(); + std::string metaPath = path.string() + std::string(".meta"); + std::ofstream file (metaPath, std::ios::out); + file << metaContent; + file.close(); } const Scene::Texture* ArFrame::GetImageTexture() @@ -38,4 +45,4 @@ namespace OpenVulkano::AR { if (m_texture) m_session->ReturnTexture(m_texture); } -} \ No newline at end of file +} diff --git a/openVulkanoCpp/AR/ArFrame.hpp b/openVulkanoCpp/AR/ArFrame.hpp index b0678ce..c06fcc4 100644 --- a/openVulkanoCpp/AR/ArFrame.hpp +++ b/openVulkanoCpp/AR/ArFrame.hpp @@ -122,7 +122,20 @@ namespace OpenVulkano::AR [[nodiscard]] ArTrackingState GetTrackingState() const { return frameMetadata.trackingState; }; - [[nodiscard]] virtual Math::PoseF GetPose() const { return Math::PoseF(); }; //TODO + [[nodiscard]] virtual Math::PoseF GetPose() const { return Math::PoseF(frameMetadata.transformation); }; + + [[nodiscard]] virtual Math::Vector3f GetEulerAngle() const { + return { + asin(-frameMetadata.transformation[2][1]), + atan2(frameMetadata.transformation[2][0], frameMetadata.transformation[2][2]), + atan2(frameMetadata.transformation[0][1], frameMetadata.transformation[1][1]) + }; + } + + [[nodiscard]] virtual const Math::Vector3f_SIMD& GetPosition() const + { + return reinterpret_cast(frameMetadata.transformation[3]); + } [[nodiscard]] Math::Timestamp GetTimestamp() const { return frameMetadata.timestamp; };