kitgit

tirbofish/dropbear · commit

a4fcd53f9d5e9eba3a4506ece2aa11e324f3e2af

wip: dealing with physics-based fix

Unverified

Thribhu K <4tkbytes@pm.me> · 2026-04-01 09:24

view full diff

diff --git a/Cargo.toml b/Cargo.toml
index 776ed78..d44e929 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -31,13 +31,13 @@ egui_dock = { git = "https://github.com/enomado/egui_dock", branch = "update-egu
 egui_extras = { version = "0.34", features = ["all_loaders"] }
 egui_ltreeview = { git = "https://github.com/LennysLounge/egui_ltreeview", features = ["doc"] }
 egui_plot = "0.35"
-transform-gizmo-egui = { git = "https://github.com/tirbofish/transform-gizmo" }
+transform-gizmo-egui = { version = "0.9" }
 
 env_logger = "0.11"
 futures = "0.3"
 gilrs = "0.11"
 git2 = { version = "0.20", features = ["vendored-openssl"] }
-glam = { version = "0.30", features = ["serde", "mint", "bytemuck", "rkyv", "bytecheck"] } # required to be at 0.30 because of rapier3d not being updated yet
+glam = { version = "0.30", features = ["serde", "mint", "bytemuck", "rkyv", "bytechec"] } # required to be at 0.30 because of rapier3d not being updated yet
 hecs = { version = "0.11", features = ["serde"] }
 log = "0.4"
 log-once = "0.4"
diff --git a/crates/dropbear-engine/src/pipelines/animation.rs b/crates/dropbear-engine/src/pipelines/animation.rs
index 80b1b87..b8a4417 100644
--- a/crates/dropbear-engine/src/pipelines/animation.rs
+++ b/crates/dropbear-engine/src/pipelines/animation.rs
@@ -1,7 +1,5 @@
 use std::sync::Arc;
 use glam::{Mat4};
-use wgpu::util::DeviceExt;
-use dropbear_utils::Dirty;
 use crate::animation::{MorphTargetInfo, MAX_MORPH_WEIGHTS, MAX_SKINNING_MATRICES};
 use crate::buffer::{StorageBuffer, UniformBuffer};
 use crate::graphics::SharedGraphicsContext;
diff --git a/crates/eucalyptus-core/src/hierarchy.rs b/crates/eucalyptus-core/src/hierarchy.rs
index 656c137..87e1a4a 100644
--- a/crates/eucalyptus-core/src/hierarchy.rs
+++ b/crates/eucalyptus-core/src/hierarchy.rs
@@ -165,13 +165,13 @@ impl EntityTransformExt for EntityTransform {
             let parent_entity = parent_comp.parent();
 
             if let Ok(parent_transform) = world.get::<&EntityTransform>(parent_entity) {
-                let parent_world = parent_transform.world();
+                let parent_synced = parent_transform.sync();
 
                 result = Transform {
-                    position: parent_world.position
-                        + parent_world.rotation * (result.position * parent_world.scale),
-                    rotation: parent_world.rotation * result.rotation,
-                    scale: parent_world.scale * result.scale,
+                    position: parent_synced.position
+                        + parent_synced.rotation * (result.position * parent_synced.scale),
+                    rotation: parent_synced.rotation * result.rotation,
+                    scale: parent_synced.scale * result.scale,
                 };
             }
 
diff --git a/crates/eucalyptus-editor/src/editor/mod.rs b/crates/eucalyptus-editor/src/editor/mod.rs
index e8762cb..86f17af 100644
--- a/crates/eucalyptus-editor/src/editor/mod.rs
+++ b/crates/eucalyptus-editor/src/editor/mod.rs
@@ -19,7 +19,7 @@ use crate::plugin::PluginRegistry;
 use crate::stats::NerdStats;
 use crossbeam_channel::{Receiver, Sender, unbounded};
 use docks::console::EucalyptusConsole;
-use dropbear_engine::animation::{MAX_MORPH_WEIGHTS, MorphTargetInfo};
+use dropbear_engine::animation::MorphTargetInfo;
 use dropbear_engine::billboarding::BillboardPipeline;
 use dropbear_engine::buffer::ResizableBuffer;
 use dropbear_engine::entity::EntityTransform;
@@ -68,12 +68,10 @@ use std::rc::Rc;
 use std::{collections::HashMap, path::PathBuf, sync::Arc, time::Instant};
 use tokio::sync::oneshot;
 use transform_gizmo_egui::{EnumSet, Gizmo, GizmoMode, GizmoOrientation};
-use wgpu::util::DeviceExt;
 use wgpu::{Color, Extent3d};
 use winit::dpi::PhysicalSize;
 use winit::window::{CursorGrabMode, WindowAttributes};
 use winit::{keyboard::KeyCode, window::Window};
-use dropbear_engine::model::Animation;
 use dropbear_engine::pipelines::animation::AnimationDefaults;
 
 pub struct Editor {
diff --git a/scripting/commonMain/kotlin/com/dropbear/logging/Logger.kt b/scripting/commonMain/kotlin/com/dropbear/logging/Logger.kt
index f32db8c..51e655c 100644
--- a/scripting/commonMain/kotlin/com/dropbear/logging/Logger.kt
+++ b/scripting/commonMain/kotlin/com/dropbear/logging/Logger.kt
@@ -77,23 +77,4 @@ object Logger {
     }
 }
 
-internal expect fun getCallerInfo(): String
-
-/**
- * Extension function to log and return a value if the value is null.
- *
- * # Example
- * ```
- * val room1Sensor = engine
- *     .getEntity("room1_sensor")
- *     ?.getComponent(ColliderGroup)
- *     ?.getColliders()
- *     .orLogAndReturn("room1_sensor missing") { return } // returns if the value is null
- * ```
- */
-inline fun <T> T?.orLogAndReturn(msg: String, returnBlock: () -> Nothing): T {
-    return this ?: run {
-        Logger.warn(msg)
-        returnBlock()
-    }
-}
\ No newline at end of file
+internal expect fun getCallerInfo(): String
\ No newline at end of file
diff --git a/scripting/nativeMain/kotlin/com/dropbear/logging/LoggerUtils.kt b/scripting/nativeMain/kotlin/com/dropbear/logging/LoggerUtils.kt
new file mode 100644
index 0000000..873b8b0
--- /dev/null
+++ b/scripting/nativeMain/kotlin/com/dropbear/logging/LoggerUtils.kt
@@ -0,0 +1,20 @@
+package com.dropbear.logging
+
+/**
+ * Extension function to log and return a value if the value is null.
+ *
+ * # Example
+ * ```
+ * val room1Sensor = engine
+ *     .getEntity("room1_sensor")
+ *     ?.getComponent(ColliderGroup)
+ *     ?.getColliders()
+ *     .orLogAndReturn("room1_sensor missing") { return } // returns if the value is null
+ * ```
+ */
+inline fun <T> T?.orLogAndReturn(msg: String, returnBlock: () -> Nothing): T {
+    return this ?: run {
+        Logger.warn(msg)
+        returnBlock()
+    }
+}
\ No newline at end of file