Enum blender_armature::Bone[][src]

pub enum Bone {
    Matrix(Matrix4<f32>),
    DualQuat(DualQuaternion<f32>),
}

A bone in an armature. Can either be a dual quaternion or a matrix. When you export bones from Blender they come as matrices - BlenderArmature lets you convert them into dual quaternions which are usually more favorable for when implementing skeletal animation with rigid transformations.

Variants

Matrix(Matrix4<f32>)

A transform represented as a matrix

DualQuat(DualQuaternion<f32>)

A rigid transform represented as a dual quaternion

Implementations

impl Bone[src]

pub fn relative_to_parent(&self, parent_bone: Bone) -> Bone[src]

Get this bone’s transform relative to some parent bone.

You could typically use this when both bones are in world space.

use nalgebra::{Matrix4, Vector3, Point3};

let axis_angle = Vector3::default();

let parent = Bone::Matrix(Matrix4::new_rotation_wrt_point(
  axis_angle,
  Point3::new(4., 5., 6.)
));

let child = Bone::Matrix(Matrix4::new_rotation_wrt_point(
  axis_angle,
  Point3::new(44., 55., 66.)
));

let expected = Bone::Matrix(Matrix4::new_rotation_wrt_point(
  axis_angle,
  Point3::new(40., 50., 60.)
));

assert_eq!(child.relative_to_parent(parent), expected);

Trait Implementations

impl Clone for Bone[src]

impl Copy for Bone[src]

impl Debug for Bone[src]

impl<'de> Deserialize<'de> for Bone[src]

impl PartialEq<Bone> for Bone[src]

impl Serialize for Bone[src]

impl StructuralPartialEq for Bone[src]

Auto Trait Implementations

impl RefUnwindSafe for Bone

impl Send for Bone

impl Sync for Bone

impl Unpin for Bone

impl UnwindSafe for Bone

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Scalar for T where
    T: PartialEq<T> + Copy + Any + Debug
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,