Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give FTouchManager the option to raycast touch positions onto a plane #212

Open
MattRix opened this issue Nov 13, 2013 · 2 comments
Open
Assignees

Comments

@MattRix
Copy link
Owner

MattRix commented Nov 13, 2013

In other words, make it so that if the Futile scene has been transformed in 3D (ex. rotated or scaled), that the touch values would still be accurate to where they are happening in the Futile scene. Currently the touch positions are relative to the actual screen, rather than the scene itself.

In theory, this would also give the benefit of letting non-Futile objects claim touches before they reach Futile.

@ghost ghost assigned MattRix Nov 13, 2013
@diegodorado
Copy link

I am doing this way to get the ray, but I wonder if there is any shorcut or better way:

def CameraRay ( touch as FTouch):
  //the offsets account for the camera's 0,0 point (eg, center, bottom left, etc.)
  offsetX = -Futile.screen.originX * Futile.screen.pixelWidth
  offsetY = -Futile.screen.originY * Futile.screen.pixelHeight
  //reverse futile transformations... for now
  pos = Vector2(touch.position.x* Futile.displayScale - offsetX, touch.position.y* Futile.displayScale - offsetY)

  return Camera.main.ScreenPointToRay(pos)

@diegodorado
Copy link

got this reversing the mouse touch simulation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants