diff --git a/src/edit/src/editor.cpp b/src/edit/src/editor.cpp index 587e782fd6717508d5d16937a24ee87c64ff4545..e1f373623682aa2acb9761edd89a0461897ec0bb 100644 --- a/src/edit/src/editor.cpp +++ b/src/edit/src/editor.cpp @@ -2668,6 +2668,7 @@ void Editor::rotateComponent() void Editor::rotateVoxel(voxel_ptr voxel, float angle) { voxel->getNode()->rotateRotationQuat(glm::angleAxis(glm::radians(angle), glm::vec3(1.0f, 0.0f, 0.0f))); + // voxel->getNode()->rotateRotationQuat(glm::angleAxis(glm::radians(angle), -voxel->getNode()->getRotationAxisZLocal())); } void Editor::rotateConnector(connector_ptr connector, float angle) diff --git a/src/filein/src/rofiworld_loader.cpp b/src/filein/src/rofiworld_loader.cpp index dd5dc6563668935d57f8046bc369f9c83bde58ce..3b038378e120d5cdb2fbfbf012433d3adb728f7d 100644 --- a/src/filein/src/rofiworld_loader.cpp +++ b/src/filein/src/rofiworld_loader.cpp @@ -62,14 +62,19 @@ void export_module_universal(boost::json::array &modules_array, const module_ptr void export_alpha_beta(boost::json::object &module_object, const module_ptr module) { using namespace rofi; + float alpha = 0; + float beta = 0; for (const auto&[connector, dock] : module->getConnectorDocks()) { if (dock == "A-Z") - module_object.emplace("alpha", std::dynamic_pointer_cast<RotationConnector>(connector)->getCurrentRotation()); + alpha = std::dynamic_pointer_cast<RotationConnector>(connector)->getCurrentRotation(); else if (dock == "B-Z") - module_object.emplace("beta", std::dynamic_pointer_cast<RotationConnector>(connector)->getCurrentRotation()); + beta = std::dynamic_pointer_cast<RotationConnector>(connector)->getCurrentRotation(); } + + module_object.emplace("alpha", alpha); + module_object.emplace("beta", beta); } void export_gamma(boost::json::object &module_object, const module_ptr module) @@ -77,7 +82,7 @@ void export_gamma(boost::json::object &module_object, const module_ptr module) const auto fst_orientation = module->getParts()->getVoxels().front()->getNode()->getRotationAxisYWorld(); const auto snd_orientation = module->getParts()->getVoxels().back()->getNode()->getRotationAxisYWorld(); const auto ref_axis = module->getParts()->getVoxels().front()->getNode()->getRotationAxisZWorld(); - auto gamma = glm::orientedAngle(fst_orientation, snd_orientation, ref_axis); + auto gamma = glm::degrees(glm::orientedAngle(fst_orientation, snd_orientation, ref_axis)); module_object.emplace("gamma", gamma); }