12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #ifndef ENTITY_H
- #define ENTITY_H
- #include "common/Box.h"
- #include "math/Quaternion.h"
- struct Entity {
- Vector3 lastPosition;
- Vector3 position;
- float lastLengthAngle;
- float lengthAngle;
- float lastWidthAngle;
- float widthAngle;
- Vector3 velocity;
- Vector3 acceleration;
- Vector3 size;
- Vector3 drag;
- float speed;
- float jumpPower;
- bool onGround;
- bool skip;
- Entity();
- virtual ~Entity() = default;
- virtual void tick();
- void addForce(const Vector3& force);
- const Vector3& getVelocity() const;
- void move(const Vector3& v);
- Box getBox() const;
- bool isOnGround() const;
- void setPosition(const Vector3& pos);
- void setPosition(const Vector3& pos, float lengthAngle, float widthAngle);
- Vector3 getRenderPosition(float lag) const;
- Quaternion getRotation() const;
- Quaternion getRenderRotation(float lag) const;
- void addLengthAngle(float angle);
- void addWidthAngle(float angle);
- float getMaxXZVelocity() const;
- void jump();
- };
- #endif
|