Skip to content

Commit

Permalink
fix mouse_picking when compositor in use
Browse files Browse the repository at this point in the history
  • Loading branch information
Xtarsia authored and TokisanGames committed Jan 21, 2025
1 parent 517bce0 commit ebde61c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/terrain_3d.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright © 2025 Cory Petkovsek, Roope Palmroos, and Contributors.

#include <godot_cpp/classes/collision_shape3d.hpp>
#include <godot_cpp/classes/compositor.hpp>
#include <godot_cpp/classes/editor_interface.hpp>
#include <godot_cpp/classes/engine.hpp>
#include <godot_cpp/classes/environment.hpp>
Expand Down Expand Up @@ -591,6 +592,9 @@ void Terrain3D::_setup_mouse_picking() {
env.instantiate();
env->set_tonemapper(Environment::TONE_MAPPER_LINEAR);
_mouse_cam->set_environment(env);
Ref<Compositor> comp;
comp.instantiate();
_mouse_cam->set_compositor(comp);
_mouse_cam->set_projection(Camera3D::PROJECTION_ORTHOGONAL);
_mouse_cam->set_size(0.1f);
_mouse_cam->set_far(100000.f);
Expand Down

0 comments on commit ebde61c

Please sign in to comment.