forked from StrafesNET/strafe-client
tweaks
This commit is contained in:
parent
543ff75be9
commit
e936be4f3c
@ -642,8 +642,8 @@ impl crate::instruction::InstructionConsumer<PhysicsInstruction> 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 {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user