Struct glium_shapes::axes::AxesBuilder
[−]
[src]
pub struct AxesBuilder { /* fields omitted */ }
Responsible for building and returning an Axes
object.
By default, each orthogonal axis line is 1 unit in length, with the centre point 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. Vertex normals define the normalised direction of their respective axis line. Vertex texture coordinates encode end point in the U coordinate (a value of 0 or 1), and the axis number in the V coordinate (a value of 0, 1, or 2).
Methods
impl AxesBuilder
[src]
fn new() -> AxesBuilder
Create a new AxesBuilder
object.
fn scale(self, x: f32, y: f32, z: f32) -> Self
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.
fn translate(self, x: f32, y: f32, z: f32) -> Self
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.
fn rotate_x(self, radians: f32) -> Self
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.
fn rotate_y(self, radians: f32) -> Self
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.
fn rotate_z(self, radians: f32) -> Self
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.
fn build<F>(self, display: &F) -> Result<Axes, ShapeCreationError> where F: Facade
Build a new Axes
object.
fn build_vertices(&self) -> Result<Vec<Vertex>, ShapeCreationError>
Build the axes vertices and return them in a vector.
Useful if you wish to do other things with the vertices besides constructing
a Axes
object (e.g. unit testing, further processing, etc).
Trait Implementations
impl Default for AxesBuilder
[src]
fn default() -> AxesBuilder
Returns the "default value" for a type. Read more