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.

ugeentity.h 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef UGEENTITY_H
  2. #define UGEENTITY_H
  3. #include <QObject>
  4. #include <QPoint>
  5. #include <QSharedPointer>
  6. #include "utils/vector3d.h"
  7. #include "engine/abstractrenderdevice.h"
  8. class UGEEntity : public QObject
  9. {
  10. Q_OBJECT
  11. public:
  12. explicit UGEEntity(QObject *parent = 0);
  13. virtual ~UGEEntity();
  14. Vector3D getPosition() const;
  15. void setPosition(const Vector3D& position);
  16. void move(const Vector3D& move);
  17. Vector3D getSpeed() const;
  18. void setSpeed(const Vector3D& speed);
  19. void accelerate(const Vector3D& speed);
  20. Vector3D getRotation() const;
  21. void setRotation(const Vector3D& rotation);
  22. void rotate(const Vector3D& rotation);
  23. Vector3D getScale() const;
  24. void setScale(const Vector3D& scale);
  25. void scale(const Vector3D& scale);
  26. bool isVisible() const;
  27. void setVisible(bool visible);
  28. void show();
  29. void hide();
  30. Vector3D getRealPoint(const Vector3D& pos);
  31. ColorVector3D getRealPoint(const ColorVector3D& pos);
  32. TextureVector3D getRealPoint(const TextureVector3D& pos);
  33. virtual void drawPoint(AbstractRenderDevice* device, const ColorVector3D& point);
  34. virtual void drawLine(AbstractRenderDevice* device, const ColorVector3D& begin, const ColorVector3D& end, double width = 1.0);
  35. virtual void drawPolygon(AbstractRenderDevice* device, QList<ColorVector3D> points);
  36. virtual void drawPolygonTexture(AbstractRenderDevice *device, QList<TextureVector3D> points, const QVariant& textureId);
  37. virtual void draw(AbstractRenderDevice* device) = 0;
  38. private:
  39. Vector3D _position;
  40. Vector3D _speed;
  41. Vector3D _rotation;
  42. Vector3D _scale;
  43. bool _visible;
  44. };
  45. #endif // UGEENTITY_H