summaryrefslogtreecommitdiff
path: root/src/sim/entity/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim/entity/mod.rs')
-rw-r--r--src/sim/entity/mod.rs22
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 {