diff --git a/src/body.rs b/src/body.rs index 7ac03134..8cb2a455 100644 --- a/src/body.rs +++ b/src/body.rs @@ -278,11 +278,11 @@ impl RelativeCollision { pub type TIME = i64; impl Body { - pub fn with_position(position:glam::Vec3) -> Self { + pub fn with_pva(position:glam::Vec3,velocity:glam::Vec3,acceleration:glam::Vec3) -> Self { Self{ - position: position, - velocity: glam::Vec3::ZERO, - acceleration: glam::Vec3::ZERO, + position, + velocity, + acceleration, time: 0, } } diff --git a/src/main.rs b/src/main.rs index 55c8184c..551dbef3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -292,7 +292,7 @@ impl strafe_client::framework::Example for Skybox { controls:0, }; let physics = strafe_client::body::PhysicsState { - body: strafe_client::body::Body::with_position(glam::Vec3::new(5.0,5.0,5.0)), + body: strafe_client::body::Body::with_pva(glam::vec3(0.0,50.0,0.0),glam::vec3(0.0,0.0,0.0),glam::vec3(0.0,-100.0,0.0)), time: 0, tick: 0, strafe_tick_num: 100,//100t