particle.h 623 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * 2D Physic Engine
  3. * particle.h:
  4. * Based on pikuma.com Learn Game Physics Engine Programming course.
  5. * Copyright (c) 2022 986-Studio. All rights reserved.
  6. *
  7. * Created by Manoël Trapier on 07/06/2022.
  8. */
  9. #ifndef PHYSICENGINE_PHYSICS_PARTICLE_H
  10. #define PHYSICENGINE_PHYSICS_PARTICLE_H
  11. #include <physics/vec2.h>
  12. class particle
  13. {
  14. public:
  15. uint16_t radius;
  16. vec2 position;
  17. vec2 acceleration;
  18. vec2 velocity;
  19. double mass;
  20. public:
  21. particle(double x, double y, double mass): radius(4), position(x, y), mass(mass) {};
  22. ~particle() = default;
  23. };
  24. #endif /* PHYSICENGINE_PHYSICS_PARTICLE_H */