[−][src]Enum bvh_anim::ChannelType
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]
B: AsRef<[u8]>,
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]
fn eq(&self, other: &ChannelType) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Clone for ChannelType
[src]
fn clone(&self) -> 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]
fn from(channel_ty: ChannelType) -> Self
[src]
impl From<bvh_ChannelType> for ChannelType
[src]
fn from(channel_ty: bvh_ChannelType) -> Self
[src]
impl Eq for ChannelType
[src]
impl Display for ChannelType
[src]
impl Debug for ChannelType
[src]
impl Hash for ChannelType
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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.
fn try_from(string: &BStr) -> Result<Self, Self::Error>
[src]
impl<'_> TryFrom<&'_ [u8]> for ChannelType
[src]
type Error = ParseChannelError
The type returned in the event of a conversion error.
fn try_from(string: &[u8]) -> Result<Self, Self::Error>
[src]
impl<'_> TryFrom<&'_ str> for ChannelType
[src]
type Error = ParseChannelError
The type returned in the event of a conversion error.
fn try_from(string: &str) -> Result<Self, Self::Error>
[src]
impl FromStr for ChannelType
[src]
Auto Trait Implementations
impl Send for ChannelType
impl Sync for ChannelType
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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,