pub struct PathGizmo {
pub waypoints: Vec<Vec3>,
pub color: Vec4,
pub closed: bool,
pub show_handles: bool,
pub segments_per_span: usize,
}Expand description
Draws a spline path between waypoints.
Fields§
§waypoints: Vec<Vec3>§color: Vec4§closed: bool§show_handles: bool§segments_per_span: usizeImplementations§
Source§impl PathGizmo
impl PathGizmo
pub fn new(waypoints: Vec<Vec3>) -> Self
Sourcepub fn spline_lines(&self) -> Vec<(Vec3, Vec3)>
pub fn spline_lines(&self) -> Vec<(Vec3, Vec3)>
Generate line segments for the spline path.
Sourcepub fn line_segments(&self) -> Vec<(Vec3, Vec3)>
pub fn line_segments(&self) -> Vec<(Vec3, Vec3)>
Straight-line segments between consecutive waypoints.
pub fn add_waypoint(&mut self, pt: Vec3)
pub fn remove_waypoint(&mut self, index: usize)
pub fn total_length(&self) -> f32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PathGizmo
impl RefUnwindSafe for PathGizmo
impl Send for PathGizmo
impl Sync for PathGizmo
impl Unpin for PathGizmo
impl UnsafeUnpin for PathGizmo
impl UnwindSafe for PathGizmo
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.