mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
cargo fmt
This commit is contained in:
parent
171113ea74
commit
9e9cbd290b
@ -413,24 +413,26 @@ impl Body {
|
||||
}
|
||||
|
||||
// How far away other entities should try to be. Will be added uppon the other
|
||||
// entitys spacing_radius. So an entity with 2.0 and an entity with 3.0 will lead
|
||||
// to that both entities will try to keep 5.0 units away from each other.
|
||||
// entitys spacing_radius. So an entity with 2.0 and an entity with 3.0 will
|
||||
// lead to that both entities will try to keep 5.0 units away from each
|
||||
// other.
|
||||
pub fn spacing_radius(&self) -> f32 {
|
||||
self.radius() + match self {
|
||||
Body::QuadrupedSmall(body) => match body.species {
|
||||
quadruped_small::Species::Rat => 0.0,
|
||||
_ => 2.0,
|
||||
},
|
||||
Body::QuadrupedLow(body) => match body.species {
|
||||
quadruped_low::Species::Hakulaq => 0.0,
|
||||
self.radius()
|
||||
+ match self {
|
||||
Body::QuadrupedSmall(body) => match body.species {
|
||||
quadruped_small::Species::Rat => 0.0,
|
||||
_ => 2.0,
|
||||
},
|
||||
Body::QuadrupedLow(body) => match body.species {
|
||||
quadruped_low::Species::Hakulaq => 0.0,
|
||||
_ => 2.0,
|
||||
},
|
||||
Body::BipedSmall(body) => match body.species {
|
||||
biped_small::Species::Husk => 3.0,
|
||||
_ => 2.0,
|
||||
},
|
||||
_ => 2.0,
|
||||
}
|
||||
Body::BipedSmall(body) => match body.species {
|
||||
biped_small::Species::Husk => 3.0,
|
||||
_ => 2.0,
|
||||
}
|
||||
_ => 2.0,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn height(&self) -> f32 { self.dimensions().z }
|
||||
|
@ -3478,7 +3478,15 @@ impl<'a> AgentData<'a> {
|
||||
.actions
|
||||
.push(ControlAction::basic_input(InputKind::Ability(0)));
|
||||
// Move towards the target slowly
|
||||
self.path_toward_target(agent, controller, tgt_data, read_data, true, false, Some(0.5));
|
||||
self.path_toward_target(
|
||||
agent,
|
||||
controller,
|
||||
tgt_data,
|
||||
read_data,
|
||||
true,
|
||||
false,
|
||||
Some(0.5),
|
||||
);
|
||||
agent.action_state.timer += read_data.dt.0;
|
||||
} else if agent.action_state.timer < 6.0
|
||||
&& attack_data.angle < 90.0
|
||||
@ -4094,7 +4102,8 @@ impl<'a> AgentData<'a> {
|
||||
}
|
||||
self.pos.0
|
||||
+ PARTIAL_PATH_DIST
|
||||
* (sep_vec * SEPARATION_BIAS + (tgt_data.pos.0 - self.pos.0) * (1.0 - SEPARATION_BIAS))
|
||||
* (sep_vec * SEPARATION_BIAS
|
||||
+ (tgt_data.pos.0 - self.pos.0) * (1.0 - SEPARATION_BIAS))
|
||||
.try_normalized()
|
||||
.unwrap_or_else(Vec3::zero)
|
||||
} else if full_path {
|
||||
|
Loading…
Reference in New Issue
Block a user