pub fn translate(&mut self, translation: Vec3)
    {
        for vertex_id in self.vertex_iter() {
            self.move_vertex_by(vertex_id, translation);
        }
    }
/// Translates the entire mesh by applying the `translation` to each vertex position.
///
/// # Examples
///
/// ```
/// # use tri_mesh::prelude::*;
/// #
/// # fn main() -> Result<(), Box<tri_mesh::mesh_builder::Error>> {
///     let mut mesh = MeshBuilder::new().cube().build()?;
/// #   let first_vertex_id = mesh.vertex_iter().next().unwrap();
/// #   let vertex_position_before = mesh.vertex_position(first_vertex_id);
///     mesh.translate(vec3(2.5, -1.0, 0.0));
/// #   let vertex_position_after = mesh.vertex_position(first_vertex_id);
/// #   assert_eq!(vertex_position_before + vec3(2.5, -1.0, 0.0), vertex_position_after);
/// #   mesh.is_valid().unwrap();
/// #   Ok(())
/// # }
/// ```
///
Translates the entire mesh by applying the `translation` to each vertex position.
Translates the entire mesh by applying the ` translation ` to each vertex position .
pub fn translate(&mut self, translation: Vec3)
    {
        for vertex_id in self.vertex_iter() {
            self.move_vertex_by(vertex_id, translation);
        }
    }
pub fn translate ( & mut self , translation : Vec3 ) { for vertex_id in self . vertex_iter ( ) { self . move_vertex_by ( vertex_id , translation ) ; } }
Translates the entire mesh by applying the `translation` to each vertex position.
Translates the entire mesh by applying the ` translation ` to each vertex position .
&mut self
translation
Vec3
&mut self
translation
Vec3
examples
None
use tri_mesh::prelude::*;
None
fn main() -> result<(), box<tri_mesh::mesh_builder::error>> {
let mut mesh = MeshBuilder::new().cube().build()?.
let mut mesh = MeshBuilder :: new () . cube () . build () ? .
let first_vertex_id = mesh.vertex_iter().next().unwrap();
None
let vertex_position_before = mesh.vertex_position(first_vertex_id);
None
let vertex_position_after = mesh.vertex_position(first_vertex_id);
None
assert_eq!(vertex_position_before + vec3(2.5, -1.0, 0.0), vertex_position_after);
None
mesh.is_valid().unwrap();
None
ok(())
None
}
None