diff options
| author | Kai Stevenson <kai@kaistevenson.com> | 2026-08-23 14:33:23 -0700 |
|---|---|---|
| committer | Kai Stevenson <kai@kaistevenson.com> | 2026-08-23 14:33:23 -0700 |
| commit | da45c5a7dbb017c8e579d0ab66a2259a70b28f40 (patch) | |
| tree | 938c0be6bd6b938cb8788456ce759b784ee74f5c /src/sim/entity/mod.rs | |
| parent | c4c26f03e3eb18a76f9c2756076030dc52a667fa (diff) | |
input manager
Diffstat (limited to 'src/sim/entity/mod.rs')
| -rw-r--r-- | src/sim/entity/mod.rs | 22 |
1 files changed, 10 insertions, 12 deletions
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 { |
