[−][src]Enum bvh_anim::JointData
Internal representation of a joint.
Variants
Root
Root of the skeletal heirarchy.
Fields of Root
Child
A child joint in the skeleton.
Fields of Child
Methods
impl JointData
[src]
pub fn is_root(&self) -> bool
[src]
Returns true
if the Joint
is the root Joint
, or false
if it isn't.
Examples
let bvh = bvh! { HIERARCHY ROOT Hips { OFFSET 0.0 0.0 0.0 CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation End Site { OFFSET 0.0 0.0 30.0 } } MOTION Frames: 0 Frame Time: 0.0333333 }; let root = bvh.root_joint().unwrap(); assert!(root.data().is_root());
pub fn is_child(&self) -> bool
[src]
Returns true
if the Joint
is a child Joint
, or false
if it isn't.
Examples
let bvh = bvh! { // bvh hierarchy unspecified .. }; for joint in bvh.joints().skip(1) { assert!(joint.data().is_child()); }
pub fn name(&self) -> &BStr
[src]
Returns the name of the JointData
.
Examples
let bvh = bvh! { HIERARCHY ROOT Hips { OFFSET 0.0 0.0 0.0 CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation // ... } MOTION // ... }; let root = bvh.root_joint().unwrap(); assert_eq!(root.data().name(), "Hips");
pub fn offset(&self) -> &Vector3<f32>
[src]
Returns the offset of the JointData
if it exists, or None
.
Examples
let bvh = bvh! { HIERARCHY ROOT Hips { OFFSET 1.2 3.4 5.6 CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation // ... } MOTION // ... }; let root = bvh.root_joint().unwrap(); assert_eq!(root.data().offset(), &[1.2, 3.4, 5.6].into());
pub fn end_site(&self) -> Option<&Vector3<f32>>
[src]
Returns the end_site
position if this Joint
has an end site, or None
if
it doesn't.
Examples
let bvh = bvh! { HIERARCHY ROOT Base { OFFSET 0.0 0.0 0.0 CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation JOINT Tip { OFFSET 0.0 0.0 5.0 CHANNELS 3 Zrotation Xrotation Yrotation End Site { OFFSET 5.4 3.2 1.0 } } } MOTION // ... }; let mut joints = bvh.joints(); let base = joints.next().unwrap(); assert!(base.data().end_site().is_none()); let tip = joints.next().unwrap(); assert_eq!(tip.data().end_site(), Some([5.4, 3.2, 1.0].into()).as_ref());
pub fn has_end_site(&self) -> bool
[src]
Returns true
if the Joint
has an end_site_offset
, or false
if it doesn't.
pub fn channels(&self) -> &[Channel]
[src]
Returns the ordered array of Channel
s of this JointData
.
Examples
let bvh = bvh! { HIERARCHY ROOT Hips { OFFSET 0.0 0.0 0.0 CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation // ... } MOTION // ... }; let root = bvh.root_joint().unwrap(); let expected_channels = &[ ChannelType::PositionX, ChannelType::PositionY, ChannelType::PositionZ, ChannelType::RotationZ, ChannelType::RotationX, ChannelType::RotationY, ]; for (channel, &expected) in root .data() .channels() .iter() .map(|c| c.channel_type()) .zip(expected_channels.iter()) { assert_eq!(channel, expected); }
pub fn channels_mut(&mut self) -> &mut [Channel]
[src]
Returns a mutable reference to ordered array of Channel
s of this JointData
.
pub fn num_channels(&self) -> usize
[src]
Returns the total number of channels applicable to this JointData
.
pub fn index(&self) -> usize
[src]
Return the index of this Joint
in the array.
pub fn parent_index(&self) -> Option<usize>
[src]
Returns the index of the parent JointData
, or None
if this JointData
is the
root joint.
Trait Implementations
impl PartialEq<JointData> for JointData
[src]
impl Clone for JointData
[src]
fn clone(&self) -> JointData
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for JointData
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,