Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
322d271499 | |||
e64298dc88 | |||
32e5122339 | |||
1be94935cf | |||
06f6e4b578 | |||
87e27e732d | |||
fb678f9613 | |||
ee4230340b | |||
f585119883 | |||
25d5c5217e | |||
355178f5fa |
@ -1,12 +0,0 @@
|
|||||||
version: 1
|
|
||||||
update_configs:
|
|
||||||
- package_manager: "rust:cargo"
|
|
||||||
directory: "."
|
|
||||||
update_schedule: "live"
|
|
||||||
target_branch: "master"
|
|
||||||
default_reviewers:
|
|
||||||
- "phaazon"
|
|
||||||
default_assignees:
|
|
||||||
- "phaazon"
|
|
||||||
default_labels:
|
|
||||||
- "dependency-update"
|
|
25
.github/dependabot.yml
vendored
Normal file
25
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: cargo
|
||||||
|
directory: "/."
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
time: "04:00"
|
||||||
|
open-pull-requests-limit: 10
|
||||||
|
target-branch: master
|
||||||
|
reviewers:
|
||||||
|
- phaazon
|
||||||
|
assignees:
|
||||||
|
- phaazon
|
||||||
|
labels:
|
||||||
|
- dependency-update
|
||||||
|
ignore:
|
||||||
|
- dependency-name: glam
|
||||||
|
versions:
|
||||||
|
- 0.13.0
|
||||||
|
- dependency-name: nalgebra
|
||||||
|
versions:
|
||||||
|
- 0.25.0
|
||||||
|
- dependency-name: cgmath
|
||||||
|
versions:
|
||||||
|
- 0.18.0
|
13
CHANGELOG.md
13
CHANGELOG.md
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
<!-- vim-markdown-toc GFM -->
|
<!-- vim-markdown-toc GFM -->
|
||||||
|
|
||||||
|
* [4.0.1](#401)
|
||||||
* [4.0](#40)
|
* [4.0](#40)
|
||||||
* [Major changes](#major-changes)
|
* [Major changes](#major-changes)
|
||||||
* [Patch changes](#patch-changes)
|
* [Patch changes](#patch-changes)
|
||||||
@ -39,6 +40,18 @@
|
|||||||
|
|
||||||
<!-- vim-markdown-toc -->
|
<!-- vim-markdown-toc -->
|
||||||
|
|
||||||
|
# 4.0.1
|
||||||
|
|
||||||
|
> Jul 11, 2021
|
||||||
|
|
||||||
|
- Add support up to `glam-0.17`.
|
||||||
|
- Add support up to `nalgebra-0.27`.
|
||||||
|
- Replace the name of some feature gates:
|
||||||
|
- `serialization` becomes `serde`.
|
||||||
|
- `impl-*` becomes `*`.
|
||||||
|
- The previous feature gates are kept around to prevent a breaking change but will eventually be removed in the next
|
||||||
|
major update.
|
||||||
|
|
||||||
# 4.0
|
# 4.0
|
||||||
|
|
||||||
> Mar 05, 2021
|
> Mar 05, 2021
|
||||||
|
13
Cargo.toml
13
Cargo.toml
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "splines"
|
name = "splines"
|
||||||
version = "4.0.0"
|
version = "4.0.1"
|
||||||
license = "BSD-3-Clause"
|
license = "BSD-3-Clause"
|
||||||
authors = ["Dimitri Sabadie <dimitri.sabadie@gmail.com>"]
|
authors = ["Dimitri Sabadie <dimitri.sabadie@gmail.com>"]
|
||||||
description = "Spline interpolation made easy"
|
description = "Spline interpolation made easy"
|
||||||
@ -24,15 +24,14 @@ default = ["std"]
|
|||||||
impl-cgmath = ["cgmath"]
|
impl-cgmath = ["cgmath"]
|
||||||
impl-glam = ["glam"]
|
impl-glam = ["glam"]
|
||||||
impl-nalgebra = ["nalgebra"]
|
impl-nalgebra = ["nalgebra"]
|
||||||
serialization = ["serde", "serde_derive"]
|
serialization = ["serde"]
|
||||||
std = []
|
std = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cgmath = { version = ">=0.17, <0.19", optional = true }
|
cgmath = { version = ">=0.17, <0.19", optional = true }
|
||||||
glam = { version = ">=0.10, <0.13", optional = true }
|
glam = { version = ">=0.10, <0.18", optional = true }
|
||||||
nalgebra = { version = ">=0.21, <0.25", optional = true }
|
nalgebra = { version = ">=0.21, <0.28", optional = true }
|
||||||
serde = { version = "1", optional = true }
|
serde = { version = "1", features = ["derive"], optional = true }
|
||||||
serde_derive = { version = "1", optional = true }
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
float-cmp = ">=0.6, < 0.9"
|
float-cmp = ">=0.6, < 0.9"
|
||||||
@ -46,4 +45,4 @@ name = "hello-world"
|
|||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "serialization"
|
name = "serialization"
|
||||||
required-features = ["serialization"]
|
required-features = ["serde"]
|
||||||
|
10
README.md
10
README.md
@ -83,19 +83,19 @@ not. It’s especially important to see how it copes with the documentation.
|
|||||||
|
|
||||||
So here’s a list of currently supported features and how to enable them:
|
So here’s a list of currently supported features and how to enable them:
|
||||||
|
|
||||||
- **Serialization / deserialization.**
|
- **Serde.**
|
||||||
- This feature implements both the `Serialize` and `Deserialize` traits from `serde` for all
|
- This feature implements both the `Serialize` and `Deserialize` traits from `serde` for all
|
||||||
types exported by this crate.
|
types exported by this crate.
|
||||||
- Enable with the `"serialization"` feature.
|
- Enable with the `"serde"` feature.
|
||||||
- **[cgmath](https://crates.io/crates/cgmath) implementors.**
|
- **[cgmath](https://crates.io/crates/cgmath) implementors.**
|
||||||
- Adds some useful implementations of `Interpolate` for some cgmath types.
|
- Adds some useful implementations of `Interpolate` for some cgmath types.
|
||||||
- Enable with the `"impl-cgmath"` feature.
|
- Enable with the `"cgmath"` feature.
|
||||||
- **[glam](https://crates.io/crates/glam) implementors.**
|
- **[glam](https://crates.io/crates/glam) implementors.**
|
||||||
- Adds some useful implementations of `Interpolate` for some glam types.
|
- Adds some useful implementations of `Interpolate` for some glam types.
|
||||||
- Enable with the `"impl-glam"` feature.
|
- Enable with the `"glam"` feature.
|
||||||
- **[nalgebra](https://crates.io/crates/nalgebra) implementors.**
|
- **[nalgebra](https://crates.io/crates/nalgebra) implementors.**
|
||||||
- Adds some useful implementations of `Interpolate` for some nalgebra types.
|
- Adds some useful implementations of `Interpolate` for some nalgebra types.
|
||||||
- Enable with the `"impl-nalgebra"` feature.
|
- Enable with the `"nalgebra"` feature.
|
||||||
- **Standard library / no standard library.**
|
- **Standard library / no standard library.**
|
||||||
- It’s possible to compile against the standard library or go on your own without it.
|
- It’s possible to compile against the standard library or go on your own without it.
|
||||||
- Compiling with the standard library is enabled by default.
|
- Compiling with the standard library is enabled by default.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//! Available interpolation modes.
|
//! Available interpolation modes.
|
||||||
|
|
||||||
#[cfg(feature = "serialization")]
|
#[cfg(any(feature = "serialization", feature = "serde"))]
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
/// Available kind of interpolations.
|
/// Available kind of interpolations.
|
||||||
///
|
///
|
||||||
@ -9,7 +9,7 @@ use serde_derive::{Deserialize, Serialize};
|
|||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serialization",
|
any(feature = "serialization", feature = "serde"),
|
||||||
derive(Deserialize, Serialize),
|
derive(Deserialize, Serialize),
|
||||||
serde(rename_all = "snake_case")
|
serde(rename_all = "snake_case")
|
||||||
)]
|
)]
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
//! interpolation mode on a key-based way, allowing you to implement and encode complex curves.
|
//! interpolation mode on a key-based way, allowing you to implement and encode complex curves.
|
||||||
|
|
||||||
use crate::interpolation::Interpolation;
|
use crate::interpolation::Interpolation;
|
||||||
#[cfg(feature = "serialization")]
|
#[cfg(any(feature = "serialization", feature = "serde"))]
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
/// A spline control point.
|
/// A spline control point.
|
||||||
///
|
///
|
||||||
@ -19,7 +19,7 @@ use serde_derive::{Deserialize, Serialize};
|
|||||||
/// [`Interpolation`]: crate::interpolation::Interpolation
|
/// [`Interpolation`]: crate::interpolation::Interpolation
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "serialization",
|
any(feature = "serialization", feature = "serde"),
|
||||||
derive(Deserialize, Serialize),
|
derive(Deserialize, Serialize),
|
||||||
serde(rename_all = "snake_case")
|
serde(rename_all = "snake_case")
|
||||||
)]
|
)]
|
||||||
|
16
src/lib.rs
16
src/lib.rs
@ -84,19 +84,19 @@
|
|||||||
//!
|
//!
|
||||||
//! So here’s a list of currently supported features and how to enable them:
|
//! So here’s a list of currently supported features and how to enable them:
|
||||||
//!
|
//!
|
||||||
//! - **Serialization / deserialization.**
|
//! - **Serde.**
|
||||||
//! - This feature implements both the `Serialize` and `Deserialize` traits from `serde` for all
|
//! - This feature implements both the `Serialize` and `Deserialize` traits from `serde` for all
|
||||||
//! types exported by this crate.
|
//! types exported by this crate.
|
||||||
//! - Enable with the `"serialization"` feature.
|
//! - Enable with the `"serde"` feature.
|
||||||
//! - **[cgmath](https://crates.io/crates/cgmath) implementors.**
|
//! - **[cgmath](https://crates.io/crates/cgmath) implementors.**
|
||||||
//! - Adds some useful implementations of `Interpolate` for some cgmath types.
|
//! - Adds some useful implementations of `Interpolate` for some cgmath types.
|
||||||
//! - Enable with the `"impl-cgmath"` feature.
|
//! - Enable with the `"cgmath"` feature.
|
||||||
//! - **[glam](https://crates.io/crates/glam) implementors.**
|
//! - **[glam](https://crates.io/crates/glam) implementors.**
|
||||||
//! - Adds some useful implementations of `Interpolate` for some glam types.
|
//! - Adds some useful implementations of `Interpolate` for some glam types.
|
||||||
//! - Enable with the `"impl-glam"` feature.
|
//! - Enable with the `"glam"` feature.
|
||||||
//! - **[nalgebra](https://crates.io/crates/nalgebra) implementors.**
|
//! - **[nalgebra](https://crates.io/crates/nalgebra) implementors.**
|
||||||
//! - Adds some useful implementations of `Interpolate` for some nalgebra types.
|
//! - Adds some useful implementations of `Interpolate` for some nalgebra types.
|
||||||
//! - Enable with the `"impl-nalgebra"` feature.
|
//! - Enable with the `"nalgebra"` feature.
|
||||||
//! - **Standard library / no standard library.**
|
//! - **Standard library / no standard library.**
|
||||||
//! - It’s possible to compile against the standard library or go on your own without it.
|
//! - It’s possible to compile against the standard library or go on your own without it.
|
||||||
//! - Compiling with the standard library is enabled by default.
|
//! - Compiling with the standard library is enabled by default.
|
||||||
@ -112,15 +112,15 @@
|
|||||||
#[cfg(not(feature = "std"))]
|
#[cfg(not(feature = "std"))]
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
#[cfg(feature = "impl-cgmath")]
|
#[cfg(any(feature = "impl-cgmath", feature = "cgmath"))]
|
||||||
mod cgmath;
|
mod cgmath;
|
||||||
#[cfg(feature = "impl-glam")]
|
#[cfg(any(feature = "impl-glam", feature = "glam"))]
|
||||||
mod glam;
|
mod glam;
|
||||||
pub mod interpolate;
|
pub mod interpolate;
|
||||||
pub mod interpolation;
|
pub mod interpolation;
|
||||||
pub mod iter;
|
pub mod iter;
|
||||||
pub mod key;
|
pub mod key;
|
||||||
#[cfg(feature = "impl-nalgebra")]
|
#[cfg(any(feature = "impl-nalgebra", feature = "nalgebra"))]
|
||||||
mod nalgebra;
|
mod nalgebra;
|
||||||
pub mod spline;
|
pub mod spline;
|
||||||
|
|
||||||
|
@ -10,8 +10,8 @@ use alloc::vec::Vec;
|
|||||||
use core::cmp::Ordering;
|
use core::cmp::Ordering;
|
||||||
#[cfg(not(feature = "std"))]
|
#[cfg(not(feature = "std"))]
|
||||||
use core::ops::{Div, Mul};
|
use core::ops::{Div, Mul};
|
||||||
#[cfg(feature = "serialization")]
|
#[cfg(any(feature = "serialization", feature = "serde"))]
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
|
|
||||||
@ -28,7 +28,10 @@ use std::cmp::Ordering;
|
|||||||
/// - [`Spline::clamped_sample`]: behaves like [`Spline::sample`] but will return either the first
|
/// - [`Spline::clamped_sample`]: behaves like [`Spline::sample`] but will return either the first
|
||||||
/// or last key if out of bound; it will return `None` if not enough key.
|
/// or last key if out of bound; it will return `None` if not enough key.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
#[cfg_attr(feature = "serialization", derive(Deserialize, Serialize))]
|
#[cfg_attr(
|
||||||
|
any(feature = "serialization", feature = "serde"),
|
||||||
|
derive(Deserialize, Serialize)
|
||||||
|
)]
|
||||||
pub struct Spline<T, V>(pub(crate) Vec<Key<T, V>>);
|
pub struct Spline<T, V>(pub(crate) Vec<Key<T, V>>);
|
||||||
|
|
||||||
impl<T, V> Spline<T, V> {
|
impl<T, V> Spline<T, V> {
|
||||||
|
Reference in New Issue
Block a user