mirror of
https://git.neolegacy.dev/neoStudiosLCE/neoLegacy.git
synced 2026-11-20 04:28:04 +01:00
Co-authored-by: DrPerkyLegit <116128211+DrPerkyLegit@users.noreply.github.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Anaël <60509176+Bakoubak@users.noreply.github.com> Reviewed-on: https://git.neolegacy.dev/neoStudiosLCE/neoLegacy/pulls/4205
38 lines
675 B
C++
38 lines
675 B
C++
#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;
|
|
bool _strafing;
|
|
float strafeForwards;
|
|
float strafeRight;
|
|
|
|
public:
|
|
MoveControl(Mob *mob);
|
|
|
|
bool hasWanted();
|
|
double getSpeedModifier();
|
|
void setWantedPosition(double x, double y, double z, double speedModifier);
|
|
void setSpeed(float speed);
|
|
void strafe(float forwards, float right);
|
|
virtual void tick();
|
|
|
|
private:
|
|
float rotlerp(float a, float b, float max);
|
|
}; |