Files Classes Functions Hierarchy
#include <zprmouse.h>
Public Member Functions | |
| zprmouse (zpr &zz_) | |
| Constructor. | |
| point2< uint > const | mouse () const |
| Get the screen coordinates. | |
| point2< int > const | mouseint () const |
| Return the position as a point in integers. | |
| template<typename T > | |
| void | mouse (T &p) const |
| point2< double > const | mouseratio (point2< uint > const &p) const |
| Convert screen point to ratio. | |
| point2< double > const | mouseratio () const |
| Convert actual mouse screen point to ratio. | |
| point2< uint > const | mouseratioInv (point2< double > const &p) const |
| point3< double > const | world (point2< uint > const &p) const |
| point3< double > const | world (point2< double > const &p) const |
| Convert ratio to pixel screen point, then to world. | |
| point3< double > const | world () const |
| Convert actual mouse screen point to near world point. | |
| void | update () |
Public Attributes | |
| zpr & | zz |
| Reference to actual mouse state. | |
Top left is origin. So positive y is downward direction.
Local pixel coordinate system, Local ratio coordinate system, world near plane supported.
The local ratio is the screen mapped to a unit square. So could specify a point in local ratio and this would have meaning in all different screen rectangles.
Definition at line 19 of file zprmouse.h.
| zprmouse::zprmouse | ( | zpr & | zz_ | ) | [inline] |
| void zprmouse::mouse | ( | T & | p | ) | const [inline] |
Get the screen coordinates.
Definition at line 31 of file zprmouse.h.
References zpr::mouseX, zpr::mouseY, and zz.
00032 { return point2<uint>(zz.mouseX,zz.mouseY); }
| point2<int> const zprmouse::mouseint | ( | ) | const [inline] |
Return the position as a point in integers.
Definition at line 34 of file zprmouse.h.
References zpr::mouseX, zpr::mouseY, and zz.
00035 { return point2<int>(zz.mouseX,zz.mouseY); }
| point2< double > const zprmouse::mouseratio | ( | ) | const |
Convert actual mouse screen point to ratio.
Definition at line 18 of file zprmouse.cpp.
References zpr::mouseX, zpr::mouseY, and zz.
00019 { 00020 return mouseratio(point2<uint>(zz.mouseX,zz.mouseY)); 00021 }
Convert screen point to ratio.
Definition at line 3 of file zprmouse.cpp.
References zpr::height, r, zpr::width, point2< T >::x, point2< T >::y, and zz.
00004 { 00005 assert(zz.width!=0); 00006 assert(zz.height!=0); 00007 00008 point2<double> r(p.x,p.y); 00009 r.x /= (double)zz.width; 00010 r.y /= (double)zz.height; 00011 00012 assert(r.x <= 1.0); 00013 assert(r.y <= 1.0); 00014 00015 return r; 00016 }
Definition at line 46 of file zprmouse.h.
References zpr::height, zpr::width, point2< T >::x, point2< T >::y, and zz.
00047 { 00048 assert(p.x<=1.0); 00049 assert(p.y<=1.0); 00050 assert(p.x>=0.0); 00051 assert(p.y>=0.0); 00052 return point2<uint>(p.x*zz.width,p.y*zz.height); 00053 }
| void zprmouse::update | ( | ) | [inline] |
Definition at line 63 of file zprmouse.h.
References zpr::update(), and zz.
Referenced by mazedisp03::mouseevent().
| point3< double > const zprmouse::world | ( | ) | const |
Convert actual mouse screen point to near world point.
Definition at line 31 of file zprmouse.cpp.
References zpr::mouseXworld, zpr::mouseYworld, zpr::mouseZworld, and zz.
00032 { 00033 return point3<double>(zz.mouseXworld,zz.mouseYworld,zz.mouseZworld); 00034 }
Convert ratio to pixel screen point, then to world.
Definition at line 49 of file zprmouse.cpp.
00052 { 00053 return world( mouseratioInv(p) ); 00054 }
Definition at line 23 of file zprmouse.cpp.
References zpr::readMouse(), point2< T >::x, point3< T >::x, point2< T >::y, point3< T >::y, point3< T >::z, and zz.
Referenced by buttonpanel01::update().
00024 { 00025 point3<GLdouble> p2; 00026 zz.readMouse(&p2.x,&p2.y,&p2.z,p.x,p.y); 00027 00028 return point3<double>(p2.x,p2.y,p2.z); 00029 }
Reference to actual mouse state.
Definition at line 24 of file zprmouse.h.
Referenced by buttonpanel02::draw(), mazedisp03::f01(), mouse(), mouseint(), mouseratio(), mouseratioInv(), update(), buttonpanel02::update(), and world().
1.5.8