fix spaceship rotation fix sync boxes

This commit is contained in:
Vlad committed 2026-02-27 17:37:00 +06:00
1 parent be2aa76f8b
commit 7418bbbe27
5 files changed
+68 -23

No files matched your search

+6 -4
View File
@@ -160,17 +160,19 @@ private:
std::lock_guard<std::mutex> lock(g_boxes_mutex);
std::string boxMsg = "BOXES:";
for (const auto& box : g_serverBoxes) {
for (size_t i = 0; i < g_serverBoxes.size(); ++i) {
const auto& box = g_serverBoxes[i];
Eigen::Quaternionf q(box.rotation);
boxMsg += std::to_string(box.position.x()) + ":" +
boxMsg += std::to_string(i) + ":" +
std::to_string(box.position.x()) + ":" +
std::to_string(box.position.y()) + ":" +
std::to_string(box.position.z()) + ":" +
std::to_string(q.w()) + ":" +
std::to_string(q.x()) + ":" +
std::to_string(q.y()) + ":" +
std::to_string(q.z()) + "|";
std::to_string(q.z()) + ":" +
(std::to_string(box.destroyed ? 1 : 0)) + "|";
}
if (!boxMsg.empty() && boxMsg.back() == '|') boxMsg.pop_back();
send_message(boxMsg);