Struct truck_rendimpl::PolygonInstance
source · [−]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
sourceimpl PolygonInstance
impl PolygonInstance
sourcepub fn clone_instance(&self) -> PolygonInstance
pub fn clone_instance(&self) -> PolygonInstance
Clone the instance as another drawn element.
sourcepub fn instance_state(&self) -> &PolygonState
pub 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
sourceimpl Debug for PolygonInstance
impl Debug for PolygonInstance
sourceimpl Rendered for PolygonInstance
impl Rendered for PolygonInstance
sourcefn 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).
sourcefn bind_group_layout(
&self,
device_handler: &DeviceHandler
) -> Arc<BindGroupLayout>
fn bind_group_layout(
&self,
device_handler: &DeviceHandler
) -> Arc<BindGroupLayout>
Creates the bind group layout.
sourcefn 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.
sourcefn 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.
sourceimpl ToInstance<PolygonInstance> for PolygonMesh
impl ToInstance<PolygonInstance> for PolygonMesh
type State = PolygonState
type State = PolygonState
Configuation deacriptor for instance.
sourcefn 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.
sourceimpl ToInstance<PolygonInstance> for StructuredMesh
impl ToInstance<PolygonInstance> for StructuredMesh
type State = PolygonState
type State = PolygonState
Configuation deacriptor for instance.
sourcefn 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 !RefUnwindSafe for PolygonInstance
impl Send for PolygonInstance
impl Sync for PolygonInstance
impl Unpin for PolygonInstance
impl !UnwindSafe for PolygonInstance
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more