diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/MoveControl.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.World/MoveControl.h')
| -rw-r--r-- | Minecraft.World/MoveControl.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Minecraft.World/MoveControl.h b/Minecraft.World/MoveControl.h new file mode 100644 index 00000000..4138280e --- /dev/null +++ b/Minecraft.World/MoveControl.h @@ -0,0 +1,34 @@ +#pragma once + +#include "Control.h" + +class Mob; + +class MoveControl : public Control +{ +public: + static const float MIN_SPEED; + static const float MIN_SPEED_SQR; + +private: + static const int MAX_TURN = 30; + + Mob *mob; + double wantedX; + double wantedY; + double wantedZ; + float speed; + bool _hasWanted; + +public: + MoveControl(Mob *mob); + + bool hasWanted(); + float getSpeed(); + void setWantedPosition(double x, double y, double z, float speed); + void setSpeed(float speed); + virtual void tick(); + +private: + float rotlerp(float a, float b, float max); +};
\ No newline at end of file |
