[][src]Enum bvh_anim::ChannelType

pub enum ChannelType {
    RotationX,
    RotationY,
    RotationZ,
    PositionX,
    PositionY,
    PositionZ,
}

The available degrees of freedom along which a Joint may be manipulated.

Variants

RotationX

Can be rotated along the x axis.

RotationY

Can be rotated along the y axis.

RotationZ

Can be rotated along the z axis.

PositionX

Can be translated along the x axis.

PositionY

Can be translated along the y axis.

PositionZ

Can be translated along the z axis.

Methods

impl ChannelType[src]

pub fn from_bytes<B: ?Sized>(s: &B) -> Result<Self, ParseChannelError> where
    B: AsRef<[u8]>, 
[src]

Attempt to parse a bvh channel byte string into a ChannelType. Returns Err if the string cannot be parsed.

Examples

assert_eq!(
    ChannelType::from_bytes("Xrotation").unwrap(),
    ChannelType::RotationX);

let err = ChannelType::from_bytes("Hello").unwrap_err();
assert_eq!(err.into_inner(), "Hello");

pub fn is_rotation(&self) -> bool[src]

Returns true if this channel corresponds to a rotational transform, otherwise false.

Example

let channel_type = ChannelType::RotationX;
assert!(channel_type.is_rotation());

pub fn is_position(&self) -> bool[src]

Returns true if this channel corresponds to a positional transform, otherwise false.

Example

let channel_type = ChannelType::PositionZ;
assert!(channel_type.is_position());

pub fn axis(&self) -> Axis[src]

Get the Axis about which this Channel transforms.

Example

let channel_type = ChannelType::PositionX;
assert_eq!(channel_type.axis(), Axis::X);

pub fn axis_vector<T: Clone + One + Zero>(&self) -> Vector3<T>[src]

Returns the Vector3 of the channel axis. See the Axis::vector Axis::vector method for more info.

pub fn as_str(&self) -> &'static str[src]

Returns the string representation of the ChannelType.

pub fn as_bstr(&self) -> &'static BStr[src]

Returns the string representation of the ChannelType.

Trait Implementations

impl Copy for ChannelType[src]

impl PartialEq<ChannelType> for ChannelType[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Clone for ChannelType[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl From<ChannelType> for bvh_ChannelType[src]

impl From<bvh_ChannelType> for ChannelType[src]

impl Eq for ChannelType[src]

impl Display for ChannelType[src]

impl Debug for ChannelType[src]

impl Hash for ChannelType[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<'_> TryFrom<&'_ BStr> for ChannelType[src]

type Error = ParseChannelError

The type returned in the event of a conversion error.

impl<'_> TryFrom<&'_ [u8]> for ChannelType[src]

type Error = ParseChannelError

The type returned in the event of a conversion error.

impl<'_> TryFrom<&'_ str> for ChannelType[src]

type Error = ParseChannelError

The type returned in the event of a conversion error.

impl FromStr for ChannelType[src]

type Err = ParseChannelError

The associated error which can be returned from parsing.

Auto Trait Implementations

impl Send for ChannelType

impl Sync for ChannelType

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto 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<T> Borrow for T where
    T: ?Sized
[src]

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

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