#[repr(u32)]pub enum Body {
DefaultAirship = 0,
AirBalloon = 1,
SailBoat = 2,
Galleon = 3,
Volume = 4,
Skiff = 5,
Submarine = 6,
Carriage = 7,
Cart = 8,
}
Variants§
DefaultAirship = 0
AirBalloon = 1
SailBoat = 2
Galleon = 3
Volume = 4
Skiff = 5
Submarine = 6
Carriage = 7
Cart = 8
Implementations§
Source§impl Body
impl Body
pub fn random() -> Body
pub fn random_with(rng: &mut impl Rng) -> Body
pub fn random_airship_with(rng: &mut impl Rng) -> Body
pub fn random_ship_with(rng: &mut impl Rng) -> Body
Sourcepub fn manifest_entry(&self) -> Option<&'static str>
pub fn manifest_entry(&self) -> Option<&'static str>
Return the structure manifest that this ship uses. None
means that it
should be derived from the collider.
pub fn dimensions(&self) -> Vec3<f32>
pub fn hull_density(&self) -> Density
pub fn density(&self) -> Density
pub fn mass(&self) -> Mass
pub fn can_fly(&self) -> bool
pub fn vectored_propulsion(&self) -> bool
pub fn flying_height(&self) -> f32
pub fn has_water_thrust(&self) -> bool
pub fn has_wheels(&self) -> bool
pub fn make_collider(&self) -> Collider
Sourcepub fn get_speed(&self) -> f32
pub fn get_speed(&self) -> f32
Max speed in block/s. This is the simulated speed of Ship bodies (which are NPCs).
Air Vehicles: Loaded (non-simulated) air ships don’t have a speed, they have thrust that produces acceleration and air resistance that produces drag. The acceleration is modulated by a speed_factor assigned by the agent, and the balance of forces results in a semi-constant velocity (speed) when thrust and drag are in equilibrium. The average velocity changes depending on wind and changes in altitude (e.g. when terrain following and going up or down over mountains).
Water Vehicles: Loaded water ships also have thrust and drag, and a speed_factor that modulates the resulting acceleration and top speed. Wind does have an effect on the velocity of watercraft.
The airship simulated speed below was chosen experimentally so that the time required to complete one full circuit of an airship multi-leg route is the same for simulated airships and loaded airships (one where a player is continuously riding the airship).
Other vehicles should be tuned if and when implemented, but for now the airship is the only Ship in use.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Body
impl<'de> Deserialize<'de> for Body
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Body, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Body, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Ord for Body
impl Ord for Body
Source§impl PartialOrd for Body
impl PartialOrd for Body
Source§impl Serialize for Body
impl Serialize for Body
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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,
§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
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