diff --git a/src/physics.rs b/src/physics.rs index 063c886..2e9ef36 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -738,13 +738,13 @@ impl Default for TouchingState{ } } -impl Body { - pub fn with_pva(position:Planar64Vec3,velocity:Planar64Vec3,acceleration:Planar64Vec3) -> Self { +impl Body{ + pub fn new(position:Planar64Vec3,velocity:Planar64Vec3,acceleration:Planar64Vec3,time:Time)->Self{ Self{ position, velocity, acceleration, - time:Time::ZERO, + time, } } pub fn extrapolated_position(&self,time:Time)->Planar64Vec3{ @@ -771,7 +771,7 @@ impl Default for PhysicsState{ fn default()->Self{ Self{ spawn_point:Planar64Vec3::int(0,50,0), - body:Body::with_pva(Planar64Vec3::int(0,50,0),Planar64Vec3::int(0,0,0),Planar64Vec3::int(0,-100,0)), + body:Body::new(Planar64Vec3::int(0,50,0),Planar64Vec3::int(0,0,0),Planar64Vec3::int(0,-100,0),Time::ZERO), time:Time::ZERO, style:StyleModifiers::default(), touching:TouchingState::default(), diff --git a/src/worker.rs b/src/worker.rs index 91253d5..44ea0b0 100644 --- a/src/worker.rs +++ b/src/worker.rs @@ -177,8 +177,8 @@ impl<'a,Task:Send+'a> INWorker<'a,Task>{ fn test_worker() { println!("hiiiii"); // Create the worker thread - let worker=QRWorker::new(crate::physics::Body::with_pva(crate::integer::Planar64Vec3::ZERO,crate::integer::Planar64Vec3::ZERO,crate::integer::Planar64Vec3::ZERO), - |_|crate::physics::Body::with_pva(crate::integer::Planar64Vec3::ONE,crate::integer::Planar64Vec3::ONE,crate::integer::Planar64Vec3::ONE) + let worker=QRWorker::new(crate::physics::Body::default(), + |_|crate::physics::Body::new(crate::integer::Planar64Vec3::ONE,crate::integer::Planar64Vec3::ONE,crate::integer::Planar64Vec3::ONE,crate::integer::Time::ZERO) ); // Send tasks to the worker