
# Objective - bevy_render is gargantuan ## Solution - Split out bevy_mesh ## Testing - Ran some examples, everything looks fine ## Migration Guide `bevy_render::mesh::morph::inherit_weights` is now `bevy_render::mesh::inherit_weights` if you were using `Mesh::compute_aabb`, you will need to `use bevy_render::mesh::MeshAabb;` now --------- Co-authored-by: Joona Aalto <jondolf.dev@gmail.com>
42 lines
1.0 KiB
Rust
42 lines
1.0 KiB
Rust
use bevy_asset::{Asset, Handle};
|
|
use bevy_ecs::{
|
|
component::Component,
|
|
entity::{Entity, VisitEntities, VisitEntitiesMut},
|
|
prelude::ReflectComponent,
|
|
reflect::{ReflectMapEntities, ReflectVisitEntities, ReflectVisitEntitiesMut},
|
|
};
|
|
use bevy_math::Mat4;
|
|
use bevy_reflect::prelude::*;
|
|
use core::ops::Deref;
|
|
|
|
#[derive(Component, Debug, Default, Clone, Reflect, VisitEntities, VisitEntitiesMut)]
|
|
#[reflect(
|
|
Component,
|
|
MapEntities,
|
|
VisitEntities,
|
|
VisitEntitiesMut,
|
|
Default,
|
|
Debug
|
|
)]
|
|
pub struct SkinnedMesh {
|
|
#[visit_entities(ignore)]
|
|
pub inverse_bindposes: Handle<SkinnedMeshInverseBindposes>,
|
|
pub joints: Vec<Entity>,
|
|
}
|
|
|
|
#[derive(Asset, TypePath, Debug)]
|
|
pub struct SkinnedMeshInverseBindposes(Box<[Mat4]>);
|
|
|
|
impl From<Vec<Mat4>> for SkinnedMeshInverseBindposes {
|
|
fn from(value: Vec<Mat4>) -> Self {
|
|
Self(value.into_boxed_slice())
|
|
}
|
|
}
|
|
|
|
impl Deref for SkinnedMeshInverseBindposes {
|
|
type Target = [Mat4];
|
|
fn deref(&self) -> &Self::Target {
|
|
&self.0
|
|
}
|
|
}
|