00001 #pragma once 00002 00003 #ifndef _DYNAMIC_LINES_H_ 00004 #define _DYNAMIC_LINES_H_ 00005 00006 #include "DynamicRenderable.h" 00007 #include <vector> 00008 00009 namespace ASR 00010 { 00011 00012 class DynamicLines : public DynamicRenderable 00013 { 00014 typedef Ogre::Vector3 Vector3; 00015 typedef Ogre::Quaternion Quaternion; 00016 typedef Ogre::Camera Camera; 00017 typedef Ogre::Real Real; 00018 typedef Ogre::RenderOperation::OperationType OperationType; 00019 00020 public: 00022 DynamicLines(OperationType opType=Ogre::RenderOperation::OT_LINE_STRIP); 00023 virtual ~DynamicLines(); 00024 00026 void addPoint(const Ogre::Vector3 &p); 00028 void addPoint(Real x, Real y, Real z); 00029 00031 void setPoint(unsigned short index, const Vector3 &value); 00032 00034 const Vector3& getPoint(unsigned short index) const; 00035 00037 unsigned short getNumPoints(void) const; 00038 00040 void clear(); 00041 00043 void update(); 00044 00055 void setOperationType(OperationType opType); 00056 OperationType getOperationType() const; 00057 00058 protected: 00060 virtual void createVertexDeclaration(); 00062 virtual void fillHardwareBuffers(); 00063 00064 private: 00065 std::vector<Vector3> mPoints; 00066 bool mDirty; 00067 }; 00068 } 00069 00070 00071 #endif