mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixed shadows, better pathfinding cap
This commit is contained in:
parent
f92371101c
commit
7167320c92
@ -66,7 +66,7 @@ float shadow_at(vec3 wpos, vec3 wnorm) {
|
|||||||
|
|
||||||
vec3 diff = shadow_pos - wpos;
|
vec3 diff = shadow_pos - wpos;
|
||||||
if (diff.z >= 0.0) {
|
if (diff.z >= 0.0) {
|
||||||
diff.z = sign(diff.z) * 0.1;
|
diff.z = -sign(diff.z) * diff.z * 0.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
float shade = max(pow(diff.x * diff.x + diff.y * diff.y + diff.z * diff.z, 0.25) / pow(radius * radius * 0.5, 0.25), 0.5);
|
float shade = max(pow(diff.x * diff.x + diff.y * diff.y + diff.z * diff.z, 0.25) / pow(radius * radius * 0.5, 0.25), 0.5);
|
||||||
|
@ -205,7 +205,12 @@ where
|
|||||||
let satisfied = |pos: &Vec3<i32>| pos == &end;
|
let satisfied = |pos: &Vec3<i32>| pos == &end;
|
||||||
|
|
||||||
let mut new_astar = match astar.take() {
|
let mut new_astar = match astar.take() {
|
||||||
None => Astar::new(50000, start, heuristic.clone()),
|
None => {
|
||||||
|
let max_iters = ((Vec2::<f32>::from(start).distance(Vec2::from(end)) + 10.0).powf(2.0)
|
||||||
|
as usize)
|
||||||
|
.min(25_000);
|
||||||
|
Astar::new(max_iters, start, heuristic.clone())
|
||||||
|
}
|
||||||
Some(astar) => astar,
|
Some(astar) => astar,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user