aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/MoveControl.h
blob: fdc5d65db0ba550c2484c73ef97869894e87091f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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;
	double speedModifier;
	bool _hasWanted;

public:
	MoveControl(Mob *mob);

	bool hasWanted();
	double getSpeedModifier();
	void setWantedPosition(double x, double y, double z, double speedModifier);
	void setSpeed(float speed);
	virtual void tick();

private:
	float rotlerp(float a, float b, float max);
};