O'Reilly logo

CryENGINE Game Programming with C++, C#, and Lua by Ruan Pearce-Authers, Carl-Filip Lundgren

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

Camera handling

Player-controlled actors manage the viewport camera within the IActor::UpdateView(SViewParams &viewParams) and IActor::PostUpdateView(SViewParams &viewParams) functions.

The SViewParams struct is used to define camera properties such as position, rotation, and field of view. By modifying the viewParams reference inside the UpdateView method, we can move our camera to the position we require for our game.

Note

CryMono actors receive and handle the UpdateView(ref ViewParams viewParams) and PostUpdateView(ref ViewParams viewParams) events in the same way C++ actors do.

Implementing IGameObjectView

In order to get view events, we'll need to implement and register a game object view. To do so, start by deriving from IGameObjectView, and ...

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