Enum veloren_common::comp::body::Body
source · #[repr(u32)]pub enum Body {
Show 19 variants
Humanoid(Body),
QuadrupedSmall(Body),
QuadrupedMedium(Body),
BirdMedium(Body),
FishMedium(Body),
Dragon(Body),
BirdLarge(Body),
FishSmall(Body),
BipedLarge(Body),
BipedSmall(Body),
Object(Body),
Golem(Body),
Theropod(Body),
QuadrupedLow(Body),
Ship(Body),
Arthropod(Body),
ItemDrop(Body),
Crustacean(Body),
Plugin(Body),
}
Variants§
Humanoid(Body)
QuadrupedSmall(Body)
QuadrupedMedium(Body)
BirdMedium(Body)
FishMedium(Body)
Dragon(Body)
BirdLarge(Body)
FishSmall(Body)
BipedLarge(Body)
BipedSmall(Body)
Object(Body)
Golem(Body)
Theropod(Body)
QuadrupedLow(Body)
Ship(Body)
Arthropod(Body)
ItemDrop(Body)
Crustacean(Body)
Plugin(Body)
Implementations§
source§impl Body
impl Body
pub fn elim<'a, Elim, Context, S, Type>( &'a self, elim: Elim, context: Context, ) -> (Type, S)
pub fn elim_case_pure<'a, Type>(&self, cases: &'a PureCases<Type>) -> &'a Type
pub fn elim_case_weak<'a, 'b, Type>(
&'a self,
cases: &'b ElimWeak<Self, Type>,
) -> &'b Typewhere
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
WeakHead<Body, Type>: SynthTyped<((Body,), ()), Type>,
&'b ElimWeak<Self, Type>: Typed<((&'a Body,), ()), &'b Type, ()>,
source§impl Body
impl Body
pub fn is_same_species_as(&self, other: &Body) -> bool
sourcepub fn heads(&self) -> Option<usize>
pub fn heads(&self) -> Option<usize>
How many heads this body has in the Heads
component if any.
pub fn is_humanoid(&self) -> bool
pub fn is_campfire(&self) -> bool
pub fn is_portal(&self) -> bool
pub fn bleeds(&self) -> bool
sourcepub fn stride_length(&self) -> f32
pub fn stride_length(&self) -> f32
The length of the stride of the body, in metres (not accounting for different legs)
pub fn scale(&self) -> Scale
pub fn mass(&self) -> Mass
sourcepub fn dimensions(&self) -> Vec3<f32>
pub fn dimensions(&self) -> Vec3<f32>
The width (shoulder to shoulder), length (nose to tail) and height respectively (in metres)
pub fn max_radius(&self) -> f32
pub fn front_radius(&self) -> f32
pub fn min_radius(&self) -> f32
sourcepub fn sausage(&self) -> (Vec2<f32>, Vec2<f32>, f32)
pub fn sausage(&self) -> (Vec2<f32>, Vec2<f32>, f32)
Base of our Capsule Prism used for collisions. Returns line segment and radius. See this wiki page.
sourcepub fn spacing_radius(&self) -> f32
pub fn spacing_radius(&self) -> f32
How far away other entities should try to be. Will be added upon the other entity’s 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 base_energy(&self) -> u16
sourcepub fn has_death_protection(&self) -> bool
pub fn has_death_protection(&self) -> bool
If this body will retain 1 hp when it would die, and consume death protection, and entering a downed state.
pub fn base_health(&self) -> u16
pub fn flying_height(&self) -> f32
pub fn immune_to(&self, buff: BuffKind) -> bool
sourcepub fn combat_multiplier(&self) -> f32
pub fn combat_multiplier(&self) -> f32
Returns a multiplier representing increased difficulty not accounted for due to AI or not using an actual weapon
pub fn base_poise(&self) -> u16
sourcepub fn eye_height(&self, scale: f32) -> f32
pub fn eye_height(&self, scale: f32) -> f32
Returns the eye height for this creature.
pub fn default_light_offset(&self) -> Vec3<f32>
pub fn can_strafe(&self) -> bool
sourcepub fn mount_offset(&self) -> Vec3<f32>
pub fn mount_offset(&self) -> Vec3<f32>
Component of the mounting offset specific to the mount
sourcepub fn rider_offset(&self) -> Vec3<f32>
pub fn rider_offset(&self) -> Vec3<f32>
Component of the mounting offset specific to the rider
pub fn tether_offset_leader(&self) -> Vec3<f32>
pub fn tether_offset_follower(&self) -> Vec3<f32>
sourcepub fn localize_npc(&self) -> Content
pub fn localize_npc(&self) -> Content
Should be only used with npc-tell_monster.
If you want to use for displaying names in HUD, add new strings. If you want to use for anything else, add new strings.
sourcepub fn humanoid_gender(&self) -> Option<Gender>
pub fn humanoid_gender(&self) -> Option<Gender>
Read comment on Gender
for more
source§impl Body
impl Body
pub fn aerodynamic_forces( &self, rel_flow: &Vel, fluid_density: f32, wings: Option<&Wings>, scale: f32, ) -> Vec3<f32>
sourcepub fn drag_coefficient_liquid(&self, fluid_density: f32, scale: f32) -> f32
pub fn drag_coefficient_liquid(&self, fluid_density: f32, scale: f32) -> f32
Physically incorrect (but relatively dt-independent) way to calculate drag coefficients for liquids.
sourcefn parasite_drag(&self, scale: f32) -> f32
fn parasite_drag(&self, scale: f32) -> f32
Parasite drag is the sum of pressure drag and skin friction. Skin friction is the drag arising from the shear forces between a fluid and a surface, while pressure drag is due to flow separation. Both are viscous effects.
source§impl Body
impl Body
pub fn base_accel(&self) -> f32
pub fn air_accel(&self) -> f32
sourcepub fn max_speed_approx(&self) -> f32
pub fn max_speed_approx(&self) -> f32
Attempt to determine the maximum speed of the character when moving on the ground
sourcepub fn base_ori_rate(&self) -> f32
pub fn base_ori_rate(&self) -> f32
The turn rate in 180°/s (or (rotations per second)/2)
sourcepub fn swim_thrust(&self) -> Option<f32>
pub fn swim_thrust(&self) -> Option<f32>
Returns thrust force if the body type can swim, otherwise None
sourcepub fn fly_thrust(&self) -> Option<f32>
pub fn fly_thrust(&self) -> Option<f32>
Returns thrust force if the body type can fly, otherwise None
sourcepub fn jump_impulse(&self) -> Option<f32>
pub fn jump_impulse(&self) -> Option<f32>
Returns jump impulse if the body type can jump, otherwise None
pub fn can_climb(&self) -> bool
sourcepub fn reverse_move_factor(&self) -> f32
pub fn reverse_move_factor(&self) -> f32
Returns how well a body can move backwards while strafing (0.0 = not at all, 1.0 = same as forward)
Trait Implementations§
source§impl<'de> Deserialize<'de> for Body
impl<'de> Deserialize<'de> for Body
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<'a, BodyMeta, SpeciesMeta> Index<&'a Body> for AllBodies<BodyMeta, SpeciesMeta>
impl<'a, BodyMeta, SpeciesMeta> Index<&'a Body> for AllBodies<BodyMeta, SpeciesMeta>
Can only retrieve body metadata by direct index.
source§impl Ord for Body
impl Ord for Body
source§impl<Target> PackedElim for WeakHead<Body, Target>where
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
impl<Target> PackedElim for WeakHead<Body, Target>where
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
type Humanoid = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type QuadrupedSmall = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type QuadrupedMedium = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type BirdMedium = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type FishMedium = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type Dragon = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type BirdLarge = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type FishSmall = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type BipedLarge = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type BipedSmall = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type Object = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type Golem = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type Theropod = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type QuadrupedLow = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type Ship = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type Arthropod = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type ItemDrop = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type Crustacean = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
type Plugin = <WeakHead<Body, Target> as SynthTyped<((Body,), ()), Target>>::Expr
source§impl PartialEq for Body
impl PartialEq for Body
source§impl PartialOrd for Body
impl PartialOrd for Body
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<Context, Target> SynthTyped<((Body,), Context), Target> for WeakHead<Body, Target>where
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
impl<Context, Target> SynthTyped<((Body,), Context), Target> for WeakHead<Body, Target>where
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
WeakHead<Body, Target>: SynthTyped<((Body,), ()), Target>,
impl Copy for Body
impl Eq for Body
impl StructuralPartialEq for Body
Auto Trait Implementations§
impl Freeze for Body
impl RefUnwindSafe for Body
impl Send for Body
impl Sync for Body
impl Unpin for Body
impl UnwindSafe for Body
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<C, M> ConvertSaveload<M> for C
impl<C, M> ConvertSaveload<M> for C
§type Error = Infallible
type Error = Infallible
§fn convert_into<F>(
&self,
_: F,
) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error>
fn convert_into<F>( &self, _: F, ) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error>
Data
) using
entity to marker mapping function§fn convert_from<F>(
data: <C as ConvertSaveload<M>>::Data,
_: F,
) -> Result<C, <C as ConvertSaveload<M>>::Error>
fn convert_from<F>( data: <C as ConvertSaveload<M>>::Data, _: F, ) -> Result<C, <C as ConvertSaveload<M>>::Error>
Data
) using
entity to marker mapping function§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<Context> SubContext<Context> for Context
impl<Context> SubContext<Context> for Context
fn sub_context(self) -> Context
§impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere
T: Default,
§fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
§fn unwrap_default() -> Self
fn unwrap_default() -> Self
try_default
and panics on an error case.