Struct lotus_script::vehicle::Axle

source ·
pub struct Axle { /* private fields */ }

Implementations§

source§

impl Axle

source

pub fn get(bogie_index: usize, axle_index: usize) -> Result<Axle, VehicleError>

source

pub fn velocity_var_name(self) -> String

source

pub fn bogie(self) -> Bogie

source

pub fn inverse_radius(self) -> f32

Gets the curvature of the track under the given axis. The curvature is the reciprocal of the radius (1/R), which has the advantage that the value does not tend to infinity in a straight line, but tends to 0. The values are very small due to this calculation: Even a radius of only 100m leads to a value of 0.01, larger radii lead to even smaller values. Positive = right, negative = left.

source

pub fn surface_type(self) -> SurfaceType

Provides the type of the surface under the given axis.

source

pub fn rail_quality(self) -> RailQuality

Provides the quality of the rails under the given axis.

source

pub fn set_traction_force_newton(self, value: f32)

Sets the traction force in newton. This is the torque applied to the axle, already converted to the force acting on the running surface. This means that as long as the wheel does not slip or spin, this value is equal to the force exerted by the wheel on the rail. This force acts independently of the direction of travel. If it acts in the opposite direction to the travel, the vehicle will be braked, but it cannot hold the vehicle stationary.

source

pub fn set_brake_force_newton(self, value: f32)

Sets the brake force in newton. This is the torque applied to the axle, already converted to the force acting on the running surface. This means that as long as the wheel does not slip or spin, this value is equal to the force exerted by the wheel on the rail. The difference to “traction_force_newton” is that brake_force_newton is always positive and always acts in the opposite direction to the travel. This means that brake_force_newton can also hold the vehicle stationary like a disc brake.

Trait Implementations§

source§

impl Clone for Axle

source§

fn clone(&self) -> Axle

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

impl Debug for Axle

source§

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

Formats the value using the given formatter. Read more
source§

impl Hash for Axle

source§

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

impl PartialEq for Axle

source§

fn eq(&self, other: &Axle) -> 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.
source§

impl Copy for Axle

source§

impl Eq for Axle

source§

impl StructuralPartialEq for Axle

Auto Trait Implementations§

§

impl Freeze for Axle

§

impl RefUnwindSafe for Axle

§

impl Send for Axle

§

impl Sync for Axle

§

impl Unpin for Axle

§

impl UnwindSafe for Axle

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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, 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.