Takashi Asano
/
linearMirrorMotion1017
sotsuron
Fork of linearMirrorMotion1017 by
renderclass.h@21:4095a071724d, 2013-06-07 (annotated)
- Committer:
- takapiasano
- Date:
- Fri Jun 07 05:01:40 2013 +0000
- Revision:
- 21:4095a071724d
- Parent:
- 20:8475768fc2f7
- Child:
- 22:e86d63dfbbe1
demo horizontal
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hiromasaoku | 16:6dd2e60bc5bc | 1 | #include "mbed.h" |
hiromasaoku | 16:6dd2e60bc5bc | 2 | #include <vector> |
hiromasaoku | 19:8e9fe7d25b9c | 3 | #define PI 3.14159 |
hiromasaoku | 16:6dd2e60bc5bc | 4 | |
takapiasano | 21:4095a071724d | 5 | #define RENDER_INTERVAL 7000// in microseconds |
hiromasaoku | 17:dce982e0a383 | 6 | |
hiromasaoku | 16:6dd2e60bc5bc | 7 | struct point2dl { |
hiromasaoku | 16:6dd2e60bc5bc | 8 | int x,y; |
hiromasaoku | 16:6dd2e60bc5bc | 9 | int laserSwitch; // laser {1: on 0:off} until next step |
hiromasaoku | 16:6dd2e60bc5bc | 10 | }; |
hiromasaoku | 16:6dd2e60bc5bc | 11 | |
hiromasaoku | 16:6dd2e60bc5bc | 12 | struct letter { |
hiromasaoku | 16:6dd2e60bc5bc | 13 | int pointnum; |
hiromasaoku | 16:6dd2e60bc5bc | 14 | vector<point2dl> letpoints; |
hiromasaoku | 16:6dd2e60bc5bc | 15 | }; |
hiromasaoku | 16:6dd2e60bc5bc | 16 | |
hiromasaoku | 16:6dd2e60bc5bc | 17 | class render{ |
hiromasaoku | 16:6dd2e60bc5bc | 18 | public: |
hiromasaoku | 16:6dd2e60bc5bc | 19 | void startRender(); |
hiromasaoku | 16:6dd2e60bc5bc | 20 | void setRender(vector<letter> *p); |
hiromasaoku | 16:6dd2e60bc5bc | 21 | void translating(float speed, float angle); |
hiromasaoku | 16:6dd2e60bc5bc | 22 | void stopRender(); |
hiromasaoku | 16:6dd2e60bc5bc | 23 | void draw(); |
hiromasaoku | 18:6f86abfae754 | 24 | void transform(point2dl& mypoint); |
hiromasaoku | 18:6f86abfae754 | 25 | void shearing(point2dl& dataBefore); |
hiromasaoku | 18:6f86abfae754 | 26 | void rotation(point2dl& dataBefore); |
hiromasaoku | 18:6f86abfae754 | 27 | void updateSpeed(float vx, float vy); |
hiromasaoku | 20:8475768fc2f7 | 28 | |
hiromasaoku | 20:8475768fc2f7 | 29 | int shearingSwitch; |
hiromasaoku | 18:6f86abfae754 | 30 | |
hiromasaoku | 16:6dd2e60bc5bc | 31 | private: |
hiromasaoku | 16:6dd2e60bc5bc | 32 | vector<letter> *ptext; |
hiromasaoku | 16:6dd2e60bc5bc | 33 | vector<letter> translated; |
hiromasaoku | 16:6dd2e60bc5bc | 34 | int currentLetters; |
hiromasaoku | 16:6dd2e60bc5bc | 35 | int currentPoints; |
hiromasaoku | 16:6dd2e60bc5bc | 36 | point2dl drawPoint; |
hiromasaoku | 17:dce982e0a383 | 37 | |
hiromasaoku | 17:dce982e0a383 | 38 | Ticker renderTimer; |
hiromasaoku | 20:8475768fc2f7 | 39 | Timer speedTimer; |
hiromasaoku | 18:6f86abfae754 | 40 | |
hiromasaoku | 18:6f86abfae754 | 41 | float speed; |
hiromasaoku | 18:6f86abfae754 | 42 | float angle; |
hiromasaoku | 20:8475768fc2f7 | 43 | |
hiromasaoku | 16:6dd2e60bc5bc | 44 | }; |