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/LookControl.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.World/LookControl.h')
| -rw-r--r-- | Minecraft.World/LookControl.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Minecraft.World/LookControl.h b/Minecraft.World/LookControl.h new file mode 100644 index 00000000..add64e4a --- /dev/null +++ b/Minecraft.World/LookControl.h @@ -0,0 +1,33 @@ +#pragma once + +#include "Control.h" + +class Mob; + +class LookControl : public Control +{ +private: + Mob *mob; + float yMax, xMax; + bool hasWanted; + + double wantedX, wantedY, wantedZ; + +public: + LookControl(Mob *mob); + + void setLookAt(shared_ptr<Entity> target, float yMax, float xMax); + void setLookAt(double x, double y, double z, float yMax, float xMax); + virtual void tick(); + +private: + float rotlerp(float a, float b, float max); + +public: + bool isHasWanted(); + float getYMax(); + float getXMax(); + double getWantedX(); + double getWantedY(); + double getWantedZ(); +};
\ No newline at end of file |
