Files Classes Functions Hierarchy
00001 #include <zprmouse.h> 00002 00003 point2<double> const zprmouse::mouseratio(point2<uint> const & p) const 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 } 00017 00018 point2<double> const zprmouse::mouseratio() const 00019 { 00020 return mouseratio(point2<uint>(zz.mouseX,zz.mouseY)); 00021 } 00022 00023 point3<double> const zprmouse::world(point2<uint> const & p) const 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 } 00030 00031 point3<double> const zprmouse::world() const 00032 { 00033 return point3<double>(zz.mouseXworld,zz.mouseYworld,zz.mouseZworld); 00034 } 00035 00036 /* 00037 point2<uint> const zprmouse::mouseratioInv 00038 ( 00039 point2<double> const & p 00040 ) const; 00041 { 00042 assert(p.x<=1.0); 00043 assert(p.y<=1.0); 00044 return point2<uint>(p.x*z.width,p.y*z.height); 00045 } 00046 */ 00047 00048 point3<double> const zprmouse::world 00049 ( 00050 point2<double> const & p 00051 ) const 00052 { 00053 return world( mouseratioInv(p) ); 00054 } 00055
1.5.8