Struct kiss3d::scene::SceneNodeData
[−]
[src]
pub struct SceneNodeData { /* fields omitted */ }
The datas contained by a SceneNode
.
Methods
impl SceneNodeData
[src]
fn has_object(&self) -> bool
Whether this node contains an Object
.
fn is_root(&self) -> bool
Whether this node has no parent.
fn render(&mut self, pass: usize, camera: &mut Camera, light: &Light)
Render the scene graph rooted by this node.
fn object(&self) -> Option<&Object>
A reference to the object possibly contained by this node.
fn object_mut(&mut self) -> Option<&mut Object>
A mutable reference to the object possibly contained by this node.
fn get_object(&self) -> &Object
A reference to the object possibly contained by this node.
Failure
Fails of this node does not contains an object.
fn get_object_mut(&mut self) -> &mut Object
A mutable reference to the object possibly contained by this node.
Failure
Fails of this node does not contains an object.
fn set_material(&mut self, material: Rc<RefCell<Box<Material + 'static>>>)
Sets the material of the objects contained by this node and its children.
fn set_material_with_name(&mut self, name: &str)
Sets the material of the objects contained by this node and its children.
The material must already have been registered as name
.
fn set_lines_width(&mut self, width: f32)
Sets the width of the lines drawn for the objects contained by this node and its children.
fn set_points_size(&mut self, size: f32)
Sets the size of the points drawn for the objects contained by this node and its children.
fn set_surface_rendering_activation(&mut self, active: bool)
Activates or deactivates the rendering of the surfaces of the objects contained by this node and its children.
fn enable_backface_culling(&mut self, active: bool)
Activates or deactivates backface culling for the objects contained by this node and its children.
fn modify_vertices<F: FnMut(&mut Vec<Point3<f32>>)>(&mut self, f: &mut F)
Mutably accesses the vertices of the objects contained by this node and its children.
The provided closure is called once per object.
fn read_vertices<F: FnMut(&[Point3<f32>])>(&self, f: &mut F)
Accesses the vertices of the objects contained by this node and its children.
The provided closure is called once per object.
fn recompute_normals(&mut self)
Recomputes the normals of the meshes of the objects contained by this node and its children.
fn modify_normals<F: FnMut(&mut Vec<Vector3<f32>>)>(&mut self, f: &mut F)
Mutably accesses the normals of the objects contained by this node and its children.
The provided closure is called once per object.
fn read_normals<F: FnMut(&[Vector3<f32>])>(&self, f: &mut F)
Accesses the normals of the objects contained by this node and its children.
The provided closure is called once per object.
fn modify_faces<F: FnMut(&mut Vec<Point3<u32>>)>(&mut self, f: &mut F)
Mutably accesses the faces of the objects contained by this node and its children.
The provided closure is called once per object.
fn read_faces<F: FnMut(&[Point3<u32>])>(&self, f: &mut F)
Accesses the faces of the objects contained by this node and its children.
The provided closure is called once per object.
fn modify_uvs<F: FnMut(&mut Vec<Point2<f32>>)>(&mut self, f: &mut F)
Mutably accesses the texture coordinates of the objects contained by this node and its children.
The provided closure is called once per object.
fn read_uvs<F: FnMut(&[Point2<f32>])>(&self, f: &mut F)
Accesses the texture coordinates of the objects contained by this node and its children.
The provided closure is called once per object.
fn is_visible(&self) -> bool
Get the visibility status of node.
fn set_visible(&mut self, visible: bool)
Sets the visibility of this node.
The node and its children are not rendered if it is not visible.
fn set_color(&mut self, r: f32, g: f32, b: f32)
Sets the color of the objects contained by this node and its children.
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 objects contained by this node and its children.
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 objects contained by this node and its children.
The texture must already have been registered as name
.
fn set_texture(&mut self, texture: Rc<Texture>)
Sets the texture of the objects contained by this node and its children.
fn apply_to_objects_mut<F: FnMut(&mut Object)>(&mut self, f: &mut F)
Applies a closure to each object contained by this node and its children.
fn apply_to_objects<F: FnMut(&Object)>(&self, f: &mut F)
Applies a closure to each object contained by this node and its children.
fn set_local_scale(&mut self, sx: f32, sy: f32, sz: f32)
Sets the local scaling factors of the object.
fn local_scale(&self) -> Vector3<f32>
Returns the scaling factors of the object.
fn reorient(&mut self, eye: &Point3<f32>, at: &Point3<f32>, up: &Vector3<f32>)
Move and orient the object such that it is placed at the point eye
and have its z
axis
oriented toward at
.
fn local_transformation(&self) -> Isometry3<f32>
This node local transformation.
fn inverse_local_transformation(&self) -> Isometry3<f32>
Inverse of this node local transformation.
fn world_transformation(&self) -> Isometry3<f32>
This node world transformation.
This will force an update of the world transformation of its parents if they have been invalidated.
fn inverse_world_transformation(&self) -> Isometry3<f32>
The inverse of this node world transformation.
This will force an update of the world transformation of its parents if they have been invalidated.
fn append_transformation(&mut self, t: &Isometry3<f32>)
Appends a transformation to this node local transformation.
fn prepend_to_local_transformation(&mut self, t: &Isometry3<f32>)
Prepends a transformation to this node local transformation.
fn set_local_transformation(&mut self, t: Isometry3<f32>)
Set this node local transformation.
fn local_translation(&self) -> Translation3<f32>
This node local translation.
fn inverse_local_translation(&self) -> Translation3<f32>
The inverse of this node local translation.
fn append_translation(&mut self, t: &Translation3<f32>)
Appends a translation to this node local transformation.
fn prepend_to_local_translation(&mut self, t: &Translation3<f32>)
Prepends a translation to this node local transformation.
fn set_local_translation(&mut self, t: Translation3<f32>)
Sets the local translation of this node.
fn local_rotation(&self) -> UnitQuaternion<f32>
This node local rotation.
fn inverse_local_rotation(&self) -> UnitQuaternion<f32>
The inverse of this node local rotation.
fn append_rotation(&mut self, r: &UnitQuaternion<f32>)
Appends a rotation to this node local transformation.
fn append_rotation_wrt_center(&mut self, r: &UnitQuaternion<f32>)
Appends a rotation to this node local transformation.
fn prepend_to_local_rotation(&mut self, r: &UnitQuaternion<f32>)
Prepends a rotation to this node local transformation.
fn set_local_rotation(&mut self, r: UnitQuaternion<f32>)
Sets the local rotation of this node.