In the Beginning ... There Was the Vector

In the last chapter, you learned that vectors shouldn't be mixed up with positions. This is not entirely true, as you can (and will) represent a position in some spaces via a vector. A vector can actually have many interpretations:

  • Position: You already used this in the previous chapters to encode the coordinates of our entities relative to the origin of the coordinate system.
  • Velocity and acceleration: These are physical quantities you'll hear about in the next section. While you are likely used to thinking about velocity and acceleration as being a single value, they should actually be represented as 2D or 3D vectors. They encode not only the speed of an entity (for example, a car driving at 100 km/h), ...

Get Beginning Android 4 Games Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.