pub struct RocketScenario { /* private fields */ }Expand description
Rocket scenario for launch simulations.
Implementations§
Source§impl RocketScenario
impl RocketScenario
Sourcepub fn new(config: RocketConfig) -> Self
pub fn new(config: RocketConfig) -> Self
Create a new rocket scenario.
Sourcepub fn init_state(&self) -> SimState
pub fn init_state(&self) -> SimState
Initialize simulation state for the rocket.
Sourcepub fn total_mass(&self) -> f64
pub fn total_mass(&self) -> f64
Get total current mass.
Sourcepub fn current_thrust(&self) -> f64
pub fn current_thrust(&self) -> f64
Get current thrust.
Sourcepub fn consume_fuel(&mut self, dt: f64)
pub fn consume_fuel(&mut self, dt: f64)
Consume fuel for a timestep.
Sourcepub fn check_separation(&mut self, altitude: f64) -> bool
pub fn check_separation(&mut self, altitude: f64) -> bool
Check and perform stage separation.
Sourcepub fn complete_separation(&mut self)
pub fn complete_separation(&mut self)
Complete stage separation.
Sourcepub const fn current_stage(&self) -> StageSeparation
pub const fn current_stage(&self) -> StageSeparation
Get current stage.
Sourcepub const fn config(&self) -> &RocketConfig
pub const fn config(&self) -> &RocketConfig
Get configuration.
Sourcepub const fn fuel_remaining_stage1(&self) -> f64
pub const fn fuel_remaining_stage1(&self) -> f64
Get fuel remaining (stage 1).
Sourcepub const fn fuel_remaining_stage2(&self) -> f64
pub const fn fuel_remaining_stage2(&self) -> f64
Get fuel remaining (stage 2).
Trait Implementations§
Source§impl Clone for RocketScenario
impl Clone for RocketScenario
Source§fn clone(&self) -> RocketScenario
fn clone(&self) -> RocketScenario
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RocketScenario
impl RefUnwindSafe for RocketScenario
impl Send for RocketScenario
impl Sync for RocketScenario
impl Unpin for RocketScenario
impl UnsafeUnpin for RocketScenario
impl UnwindSafe for RocketScenario
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