pub struct RenderMeshInstanceBuilder { /* private fields */ }
Expand description

Creates RenderMeshInstance through the builder pattern

Implementations§

source§

impl RenderMeshInstanceBuilder

source

pub fn new(mesh: &RenderMesh) -> Self

Creates a new builder from a RenderMesh.

source

pub fn with_world_transform(&mut self, world_transform: &Mat4) -> &mut Self

Set world transform. Default is Mat4::IDENTITY

source

pub fn with_style(&mut self, style: &RenderMeshStyle) -> &mut Self

Set the style. Default is RenderMeshStyle::default()

source

pub fn with_instance_id(&mut self, instance_id: InstanceId) -> &mut Self

Set the instance id. Default is 0 which means no instance id.

source

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.

source

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

source

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.

source

pub fn build(&self) -> RenderMeshInstance

Builds the mesh instance

Trait Implementations§

source§

impl Clone for RenderMeshInstanceBuilder

source§

fn clone(&self) -> RenderMeshInstanceBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RenderMeshInstanceBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.