Struct kiss3d::scene::Object
[−]
[src]
pub struct Object { /* fields omitted */ }
A 3d objects on the scene.
This is the only interface to manipulate the object position, color, vertices and texture.
Methods
impl Object
[src]
fn data(&self) -> &ObjectData
Gets the data of this object.
fn data_mut(&mut self) -> &mut ObjectData
Gets the data of this object.
fn enable_backface_culling(&mut self, active: bool)
Enables or disables backface culling for this object.
fn set_user_data(&mut self, user_data: Box<Any + 'static>)
Attaches user-defined data to this object.
fn material(&self) -> Rc<RefCell<Box<Material + 'static>>>
Gets the material of this object.
fn set_material(&mut self, material: Rc<RefCell<Box<Material + 'static>>>)
Sets the material of this object.
fn set_lines_width(&mut self, width: f32)
Sets the width of the lines drawn for this object.
fn lines_width(&self) -> f32
Returns the width of the lines drawn for this object.
fn set_points_size(&mut self, size: f32)
Sets the size of the points drawn for this object.
fn points_size(&self) -> f32
Returns the size of the points drawn for this object.
fn set_surface_rendering_activation(&mut self, active: bool)
Activate or deactivate the rendering of this object surface.
fn surface_rendering_activation(&self) -> bool
Activate or deactivate the rendering of this object surface.
fn mesh(&self) -> &Rc<RefCell<Mesh>>
This object's mesh.
fn modify_vertices<F: FnMut(&mut Vec<Point3<GLfloat>>)>(&mut self, f: &mut F)
Mutably access the object's vertices.
fn read_vertices<F: FnMut(&[Point3<GLfloat>])>(&self, f: &mut F)
Access the object's vertices.
fn recompute_normals(&mut self)
Recomputes the normals of this object's mesh.
fn modify_normals<F: FnMut(&mut Vec<Vector3<GLfloat>>)>(&mut self, f: &mut F)
Mutably access the object's normals.
fn read_normals<F: FnMut(&[Vector3<GLfloat>])>(&self, f: &mut F)
Access the object's normals.
fn modify_faces<F: FnMut(&mut Vec<Point3<GLuint>>)>(&mut self, f: &mut F)
Mutably access the object's faces.
fn read_faces<F: FnMut(&[Point3<GLuint>])>(&self, f: &mut F)
Access the object's faces.
fn modify_uvs<F: FnMut(&mut Vec<Point2<GLfloat>>)>(&mut self, f: &mut F)
Mutably access the object's texture coordinates.
fn read_uvs<F: FnMut(&[Point2<GLfloat>])>(&self, f: &mut F)
Access the object's texture coordinates.
fn set_color(&mut self, r: f32, g: f32, b: f32)
Sets the color of the object.
Colors components must be on the range [0.0, 1.0]
.
fn set_texture_from_file(&mut self, path: &Path, name: &str)
Sets the texture of the object.
The texture is loaded from a file and registered by the global TextureManager
.
Arguments
path
- relative path of the texture on the disk
fn set_texture_with_name(&mut self, name: &str)
Sets the texture of the object.
The texture must already have been registered as name
.
fn set_texture(&mut self, texture: Rc<Texture>)
Sets the texture of the object.