pub struct Mesh2D {
pub position: Vec3,
pub size: Vec2,
pub vertices: Vec<Mesh2DVertex>,
pub indices: Vec<u32>,
pub vbo_store_id: Index,
pub order: DrawOrder,
pub render_layer: u32,
pub high_index: u32,
pub order_override: Option<Vec3>,
pub changed: bool,
}Expand description
2D Meshs to render to screen.
Fields§
§position: Vec3Position on the Screen.
size: Vec2Width and Height of the mesh.
vertices: Vec<Mesh2DVertex>Saved Verticies of the Mesh.
indices: Vec<u32>Saved indices of the mesh.
vbo_store_id: IndexMesh’s Vertex Buffer Store Index.
order: DrawOrderthe draw order of the rect. created/updated when update is called.
render_layer: u32Rendering Layer of the rect used in DrawOrder.
high_index: u32Index Max Generated by the Mesh Builder.
order_override: Option<Vec3>Overides the absolute order values based on position.
changed: boolImplementations§
Source§impl Mesh2D
impl Mesh2D
Sourcepub fn new(renderer: &mut GpuRenderer, render_layer: u32) -> Self
pub fn new(renderer: &mut GpuRenderer, render_layer: u32) -> Self
Creates a new Mesh2D with rendering layer.
Sourcepub fn unload(&self, renderer: &mut GpuRenderer)
pub fn unload(&self, renderer: &mut GpuRenderer)
Unloads the Mesh2D from the Instance Buffers Store.
Sourcepub fn set_order_override(&mut self, order_override: Option<Vec3>) -> &mut Self
pub fn set_order_override(&mut self, order_override: Option<Vec3>) -> &mut Self
Updates the Mesh2D’s order_override.
Sourcepub fn from_builder(&mut self, builder: &Mesh2DBuilder)
pub fn from_builder(&mut self, builder: &Mesh2DBuilder)
Clears and Builds Mesh’s from the Mesh2DBuilder into the Mesh2D.
Sourcepub fn append_from_builder(&mut self, builder: &Mesh2DBuilder)
pub fn append_from_builder(&mut self, builder: &Mesh2DBuilder)
Appends Mesh’s from the Mesh2DBuilder into the Mesh2D.
pub fn clear(&mut self)
Sourcepub fn set_position(&mut self, position: Vec3) -> &mut Self
pub fn set_position(&mut self, position: Vec3) -> &mut Self
Sets the Mesh2D’s Position.
Sourcepub fn create_quad(&mut self, renderer: &mut GpuRenderer)
pub fn create_quad(&mut self, renderer: &mut GpuRenderer)
Updates the Mesh2D’s Buffers to prepare them for rendering.
Sourcepub fn update(&mut self, renderer: &mut GpuRenderer) -> OrderedIndex
pub fn update(&mut self, renderer: &mut GpuRenderer) -> OrderedIndex
Used to check and update the vertex array.
Returns a OrderedIndex used in Rendering.
Sourcepub fn check_mouse_bounds(&self, mouse_pos: Vec2) -> bool
pub fn check_mouse_bounds(&self, mouse_pos: Vec2) -> bool
Checks if Mouse position is within the Mesh2D’s Bounds.
Auto Trait Implementations§
impl Freeze for Mesh2D
impl RefUnwindSafe for Mesh2D
impl Send for Mesh2D
impl Sync for Mesh2D
impl Unpin for Mesh2D
impl UnwindSafe for Mesh2D
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
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>
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>
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)
&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)
&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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 more