mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Added maximum vertical angle for shockwave.
This commit is contained in:
parent
d0f068ba63
commit
6a1acd47a1
@ -225,7 +225,7 @@ void main() {
|
||||
sin(lifetime * 3.0 + rand1) + sin(lifetime * 8.0 + rand4) * 0.3,
|
||||
sin(lifetime * 2.0 + rand2) + sin(lifetime * 9.0 + rand5) * 0.3
|
||||
),
|
||||
raise,
|
||||
vec3(raise),
|
||||
vec4(vec3(5, 5, 1.1), 1),
|
||||
spin_in_axis(vec3(rand6, rand7, rand8), rand9 * 3 + lifetime * 5)
|
||||
);
|
||||
@ -237,7 +237,7 @@ void main() {
|
||||
sin(lifetime * 3.0 + rand1) + sin(lifetime * 10.0 + rand4) * 0.3,
|
||||
sin(lifetime * 4.0 + rand2) + sin(lifetime * 11.0 + rand5) * 0.3
|
||||
) * 0.5,
|
||||
lower,
|
||||
vec3(lower),
|
||||
vec4(vec3(1, 0.7, 0), 1),
|
||||
spin_in_axis(vec3(rand6, rand7, rand8), rand9 * 3 + lifetime * 5)
|
||||
);
|
||||
|
@ -267,7 +267,6 @@ impl LoadoutBuilder {
|
||||
Self::default_item_config_from_item(Item::new_from_asset_expect(item_ref))
|
||||
}
|
||||
|
||||
|
||||
pub fn active_item(mut self, item: Option<ItemConfig>) -> Self {
|
||||
self.0.active_item = item;
|
||||
|
||||
|
@ -155,6 +155,10 @@ impl<'a> System<'a> for Sys {
|
||||
let scale_b = scale_b_maybe.map_or(1.0, |s| s.0);
|
||||
let rad_b = body_b.radius() * scale_b;
|
||||
|
||||
// Angle checks
|
||||
let pos_b_ground = Vec3::new(pos_b.0.x, pos_b.0.y, pos.0.z);
|
||||
let max_angle = 15.0_f32.to_radians();
|
||||
|
||||
// Check if it is a hit
|
||||
let hit = entity != b
|
||||
&& !stats_b.is_dead
|
||||
@ -169,6 +173,7 @@ impl<'a> System<'a> for Sys {
|
||||
arc_strip.collides_with_circle(Circle { pos, radius: rad_b })
|
||||
})
|
||||
}
|
||||
&& (pos_b_ground - pos.0).angle_between(pos_b.0 - pos.0) < max_angle
|
||||
&& (!shockwave.requires_ground || physics_state_b.on_ground);
|
||||
|
||||
if hit {
|
||||
|
Loading…
x
Reference in New Issue
Block a user