aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/LookControl.h
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/LookControl.h
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.World/LookControl.h')
-rw-r--r--Minecraft.World/LookControl.h33
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