hx3d  1
2D/3D Simple Game Framework
mesh.hpp
1 /*
2  Mesh.
3  Copyright (C) 2015 Denis BOURGE
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
18  USA
19 */
20 
21 #ifndef HX3D_GRAPHICS_MESH
22 #define HX3D_GRAPHICS_MESH
23 
24 #include "hx3d/graphics/color.hpp"
25 
26 #include "hx3d/graphics/geometries/base_geometry.hpp"
27 #include "hx3d/graphics/transform.hpp"
28 
29 #include "hx3d/utils/ptr.hpp"
30 
31 
32 namespace hx3d {
33 namespace graphics {
34 
35 class Shader;
36 class Color;
37 
41 class Mesh {
42 
43 public:
44  Mesh();
45 
51  virtual void draw(Ptr<Shader> shader);
52 
61  void setTint(Color tint);
62 
68  Color& getTint();
69 
73  void updateColor();
74 
80  void setGeometry(Ptr<geom::BaseGeometry> geometry);
81 
88 
91 
92 protected:
97 };
98 
99 } /* graphics */
100 } /* hx3d */
101 
102 #endif
Color _tint
Tint color.
Definition: mesh.hpp:94
void setTint(Color tint)
Set the mesh tint.
Definition: mesh.cpp:43
2D/3D transform.
Definition: transform.hpp:35
void updateColor()
Update the mesh color from the tint.
Definition: mesh.cpp:57
Color & getTint()
Get the mesh tint.
Definition: mesh.cpp:79
Four [0..255] components defined color.
Definition: color.hpp:32
hx3d framework namespace
Definition: audio.hpp:26
void setGeometry(Ptr< geom::BaseGeometry > geometry)
Set the mesh geometry.
Definition: mesh.cpp:49
Ptr< geom::BaseGeometry > _geometry
Current geometry.
Definition: mesh.hpp:96
Transform transform
Mesh transformation.
Definition: mesh.hpp:90
Displayable 2D/3D element.
Definition: mesh.hpp:41
virtual void draw(Ptr< Shader > shader)
Draw the mesh using a shader.
Definition: mesh.cpp:30
Ptr< geom::BaseGeometry > & getGeometry()
Get the mesh geometry.
Definition: mesh.cpp:53
std::shared_ptr< T > Ptr
Quick-typing shared ptr.
Definition: ptr.hpp:34