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.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 UGEEntity;
  8. class UGameEngine : public QObject
  9. {
  10. Q_OBJECT
  11. public:
  12. UGameEngine(AbstractRenderDevice* device);
  13. virtual ~UGameEngine();
  14. void draw();
  15. const QList<UGEEntity*>& getEntities() const;
  16. UGEEntity *getEntity(int i) const;
  17. Vector3D get2DFrom3D(const Vector3D& pos);
  18. Vector3D get3DFrom2D(const Vector2D &pos);
  19. UGEEntity* getVectorNearestIntesection(const Vector3D& vector, const Vector3D &pos, Vector3D *bestp);
  20. public slots:
  21. void addEntity(UGEEntity* entity);
  22. void removeEntity(UGEEntity* entity);
  23. void lookAt(const Vector3D& eye, const Vector3D& center, const Vector3D& up = Vector3D(0.0, 1.0, 0.0));
  24. void setClearColor(const QColor &clearColor);
  25. void initialize(int fov, int width, int height);
  26. void resize(int width, int height);
  27. void loadTextureFromFile(const QVariant& id, const QString& filename);
  28. protected:
  29. void update();
  30. QList<UGEEntity*> _entitites;
  31. AbstractRenderDevice* _device;
  32. QList<EntitiesUpdateThread*> _entitiesUpdateThreads;
  33. };
  34. #endif // UGAMEENGINE_H