Struct three_d::core::InstancedMesh[][src]

pub struct InstancedMesh { /* fields omitted */ }
👎 Deprecated:

Use InstancedModel instead

Expand description

Similar to Mesh, except it is possible to render many instances of the same triangle mesh efficiently.

Implementations

Constructs a new InstancedMesh from the given CPUMesh. The mesh is rendered in as many instances as there are transformation matrices in the transformations parameter. Each instance is transformed with the given transformation before it is rendered. The transformations can be updated by the update_transformations function.

Render the instanced mesh with the given Program. Must be called in a render target render function, for example in the callback function of Screen::write.

Errors

Will return an error if the program requires a certain attribute and the instanced mesh does not have that attribute. For example if the program needs the normal to calculate lighting, but the mesh does not have per vertex normals, this function will return an error.

Updates the transformations applied to each mesh instance before they are rendered. The mesh is rendered in as many instances as there are transformation matrices.

Methods from Deref<Target = Mesh>

👎 Deprecated:

Use Model instead

Returns the local to world transformation of this mesh.

👎 Deprecated:

Use Model instead

Set the local to world transformation of this mesh.

👎 Deprecated:

Instead, use render_forward in Model or use Program and send attributes and uniforms self

Render the mesh with the given Program. Must be called in a render target render function, for example in the callback function of Screen::write.

Errors

Will return an error if the program requires a certain attribute and the mesh does not have that attribute data. For example if the program needs the normal to calculate lighting, but the mesh does not have per vertex normals, this function will return an error.

👎 Deprecated:

Use Model instead

Computes the axis aligned bounding box for this mesh.

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more