pub trait BodySpec: Sized {
type Spec;
type Manifests: Send + Sync + Clone;
type Extra: Send + Sync;
type BoneMesh;
type ModelEntryFuture<const N: usize>: ModelEntryFuture<N>;
// Required methods
fn load_spec() -> Result<Self::Manifests, Error>;
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher;
fn bone_meshes(
key: &FigureKey<Self>,
manifests: &Self::Manifests,
extra: Self::Extra,
) -> [Option<Self::BoneMesh>; 16];
}
Expand description
A set of reloadable specifications for a Body.
Required Associated Types§
type Spec
Sourcetype Manifests: Send + Sync + Clone
type Manifests: Send + Sync + Clone
Cloned on each cache invalidation. If this type is expensive to clone,
place it behind an [Arc
].
type Extra: Send + Sync
type BoneMesh
type ModelEntryFuture<const N: usize>: ModelEntryFuture<N>
Required Methods§
Sourcefn load_spec() -> Result<Self::Manifests, Error>
fn load_spec() -> Result<Self::Manifests, Error>
Initialize all the specifications for this Body.
Sourcefn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
Determine whether the cache’s manifest was reloaded
Sourcefn bone_meshes(
key: &FigureKey<Self>,
manifests: &Self::Manifests,
extra: Self::Extra,
) -> [Option<Self::BoneMesh>; 16]
fn bone_meshes( key: &FigureKey<Self>, manifests: &Self::Manifests, extra: Self::Extra, ) -> [Option<Self::BoneMesh>; 16]
Mesh bones using the given spec, character state, and mesh generation function.
NOTE: We deliberately call this function with only the key into the cache, to enforce that the cached state only depends on the key. We may end up using a mechanism different from this cache eventually, in which case this strategy might change.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.