Space Comps
 All Classes Files Functions Variables
qparticle3d.h
1 #ifndef QPARTICLE3D_H
2 #define QPARTICLE3D_H
3 
4 #include <valarray>
5 #include <QGLSceneNode>
6 #include <QGLPainter>
7 #include <QGLTexture2D>
8 #include <QGLMaterial>
9 #include "particle.h"
10 
19 {
20 public:
30 
36 
41  void setPosition(Position *newpos);
42 
51  void setCollisionTimestep(int t);
52 
59  void incrementTimestep();
60 
71  void draw(QGLPainter* painter);
72 
73 private:
74  Particle* particle;
75  QGLSceneNode* sphere;
76  std::valarray<double> pos;
77  QColor color;
78  QGLTexture2D earthSkin;
79  int timestep;
80  int collisionTimestep;
81 };
82 
83 #endif // QPARTICLE3D_H
void setPosition(Position *newpos)
Sets the current position of the QParticle3D.
Definition: qparticle3d.cpp:34
QParticle3D(Particle *p)
Constructs a QParticle3D associated with the given Particle.
Definition: qparticle3d.cpp:7
void incrementTimestep()
Increments the internal timestep counter.
Definition: qparticle3d.cpp:42
Definition: position.h:8
3D graphical wrapper for Particle.
Definition: qparticle3d.h:18
void setCollisionTimestep(int t)
Sets the timestep for the a collision involving the Particle.
Definition: qparticle3d.cpp:38
void draw(QGLPainter *painter)
Draw the QParticle3D to the display.
Definition: qparticle3d.cpp:46
Definition: particle.h:12
Particle * getParticle()
Returns the Particle associated with this QParticle3D.
Definition: qparticle3d.cpp:30