Trait BodySpec

Source
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§

Source

type Spec

Source

type Manifests: Send + Sync + Clone

Cloned on each cache invalidation. If this type is expensive to clone, place it behind an [Arc].

Source

type Extra: Send + Sync

Source

type BoneMesh

Source

type ModelEntryFuture<const N: usize>: ModelEntryFuture<N>

Required Methods§

Source

fn load_spec() -> Result<Self::Manifests, Error>

Initialize all the specifications for this Body.

Source

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Determine whether the cache’s manifest was reloaded

Source

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.

Implementations on Foreign Types§

Source§

impl BodySpec for Body

Source§

type Spec = ItemDropSpec

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type Extra = ()

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Source§

impl BodySpec for Body

Source§

type Spec = ObjectSpec

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type Extra = ()

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Source§

impl BodySpec for Body

Source§

type BoneMesh = (Dyna<Block, ()>, Vec3<f32>)

Source§

type Extra = ()

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type ModelEntryFuture<const N: usize> = TerrainModelEntryFuture<N>

Source§

type Spec = ShipSpec

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<Self::BoneMesh>; 16]

Source§

impl BodySpec for Body

Source§

type Spec = ArthropodSpec

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type Extra = ()

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Source§

impl BodySpec for Body

Source§

type Spec = BipedLargeSpec

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type Extra = ()

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Source§

impl BodySpec for Body

Source§

type Spec = BipedSmallSpec

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type Extra = ()

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Source§

impl BodySpec for Body

Source§

type Spec = BirdLargeSpec

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type Extra = ()

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Source§

impl BodySpec for Body

Source§

type Spec = BirdMediumSpec

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type Extra = ()

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Source§

impl BodySpec for Body

Source§

type Spec = CrustaceanSpec

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type Extra = ()

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Source§

impl BodySpec for Body

Source§

type Spec = DragonSpec

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type Extra = ()

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Source§

impl BodySpec for Body

Source§

type Spec = FishMediumSpec

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type Extra = ()

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Source§

impl BodySpec for Body

Source§

type Spec = FishSmallSpec

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type Extra = ()

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Source§

impl BodySpec for Body

Source§

type Spec = GolemSpec

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type Extra = ()

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Source§

impl BodySpec for Body

Source§

type Spec = HumSpec

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type Extra = ()

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Source§

impl BodySpec for Body

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type Extra = ()

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

type Spec = PluginBoneSpec

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( key: &FigureKey<Self>, manifests: &Self::Manifests, _extra: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Source§

impl BodySpec for Body

Source§

type Spec = QuadrupedLowSpec

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type Extra = ()

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Source§

impl BodySpec for Body

Source§

impl BodySpec for Body

Source§

type Spec = QuadrupedSmallSpec

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type Extra = ()

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Source§

impl BodySpec for Body

Source§

type Spec = TheropodSpec

Source§

type Manifests = &'static Handle<<Body as BodySpec>::Spec>

Source§

type Extra = ()

Source§

type BoneMesh = (Dyna<Cell, ()>, Vec3<f32>)

Source§

type ModelEntryFuture<const N: usize> = FigureModelEntryFuture<N>

Source§

fn load_spec() -> Result<Self::Manifests, Error>

Source§

fn reload_watcher(manifests: &Self::Manifests) -> ReloadWatcher

Source§

fn bone_meshes( _: &FigureKey<Self>, manifests: &Self::Manifests, _: Self::Extra, ) -> [Option<BoneMeshes>; 16]

Implementors§