104 lines
3.5 KiB
C++
104 lines
3.5 KiB
C++
#ifndef CAMERA_HPP_INCLUDED
|
|
#define CAMERA_HPP_INCLUDED
|
|
|
|
#include "../../Core/Types/Tile.hpp"
|
|
#include <cstdint>
|
|
|
|
namespace Camera
|
|
{
|
|
typedef enum COMPASS_DIRECTION
|
|
{
|
|
NORTH = 0,
|
|
EAST = 90,
|
|
SOUTH = 180,
|
|
WEST = 270
|
|
} COMPASS_DIRECTION;
|
|
|
|
typedef enum CAMERA_PITCH
|
|
{
|
|
LOWEST = 128,
|
|
MIDDLE = 191,
|
|
HIGHEST = 383
|
|
} CAMERA_PITCH;
|
|
|
|
std::int32_t GetX();
|
|
std::int32_t GetY();
|
|
std::int32_t GetZ();
|
|
std::int32_t GetYaw();
|
|
double GetAngle();
|
|
std::int32_t GetPitch();
|
|
double GetZoom();
|
|
|
|
/**
|
|
* @brief Rotates the camera to the passed angle/degree
|
|
*
|
|
* @param Angle or degree
|
|
* @param Tolerance angle tolerance used to determine if it no longer needs to keep rotating (+/-)
|
|
* @return true if it rotates within (+/-) 10 of the passed angle
|
|
*/
|
|
bool RotateTo(std::int32_t Angle, std::int32_t Tolerance = 10);
|
|
/**
|
|
* @brief Rotates the camera to the passed direction (Camera::NORTH/EAST/SOUTH/WEST)
|
|
*
|
|
* @param Direction Camera::NORTH / EAST / SOUTH / WEST
|
|
* @param Tolerance angle tolerance used to determine if it no longer needs to keep rotating (+/-)
|
|
* @return true if it rotates within (+/-) 10 of the passed direction
|
|
*/
|
|
bool RotateTo(COMPASS_DIRECTION Direction, std::int32_t Tolerance = 10);
|
|
/**
|
|
* @brief Rotates the camera to the passed tile, with an optional desired Angle
|
|
*
|
|
* @param T tile to rotate to
|
|
* @param Angle optional desired angle of where the tile should be in relation to the player, defaulted to 0 or North
|
|
* @param Tolerance angle tolerance used to determine if it no longer needs to keep rotating (+/-)
|
|
* @return true if it rotates within (+/-) 10 of the passed tile and angle
|
|
*/
|
|
bool RotateTo(const Tile& T, std::int32_t Angle = 0, std::int32_t Tolerance = 10);
|
|
/**
|
|
* @brief Rotates the camera to the passed tile, with an optional desired direction
|
|
*
|
|
* @param T tile to rotate to
|
|
* @param Tolerance angle tolerance used to determine if it no longer needs to keep rotating (+/-)
|
|
* @param Direction optional desired angle of where the tile should be in relation to the player (NORTH/EAST/SOUTH/WEST), defaulted to North
|
|
* @return true if it rotates within (+/-) 10 of the passed tile and direction
|
|
*/
|
|
bool RotateTo(const Tile& T, COMPASS_DIRECTION Direction = NORTH, std::int32_t Tolerance = 10);
|
|
|
|
bool RotateToWithMouse(std::int32_t Angle, std::int32_t Tolerance = 10);
|
|
|
|
bool RotateToWithMouse(COMPASS_DIRECTION Direction, std::int32_t Tolerance = 10);
|
|
|
|
bool RotateToWithMouse(const Tile& T, std::int32_t Angle = 0, std::int32_t Tolerance = 10);
|
|
|
|
bool RotateToWithMouse(const Tile& T, COMPASS_DIRECTION Direction = NORTH, std::int32_t Tolerance = 10);
|
|
|
|
/**
|
|
* @brief Sets the pitch of the camera
|
|
*
|
|
* @param Pitch desired pitch
|
|
* @return true if the camera sets the pitch (+/-) 10 of the passed pitch
|
|
*/
|
|
bool SetPitch(std::int32_t Pitch);
|
|
|
|
/**
|
|
* @brief Sets the pitch of the camera
|
|
*
|
|
* @param Pitch desired pitch (Camera::LOWEST/MIDDLE/HIGHEST)
|
|
* @return true if the camera sets the pitch (+/-) 10 of the passed pitch
|
|
*/
|
|
bool SetPitch(CAMERA_PITCH Pitch);
|
|
|
|
bool SetPitchWithMouse(std::int32_t Pitch);
|
|
|
|
bool SetPitchWithMouse(CAMERA_PITCH Pitch);
|
|
|
|
/* *//**
|
|
* @brief Sets the zoom of the camera
|
|
*
|
|
* @param Zoom desired zoom 0.00 (all the way out) - 1.00 (all the way in)
|
|
*//*
|
|
bool SetZoom(double Zoom);*/
|
|
}
|
|
|
|
#endif // CAMERA_HPP_INCLUDED
|