Struct glium_shapes::cuboid::CuboidBuilder [] [src]

pub struct CuboidBuilder { /* fields omitted */ }

Responsible for building and returning a Cuboid object.

By default, the cuboid is defined as a unit-cube with its centre-of-mass located at the origin. This can be overriden using the transformation methods on this object.

The resultant geometry is constructed to suit OpenGL defaults - assuming a right-handed coordinate system, front-facing polygons are defined in counter-clock-wise order. Vertex normals point in the direction of their respective face (such that the shape appears faceted when lit). Vertex texture coordinates define a planar-projection on each face.

Methods

impl CuboidBuilder
[src]

Create a new CuboidBuilder object.

Apply a scaling transformation to the shape.

The scale, translate, and rotate functions accumulate, and are not commutative. The transformation functions are intended to provide flexibility in model-space. For per-instance world-space transformations, one should prefer to share as few shapes as possible across multiple instances, and instead rely on uniform constants in the shader and/or instanced drawing.

Apply a translation transformation to the shape.

The scale, translate, and rotate functions accumulate, and are not commutative. The transformation functions are intended to provide flexibility in model-space. For per-instance world-space transformations, one should prefer to share as few shapes as possible across multiple instances, and instead rely on uniform constants in the shader and/or instanced drawing.

Apply a rotation transformation to the shape about the x-axis.

The scale, translate, and rotate functions accumulate, and are not commutative. The transformation functions are intended to provide flexibility in model-space. For per-instance world-space transformations, one should prefer to share as few shapes as possible across multiple instances, and instead rely on uniform constants in the shader and/or instanced drawing.

Apply a rotation transformation to the shape about the y-axis.

The scale, translate, and rotate functions accumulate, and are not commutative. The transformation functions are intended to provide flexibility in model-space. For per-instance world-space transformations, one should prefer to share as few shapes as possible across multiple instances, and instead rely on uniform constants in the shader and/or instanced drawing.

Apply a rotation transformation to the shape about the z-axis.

The scale, translate, and rotate functions accumulate, and are not commutative. The transformation functions are intended to provide flexibility in model-space. For per-instance world-space transformations, one should prefer to share as few shapes as possible across multiple instances, and instead rely on uniform constants in the shader and/or instanced drawing.

Build a new Cuboid object.

Build the shape vertices and return them in a vector.

Useful if you wish to do other things with the vertices besides constructing a Cuboid object (e.g. unit testing, further processing, etc).

Trait Implementations

impl Default for CuboidBuilder
[src]

Returns the "default value" for a type. Read more