Hello,
We recently purchased and downloaded the BC Gestures Library, hoping to use it to control our player character for a 2D game using tk2dCamera. For this we were interested in the DragGesture script to do relative motion on a touchscreen.
However, we ran into some issues due to interactions with the tk2dCamera. The tk2dCamera applies a transformation to the camera in order to achieve pixel perfect rendering. This appears to have interacted with the BC Gestures Library and the result is that the draggable object motion was very exaggerated and wildly uncontrollable, but works correctly when the tk2dCamera script is removed.
Experimenting with ways to fix this while keeping the tk2dCamera script, we appear to have achieved a partial fix in BaseGesture.cs ScreenToWorldPosition(), we modified the following:
Ray ray = theCamera.ScreenPointToRay( screenPos );
To the following:
Ray ray = theCamera.ScreenPointToRay( theCamera.WorldToScreenPoint(screenPos) );
This seems to have achieved a partial fix, however the draggable object in our game scene only scrolls halfway through the screen when we drag the mouse across the entire screen. We were wondering if you could suggest a more appropriate fix. Are the transformations made by tk2dCamera all covered by theCamera.WorldToScreenPoint or are there more transformations that need to be accounted for? Or is it an entirely different transformation?
Thank you,
hemdanw