Struct glium_shapes::quad::QuadBuilder [] [src]

pub struct QuadBuilder { /* fields omitted */ }

Responsible for building and returning a Quad object.

By default, the resultant polygon will be a regular quad of length 2 on each side, with its centre at the origin, and aligned to face the negative Z-axis. The default position, size, and alignment can be overridden using the transformation methods on this object. These defaults are chosen such that the default quad can be used directly as geometry for screen-aligned effects.

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 the face.

Methods

impl QuadBuilder
[src]

Create a new QuadBuilder 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 Quad object.

Build the Quad vertices and return them in a vector.

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

Trait Implementations

impl Default for QuadBuilder
[src]

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