Revision: 6530
http://playerstage.svn.sourceforge.net/playerstage/?rev=6530&view=rev
Author: alexcb
Date: 2008-06-10 15:41:55 -0700 (Tue, 10 Jun 2008)
Log Message:
-----------
fixed follow selected robot bug introduced by camera changes
Modified Paths:
--------------
code/stage/trunk/libstage/canvas.cc
Modified: code/stage/trunk/libstage/canvas.cc
===================================================================
--- code/stage/trunk/libstage/canvas.cc 2008-06-10 22:22:24 UTC (rev 6529)
+++ code/stage/trunk/libstage/canvas.cc 2008-06-10 22:41:55 UTC (rev 6530)
@@ -345,24 +345,7 @@
if( ! (showflags & STG_SHOW_TRAILS) || robot_camera )
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
- // if following selected, shift the view to above the selected robot
- if( (showflags & STG_SHOW_FOLLOW) && last_selection && robot_camera ==
false )
- {
- glLoadIdentity ();
- double zclip = 20 * camera.getScale(); //hypot(world->Width(),
world->Height()) * camera.getScale();
- glTranslatef( 0,0,
- -zclip / 2.0 );
- // meter scale
- glScalef ( camera.getScale(), camera.getScale(),
camera.getScale() ); // zoom
-
- stg_pose_t gpose = last_selection->GetGlobalPose();
-
- // and put it in the center of the window
- //glRotatef( -rtod(gpose.a), 0,0,1 );
- glTranslatef( -gpose.x, -gpose.y, 0 );
- }
-
glPushMatrix();
// draw the world size rectangle in white, using the polygon offset
@@ -553,7 +536,6 @@
//TODO find a better home for loading textures
if( loaded_texture == false ) {
-
GLuint stall_id =
TextureManager::getInstance().loadTexture( "assets/stall.png" );
TextureManager::getInstance()._stall_texture_id =
stall_id;
@@ -567,9 +549,6 @@
camera.SetProjection( w(), h(), extent.y.min, extent.y.max );
camera.Draw();
-
-
-
// enable vertex arrays
glEnableClientState( GL_VERTEX_ARRAY );
//glEnableClientState( GL_COLOR_ARRAY );
@@ -577,6 +556,16 @@
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
}
+ //Follow the selected robot
+ if( (showflags & STG_SHOW_FOLLOW) && last_selection ) {
+ stg_pose_t gpose = last_selection->GetGlobalPose();
+ camera.setPose( gpose.x, gpose.y );
+
+ stg_bounds3d_t extent = world->GetExtent();
+ camera.SetProjection( w(), h(), extent.y.min, extent.y.max );
+ camera.Draw();
+ }
+
renderFrame();
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit