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::{
|
use crate::{
|
||||||
assets::{self, Asset},
|
assets::{self, Asset},
|
||||||
|
comp::Collider,
|
||||||
consts::{HUMAN_DENSITY, WATER_DENSITY},
|
consts::{HUMAN_DENSITY, WATER_DENSITY},
|
||||||
make_case_elim,
|
make_case_elim,
|
||||||
npc::NpcKind,
|
npc::NpcKind,
|
||||||
@ -399,6 +400,14 @@ impl Body {
|
|||||||
|
|
||||||
pub fn height(&self) -> f32 { self.dimensions().z }
|
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 {
|
pub fn base_energy(&self) -> u32 {
|
||||||
match self {
|
match self {
|
||||||
Body::BipedLarge(biped_large) => match biped_large.species {
|
Body::BipedLarge(biped_large) => match biped_large.species {
|
||||||
|
Loading…
Reference in New Issue
Block a user