tirbofish/dropbear · commit
a237d8760e0bedebc3749754eadda0823bc927e4
fix: animation header fix
Signature present but could not be verified.
Unverified
@@ -0,0 +1,535 @@ +use std::sync::Arc; +use egui::{CollapsingHeader, ComboBox, Ui}; +use hecs::{Entity, World}; +use dropbear_engine::animation::{AnimationComponent, AnimationSettings}; +use dropbear_engine::asset::ASSET_REGISTRY; +use dropbear_engine::entity::MeshRenderer; +use dropbear_engine::graphics::SharedGraphicsContext; +use jni::objects::JObject; +use jni::JNIEnv; +use crate::component::{Component, ComponentDescriptor, InspectableComponent, SerializedComponent}; +use crate::ptr::WorldPtr; +use crate::scripting::jni::utils::ToJObject; +use crate::scripting::native::DropbearNativeError; +use crate::scripting::result::DropbearNativeResult; + +#[typetag::serde] +impl SerializedComponent for AnimationComponent {} + +impl Component for AnimationComponent { + type SerializedForm = Self; + type RequiredComponentTypes = (Self, ); + + fn descriptor() -> ComponentDescriptor { + ComponentDescriptor { + fqtn: "dropbear_engine::animation::AnimationComponent".to_string(), + type_name: "AnimationComponent".to_string(), + category: Some("Animation".to_string()), + description: Some("Animates a 3D MeshRenderer".to_string()), + } + } + + fn init<'a>( + ser: &'a Self::SerializedForm, + _graphics: Arc<SharedGraphicsContext>, + ) -> crate::component::ComponentInitFuture<'a, Self> { + Box::pin(async move { Ok((ser.clone(), )) }) + } + + fn update_component(&mut self, world: &World, _physics: &mut crate::physics::PhysicsState, entity: Entity, dt: f32, graphics: Arc<SharedGraphicsContext>) { + let Ok(renderer) = world.get::<&MeshRenderer>(entity) else { + return; + }; + + let handle = renderer.model();
Large diffs are not rendered by default. Showing the first 50 of 1191 lines. Show full diff