Add Body::collider_shape method

This commit is contained in:
Ludvig Böklin 2021-05-19 14:21:14 +02:00
parent 7d4167970b
commit 545d04544a

View File

@ -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 {