mirror of
https://github.com/overte-org/overte.git
synced 2025-06-19 05:00:08 +02:00
Removing some of the triangle code in main.cpp
This commit is contained in:
parent
4174364adc
commit
cb52fb7f04
2 changed files with 26 additions and 37 deletions
Binary file not shown.
11
main.cpp
11
main.cpp
|
@ -125,9 +125,6 @@ Cloud cloud(250000, // Particles
|
||||||
struct {
|
struct {
|
||||||
float vertices[NUM_TRIS * 3];
|
float vertices[NUM_TRIS * 3];
|
||||||
float vel [NUM_TRIS * 3];
|
float vel [NUM_TRIS * 3];
|
||||||
glm::vec3 vel1[NUM_TRIS];
|
|
||||||
glm::vec3 vel2[NUM_TRIS];
|
|
||||||
int element[NUM_TRIS];
|
|
||||||
}tris;
|
}tris;
|
||||||
|
|
||||||
|
|
||||||
|
@ -325,7 +322,6 @@ void init(void)
|
||||||
//tris.normals[i*3+2] = pos.z;
|
//tris.normals[i*3+2] = pos.z;
|
||||||
|
|
||||||
// Moving - white
|
// 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.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] = (randFloat() - 0.5)*VEL_SCALE;
|
||||||
tris.vel[i*3+1] = (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_val[3];
|
||||||
float field_contrib[3];
|
float field_contrib[3];
|
||||||
for (i = 0; i < NUM_TRIS; i++)
|
for (i = 0; i < NUM_TRIS; i++)
|
||||||
{
|
|
||||||
if (tris.element[i] == 1) // If moving object, move and drag
|
|
||||||
{
|
{
|
||||||
// Update position
|
// Update position
|
||||||
tris.vertices[i*3+0] += tris.vel[i*3];
|
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] *= DRAG;
|
||||||
tris.vel[i*3+1] *= DRAG;
|
tris.vel[i*3+1] *= DRAG;
|
||||||
tris.vel[i*3+2] *= DRAG;
|
tris.vel[i*3+2] *= DRAG;
|
||||||
}
|
|
||||||
|
|
||||||
if (tris.element[i] == 1)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Read and add velocity from field
|
// Read and add velocity from field
|
||||||
field_value(field_val, &tris.vertices[i*3]);
|
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_contrib[2] = tris.vel[i*3+2]*FIELD_COUPLE;
|
||||||
field_add(field_contrib, &tris.vertices[i*3]);
|
field_add(field_contrib, &tris.vertices[i*3]);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// bounce at edge of world
|
// bounce at edge of world
|
||||||
for (j=0; j < 3; j++) {
|
for (j=0; j < 3; j++) {
|
||||||
|
|
Loading…
Reference in a new issue