pub struct RailTrack {
pub id: u64,
pub spline: CatmullRomSpline,
pub gauge: f32,
pub max_speed: f32,
pub super_elevation_max: f32,
pub cant_deficiency: f32,
pub name: String,
}Fields§
§id: u64§spline: CatmullRomSpline§gauge: f32§max_speed: f32§super_elevation_max: f32§cant_deficiency: f32§name: StringImplementations§
Source§impl RailTrack
impl RailTrack
pub fn new(spline: CatmullRomSpline, gauge: f32) -> Self
Sourcepub fn banking_angle_at(&self, t: f32, speed_ms: f32) -> f32
pub fn banking_angle_at(&self, t: f32, speed_ms: f32) -> f32
Banking angle from curvature: θ = atan(v²κ/g) where κ = curvature
Sourcepub fn superelevation_at(&self, t: f32, speed_ms: f32) -> f32
pub fn superelevation_at(&self, t: f32, speed_ms: f32) -> f32
Superelevation (cant) in mm: e = v²·g/(R·g) * gauge where R = 1/κ
Sourcepub fn rail_positions(&self, t: f32, speed_ms: f32) -> (Vec3, Vec3)
pub fn rail_positions(&self, t: f32, speed_ms: f32) -> (Vec3, Vec3)
Left and right rail positions at parameter t
pub fn rail_mesh_data(&self, resolution: usize, speed_ms: f32) -> RailMeshData
pub fn add_sleepers(&self, rail_data: &mut RailMeshData, spacing: f32)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RailTrack
impl RefUnwindSafe for RailTrack
impl Send for RailTrack
impl Sync for RailTrack
impl Unpin for RailTrack
impl UnsafeUnpin for RailTrack
impl UnwindSafe for RailTrack
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.