This commit is contained in:
Quaternions 2023-09-18 13:45:17 -07:00
parent 543ff75be9
commit e936be4f3c
2 changed files with 3 additions and 3 deletions

View File

@ -642,8 +642,8 @@ impl crate::instruction::InstructionConsumer<PhysicsInstruction> for PhysicsStat
match ins.instruction { match ins.instruction {
PhysicsInstruction::CollisionStart(c) => { PhysicsInstruction::CollisionStart(c) => {
//flatten v //flatten v
let n=c.normal(&self.models_cringe_clone).normalize(); let n=c.normal(&self.models_cringe_clone);
let d=self.body.velocity.dot(n); let d=self.body.velocity.dot(n)/n.length_squared();
self.body.velocity-=d*n; self.body.velocity-=d*n;
//check ground //check ground
match c.face { match c.face {

View File

@ -292,7 +292,7 @@ impl strafe_client::framework::Example for Skybox {
controls:0, controls:0,
}; };
let physics = strafe_client::body::PhysicsState { 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, time: 0,
tick: 0, tick: 0,
strafe_tick_num: 100,//100t strafe_tick_num: 100,//100t