summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-01-24 11:41:15 +0100
committerGitHub <noreply@github.com>2022-01-24 11:41:15 +0100
commite8789132b46dd9bec6fcfad8d578e5f869fb7326 (patch)
treea5091e754f2bbae9c4521140d2aea384e428749c /scene
parent57a057f7ff031f4593d851e351bc63fda77be535 (diff)
parent44f6fe4be44b778e53096e9f9d3d619b2a417d51 (diff)
Merge pull request #57105 from rafallus/regression/3d_disabled
Diffstat (limited to 'scene')
-rw-r--r--scene/main/viewport.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index b94d109785..1244e0c028 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -523,6 +523,13 @@ void Viewport::_process_picking() {
_drop_physics_mouseover(true);
+#ifndef _3D_DISABLED
+ Vector2 last_pos(1e20, 1e20);
+ CollisionObject3D *last_object = nullptr;
+ ObjectID last_id;
+ PhysicsDirectSpaceState3D::RayResult result;
+#endif // _3D_DISABLED
+
PhysicsDirectSpaceState2D *ss2d = PhysicsServer2D::get_singleton()->space_get_direct_state(find_world_2d()->get_space());
if (physics_has_last_mousepos) {
@@ -690,10 +697,6 @@ void Viewport::_process_picking() {
}
#ifndef _3D_DISABLED
- Vector2 last_pos(1e20, 1e20);
- CollisionObject3D *last_object = nullptr;
- ObjectID last_id;
- PhysicsDirectSpaceState3D::RayResult result;
bool captured = false;
if (physics_object_capture.is_valid()) {