replace Body::with_pva with Body::new

This commit is contained in:
Quaternions 2023-10-26 15:50:42 -07:00
parent 9f76611c18
commit f8a8cbf12a
2 changed files with 6 additions and 6 deletions

View File

@ -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(),

View File

@ -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