[−][src]Struct kiss3d::scene::PlanarSceneNode
A node of the scene graph.
This may represent a group of other nodes, and/or contain an object that can be rendered.
Methods
impl PlanarSceneNode
[src]
pub fn new(
local_scale: Vector2<f32>,
local_transform: Isometry2<f32>,
object: Option<PlanarObject>
) -> PlanarSceneNode
[src]
local_scale: Vector2<f32>,
local_transform: Isometry2<f32>,
object: Option<PlanarObject>
) -> PlanarSceneNode
Creates a new scene node that is not rooted.
pub fn new_empty() -> PlanarSceneNode
[src]
Creates a new empty, not rooted, node with identity transformations.
pub fn unlink(&mut self)
[src]
Removes this node from its parent.
pub fn data(&self) -> Ref<PlanarSceneNodeData>
[src]
The data of this scene node.
pub fn data_mut(&mut self) -> RefMut<PlanarSceneNodeData>
[src]
The data of this scene node.
pub fn add_group(&mut self) -> PlanarSceneNode
[src]
Adds a node without object to this node children.
pub fn add_child(&mut self, node: PlanarSceneNode)
[src]
pub fn add_object(
&mut self,
local_scale: Vector2<f32>,
local_transform: Isometry2<f32>,
object: PlanarObject
) -> PlanarSceneNode
[src]
&mut self,
local_scale: Vector2<f32>,
local_transform: Isometry2<f32>,
object: PlanarObject
) -> PlanarSceneNode
Adds a node containing an object to this node children.
pub fn add_rectangle(&mut self, wx: f32, wy: f32) -> PlanarSceneNode
[src]
Adds a rectangle as a children of this node. The rectangle is initially axis-aligned and centered at (0, 0).
Arguments
wx
- the rectangle extent along the x axiswy
- the rectangle extent along the y axis
pub fn add_circle(&mut self, r: f32) -> PlanarSceneNode
[src]
Adds a circle as a children of this node. The circle is initially centered at (0, 0, 0).
Arguments
r
- the circle radius
pub fn add_capsule(&mut self, r: f32, h: f32) -> PlanarSceneNode
[src]
Adds a 2D capsule as a children of this node. The capsule is initially centered at (0, 0).
Arguments
r
- the circle radius
pub fn add_geom_with_name(
&mut self,
geometry_name: &str,
scale: Vector2<f32>
) -> Option<PlanarSceneNode>
[src]
&mut self,
geometry_name: &str,
scale: Vector2<f32>
) -> Option<PlanarSceneNode>
Creates and adds a new object using the geometry registered as geometry_name
.
pub fn add_mesh(
&mut self,
mesh: Rc<RefCell<PlanarMesh>>,
scale: Vector2<f32>
) -> PlanarSceneNode
[src]
&mut self,
mesh: Rc<RefCell<PlanarMesh>>,
scale: Vector2<f32>
) -> PlanarSceneNode
Creates and adds a new object to this node children using a 2D mesh.
pub fn add_convex_polygon(
&mut self,
polygon: Vec<Point2<f32>>,
scale: Vector2<f32>
) -> PlanarSceneNode
[src]
&mut self,
polygon: Vec<Point2<f32>>,
scale: Vector2<f32>
) -> PlanarSceneNode
Creates and adds a new object to this node children using a convex polyline
pub fn apply_to_scene_nodes_mut<F: FnMut(&mut PlanarSceneNode)>(
&mut self,
f: &mut F
)
[src]
&mut self,
f: &mut F
)
Applies a closure to each object contained by this node and its children.
pub fn apply_to_scene_nodes<F: FnMut(&PlanarSceneNode)>(&self, f: &mut F)
[src]
Applies a closure to each object contained by this node and its children.
pub fn render(&mut self, camera: &mut dyn PlanarCamera)
[src]
Render the scene graph rooted by this node.
pub fn set_material(
&mut self,
material: Rc<RefCell<Box<dyn PlanarMaterial + 'static>>>
)
[src]
&mut self,
material: Rc<RefCell<Box<dyn PlanarMaterial + 'static>>>
)
Sets the material of the objects contained by this node and its children.
pub fn set_material_with_name(&mut self, name: &str)
[src]
Sets the material of the objects contained by this node and its children.
pub fn set_lines_width(&mut self, width: f32)
[src]
Sets the width of the lines drawn for the objects contained by this node and its children.
pub fn set_points_size(&mut self, size: f32)
[src]
Sets the size of the points drawn for the objects contained by this node and its children.
pub fn set_surface_rendering_activation(&mut self, active: bool)
[src]
Activates or deactivates the rendering of the surfaces of the objects contained by this node and its children.
pub fn enable_backface_culling(&mut self, active: bool)
[src]
Activates or deactivates backface culling for the objects contained by this node and its children.
pub fn modify_vertices<F: FnMut(&mut Vec<Point2<f32>>)>(&mut self, f: &mut F)
[src]
Mutably accesses the vertices of the objects contained by this node and its children.
The provided closure is called once per object.
pub fn read_vertices<F: FnMut(&[Point2<f32>])>(&self, f: &mut F)
[src]
Accesses the vertices of the objects contained by this node and its children.
The provided closure is called once per object.
pub fn modify_faces<F: FnMut(&mut Vec<Point3<u16>>)>(&mut self, f: &mut F)
[src]
Mutably accesses the faces of the objects contained by this node and its children.
The provided closure is called once per object.
pub fn read_faces<F: FnMut(&[Point3<u16>])>(&self, f: &mut F)
[src]
Accesses the faces of the objects contained by this node and its children.
The provided closure is called once per object.
pub fn modify_uvs<F: FnMut(&mut Vec<Point2<f32>>)>(&mut self, f: &mut F)
[src]
Mutably accesses the texture coordinates of the objects contained by this node and its children.
The provided closure is called once per object.
pub fn read_uvs<F: FnMut(&[Point2<f32>])>(&self, f: &mut F)
[src]
Accesses the texture coordinates of the objects contained by this node and its children.
The provided closure is called once per object.
pub fn is_visible(&self) -> bool
[src]
Get the visibility status of node.
pub fn set_visible(&mut self, visible: bool)
[src]
Sets the visibility of this node.
The node and its children are not rendered if it is not visible.
pub fn set_color(&mut self, r: f32, g: f32, b: f32)
[src]
Sets the color of the objects contained by this node and its children.
Colors components must be on the range [0.0, 1.0]
.
pub fn set_texture_from_file(&mut self, path: &Path, name: &str)
[src]
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 diskname
- &str to identify this texture inTextureManager
pub fn set_texture_from_memory(&mut self, image_data: &[u8], name: &str)
[src]
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
image_data
- slice of bytes containing encoded imagename
- &str to identify this texture inTextureManager
pub fn set_texture_with_name(&mut self, name: &str)
[src]
Sets the texture of the objects contained by this node and its children.
The texture must already have been registered as name
.
pub fn set_texture(&mut self, texture: Rc<Texture>)
[src]
Sets the texture of the objects contained by this node and its children.
pub fn set_local_scale(&mut self, sx: f32, sy: f32)
[src]
Sets the local scaling factors of the object.
pub fn append_transformation(&mut self, t: &Isometry2<f32>)
[src]
Appends a transformation to this node local transformation.
pub fn prepend_to_local_transformation(&mut self, t: &Isometry2<f32>)
[src]
Prepends a transformation to this node local transformation.
pub fn set_local_transformation(&mut self, t: Isometry2<f32>)
[src]
Set this node local transformation.
pub fn append_translation(&mut self, t: &Translation2<f32>)
[src]
Appends a translation to this node local transformation.
pub fn prepend_to_local_translation(&mut self, t: &Translation2<f32>)
[src]
Prepends a translation to this node local transformation.
pub fn set_local_translation(&mut self, t: Translation2<f32>)
[src]
Sets the local translation of this node.
pub fn append_rotation(&mut self, r: &UnitComplex<f32>)
[src]
Appends a rotation to this node local transformation.
pub fn append_rotation_wrt_center(&mut self, r: &UnitComplex<f32>)
[src]
Appends a rotation to this node local transformation.
pub fn prepend_to_local_rotation(&mut self, r: &UnitComplex<f32>)
[src]
Prepends a rotation to this node local transformation.
pub fn set_local_rotation(&mut self, r: UnitComplex<f32>)
[src]
Sets the local rotation of this node.
Trait Implementations
impl Clone for PlanarSceneNode
[src]
fn clone(&self) -> PlanarSceneNode
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !Send for PlanarSceneNode
impl !Sync for PlanarSceneNode
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
Sets value
as a parameter of self
.
impl<T> Same for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> Downcast for T where
T: Any,
T: Any,