sotsuron

Fork of linearMirrorMotion1017 by Hiromasa Oku

Revision:
29:aa8fe9fccec8
Parent:
20:8475768fc2f7
--- a/renderclass.h	Fri May 31 06:32:07 2013 +0000
+++ b/renderclass.h	Tue Jul 30 04:16:21 2013 +0000
@@ -2,7 +2,11 @@
 #include <vector>
 #define PI 3.14159
 
-#define RENDER_INTERVAL 700// in microseconds
+#define RENDER_INTERVAL 500// in microseconds
+#define WAITING_FIRST 1 // this means WAITING_FIRST number of interrupt cycles in case of the first point
+#define WAITING_LAST 1
+
+enum stateMachine{NORMAL_POINT, FIRST_POINT, AFTER_LAST_POINT};
 
 struct point2dl {
     int x,y;
@@ -10,7 +14,7 @@
 };
 
 struct letter {
-    int pointnum;
+    int pointnum; //not used for the time being
     vector<point2dl> letpoints;
 };
 
@@ -24,9 +28,13 @@
     void transform(point2dl& mypoint);
     void shearing(point2dl& dataBefore);
     void rotation(point2dl& dataBefore);
-    void updateSpeed(float vx, float vy);
+    void updateSpeed(float vvx, float vvy);
 
     int shearingSwitch;
+    int laserColor;
+    
+    int radious;
+    int startSwitch;
     
     private:
     vector<letter> *ptext;
@@ -35,10 +43,17 @@
     int currentPoints;
     point2dl drawPoint;
     
+    stateMachine rendererState;
+    int firstPointCounter, lastPointCounter;
+    
     Ticker renderTimer;
     Timer   speedTimer;
     
     float speed;
     float angle;
+    float vx;
+    float vy;
+    float intvx,intvy;
     
-};
\ No newline at end of file
+    
+};