pub type InstancedModel<M> = Gm<InstancedMesh, M>;Expand description
Similar to Model, except it is possible to render many instances of the same model efficiently.
Implementations
sourceimpl InstancedModel<ColorMaterial>
impl InstancedModel<ColorMaterial>
sourcepub fn new(
context: &Context,
instances: &[Instance],
cpu_mesh: &CpuMesh
) -> ThreeDResult<Self>
pub fn new(
context: &Context,
instances: &[Instance],
cpu_mesh: &CpuMesh
) -> ThreeDResult<Self>
Creates a new instanced 3D model with a triangle mesh as geometry and a default ColorMaterial. The model is rendered in as many instances as there are Instance structs given as input. The transformation and texture transform in Instance are applied to each model instance before they are rendered.