From e936be4f3c533521c0591b2b9a87d9befcc0dfca Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 18 Sep 2023 13:45:17 -0700 Subject: [PATCH] tweaks --- src/body.rs | 4 ++-- src/main.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/body.rs b/src/body.rs index 2658ae4..5e22f15 100644 --- a/src/body.rs +++ b/src/body.rs @@ -642,8 +642,8 @@ impl crate::instruction::InstructionConsumer for PhysicsStat match ins.instruction { PhysicsInstruction::CollisionStart(c) => { //flatten v - let n=c.normal(&self.models_cringe_clone).normalize(); - let d=self.body.velocity.dot(n); + let n=c.normal(&self.models_cringe_clone); + let d=self.body.velocity.dot(n)/n.length_squared(); self.body.velocity-=d*n; //check ground match c.face { diff --git a/src/main.rs b/src/main.rs index 211ebbb..c6c35ad 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_position(glam::Vec3::new(5.0,2.0,5.0)), time: 0, tick: 0, strafe_tick_num: 100,//100t