Pixel.h 681 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include <Welt2D.h>
  3. using namespace Framework;
  4. class Pixel : public Object2D
  5. {
  6. private:
  7. float ep;
  8. int pixelId;
  9. struct PixelDataSave
  10. {
  11. float rSpeed;
  12. Vertex pos;
  13. Vertex speed;
  14. float rotation;
  15. float oldEp;
  16. };
  17. PixelDataSave backup;
  18. public:
  19. Pixel( Vertex pos, Vertex speed, float ep, int id );
  20. bool tick( const WeltInfo &info, double zeit ) override;
  21. void render( Mat3< float > &kamMat, Bild &zRObj, const char *kamName ) override;
  22. Rect2< float > getBoundingBox() const override;
  23. float getEp() const;
  24. int getId() const;
  25. bool isDead() const;
  26. void save();
  27. void load();
  28. };