pub struct Gm<G: Geometry, M: Material> {
    pub geometry: G,
    pub material: M,
}
Expand description

A combination of a Geometry and a Material which implements Object. Use this to combine any geometry and material into an object that can be used in a render function for example render_pass. The only requirement is that the geometry provides all the per vertex information (normals, uv coordinates, etc.) that the material requires.

Fields

geometry: G

The geometry

material: M

The material applied to the geometry

Implementations

Creates a new 3D model with a Mesh as geometry and a default ColorMaterial.

Creates a new 3D model with a Mesh as geometry and the given material.

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.

Creates a new instanced 3D model with a triangle mesh as geometry and the given material. 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.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Returns the AxisAlignedBoundingBox for this geometry in the global coordinate system. Read more

Render the geometry with the given material. Must be called in a render target render function, for example in the callback function of Screen::write. You can use an empty array for the lights argument, if you know the object does not require lights to be rendered. Read more

Render the object. Must be called in a render target render function, for example in the callback function of Screen::write. You can use an empty array for the lights argument, if you know the object does not require lights to be rendered. Read more

Returns whether or not this object should be considered transparent. Read more

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

Returns the argument unchanged.

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

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

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