Fixed faulty timestep
This commit is contained in:
@@ -6,6 +6,12 @@ fn main() {
|
||||
// create a sim loop
|
||||
let mut sim = Loop::new();
|
||||
|
||||
// set the loop update interval
|
||||
sim.set_update_interval(40);
|
||||
|
||||
// set the loop's timescale
|
||||
sim.get_state_mut().set_timescale(1.0);
|
||||
|
||||
// datastream
|
||||
let mut x: i32 = 0;
|
||||
|
||||
@@ -16,12 +22,16 @@ fn main() {
|
||||
|
||||
// update logic goes here
|
||||
if sim.is_awake() {
|
||||
//sim.get_state().debug_time();
|
||||
|
||||
x += 1;
|
||||
println!("x: {}", x);
|
||||
|
||||
//x += 1;
|
||||
//println!("x: {}", x);
|
||||
}
|
||||
sim.get_state().debug_time();
|
||||
|
||||
// display logic goes here
|
||||
// problem: the timestep is not what we want here. we need to get the elapsed time
|
||||
//let timestep = sim.get_state().get_timestep();
|
||||
//let x_interpolated: f32 = x as f32 + timestep;
|
||||
//println!("x: {}", x_interpolated);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user