Skip to content

Commit

Permalink
Fix math types
Browse files Browse the repository at this point in the history
  • Loading branch information
Jondolf committed Nov 25, 2024
1 parent 90ddeb4 commit 800f6d2
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/interpolation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,55 +308,56 @@ impl VelocitySource for LinVelSource {
type Previous = PreviousLinearVelocity;
type Current = LinearVelocity;

fn previous(start: &Self::Previous) -> Vec3 {
fn previous(previous: &Self::Previous) -> Vec3 {
#[cfg(feature = "2d")]
{
start.f32().extend(0.0)
previous.f32().extend(0.0)
}
#[cfg(feature = "3d")]
{
start.f32()
previous.f32()
}
}

fn current(end: &Self::Current) -> Vec3 {
fn current(current: &Self::Current) -> Vec3 {
#[cfg(feature = "2d")]
{
end.0.f32().extend(0.0)
current.0.f32().extend(0.0)
}
#[cfg(feature = "3d")]
{
end.0.f32()
current.0.f32()
}
}
}

#[derive(QueryData)]
struct AngVelSource;

#[allow(clippy::unnecessary_cast)]
impl VelocitySource for AngVelSource {
type Previous = PreviousAngularVelocity;
type Current = AngularVelocity;

fn previous(start: &Self::Previous) -> Vec3 {
fn previous(previous: &Self::Previous) -> Vec3 {
#[cfg(feature = "2d")]
{
Vec3::Z * start.0 .0
Vec3::Z * previous.0 .0 as f32
}
#[cfg(feature = "3d")]
{
start.0 .0
previous.0.f32()
}
}

fn current(end: &Self::Current) -> Vec3 {
fn current(current: &Self::Current) -> Vec3 {
#[cfg(feature = "2d")]
{
Vec3::Z * end.0
Vec3::Z * current.0 as f32
}
#[cfg(feature = "3d")]
{
end.0
current.0.f32()
}
}
}
Expand Down

0 comments on commit 800f6d2

Please sign in to comment.