Player.h 919 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef PLAYER_H
  2. #define PLAYER_H
  3. #include "common/utils/CollisionBox.h"
  4. #include "math/Quaternion.h"
  5. class Player {
  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. public:
  17. Player();
  18. void tick();
  19. void addForce(const Vector3& force);
  20. const Vector3& getVelocity() const;
  21. void move(const Vector3& v);
  22. CollisionBox getCollisionBox() const;
  23. bool isOnGround() const;
  24. void setPosition(const Vector3& pos);
  25. void setPosition(const Vector3& pos, float lengthAngle, float widthAngle);
  26. Vector3 getRenderPosition(float lag) const;
  27. Quaternion getRotation() const;
  28. Quaternion getRenderRotation(float lag) const;
  29. void addLengthAngle(float angle);
  30. void addWidthAngle(float angle);
  31. };
  32. #endif