Merge, adding ship vertical shift
This commit is contained in:
parent
8d58e41459
commit
4cc6971542
@ -23,6 +23,8 @@ namespace ZL
|
|||||||
|
|
||||||
static bool g_exitBgAnimating = false;
|
static bool g_exitBgAnimating = false;
|
||||||
|
|
||||||
|
float x = 0;
|
||||||
|
|
||||||
Eigen::Quaternionf generateRandomQuaternion(std::mt19937& gen)
|
Eigen::Quaternionf generateRandomQuaternion(std::mt19937& gen)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -462,8 +464,8 @@ namespace ZL
|
|||||||
|
|
||||||
renderer.LoadIdentity();
|
renderer.LoadIdentity();
|
||||||
renderer.TranslateMatrix({ 0,0, -1.0f * Environment::zoom });
|
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) {
|
if (shipAlive) {
|
||||||
glBindTexture(GL_TEXTURE_2D, spaceshipTexture->getTexID());
|
glBindTexture(GL_TEXTURE_2D, spaceshipTexture->getTexID());
|
||||||
renderer.DrawVertexRenderStruct(spaceship);
|
renderer.DrawVertexRenderStruct(spaceship);
|
||||||
@ -478,7 +480,10 @@ namespace ZL
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (shipAlive) {
|
if (shipAlive) {
|
||||||
|
renderer.PushMatrix();
|
||||||
|
renderer.TranslateMatrix({ 0, 0, 16 });
|
||||||
sparkEmitter.draw(renderer, Environment::zoom, Environment::width, Environment::height);
|
sparkEmitter.draw(renderer, Environment::zoom, Environment::width, Environment::height);
|
||||||
|
renderer.PopMatrix();
|
||||||
projectileEmitter.draw(renderer, Environment::zoom, Environment::width, Environment::height);
|
projectileEmitter.draw(renderer, Environment::zoom, Environment::width, Environment::height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -905,10 +910,12 @@ namespace ZL
|
|||||||
if (event.key.keysym.sym == SDLK_o)
|
if (event.key.keysym.sym == SDLK_o)
|
||||||
{
|
{
|
||||||
Environment::shipVelocity += 50.f;
|
Environment::shipVelocity += 50.f;
|
||||||
|
//x = x + 2.0;
|
||||||
}
|
}
|
||||||
if (event.key.keysym.sym == SDLK_l)
|
if (event.key.keysym.sym == SDLK_l)
|
||||||
{
|
{
|
||||||
Environment::shipVelocity -= 50.f;
|
Environment::shipVelocity -= 50.f;
|
||||||
|
//x = x - 2.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -157,8 +157,8 @@ namespace ZL {
|
|||||||
renderer.EnableVertexAttribArray(vPositionName);
|
renderer.EnableVertexAttribArray(vPositionName);
|
||||||
renderer.EnableVertexAttribArray(vTexCoordName);
|
renderer.EnableVertexAttribArray(vTexCoordName);
|
||||||
|
|
||||||
float aspectRatio = static_cast<float>(screenWidth) / static_cast<float>(screenHeight);
|
//float aspectRatio = static_cast<float>(screenWidth) / static_cast<float>(screenHeight);
|
||||||
renderer.PushPerspectiveProjectionMatrix(1.0 / 1.5, aspectRatio, Environment::CONST_Z_NEAR, Environment::CONST_Z_FAR);
|
//renderer.PushPerspectiveProjectionMatrix(1.0 / 1.5, aspectRatio, Environment::CONST_Z_NEAR, Environment::CONST_Z_FAR);
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, texture->getTexID());
|
glBindTexture(GL_TEXTURE_2D, texture->getTexID());
|
||||||
|
|
||||||
@ -166,13 +166,13 @@ namespace ZL {
|
|||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||||
|
|
||||||
renderer.PushMatrix();
|
renderer.PushMatrix();
|
||||||
renderer.LoadIdentity();
|
//renderer.LoadIdentity();
|
||||||
renderer.TranslateMatrix({ 0, 0, -1.0f * zoom });
|
//renderer.TranslateMatrix({ 0, 0, -1.0f * zoom });
|
||||||
|
|
||||||
renderer.DrawVertexRenderStruct(sparkQuad);
|
renderer.DrawVertexRenderStruct(sparkQuad);
|
||||||
|
|
||||||
renderer.PopMatrix();
|
renderer.PopMatrix();
|
||||||
renderer.PopProjectionMatrix();
|
//renderer.PopProjectionMatrix();
|
||||||
|
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user