tirbofish/dropbear · diff
wip: dealing with physics-based fix
Signature present but could not be verified.
Unverified
@@ -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" @@ -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; @@ -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, }; } @@ -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 { @@ -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() - } -} +internal expect fun getCallerInfo(): String @@ -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() + } +}