forked from Dynamitos/Seele
Formatted EVERYTHING
This commit is contained in:
1 parent
f18bf8acbe
commit
d95dab850c
265 files changed
+8002
-12310
No files matched your search
@@ -6,81 +6,56 @@ using namespace Seele;
|
||||
using namespace Seele::Editor;
|
||||
|
||||
ViewportControl::ViewportControl(const URect& viewportDimensions, Vector initialPos)
|
||||
: position(initialPos)
|
||||
, fieldOfView(glm::radians(70.f))
|
||||
, aspectRatio(static_cast<float>(viewportDimensions.size.x) / viewportDimensions.size.y)
|
||||
, pitch(0)
|
||||
, yaw(glm::pi<float>()/-2.0f)
|
||||
{
|
||||
: position(initialPos), fieldOfView(glm::radians(70.f)),
|
||||
aspectRatio(static_cast<float>(viewportDimensions.size.x) / viewportDimensions.size.y), pitch(0), yaw(glm::pi<float>() / -2.0f) {
|
||||
std::cout << yaw << " " << pitch << std::endl;
|
||||
}
|
||||
|
||||
ViewportControl::~ViewportControl()
|
||||
{
|
||||
|
||||
}
|
||||
ViewportControl::~ViewportControl() {}
|
||||
|
||||
void ViewportControl::update(Component::Camera& camera, float deltaTime)
|
||||
{
|
||||
void ViewportControl::update(Component::Camera& camera, float deltaTime) {
|
||||
float cameraMove = deltaTime * 20;
|
||||
if(keys[KeyCode::KEY_LEFT_SHIFT])
|
||||
{
|
||||
if (keys[KeyCode::KEY_LEFT_SHIFT]) {
|
||||
cameraMove *= 4;
|
||||
}
|
||||
Vector moveVector = Vector();
|
||||
Vector forward = glm::normalize(springArm);
|
||||
Vector side = glm::cross(Vector(0, 1, 0), forward);
|
||||
if(keys[KeyCode::KEY_W])
|
||||
{
|
||||
if (keys[KeyCode::KEY_W]) {
|
||||
moveVector += forward * cameraMove;
|
||||
}
|
||||
if(keys[KeyCode::KEY_S])
|
||||
{
|
||||
if (keys[KeyCode::KEY_S]) {
|
||||
moveVector += forward * -cameraMove;
|
||||
}
|
||||
if(keys[KeyCode::KEY_A])
|
||||
{
|
||||
if (keys[KeyCode::KEY_A]) {
|
||||
moveVector += side * cameraMove;
|
||||
}
|
||||
if(keys[KeyCode::KEY_D])
|
||||
{
|
||||
if (keys[KeyCode::KEY_D]) {
|
||||
moveVector += side * -cameraMove;
|
||||
}
|
||||
if(keys[KeyCode::KEY_E])
|
||||
{
|
||||
if (keys[KeyCode::KEY_E]) {
|
||||
moveVector += glm::vec3(0, cameraMove, 0);
|
||||
}
|
||||
if(keys[KeyCode::KEY_Q])
|
||||
{
|
||||
}
|
||||
if (keys[KeyCode::KEY_Q]) {
|
||||
moveVector += glm::vec3(0, -cameraMove, 0);
|
||||
}
|
||||
throw std::logic_error("Not implemented");
|
||||
}
|
||||
|
||||
void ViewportControl::keyCallback(KeyCode key, InputAction action)
|
||||
{
|
||||
keys[static_cast<size_t>(key)] = action != InputAction::RELEASE;
|
||||
}
|
||||
void ViewportControl::keyCallback(KeyCode key, InputAction action) { keys[static_cast<size_t>(key)] = action != InputAction::RELEASE; }
|
||||
|
||||
void ViewportControl::mouseMoveCallback(double xPos, double yPos)
|
||||
{
|
||||
void ViewportControl::mouseMoveCallback(double xPos, double yPos) {
|
||||
mouseX = static_cast<float>(xPos);
|
||||
mouseY = static_cast<float>(yPos);
|
||||
}
|
||||
|
||||
void ViewportControl::mouseButtonCallback(MouseButton button, InputAction action)
|
||||
{
|
||||
if(button == MouseButton::MOUSE_BUTTON_1)
|
||||
{
|
||||
void ViewportControl::mouseButtonCallback(MouseButton button, InputAction action) {
|
||||
if (button == MouseButton::MOUSE_BUTTON_1) {
|
||||
mouse1 = action != InputAction::RELEASE;
|
||||
}
|
||||
if(button == MouseButton::MOUSE_BUTTON_2)
|
||||
{
|
||||
if (button == MouseButton::MOUSE_BUTTON_2) {
|
||||
mouse2 = action != InputAction::RELEASE;
|
||||
}
|
||||
}
|
||||
|
||||
void ViewportControl::viewportResize(URect dimensions)
|
||||
{
|
||||
aspectRatio = static_cast<float>(dimensions.size.x) / dimensions.size.y;
|
||||
}
|
||||
void ViewportControl::viewportResize(URect dimensions) { aspectRatio = static_cast<float>(dimensions.size.x) / dimensions.size.y; }
|
||||
Reference in new issue
Block a user