31 #ifndef INCLUDE_ARTICULATION_NODE_H_ 32 #define INCLUDE_ARTICULATION_NODE_H_ 34 #include <gpu_coverage/Programs.h> 35 #include <assimp/scene.h> 36 #include <glm/detail/type_mat4x4.hpp> 43 struct LocationsCommonRender;
54 typedef std::vector<Node *> Children;
55 typedef std::vector<Mesh *> Meshes;
56 typedef std::vector<AbstractCamera *> Cameras;
57 typedef std::vector<Light *> Lights;
58 typedef std::vector<Channel *> Channels;
67 Node(
const aiNode *
const node,
const aiScene * scene,
const std::vector<Mesh*>&
meshes,
Node *
const parent =
96 void render(
const std::vector<glm::mat4>& view,
const LocationsMVP *
const locationsMVP,
97 const LocationsMaterial *
const locationsMaterial,
const bool hasTesselationShader)
const;
103 void toDot(FILE *dot);
void toDot(FILE *dot)
Write Graphviz Dot node representing this node to file for debugging.
const Meshes & getMeshes() const
Returns a vector of all meshes associated with this node.
Definition: Node.h:117
Children children
Direct children of this node.
Definition: Node.h:239
void addCamera(AbstractCamera *const camera)
Adds a camera to this node.
Node *const parent
Parent node.
Definition: Node.h:245
const std::string & getName() const
Returns the name of this node for logging.
Definition: Node.h:135
const Lights & getLights() const
Returns the light sources associated with this node.
Definition: Node.h:223
void setVisible(bool visible)
Sets the visibility of this node.
Definition: Node.h:207
Represents a light source, corresponds to Assimp's aiLight structure.
Definition: Light.h:45
Channels channels
Animation channels influencing this node.
Definition: Node.h:244
Scene graph corresponding to Assimp's aiScene.
Definition: Scene.h:59
Scene graph node, corresponding to Assimp's aiNode.
Definition: Node.h:52
Locations of material shader variables.
Definition: Programs.h:142
Locations of model, view, and projection shader variables.
Definition: Programs.h:104
bool visible
True if node is visible while rendering, see setVisible() and isVisible().
Definition: Node.h:248
void addLight(Light *const light)
Adds a light source to this node.
size_t getId() const
Returns the unique ID of this node.
Definition: Node.h:125
void addAnimationChannel(Channel *const channel)
Adds an animation channel to this node.
const Channels & getChannels() const
Returns the animation channels influencing this node.
Definition: Node.h:231
Cameras cameras
Cameras associated with this node.
Definition: Node.h:242
void updateWorldTransform()
Recomputes the world transform after the local transform has changed.
const Node * getParent() const
Returns the parent node.
Definition: Node.h:143
const glm::mat4 & getLocalTransform() const
Returns the local transform of the node relative to the parent node.
Definition: Node.h:151
const std::string name
Name of this node for logging, see getName().
Definition: Node.h:237
bool isVisible() const
Returns true if the node is visible.
Definition: Node.h:197
Definition: AbstractCamera.h:41
glm::mat4 localTransform
Current world transform, see getLocalTransform().
Definition: Node.h:247
std::vector< bool > allocatedChild
Bit map indicating which children this node has allocated and is in charge of deleting later...
Definition: Node.h:240
Lights lights
Light sources associated with this node.
Definition: Node.h:243
const glm::mat4 & getWorldTransform() const
Returns the transform of the node in world coordinates.
Definition: Node.h:159
Abstract superclass for all cameras.
Definition: AbstractCamera.h:48
virtual ~Node()
Destructor.
const size_t id
Unique ID, see getId().
Definition: Node.h:236
Meshes meshes
Meshes associated with this node.
Definition: Node.h:241
void setLocalTransform(const glm::mat4 &localTransform)
Sets the local transform of the node relative to the parent node.
Definition: Node.h:170
void setFrame()
Set the current frame of the animation.
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.
const Children & getChildren() const
Returns a vector of all direct children.
Definition: Node.h:109
glm::mat4 worldTransform
Current world transform, see getWorldTransform().
Definition: Node.h:246
Animation channel.
Definition: Channel.h:53
void 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.
void setFrameRecursive(bool needsUpdate)
Updates the current frame number recursively in all child frames.
const Cameras & getCameras() const
Returns the cameras associated with this node.
Definition: Node.h:215