From 1615bc4229fad13c6c25a645d0c0c26cd5e30ea2 Mon Sep 17 00:00:00 2001 From: SirLynix Date: Thu, 7 Dec 2023 17:30:29 +0100 Subject: [PATCH] Fix PhysicsPlayground --- examples/PhysicsPlayground/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/PhysicsPlayground/main.cpp b/examples/PhysicsPlayground/main.cpp index 26f80bceb..baeda9993 100644 --- a/examples/PhysicsPlayground/main.cpp +++ b/examples/PhysicsPlayground/main.cpp @@ -456,13 +456,13 @@ int main(int argc, char* argv[]) if (lastHitInfo.hitBody && lastHitInfo.hitEntity != boxColliderEntity) { #if USE_JOLT - grabConstraint.emplace(*lastHitInfo.hitBody, lastHitInfo.hitPosition); + grabConstraint.emplace(static_cast(*lastHitInfo.hitBody), lastHitInfo.hitPosition); #else grabConstraint.emplace(*lastHitInfo.hitBody, lastHitInfo.hitPosition); grabConstraint->SetImpulseClamp(30.f); #endif - grabbedObjectMove.Connect(eventHandler.OnMouseMoved, [&, body = lastHitInfo.hitBody, distance = Nz::Vector3f::Distance(from, lastHitInfo.hitPosition)](const Nz::WindowEventHandler*, const Nz::WindowEvent::MouseMoveEvent& event) + grabbedObjectMove.Connect(eventHandler.OnMouseMoved, [&, distance = Nz::Vector3f::Distance(from, lastHitInfo.hitPosition)](const Nz::WindowEventHandler*, const Nz::WindowEvent::MouseMoveEvent& event) { Nz::Vector3f from = cameraComponent.Unproject({ float(event.x), float(event.y), 0.f }); Nz::Vector3f to = cameraComponent.Unproject({ float(event.x), float(event.y), 1.f });