- x, y, z = self.getProjPos(realPos)
- # mirror
- x = SCREEN_SIZE[0] - x
- # scale
- x, y = x * self.xratio, y * self.yratio
+ if self.mouseMode == MOUSE_SCREEN_COORDINATES :
+ x, y, z = self.getProjPos(realPos)
+ # mirror
+ x = SCREEN_SIZE[0] - x
+ # scale
+ x, y = x * self.xratio, y * self.yratio
+ elif self.mouseMode == MOUSE_REAL_COORDINATES :
+ x, y = realPos[:2]
+ x, y = x - self.handCenteredPosition[0], y - self.handCenteredPosition[1]
+ x = -x # miroir
+ x, y = x + DEFAULT_HAND_DISTANCE_RANGE, DEFAULT_HAND_DISTANCE_RANGE - y
+ x, y = map(lambda i : numpy.clip(i, 0, DEFAULT_HAND_DISTANCE_RANGE * 2), [x, y])
+ x = x * (self.pygameScreenWidth / (2. * DEFAULT_HAND_DISTANCE_RANGE))
+ y = y * (self.pygameScreenHeight / (2. * DEFAULT_HAND_DISTANCE_RANGE))
+