diff --git a/src/Game.cpp b/src/Game.cpp index 2956ffe..468ef95 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -23,6 +23,8 @@ namespace ZL static bool g_exitBgAnimating = false; + float x = 0; + Eigen::Quaternionf generateRandomQuaternion(std::mt19937& gen) { @@ -462,8 +464,8 @@ namespace ZL renderer.LoadIdentity(); renderer.TranslateMatrix({ 0,0, -1.0f * Environment::zoom }); + renderer.TranslateMatrix({ 0, -6.f, 0 }); //Ship camera offset - renderer.TranslateMatrix({ 0, -Environment::zoom * 0.03f, 0 }); if (shipAlive) { glBindTexture(GL_TEXTURE_2D, spaceshipTexture->getTexID()); renderer.DrawVertexRenderStruct(spaceship); @@ -478,7 +480,10 @@ namespace ZL } if (shipAlive) { + renderer.PushMatrix(); + renderer.TranslateMatrix({ 0, 0, 16 }); sparkEmitter.draw(renderer, Environment::zoom, Environment::width, Environment::height); + renderer.PopMatrix(); projectileEmitter.draw(renderer, Environment::zoom, Environment::width, Environment::height); } @@ -905,10 +910,12 @@ namespace ZL if (event.key.keysym.sym == SDLK_o) { Environment::shipVelocity += 50.f; + //x = x + 2.0; } if (event.key.keysym.sym == SDLK_l) { Environment::shipVelocity -= 50.f; + //x = x - 2.0; } } #endif diff --git a/src/SparkEmitter.cpp b/src/SparkEmitter.cpp index 40bc676..d162675 100644 --- a/src/SparkEmitter.cpp +++ b/src/SparkEmitter.cpp @@ -157,8 +157,8 @@ namespace ZL { renderer.EnableVertexAttribArray(vPositionName); renderer.EnableVertexAttribArray(vTexCoordName); - float aspectRatio = static_cast(screenWidth) / static_cast(screenHeight); - renderer.PushPerspectiveProjectionMatrix(1.0 / 1.5, aspectRatio, Environment::CONST_Z_NEAR, Environment::CONST_Z_FAR); + //float aspectRatio = static_cast(screenWidth) / static_cast(screenHeight); + //renderer.PushPerspectiveProjectionMatrix(1.0 / 1.5, aspectRatio, Environment::CONST_Z_NEAR, Environment::CONST_Z_FAR); glBindTexture(GL_TEXTURE_2D, texture->getTexID()); @@ -166,13 +166,13 @@ namespace ZL { glBlendFunc(GL_SRC_ALPHA, GL_ONE); renderer.PushMatrix(); - renderer.LoadIdentity(); - renderer.TranslateMatrix({ 0, 0, -1.0f * zoom }); + //renderer.LoadIdentity(); + //renderer.TranslateMatrix({ 0, 0, -1.0f * zoom }); renderer.DrawVertexRenderStruct(sparkQuad); renderer.PopMatrix(); - renderer.PopProjectionMatrix(); + //renderer.PopProjectionMatrix(); glDisable(GL_BLEND);