Enum veloren_common_net::synced_components::Body

#[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§

§

impl Body

pub fn elim<'a, Elim, Context, S, Type>( &'a self, elim: Elim, context: Context, ) -> (Type, S)
where Elim: Typed<((&'a Body,), Context), Type, S>,

pub fn elim_case_pure<'a, Type>( &self, cases: &'a ElimCase<Cases<Pure<Type>>>, ) -> &'a Type

pub fn elim_case_weak<'a, 'b, Type>( &'a self, cases: &'b <WeakHead<Body, Type> as SynthTyped<((Body,), ()), Type>>::Expr, ) -> &'b Type
where 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 <WeakHead<Body, Type> as SynthTyped<((Body,), ()), Type>>::Expr: Typed<((&'a Body,), ()), &'b Type, ()>,

§

impl Body

pub fn is_same_species_as(&self, other: &Body) -> bool

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

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 density(&self) -> Density

Average density of the body

pub fn mass(&self) -> Mass

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

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.

pub fn collider(&self) -> Collider

Body collider

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 height(&self) -> f32

Height from the bottom to the top (in metres)

pub fn base_energy(&self) -> u16

pub fn base_health(&self) -> u16

pub fn flying_height(&self) -> f32

pub fn immune_to(&self, buff: BuffKind) -> bool

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

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

pub fn mount_offset(&self) -> Vec3<f32>

Component of the mounting offset specific to the mount

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>

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.

pub fn humanoid_gender(&self) -> Option<Gender>

Read comment on Gender for more

§

impl Body

pub fn aerodynamic_forces( &self, rel_flow: &Vel, fluid_density: f32, wings: Option<&Wings>, scale: f32, ) -> Vec3<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.

§

impl Body

pub fn base_accel(&self) -> f32

pub fn air_accel(&self) -> f32

pub fn max_speed_approx(&self) -> f32

Attempt to determine the maximum speed of the character when moving on the ground

pub fn base_ori_rate(&self) -> f32

The turn rate in 180°/s (or (rotations per second)/2)

pub fn swim_thrust(&self) -> Option<f32>

Returns thrust force if the body type can swim, otherwise None

pub fn fly_thrust(&self) -> Option<f32>

Returns thrust force if the body type can fly, otherwise None

pub fn jump_impulse(&self) -> Option<f32>

Returns jump impulse if the body type can jump, otherwise None

pub fn can_climb(&self) -> bool

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)

pub fn projectile_offsets(&self, ori: Vec3<f32>, scale: f32) -> Vec3<f32>

Returns the position where a projectile should be fired relative to this body

Trait Implementations§

§

impl Clone for Body

§

fn clone(&self) -> Body

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Component for Body

§

type Storage = DerefFlaggedStorage<Body, VecStorage<Body>>

Associated storage type for this component.
§

impl Debug for Body

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for Body

§

fn default() -> Body

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for Body

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Body, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for Body

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'a> From<&'a Body> for Psyche

§

fn from(body: &'a Body) -> Psyche

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
§

impl From<Body> for Body

§

fn from(body: Body) -> Body

Converts to this type from the input type.
source§

impl From<Body> for EcsCompPacket

source§

fn from(other: Body) -> EcsCompPacket

Converts to this type from the input type.
§

impl Hash for Body

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<'a, BodyMeta, SpeciesMeta> Index<&'a Body> for AllBodies<BodyMeta, SpeciesMeta>

Can only retrieve body metadata by direct index.

§

type Output = BodyMeta

The returned type after indexing.
§

fn index( &self, index: &Body, ) -> &<AllBodies<BodyMeta, SpeciesMeta> as Index<&'a Body>>::Output

Performs the indexing (container[index]) operation. Read more
source§

impl NetSync for Body

source§

const SYNC_FROM: SyncFrom = SyncFrom::AnyEntity

Determines what for entities this component is synced to the client. Read more
source§

fn pre_insert(&mut self, world: &World)

Allows making modifications before the synced component is inserted on the client.
source§

fn pre_modify(&mut self, world: &World)

Allows making modifications before the synced component is overwritten with this version on the client.
§

impl Ord for Body

§

fn cmp(&self, other: &Body) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

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

§

impl PartialEq for Body

§

fn eq(&self, other: &Body) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for Body

§

fn partial_cmp(&self, other: &Body) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl Serialize for Body

§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<EcsCompPacket> for Body

§

type Error = InvalidType

The type returned in the event of a conversion error.
source§

fn try_from(other: EcsCompPacket) -> Result<Body, Self::Error>

Performs the conversion.
§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for T
where T: Hash,

§

fn get_hash<H>(&self, hasher: H) -> u64
where H: Hasher,

source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<C, M> ConvertSaveload<M> for C

§

type Data = C

(De)Serializable data representation for data type
§

type Error = Infallible

Error may occur during serialization or deserialization of component
§

fn convert_into<F>( &self, _: F, ) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error>
where F: FnMut(Entity) -> Option<M>,

Convert this data type into serializable form (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>
where F: FnMut(M) -> Option<Entity>,

Convert this data from a deserializable form (Data) using entity to marker mapping function
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<Context> SubContext<Context> for Context

§

fn sub_context(self) -> Context

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> TryDefault for T
where T: Default,

§

fn try_default() -> Result<T, String>

Tries to create the default.
§

fn unwrap_default() -> Self

Calls try_default and panics on an error case.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Event for T
where T: Send + Sync + 'static,

§

impl<T> Resource for T
where T: Any + Send + Sync,

§

impl<T> Storable for T
where T: Send + Sync + 'static,