pub struct Map {Show 19 fields
pub id: Uuid,
pub name: String,
pub offset: Vec2<f32>,
pub grid_size: f32,
pub subdivisions: f32,
pub possible_polygon: Vec<u32>,
pub curr_grid_pos: Option<Vec2<f32>>,
pub curr_mouse_pos: Option<Vec2<f32>>,
pub curr_rectangle: Option<(Vec2<f32>, Vec2<f32>)>,
pub vertices: Vec<Vertex>,
pub linedefs: Vec<Linedef>,
pub sectors: Vec<Sector>,
pub sky_texture: Option<Uuid>,
pub camera: MapCamera,
pub camera_xz: Option<Vec2<f32>>,
pub lights: Vec<Light>,
pub selected_vertices: Vec<u32>,
pub selected_linedefs: Vec<u32>,
pub selected_sectors: Vec<u32>,
}Fields§
§id: Uuid§name: String§offset: Vec2<f32>§grid_size: f32§subdivisions: f32§possible_polygon: Vec<u32>§curr_grid_pos: Option<Vec2<f32>>§curr_mouse_pos: Option<Vec2<f32>>§curr_rectangle: Option<(Vec2<f32>, Vec2<f32>)>§vertices: Vec<Vertex>§linedefs: Vec<Linedef>§sectors: Vec<Sector>§sky_texture: Option<Uuid>§camera: MapCamera§camera_xz: Option<Vec2<f32>>§lights: Vec<Light>§selected_vertices: Vec<u32>§selected_linedefs: Vec<u32>§selected_sectors: Vec<u32>Implementations§
Source§impl Map
impl Map
pub fn new() -> Self
pub fn clear_temp(&mut self)
Sourcepub fn bounding_box(&self) -> Option<Vec4<f32>>
pub fn bounding_box(&self) -> Option<Vec4<f32>>
Generate a bounding box for all vertices in the map
pub fn add_vertex_at(&mut self, x: f32, y: f32) -> u32
Sourcepub fn find_vertex_at(&self, x: f32, y: f32) -> Option<u32>
pub fn find_vertex_at(&self, x: f32, y: f32) -> Option<u32>
Finds a vertex at the given position and returns its ID if it exists
Sourcepub fn find_vertex(&self, id: u32) -> Option<&Vertex>
pub fn find_vertex(&self, id: u32) -> Option<&Vertex>
Finds a reference to a vertex by its ID
Sourcepub fn find_vertex_mut(&mut self, id: u32) -> Option<&mut Vertex>
pub fn find_vertex_mut(&mut self, id: u32) -> Option<&mut Vertex>
Finds a mutable reference to a vertex by its ID
Sourcepub fn find_linedef(&self, id: u32) -> Option<&Linedef>
pub fn find_linedef(&self, id: u32) -> Option<&Linedef>
Finds a reference to a linedef by its ID
Sourcepub fn find_linedef_mut(&mut self, id: u32) -> Option<&mut Linedef>
pub fn find_linedef_mut(&mut self, id: u32) -> Option<&mut Linedef>
Finds a reference to a linedef by its ID
Sourcepub fn find_sector(&self, id: u32) -> Option<&Sector>
pub fn find_sector(&self, id: u32) -> Option<&Sector>
Finds a mutable reference to a sector by its ID
Sourcepub fn find_sector_mut(&mut self, id: u32) -> Option<&mut Sector>
pub fn find_sector_mut(&mut self, id: u32) -> Option<&mut Sector>
Finds a mutable reference to a sector by its ID
pub fn create_linedef( &mut self, start_vertex: u32, end_vertex: u32, ) -> (u32, Option<u32>)
Sourcepub fn test_for_closed_polygon(&self) -> bool
pub fn test_for_closed_polygon(&self) -> bool
Check if the possible_polygon forms a closed loop
Sourcepub fn create_sector_from_polygon(&mut self) -> Option<u32>
pub fn create_sector_from_polygon(&mut self) -> Option<u32>
Tries to create a polyon from the tracked vertices in possible_polygon
Sourcepub fn delete_elements(
&mut self,
vertex_ids: &[u32],
linedef_ids: &[u32],
sector_ids: &[u32],
)
pub fn delete_elements( &mut self, vertex_ids: &[u32], linedef_ids: &[u32], sector_ids: &[u32], )
Deletes the specified vertices, linedefs, and sectors, along with their associated geometry.
Sourcepub fn is_linedef_in_closed_polygon(&self, linedef_id: u32) -> bool
pub fn is_linedef_in_closed_polygon(&self, linedef_id: u32) -> bool
Check if a given linedef ID is part of any sector.
Sourcepub fn add_to_selection(
&mut self,
vertices: Vec<u32>,
linedefs: Vec<u32>,
sectors: Vec<u32>,
)
pub fn add_to_selection( &mut self, vertices: Vec<u32>, linedefs: Vec<u32>, sectors: Vec<u32>, )
Add the given geometry to the selection.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Map
impl<'de> Deserialize<'de> for Map
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Map
impl RefUnwindSafe for Map
impl Send for Map
impl Sync for Map
impl Unpin for Map
impl UnwindSafe for Map
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
fn overflowing_into(self) -> (U, bool)
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().