From da45c5a7dbb017c8e579d0ab66a2259a70b28f40 Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Sun, 23 Aug 2026 14:33:23 -0700 Subject: input manager --- src/sim/entity/mod.rs | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src/sim/entity') diff --git a/src/sim/entity/mod.rs b/src/sim/entity/mod.rs index 044d07c..2a046c5 100644 --- a/src/sim/entity/mod.rs +++ b/src/sim/entity/mod.rs @@ -126,21 +126,19 @@ impl<'a> EntityUpdateCtx<'a> { } impl EntityData { - pub fn transform(&self, ctx: &SimCtx) -> Option<(Vec2, (f32, f32))> { + pub fn _transform(&self, rb_manager: &RbManager) -> Option<(Vec2, (f32, f32))> { self.rb_h.and_then(|rb_h| { - ctx.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() * CELLS_TO_METRES, + (rb.rotation().cos(), rb.rotation().sin()), + ) + }) }) } + pub fn transform(&self, ctx: &SimCtx) -> Option<(Vec2, (f32, f32))> { + self._transform(ctx.rb_manager) + } } pub struct Entity { -- cgit v1.3.1