mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add Body::collider_shape method
This commit is contained in:
parent
7d4167970b
commit
545d04544a
@ -16,6 +16,7 @@ pub mod theropod;
|
||||
|
||||
use crate::{
|
||||
assets::{self, Asset},
|
||||
comp::Collider,
|
||||
consts::{HUMAN_DENSITY, WATER_DENSITY},
|
||||
make_case_elim,
|
||||
npc::NpcKind,
|
||||
@ -399,6 +400,14 @@ impl Body {
|
||||
|
||||
pub fn height(&self) -> f32 { self.dimensions().z }
|
||||
|
||||
pub fn collider_shape(&self) -> Collider {
|
||||
Collider::Box {
|
||||
radius: self.radius(),
|
||||
z_min: 0.0,
|
||||
z_max: self.height(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn base_energy(&self) -> u32 {
|
||||
match self {
|
||||
Body::BipedLarge(biped_large) => match biped_large.species {
|
||||
|
Loading…
Reference in New Issue
Block a user