Skip to content

Commit

Permalink
#230: Fixed heli bobbing
Browse files Browse the repository at this point in the history
  • Loading branch information
ozkriff committed Nov 12, 2016
1 parent ea9fff8 commit f3db665
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tactical_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ impl TacticalScreen {
}
}

fn bobble_helicopters(&mut self, context: &Context) {
fn bobble_helicopters(&mut self, context: &Context, dtime: Time) {
let player_info = self.player_info.get_mut(self.core.player_id());
let state = &player_info.game_state;
let scene = &mut player_info.scene;
Expand All @@ -577,7 +577,7 @@ impl TacticalScreen {
let node_id = scene.unit_id_to_node_id(unit.id);
let node = scene.node_mut(node_id);
let n = context.current_time().n + unit.id.id as f32;
node.pos.v.z += (n * 1.5).sin() * 0.005;
node.pos.v.z += (n * 1.5).sin() * 0.4 * dtime.n;
}
}
}
Expand Down Expand Up @@ -1263,7 +1263,7 @@ impl Screen for TacticalScreen {
fn tick(&mut self, context: &mut Context, dtime: Time) {
self.logic(context);
self.draw(context, dtime);
self.bobble_helicopters(context);
self.bobble_helicopters(context, dtime);
self.update_fow(dtime);
self.handle_context_menu_popup_commands(context);
}
Expand Down

0 comments on commit f3db665

Please sign in to comment.