#include "player.h"

#include "internal/physics.h"

namespace kek {

Player::Player(): RotateableObject() {
	this->noclip = false;
	this->onGround = false;
}

void Player::rotateTo(glm::quat rotation) {
	this->physics->body->getWorldTransform().setRotation(Physics::fromGLM(rotation));
}

glm::quat Player::getRotation() {
	return Physics::toGLM(this->physics->body->getWorldTransform().getRotation());
}

void Player::moveTo(glm::vec3 position) {
	this->physics->body->getWorldTransform().setOrigin(Physics::fromGLM(position));
}

glm::vec3 Player::getPosition() {
	return Physics::toGLM(this->physics->body->getWorldTransform().getOrigin());
}

}
