Struct ark_api::render::RenderMeshInstanceBuilder
source · pub struct RenderMeshInstanceBuilder { /* private fields */ }Expand description
Creates RenderMeshInstance through the builder pattern
Implementations§
source§impl RenderMeshInstanceBuilder
impl RenderMeshInstanceBuilder
sourcepub fn new(mesh: &RenderMesh) -> Self
pub fn new(mesh: &RenderMesh) -> Self
Creates a new builder from a RenderMesh.
sourcepub fn with_world_transform(&mut self, world_transform: &Mat4) -> &mut Self
pub fn with_world_transform(&mut self, world_transform: &Mat4) -> &mut Self
Set world transform. Default is Mat4::IDENTITY
sourcepub fn with_style(&mut self, style: &RenderMeshStyle) -> &mut Self
pub fn with_style(&mut self, style: &RenderMeshStyle) -> &mut Self
Set the style. Default is RenderMeshStyle::default()
sourcepub fn with_instance_id(&mut self, instance_id: InstanceId) -> &mut Self
pub fn with_instance_id(&mut self, instance_id: InstanceId) -> &mut Self
Set the instance id. Default is 0 which means no instance id.
sourcepub fn with_materials_offset(&mut self, offset: u32) -> &mut Self
pub fn with_materials_offset(&mut self, offset: u32) -> &mut Self
Set the materials offset. Default is 0.
This is the offset the instance will use to read into the material overrides provided with Render::draw_meshes_with_materials.
sourcepub fn with_materials_len(&mut self, len: u32) -> &mut Self
pub fn with_materials_len(&mut self, len: u32) -> &mut Self
Set the materials length. Default is 0.
This is the number of material overrides the instance will use Render::draw_meshes_with_materials.
By default it will take all materials after the offset
sourcepub fn with_mesh_styles_index(&mut self, idx: u32) -> &mut Self
pub fn with_mesh_styles_index(&mut self, idx: u32) -> &mut Self
Set the materials offset. Default is 0.
This is the index of the mesh style in the mesh_style_overrides list passed into Render::draw_meshes_with_materials_and_styles.
If the index is not valid in the overrides list it will use the RenderMeshInstance::style variable instead.
sourcepub fn build(&self) -> RenderMeshInstance
pub fn build(&self) -> RenderMeshInstance
Builds the mesh instance
Trait Implementations§
source§impl Clone for RenderMeshInstanceBuilder
impl Clone for RenderMeshInstanceBuilder
source§fn clone(&self) -> RenderMeshInstanceBuilder
fn clone(&self) -> RenderMeshInstanceBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more