Final version of Beta 1

- made the world a little smaller such that there is only little space off screen
This commit is contained in:
2010-12-01 10:48:10 +01:00
parent 263a80a1fd
commit 1a30c7583c
3 changed files with 11 additions and 9 deletions
+9 -7
View File
@@ -49,9 +49,9 @@ int View::OnInit (int argc, char* argv[]) {
int i;
for (i = 0; i < 200; i++) {
BackgroundStar star;
star.position[0] = rand() / float(RAND_MAX);
star.position[1] = rand() / float(RAND_MAX);
star.position[2] = rand() / float(RAND_MAX);
star.position[0] = rand() / float(RAND_MAX) * 1.2;
star.position[1] = rand() / float(RAND_MAX) * 1.2;
star.position[2] = rand() / float(RAND_MAX) * 1.2;
mBackgroundStars.push_back (star);
}
@@ -211,10 +211,12 @@ void View::DrawStars() {
mBackgroundStars.at(i).position -= vector3d(Engine::GetFrameDuration() * 0.7 * mBackgroundStars.at(i).position[1] / world_width, 0., 0.);
if (mBackgroundStars.at(i).position[0] < 0.)
mBackgroundStars.at(i).position[0] += 1.;
if (mBackgroundStars.at(i).position[0] >= 1.)
mBackgroundStars.at(i).position[0] -= 1.;
// we move the stars a little more such that they are not blende out too early
// \todo compute proper bounds from Physics world size!
if (mBackgroundStars.at(i).position[0] < -0.1)
mBackgroundStars.at(i).position[0] += 1.2;
if (mBackgroundStars.at(i).position[0] >= 1.1)
mBackgroundStars.at(i).position[0] -= 1.2;
}
glEnd();