Commit bf39c6b6 authored by David Gilbert's avatar David Gilbert

Try #3

parent 7381a0a2
......@@ -444,8 +444,8 @@ void PlayerSystem::update(float dt) {
if (m_keyState[SDL_SCANCODE_LSHIFT]) speedMod = 10;
if (m_keyState[SDL_SCANCODE_W] || m_keyState[SDL_SCANCODE_UP]) rotDir += glm::dvec2(0, 1);
if (m_keyState[SDL_SCANCODE_S] || m_keyState[SDL_SCANCODE_DOWN]) rotDir -= glm::dvec2(0, 1);
if (m_keyState[SDL_SCANCODE_W] || m_keyState[SDL_SCANCODE_UP]) rotDir -= glm::dvec2(0, 1);
if (m_keyState[SDL_SCANCODE_S] || m_keyState[SDL_SCANCODE_DOWN]) rotDir += glm::dvec2(0, 1);
if (m_keyState[SDL_SCANCODE_A] || m_keyState[SDL_SCANCODE_LEFT]) rotDir += glm::dvec2(1, 0);
if (m_keyState[SDL_SCANCODE_D] || m_keyState[SDL_SCANCODE_RIGHT]) rotDir -= glm::dvec2(1, 0);
if (m_keyState[SDL_SCANCODE_Q]) rollDir = 1;
......@@ -464,10 +464,10 @@ void PlayerSystem::update(float dt) {
glm::dmat4 yprMatrix = glm::yawPitchRoll(rotDir.x * 0.01, rotDir.y * 0.01, rollDir * 0.01);
cameraTransform->rotation = cameraTransform->rotation * yprMatrix;
skyboxCamTransform->rotation = yprMatrix * skyboxCamTransform->rotation * yprMatrix;
skyboxCamTransform->rotation = skyboxCamTransform->rotation * yprMatrix;
directionRot = directionRot * yprMatrix;
auto dir = normalize(directionRot * glm::vec4{ 0, 0, -1, 0 });
auto dir = normalize( rotate(glm::dvec3(0, 0, -1), directionRot));
cameraTransform->position += glm::normalize(glm::vec3(dir)) * static_cast<double>(dt) * velocity;
......
......@@ -318,7 +318,7 @@ void AtmosphereTestScene::switchToMainScene() {
consoleFront.assign<Drawable>(
consoleGeom,
Material{ glm::vec4{ 1, 1, 1, 1 }, glm::vec4{ 1, 1, 1, 1 },
m_renderer->getRenderPassTarget("Console"_sh), nullptr, nullptr,
m_renderer->getRenderPassTarget("Main"_sh), nullptr, nullptr,
skyboxMaterial.prog, false, RenderQueue::OPAQUE, GL_BACK },
0, cockpitPassId);
consoleFront.assign<Transform>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment