pub struct BvhFile {
pub skeleton: BvhSkeleton,
pub frames: Vec<BvhFrame>,
pub frame_time: f32,
}Expand description
A fully parsed BVH file.
Fields§
§skeleton: BvhSkeletonParsed skeleton hierarchy.
frames: Vec<BvhFrame>All motion frames.
frame_time: f32Duration of a single frame in seconds.
Implementations§
Source§impl BvhFile
impl BvhFile
Sourcepub fn frame_count(&self) -> usize
pub fn frame_count(&self) -> usize
Number of frames in the file.
Sourcepub fn duration_seconds(&self) -> f32
pub fn duration_seconds(&self) -> f32
Total duration in seconds.
Sourcepub fn root_translation(&self, frame: usize) -> [f32; 3]
pub fn root_translation(&self, frame: usize) -> [f32; 3]
Returns the root translation [x, y, z] at frame frame.
The root joint must have Xposition, Yposition, Zposition as its first three channels
(the BVH standard for a 6-DOF root). If the root has no translation channels the
function returns [0.0, 0.0, 0.0].
Sourcepub fn joint_rotation(&self, frame: usize, joint_idx: usize) -> [f32; 3]
pub fn joint_rotation(&self, frame: usize, joint_idx: usize) -> [f32; 3]
Returns the Euler rotation (degrees) [x, y, z] for joint joint_idx at frame.
Only the rotation channels of the joint are inspected; translation channels are skipped.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BvhFile
impl RefUnwindSafe for BvhFile
impl Send for BvhFile
impl Sync for BvhFile
impl Unpin for BvhFile
impl UnsafeUnpin for BvhFile
impl UnwindSafe for BvhFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more