Skip to main content

SplineEditor

Struct SplineEditor 

Source
pub struct SplineEditor {
Show 29 fields pub catmull_splines: HashMap<u64, CatmullRomSpline>, pub bezier_splines: HashMap<u64, CubicBezierSpline>, pub bsplines: HashMap<u64, BSpline>, pub nurbs_splines: HashMap<u64, NurbsSpline>, pub hermite_splines: HashMap<u64, HermiteSpline>, pub spline_names: HashMap<u64, String>, pub spline_types: HashMap<u64, SplineType>, pub rail_tracks: HashMap<u64, RailTrack>, pub camera_rails: HashMap<u64, CameraRail>, pub path_network: PathNetwork, pub traffic_system: Option<TrafficSystem>, pub constrained_objects: Vec<SplineConstrainedObject>, pub chains: Vec<SplineChain>, pub selection: SelectionState, pub undo_history: UndoHistory, pub debug_viz: SplineDebugViz, pub default_alpha: f32, pub snap_to_grid: bool, pub grid_size: f32, pub show_debug: bool, pub show_curvature_comb: bool, pub show_arc_length_marks: bool, pub curvature_comb_scale: f32, pub arc_length_mark_interval: f32, pub show_frenet_frames: bool, pub frenet_frame_scale: f32, pub mesh_section: CrossSection, pub mesh_resolution: usize, pub generated_meshes: HashMap<u64, SplineMesh>,
}

Fields§

§catmull_splines: HashMap<u64, CatmullRomSpline>§bezier_splines: HashMap<u64, CubicBezierSpline>§bsplines: HashMap<u64, BSpline>§nurbs_splines: HashMap<u64, NurbsSpline>§hermite_splines: HashMap<u64, HermiteSpline>§spline_names: HashMap<u64, String>§spline_types: HashMap<u64, SplineType>§rail_tracks: HashMap<u64, RailTrack>§camera_rails: HashMap<u64, CameraRail>§path_network: PathNetwork§traffic_system: Option<TrafficSystem>§constrained_objects: Vec<SplineConstrainedObject>§chains: Vec<SplineChain>§selection: SelectionState§undo_history: UndoHistory§debug_viz: SplineDebugViz§default_alpha: f32§snap_to_grid: bool§grid_size: f32§show_debug: bool§show_curvature_comb: bool§show_arc_length_marks: bool§curvature_comb_scale: f32§arc_length_mark_interval: f32§show_frenet_frames: bool§frenet_frame_scale: f32§mesh_section: CrossSection§mesh_resolution: usize§generated_meshes: HashMap<u64, SplineMesh>

Implementations§

Source§

impl SplineEditor

Source

pub fn new() -> Self

Source

pub fn create_catmull_spline(&mut self, points: Vec<Vec3>, name: &str) -> u64

Source

pub fn remove_catmull_spline(&mut self, id: u64)

Source

pub fn add_control_point(&mut self, spline_id: u64, position: Vec3)

Source

pub fn remove_control_point(&mut self, spline_id: u64, index: usize)

Source

pub fn move_control_point( &mut self, spline_id: u64, index: usize, new_pos: Vec3, )

Source

pub fn insert_knot_at(&mut self, spline_id: u64, t: f32)

Source

pub fn toggle_closed_spline(&mut self, spline_id: u64)

Source

pub fn split_spline(&mut self, spline_id: u64, t: f32) -> Option<(u64, u64)>

Source

pub fn join_splines(&mut self, id_a: u64, id_b: u64) -> Option<u64>

Source

pub fn create_bezier_spline(&mut self, points: &[Vec3], name: &str) -> u64

Source

pub fn split_bezier_segment(&mut self, spline_id: u64, seg: usize, u: f32)

Source

pub fn create_bspline( &mut self, points: Vec<Vec3>, degree: usize, name: &str, ) -> u64

Source

pub fn insert_bspline_knot(&mut self, spline_id: u64, t: f32)

Source

pub fn create_nurbs( &mut self, points: Vec<Vec3>, weights: Vec<f32>, degree: usize, name: &str, ) -> u64

Source

pub fn create_hermite_spline( &mut self, points: Vec<(Vec3, Vec3)>, name: &str, ) -> u64

Source

pub fn create_rail_track(&mut self, spline_id: u64, gauge: f32) -> Option<u64>

Source

pub fn rail_banking_at( &self, track_id: u64, t: f32, speed_ms: f32, ) -> Option<f32>

Source

pub fn get_rail_mesh( &self, track_id: u64, resolution: usize, speed_ms: f32, ) -> Option<RailMeshData>

Source

pub fn create_camera_rail(&mut self, spline_id: u64) -> Option<u64>

Source

pub fn camera_transform_at(&self, rail_id: u64, t: f32) -> Option<Mat4>

Source

pub fn bake_camera_path(&self, rail_id: u64, steps: usize) -> Vec<(Mat4, f32)>

Source

pub fn generate_mesh_for_spline(&mut self, spline_id: u64) -> bool

Source

pub fn generate_lod_mesh( &mut self, spline_id: u64, min_steps: usize, max_steps: usize, ) -> bool

Source

pub fn add_constrained_object( &mut self, spline_id: u64, t: f32, mass: f32, ) -> u64

Source

pub fn update_physics(&mut self, dt: f32)

Source

pub fn add_chain(&mut self, spline_id: u64, link_length: f32)

Source

pub fn setup_traffic_system(&mut self)

Source

pub fn plan_path(&self, start_node: u64, end_node: u64) -> Option<Vec<u64>>

Source

pub fn nearest_point_on_any_spline( &self, query: Vec3, ) -> Option<(u64, f32, Vec3)>

Source

pub fn find_spline_plane_intersections( &self, spline_id: u64, plane_normal: Vec3, plane_d: f32, ) -> Vec<SplinePlaneIntersection>

Source

pub fn find_spline_spline_intersections( &self, id_a: u64, id_b: u64, tol: f32, ) -> Vec<SplineSplineIntersection>

Source

pub fn update_debug_viz(&mut self)

Source

pub fn undo(&mut self)

Source

pub fn redo(&mut self)

Source

pub fn serialize_spline(&self, spline_id: u64) -> Option<SplineSerializedData>

Source

pub fn serialize_all(&self) -> Vec<SplineSerializedData>

Source

pub fn deserialize_and_add(&mut self, data: SplineSerializedData)

Source

pub fn spline_ids(&self) -> Vec<u64>

Source

pub fn spline_count(&self) -> usize

Source

pub fn evaluate_spline(&self, id: u64, t: f32) -> Option<Vec3>

Source

pub fn spline_arc_length(&self, id: u64) -> f32

Source

pub fn curvature_at(&self, id: u64, t: f32) -> f32

Source§

impl SplineEditor

Source

pub fn update(&mut self, dt: f32)

Source

pub fn stats(&self) -> SplineEditorStats

Source§

impl SplineEditor

Source

pub fn compute_statistics(&self, id: u64) -> Option<SplineStatistics>

Source

pub fn all_statistics(&self) -> Vec<SplineStatistics>

Source

pub fn find_by_name(&self, name: &str) -> Option<u64>

Source

pub fn rename_spline(&mut self, id: u64, new_name: &str)

Source

pub fn duplicate_spline(&mut self, id: u64) -> Option<u64>

Source

pub fn translate_spline(&mut self, id: u64, delta: Vec3)

Source

pub fn scale_spline(&mut self, id: u64, origin: Vec3, scale: Vec3)

Source

pub fn rotate_spline(&mut self, id: u64, origin: Vec3, rotation: Quat)

Source

pub fn mirror_spline( &mut self, id: u64, plane_normal: Vec3, plane_d: f32, ) -> Option<u64>

Source§

impl SplineEditor

Source

pub fn clear(&mut self)

Clear all data

Source

pub fn use_circle_section(&mut self, radius: f32, segments: usize)

Set mesh section preset

Source

pub fn use_rectangle_section(&mut self, w: f32, h: f32)

Source

pub fn use_ibeam_section(&mut self, w: f32, h: f32, flange: f32, web: f32)

Source

pub fn select_all(&mut self)

Select all splines

Source

pub fn deselect_all(&mut self)

Deselect all

Source

pub fn delete_selected(&mut self)

Delete selected splines

Source

pub fn regenerate_all_meshes(&mut self)

Regenerate all meshes

Source§

impl SplineEditor

Source

pub fn cmd_taubin_smooth( &mut self, id: u64, lambda: f32, mu: f32, iterations: u32, )

Source

pub fn cmd_equidistribute(&mut self, id: u64, new_count: usize)

Source

pub fn cmd_snap_grid(&mut self, id: u64, cell_size: f32)

Source

pub fn cmd_mirror(&mut self, id: u64, axis: u8)

Source

pub fn cmd_perturb_fbm( &mut self, id: u64, amplitude: f32, freq: f32, octaves: u32, seed: u32, )

Source

pub fn cmd_translate(&mut self, id: u64, delta: Vec3)

Source

pub fn cmd_rotate(&mut self, id: u64, rot: Quat)

Source

pub fn cmd_scale(&mut self, id: u64, scale: f32)

Source

pub fn cmd_analyze( &self, id: u64, samples: usize, ) -> Option<SplineAnalysisReport>

Source

pub fn cmd_fit_bezier( &mut self, id: u64, samples: usize, max_error: f32, ) -> Option<u64>

Source

pub fn cmd_export_csv(&self) -> String

Source

pub fn cmd_import_csv(&mut self, csv: &str)

Source

pub fn spline_bounding_box(&self, id: u64) -> Option<(Vec3, Vec3)>

Source

pub fn clear_all(&mut self)

Source

pub fn total_control_points(&self) -> usize

Source

pub fn cmd_reverse(&mut self, id: u64)

Source

pub fn cmd_duplicate(&mut self, id: u64, offset: Vec3) -> Option<u64>

Source

pub fn cmd_weld(&mut self, id_a: u64, id_b: u64, threshold: f32) -> Option<u64>

Source

pub fn arc_length(&self, id: u64) -> f32

Trait Implementations§

Source§

impl Debug for SplineEditor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more