diff --git a/Cargo.toml b/Cargo.toml index a76527b..ca8b9b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,19 +12,25 @@ keywords = ["gamedev", "interpolation", "easing", "bevy"] categories = ["game-development"] [features] -default = [] +default = ["std"] + +# Enable the Rust standard library. +std = ["bevy/std"] + +# Enable `libm` math operations for `no_std` environments and cross-platform determinism. +libm = ["bevy/libm"] # Enable data serialization/deserialization using `serde`. serialize = ["dep:serde", "bevy/serialize"] [dependencies] -bevy = { version = "0.15", default-features = false } +bevy = { version = "0.16.0-rc.1", default-features = false } # Serialization serde = { version = "1.0", default-features = false, optional = true } [dev-dependencies] -bevy = { version = "0.15", default-features = false, features = [ +bevy = { version = "0.16.0-rc.1", default-features = false, features = [ "bevy_core_pipeline", "bevy_text", "bevy_ui", @@ -36,3 +42,8 @@ bevy = { version = "0.15", default-features = false, features = [ "bevy_window", "x11", ] } + +[lints.clippy] +std_instead_of_core = "warn" +std_instead_of_alloc = "warn" +alloc_instead_of_core = "warn" diff --git a/README.md b/README.md index 29d718a..9bd6771 100644 --- a/README.md +++ b/README.md @@ -154,9 +154,10 @@ and `NonlinearRotationEasing` marker components. Custom easing solutions can be ## Supported Bevy Versions -| `bevy` | `bevy_transform_interpolation` | -| ------ | ------------------------------ | -| 0.15 | 0.1 | +| `bevy` | `bevy_transform_interpolation` | +| ------- | ------------------------------ | +| 0.16 RC | main | +| 0.15 | 0.1 | ## License diff --git a/examples/hermite_interpolation.rs b/examples/hermite_interpolation.rs index 6066c64..060452a 100644 --- a/examples/hermite_interpolation.rs +++ b/examples/hermite_interpolation.rs @@ -24,7 +24,7 @@ use bevy_transform_interpolation::{ }; const MOVEMENT_SPEED: f32 = 250.0; -const ROTATION_SPEED: f32 = std::f32::consts::TAU * 3.0; +const ROTATION_SPEED: f32 = core::f32::consts::TAU * 3.0; fn main() { let mut app = App::new(); diff --git a/src/extrapolation.rs b/src/extrapolation.rs index b138f7d..2b74173 100644 --- a/src/extrapolation.rs +++ b/src/extrapolation.rs @@ -3,7 +3,7 @@ //! //! See the [`TransformExtrapolationPlugin`] for more information. -use std::marker::PhantomData; +use core::marker::PhantomData; use crate::{ NoRotationEasing, NoTranslationEasing, RotationEasingState, TransformEasingPlugin, @@ -82,7 +82,7 @@ use bevy::prelude::*; /// /// Then, add the [`TransformExtrapolationPlugin`] to the app with the velocity sources: /// -/// ``` +/// ```no_run /// use bevy::{ecs::query::QueryData, prelude::*}; /// use bevy_transform_interpolation::{prelude::*, VelocitySource}; /// # @@ -130,6 +130,7 @@ use bevy::prelude::*; /// app.add_plugins(( /// TransformInterpolationPlugin::default(), /// TransformExtrapolationPlugin::::default(), +/// # bevy::time::TimePlugin::default(), /// )); /// /// // Optional: Insert velocity components automatically for entities with extrapolation. diff --git a/src/hermite.rs b/src/hermite.rs index 6333a6c..e80c57e 100644 --- a/src/hermite.rs +++ b/src/hermite.rs @@ -1,6 +1,6 @@ //! Hermite interpolation for [`Transform`] easing. -use std::{f32::consts::TAU, marker::PhantomData}; +use core::{f32::consts::TAU, marker::PhantomData}; use bevy::prelude::*; use ops::FloatPow; @@ -91,7 +91,7 @@ use crate::{ /// Then, add the [`TransformHermiteEasingPlugin`] to the app with the velocity sources, /// along with the [`TransformInterpolationPlugin`] and/or [`TransformExtrapolationPlugin`]: /// -/// ``` +/// ```no_run /// use bevy::{ecs::query::QueryData, prelude::*}; /// use bevy_transform_interpolation::{prelude::*, VelocitySource}; /// # @@ -146,6 +146,7 @@ use crate::{ /// app.add_plugins(( /// TransformInterpolationPlugin::default(), /// TransformHermiteEasingPlugin::::default(), +/// # bevy::time::TimePlugin::default(), /// )); /// /// // Optional: Insert velocity components automatically for entities with Hermite interpolation. diff --git a/src/lib.rs b/src/lib.rs index ef2b022..1827ab8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -56,13 +56,14 @@ //! If you want *all* entities with a [`Transform`] to be interpolated by default, you can use //! [`TransformInterpolationPlugin::interpolate_all()`]: //! -//! ``` +//! ```no_run //! # use bevy::prelude::*; //! # use bevy_transform_interpolation::prelude::*; //! # //! fn main() { //! App::new() //! .add_plugins(TransformInterpolationPlugin::interpolate_all()) +//! # .add_plugins(bevy::time::TimePlugin::default()) //! // ... //! .run(); //! } @@ -121,6 +122,7 @@ //! //! [`TransformHermiteEasingPlugin`]: crate::hermite::TransformHermiteEasingPlugin +#![no_std] #![expect(clippy::needless_doctest_main)] #![expect(clippy::type_complexity)] #![warn(missing_docs)] @@ -150,7 +152,7 @@ pub mod prelude { }; } -use std::marker::PhantomData; +use core::marker::PhantomData; // For doc links. #[allow(unused_imports)]