From b5f9bc2b14ce263518046d071473c1f8bdf40144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tur=C3=A1nszki=20J=C3=A1nos?= Date: Mon, 2 Sep 2024 08:22:10 +0200 Subject: [PATCH] editor: fixed snap to surface transform --- Editor/Translator.cpp | 7 +++++-- Editor/Translator.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Editor/Translator.cpp b/Editor/Translator.cpp index 56740de66..a7910d480 100644 --- a/Editor/Translator.cpp +++ b/Editor/Translator.cpp @@ -478,8 +478,9 @@ void Translator::Update(const CameraComponent& camera, const XMFLOAT4& currentMo ObjectComponent* object = scene.objects.GetComponent(x.entity); if (object == nullptr) continue; - temp_filters.push_back(object->filterMask); + temp_filters.push_back(uint64_t(object->filterMask) | (uint64_t(object->filterMaskDynamic) << 32ull)); object->filterMask = 0; + object->filterMaskDynamic = 0; } Ray ray = wi::renderer::GetPickRay((long)currentMouse.x, (long)currentMouse.y, canvas, camera); wi::scene::Scene::RayIntersectionResult result = scene.Intersects(ray, wi::enums::FILTER_OBJECT_ALL); @@ -490,7 +491,9 @@ void Translator::Update(const CameraComponent& camera, const XMFLOAT4& currentMo ObjectComponent* object = scene.objects.GetComponent(x.entity); if (object == nullptr) continue; - object->filterMask = temp_filters[ind++]; + uint64_t tmp = temp_filters[ind++]; + object->filterMask = uint32_t(tmp); + object->filterMaskDynamic = uint32_t(tmp >> 32ull); } } } diff --git a/Editor/Translator.h b/Editor/Translator.h index 63339fe7f..0a369b724 100644 --- a/Editor/Translator.h +++ b/Editor/Translator.h @@ -11,7 +11,7 @@ private: float angle = 0; float angle_start = 0; bool has_selected_transform = false; - wi::vector temp_filters; + wi::vector temp_filters; public: void Update(const wi::scene::CameraComponent& camera, const XMFLOAT4& currentMouse, const wi::Canvas& canvas);