Files Classes Functions Hierarchy
Conversion functions for mouse coordinate spaces. More...
#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. | |
Conversion functions for mouse coordinate spaces.
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] |
Definition at line 38 of file zprmouse.h.
References zpr::mouseX, zpr::mouseY, and zz.
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.
Definition at line 46 of file zprmouse.h.
References zpr::height, zpr::width, point2< T >::x, point2< T >::y, and zz.
| 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().
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.6.1