Skip to content

Commit

Permalink
Reflect for debug renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
Aceeri committed Jul 5, 2023
1 parent 38e1b79 commit 4044aca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ impl RapierDebugRenderPlugin {
}

/// Context to control some aspect of the debug-renderer after initialization.
#[derive(Resource)]
#[derive(Resource, Reflect, FromReflect)]
#[reflect(Resource)]
pub struct DebugRenderContext {
/// Is the debug-rendering currently enabled?
pub enabled: bool,
/// Pipeline responsible for rendering. Access `pipeline.mode` and `pipeline.style`
/// to modify the set of rendered elements, and modify the default coloring rules.
#[reflect(ignore)]
pub pipeline: DebugRenderPipeline,
/// Are the debug-lines always rendered on top of other primitives?
pub always_on_top: bool,
Expand All @@ -97,6 +99,8 @@ impl Default for DebugRenderContext {

impl Plugin for RapierDebugRenderPlugin {
fn build(&self, app: &mut App) {
app.register_type::<DebugRenderContext>();

app.add_plugin(lines::DebugLinesPlugin::always_on_top(self.always_on_top))
.insert_resource(DebugRenderContext {
enabled: self.enabled,
Expand Down

0 comments on commit 4044aca

Please sign in to comment.