Removing some of the triangle code in main.cpp

This commit is contained in:
Philip Rosedale 2012-11-18 11:00:21 -08:00
parent 4174364adc
commit cb52fb7f04
2 changed files with 26 additions and 37 deletions

View file

@ -125,9 +125,6 @@ Cloud cloud(250000, // Particles
struct {
float vertices[NUM_TRIS * 3];
float vel [NUM_TRIS * 3];
glm::vec3 vel1[NUM_TRIS];
glm::vec3 vel2[NUM_TRIS];
int element[NUM_TRIS];
}tris;
@ -325,7 +322,6 @@ void init(void)
//tris.normals[i*3+2] = pos.z;
// Moving - white
tris.element[i] = 1;
//tris.colors[i*3] = 1.0; tris.colors[i*3+1] = 1.0; tris.colors[i*3+2] = 1.0;
tris.vel[i*3] = (randFloat() - 0.5)*VEL_SCALE;
tris.vel[i*3+1] = (randFloat() - 0.5)*VEL_SCALE;
@ -375,8 +371,6 @@ void update_tris()
float field_val[3];
float field_contrib[3];
for (i = 0; i < NUM_TRIS; i++)
{
if (tris.element[i] == 1) // If moving object, move and drag
{
// Update position
tris.vertices[i*3+0] += tris.vel[i*3];
@ -391,10 +385,6 @@ void update_tris()
tris.vel[i*3] *= DRAG;
tris.vel[i*3+1] *= DRAG;
tris.vel[i*3+2] *= DRAG;
}
if (tris.element[i] == 1)
{
// Read and add velocity from field
field_value(field_val, &tris.vertices[i*3]);
@ -409,7 +399,6 @@ void update_tris()
field_contrib[2] = tris.vel[i*3+2]*FIELD_COUPLE;
field_add(field_contrib, &tris.vertices[i*3]);
}
// bounce at edge of world
for (j=0; j < 3; j++) {