13 Commits
3.4.2 ... 3.5.2

Author SHA1 Message Date
cc2b9c75a0 Prepare 3.5.2. 2021-01-01 16:59:52 +01:00
60952acb73 Merge pull request #55 from phaazon/dependabot/cargo/master/nalgebra-gte-0.21-and-lt-0.25
Update nalgebra requirement from >=0.21, <0.24 to >=0.21, <0.25
2021-01-01 03:07:31 +01:00
fb67b32959 Update nalgebra requirement from >=0.21, <0.24 to >=0.21, <0.25
Updates the requirements on [nalgebra](https://github.com/rustsim/nalgebra) to permit the latest version.
- [Release notes](https://github.com/rustsim/nalgebra/releases)
- [Changelog](https://github.com/dimforge/nalgebra/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/rustsim/nalgebra/compare/v0.21.0...v0.24.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-30 14:33:27 +00:00
ab543b61e8 Merge pull request #54 from phaazon/dependabot/cargo/master/glam-0.11
Update glam requirement from 0.10 to 0.11
2020-12-05 16:39:28 +01:00
73df77380b Prepare 3.5.1. 2020-12-05 16:34:56 +01:00
08bcf902a4 Update glam requirement from 0.10 to 0.11
Updates the requirements on [glam](https://github.com/bitshifter/glam-rs) to permit the latest version.
- [Release notes](https://github.com/bitshifter/glam-rs/releases)
- [Changelog](https://github.com/bitshifter/glam-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bitshifter/glam-rs/compare/0.10.0...0.11.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-25 20:41:04 +00:00
bfb1cc14bb Merge pull request #53 from phaazon/release/3.5
Release/3.5
2020-11-23 22:38:09 +01:00
5836f778f4 Prepare 3.5. 2020-11-23 22:29:22 +01:00
7b5c08d9fa Add support for nalgebra-0.23. 2020-11-23 22:29:22 +01:00
fe78bf2eb6 Merge pull request #50 from iwikal/glam
Add impl-glam feature
2020-11-23 22:20:50 +01:00
4b3a06d66e Update glam 2020-11-02 04:04:06 +01:00
c50a9274a5 glam::Quat::lerp normalizes internally 2020-10-25 22:11:25 +01:00
3ffe6106ec Add impl-glam feature 2020-10-25 22:00:13 +01:00
5 changed files with 121 additions and 2 deletions

View File

@ -2,6 +2,8 @@
<!-- vim-markdown-toc GFM -->
* [3.5.1](#351)
* [3.5](#35)
* [3.4.2](#342)
* [3.4.1](#341)
* [3.4](#34)
@ -31,6 +33,25 @@
<!-- vim-markdown-toc -->
# 3.5.2
> Fri Jan 01, 2021
- Support of `nalgebra-0.24`.
# 3.5.1
> Dec 5th, 2020
- Support of `glam-0.11`.
# 3.5
> Nov 23rd, 2020
- Add support for [glam](https://crates.io/crates/glam) via the `"impl-glam"` feature gate.
- Support of `nalgebra-0.23`.
# 3.4.2
> Oct 24th, 2020

View File

@ -1,6 +1,6 @@
[package]
name = "splines"
version = "3.4.2"
version = "3.5.2"
license = "BSD-3-Clause"
authors = ["Dimitri Sabadie <dimitri.sabadie@gmail.com>"]
description = "Spline interpolation made easy"
@ -22,13 +22,15 @@ maintenance = { status = "actively-developed" }
[features]
default = ["std"]
impl-cgmath = ["cgmath"]
impl-glam = ["glam"]
impl-nalgebra = ["nalgebra", "num-traits", "simba"]
serialization = ["serde", "serde_derive"]
std = []
[dependencies]
cgmath = { version = "0.17", optional = true }
nalgebra = { version = ">=0.21, <0.23", optional = true }
glam = { version = ">=0.10, <0.12", optional = true }
nalgebra = { version = ">=0.21, <0.25", optional = true }
num-traits = { version = "0.2", optional = true }
serde = { version = "1", optional = true }
serde_derive = { version = "1", optional = true }

View File

@ -90,6 +90,9 @@ So heres a list of currently supported features and how to enable them:
- **[cgmath](https://crates.io/crates/cgmath) implementors.**
- Adds some useful implementations of `Interpolate` for some cgmath types.
- Enable with the `"impl-cgmath"` feature.
- **[glam](https://crates.io/crates/glam) implementors.**
- Adds some useful implementations of `Interpolate` for some glam types.
- Enable with the `"impl-glam"` feature.
- **[nalgebra](https://crates.io/crates/nalgebra) implementors.**
- Adds some useful implementations of `Interpolate` for some nalgebra types.
- Enable with the `"impl-nalgebra"` feature.

88
src/glam.rs Normal file
View File

@ -0,0 +1,88 @@
use glam::{Quat, Vec2, Vec3, Vec3A, Vec4};
use crate::interpolate::{
cubic_bezier_def, cubic_hermite_def, quadratic_bezier_def, Interpolate, Linear,
};
macro_rules! impl_interpolate_vec {
($($t:tt)*) => {
impl Linear<f32> for $($t)* {
#[inline(always)]
fn outer_mul(self, t: f32) -> Self {
self * t
}
#[inline(always)]
fn outer_div(self, t: f32) -> Self {
self / t
}
}
impl Interpolate<f32> for $($t)* {
#[inline(always)]
fn lerp(a: Self, b: Self, t: f32) -> Self {
a.lerp(b, t)
}
#[inline(always)]
fn cubic_hermite(
x: (Self, f32),
a: (Self, f32),
b: (Self, f32),
y: (Self, f32),
t: f32,
) -> Self {
cubic_hermite_def(x, a, b, y, t)
}
#[inline(always)]
fn quadratic_bezier(a: Self, u: Self, b: Self, t: f32) -> Self {
quadratic_bezier_def(a, u, b, t)
}
#[inline(always)]
fn cubic_bezier(a: Self, u: Self, v: Self, b: Self, t: f32) -> Self {
cubic_bezier_def(a, u, v, b, t)
}
}
}
}
impl_interpolate_vec!(Vec2);
impl_interpolate_vec!(Vec3);
impl_interpolate_vec!(Vec3A);
impl_interpolate_vec!(Vec4);
impl Linear<f32> for Quat {
#[inline(always)]
fn outer_mul(self, t: f32) -> Self {
self * t
}
#[inline(always)]
fn outer_div(self, t: f32) -> Self {
self / t
}
}
impl Interpolate<f32> for Quat {
#[inline(always)]
fn lerp(a: Self, b: Self, t: f32) -> Self {
a.lerp(b, t)
}
#[inline(always)]
fn cubic_hermite(x: (Self, f32), a: (Self, f32), b: (Self, f32), y: (Self, f32), t: f32) -> Self {
cubic_hermite_def(x, a, b, y, t)
}
#[inline(always)]
fn quadratic_bezier(a: Self, u: Self, b: Self, t: f32) -> Self {
quadratic_bezier_def(a, u, b, t)
}
#[inline(always)]
fn cubic_bezier(a: Self, u: Self, v: Self, b: Self, t: f32) -> Self {
cubic_bezier_def(a, u, v, b, t)
}
}

View File

@ -91,6 +91,9 @@
//! - **[cgmath](https://crates.io/crates/cgmath) implementors.**
//! - Adds some useful implementations of `Interpolate` for some cgmath types.
//! - Enable with the `"impl-cgmath"` feature.
//! - **[glam](https://crates.io/crates/glam) implementors.**
//! - Adds some useful implementations of `Interpolate` for some glam types.
//! - Enable with the `"impl-glam"` feature.
//! - **[nalgebra](https://crates.io/crates/nalgebra) implementors.**
//! - Adds some useful implementations of `Interpolate` for some nalgebra types.
//! - Enable with the `"impl-nalgebra"` feature.
@ -111,6 +114,8 @@ extern crate alloc;
#[cfg(feature = "impl-cgmath")]
mod cgmath;
#[cfg(feature = "impl-glam")]
mod glam;
pub mod interpolate;
pub mod interpolation;
pub mod iter;