From 605767d7a95914af61b73a5cf6bad043bc34476b Mon Sep 17 00:00:00 2001 From: kl-botsu Date: Sat, 31 Aug 2024 16:14:26 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20khonsula?= =?UTF-8?q?bs/FunnyBones@a754e58a4f172a47b0a2c03b45c57f89b0c7a94c=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../funnybones/animation/enum.ChangeKind.html | 10 +++---- main/funnybones/animation/index.html | 2 +- .../animation/struct.Animation.html | 6 ++-- main/funnybones/animation/struct.Change.html | 8 ++--- main/funnybones/animation/struct.Frame.html | 10 +++---- .../animation/struct.RunningAnimation.html | 2 +- main/funnybones/index.html | 29 ++++++++++++++----- main/src/funnybones/animation.rs.html | 22 ++++++++++++-- 8 files changed, 59 insertions(+), 30 deletions(-) diff --git a/main/funnybones/animation/enum.ChangeKind.html b/main/funnybones/animation/enum.ChangeKind.html index 9f59b9a..9130b34 100644 --- a/main/funnybones/animation/enum.ChangeKind.html +++ b/main/funnybones/animation/enum.ChangeKind.html @@ -1,4 +1,4 @@ -ChangeKind in funnybones::animation - Rust

Enum funnybones::animation::ChangeKind

source ·
pub enum ChangeKind {
+ChangeKind in funnybones::animation - Rust

Enum funnybones::animation::ChangeKind

source ·
pub enum ChangeKind {
     Bone {
         bone: BoneId,
         position: Vector,
@@ -7,10 +7,10 @@
         joint: JointId,
         rotation: Angle,
     },
-}

Variants§

§

Bone

Fields

§bone: BoneId
§position: Vector
§

Joint

Fields

§joint: JointId
§rotation: Angle

Implementations§

source§

impl ChangeKind

source

pub const fn with_easing(self, easing: StandardEasing) -> Change

Trait Implementations§

source§

impl Clone for ChangeKind

source§

fn clone(&self) -> ChangeKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ChangeKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for ChangeKind

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<ChangeKind> for Change

source§

fn from(kind: ChangeKind) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ChangeKind

source§

fn eq(&self, other: &ChangeKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, -and should not be overridden without very good reason.
source§

impl Serialize for ChangeKind

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for ChangeKind

source§

impl StructuralPartialEq for ChangeKind

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where +}

Variants§

§

Bone

Fields

§bone: BoneId
§position: Vector
§

Joint

Fields

§joint: JointId
§rotation: Angle

Implementations§

source§

impl ChangeKind

source

pub const fn with_easing(self, easing: StandardEasing) -> Change

Trait Implementations§

source§

impl Clone for ChangeKind

source§

fn clone(&self) -> ChangeKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ChangeKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for ChangeKind

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<ChangeKind> for Change

source§

fn from(kind: ChangeKind) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ChangeKind

source§

fn eq(&self, other: &ChangeKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
source§

impl Serialize for ChangeKind

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for ChangeKind

source§

impl StructuralPartialEq for ChangeKind

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/main/funnybones/animation/index.html b/main/funnybones/animation/index.html index 8f09d0a..6669ee1 100644 --- a/main/funnybones/animation/index.html +++ b/main/funnybones/animation/index.html @@ -1 +1 @@ -funnybones::animation - Rust
\ No newline at end of file +funnybones::animation - Rust
\ No newline at end of file diff --git a/main/funnybones/animation/struct.Animation.html b/main/funnybones/animation/struct.Animation.html index 91ed3e7..45f1388 100644 --- a/main/funnybones/animation/struct.Animation.html +++ b/main/funnybones/animation/struct.Animation.html @@ -1,4 +1,4 @@ -Animation in funnybones::animation - Rust

Struct funnybones::animation::Animation

source ·
pub struct Animation(/* private fields */);

Implementations§

source§

impl Animation

source

pub fn push(&mut self, frame: Frame)

source

pub fn with(self, frame: Frame) -> Self

source

pub fn remove(&mut self, frame_index: usize) -> Frame

source

pub fn insert(&mut self, index: usize, frame: Frame)

source

pub fn with_variable(self, name: impl Into<String>, value: f32) -> Self

source

pub fn set_variable<'a>(&mut self, name: impl Into<Cow<'a, str>>, value: f32)

source

pub fn variable(&self, name: &str) -> Option<f32>

source

pub fn start(&self) -> RunningAnimation

Methods from Deref<Target = [Frame]>§

source

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

+Animation in funnybones::animation - Rust

Struct funnybones::animation::Animation

source ·
pub struct Animation(/* private fields */);

Implementations§

source§

impl Animation

source

pub fn push(&mut self, frame: Frame)

source

pub fn with(self, frame: Frame) -> Self

source

pub fn remove(&mut self, frame_index: usize) -> Frame

source

pub fn insert(&mut self, index: usize, frame: Frame)

source

pub fn with_variable(self, name: impl Into<String>, value: f32) -> Self

source

pub fn set_variable<'a>(&mut self, name: impl Into<Cow<'a, str>>, value: f32)

source

pub fn variable(&self, name: &str) -> Option<f32>

source

pub fn start(&self) -> RunningAnimation

Methods from Deref<Target = [Frame]>§

source

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

source

pub fn as_bytes(&self) -> &[u8]

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a slice of u8 bytes.

1.23.0 · source

pub fn is_ascii(&self) -> bool

Checks if all bytes in this slice are within the ASCII range.

source

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this slice is_ascii, returns it as a slice of @@ -2452,8 +2452,8 @@

§Examples<

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged.

To lowercase the value in-place, use make_ascii_lowercase.

-

Trait Implementations§

source§

impl Clone for Animation

source§

fn clone(&self) -> Animation

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Animation

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Animation

source§

fn default() -> Animation

Returns the “default value” for a type. Read more
source§

impl Deref for Animation

source§

type Target = [Frame]

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Animation

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl PartialEq for Animation

source§

fn eq(&self, other: &Animation) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, -and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Animation

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where +

Trait Implementations§

source§

impl Clone for Animation

source§

fn clone(&self) -> Animation

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Animation

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Animation

source§

fn default() -> Animation

Returns the “default value” for a type. Read more
source§

impl Deref for Animation

source§

type Target = [Frame]

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Animation

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl PartialEq for Animation

source§

fn eq(&self, other: &Animation) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Animation

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/main/funnybones/animation/struct.Change.html b/main/funnybones/animation/struct.Change.html index ae8fb9c..16b96b2 100644 --- a/main/funnybones/animation/struct.Change.html +++ b/main/funnybones/animation/struct.Change.html @@ -1,7 +1,7 @@ -Change in funnybones::animation - Rust

Struct funnybones::animation::Change

source ·
pub struct Change { /* private fields */ }

Trait Implementations§

source§

impl Clone for Change

source§

fn clone(&self) -> Change

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Change

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Change

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<ChangeKind> for Change

source§

fn from(kind: ChangeKind) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Change

source§

fn eq(&self, other: &Change) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, -and should not be overridden without very good reason.
source§

impl Serialize for Change

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for Change

source§

impl StructuralPartialEq for Change

Auto Trait Implementations§

§

impl Freeze for Change

§

impl RefUnwindSafe for Change

§

impl Send for Change

§

impl Sync for Change

§

impl Unpin for Change

§

impl UnwindSafe for Change

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where +Change in funnybones::animation - Rust

Struct funnybones::animation::Change

source ·
pub struct Change { /* private fields */ }

Trait Implementations§

source§

impl Clone for Change

source§

fn clone(&self) -> Change

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Change

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Change

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<ChangeKind> for Change

source§

fn from(kind: ChangeKind) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Change

source§

fn eq(&self, other: &Change) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
source§

impl Serialize for Change

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for Change

source§

impl StructuralPartialEq for Change

Auto Trait Implementations§

§

impl Freeze for Change

§

impl RefUnwindSafe for Change

§

impl Send for Change

§

impl Sync for Change

§

impl Unpin for Change

§

impl UnwindSafe for Change

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/main/funnybones/animation/struct.Frame.html b/main/funnybones/animation/struct.Frame.html index c551305..a589965 100644 --- a/main/funnybones/animation/struct.Frame.html +++ b/main/funnybones/animation/struct.Frame.html @@ -1,4 +1,4 @@ -Frame in funnybones::animation - Rust

Struct funnybones::animation::Frame

source ·
pub struct Frame { /* private fields */ }

Implementations§

source§

impl Frame

source

pub const fn new(duration: Duration) -> Self

source

pub fn set_duration(&mut self, duration: Duration)

source

pub const fn duration(&self) -> Duration

source

pub fn with_change(self, change: impl Into<Change>) -> Self

source

pub fn push_change(&mut self, change: impl Into<Change>)

Methods from Deref<Target = [Change]>§

source

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

+Frame in funnybones::animation - Rust

Struct funnybones::animation::Frame

source ·
pub struct Frame { /* private fields */ }

Implementations§

source§

impl Frame

source

pub const fn new(duration: Duration) -> Self

source

pub fn set_duration(&mut self, duration: Duration)

source

pub const fn duration(&self) -> Duration

source

pub fn with_change(self, change: impl Into<Change>) -> Self

source

pub fn push_change(&mut self, change: impl Into<Change>)

Methods from Deref<Target = [Change]>§

source

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

source

pub fn as_bytes(&self) -> &[u8]

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a slice of u8 bytes.

1.23.0 · source

pub fn is_ascii(&self) -> bool

Checks if all bytes in this slice are within the ASCII range.

source

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this slice is_ascii, returns it as a slice of @@ -2452,10 +2452,10 @@

§Examples<

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged.

To lowercase the value in-place, use make_ascii_lowercase.

-

Trait Implementations§

source§

impl Clone for Frame

source§

fn clone(&self) -> Frame

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Frame

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for Frame

source§

type Target = [Change]

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Frame

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'de> Deserialize<'de> for Frame

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for Frame

source§

fn eq(&self, other: &Frame) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, -and should not be overridden without very good reason.
source§

impl Serialize for Frame

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for Frame

Auto Trait Implementations§

§

impl Freeze for Frame

§

impl RefUnwindSafe for Frame

§

impl Send for Frame

§

impl Sync for Frame

§

impl Unpin for Frame

§

impl UnwindSafe for Frame

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where +

Trait Implementations§

source§

impl Clone for Frame

source§

fn clone(&self) -> Frame

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Frame

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for Frame

source§

type Target = [Change]

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Frame

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'de> Deserialize<'de> for Frame

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for Frame

source§

fn eq(&self, other: &Frame) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
source§

impl Serialize for Frame

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for Frame

Auto Trait Implementations§

§

impl Freeze for Frame

§

impl RefUnwindSafe for Frame

§

impl Send for Frame

§

impl Sync for Frame

§

impl Unpin for Frame

§

impl UnwindSafe for Frame

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/main/funnybones/animation/struct.RunningAnimation.html b/main/funnybones/animation/struct.RunningAnimation.html index 4095959..336a067 100644 --- a/main/funnybones/animation/struct.RunningAnimation.html +++ b/main/funnybones/animation/struct.RunningAnimation.html @@ -1,4 +1,4 @@ -RunningAnimation in funnybones::animation - Rust

Struct funnybones::animation::RunningAnimation

source ·
pub struct RunningAnimation { /* private fields */ }

Implementations§

source§

impl RunningAnimation

source

pub fn looping(self) -> Self

source

pub fn update(&mut self, elapsed: Duration, skeleton: &mut Skeleton) -> bool

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where +RunningAnimation in funnybones::animation - Rust

Struct funnybones::animation::RunningAnimation

source ·
pub struct RunningAnimation { /* private fields */ }

Implementations§

source§

impl RunningAnimation

source

pub fn looping(self) -> Self

source

pub fn update(&mut self, elapsed: Duration, skeleton: &mut Skeleton) -> bool

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/main/funnybones/index.html b/main/funnybones/index.html index 501e49a..eb205b0 100644 --- a/main/funnybones/index.html +++ b/main/funnybones/index.html @@ -49,12 +49,17 @@

let mut skeleton = Skeleton::default();
+
 // Create our root bone: the spine
-let spine = skeleton.push_bone(BoneKind::Rigid { length: 3. }, "spine");
+let spine = skeleton.push_bone(BoneKind::Rigid { length: 3. }.with_label("spine"));
 // Create the right-half of the hips.
-let r_hip = skeleton.push_bone(BoneKind::Rigid { length: 0.5 }, "r_hip");
+let r_hip = skeleton.push_bone(BoneKind::Rigid { length: 0.5 }.with_label("r_hip"));
 // Connect the right hip to the spine.
-skeleton.push_joint(Rotation::degrees(-90.), spine.axis_a(), r_hip.axis_a());
+skeleton.push_joint(Joint::new(
+    Angle::degrees(-90.),
+    spine.axis_a(),
+    r_hip.axis_a(),
+));
 // Create the right leg as a jointed bone with equal sizes for the upper and
 // lower leg.
 let r_leg = skeleton.push_bone(
@@ -62,16 +67,24 @@ 

1.5, end_length: 1.5, inverse: true, - }, - "r_leg", + } + .with_label("r_leg"), ); // Connect the right leg to the right hip. -skeleton.push_joint(Rotation::degrees(-90.), r_hip.axis_b(), r_leg.axis_a()); +skeleton.push_joint(Joint::new( + Angle::degrees(0.), + r_hip.axis_b(), + r_leg.axis_a(), +)); // Create the right foot. -let r_foot = skeleton.push_bone(BoneKind::Rigid { length: 0.5 }, "r_foot"); +let r_foot = skeleton.push_bone(BoneKind::Rigid { length: 0.5 }.with_label("r_foot")); // Connect the right foot to the right leg. -let r_ankle_id = skeleton.push_joint(Rotation::degrees(90.), r_leg.axis_b(), r_foot.axis_a());

+let r_ankle_id = skeleton.push_joint(Joint::new( + Angle::degrees(90.), + r_leg.axis_b(), + r_foot.axis_a(), +));

The example draws a small white circle where a desired location for a joint is. FunnyBones ensures that all bones remain their original lengths while solving diff --git a/main/src/funnybones/animation.rs.html b/main/src/funnybones/animation.rs.html index efb3209..8589936 100644 --- a/main/src/funnybones/animation.rs.html +++ b/main/src/funnybones/animation.rs.html @@ -315,6 +315,14 @@ 315 316 317 +318 +319 +320 +321 +322 +323 +324 +325

#![allow(missing_docs)]
 use std::{
     borrow::Cow,
@@ -324,7 +332,6 @@
     time::Duration,
 };
 
-use cushy::animation::LinearInterpolate;
 use easing_function::{easings::StandardEasing, Easing};
 
 use crate::{Angle, BoneId, Coordinate, JointId, Skeleton, Vector};
@@ -577,7 +584,7 @@
                             },
                             OriginalProperty::Vector(original),
                         ) => {
-                            skeleton[bone].set_desired_end(Some(original.lerp(&target, factor)));
+                            skeleton[bone].set_desired_end(Some(original.lerp(target, factor)));
                         }
                         (
                             ChangeKind::Joint {
@@ -586,7 +593,7 @@
                             },
                             OriginalProperty::Rotation(original),
                         ) => {
-                            skeleton[joint].set_angle(original.lerp(&target, factor));
+                            skeleton[joint].set_angle(original.lerp(target, factor));
                         }
                         _ => unreachable!(),
                     }
@@ -632,4 +639,13 @@
         )
     }
 }
+
+impl Lerp for Vector {
+    fn lerp(self, target: Self, percent: f32) -> Self {
+        Self::new(
+            self.magnitude.lerp(target.magnitude, percent),
+            self.direction.lerp(target.direction, percent),
+        )
+    }
+}
 

\ No newline at end of file