7 #include <GLFW/glfw3.h>
24 void render(glm::mat4
const& view_projection,
25 glm::mat4
const& parent_transform = glm::mat4(1.0f))
const;
40 void render(glm::mat4
const& view_projection, glm::mat4
const&
world,
42 std::function<
void (GLuint)>
const& set_uniforms = [](GLuint ){})
const;
86 std::function<
void (GLuint)>
const& set_uniforms = [](GLuint ){});
96 void set_name(std::string
const& name);
106 void add_texture(std::string
const& name, GLuint tex_id, GLenum type);
146 std::vector<std::tuple<std::string, GLuint, GLenum>>
_textures;
156 std::string
_name{
"Render un-named node"};
Represents a node of a scene graph.
Definition: node.hpp:17
void add_texture(std::string const &name, GLuint tex_id, GLenum type)
Add a texture to this node.
Definition: node.cpp:128
void set_program(GLuint const *const program, std::function< void(GLuint)> const &set_uniforms=[](GLuint){})
Set the program of this node.
Definition: node.cpp:98
std::vector< Node const * > _children
Definition: node.hpp:153
Node const * get_child(size_t index) const
Return the ith child.
Definition: node.cpp:168
GLuint const * _program
Definition: node.hpp:142
GLenum _drawing_mode
Definition: node.hpp:138
TRSTransformf _transform
Definition: node.hpp:150
GLsizei _indices_nb
Definition: node.hpp:137
GLuint _vao
Definition: node.hpp:135
bonobo::material_data _constants
Definition: node.hpp:147
void set_name(std::string const &name)
Set the name of this node.
Definition: node.cpp:110
std::string _name
Definition: node.hpp:156
void render(glm::mat4 const &view_projection, glm::mat4 const &parent_transform=glm::mat4(1.0f)) const
Render this node.
Definition: node.cpp:11
GLsizei _vertices_nb
Definition: node.hpp:136
void add_child(Node const *child)
Add a child to this node.
Definition: node.cpp:151
size_t get_indices_nb() const
Get the number of indices to use.
Definition: node.cpp:116
void set_indices_nb(size_t const &indices_nb)
Set the number of indices to use.
Definition: node.cpp:122
TRSTransformf const & get_transform() const
Return this node transformation matrix.
Definition: node.cpp:175
bool _has_indices
Definition: node.hpp:139
size_t get_children_nb() const
Return the number of children to this node.
Definition: node.cpp:162
std::function< void(GLuint)> _set_uniforms
Definition: node.hpp:143
void set_material_constants(bonobo::material_data const &constants)
Set the material constants of this node.
Definition: node.cpp:92
std::vector< std::tuple< std::string, GLuint, GLenum > > _textures
Definition: node.hpp:146
void set_geometry(bonobo::mesh_data const &shape)
Set the geometry of this node.
Definition: node.cpp:74
GLuint world
Definition: helpers.cpp:29
Definition: helpers.hpp:31
Contains the data for a mesh in OpenGL.
Definition: helpers.hpp:42