dao::portraits

Frame a creature’s portrait with a camera of your own.

Declared in dao/Portraits.h.

Classes

Class  
Camera A portrait camera, with one value per camera column of the portraits table.

Functions

ClearCamera()

void ClearCamera(ObjectId creature)

Restores the table’s framing for a creature’s portrait.

HeadPosition()

std::optional<Vector> HeadPosition(ObjectId creature)

Returns the world position of a creature’s head: its model’s “head” node, which the portrait camera aims at.

Call on the game thread. For creatures without a head node, the portrait camera aims at the feet, so frame them with Camera’s zAdjust and xAdjust.

Returns nullopt if there is no such creature, or its skeleton has no “head” node (the deepstalker, the deer, the chicken and a few others)

SetCamera()

void SetCamera(ObjectId creature, const Camera &camera)

Frames a creature’s portrait with the given camera until ClearCamera is called.

Takes effect the next time the creature’s portrait is rendered. The creature being made in character creation keeps the game’s own framing.