Skip to content

Commit

Permalink
Fix missing reflection setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
komadori committed Jul 1, 2024
1 parent 1f446e2 commit 8e99064
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ pub enum NodeOutline {

/// A component for stenciling meshes during outline rendering.
#[derive(Clone, Component, Reflect)]
#[reflect(Component, Default)]
pub struct OutlineStencil {
/// Enable rendering of the stencil
pub enabled: bool,
Expand Down Expand Up @@ -124,6 +125,7 @@ impl Lerp for OutlineStencil {

/// A component for rendering outlines around meshes.
#[derive(Clone, Component, Reflect, Default)]
#[reflect(Component, Default)]
pub struct OutlineVolume {
/// Enable rendering of the outline
pub visible: bool,
Expand Down Expand Up @@ -155,6 +157,7 @@ impl Lerp for OutlineVolume {
#[derive(
Component, Reflect, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Deref, DerefMut, Default,
)]
#[reflect(Component, Default)]
pub struct OutlineRenderLayers(pub RenderLayers);

impl ExtractComponent for OutlineRenderLayers {
Expand All @@ -179,6 +182,7 @@ impl ExtractComponent for OutlineRenderLayers {

/// A component which specifies how the outline should be rendered.
#[derive(Clone, Component, Reflect)]
#[reflect(Component, Default)]
#[non_exhaustive]
pub enum OutlineMode {
/// Vertex extrusion flattened into a plane facing the camera and intersecting the specified
Expand All @@ -198,6 +202,7 @@ impl Default for OutlineMode {

/// A component for inheriting outlines from the parent entity.
#[derive(Clone, Component, Reflect, Default)]
#[reflect(Component, Default)]
pub struct InheritOutline;

/// A bundle for rendering stenciled outlines around meshes.
Expand Down Expand Up @@ -249,6 +254,11 @@ impl Plugin for OutlinePlugin {
UniformComponentPlugin::<OutlineFragmentUniform>::default(),
UniformComponentPlugin::<OutlineViewUniform>::default(),
))
.register_type::<OutlineStencil>()
.register_type::<OutlineVolume>()
.register_type::<OutlineRenderLayers>()
.register_type::<OutlineMode>()
.register_type::<InheritOutline>()
.add_systems(
PostUpdate,
(
Expand Down

0 comments on commit 8e99064

Please sign in to comment.