pub struct Model {
pub vertices: Vec<Vertex>,
pub t: Vec<Tf>,
}Expand description
A model (a model is a shape).
1 model = 1 entity.
This is what fn new() of specific models return.
verticesare the vertices of the model, each group of threeVertexforming a triangle.tare the runtime transformations of the model.
Fields§
§vertices: Vec<Vertex>§t: Vec<Tf>Implementations§
Source§impl Model
impl Model
Sourcepub fn from_merge(models: Vec<Model>) -> Self
pub fn from_merge(models: Vec<Model>) -> Self
Merges several models into one single entity, with empty transformations.
Sourcepub fn from_vertices(vertices: Vec<Vertex>) -> Self
pub fn from_vertices(vertices: Vec<Vertex>) -> Self
Creates a single entity from the given vertices, with empty transformations. The number of vertices should (most likely) be a multiple of 3.
Sourcepub fn transform(self, transformation: Transformation) -> Self
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.
Sourcepub fn recolor(self, colorization: Colorization) -> Self
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.
Sourcepub fn evolution_c(self, e: Evolution) -> Self
pub fn evolution_c(self, e: Evolution) -> Self
Modifies the speed evolution of the latest colorization added.
Sourcepub fn start_c(self, start: f32) -> Self
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.
Sourcepub fn end_c(self, end: f32) -> Self
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.
Sourcepub fn evolution_t(self, e: Evolution) -> Self
pub fn evolution_t(self, e: Evolution) -> Self
Modifies the speed evolution of the latest transformation added.