Scene graph node, corresponding to Assimp's aiNode.
More...
#include <Node.h>
|
typedef std::vector< Node * > | Children |
|
typedef std::vector< Mesh * > | Meshes |
|
typedef std::vector< AbstractCamera * > | Cameras |
|
typedef std::vector< Light * > | Lights |
|
typedef std::vector< Channel * > | Channels |
|
Scene graph node, corresponding to Assimp's aiNode.
gpu_coverage::Node::Node |
( |
const aiNode *const |
node, |
|
|
const aiScene * |
scene, |
|
|
const std::vector< Mesh * > & |
meshes, |
|
|
Node *const |
parent = NULL |
|
) |
| |
Constructor for creating a node from an Assimp aiNode.
- Parameters
-
node | The Assimp aiNode for creating this node. |
scene | The scene containing this node. |
meshes | All meshes loaded beforehand. |
parent | The parent node (NULL if this node is the root node). |
gpu_coverage::Node::Node |
( |
const std::string & |
name, |
|
|
Node *const |
parent |
|
) |
| |
Constructor for manually creating a child node.
- Parameters
-
name | Name of the child node. |
parent | Parent node. |
void gpu_coverage::Node::addAnimationChannel |
( |
Channel *const |
channel | ) |
|
Adds an animation channel to this node.
- Parameters
-
Adds a camera to this node.
- Parameters
-
void gpu_coverage::Node::addLight |
( |
Light *const |
light | ) |
|
Adds a light source to this node.
- Parameters
-
const Cameras& gpu_coverage::Node::getCameras |
( |
| ) |
const |
|
inline |
Returns the cameras associated with this node.
- Returns
- Vector of cameras.
const Channels& gpu_coverage::Node::getChannels |
( |
| ) |
const |
|
inline |
Returns the animation channels influencing this node.
- Returns
- Vector of animation channels.
const Children& gpu_coverage::Node::getChildren |
( |
| ) |
const |
|
inline |
Returns a vector of all direct children.
- Returns
- Children of this node.
size_t gpu_coverage::Node::getId |
( |
| ) |
const |
|
inline |
Returns the unique ID of this node.
- Returns
- ID.
const Lights& gpu_coverage::Node::getLights |
( |
| ) |
const |
|
inline |
Returns the light sources associated with this node.
- Returns
- Vector of light sources.
const glm::mat4& gpu_coverage::Node::getLocalTransform |
( |
| ) |
const |
|
inline |
Returns the local transform of the node relative to the parent node.
- Returns
- Local transform.
const Meshes& gpu_coverage::Node::getMeshes |
( |
| ) |
const |
|
inline |
Returns a vector of all meshes associated with this node.
- Returns
- Children of this node.
const std::string& gpu_coverage::Node::getName |
( |
| ) |
const |
|
inline |
Returns the name of this node for logging.
- Returns
- Name of this node.
If available, the name included in the input file read by Assimp is used.
const Node* gpu_coverage::Node::getParent |
( |
| ) |
const |
|
inline |
Returns the parent node.
- Returns
- Parent node.
const glm::mat4& gpu_coverage::Node::getWorldTransform |
( |
| ) |
const |
|
inline |
Returns the transform of the node in world coordinates.
- Returns
- World transform.
bool gpu_coverage::Node::isVisible |
( |
| ) |
const |
|
inline |
Returns true if the node is visible.
- Parameters
-
void gpu_coverage::Node::render |
( |
const std::vector< glm::mat4 > & |
view, |
|
|
const LocationsMVP *const |
locationsMVP, |
|
|
const LocationsMaterial *const |
locationsMaterial, |
|
|
const bool |
hasTesselationShader |
|
) |
| const |
Renders the scene using the current shaders.
- Parameters
-
view | View matrix (or matrices) as set by AbstractCamera::setViewProjection(). |
locationsMVP | Location of the shader variables for model, view, and projection matrices. |
locationsMaterial | Location of the shader variables for material and light variables. |
hasTesselationShader | True if the current shader has a tesselation stage. |
void gpu_coverage::Node::setFrame |
( |
| ) |
|
Set the current frame of the animation.
- Parameters
-
[in] | frame | Frame number of the animation. |
This method passes the new frame number to all animation Channels and recomputes the local transforms of all tree nodes recursively.
void gpu_coverage::Node::setFrameRecursive |
( |
bool |
needsUpdate | ) |
|
|
protected |
Updates the current frame number recursively in all child frames.
- Parameters
-
needsUpdate | True if the local transform needs to be updated. |
needsUpdate is true if the local transform of this node or one of its ancestors in the tree has changed due to an animation channel. In this case, the world transform of all children will also have to be recomputed.
void gpu_coverage::Node::setLocalTransform |
( |
const glm::mat4 & |
localTransform | ) |
|
|
inline |
Sets the local transform of the node relative to the parent node.
- Parameters
-
localTransform | The local transform. |
This method also updates the node's world transform, but does not update the transformations of the children.
void gpu_coverage::Node::setVisible |
( |
bool |
visible | ) |
|
|
inline |
Sets the visibility of this node.
- Parameters
-
visible | True if node is visible. |
Children of invisible nodes will not be rendered.
void gpu_coverage::Node::toDot |
( |
FILE * |
dot | ) |
|
Write Graphviz Dot node representing this node to file for debugging.
- Parameters
-
void gpu_coverage::Node::updateWorldTransform |
( |
| ) |
|
|
protected |
Recomputes the world transform after the local transform has changed.
setLocalTransform() triggers this method.
The documentation for this class was generated from the following file: