Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion examples/hermite_interpolation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 3 additions & 2 deletions src/extrapolation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//!
//! See the [`TransformExtrapolationPlugin`] for more information.

use std::marker::PhantomData;
use core::marker::PhantomData;

use crate::{
NoRotationEasing, NoTranslationEasing, RotationEasingState, TransformEasingPlugin,
Expand Down Expand Up @@ -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};
/// #
Expand Down Expand Up @@ -130,6 +130,7 @@ use bevy::prelude::*;
/// app.add_plugins((
/// TransformInterpolationPlugin::default(),
/// TransformExtrapolationPlugin::<LinVelSource, AngVelSource>::default(),
/// # bevy::time::TimePlugin::default(),
/// ));
///
/// // Optional: Insert velocity components automatically for entities with extrapolation.
Expand Down
5 changes: 3 additions & 2 deletions src/hermite.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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};
/// #
Expand Down Expand Up @@ -146,6 +146,7 @@ use crate::{
/// app.add_plugins((
/// TransformInterpolationPlugin::default(),
/// TransformHermiteEasingPlugin::<LinVelSource, AngVelSource>::default(),
/// # bevy::time::TimePlugin::default(),
/// ));
///
/// // Optional: Insert velocity components automatically for entities with Hermite interpolation.
Expand Down
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
//! }
Expand Down Expand Up @@ -121,6 +122,7 @@
//!
//! [`TransformHermiteEasingPlugin`]: crate::hermite::TransformHermiteEasingPlugin

#![no_std]
#![expect(clippy::needless_doctest_main)]
#![expect(clippy::type_complexity)]
#![warn(missing_docs)]
Expand Down Expand Up @@ -150,7 +152,7 @@ pub mod prelude {
};
}

use std::marker::PhantomData;
use core::marker::PhantomData;

// For doc links.
#[allow(unused_imports)]
Expand Down