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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl BodySpec for Body

§

type Spec = ItemDropSpec

§

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

§

type Extra = ()

§

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

§

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

§

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>

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

§

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

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

§

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>

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

§

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>

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

§

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>

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

§

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>

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

§

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>

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

§

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>

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

§

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>

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

§

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>

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

§

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>

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

§

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>

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

§

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>

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

§

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>

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

§

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>

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

§

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>

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

§

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>

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§