mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-25 16:28:42 -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"
|
hashbrown = "0.13"
|
||||||
noise = "0.8"
|
noise = "0.8"
|
||||||
rayon = "1.6"
|
rayon = "1.6"
|
||||||
|
#ordered-float = "3.4"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
|
|
@ -23,9 +23,17 @@ impl BasicPhysicsActor {
|
||||||
self.position += self.velocity;
|
self.position += self.velocity;
|
||||||
loop {
|
loop {
|
||||||
let block_pos = self.position.floor().as_ivec3();
|
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) {
|
if let Some(block) = world.try_get(block_pos) {
|
||||||
match block.descriptor().collision {
|
match block.descriptor().collision {
|
||||||
Some(super::blocks::CollisionType::Solid) => {
|
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
|
//todo compute restitution here
|
||||||
}
|
}
|
||||||
_ => break
|
_ => break
|
||||||
|
|
Loading…
Reference in a new issue