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 std::sync::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".
Implementations on Foreign Types§
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = HumSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = QuadrupedSmallSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = QuadrupedMediumSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = BirdMediumSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = TheropodSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = ArthropodSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = CrustaceanSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = FishMediumSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = FishSmallSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = BipedSmallSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = DragonSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = BirdLargeSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = BipedLargeSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = GolemSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = QuadrupedLowSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = ObjectSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type Spec = ItemSpec
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type Extra = ()
type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)
type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]
Source§impl BodySpec for Body
impl BodySpec for Body
type BoneMesh = (Dyna<Block, ()>, Vec3<f32>)
type Extra = ()
type Manifests = &'static Handle<<Body as BodySpec>::Spec>
type ModelEntryFuture<const N: usize> = TerrainModelEntryFuture<N>
type Spec = ShipSpec
fn load_spec() -> Result<Self::Manifests, Error>
fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher
fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<Self::BoneMesh>; 16]
Source§impl BodySpec for Body
Available on crate feature plugins only.
impl BodySpec for Body
Available on crate feature
plugins only.