pub struct ClockComparison {
pub clock_a: DilatedClock,
pub clock_b: DilatedClock,
pub position_a: Vec2,
pub position_b: Vec2,
pub label_a: String,
pub label_b: String,
}Expand description
Visualize two clocks at different velocities/heights side by side.
Fields§
§clock_a: DilatedClock§clock_b: DilatedClock§position_a: Vec2§position_b: Vec2§label_a: String§label_b: StringImplementations§
Source§impl ClockComparison
impl ClockComparison
pub fn new(v_a: f64, v_b: f64, c: f64, pos_a: Vec2, pos_b: Vec2) -> Self
Sourcepub fn time_difference(&self) -> f64
pub fn time_difference(&self) -> f64
Get the time difference between the two clocks.
Sourcepub fn time_ratio(&self) -> f64
pub fn time_ratio(&self) -> f64
Get the ratio of proper times.
Sourcepub fn render_data(
&self,
renderer: &TimeDilationRenderer,
) -> ((Vec<Vec2>, Vec2), (Vec<Vec2>, Vec2))
pub fn render_data( &self, renderer: &TimeDilationRenderer, ) -> ((Vec<Vec2>, Vec2), (Vec<Vec2>, Vec2))
Generate rendering data for both clocks.
Trait Implementations§
Source§impl Clone for ClockComparison
impl Clone for ClockComparison
Source§fn clone(&self) -> ClockComparison
fn clone(&self) -> ClockComparison
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 ClockComparison
impl RefUnwindSafe for ClockComparison
impl Send for ClockComparison
impl Sync for ClockComparison
impl Unpin for ClockComparison
impl UnsafeUnpin for ClockComparison
impl UnwindSafe for ClockComparison
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
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.