pub struct MobiusNavigation {
pub strip: MobiusStrip,
pub u: f32,
pub v: f32,
pub loops: u32,
}Expand description
Handles movement on a Mobius strip with automatic face switching.
Fields§
§strip: MobiusStrip§u: f32Parameter along the strip center, in [0, 2*PI)
v: f32Parameter across the strip, in [-1, 1]
loops: u32How many times we have gone fully around
Implementations§
pub fn new(strip: MobiusStrip) -> Self
Sourcepub fn move_by(&mut self, du: f32, dv: f32)
pub fn move_by(&mut self, du: f32, dv: f32)
Move along the strip (du) and across it (dv). When crossing u = 2*PI, v is negated (you switch to the other side).
Sourcepub fn on_backside(&self) -> bool
pub fn on_backside(&self) -> bool
Check if currently on the “back side” (odd number of loops).
Sourcepub fn current_normal(&self) -> Vec3
pub fn current_normal(&self) -> Vec3
Get the surface normal at the current position.
Auto Trait Implementations§
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> 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.