pub struct PolygonInstance { /* private fields */ }Expand description
Instance of polygon
One can duplicate polygons with different postures and materials that have the same mesh data. To save memory, mesh data on the GPU can be used again.
The duplicated polygon by Clone::clone has the same mesh data and descriptor
with original, however, its render id is different from the one of original.
Implementations§
Source§impl PolygonInstance
impl PolygonInstance
Sourcepub fn clone_instance(&self) -> PolygonInstance
pub fn clone_instance(&self) -> PolygonInstance
Clone the instance as another drawn element.
Sourcepub const fn instance_state(&self) -> &PolygonState
pub const fn instance_state(&self) -> &PolygonState
Returns a reference to the instance descriptor.
Sourcepub fn instance_state_mut(&mut self) -> &mut PolygonState
pub fn instance_state_mut(&mut self) -> &mut PolygonState
Returns the mutable reference to instance descriptor.
Sourcepub fn swap_vertex(&mut self, other: &mut PolygonInstance)
pub fn swap_vertex(&mut self, other: &mut PolygonInstance)
swap vertex buffers and index buffers
Trait Implementations§
Source§impl Debug for PolygonInstance
impl Debug for PolygonInstance
Source§impl Rendered for PolygonInstance
impl Rendered for PolygonInstance
Source§fn vertex_buffer(
&self,
_: &DeviceHandler,
) -> (Arc<BufferHandler>, Option<Arc<BufferHandler>>)
fn vertex_buffer( &self, _: &DeviceHandler, ) -> (Arc<BufferHandler>, Option<Arc<BufferHandler>>)
Creates the pair (vertex buffer, index buffer).
Source§fn bind_group_layout(
&self,
device_handler: &DeviceHandler,
) -> Arc<BindGroupLayout>
fn bind_group_layout( &self, device_handler: &DeviceHandler, ) -> Arc<BindGroupLayout>
Creates the bind group layout.
Source§fn bind_group(
&self,
device_handler: &DeviceHandler,
layout: &BindGroupLayout,
) -> Arc<BindGroup>
fn bind_group( &self, device_handler: &DeviceHandler, layout: &BindGroupLayout, ) -> Arc<BindGroup>
Creates the bind group in
set = 1.Source§fn pipeline(
&self,
device_handler: &DeviceHandler,
layout: &PipelineLayout,
scene_desc: &SceneDescriptor,
) -> Arc<RenderPipeline>
fn pipeline( &self, device_handler: &DeviceHandler, layout: &PipelineLayout, scene_desc: &SceneDescriptor, ) -> Arc<RenderPipeline>
Creates the render pipeline.
Source§impl ToInstance<PolygonInstance> for PolygonMesh
impl ToInstance<PolygonInstance> for PolygonMesh
Source§type State = PolygonState
type State = PolygonState
Configuration descriptor for instance.
Source§fn to_instance(
&self,
handler: &DeviceHandler,
shaders: &PolygonShaders,
state: &PolygonState,
) -> PolygonInstance
fn to_instance( &self, handler: &DeviceHandler, shaders: &PolygonShaders, state: &PolygonState, ) -> PolygonInstance
Creates
Instance from self.Source§impl ToInstance<PolygonInstance> for StructuredMesh
impl ToInstance<PolygonInstance> for StructuredMesh
Source§type State = PolygonState
type State = PolygonState
Configuration descriptor for instance.
Source§fn to_instance(
&self,
handler: &DeviceHandler,
shaders: &PolygonShaders,
state: &PolygonState,
) -> PolygonInstance
fn to_instance( &self, handler: &DeviceHandler, shaders: &PolygonShaders, state: &PolygonState, ) -> PolygonInstance
Creates
Instance from self.impl Instance for PolygonInstance
Auto Trait Implementations§
impl Freeze for PolygonInstance
impl !RefUnwindSafe for PolygonInstance
impl Send for PolygonInstance
impl Sync for PolygonInstance
impl Unpin for PolygonInstance
impl !UnwindSafe for PolygonInstance
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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> 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> 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>
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 more