added simulate bool
This commit is contained in:
parent
c90ed3fb00
commit
af98bc2fa6
@ -16,6 +16,8 @@ struct PhysicsObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
let mut simulate: bool = true;
|
||||||
|
|
||||||
// global time
|
// global time
|
||||||
let mut time = Duration::new(0,0);
|
let mut time = Duration::new(0,0);
|
||||||
|
|
||||||
@ -24,12 +26,12 @@ fn main() {
|
|||||||
|
|
||||||
// create a test physics object
|
// create a test physics object
|
||||||
let mut test_object = PhysicsObject {
|
let mut test_object = PhysicsObject {
|
||||||
location: [0.0, 0.0, 100.0],
|
location: [0.0, 0.0, 10.0],
|
||||||
velocity: [0.0, 5.0, 0.0],
|
velocity: [0.0, 5.0, 0.0],
|
||||||
gravity_enabled: true
|
gravity_enabled: true
|
||||||
};
|
};
|
||||||
|
|
||||||
loop {
|
while simulate {
|
||||||
// start timing the loop
|
// start timing the loop
|
||||||
let start_time = Instant::now();
|
let start_time = Instant::now();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user