Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

10.5. Flick and Inertia

In the movie Minority Report (2002), Tom Cruise demonstrated how to flick an object off to one side of the computer screen, and the whole world said “Way cool!”

For the most part, implementing inertia in the touch interfaces of a program is your responsibility. XNA helps out just a little with the Flick gesture, which is generated when the user quickly sweeps a finger on the screen. The Delta property of the GestureSample object indicates the velocity of the finger in pixels per second. (That’s what it’s supposed to be, anyway. It actually seems to be closer to half the actual velocity.) The velocity is represented as a Vector2, so it indicates direction as well as magnitude.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial