From 5bedb15c61ad26824dbe6053f0b66b11b6ad5047 Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Sun, 23 Aug 2026 23:35:57 -0700 Subject: fix scaling --- src/sim/entity/mod.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/sim/entity') diff --git a/src/sim/entity/mod.rs b/src/sim/entity/mod.rs index a86a51f..af4f0dd 100644 --- a/src/sim/entity/mod.rs +++ b/src/sim/entity/mod.rs @@ -5,7 +5,7 @@ use rapier2d::{ }; use crate::{ - config::{CELLS_TO_METRES, MASS_SCALING}, + config::MASS_SCALING, content::materials::MaterialId, sim::{ cell::Cell, lib::marching_squares::Marchable, rb_manager::RbManager, sim_manager::SimCtx, @@ -90,9 +90,7 @@ impl EntityDef { cells: EntityCells, behaviour: Option>, ) -> Self { - let rb = RigidBodyBuilder::dynamic() - .translation(position / CELLS_TO_METRES) - .build(); + let rb = RigidBodyBuilder::dynamic().translation(position).build(); let collider = RbManager::convex_hull_collider_from_marchable(&cells, Some(10)) .mass(mass_from_cells(&cells.cells)) @@ -146,12 +144,12 @@ impl<'a> EntityUpdateCtx<'a> { impl EntityData { pub fn _transform(&self, rb_manager: &RbManager) -> Option<(Vec2, (f32, f32))> { self.rb_h.and_then(|rb_h| { - rb_manager.physics_manager.world.bodies.get(rb_h).map(|rb| { - ( - rb.translation() * CELLS_TO_METRES, - (rb.rotation().cos(), rb.rotation().sin()), - ) - }) + rb_manager + .physics_manager + .world + .bodies + .get(rb_h) + .map(|rb| (rb.translation(), (rb.rotation().cos(), rb.rotation().sin()))) }) } pub fn transform(&self, ctx: &SimCtx) -> Option<(Vec2, (f32, f32))> { -- cgit v1.3.1