Update of /cvsroot/playerstage/code/stage/libstage
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14456/libstage

Modified Files:
      Tag: opengl
        Makefile block.cc blockgrid.cc canvas.cc model.cc 
        model_fiducial.cc model_laser.cc model_load.cc 
        model_position.cc model_ranger.cc stage.hh stest.cc world.cc 
        worldgui.cc 
Log Message:
patching up API and documentation

Index: worldgui.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstage/Attic/worldgui.cc,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -d -r1.1.2.6 -r1.1.2.7
*** worldgui.cc 24 Dec 2007 10:50:45 -0000      1.1.2.6
--- worldgui.cc 29 Dec 2007 05:07:40 -0000      1.1.2.7
***************
*** 58,62 ****
  
    //printf("CALLBACK: You picked '%s'\n", picked);
!   
    // this is slow and a little ugly, but it's the least hacky approach I think
         if( strcmp(picked, MITEM_VIEW_DATA ) == 0 ) canvas->InvertView( 
STG_SHOW_DATA );
--- 58,62 ----
  
    //printf("CALLBACK: You picked '%s'\n", picked);
! 
    // this is slow and a little ugly, but it's the least hacky approach I think
         if( strcmp(picked, MITEM_VIEW_DATA ) == 0 ) canvas->InvertView( 
STG_SHOW_DATA );

Index: model_laser.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstage/Attic/model_laser.cc,v
retrieving revision 1.1.2.15
retrieving revision 1.1.2.16
diff -C2 -d -r1.1.2.15 -r1.1.2.16
*** model_laser.cc      24 Dec 2007 10:50:45 -0000      1.1.2.15
--- model_laser.cc      29 Dec 2007 05:07:40 -0000      1.1.2.16
***************
*** 133,137 ****
    StgModel::Load(); 
  
!   CWorldFile* wf = world->wf;
    
    sample_count = wf->ReadInt( id, "samples", sample_count );        
--- 133,137 ----
    StgModel::Load(); 
  
!   CWorldFile* wf = world->GetWorldFile();
    
    sample_count = wf->ReadInt( id, "samples", sample_count );        
***************
*** 154,159 ****
    // lasers
  
!   if( (testblock->mod != finder) &&
!       (testblock->mod->LaserReturn() > 0 ) )
      return true; // match!
  
--- 154,159 ----
    // lasers
  
!   if( (testblock->Model() != finder) &&
!       (testblock->Model()->LaserReturn() > 0 ) )
      return true; // match!
  

Index: block.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstage/Attic/block.cc,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -C2 -d -r1.1.2.7 -r1.1.2.8
*** block.cc    24 Dec 2007 10:50:45 -0000      1.1.2.7
--- block.cc    29 Dec 2007 05:07:40 -0000      1.1.2.8
***************
*** 163,167 ****
               (int)pt_count );
  
!   double ppm = mod->world->ppm;
   
    // update the global coordinate list
--- 163,167 ----
               (int)pt_count );
  
!   double ppm = mod->World()->ppm;
   
    // update the global coordinate list
***************
*** 177,182 ****
        mod->LocalToGlobal( &gpose );
              
!       pts_global[p].x = (int32_t)floor((gpose.x+mod->world->width/2.0)*ppm);
!       pts_global[p].y = (int32_t)floor((gpose.y+mod->world->height/2.0)*ppm);
  
        PRINT_DEBUG2("loc [%.2f %.2f]", 
--- 177,182 ----
        mod->LocalToGlobal( &gpose );
              
!       pts_global[p].x = (int32_t)floor((gpose.x+mod->World()->width/2.0)*ppm);
!       pts_global[p].y = 
(int32_t)floor((gpose.y+mod->World()->height/2.0)*ppm);
  
        PRINT_DEBUG2("loc [%.2f %.2f]", 
***************
*** 193,198 ****
    global_zmin = gpose.z;
    global_zmax = gpose.z + (zmax-zmin);
! 
!   mod->world->MapBlock( this );
  }
  
--- 193,205 ----
    global_zmin = gpose.z;
    global_zmax = gpose.z + (zmax-zmin);
!   
!   stg_render_info_t render_info;
!   render_info.world = mod->World();
!   render_info.block = this;
!   
!   stg_polygon_3d( pts_global, pt_count,
!                 (stg_line3d_func_t)StgWorld::AddBlockPixel,
!                 (void*)&render_info );
!               
  }
  
***************
*** 208,212 ****
        &g_array_index( rendered_points, stg_point_int_t, p);
        
!       mod->world->bgrid->RemoveBlock( pt->x, pt->y, this );
  
      }
--- 215,219 ----
        &g_array_index( rendered_points, stg_point_int_t, p);
        
!       mod->World()->RemoveBlock( pt->x, pt->y, this );
  
      }
***************
*** 226,231 ****
  
  
! void stg_block_list_scale( GList* blocks, 
!                          stg_size_t* size )
  {
    if( g_list_length( blocks ) < 1 )
--- 233,238 ----
  
  
! void StgBlock::ScaleList( GList* blocks, 
!                         stg_size_t* size )
  {
    if( g_list_length( blocks ) < 1 )

Index: model.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstage/Attic/model.cc,v
retrieving revision 1.1.2.19
retrieving revision 1.1.2.20
diff -C2 -d -r1.1.2.19 -r1.1.2.20
*** model.cc    24 Dec 2007 10:50:45 -0000      1.1.2.19
--- model.cc    29 Dec 2007 05:07:40 -0000      1.1.2.20
***************
*** 107,141 ****
  #define _GNU_SOURCE
  
- #include <limits.h> 
- //#include <assert.h>
- //#include <math.h>
- //#include <GL/gl.h>
- //#include <glib.h>
- 
  //#define DEBUG
  #include "stage.hh"
  
  // basic model
! #define STG_DEFAULT_BLOBRETURN true
! #define STG_DEFAULT_BOUNDARY true
! #define STG_DEFAULT_COLOR (0xFFFF0000) // red
! #define STG_DEFAULT_ENERGY_CAPACITY 1000.0
! #define STG_DEFAULT_ENERGY_CHARGEENABLE 1
! #define STG_DEFAULT_ENERGY_GIVERATE 0.0
! #define STG_DEFAULT_ENERGY_PROBERANGE 0.0
! #define STG_DEFAULT_ENERGY_TRICKLERATE 0.1
! #define STG_DEFAULT_GEOM_SIZEX 0.10 // 1m square by default
! #define STG_DEFAULT_GEOM_SIZEY 0.10
! #define STG_DEFAULT_GEOM_SIZEZ 0.10
! #define STG_DEFAULT_GRID false
! #define STG_DEFAULT_GRIPPERRETURN false
! #define STG_DEFAULT_LASERRETURN LaserVisible
! #define STG_DEFAULT_MAP_RESOLUTION 0.1
! #define STG_DEFAULT_MASK (STG_MOVE_TRANS | STG_MOVE_ROT)
! #define STG_DEFAULT_MASS 10.0  // kg
! #define STG_DEFAULT_NOSE false
! #define STG_DEFAULT_OBSTACLERETURN true
! #define STG_DEFAULT_OUTLINE true
! #define STG_DEFAULT_RANGERRETURN true
  
  
--- 107,136 ----
  #define _GNU_SOURCE
  
  //#define DEBUG
  #include "stage.hh"
+ #include <limits.h> 
  
  // basic model
! #define STG_DEFAULT_MOD_BLOBRETURN true
! #define STG_DEFAULT_MOD_BOUNDARY false
! #define STG_DEFAULT_MOD_COLOR (0xFFFF0000) // red
! #define STG_DEFAULT_MOD_ENERGY_CAPACITY 1000.0
! #define STG_DEFAULT_MOD_ENERGY_CHARGEENABLE 1
! #define STG_DEFAULT_MOD_ENERGY_GIVERATE 0.0
! #define STG_DEFAULT_MOD_ENERGY_PROBERANGE 0.0
! #define STG_DEFAULT_MOD_ENERGY_TRICKLERATE 0.1
! #define STG_DEFAULT_MOD_GEOM_SIZEX 0.10 // 1m square by default
! #define STG_DEFAULT_MOD_GEOM_SIZEY 0.10
! #define STG_DEFAULT_MOD_GEOM_SIZEZ 0.10
! #define STG_DEFAULT_MOD_GRID false
! #define STG_DEFAULT_MOD_GRIPPERRETURN false
! #define STG_DEFAULT_MOD_LASERRETURN LaserVisible
! #define STG_DEFAULT_MOD_MAP_RESOLUTION 0.1
! #define STG_DEFAULT_MOD_MASK (STG_MOVE_TRANS | STG_MOVE_ROT)
! #define STG_DEFAULT_MOD_MASS 10.0  // kg
! #define STG_DEFAULT_MOD_NOSE false
! #define STG_DEFAULT_MOD_OBSTACLERETURN true
! #define STG_DEFAULT_MOD_OUTLINE true
! #define STG_DEFAULT_MOD_RANGERRETURN true
  
  
***************
*** 183,187 ****
    memset( &global_pose, 0, sizeof(global_pose));
    
-   this->ray_list = NULL;
    this->trail = g_array_new( false, false, sizeof(stg_trail_item_t) );
  
--- 178,181 ----
***************
*** 196,216 ****
    this->subs = 0;
    
!   this->geom.size.x = STG_DEFAULT_GEOM_SIZEX;
!   this->geom.size.y = STG_DEFAULT_GEOM_SIZEX;
!   this->geom.size.z = STG_DEFAULT_GEOM_SIZEX;
    memset( &this->geom.pose, 0, sizeof(this->geom.pose));
  
!   this->obstacle_return = STG_DEFAULT_OBSTACLERETURN;
!   this->ranger_return = STG_DEFAULT_RANGERRETURN;
!   this->blob_return = STG_DEFAULT_BLOBRETURN;
!   this->laser_return = STG_DEFAULT_LASERRETURN;
!   this->gripper_return = STG_DEFAULT_GRIPPERRETURN;
!   this->boundary = false;//STG_DEFAULT_BOUNDARY;
!   this->color = STG_DEFAULT_COLOR;
!   this->map_resolution = STG_DEFAULT_MAP_RESOLUTION; // meters
!   this->gui_nose = STG_DEFAULT_NOSE;
!   this->gui_grid = STG_DEFAULT_GRID;
!   this->gui_outline = STG_DEFAULT_OUTLINE;
!   this->gui_mask = this->parent ? 0 : STG_DEFAULT_MASK;
  
    this->fiducial_return = 0;
--- 190,210 ----
    this->subs = 0;
    
!   this->geom.size.x = STG_DEFAULT_MOD_GEOM_SIZEX;
!   this->geom.size.y = STG_DEFAULT_MOD_GEOM_SIZEX;
!   this->geom.size.z = STG_DEFAULT_MOD_GEOM_SIZEX;
    memset( &this->geom.pose, 0, sizeof(this->geom.pose));
  
!   this->obstacle_return = STG_DEFAULT_MOD_OBSTACLERETURN;
!   this->ranger_return = STG_DEFAULT_MOD_RANGERRETURN;
!   this->blob_return = STG_DEFAULT_MOD_BLOBRETURN;
!   this->laser_return = STG_DEFAULT_MOD_LASERRETURN;
!   this->gripper_return = STG_DEFAULT_MOD_GRIPPERRETURN;
!   this->boundary = STG_DEFAULT_MOD_BOUNDARY;
!   this->color = STG_DEFAULT_MOD_COLOR;
!   this->map_resolution = STG_DEFAULT_MOD_MAP_RESOLUTION; // meters
!   this->gui_nose = STG_DEFAULT_MOD_NOSE;
!   this->gui_grid = STG_DEFAULT_MOD_GRID;
!   this->gui_outline = STG_DEFAULT_MOD_OUTLINE;
!   this->gui_mask = this->parent ? 0 : STG_DEFAULT_MOD_MASK;
  
    this->fiducial_return = 0;
***************
*** 220,227 ****
  
    bzero( &this->velocity, sizeof(velocity));
-   this->on_velocity_list = false;
  
!   //this->velocity.a = 0.2;
!   //SetVelocity( &this->velocity );
  
    this->last_update = 0;
--- 214,219 ----
  
    bzero( &this->velocity, sizeof(velocity));
  
!   this->on_velocity_list = false;
  
    this->last_update = 0;
***************
*** 255,260 ****
                         bool inherit_color )
  {
-   //UnMap();
-   
    blocks = 
      g_list_prepend( blocks, new StgBlock( this, pts, pt_count, 
--- 247,250 ----
***************
*** 264,269 ****
    // force recreation of display lists before drawing
    body_dirty = true;
- 
-   //Map();
  }
  
--- 254,257 ----
***************
*** 391,411 ****
  }
  
- // // default update function that implements velocities for all objects
- // void StgModel::MoveDueToVelocity( void )
- // {
- //   // now move the model if it has any velocity
- //   if( velocity.x || velocity.y || velocity.z || velocity.a )
- //     this->UpdatePoses( void );
- // }
- 
- 
- // StgModel* StgModel::Create( stg_world_t* world, StgModel* parent, 
- //                        stg_id_t id, CWorldFile* wf )
- // { 
- //   return new StgModel( world, parent, id, wf ); 
- // }    
- 
- 
- 
  void StgModel::Say( char* str )
  {
--- 379,382 ----
***************
*** 581,585 ****
    for( GList* it=blocks; it; it=it->next )
      ((StgBlock*)it->data)->Map();
! 
    if( world->graphics && this->debug )
      glPopMatrix();
--- 552,556 ----
    for( GList* it=blocks; it; it=it->next )
      ((StgBlock*)it->data)->Map();
!   
    if( world->graphics && this->debug )
      glPopMatrix();
***************
*** 901,907 ****
  void StgModel::DataVisualize( void )
  {
!  //  // do nothing but recursively draw the tree below this model
! //   for( GList* it=children; it; it=it->next )
! //     ((StgModel*)it->data)->DataVisualize();
  }
  
--- 872,876 ----
  void StgModel::DataVisualize( void )
  {
!   // do nothing - subclasses will do more here
  }
  
***************
*** 1072,1077 ****
    memcpy( &this->geom, geom, sizeof(stg_geom_t));
    
!   stg_block_list_scale( blocks,
!                       &geom->size );
    
    body_dirty = true;
--- 1041,1045 ----
    memcpy( &this->geom, geom, sizeof(stg_geom_t));
    
!   StgBlock::ScaleList( blocks, &geom->size );
    
    body_dirty = true;
***************
*** 1223,1232 ****
    this->parent = newparent;
    
-   // HACK - completely rebuild the GUI elements - it's too complex to patch 
up the tree
-   //gui_model_destroy( mod );
-   //gui_model_create( mod );
- 
    CallCallbacks( &this->parent );
- 
    return 0; //ok
  }
--- 1191,1195 ----
***************
*** 1236,1240 ****
                             StgModel* finder )
  { 
!   return( (testblock->mod != finder) && testblock->mod->ObstacleReturn()  );
  }     
  
--- 1199,1203 ----
                             StgModel* finder )
  { 
!   return( (testblock->Model() != finder) && 
testblock->Model()->ObstacleReturn()  );
  }     
  
***************
*** 1279,1288 ****
        StgBlock* b = (StgBlock*)it->data;
        
        // loop over all edges of the block
!       for( unsigned int p=0; p<b->pt_count; p++ ) 
        { 
          // find the local poses of the ends of this block edge
!         stg_point_t* pt1 = &b->pts[p];
!         stg_point_t* pt2 = &b->pts[(p+1) % b->pt_count]; 
          double dx = pt2->x - pt1->x;
          double dy = pt2->y - pt1->y;
--- 1242,1254 ----
        StgBlock* b = (StgBlock*)it->data;
        
+       unsigned int pt_count;
+       stg_point_t *pts = b->Points( &pt_count );
+ 
        // loop over all edges of the block
!       for( unsigned int p=0; p < pt_count; p++ ) 
        { 
          // find the local poses of the ends of this block edge
!         stg_point_t* pt1 = &pts[p];
!         stg_point_t* pt2 = &pts[(p+1) % pt_count]; 
          double dx = pt2->x - pt1->x;
          double dy = pt2->y - pt1->y;
***************
*** 1499,1505 ****
  }
  
! StgModel* StgModel::GetUnsubcribedModelOfType( char* modelstr )
  {
!   //  printf( "searching for %s in model %s with string %s\n", modelstr, 
token, typestr );
  
    if( subs == 0 && (strcmp( typestr, modelstr ) == 0) )
--- 1465,1471 ----
  }
  
! StgModel* StgModel::GetUnsubscribedModelOfType( char* modelstr )
  {
!   //   printf( "searching for %s in model %s with string %s\n", modelstr, 
token, typestr );
  
    if( subs == 0 && (strcmp( typestr, modelstr ) == 0) )
***************
*** 1511,1515 ****
        StgModel* child = (StgModel*)it->data;
        
!       StgModel* found = child->GetUnsubcribedModelOfType( modelstr );
        if( found )
        return found;
--- 1477,1481 ----
        StgModel* child = (StgModel*)it->data;
        
!       StgModel* found = child->GetUnsubscribedModelOfType( modelstr );
        if( found )
        return found;

Index: stest.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstage/Attic/stest.cc,v
retrieving revision 1.1.2.21
retrieving revision 1.1.2.22
diff -C2 -d -r1.1.2.21 -r1.1.2.22
*** stest.cc    24 Dec 2007 10:50:45 -0000      1.1.2.21
--- stest.cc    29 Dec 2007 05:07:40 -0000      1.1.2.22
***************
*** 55,62 ****
    for( int i=0; i<POPSIZE; i++ )
      {
-       //robots[i].randcount = 0;
-       //robots[i].avoidcount = 0;
-       //robots[i].obs = false;
-        
         char* base = "r";
         sprintf( namebuf, "%s%d", base, i );
--- 55,58 ----
***************
*** 65,80 ****
         robots[i].position->Subscribe();
         
!        //robots[i].laser = (StgModelLaser*)
!        //robots[i].position->GetUnsubcribedModelOfType( "laser" );     
!        //assert(robots[i].laser);
!        //robots[i].laser->Subscribe();
  
         robots[i].fiducial = (StgModelFiducial*)
!        robots[i].position->GetUnsubcribedModelOfType( "fiducial" );    
         assert(robots[i].fiducial);
         robots[i].fiducial->Subscribe();
         
         robots[i].ranger = (StgModelRanger*)
!        robots[i].position->GetUnsubcribedModelOfType( "ranger" );
         assert(robots[i].ranger);
         robots[i].ranger->Subscribe();
--- 61,76 ----
         robots[i].position->Subscribe();
         
!        robots[i].laser = (StgModelLaser*)
!        robots[i].position->GetUnsubscribedModelOfType( "laser" );      
!        assert(robots[i].laser);
!        robots[i].laser->Subscribe();
  
         robots[i].fiducial = (StgModelFiducial*)
!        robots[i].position->GetUnsubscribedModelOfType( "fiducial" );   
         assert(robots[i].fiducial);
         robots[i].fiducial->Subscribe();
         
         robots[i].ranger = (StgModelRanger*)
!        robots[i].position->GetUnsubscribedModelOfType( "ranger" );
         assert(robots[i].ranger);
         robots[i].ranger->Subscribe();
***************
*** 139,144 ****
        vel.a = turn_speed;
        
!       //printf( "robot %s x %.2f y %.2f z %.2f a %.2f\n",
!       //robots[i].position->Token(), vel.x, vel.y, vel.z, vel.a );
        
        robots[i].position->SetSpeed( forward_speed, side_speed, turn_speed );
--- 135,140 ----
        vel.a = turn_speed;
        
!       printf( "robot %s [%.2f %.2f %.2f %.2f]\n",
!               robots[i].position->Token(), vel.x, vel.y, vel.z, vel.a );
        
        robots[i].position->SetSpeed( forward_speed, side_speed, turn_speed );


Index: world.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstage/Attic/world.cc,v
retrieving revision 1.1.2.19
retrieving revision 1.1.2.20
diff -C2 -d -r1.1.2.19 -r1.1.2.20
*** world.cc    24 Dec 2007 10:50:45 -0000      1.1.2.19
--- world.cc    29 Dec 2007 05:07:40 -0000      1.1.2.20
***************
*** 51,54 ****
--- 51,56 ----
  #define _GNU_SOURCE
  
+ //#define DEBUG 
+ 
  #include <stdlib.h>
  #include <assert.h>
***************
*** 57,62 ****
  #include <glib-object.h> // fior g_type_init() used by GDKPixbuf objects
  
- //#define DEBUG 
- 
  #include "stage.hh"
  
--- 59,62 ----
***************
*** 146,150 ****
                          // change this
  
!   this->models_by_id = g_hash_table_new( g_int_hash, g_int_equal );
    this->models_by_name = g_hash_table_new( g_str_hash, g_str_equal );
    this->sim_time = 0;
--- 146,150 ----
                          // change this
  
!   this->models_by_id = g_hash_table_new( g_direct_hash, g_direct_equal );
    this->models_by_name = g_hash_table_new( g_str_hash, g_str_equal );
    this->sim_time = 0;
***************
*** 297,307 ****
        int parent_entity = wf->GetEntityParent( entity );
        
!       //PRINT_DEBUG2( "wf entity %d parent entity %d\n", 
!       //          entity, parent_entity );
        
        StgModel *mod, *parent;
        
!       parent = (StgModel*)
!       g_hash_table_lookup( this->models_by_id, &parent_entity );
        
        // find the creator function pointer in the hash table
--- 297,306 ----
        int parent_entity = wf->GetEntityParent( entity );
        
!       PRINT_DEBUG2( "wf entity %d parent entity %d\n", 
!                   entity, parent_entity );
        
        StgModel *mod, *parent;
        
!       parent = GetModel( parent_entity );
        
        // find the creator function pointer in the hash table
***************
*** 335,350 ****
  }
  
- void StgWorld::Stop()
- {
-   this->paused = true;
- }
- 
- void StgWorld::Start()
- {
-   this->paused = false;
- 
-   wf->WarnUnused();
- }
- 
  stg_usec_t StgWorld::RealTimeNow()
  {
--- 334,337 ----
***************
*** 428,432 ****
    //        token, mod->id, mod->Token() );  
  
!   g_hash_table_insert( this->models_by_id, &mod->id, mod );
    AddModelName( mod );
  }
--- 415,419 ----
    //        token, mod->id, mod->Token() );  
  
!   g_hash_table_insert( this->models_by_id, (gpointer)mod->Id(), mod );
    AddModelName( mod );
  }
***************
*** 440,444 ****
  StgModel* StgWorld::GetModel( const char* name )
  {
!   //printf( "looking up model name %s in models_by_name\n", name );
    StgModel* mod = (StgModel*)g_hash_table_lookup( this->models_by_name, name 
);
  
--- 427,431 ----
  StgModel* StgWorld::GetModel( const char* name )
  {
!   PRINT_DEBUG1( "looking up model name %s in models_by_name", name );
    StgModel* mod = (StgModel*)g_hash_table_lookup( this->models_by_name, name 
);
  
***************
*** 451,455 ****
  StgModel* StgWorld::GetModel( const stg_id_t id )
  {
!   //printf( "looking up model id %d in models_by_id\n", id );
    return (StgModel*)g_hash_table_lookup( this->models_by_id, (gpointer)id );
  }
--- 438,442 ----
  StgModel* StgWorld::GetModel( const stg_id_t id )
  {
!   PRINT_DEBUG1( "looking up model id %d in models_by_id", id );
    return (StgModel*)g_hash_table_lookup( this->models_by_id, (gpointer)id );
  }
***************
*** 466,485 ****
  }
  
- void StgWorld::DrawRays()
- {
-   glDisable( GL_DEPTH_TEST );
-   PushColor( 0,0,0,0.5 );
-   for( GList* it = ray_list; it; it=it->next )
-     {
-       float* pts = (float*)it->data;
-       glBegin( GL_LINES );
-       glVertex2f( pts[0], pts[1] );
-       glVertex2f( pts[2], pts[3] );
-       glEnd();
-     }  
-   PopColor();
-   glEnable( GL_DEPTH_TEST );
- }
- 
  void StgWorld::ClearRays()
  {
--- 453,456 ----
***************
*** 567,578 ****
              // if this block does not belong to the searching model and it
              // matches the predicate and it's in the right z range
!             if( block && (block->mod != finder) && 
!                 (*func)( block, arg ) )// &&
!                 //pose->z >= block->global_zmin &&
!                 //pose->z < block->global_zmax )       
                {
                  // a hit!
                  if( hit_model )
!                   *hit_model = block->mod;          
                  
                  // how far away was that strike?
--- 538,548 ----
              // if this block does not belong to the searching model and it
              // matches the predicate and it's in the right z range
!             if( block && (block->Model() != finder) && 
!                 block->IntersectGlobalZ( pose->z ) &&
!                 (*func)( block, arg ) )
                {
                  // a hit!
                  if( hit_model )
!                   *hit_model = block->Model();              
                  
                  // how far away was that strike?
***************
*** 621,626 ****
  {
    // ask every model to save itself
!   g_hash_table_foreach( this->models_by_id, stg_model_save_cb, NULL );
    
    this->wf->Save(NULL);
  }
--- 591,598 ----
  {
    // ask every model to save itself
!   //g_hash_table_foreach( this->models_by_id, stg_model_save_cb, NULL );
    
+   ForEachModel( stg_model_save_cb, NULL );
+ 
    this->wf->Save(NULL);
  }
***************
*** 633,637 ****
    
    // ask every model to load itself from the file database
!   g_hash_table_foreach( this->models_by_id, stg_model_reload_cb, NULL );
  }
  
--- 605,611 ----
    
    // ask every model to load itself from the file database
!   //g_hash_table_foreach( this->models_by_id, stg_model_reload_cb, NULL );
! 
!   ForEachModel( stg_model_reload_cb, NULL );
  }
  
***************
*** 647,692 ****
  }
  
- 
- // void draw_voxel( int x, int y, int z )
- // {
- //   glTranslatef( x,y,z );
-   
- //   glBegin(GL_QUADS);               // Draw The Cube Using quads
- //     glColor3f(0.0f,1.0f,0.0f);     // Color Blue
- //     glVertex3f( 1.0f, 1.0f,-1.0f); // Top Right Of The Quad (Top)
- //     glVertex3f(-1.0f, 1.0f,-1.0f); // Top Left Of The Quad (Top)
- //     glVertex3f(-1.0f, 1.0f, 1.0f); // Bottom Left Of The Quad (Top)
- //     glVertex3f( 1.0f, 1.0f, 1.0f); // Bottom Right Of The Quad (Top)
- //     glColor3f(1.0f,0.5f,0.0f);     // Color Orange
- //     glVertex3f( 1.0f,-1.0f, 1.0f); // Top Right Of The Quad (Bottom)
- //     glVertex3f(-1.0f,-1.0f, 1.0f); // Top Left Of The Quad (Bottom)
- //     glVertex3f(-1.0f,-1.0f,-1.0f); // Bottom Left Of The Quad (Bottom)
- //     glVertex3f( 1.0f,-1.0f,-1.0f); // Bottom Right Of The Quad (Bottom)
- //     glColor3f(1.0f,0.0f,0.0f);     // Color Red    
- //     glVertex3f( 1.0f, 1.0f, 1.0f); // Top Right Of The Quad (Front)
- //     glVertex3f(-1.0f, 1.0f, 1.0f); // Top Left Of The Quad (Front)
- //     glVertex3f(-1.0f,-1.0f, 1.0f); // Bottom Left Of The Quad (Front)
- //     glVertex3f( 1.0f,-1.0f, 1.0f); // Bottom Right Of The Quad (Front)
- //     glColor3f(1.0f,1.0f,0.0f);     // Color Yellow
- //     glVertex3f( 1.0f,-1.0f,-1.0f); // Top Right Of The Quad (Back)
- //     glVertex3f(-1.0f,-1.0f,-1.0f); // Top Left Of The Quad (Back)
- //     glVertex3f(-1.0f, 1.0f,-1.0f); // Bottom Left Of The Quad (Back)
- //     glVertex3f( 1.0f, 1.0f,-1.0f); // Bottom Right Of The Quad (Back)
- //     glColor3f(0.0f,0.0f,1.0f);     // Color Blue
- //     glVertex3f(-1.0f, 1.0f, 1.0f); // Top Right Of The Quad (Left)
- //     glVertex3f(-1.0f, 1.0f,-1.0f); // Top Left Of The Quad (Left)
- //     glVertex3f(-1.0f,-1.0f,-1.0f); // Bottom Left Of The Quad (Left)
- //     glVertex3f(-1.0f,-1.0f, 1.0f); // Bottom Right Of The Quad (Left)
- //     glColor3f(1.0f,0.0f,1.0f);     // Color Violet
- //     glVertex3f( 1.0f, 1.0f,-1.0f); // Top Right Of The Quad (Right)
- //     glVertex3f( 1.0f, 1.0f, 1.0f); // Top Left Of The Quad (Right)
- //     glVertex3f( 1.0f,-1.0f, 1.0f); // Bottom Left Of The Quad (Right)
- //     glVertex3f( 1.0f,-1.0f,-1.0f); // Bottom Right Of The Quad (Right)
- //   glEnd();                 // End Drawing The Cube
- 
- //   glTranslatef( -x, -y, -z );
- // }
- 
- 
  void StgWorld::MetersToPixels( stg_meters_t mx, stg_meters_t my, 
                               int32_t *px, int32_t *py )
--- 621,624 ----
***************
*** 696,746 ****
  }
  
! typedef struct
! {
!   StgBlockGrid* grid;
!   StgBlock* block;
! } _render_info_t;
! 
! int stg_add_block_to_grid( int x, int y, int z,
!                          _render_info_t* rinfo )
  {
!   rinfo->grid->AddBlock( x, y, rinfo->block );
    return FALSE;
  }
  
- 
- void StgWorld::MapBlock( StgBlock* block )
- {
-   stg_point_int_t* pts = block->pts_global;
-   unsigned int pt_count = block->pt_count;
-   
-   assert( pt_count >=2 );
-   
-   _render_info_t rinfo;
-   rinfo.grid = bgrid;
-   rinfo.block = block;
- 
-   // TODO - could be a little bit faster - currently considers each
-   // vertex twice
-   for( unsigned int p=0; p<pt_count; p++ )
-     {
-       int32_t x = pts[p].x; // line start
-       int32_t y = pts[p].y; // line end
-       
-       int32_t dx = pts[(p+1)%pt_count].x - x;
-       int32_t dy = pts[(p+1)%pt_count].y - y;
- 
-       
-       // pass this structure into our per-pixel callback
-       _render_info_t rinfo;
-       rinfo.grid = bgrid;
-       rinfo.block = block;
-       
-       // ignore return value
-       stg_line_3d( x, y, 0,
-                  dx, dy, 0,
-                  (stg_line3d_func_t)stg_add_block_to_grid, 
-                  &rinfo );
-     }
- }
- 
--- 628,636 ----
  }
  
! int StgWorld::AddBlockPixel( int x, int y, int z,
!                            stg_render_info_t* rinfo )
  {
!   rinfo->world->bgrid->AddBlock( x, y, rinfo->block );
    return FALSE;
  }
  

Index: model_load.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstage/Attic/model_load.cc,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -d -r1.1.2.6 -r1.1.2.7
*** model_load.cc       24 Dec 2007 10:50:45 -0000      1.1.2.6
--- model_load.cc       29 Dec 2007 05:07:40 -0000      1.1.2.7
***************
*** 200,204 ****
            }     
          
!         stg_block_list_scale( this->blocks, &this->geom.size );         
          this->Map();
          this->body_dirty = true;
--- 200,204 ----
            }     
          
!         StgBlock::ScaleList( this->blocks, &this->geom.size );          
          this->Map();
          this->body_dirty = true;
***************
*** 269,273 ****
          }
        
!       stg_block_list_scale( this->blocks, &this->geom.size );
  
        if( this->boundary )
--- 269,273 ----
          }
        
!       StgBlock::ScaleList( this->blocks, &this->geom.size );
  
        if( this->boundary )

Index: model_ranger.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstage/Attic/model_ranger.cc,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -C2 -d -r1.1.2.8 -r1.1.2.9
*** model_ranger.cc     24 Dec 2007 10:50:45 -0000      1.1.2.8
--- model_ranger.cc     29 Dec 2007 05:07:40 -0000      1.1.2.9
***************
*** 74,83 ****
  */
  
! //#define DEBUG
! 
! #include <math.h>
  #include "stage.hh"
! 
! #define STG_RANGER_WATTS 2.0 // ranger power consumption
  
  StgModelRanger::StgModelRanger( StgWorld* world, 
--- 74,89 ----
  */
  
! //#define DEBUG 1
  #include "stage.hh"
! #include <math.h>
!    
! static const stg_watts_t STG_DEFAULT_RANGER_WATTSPERSENSOR = 0.2;
! static const stg_meters_t STG_DEFAULT_RANGER_SIZEX = 0.01;
! static const stg_meters_t STG_DEFAULT_RANGER_SIZEY = 0.04;
! static const stg_meters_t STG_DEFAULT_RANGER_SIZEZ = 0.04;
! static const stg_meters_t STG_DEFAULT_RANGER_RANGEMAX = 5.0;
! static const stg_meters_t STG_DEFAULT_RANGER_RANGEMIN = 0.0;
! static const unsigned int STG_DEFAULT_RANGER_RAYCOUNT = 3;
! static const unsigned int STG_DEFAULT_RANGER_SENSORCOUNT = 16;
  
  StgModelRanger::StgModelRanger( StgWorld* world, 
***************
*** 101,108 ****
    memset( &geom, 0, sizeof(geom)); // no size
    this->SetGeom( &geom );
! 
    samples = NULL;
!   sensor_count = 16;
!   sensors= g_new0( stg_ranger_sensor_t, sensor_count );
  
    double offset = MIN(geom.size.x, geom.size.y) / 2.0;
--- 107,114 ----
    memset( &geom, 0, sizeof(geom)); // no size
    this->SetGeom( &geom );
!   
    samples = NULL;
!   sensor_count = STG_DEFAULT_RANGER_SENSORCOUNT;
!   sensors = new stg_ranger_sensor_t[sensor_count];
  
    double offset = MIN(geom.size.x, geom.size.y) / 2.0;
***************
*** 116,127 ****
        sensors[c].pose.z = 0;//geom.size.z / 2.0; // half way up
        
!       sensors[c].size.x = 0.01; // a small device
!       sensors[c].size.y = 0.04;
!       sensors[c].size.z = 0.04;
        
!       sensors[c].bounds_range.min = 0;
!       sensors[c].bounds_range.max = 5.0;
        sensors[c].fov = (2.0*M_PI)/(sensor_count+1);
!       sensors[c].ray_count = 3;
      }
  }
--- 122,133 ----
        sensors[c].pose.z = 0;//geom.size.z / 2.0; // half way up
        
!       sensors[c].size.x = STG_DEFAULT_RANGER_SIZEX;
!       sensors[c].size.y = STG_DEFAULT_RANGER_SIZEY;
!       sensors[c].size.z = STG_DEFAULT_RANGER_SIZEZ;
        
!       sensors[c].bounds_range.min = STG_DEFAULT_RANGER_RANGEMIN;
!       sensors[c].bounds_range.max = STG_DEFAULT_RANGER_RANGEMAX;;
        sensors[c].fov = (2.0*M_PI)/(sensor_count+1);
!       sensors[c].ray_count = STG_DEFAULT_RANGER_RAYCOUNT;
      }
  }
***************
*** 137,143 ****
    PRINT_DEBUG( "ranger startup" );
    
!   this->samples = new stg_meters_t[sensor_count];
! 
!   this->SetWatts( STG_RANGER_WATTS );
  }
  
--- 143,147 ----
    PRINT_DEBUG( "ranger startup" );
    
!   this->SetWatts( STG_DEFAULT_RANGER_WATTSPERSENSOR * sensor_count );
  }
  
***************
*** 162,166 ****
    StgModel::Load();
    
!   CWorldFile* wf = world->wf;
  
    if( wf->PropertyExists(id, "scount" ) )
--- 166,170 ----
    StgModel::Load();
    
!   CWorldFile* wf = world->GetWorldFile();
  
    if( wf->PropertyExists(id, "scount" ) )
***************
*** 173,185 ****
        
        char key[256];
!       sensors = g_renew( stg_ranger_sensor_t, sensors, sensor_count );
!       
        stg_size_t common_size;
!       common_size.x = wf->ReadTupleLength( id, "ssize", 0, sensors[0].size.x 
);
!       common_size.y = wf->ReadTupleLength( id, "ssize", 1, sensors[0].size.y 
);
        
!       double common_min = wf->ReadTupleLength( id, "sview", 0, 
sensors[0].bounds_range.min );
!       double common_max = wf->ReadTupleLength( id, "sview", 1, 
sensors[0].bounds_range.max );
!       double common_fov = wf->ReadTupleAngle( id, "sview", 2, sensors[0].fov 
);
  
        int common_ray_count = wf->ReadInt( id, "sraycount", 
sensors[0].ray_count );
--- 177,191 ----
        
        char key[256];
!       //sensors = g_renew( stg_ranger_sensor_t, sensors, sensor_count );
!       delete [] sensors;
!       sensors = new stg_ranger_sensor_t[sensor_count];
! 
        stg_size_t common_size;
!       common_size.x = wf->ReadTupleLength( id, "ssize", 0, 
STG_DEFAULT_RANGER_SIZEX );
!       common_size.y = wf->ReadTupleLength( id, "ssize", 1, 
STG_DEFAULT_RANGER_SIZEY );
        
!       double common_min = wf->ReadTupleLength( id, "sview", 0,  
STG_DEFAULT_RANGER_RANGEMIN );
!       double common_max = wf->ReadTupleLength( id, "sview", 1, 
STG_DEFAULT_RANGER_RANGEMAX );
!       double common_fov = wf->ReadTupleAngle( id, "sview", 2, M_PI / 
(double)sensor_count );
  
        int common_ray_count = wf->ReadInt( id, "sraycount", 
sensors[0].ray_count );
***************
*** 242,246 ****
    
    // Ignore myself, my children, and my ancestors.
!   return( block->mod->RangerReturn() && !block->mod->IsRelated( finder ) );
  }     
  
--- 248,252 ----
    
    // Ignore myself, my children, and my ancestors.
!   return( block->Model()->RangerReturn() && !block->Model()->IsRelated( 
finder ) );
  }     
  
***************
*** 255,259 ****
      return;
    
!   assert( samples ); // make sure we have the range data array
    
    //PRINT_DEBUG2( "[%d] updating ranger %s", (int)world->sim_time_ms, token );
--- 261,267 ----
      return;
    
!   if( samples ==  NULL )
!     samples = new stg_meters_t[sensor_count];  
!   assert( samples );
    
    //PRINT_DEBUG2( "[%d] updating ranger %s", (int)world->sim_time_ms, token );

Index: model_position.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstage/Attic/model_position.cc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** model_position.cc   31 Oct 2007 03:55:11 -0000      1.1.2.2
--- model_position.cc   29 Dec 2007 05:07:40 -0000      1.1.2.3
***************
*** 163,167 ****
    char* keyword = NULL;
    
!   CWorldFile* wf = world->wf;
  
    // load steering mode
--- 163,167 ----
    char* keyword = NULL;
    
!   CWorldFile* wf = world->GetWorldFile();
  
    // load steering mode
***************
*** 445,449 ****
        {
        // integrate our velocities to get an 'odometry' position estimate.
!       double dt = this->world->interval_sim/1e3;
        
        est_pose.a = NORMALIZE( est_pose.a + (vel.a * dt) * (1.0 
+integration_error.a) );
--- 445,449 ----
        {
        // integrate our velocities to get an 'odometry' position estimate.
!       double dt = this->world->GetSimInterval()/1e3;
        
        est_pose.a = NORMALIZE( est_pose.a + (vel.a * dt) * (1.0 
+integration_error.a) );

Index: model_fiducial.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstage/Attic/model_fiducial.cc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** model_fiducial.cc   24 Dec 2007 10:50:45 -0000      1.1.2.2
--- model_fiducial.cc   29 Dec 2007 05:07:40 -0000      1.1.2.3
***************
*** 97,101 ****
  bool fiducial_raytrace_match( StgBlock* testblock, StgModel* finder )
  {
!   return( ! finder->IsRelated( testblock->mod ) );
  }     
  
--- 97,101 ----
  bool fiducial_raytrace_match( StgBlock* testblock, StgModel* finder )
  {
!   return( ! finder->IsRelated( testblock->Model() ) );
  }     
  
***************
*** 106,110 ****
  
    // don't consider models with invalid returns  
!   if( him->fiducial_return == 0 )
      {
        //PRINT_DEBUG1( "  but model %s has a zero fiducial ID", him->Token());
--- 106,110 ----
  
    // don't consider models with invalid returns  
!   if( him->FiducialReturn() == 0 )
      {
        //PRINT_DEBUG1( "  but model %s has a zero fiducial ID", him->Token());
***************
*** 113,117 ****
  
    // check to see if this neighbor has the right fiducial key
!   if( fiducial_key != him->fiducial_key )
      {
        //PRINT_DEBUG1( "  but model %s doesn't match the fiducial key", 
him->Token());
--- 113,117 ----
  
    // check to see if this neighbor has the right fiducial key
!   if( fiducial_key != him->FiducialKey() )
      {
        //PRINT_DEBUG1( "  but model %s doesn't match the fiducial key", 
him->Token());
***************
*** 189,199 ****
        // if he's within ID range, get his fiducial.return value, else
        // we see value 0
!       fid.id = range < max_range_id ? hitmod->fiducial_return : 0;
        
        PRINT_DEBUG2( "adding %s's value %d to my list of fiducials",
!                   him->Token(), him->fiducial_return );
        
        g_array_append_val( data, fid );
      }
  }
    
--- 189,202 ----
        // if he's within ID range, get his fiducial.return value, else
        // we see value 0
!       fid.id = range < max_range_id ? hitmod->FiducialReturn() : 0;
        
        PRINT_DEBUG2( "adding %s's value %d to my list of fiducials",
!                   him->Token(), him->FiducialReturn() );
        
        g_array_append_val( data, fid );
      }
+   
+   fiducials = (stg_fiducial_t*)data->data;
+   fiducial_count = data->len;
  }
    
***************
*** 219,225 ****
    // TODO - add a fiducial-only hash table to the world to speed this
    // up a lot for large populations
!   g_hash_table_foreach( world->models_by_id, 
!                       (GHFunc)(StgModelFiducial::AddModelIfVisibleStatic), 
!                       this );
    
    PRINT_DEBUG2( "model %s saw %d fiducials", token, data->len );
--- 222,227 ----
    // TODO - add a fiducial-only hash table to the world to speed this
    // up a lot for large populations
!   world->ForEachModel( (GHFunc)(StgModelFiducial::AddModelIfVisibleStatic), 
!                      this );
    
    PRINT_DEBUG2( "model %s saw %d fiducials", token, data->len );
***************
*** 232,236 ****
     StgModel::Load();
     
!    CWorldFile* wf = world->wf;
     
     // load fiducial-specific properties
--- 234,238 ----
     StgModel::Load();
     
!    CWorldFile* wf = world->GetWorldFile();
     
     // load fiducial-specific properties

Index: stage.hh
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstage/Attic/stage.hh,v
retrieving revision 1.1.2.21
retrieving revision 1.1.2.22
diff -C2 -d -r1.1.2.21 -r1.1.2.22
*** stage.hh    24 Dec 2007 11:20:36 -0000      1.1.2.21
--- stage.hh    29 Dec 2007 05:07:40 -0000      1.1.2.22
***************
*** 61,71 ****
  #include "colors.h"
  
! #define STG_STRING_AUTHORS {                  \
!     "Richard Vaughan",                                \
!       "Brian Gerkey",                         \
!       "Andrew Howard",                                \
!       "Reed Hedges",                          \
!       "Pooya Karimian",                               \
!       "and contributors",                       \
        NULL }
[...1142 lines suppressed...]
-   } stg_speech_config_t;
- 
-   /** speech data packet
-    */
-   typedef struct
-   {
-     char string[STG_SPEECH_MAX_STRING_LEN];
-   } stg_speech_data_t;
- 
-   /** speech command packet
-    */
-   typedef struct
-   {
-     stg_speech_cmd_type_t cmd;
-     char string[STG_SPEECH_MAX_STRING_LEN];
-   } stg_speech_cmd_t;
- 
    // end the group of all models
    /[EMAIL PROTECTED]/
--- 2272,2275 ----

Index: blockgrid.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstage/Attic/blockgrid.cc,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -d -r1.1.2.6 -r1.1.2.7
*** blockgrid.cc        19 Nov 2007 07:40:41 -0000      1.1.2.6
--- blockgrid.cc        29 Dec 2007 05:07:40 -0000      1.1.2.7
***************
*** 1,4 ****
--- 1,6 ----
  #include "stage.hh"
  
+ // todo - get rid of constants in code, so that these are just
+ // defaults
  const uint32_t NBITS = 5;
  const uint32_t NSIZE = 1<<NBITS;
***************
*** 133,137 ****
  }
  
! void StgBlockGrid::RemoveBlock( StgBlock* block )
  {
    for( uint32_t x=0; x<width; x++ )
--- 135,139 ----
  }
  
! void StgBlockGrid::GlobalRemoveBlock( StgBlock* block )
  {
    for( uint32_t x=0; x<width; x++ )

Index: canvas.cc
===================================================================
RCS file: /cvsroot/playerstage/code/stage/libstage/Attic/canvas.cc,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -C2 -d -r1.1.2.7 -r1.1.2.8
*** canvas.cc   24 Dec 2007 10:50:45 -0000      1.1.2.7
--- canvas.cc   29 Dec 2007 05:07:40 -0000      1.1.2.8
***************
*** 1,3 ****
- \
  #include "stage.hh"
  #include <FL/fl_draw.H>
--- 1,2 ----
***************
*** 78,84 ****
        StgModel* mod = (StgModel*)it->data;      
  
!       if( mod->gui_mask & (STG_MOVE_TRANS | STG_MOVE_ROT ))
        {
!         uint32_t col = (mod->id | 0xFF000000);
          glColor4ubv( (GLubyte*)&col );     
          mod->DrawPicker();
--- 77,83 ----
        StgModel* mod = (StgModel*)it->data;      
  
!       if( mod->GuiMask() & (STG_MOVE_TRANS | STG_MOVE_ROT ))
        {
!         uint32_t col = (mod->Id() | 0xFF000000);
          glColor4ubv( (GLubyte*)&col );     
          mod->DrawPicker();
***************
*** 98,103 ****
    id &= 0x00FFFFFF;
    
!   StgModel* mod = (StgModel*)
!     g_hash_table_lookup( world->models_by_id, &id );
    
    //printf("%p %s %d\n", mod, mod ? mod->Token() : "", id );
--- 97,101 ----
    id &= 0x00FFFFFF;
    
!   StgModel* mod = world->GetModel( id );
    
    //printf("%p %s %d\n", mod, mod ? mod->Token() : "", id );
***************
*** 115,119 ****
            g_list_remove_link( selected_models, link );
  
!         mod->disabled = false;
        }                         
        else      
--- 113,117 ----
            g_list_remove_link( selected_models, link );
  
!         mod->Disable();
        }                         
        else      
***************
*** 121,125 ****
          last_selection = mod;
          selected_models = g_list_prepend( selected_models, mod );
!         mod->disabled = true;
        }
     
--- 119,123 ----
          last_selection = mod;
          selected_models = g_list_prepend( selected_models, mod );
!         mod->Enable();
        }
     
***************
*** 280,284 ****
        {
          for( GList* it=selected_models; it; it=it->next )
!           ((StgModel*)it->data)->disabled = false;
          
          g_list_free( selected_models );
--- 278,282 ----
        {
          for( GList* it=selected_models; it; it=it->next )
!           ((StgModel*)it->data)->Enable();
          
          g_list_free( selected_models );
***************
*** 297,301 ****
        {
        case 'p': // pause
!         world->paused = !world->paused;
          break;
        case ' ': // space bar
--- 295,299 ----
        {
        case 'p': // pause
!         world->TogglePause();
          break;
        case ' ': // space bar
***************
*** 354,358 ****
        gl_font( FL_HELVETICA, 12 );
        
!       double zclip = hypot(world->width, world->height) * scale;
        double pixels_width =  w();
        double pixels_height = h();
--- 352,356 ----
        gl_font( FL_HELVETICA, 12 );
        
!       double zclip = hypot(world->Width(), world->Height()) * scale;
        double pixels_width =  w();
        double pixels_height = h();
***************
*** 404,408 ****
      {      
        glLoadIdentity ();
!       double zclip = hypot(world->width, world->height) * scale;
        glTranslatef(  0,0,
                     -zclip / 2.0 );
--- 402,406 ----
      {      
        glLoadIdentity ();
!       double zclip = hypot(world->Width(), world->Height()) * scale;
        glTranslatef(  0,0,
                     -zclip / 2.0 );
***************
*** 426,431 ****
     glPolygonOffset(1.0, 1.0);
     glColor3f( 1,1,1 );
!    glRectf( -world->width/2.0, -world->height/2.0,
!           world->width/2.0, world->height/2.0 ); 
     glDisable(GL_POLYGON_OFFSET_FILL);
  
--- 424,429 ----
     glPolygonOffset(1.0, 1.0);
     glColor3f( 1,1,1 );
!    glRectf( -world->Width()/2.0, -world->Height()/2.0,
!           world->Width()/2.0, world->Height()/2.0 ); 
     glDisable(GL_POLYGON_OFFSET_FILL);
  
***************
*** 436,454 ****
         
         glPushMatrix();
!        glTranslatef( -world->width/2.0, -world->height/2.0, 1 );
!        glScalef( 1.0/world->ppm, 1.0/world->ppm, 0 );
         glPolygonMode( GL_FRONT, GL_LINE );
         colorstack.Push(1,0,0);
         
!       if( showflags & STG_SHOW_OCCUPANCY )
!       world->bgrid->Draw( false );
! 
!       if( showflags & STG_SHOW_QUADTREE )
!       world->bgrid->Draw( true );
!       
!       colorstack.Pop();
!       glPopMatrix();  
!       
!       glEnable( GL_LINE_SMOOTH );
       }
     
--- 434,452 ----
         
         glPushMatrix();
!        glTranslatef( -world->Width()/2.0, -world->Height()/2.0, 1 );
!        glScalef( 1.0/world->Resolution(), 1.0/world->Resolution(), 0 );
         glPolygonMode( GL_FRONT, GL_LINE );
         colorstack.Push(1,0,0);
         
!        if( showflags & STG_SHOW_OCCUPANCY )
!        ((StgWorldGui*)world)->GetBlockGrid()->Draw( false );
!        
!        if( showflags & STG_SHOW_QUADTREE )
!        ((StgWorldGui*)world)->GetBlockGrid()->Draw( true );
!        
!        colorstack.Pop();
!        glPopMatrix();  
!        
!        glEnable( GL_LINE_SMOOTH );
       }
     
***************
*** 500,507 ****
         }
       }
! 
!    if( world->ray_list )
       {
!        world->DrawRays();
         world->ClearRays();
       }
--- 498,517 ----
         }
       }
!    
!    if( world->GetRayList() )
       {
!        glDisable( GL_DEPTH_TEST );
!        PushColor( 0,0,0,0.5 );
!        for( GList* it = world->GetRayList(); it; it=it->next )
!        {
!          float* pts = (float*)it->data;
!          glBegin( GL_LINES );
!          glVertex2f( pts[0], pts[1] );
!          glVertex2f( pts[2], pts[3] );
!          glEnd();
!        }  
!        PopColor();
!        glEnable( GL_DEPTH_TEST );
!        
         world->ClearRays();
       }


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to