Skip to content

Blog

Camera Shake

Motivation

One of the best effects in a game that helps add another level of realism is the simple camera shake. Whenever it comes to a camera shake I always think about one series of games and that is Rockstar Games' Grand Theft Auto. Even prior to GTA 5, Rockstar Games used the camera shake effect, in the first 3D game in the Grand Theft Auto series (GTA3) there is camera shake whenever an explosion happens. I remember this being one of the first effects that made any game feel more realistic.

Passkey

We've all run into this issue before, we want to give access to certain functions of a class, so we simply make it a friend class then you realise that maybe this class should have access to all of the original classes' privates, so what do we do? Normally, I would create a public function and just hope nobody else in the codebase will call it. However, there is a better way, enter the passkey idiom, a somewhat forgotten idiom.