Revision: 6817 http://playerstage.svn.sourceforge.net/playerstage/?rev=6817&view=rev Author: alexcb Date: 2008-07-08 11:22:33 -0700 (Tue, 08 Jul 2008)
Log Message: ----------- more camera cleanup Modified Paths: -------------- code/stage/trunk/libstage/camera.cc code/stage/trunk/libstage/canvas.cc Modified: code/stage/trunk/libstage/camera.cc =================================================================== --- code/stage/trunk/libstage/camera.cc 2008-07-08 17:58:53 UTC (rev 6816) +++ code/stage/trunk/libstage/camera.cc 2008-07-08 18:22:33 UTC (rev 6817) @@ -190,8 +190,7 @@ if( to_scale > 0 ) { //zoom in _scale *= factor; - move( shift_x * w / _scale * _scale, - - shift_y * h / _scale * _scale ); + move( shift_x * w, - shift_y * h ); } else { //zoom out Modified: code/stage/trunk/libstage/canvas.cc =================================================================== --- code/stage/trunk/libstage/canvas.cc 2008-07-08 17:58:53 UTC (rev 6816) +++ code/stage/trunk/libstage/canvas.cc 2008-07-08 18:22:33 UTC (rev 6817) @@ -1000,7 +1000,6 @@ } else { stg_bounds3d_t extent = world->GetExtent(); camera.SetProjection( w(), h(), extent.y.min, extent.y.max ); - camera.Draw(); current_camera = &camera; } @@ -1010,26 +1009,19 @@ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); } - - if( pCamOn == true ) { - if( showFollow && last_selection ) { - //Follow the selected robot - stg_pose_t gpose = last_selection->GetGlobalPose(); + + //Follow the selected robot + if( showFollow && last_selection ) { + stg_pose_t gpose = last_selection->GetGlobalPose(); + if( pCamOn == true ) { perspective_camera.setPose( gpose.x, gpose.y, 0.2 ); perspective_camera.setYaw( rtod( gpose.a ) - 90.0 ); - + } else { + camera.setPose( gpose.x, gpose.y ); } - perspective_camera.Draw(); - } else if( showFollow && last_selection ) { - //Follow the selected robot - 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(); } - + + current_camera->Draw(); renderFrame(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit