Orxonox  0.0.5 Codename: Arcturus
DynamicLines.h
Go to the documentation of this file.
1 /*
2  * ORXONOX - the hottest 3D action shooter ever to exist
3  * > www.orxonox.net <
4  *
5  *
6  * License notice:
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * Author:
23  * Baxissimo, Emmeran, DWORD, EtherDrive (OGRE Wiki)
24  * Co-authors:
25  * ...
26  *
27  */
28 
29 #ifndef _DynamicLines_H__
30 #define _DynamicLines_H__
31 
32 #include "tools/ToolsPrereqs.h"
33 
34 #include <vector>
35 #include "DynamicRenderable.h"
36 
37 namespace Ogre
38 {
40  {
41  typedef RenderOperation::OperationType OperationType;
42 
43  public:
45  DynamicLines(OperationType opType = RenderOperation::OT_LINE_STRIP);
46  virtual ~DynamicLines();
47 
49  void addPoint(const Vector3 &p);
51  void addPoint(Real x, Real y, Real z);
52 
54  void setPoint(unsigned short index, const Vector3 &value);
55 
57  const Vector3& getPoint(unsigned short index) const;
58 
60  unsigned short getNumPoints(void) const;
61 
63  void clear();
64 
66  void update();
67 
81  void setOperationType(OperationType opType);
82  OperationType getOperationType() const;
83 
84  protected:
86  virtual void createVertexDeclaration() override;
88  virtual void fillHardwareBuffers() override;
89 
90  private:
91  std::vector<Vector3> mPoints;
92  bool mDirty;
93  };
94 }
95 
96 #endif /* _DynamicLines_H__ */
std::vector< Vector3 > mPoints
Definition: DynamicLines.h:91
bool mDirty
Definition: DynamicLines.h:92
Shared library macros, enums, constants and forward declarations for the tools module ...
RenderOperation::OperationType OperationType
Definition: DynamicLines.h:41
#define _ToolsExport
Definition: ToolsPrereqs.h:59
Definition: DynamicLines.h:39
Abstract base class providing mechanisms for dynamically growing hardware buffers.
Definition: DynamicRenderable.h:39
Definition: CorePrereqs.h:362