This commit is contained in:
end 2016-10-02 11:26:28 +02:00
commit c3b84633f9
3 changed files with 5157 additions and 4 deletions

View file

@ -28,9 +28,10 @@ namespace endofthejedi {
m_shader.loadFile(fss_game_objects, GL_FRAGMENT_SHADER);
#endif
addModel("../data/mesh/small_atomic_bomb.stl", &m_missileModel);
addModel("../data/mesh/planet_12.stl", &m_planetModel);
addModel("../data/mesh/ship_ufo.stl", &m_shipModel);
//addModel("../data/mesh/small_atomic_bomb.stl", &m_missileModel);
addModel("../data/mesh/rocket.stl", &m_missileModel);
addModel("../data/mesh/planet_12.stl", &m_planetModel);
addModel("../data/mesh/ship_ufo.stl", &m_shipModel);
}
void RendererPolygon3d::render(const game::State *state)
@ -236,9 +237,17 @@ namespace endofthejedi {
glm::vec2 vn = glm::normalize(missile->velocity);
float a = std::atan2(vn.y, vn.x);
glm::mat4 mat = computeModelMatrix(missile->position, 0.1f, a);
// TODO: which visual size has the rocket? in game its just a point with
// no size because all others have size.
return computeModelMatrix(missile->position, 0.03f, a);
//for atomic bomb
//return computeModelMatrix(missile->position, 0.03f, a);
// flipped too
mat = glm::rotate(mat, (float) M_PI/2.0f, glm::vec3(0.0f, 1.0f, 0.0f));
return mat;
}
glm::mat4 RendererPolygon3d::computeModelMatrix(const game::Ship *ship)