Entity.h 968 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef ENTITY_H
  2. #define ENTITY_H
  3. #include "common/utils/CollisionBox.h"
  4. #include "math/Quaternion.h"
  5. struct Entity {
  6. Vector3 lastPosition;
  7. Vector3 position;
  8. float lastLengthAngle;
  9. float lengthAngle;
  10. float lastWidthAngle;
  11. float widthAngle;
  12. Vector3 velocity;
  13. Vector3 acceleration;
  14. Vector3 size;
  15. bool onGround;
  16. bool skip;
  17. Entity();
  18. virtual ~Entity() = default;
  19. virtual void tick();
  20. void addForce(const Vector3& force);
  21. const Vector3& getVelocity() const;
  22. void move(const Vector3& v);
  23. CollisionBox getCollisionBox() const;
  24. bool isOnGround() const;
  25. void setPosition(const Vector3& pos);
  26. void setPosition(const Vector3& pos, float lengthAngle, float widthAngle);
  27. Vector3 getRenderPosition(float lag) const;
  28. Quaternion getRotation() const;
  29. Quaternion getRenderRotation(float lag) const;
  30. void addLengthAngle(float angle);
  31. void addWidthAngle(float angle);
  32. };
  33. #endif