dao::SceneCamera

class

The game’s scene camera, which the CameraController drives: its position, its angles around the point it looks at (the focus), and its zoom.

Get it from CameraController::Scene.

Declared in dao/Camera.h.

Functions

operator=()

SceneCamera & operator=(const SceneCamera &)=delete

Pitch()

float Pitch() const

Returns the camera’s tilt in radians, measured from straight above.

Position()

Vector Position() const

Returns the camera’s position in the world.

SceneCamera()

SceneCamera()=delete

SceneCamera()

SceneCamera(const SceneCamera &)=delete

SetPitch()

void SetPitch(float radians)

Tilts the camera immediately.

The tilt holds until the player tilts the camera. In the close view (Zoom 0.75 and above), the game clamps the tilt to between 30 and 150 degrees every frame. Read the player’s pitch first and restore it afterwards. Call on the game thread. Not yet tested in the game.

Parameter  
radians the angle from straight above; smaller values look down more steeply

SetYaw()

void SetYaw(float radians)

Turns the camera around its focus immediately.

To ease a turn, call it every frame, or use dao::camera::EaseYaw. Call on the game thread.

Parameter  
radians the new yaw, measured as Yaw is

Yaw()

float Yaw() const

Returns the direction from the focus to the camera, in radians, measured from +x toward +y.

The value is not wrapped, so it can grow past 2 pi as the player turns.

To put the camera behind a creature, use atan2(-fy, -fx) of the creature’s forward vector (GetOrientation), or radians(90 - GetFacing). radians(GetFacing) + pi does not work.

Zoom()

float Zoom() const

Returns the zoom: 1 is close behind the creature, 0 is the tactical view high above.

Below 0.75 the camera is in the tactical view.

~SceneCamera()

~SceneCamera()=delete

Fields

Field Type  
kPitch std::size_t = 0x20 offset of the pitch
kPosition std::size_t = 0x80 offset of the position
kYaw std::size_t = 0x1C offset of the yaw
kZoom std::size_t = 0x24 offset of the zoom