2023-09-13 20:42:01 +02:00

38 lines
942 B
C++

#pragma once
#include "gameobject.h"
#include "playercontroller.h"
namespace kek {
class Player: public RotateableObject {
public:
PlayerPhysicsObjectData *physics;
PlayerController *controller;
bool noclip = false;
bool onGround = false;
Player();
virtual void rotate(float angle, glm::vec3 axis) { rotateTo(glm::rotate(getRotation(), angle, axis)); };
virtual void rotateTo(glm::quat rotation);
virtual void lookAt(glm::vec3 direction) { rotateTo(glm::quatLookAt(glm::normalize(direction), glm::vec3(0, 1, 0))); };
virtual glm::quat getRotation();
virtual void translate(glm::vec3 delta) { moveTo(getPosition() + delta); };
virtual void moveTo(glm::vec3 position);
virtual glm::vec3 getPosition();
virtual glm::vec3 getEyePosition() { return getPosition() + glm::vec3(0, KEK_PLAYER_EYE_OFFSET, 0); }
virtual glm::vec3 getFootPosition() { return getPosition() - glm::vec3(0, KEK_PLAYER_HEIGHT / 2, 0); };
};
}