File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
include/rpplugins/env_probes Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 6464#include " render_pipeline/rpcore/native/rp_point_light.h"
6565#include " render_pipeline/rpcore/native/rp_spot_light.h"
6666
67+ #include " rpplugins/env_probes/include/rpplugins/env_probes/env_probes_plugin.hpp"
68+
6769#include " rpcore/common_resources.hpp"
6870#include " rpcore/gui/debugger.hpp"
6971#include " rpcore/gui/error_message_display.hpp"
@@ -1086,7 +1088,7 @@ rpplugins::EnvironmentProbe* RenderPipeline::add_environment_probe()
10861088 if (!impl_->plugin_mgr_ ->is_plugin_enabled (" env_probes" ))
10871089 return nullptr ;
10881090
1089- return nullptr ;
1091+ return static_cast <rpplugins::EnvProbesPlugin*>(impl_-> plugin_mgr_ -> get_instance ( " env_probes " )-> downcast ())-> create_probe () ;
10901092}
10911093
10921094void RenderPipeline::prepare_scene (const NodePath& scene)
Original file line number Diff line number Diff line change 2626
2727namespace rpplugins {
2828
29+ class EnvironmentProbe ;
30+
2931class EnvProbesPlugin : public rpcore ::BasePlugin
3032{
3133public:
@@ -39,6 +41,7 @@ class EnvProbesPlugin : public rpcore::BasePlugin
3941 void on_pre_render_update () final ;
4042
4143 virtual rpcore::RenderStage* get_capture_stage ();
44+ virtual EnvironmentProbe* create_probe ();
4245
4346private:
4447 class Impl ;
Original file line number Diff line number Diff line change @@ -203,4 +203,14 @@ rpcore::RenderStage* EnvProbesPlugin::get_capture_stage()
203203 return impl_->capture_stage_ ;
204204}
205205
206+ EnvironmentProbe* EnvProbesPlugin::create_probe ()
207+ {
208+ auto probe = std::make_unique<EnvironmentProbe>();
209+ auto probe_raw = probe.get ();
210+ if (impl_->probe_mgr_ ->add_probe (std::move (probe)))
211+ return probe_raw;
212+ else
213+ return nullptr ;
214+ }
215+
206216}
You can’t perform that action at this time.
0 commit comments