Skip to content

Commit 90ff041

Browse files
authored
Migrate to Bevy 0.16.0-rc.1 and add no_std support (#8)
# Objective The first release candidate for Bevy 0.16 has been released! We should migrate our main branch to it. Bevy 0.16 also adds `no_std` support. We need to enable some feature flags for this anyway, so I decided to add `no_std` support on our side in this PR directly since the changes are so trivial, ## Solution Migrate to Bevy 0.16.0-rc.1, and add the `std` and `libm` features to support `no_std` environments. --- ## Migration Guide `bevy_transform_interpolation` now has `no_std` support. If you have default features disabled, you must either enable the `std` feature for the Rust standard library or the `libm` feature for math in `no_std` environments.
1 parent bc8ba43 commit 90ff041

File tree

6 files changed

+29
-13
lines changed

6 files changed

+29
-13
lines changed

Cargo.toml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,25 @@ keywords = ["gamedev", "interpolation", "easing", "bevy"]
1212
categories = ["game-development"]
1313

1414
[features]
15-
default = []
15+
default = ["std"]
16+
17+
# Enable the Rust standard library.
18+
std = ["bevy/std"]
19+
20+
# Enable `libm` math operations for `no_std` environments and cross-platform determinism.
21+
libm = ["bevy/libm"]
1622

1723
# Enable data serialization/deserialization using `serde`.
1824
serialize = ["dep:serde", "bevy/serialize"]
1925

2026
[dependencies]
21-
bevy = { version = "0.15", default-features = false }
27+
bevy = { version = "0.16.0-rc.1", default-features = false }
2228

2329
# Serialization
2430
serde = { version = "1.0", default-features = false, optional = true }
2531

2632
[dev-dependencies]
27-
bevy = { version = "0.15", default-features = false, features = [
33+
bevy = { version = "0.16.0-rc.1", default-features = false, features = [
2834
"bevy_core_pipeline",
2935
"bevy_text",
3036
"bevy_ui",
@@ -36,3 +42,8 @@ bevy = { version = "0.15", default-features = false, features = [
3642
"bevy_window",
3743
"x11",
3844
] }
45+
46+
[lints.clippy]
47+
std_instead_of_core = "warn"
48+
std_instead_of_alloc = "warn"
49+
alloc_instead_of_core = "warn"

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@ and `NonlinearRotationEasing` marker components. Custom easing solutions can be
154154

155155
## Supported Bevy Versions
156156

157-
| `bevy` | `bevy_transform_interpolation` |
158-
| ------ | ------------------------------ |
159-
| 0.15 | 0.1 |
157+
| `bevy` | `bevy_transform_interpolation` |
158+
| ------- | ------------------------------ |
159+
| 0.16 RC | main |
160+
| 0.15 | 0.1 |
160161

161162
## License
162163

examples/hermite_interpolation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use bevy_transform_interpolation::{
2424
};
2525

2626
const MOVEMENT_SPEED: f32 = 250.0;
27-
const ROTATION_SPEED: f32 = std::f32::consts::TAU * 3.0;
27+
const ROTATION_SPEED: f32 = core::f32::consts::TAU * 3.0;
2828

2929
fn main() {
3030
let mut app = App::new();

src/extrapolation.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//!
44
//! See the [`TransformExtrapolationPlugin`] for more information.
55
6-
use std::marker::PhantomData;
6+
use core::marker::PhantomData;
77

88
use crate::{
99
NoRotationEasing, NoTranslationEasing, RotationEasingState, TransformEasingPlugin,
@@ -82,7 +82,7 @@ use bevy::prelude::*;
8282
///
8383
/// Then, add the [`TransformExtrapolationPlugin`] to the app with the velocity sources:
8484
///
85-
/// ```
85+
/// ```no_run
8686
/// use bevy::{ecs::query::QueryData, prelude::*};
8787
/// use bevy_transform_interpolation::{prelude::*, VelocitySource};
8888
/// #
@@ -130,6 +130,7 @@ use bevy::prelude::*;
130130
/// app.add_plugins((
131131
/// TransformInterpolationPlugin::default(),
132132
/// TransformExtrapolationPlugin::<LinVelSource, AngVelSource>::default(),
133+
/// # bevy::time::TimePlugin::default(),
133134
/// ));
134135
///
135136
/// // Optional: Insert velocity components automatically for entities with extrapolation.

src/hermite.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Hermite interpolation for [`Transform`] easing.
22
3-
use std::{f32::consts::TAU, marker::PhantomData};
3+
use core::{f32::consts::TAU, marker::PhantomData};
44

55
use bevy::prelude::*;
66
use ops::FloatPow;
@@ -91,7 +91,7 @@ use crate::{
9191
/// Then, add the [`TransformHermiteEasingPlugin`] to the app with the velocity sources,
9292
/// along with the [`TransformInterpolationPlugin`] and/or [`TransformExtrapolationPlugin`]:
9393
///
94-
/// ```
94+
/// ```no_run
9595
/// use bevy::{ecs::query::QueryData, prelude::*};
9696
/// use bevy_transform_interpolation::{prelude::*, VelocitySource};
9797
/// #
@@ -146,6 +146,7 @@ use crate::{
146146
/// app.add_plugins((
147147
/// TransformInterpolationPlugin::default(),
148148
/// TransformHermiteEasingPlugin::<LinVelSource, AngVelSource>::default(),
149+
/// # bevy::time::TimePlugin::default(),
149150
/// ));
150151
///
151152
/// // Optional: Insert velocity components automatically for entities with Hermite interpolation.

src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,14 @@
5656
//! If you want *all* entities with a [`Transform`] to be interpolated by default, you can use
5757
//! [`TransformInterpolationPlugin::interpolate_all()`]:
5858
//!
59-
//! ```
59+
//! ```no_run
6060
//! # use bevy::prelude::*;
6161
//! # use bevy_transform_interpolation::prelude::*;
6262
//! #
6363
//! fn main() {
6464
//! App::new()
6565
//! .add_plugins(TransformInterpolationPlugin::interpolate_all())
66+
//! # .add_plugins(bevy::time::TimePlugin::default())
6667
//! // ...
6768
//! .run();
6869
//! }
@@ -121,6 +122,7 @@
121122
//!
122123
//! [`TransformHermiteEasingPlugin`]: crate::hermite::TransformHermiteEasingPlugin
123124
125+
#![no_std]
124126
#![expect(clippy::needless_doctest_main)]
125127
#![expect(clippy::type_complexity)]
126128
#![warn(missing_docs)]
@@ -150,7 +152,7 @@ pub mod prelude {
150152
};
151153
}
152154

153-
use std::marker::PhantomData;
155+
use core::marker::PhantomData;
154156

155157
// For doc links.
156158
#[allow(unused_imports)]

0 commit comments

Comments
 (0)