nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nanommo::FollowCamera Class Reference

Follows your player around, from behind and above. More...

#include <camera.h>

Public Member Functions

void Update (Vector3 player, float turn, float tilt, float zoom, const Terrain &terrain)
Vector3 Relative (Vector3 direction) const
const Camera3D & camera () const

Static Public Attributes

static constexpr float kNearest = 4.0f
static constexpr float kFarthest = 40.0f

Detailed Description

Follows your player around, from behind and above.

Definition at line 14 of file camera.h.

Member Function Documentation

◆ camera()

const Camera3D & nanommo::FollowCamera::camera ( ) const
inline

Definition at line 28 of file camera.h.

◆ Relative()

Vector3 nanommo::FollowCamera::Relative ( Vector3 direction) const

Turns the keys' direction from the screen's to the world's, so that W always walks away from the camera.

Definition at line 48 of file camera.cc.

◆ Update()

void nanommo::FollowCamera::Update ( Vector3 player,
float turn,
float tilt,
float zoom,
const Terrain & terrain )

Turns and tilts by the angles, in radians, and zooms in by the share of the distance, then looks at the player from there.

Definition at line 31 of file camera.cc.

Member Data Documentation

◆ kFarthest

float nanommo::FollowCamera::kFarthest = 40.0f
staticconstexpr

Definition at line 17 of file camera.h.

◆ kNearest

float nanommo::FollowCamera::kNearest = 4.0f
staticconstexpr

Definition at line 16 of file camera.h.


The documentation for this class was generated from the following files: