QtCraft API C++ classes QML types Handbook

QcViewCamera Namespace

Places the camera for a view mode. More...

Header: #include <clientcore/camera/QcViewCamera.h>

Classes

struct Placement

Variables

const double thirdPersonDistance
const double wallMargin

Functions

std::optional<QcCameraMode> fromName(const QString &text)
const char *name(QcCameraMode mode)
QcCameraMode next(QcCameraMode mode)
QcViewCamera::Placement place(const QcVec3 &eye, float yaw, float pitch, QcCameraMode mode, const QcBlockAccess &world)

Detailed Description

Third-person cameras pull in when a block lies between the player's eyes and the wanted position, so they never look through walls.

Classes

class Placement

Where the camera is and where it looks. More...

Variable Documentation

const double QcViewCamera::thirdPersonDistance

Metres between the eye and a third-person camera, unless a block is in the way.

const double QcViewCamera::wallMargin

Kept between the camera and a blocking surface (the near plane must not cut into it).

Function Documentation

std::optional<QcCameraMode> QcViewCamera::fromName(const QString &text)

Returns the mode named text: "first", "behind", "front" or "side"; std::nullopt otherwise.

const char *QcViewCamera::name(QcCameraMode mode)

Returns the name of mode: "first", "behind", "front" or "side".

QcCameraMode QcViewCamera::next(QcCameraMode mode)

Returns the view mode after mode in the key's cycle: first person, behind, front.

QcViewCamera::Placement QcViewCamera::place(const QcVec3 &eye, float yaw, float pitch, QcCameraMode mode, const QcBlockAccess &world)

Returns where the camera of mode goes for a player whose eye is at eye looking along yaw and pitch, pulled in where a block of world is in the way.