21 Commits

Author SHA1 Message Date
3d1819b4c0 Update glam requirement from >=0.10, <0.25 to >=0.10, <0.26
Updates the requirements on [glam](https://github.com/bitshifter/glam-rs) to permit the latest version.
- [Changelog](https://github.com/bitshifter/glam-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitshifter/glam-rs/commits)

---
updated-dependencies:
- dependency-name: glam
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-19 04:16:03 +00:00
f6fa4ecbce Merge pull request #102 from phaazon/release/4.3.1
Prepare v4.3.1.
2023-11-22 19:13:05 +01:00
e2f220ec15 Prepare v4.3.1. 2023-11-22 19:10:19 +01:00
c3670d6b0a Merge pull request #100 from perlindgren/master
Default for Spline
2023-11-22 00:09:57 +01:00
c6ba8476f2 Default for Spline 2023-10-27 21:20:24 +02:00
389f4d182d Update changelog (links). 2023-09-23 16:25:54 +02:00
8af9151dac Changelog fix. 2023-09-23 16:10:14 +02:00
a82cf85619 Merge pull request #99 from phaazon/release/v4.3.0
Prepare v4.3.0.
2023-09-23 15:57:48 +02:00
37d3cc5f29 Prepare v4.3.0. 2023-09-23 15:54:10 +02:00
1e70ab882c Rustfmt. 2023-09-23 15:40:58 +02:00
2179c8300f Merge pull request #98 from EmbarkStudios/master
Add `clear` method to `Spline`
2023-09-23 15:40:26 +02:00
e7a9723ae0 Fix rustfmt. 2023-09-23 13:01:18 +02:00
eca09f1baf add clear method to Spline 2023-09-13 15:52:43 +02:00
e1b78070c6 Merge pull request #97 from phaazon/dependabot/cargo/master/glam-gte-0.10-and-lt-0.25
Update glam requirement from >=0.10, <0.23 to >=0.10, <0.25
2023-05-30 10:27:54 +02:00
cdc48a49a7 Update glam requirement from >=0.10, <0.23 to >=0.10, <0.25
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/main/CHANGELOG.md)
- [Commits](https://github.com/bitshifter/glam-rs/compare/0.10.0...0.24.0)

---
updated-dependencies:
- dependency-name: glam
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-24 04:59:27 +00:00
decd85dba2 Merge pull request #95 from phaazon/update-deps
Bump dependencies (cgmath, nalgebra) to latest.
2023-02-01 19:41:51 +01:00
df9815a464 Add deprecation lints if using impl-* feature gates. 2023-02-01 19:29:31 +01:00
ca8e797932 Prepare version 4.2.0. 2023-02-01 19:19:45 +01:00
5b746aaf57 Bump dependencies (cgmath, nalgebra) to latest. 2023-02-01 19:12:11 +01:00
88a7ee7a8d Merge pull request #91 from timethy/patch-1
Update CHANGELOG.md
2022-07-27 16:29:24 +02:00
Tim
5463fd11d6 Update CHANGELOG.md
Small typo
2022-07-27 09:22:51 +02:00
5 changed files with 49 additions and 16 deletions

View File

@ -1,7 +1,8 @@
# Changelog
<!-- vim-markdown-toc GFM -->
* [4.3.1](#431)
* [4.3](#43)
* [4.2](#42)
* [4.1.1](#411)
* [4.1](#41)
* [4.0.3](#403)
@ -42,13 +43,33 @@
* [0.1.1](#011)
* [0.1](#01)
<!-- vim-markdown-toc -->
# 4.3.1
> Nov 22, 2023
- Add `Default` implementation for `Spline`. [c6ba847](https://github.com/phaazon/splines/commit/c6ba847)
# 4.3
> Sep 23, 2023
- Add support for `glam-0.23` and `glam-0.24`. [cdc48a4](https://github.com/phaazon/splines/commit/cdc48a4)
- Add `Spline::clear` to clear a spline keys without deallocating its internal storage. [eca09f1](https://github.com/phaazon/splines/commit/eca09f1)
# 4.2
> Feb 1, 2023
- Add support for `glam-0.22`.
- Add support for `nalgebra-0.32`.
- Add deprecation lints for `impl-*` feature gates. Those shouldnt be used anymore and the `*` variant should be
preferred. For instance, if you used `impl-cgmath`, you should just use the `cgmath` feature gate now.
# 4.1.1
> Jul 27, 2022
- Internal enhancement of sampling splines by looking for control points. That brings the lookup from _O(1)_ to
- Internal enhancement of sampling splines by looking for control points. That brings the lookup from _O(N)_ to
_O(log(N))_. That is super embarassing because it should have been the default from the very first commit. Sorry
about that.
- Fix hermite cubic interpolation.

View File

@ -1,6 +1,6 @@
[package]
name = "splines"
version = "4.1.1"
version = "4.3.1"
license = "BSD-3-Clause"
authors = ["Dimitri Sabadie <dimitri.sabadie@gmail.com>"]
description = "Spline interpolation made easy"
@ -13,12 +13,6 @@ readme = "README.md"
edition = "2021"
[badges]
travis-ci = { repository = "phaazon/splines", branch = "master" }
is-it-maintained-issue-resolution = { repository = "phaazon/splines" }
is-it-maintained-open-issues = { repository = "phaazon/splines" }
maintenance = { status = "actively-developed" }
[features]
default = ["std"]
impl-cgmath = ["cgmath"]
@ -29,8 +23,8 @@ std = []
[dependencies]
cgmath = { version = ">=0.17, <0.19", optional = true }
glam = { version = ">=0.10, <0.22", optional = true }
nalgebra = { version = ">=0.21, <0.32", optional = true }
glam = { version = ">=0.10, <0.26", optional = true }
nalgebra = { version = ">=0.21, <0.33", optional = true }
serde = { version = "1", features = ["derive"], optional = true }
[dev-dependencies]
@ -38,7 +32,7 @@ float-cmp = ">=0.6, < 0.10"
serde_json = "1"
[package.metadata.docs.rs]
all-features = true
features = ["std", "cgmath", "glam", "nalgebra", "serde"]
[[example]]
name = "hello-world"

View File

@ -1,6 +1,6 @@
edition = "2018"
fn_args_layout = "Tall"
fn_params_layout = "Tall"
force_explicit_abi = true
hard_tabs = false
max_width = 100

View File

@ -108,6 +108,17 @@
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(alloc))]
#![cfg_attr(not(feature = "std"), feature(core_intrinsics))]
#![cfg_attr(
any(
feature = "impl-cgmath",
feature = "impl-glam",
feature = "impl-nalgebra"
),
deprecated(
since = "4.2.0",
note = "you are using an impl-* feature gate; please switch to * (e.g. impl-cgmath becomes cgmath)"
)
)]
#[cfg(not(feature = "std"))]
extern crate alloc;

View File

@ -27,7 +27,7 @@ use std::cmp::Ordering;
/// for the required interpolation mode, you get `None`.
/// - [`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.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Default)]
#[cfg_attr(
any(feature = "serialization", feature = "serde"),
derive(Deserialize, Serialize)
@ -56,6 +56,13 @@ impl<T, V> Spline<T, V> {
spline
}
/// Clear the spline by removing all keys. Keeps the underlying allocated storage, so adding
/// new keys should be faster than creating a new [`Spline`]
#[inline]
pub fn clear(&mut self) {
self.0.clear()
}
/// Create a new spline by consuming an `Iterater<Item = Key<T>>`. They keys dont have to be
/// sorted.
///