pub struct SceneNode { /* private fields */ }
Expand description

A node of the scene graph.

This may represent a group of other nodes, and/or contain an object that can be rendered.

Implementations

Creates a new scene node that is not rooted.

Creates a new empty, not rooted, node with identity transformations.

Removes this node from its parent.

The data of this scene node.

The data of this scene node.

Adds a node without object to this node children.

Adds a node as a child of parent.

Failures:

Fails if node already has a parent.

Adds a node containing an object to this node children.

Adds a cube as a children of this node. The cube is initially axis-aligned and centered at (0, 0, 0).

Arguments
  • wx - the cube extent along the x axis
  • wy - the cube extent along the y axis
  • wz - the cube extent along the z axis

Adds a sphere as a children of this node. The sphere is initially centered at (0, 0, 0).

Arguments
  • r - the sphere radius

Adds a cone to the scene. The cone is initially centered at (0, 0, 0) and points toward the positive y axis.

Arguments
  • h - the cone height
  • r - the cone base radius

Adds a cylinder to this node children. The cylinder is initially centered at (0, 0, 0) and has its principal axis aligned with the y axis.

Arguments
  • h - the cylinder height
  • r - the cylinder base radius

Adds a capsule to this node children. The capsule is initially centered at (0, 0, 0) and has its principal axis aligned with the y axis.

Arguments
  • h - the capsule height
  • r - the capsule caps radius

Adds a double-sided quad to this node children. The quad is initially centered at (0, 0, 0). The quad itself is composed of a user-defined number of triangles regularly spaced on a grid. This is the main way to draw height maps.

Arguments
  • w - the quad width.
  • h - the quad height.
  • wsubdivs - number of horizontal subdivisions. This correspond to the number of squares which will be placed horizontally on each line. Must not be 0.
  • hsubdivs - number of vertical subdivisions. This correspond to the number of squares which will be placed vertically on each line. Must not be 0. update.

Adds a double-sided quad with the specified vertices.

Creates and adds a new object using the geometry registered as geometry_name.

Creates and adds a new object to this node children using a mesh.

Creates and adds a new object using a mesh descriptor.

Creates and adds multiple nodes created from an obj file.

This will create a new node serving as a root of the scene described by the obj file. This newly created node is added to this node’s children.

Applies a closure to each object contained by this node and its children.

Applies a closure to each object contained by this node and its children.

Render the scene graph rooted by this node.

Sets the material of the objects contained by this node and its children.

Sets the material of the objects contained by this node and its children.

Sets the width of the lines drawn for the objects contained by this node and its children.

Sets the color of the lines drawn for the objects contained by this node and its children.

Sets the size of the points drawn for the objects contained by this node and its children.

Activates or deactivates the rendering of the surfaces of the objects contained by this node and its children.

Activates or deactivates backface culling for the objects contained by this node and its children.

Mutably accesses the vertices of the objects contained by this node and its children.

The provided closure is called once per object.

Accesses the vertices of the objects contained by this node and its children.

The provided closure is called once per object.

Recomputes the normals of the meshes of the objects contained by this node and its children.

Mutably accesses the normals of the objects contained by this node and its children.

The provided closure is called once per object.

Accesses the normals of the objects contained by this node and its children.

The provided closure is called once per object.

Mutably accesses the faces of the objects contained by this node and its children.

The provided closure is called once per object.

Accesses the faces of the objects contained by this node and its children.

The provided closure is called once per object.

Mutably accesses the texture coordinates of the objects contained by this node and its children.

The provided closure is called once per object.

Accesses the texture coordinates of the objects contained by this node and its children.

The provided closure is called once per object.

Get the visibility status of node.

Sets the visibility of this node.

The node and its children are not rendered if it is not visible.

Sets the color of the objects contained by this node and its children.

Colors components must be on the range [0.0, 1.0].

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

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 image
  • name - &str to identify this texture in TextureManager

Sets the texture of the objects contained by this node and its children.

The texture must already have been registered as name.

Sets the texture of the objects contained by this node and its children.

Sets the local scaling factors of the object.

Move and orient the object such that it is placed at the point eye and have its x axis oriented toward at.

Appends a transformation to this node local transformation.

Prepends a transformation to this node local transformation.

Set this node local transformation.

Appends a translation to this node local transformation.

Prepends a translation to this node local transformation.

Sets the local translation of this node.

Appends a rotation to this node local transformation.

Appends a rotation to this node local transformation.

Prepends a rotation to this node local transformation.

Sets the local rotation of this node.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.