You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ugameengine.h 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef UGAMEENGINE_H
  2. #define UGAMEENGINE_H
  3. #include "abstractrenderdevice.h"
  4. #include "entities/ugeentity.h"
  5. #include "entitiesupdatethread.h"
  6. class EntitiesUpdateThread;
  7. class UGameEngine : public QObject
  8. {
  9. Q_OBJECT
  10. public:
  11. UGameEngine(AbstractRenderDevice* device);
  12. virtual ~UGameEngine();
  13. void draw();
  14. const QList<UGEEntity*>& getEntities() const;
  15. UGEEntity *getEntity(int i) const;
  16. Vector3D get2DFrom3D(const Vector3D& pos);
  17. Vector3D get3DFrom2D(const Vector2D &pos);
  18. UGEEntity* getVectorNearestIntesection(const Vector3D& vector, const Vector3D &pos);
  19. public slots:
  20. void addEntity(UGEEntity* entity);
  21. void lookAt(const Vector3D& eye, const Vector3D& center, const Vector3D& up = Vector3D(0.0, 1.0, 0.0));
  22. void setClearColor(const QColor &clearColor);
  23. void initialize(int fov, int width, int height);
  24. void resize(int width, int height);
  25. void loadTextureFromFile(const QVariant& id, const QString& filename);
  26. protected:
  27. void update();
  28. QList<UGEEntity*> _entitites;
  29. AbstractRenderDevice* _device;
  30. QList<EntitiesUpdateThread*> _entitiesUpdateThreads;
  31. };
  32. #endif // UGAMEENGINE_H