O'Reilly logo

Game Programming in C++: Creating 3D Games, First Edition by Sanjay Madhav

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3

Vectors and Basic Physics

Vectors are a fundamental mathematical concept that game programmers use every day. This chapter first explores all the different ways vectors can be used to solve problems in games. Next, it shows how to implement basic movement through a MoveComponent and control it with the keyboard via an InputComponent. This chapter then briefly explores the basics of Newtonian physics before ending with a discussion of how to detect collisions between objects. This chapter’s game project uses some of these techniques to implement a version of the classic game Asteroids.

Vectors

A mathematical vector (not to be confused with std::vector) represents both a magnitude and direction in an n-dimensional space, with one component ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required