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
impl SplineEditor
pub fn new() -> Self
pub fn create_catmull_spline(&mut self, points: Vec<Vec3>, name: &str) -> u64
pub fn remove_catmull_spline(&mut self, id: u64)
pub fn add_control_point(&mut self, spline_id: u64, position: Vec3)
pub fn remove_control_point(&mut self, spline_id: u64, index: usize)
pub fn move_control_point( &mut self, spline_id: u64, index: usize, new_pos: Vec3, )
pub fn insert_knot_at(&mut self, spline_id: u64, t: f32)
pub fn toggle_closed_spline(&mut self, spline_id: u64)
pub fn split_spline(&mut self, spline_id: u64, t: f32) -> Option<(u64, u64)>
pub fn join_splines(&mut self, id_a: u64, id_b: u64) -> Option<u64>
pub fn create_bezier_spline(&mut self, points: &[Vec3], name: &str) -> u64
pub fn split_bezier_segment(&mut self, spline_id: u64, seg: usize, u: f32)
pub fn create_bspline( &mut self, points: Vec<Vec3>, degree: usize, name: &str, ) -> u64
pub fn insert_bspline_knot(&mut self, spline_id: u64, t: f32)
pub fn create_nurbs( &mut self, points: Vec<Vec3>, weights: Vec<f32>, degree: usize, name: &str, ) -> u64
pub fn create_hermite_spline( &mut self, points: Vec<(Vec3, Vec3)>, name: &str, ) -> u64
pub fn create_rail_track(&mut self, spline_id: u64, gauge: f32) -> Option<u64>
pub fn rail_banking_at( &self, track_id: u64, t: f32, speed_ms: f32, ) -> Option<f32>
pub fn get_rail_mesh( &self, track_id: u64, resolution: usize, speed_ms: f32, ) -> Option<RailMeshData>
pub fn create_camera_rail(&mut self, spline_id: u64) -> Option<u64>
pub fn camera_transform_at(&self, rail_id: u64, t: f32) -> Option<Mat4>
pub fn bake_camera_path(&self, rail_id: u64, steps: usize) -> Vec<(Mat4, f32)>
pub fn generate_mesh_for_spline(&mut self, spline_id: u64) -> bool
pub fn generate_lod_mesh( &mut self, spline_id: u64, min_steps: usize, max_steps: usize, ) -> bool
pub fn add_constrained_object( &mut self, spline_id: u64, t: f32, mass: f32, ) -> u64
pub fn update_physics(&mut self, dt: f32)
pub fn add_chain(&mut self, spline_id: u64, link_length: f32)
pub fn setup_traffic_system(&mut self)
pub fn plan_path(&self, start_node: u64, end_node: u64) -> Option<Vec<u64>>
pub fn nearest_point_on_any_spline( &self, query: Vec3, ) -> Option<(u64, f32, Vec3)>
pub fn find_spline_plane_intersections( &self, spline_id: u64, plane_normal: Vec3, plane_d: f32, ) -> Vec<SplinePlaneIntersection>
pub fn find_spline_spline_intersections( &self, id_a: u64, id_b: u64, tol: f32, ) -> Vec<SplineSplineIntersection>
pub fn update_debug_viz(&mut self)
pub fn undo(&mut self)
pub fn redo(&mut self)
pub fn serialize_spline(&self, spline_id: u64) -> Option<SplineSerializedData>
pub fn serialize_all(&self) -> Vec<SplineSerializedData>
pub fn deserialize_and_add(&mut self, data: SplineSerializedData)
pub fn spline_ids(&self) -> Vec<u64>
pub fn spline_count(&self) -> usize
pub fn evaluate_spline(&self, id: u64, t: f32) -> Option<Vec3>
pub fn spline_arc_length(&self, id: u64) -> f32
pub fn curvature_at(&self, id: u64, t: f32) -> f32
Source§impl SplineEditor
impl SplineEditor
Source§impl SplineEditor
impl SplineEditor
pub fn compute_statistics(&self, id: u64) -> Option<SplineStatistics>
pub fn all_statistics(&self) -> Vec<SplineStatistics>
pub fn find_by_name(&self, name: &str) -> Option<u64>
pub fn rename_spline(&mut self, id: u64, new_name: &str)
pub fn duplicate_spline(&mut self, id: u64) -> Option<u64>
pub fn translate_spline(&mut self, id: u64, delta: Vec3)
pub fn scale_spline(&mut self, id: u64, origin: Vec3, scale: Vec3)
pub fn rotate_spline(&mut self, id: u64, origin: Vec3, rotation: Quat)
pub fn mirror_spline( &mut self, id: u64, plane_normal: Vec3, plane_d: f32, ) -> Option<u64>
Source§impl SplineEditor
impl SplineEditor
Sourcepub fn use_circle_section(&mut self, radius: f32, segments: usize)
pub fn use_circle_section(&mut self, radius: f32, segments: usize)
Set mesh section preset
pub fn use_rectangle_section(&mut self, w: f32, h: f32)
pub fn use_ibeam_section(&mut self, w: f32, h: f32, flange: f32, web: f32)
Sourcepub fn select_all(&mut self)
pub fn select_all(&mut self)
Select all splines
Sourcepub fn deselect_all(&mut self)
pub fn deselect_all(&mut self)
Deselect all
Sourcepub fn delete_selected(&mut self)
pub fn delete_selected(&mut self)
Delete selected splines
Sourcepub fn regenerate_all_meshes(&mut self)
pub fn regenerate_all_meshes(&mut self)
Regenerate all meshes
Source§impl SplineEditor
impl SplineEditor
pub fn cmd_taubin_smooth( &mut self, id: u64, lambda: f32, mu: f32, iterations: u32, )
pub fn cmd_equidistribute(&mut self, id: u64, new_count: usize)
pub fn cmd_snap_grid(&mut self, id: u64, cell_size: f32)
pub fn cmd_mirror(&mut self, id: u64, axis: u8)
pub fn cmd_perturb_fbm( &mut self, id: u64, amplitude: f32, freq: f32, octaves: u32, seed: u32, )
pub fn cmd_translate(&mut self, id: u64, delta: Vec3)
pub fn cmd_rotate(&mut self, id: u64, rot: Quat)
pub fn cmd_scale(&mut self, id: u64, scale: f32)
pub fn cmd_analyze( &self, id: u64, samples: usize, ) -> Option<SplineAnalysisReport>
pub fn cmd_fit_bezier( &mut self, id: u64, samples: usize, max_error: f32, ) -> Option<u64>
pub fn cmd_export_csv(&self) -> String
pub fn cmd_import_csv(&mut self, csv: &str)
pub fn spline_bounding_box(&self, id: u64) -> Option<(Vec3, Vec3)>
pub fn clear_all(&mut self)
pub fn total_control_points(&self) -> usize
pub fn cmd_reverse(&mut self, id: u64)
pub fn cmd_duplicate(&mut self, id: u64, offset: Vec3) -> Option<u64>
pub fn cmd_weld(&mut self, id_a: u64, id_b: u64, threshold: f32) -> Option<u64>
pub fn arc_length(&self, id: u64) -> f32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SplineEditor
impl RefUnwindSafe for SplineEditor
impl Send for SplineEditor
impl Sync for SplineEditor
impl Unpin for SplineEditor
impl UnsafeUnpin for SplineEditor
impl UnwindSafe for SplineEditor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.