From 4a292ca6bce68167ad1ed79a28622bfdb84ef3c2 Mon Sep 17 00:00:00 2001 From: Robin KAY Date: Tue, 22 Nov 2022 19:11:36 +0000 Subject: [PATCH] Rename Outline component to OutlineVolume. --- examples/animated_fox.rs | 6 ++++-- examples/pieces.rs | 6 +++--- examples/shapes.rs | 4 ++-- src/lib.rs | 4 ++-- src/uniforms.rs | 4 ++-- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/examples/animated_fox.rs b/examples/animated_fox.rs index a04117d..cb2d921 100644 --- a/examples/animated_fox.rs +++ b/examples/animated_fox.rs @@ -1,7 +1,9 @@ use std::f32::consts::PI; use bevy::{prelude::*, window::close_on_esc}; -use bevy_mod_outline::{AutoGenerateOutlineNormalsPlugin, Outline, OutlineBundle, OutlinePlugin}; +use bevy_mod_outline::{ + AutoGenerateOutlineNormalsPlugin, OutlineBundle, OutlinePlugin, OutlineVolume, +}; #[derive(Resource)] struct Fox(Handle); @@ -74,7 +76,7 @@ fn setup_scene_once_loaded( player.play(animation.0.clone_weak()).repeat(); for entity in entities.iter() { commands.entity(entity).insert(OutlineBundle { - outline: Outline { + outline: OutlineVolume { visible: true, width: 3.0, colour: Color::RED, diff --git a/examples/pieces.rs b/examples/pieces.rs index cb87b4a..52daa1d 100644 --- a/examples/pieces.rs +++ b/examples/pieces.rs @@ -48,7 +48,7 @@ fn setup( ..default() }) .insert(OutlineBundle { - outline: Outline { + outline: OutlineVolume { visible: true, colour: Color::WHITE, width: 10.0, @@ -77,7 +77,7 @@ fn setup( ..default() }) .insert(OutlineBundle { - outline: Outline { + outline: OutlineVolume { visible: true, colour: Color::WHITE, width: 10.0, @@ -103,7 +103,7 @@ fn setup( ..default() }) .insert(OutlineBundle { - outline: Outline { + outline: OutlineVolume { visible: true, colour: Color::WHITE, width: 10.0, diff --git a/examples/shapes.rs b/examples/shapes.rs index c77d88f..358fcd2 100644 --- a/examples/shapes.rs +++ b/examples/shapes.rs @@ -46,7 +46,7 @@ fn setup( ..default() }) .insert(OutlineBundle { - outline: Outline { + outline: OutlineVolume { visible: true, colour: Color::rgba(0.0, 1.0, 0.0, 1.0), width: 25.0, @@ -70,7 +70,7 @@ fn setup( ..default() }) .insert(OutlineBundle { - outline: Outline { + outline: OutlineVolume { visible: true, colour: Color::rgba(1.0, 0.0, 1.0, 0.3), width: 15.0, diff --git a/src/lib.rs b/src/lib.rs index e3c3ee2..ab8d153 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -83,7 +83,7 @@ impl ExtractComponent for OutlineStencil { /// A component for rendering outlines around meshes. #[derive(Clone, Component, Default)] -pub struct Outline { +pub struct OutlineVolume { /// Enable rendering of the outline pub visible: bool, /// Width of the outline in logical pixels @@ -95,7 +95,7 @@ pub struct Outline { /// A bundle for rendering stenciled outlines around meshes. #[derive(Bundle, Clone, Default)] pub struct OutlineBundle { - pub outline: Outline, + pub outline: OutlineVolume, pub stencil: OutlineStencil, pub plane: ComputedOutlineDepth, } diff --git a/src/uniforms.rs b/src/uniforms.rs index 84ecd6e..a09c7f3 100644 --- a/src/uniforms.rs +++ b/src/uniforms.rs @@ -13,7 +13,7 @@ use bevy::{ }, }; -use crate::{pipeline::OutlinePipeline, ComputedOutlineDepth, Outline, OutlineStencil}; +use crate::{pipeline::OutlinePipeline, ComputedOutlineDepth, OutlineStencil, OutlineVolume}; macro_rules! outline_vertex_uniform { ($x:ident) => { @@ -59,7 +59,7 @@ pub fn extract_outline_stencil_uniforms( pub fn extract_outline_volume_uniforms( mut commands: Commands, - query: Extract>, + query: Extract>, ) { for (entity, outline, computed) in query.iter() { if !outline.visible || outline.colour.a() == 0.0 {