Files
Danny McGee 1687bfd6ed BVH animation loading / retargeting (#25)
This PR adds support for BVH animation files, with a custom animation
player and retargeting solution for our Blender Rigify-based skeletal
meshes.

---------

Co-authored-by: Brooks Palin <brookspalin710@gmail.com>
2024-01-18 17:28:25 -05:00

39 lines
741 B
Rust

use core::fmt;
use anyhow::anyhow;
use bevy::prelude::Deref;
#[derive(Debug, Deref)]
pub struct Error(pub anyhow::Error);
impl From<anyhow::Error> for Error {
fn from(value: anyhow::Error) -> Self {
Self(value)
}
}
pub trait Anyhow<T> {
fn anyhow(self) -> anyhow::Result<T>;
}
impl<T, E> Anyhow<T> for Result<T, E>
where
E: std::error::Error,
{
fn anyhow(self) -> anyhow::Result<T> {
self.map_err(|err| anyhow!("{err}"))
}
}
impl std::error::Error for Error {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
self.0.source()
}
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", **self)
}
}