From 1dce5a267e3635d0efa8561a4d5339300c96558c Mon Sep 17 00:00:00 2001 From: Robin KAY Date: Thu, 8 Feb 2024 20:55:05 +0000 Subject: [PATCH] Add interpolation 0.3 compatability feature. --- Cargo.toml | 1 + src/lib.rs | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 1526758..02297e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,7 @@ bevy = { version = "0.12", default-features = false, features = [ ] } bitfield = "0.14" interpolation = "0.2" +interpolation_03 = { package = "interpolation", version = "0.3", optional = true } thiserror = "1.0" wgpu-types = "0.17" diff --git a/src/lib.rs b/src/lib.rs index ea15eb6..63b9cd3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -113,6 +113,15 @@ impl Lerp for OutlineStencil { } } +#[cfg(feature = "interpolation_03")] +impl interpolation_03::Lerp for OutlineStencil { + type Scalar = f32; + + fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self { + ::lerp(self, other, scalar) + } +} + /// A component for rendering outlines around meshes. #[derive(Clone, Component, Default)] pub struct OutlineVolume { @@ -142,6 +151,15 @@ impl Lerp for OutlineVolume { } } +#[cfg(feature = "interpolation_03")] +impl interpolation_03::Lerp for OutlineVolume { + type Scalar = f32; + + fn lerp(&self, other: &Self, scalar: &Self::Scalar) -> Self { + ::lerp(self, other, scalar) + } +} + /// A component for specifying what layer(s) the outline should be rendered for. #[derive(Component, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Deref, DerefMut, Default)] pub struct OutlineRenderLayers(pub RenderLayers);