kitgit

tirbofish/dropbear · diff

479c490 · Thribhu K

feature: TRS (translation, rotation, scale) animation implemented fix: use string id instead of typeid for storing editor tab IDs

Unverified

diff --git a/crates/dropbear-engine/src/bind_groups.rs b/crates/dropbear-engine/src/bind_groups.rs
index 762605a..0304090 100644
--- a/crates/dropbear-engine/src/bind_groups.rs
+++ b/crates/dropbear-engine/src/bind_groups.rs
@@ -40,6 +40,7 @@ impl SceneGlobalsBindGroup {
         globals_buffer: &UniformBuffer<Globals>,
         camera_buffer: &Buffer,
     ) {
+        puffin::profile_function!();
         self.bind_group = graphics
             .device
             .create_bind_group(&wgpu::BindGroupDescriptor {
diff --git a/crates/dropbear-engine/src/entity.rs b/crates/dropbear-engine/src/entity.rs
index 3591582..605e45f 100644
--- a/crates/dropbear-engine/src/entity.rs
+++ b/crates/dropbear-engine/src/entity.rs
@@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
 use std::{collections::HashMap, path::Path, sync::Arc};
 
 use crate::asset::Handle;
-use crate::model::Material;
+use crate::model::{Material, NodeTransform};
 use crate::{
     asset::ASSET_REGISTRY,
     graphics::{Instance, SharedGraphicsContext},
@@ -69,6 +69,13 @@ impl EntityTransform {
             scale: self.world.scale * self.local.scale,
         }
     }
+
+    /// Applies a node transform for TRS animation as an absolute local transform.
+    pub fn apply_animation(&mut self, node_transform: &NodeTransform) {
+        self.local.position = node_transform.translation.as_dvec3();
+        self.local.rotation = node_transform.rotation.as_dquat();
+        self.local.scale = node_transform.scale.as_dvec3();
+    }
 }
 
 /// A type that represents a position, rotation and scale of an entity
diff --git a/crates/dropbear-engine/src/pipelines/hdr.rs b/crates/dropbear-engine/src/pipelines/hdr.rs
index 085951b..2a67108 100644
--- a/crates/dropbear-engine/src/pipelines/hdr.rs
+++ b/crates/dropbear-engine/src/pipelines/hdr.rs
@@ -146,6 +146,7 @@ impl HdrPipeline {
     /// This renders the internal HDR texture to the [TextureView]
     /// supplied as parameter.
     pub fn process(&self, encoder: &mut wgpu::CommandEncoder, output: &wgpu::TextureView) {
+        puffin::profile_function!();
         let mut pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
             label: Some("Hdr::process"),

Large diffs are not rendered by default. Showing the first 50 of 301 lines. Show full diff