Revision: 7172
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7172&view=rev
Author:   rtv
Date:     2008-11-26 21:01:07 +0000 (Wed, 26 Nov 2008)

Log Message:
-----------
added quick waypoint property and vis

Added Paths:
-----------
    code/stage/trunk/libstage/waypoint.cc

Added: code/stage/trunk/libstage/waypoint.cc
===================================================================
--- code/stage/trunk/libstage/waypoint.cc                               (rev 0)
+++ code/stage/trunk/libstage/waypoint.cc       2008-11-26 21:01:07 UTC (rev 
7172)
@@ -0,0 +1,44 @@
+
+#include "stage_internal.hh"
+
+Waypoint::Waypoint( stg_meters_t x, stg_meters_t y, stg_meters_t z, 
stg_radians_t a, stg_color_t color ) 
+  : color(color)
+{ 
+  pose.x = x; 
+  pose.y = y; 
+  pose.z = z; 
+  pose.a = a; 
+}
+
+Waypoint::Waypoint()
+{ 
+  pose = stg_pose_t( 0,0,0,0 ); 
+  color = 0; 
+};
+
+
+void Waypoint::Draw()
+{
+       GLdouble d[4];
+
+       d[0] = ((color & 0x00FF0000) >> 16) / 256.0;
+       d[1] = ((color & 0x0000FF00) >> 8)  / 256.0;
+       d[2] = ((color & 0x000000FF) >> 0)  / 256.0;
+       d[3] = (((color & 0xFF000000) >> 24) / 256.0);
+
+   glColor4dv( d );
+
+  glBegin(GL_POINTS);
+  glVertex3f( pose.x, pose.y, pose.z );
+  glEnd();
+
+  stg_meters_t quiver_length = 0.1;
+
+  double dx = cos(pose.a) * quiver_length;
+  double dy = sin(pose.a) * quiver_length;
+
+  glBegin(GL_LINES);
+  glVertex3f( pose.x, pose.y, pose.z );
+  glVertex3f( pose.x+dx, pose.y+dy, pose.z );
+  glEnd();      
+}


Property changes on: code/stage/trunk/libstage/waypoint.cc
___________________________________________________________________
Added: svn:eol-style
   + native


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to