mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Made physics cheaper still
This commit is contained in:
parent
6444ba1933
commit
acb184e15d
@ -1,4 +1,4 @@
|
||||
#![type_length_limit = "1652471"]
|
||||
#![type_length_limit = "1664759"]
|
||||
#![feature(
|
||||
euclidean_division,
|
||||
duration_float,
|
||||
|
@ -145,12 +145,15 @@ impl<'a> System<'a> for Sys {
|
||||
vel.0 = integrate_forces(dt.0, vel.0, friction);
|
||||
|
||||
// Basic collision with terrain
|
||||
let player_rad = 0.3; // half-width of the player's AABB
|
||||
let player_height = 1.7;
|
||||
let player_rad = 0.3f32; // half-width of the player's AABB
|
||||
let player_height = 1.55f32;
|
||||
|
||||
let dist = 2; // distance to probe the terrain for collisions
|
||||
let near_iter = (-dist..=dist)
|
||||
.map(move |i| (-dist..=dist).map(move |j| (-dist..=dist).map(move |k| (i, j, k))))
|
||||
// Probe distances
|
||||
let hdist = player_rad.ceil() as i32;
|
||||
let vdist = player_height.ceil() as i32;
|
||||
// Neighbouring blocks iterator
|
||||
let near_iter = (-hdist..=hdist)
|
||||
.map(move |i| (-hdist..=hdist).map(move |j| (0..=vdist).map(move |k| (i, j, k))))
|
||||
.flatten()
|
||||
.flatten();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user