Vertex

Struct Vertex 

Source
pub struct Vertex {
    pub position: [f32; 3],
    pub color: [f32; 4],
    pub t: Vec<Tf>,
    pub c: Vec<Cl>,
}
Expand description

A vertex with:

  • its id. Changing it manually has no effect;
  • the id of the entity it belongs to. Changing it manually has no effect;
  • a 3D XYZ position;
  • an RGBA color;
  • (A Vec of transformations);

Vertices enable building Triangles, which enable building all other shapes.

Fields§

§position: [f32; 3]

The position of the vertex.

§color: [f32; 4]

The color of the vertex, in RGBA format.

§t: Vec<Tf>§c: Vec<Cl>

Implementations§

Source§

impl Vertex

Source

pub fn new() -> Self

A new default Vertex. Call this method to initialize a vertex, before transforming it.

§Don’t

DO NOT call this function in multithreaded scenarios, as it calls static mut. See the crate root.

Source

pub fn pos(self, x: f32, y: f32, z: f32) -> Self

Modifies the position of the vertex to (x, y, z).

Source

pub fn r(self, red: f32) -> Self

Modifies the red color channel of the vertex color.

Source

pub fn g(self, green: f32) -> Self

Modifies the green color channel of the vertex color.

Source

pub fn b(self, blue: f32) -> Self

Modifies the blue color channel of the vertex color.

Source

pub fn a(self, alpha: f32) -> Self

Modifies the alpha color channel of the vertex color.

Source

pub fn rgb(self, red: f32, green: f32, blue: f32) -> Self

Modifies the red, green and blue color channels of the vertex color.

Source

pub fn rgba(self, red: f32, green: f32, blue: f32, alpha: f32) -> Self

Modifies the red, green, blue and alpha color channels of the vertex color.

Source

pub fn transform(self, transformation: Transformation) -> Self

Adds a new transformation with default speed evolution, start time and end time.

§Don’t

DO NOT call this function in multithreaded scenarios, as it calls static mut. See the crate root.

Source

pub fn recolor(self, colorization: Colorization) -> Self

Adds a new color change with default speed evolution, start time and end time.

§Don’t

DO NOT call this function in multithreaded scenarios, as it calls static mut. See the crate root.

Source

pub fn evolution_c(self, e: Evolution) -> Self

Modifies the speed evolution of the latest colorization added.

Source

pub fn start_c(self, start: f32) -> Self

Modifies the start time of the latest colorization added. A start after an end will result in the colorization being instantaneous at start.

Source

pub fn end_c(self, end: f32) -> Self

Modifies the end time of the latest colorization added. An end before a start will result in the colorization being instantaneous at start.

Source

pub fn evolution_t(self, e: Evolution) -> Self

Modifies the speed evolution of the latest transformation added.

Source

pub fn start_t(self, start: f32) -> Self

Modifies the start time of the latest transformation added. A start after an end will result in the transformation being instantaneous at start.

Source

pub fn end_t(self, end: f32) -> Self

Modifies the end time of the latest transformation added. An end before a start will result in the transformation being instantaneous at start.

Auto Trait Implementations§

§

impl Freeze for Vertex

§

impl RefUnwindSafe for Vertex

§

impl Send for Vertex

§

impl Sync for Vertex

§

impl Unpin for Vertex

§

impl UnwindSafe for Vertex

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.