mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-29 02:08:48 -06:00
khkhyvctyctcggc
This commit is contained in:
parent
cd20b4ae32
commit
3a446b675b
|
@ -16,6 +16,7 @@ glam = { version = "0.22", features = ["debug-glam-assert", "mint", "fast-math"]
|
|||
hashbrown = "0.13"
|
||||
noise = "0.8"
|
||||
rayon = "1.6"
|
||||
#ordered-float = "3.4"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
|
|
@ -23,9 +23,17 @@ impl BasicPhysicsActor {
|
|||
self.position += self.velocity;
|
||||
loop {
|
||||
let block_pos = self.position.floor().as_ivec3();
|
||||
let block_pos_f = block_pos.as_vec3a();
|
||||
if let Some(block) = world.try_get(block_pos) {
|
||||
match block.descriptor().collision {
|
||||
Some(super::blocks::CollisionType::Solid) => {
|
||||
let position_delta = self.position - block_pos_f;
|
||||
let distance_to_zero = position_delta.abs();
|
||||
let distance_to_one = (vec3a(1., 1., 1.) - position_delta).abs();
|
||||
|
||||
// let mut max_distance = 0;
|
||||
// let mut max_distance_normal = 0;
|
||||
// distance_to_one.x
|
||||
//todo compute restitution here
|
||||
}
|
||||
_ => break
|
||||
|
|
Loading…
Reference in a new issue