Realm

oa::anim

anim module in the OA Core public surface.

MdRust public API

Public Types

Public Functions

pub fn bake<T: AnimCurveValue>( curve: &AnimCurve<T>, start_time: Duration, frames_per_second: f32, frame_count: u32, wrap_mode: AnimWrapMode, ) -> Result<Vec<T>>
pub fn create_clip( skeleton_id: u32, joint_count: u32, frames_per_second: f32, samples: &[Transform], ) -> Result<AnimClip>
pub fn create_curve<T: AnimCurveValue>( interpolation: AnimInterpolation, keyframes: &[Keyframe<T>], ) -> Result<AnimCurve<T>>
pub fn create_pose( skeleton_id: u32, local_transforms: &[Transform], ) -> Result<SkelPose>
pub fn frame(clip: &AnimClip, frame: u32) -> Result<SkelPose>
pub fn sample_clip( clip: &AnimClip, time_seconds: f64, wrap_mode: AnimWrapMode, ) -> Result<SkelPose>
pub fn sample_curve<T: AnimCurveValue>( curve: &AnimCurve<T>, time: Duration, wrap_mode: AnimWrapMode, ) -> Result<T>
pub fn validate_clip(clip: &AnimClip) -> Result<()>
pub fn validate_curve<T: AnimCurveValue>(curve: &AnimCurve<T>) -> Result<()>
pub fn validate_pose(pose: &SkelPose) -> Result<()>

Function Documentation

pub fn bake<T: AnimCurveValue>( curve: &AnimCurve<T>, start_time: Duration, frames_per_second: f32, frame_count: u32, wrap_mode: AnimWrapMode ) -> Result<Vec<T>>
Sample a curve uniformly into frame_count values beginning at start_time. Errors Returns an error for non-finite or non-positive frames_per_second, a zero frame_count, a sample time beyond the representable range, or a sampling failure. Donor: oa::FnAnim::bake.
pub fn create_clip( skeleton_id: u32, joint_count: u32, frames_per_second: f32, samples: &[Transform] ) -> Result<AnimClip>
Create a validated AnimClip from frame-major uniform samples. samples must hold a whole number of joint_count frames. Errors Returns an error for a zero joint count, non-finite or non-positive frames_per_second, empty or partial-frame samples, a non-finite transform, or a frame count beyond the supported range. Donor: oa::FnAnim::createClip.
pub fn create_curve<T: AnimCurveValue>( interpolation: AnimInterpolation, keyframes: &[Keyframe<T>] ) -> Result<AnimCurve<T>>
Create a validated AnimCurve from strictly increasing keyframes. Quaternion curves normalize every keyframe value on construction. Errors Returns an error for empty or non-increasing keyframe times, non-finite or invalid values/tangents, an excessive count, or a time span that cannot be represented. Donor: oa::FnAnim::createCurve.
pub fn create_pose( skeleton_id: u32, local_transforms: &[Transform] ) -> Result<SkelPose>
Create a validated SkelPose from local joint transforms. Errors Returns an error when local_transforms is empty, contains a non-finite transform, or exceeds the supported joint count. Donor: oa::FnAnim::createPose.
pub fn frame( clip: &AnimClip, frame: u32 ) -> Result<SkelPose>
Extract the pose stored at frame. Errors Returns an error when the clip is invalid or frame is out of range. Donor: oa::FnAnim::getFrame.
pub fn sample_clip( clip: &AnimClip, time_seconds: f64, wrap_mode: AnimWrapMode ) -> Result<SkelPose>
Sample a clip at time_seconds, interpolating translation (lerp), rotation (slerp), scale, and shear per joint. Errors Returns an error when the clip is invalid or time_seconds is not finite. Donor: oa::FnAnim::sample(AnimClip).
pub fn sample_curve<T: AnimCurveValue>( curve: &AnimCurve<T>, time: Duration, wrap_mode: AnimWrapMode ) -> Result<T>
Sample a curve at time under wrap_mode. Errors Returns an error when interpolation produces a non-finite or non-normalizable value. Donor: oa::FnAnim::sample(AnimCurve).
pub fn validate_clip(clip: &AnimClip) -> Result<()>
Re-validate an AnimClip. Errors Returns an error under the same contract as create_clip. Donor: oa::FnAnim::validate(AnimClip).
pub fn validate_curve<T: AnimCurveValue>(curve: &AnimCurve<T>) -> Result<()>
Re-validate an AnimCurve and every stored keyframe. Errors Returns an error under the same contract as create_curve. Donor: oa::FnAnim::validate(AnimCurve).
pub fn validate_pose(pose: &SkelPose) -> Result<()>
Re-validate a SkelPose. Errors Returns an error under the same contract as create_pose. Donor: oa::FnAnim::validate(SkelPose).