Game Development Reference
In-Depth Information
these components is provided with the usual mathematical objects—gravity and
user acceleration are represented by 3D vectors, and attitude can be queried either
as Euler angles, a rotation matrix, or a quaternion.
Other Mobile Input
Some types of games might expand and use additional methods of input that
are only available on mobile devices. For example, an augmented reality game
might use data from the camera and draw on top of objects in the physical world.
Still other games might use GPS data to determine if there are any other players
nearby who are playing the same game as you. Some of these input mechanisms
will definitely carry over to wearable computing (such as virtual reality devices).
However,eventhoughtherehavebeenexcitingdevelopmentsinthisareainrecent
years (such as the Oculus Rift), VR still has a little bit to go before it becomes a
part of mainstream gaming.
Summary
Because everygamemusthaveinput,it'saveryfundamental concept. Bothdigital
and analog devices exist in many different forms, but the techniques used to query
them are often similar. With digital devices, we typically want to add some type
of meaning to the binary “on” and “off” state. With analog devices, we often need
to have some type of filtering to remove spurious input. But on a higher level, we
want a way to abstract discrete input events into actions performed by the player,
which is where event-based systems as well as gestures come into play.
Review Questions
1 . What is the difference between a digital and an analog device? Give an
example of each.
2 . In input, what is a chord and what is a sequence?
3 . Why are the “just pressed” and “just released” events necessary, as op-
posed to simply querying the state of the device?
4 . What is analog filtering, and what problem does it try to solve?
5 . What advantages does an event-based input system have over a polling
system?
6 . In a basic event-based system, how can you track which functions are re-
gistered to the event?
Search WWH ::




Custom Search