tiene que lector huella funciona error ios objective-c opengl-es raytracing glkit

ios - que - touch id no funciona



¿Está actualizando Open Touch Touch Detection(Ray Tracing) para iPad Retina? (1)

Tengo el siguiente código que estoy usando para el trazado de rayos. El código funciona con éxito en iPads sin retina, sin embargo, no funciona en los iPads retina. El toque se detecta, sin embargo, el punto convertido está a la izquierda y debajo de donde debería estar. ¿Alguien puede sugerir cómo puedo actualizar el siguiente para acomodar la pantalla retina?

- (void)handleTap: (UITapGestureRecognizer *)recognizer { CGPoint tapLoc = [recognizer locationInView:self.view]; bool testResult; GLint viewport[4]; glGetIntegerv(GL_VIEWPORT, viewport); float uiKitOffset = 113; //Need to factor in the height of the nav bar + the height of the tab bar at the bottom in the storyboard. GLKVector3 nearPt = GLKMathUnproject(GLKVector3Make(tapLoc.x, (tapLoc.y-1024+uiKitOffset)*-1, 0.0), modelViewMatrix, projectionMatrix, &viewport[0] , &testResult); GLKVector3 farPt = GLKMathUnproject(GLKVector3Make(tapLoc.x, (tapLoc.y-1024+uiKitOffset)*-1, 1.0), modelViewMatrix, projectionMatrix, &viewport[0] , &testResult); farPt = GLKVector3Subtract(farPt, nearPt); for (Object * Object in self.objectArray) { ... }


Simplemente multiplique xey de tapLoc en [UIScreen mainScreen] .scale y 1024 * [UIScreen mainScreen] .scale o reemplace con viewport [3]

Creo que algo así como:

- (void)handleTap: (UITapGestureRecognizer *)recognizer { CGPoint tapLoc = [recognizer locationInView:self.view]; tapLoc.x *= [UIScreen mainScreen].scale; tapLoc.y *= [UIScreen mainScreen].scale; bool testResult; GLint viewport[4]; glGetIntegerv(GL_VIEWPORT, viewport); float uiKitOffset = 113; //Need to factor in the height of the nav bar + the height of the tab bar at the bottom in the storyboard. GLKVector3 nearPt = GLKMathUnproject(GLKVector3Make(tapLoc.x, (tapLoc.y-viewport[3]+uiKitOffset)*-1, 0.0), modelViewMatrix, projectionMatrix, &viewport[0] , &testResult); GLKVector3 farPt = GLKMathUnproject(GLKVector3Make(tapLoc.x, (tapLoc.y-viewport[3]+uiKitOffset)*-1, 1.0), modelViewMatrix, projectionMatrix, &viewport[0] , &testResult); farPt = GLKVector3Subtract(farPt, nearPt); .... }