pub(crate) struct Mesh {
pub(crate) max_length: f64,
pub(crate) model_matrix: Matrix4<f32>,
pub(crate) boundary_indices: Option<Vec<u32>>,
binder: Binder,
pub(crate) indices: Array1<u32>,
pub(crate) vertices: Array1<f64>,
}
Expand description
General Information
Representation of a plane figure / 3d body. Contains information to draw to screen and move/rotate mesh representation to final position.
Fields
max_length
- Maximum length of figure. Used to center camera arround objective.model_matrix
- Translates and rotates object to final world position.binder
- vao, vbo and ebo variables bound to mesh drawable in GPU.indices
- Indices that map to vertices. Normally used in triads. Specified in gl configuration.vertices
- Vertices in 3d space. Normally used in sextuples (coordinate and color). Specified in gl configuration.
Fields§
§max_length: f64
§model_matrix: Matrix4<f32>
§boundary_indices: Option<Vec<u32>>
§binder: Binder
§indices: Array1<u32>
§vertices: Array1<f64>
Implementations§
source§impl Mesh
impl Mesh
sourcepub fn get_model_matrix(&self) -> &Matrix4<f32>
pub fn get_model_matrix(&self) -> &Matrix4<f32>
Getter for model_matrix
sourcepub fn builder<B>(location: B) -> MeshBuilderwhere
B: AsRef<str>,
pub fn builder<B>(location: B) -> MeshBuilderwhere
B: AsRef<str>,
Creates new instance of builder
sourcepub(crate) fn filter_for_solving_1d(&self) -> Array1<f64>
pub(crate) fn filter_for_solving_1d(&self) -> Array1<f64>
Filtering vertices to give to 1d solver. Temporal function. To be changed for better solution.
sourcepub(crate) fn update_gradient_1d(&mut self, velocity_norm: Vec<f64>)
pub(crate) fn update_gradient_1d(&mut self, velocity_norm: Vec<f64>)
Improvable solution to move gradient updating out of dzahui window. Probably will be changed in the future. Obtains max and min of solution (normallly some sort of rate of change), divides every element by the difference and then multiplies them by pi/2 so that, when calculating their sine and cosine, there’s a mapping between max velocity <-> red and min velocity <-> blue
Trait Implementations§
source§impl Bindable for Mesh
impl Bindable for Mesh
source§impl Drawable for Mesh
impl Drawable for Mesh
source§fn get_indices(&self) -> Result<&Array1<u32>, Error>
fn get_indices(&self) -> Result<&Array1<u32>, Error>
Creates a way to obtain indices to draw vertices (and triangles). Getter.
source§fn get_vertices(&self) -> Result<Array1<f32>, Error>
fn get_vertices(&self) -> Result<Array1<f32>, Error>
Creates a way to obtain vertices from drawable object. Getter.