tirbofish/dropbear · diff
feature: TRS (translation, rotation, scale) animation implemented
fix: use string id instead of typeid for storing editor tab IDs
Signature present but could not be verified.
Unverified
@@ -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 { @@ -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 @@ -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