]> git.mxchange.org Git - flightgear.git/commitdiff
There are some problems with ssgTimedSelector's but shorter strings of
authorcurt <curt>
Fri, 18 Oct 2002 03:36:56 +0000 (03:36 +0000)
committercurt <curt>
Fri, 18 Oct 2002 03:36:56 +0000 (03:36 +0000)
rabbit lights appear to almost work except the last light or two is never
included in the animation and longer strings of lights are drawn as all
light on ... :-(

src/Objects/pt_lights.cxx

index a0171637aae61211b9b6015acf24299ceca28928..733e6f77594c77cac2f4a59597c87bee9a804bb9 100644 (file)
@@ -272,15 +272,17 @@ ssgTimedSelector *gen_rabbit_lights( const point_list &nodes,
 
     ssgTimedSelector *rabbit = new ssgTimedSelector;
 
-    unsigned int i;
+    int i;
     sgVec3 pt, normal;
-    for ( i = 0; i < pnt_i.size(); ++i ) {
+    for ( i = (int)pnt_i.size() - 1; i >= 0; --i ) {
         ssgVertexArray   *vl = new ssgVertexArray( 3 );
         ssgNormalArray   *nl = new ssgNormalArray( 3 );
         ssgColourArray   *cl = new ssgColourArray( 3 );
      
         sgSetVec3( pt, nodes[pnt_i[i]][0], nodes[pnt_i[i]][1],
                    nodes[pnt_i[i]][2] );
+        cout << "nml_i[" << i << "] = " << nml_i[i] << endl;
+
         sgSetVec3( normal, normals[nml_i[i]][0], normals[nml_i[i]][1],
                    normals[nml_i[i]][2] );
 
@@ -332,8 +334,8 @@ ssgTimedSelector *gen_rabbit_lights( const point_list &nodes,
             
     }
 
-    rabbit->setDuration( 5 );
-    rabbit->setLimits( 0, pnt_i.size() );
+    rabbit->setDuration( 10 );
+    rabbit->setLimits( 0, pnt_i.size() + 1 );
     rabbit->setMode( SSG_ANIM_SHUTTLE );
     rabbit->control( SSG_ANIM_START );