AlpacaLibrary/Include/Game/Tools/Camera.hpp

121 lines
3.1 KiB
C++
Raw Normal View History

2018-06-07 03:43:38 +00:00
#ifndef CAMERA_HPP_INCLUDED
#define CAMERA_HPP_INCLUDED
#include "../../Core/Types/Tile.hpp"
#include <cstdint>
/** @addtogroup Tools
* @{ */
2018-12-27 18:17:09 +00:00
namespace Camera
2018-06-07 03:43:38 +00:00
{
2018-12-27 18:17:09 +00:00
typedef enum COMPASS_DIRECTION
{
NORTH = 0,
EAST = 90,
SOUTH = 180,
WEST = 270
} COMPASS_DIRECTION;
2018-06-07 03:43:38 +00:00
2018-12-27 18:17:09 +00:00
typedef enum CAMERA_PITCH
{
LOWEST = 128,
MIDDLE = 191,
HIGHEST = 383
} CAMERA_PITCH;
2018-06-07 03:43:38 +00:00
2018-12-27 18:17:09 +00:00
/**
* @brief Returns the cameras X
*
* @return Camera X
*/
std::int32_t GetX();
/**
* @brief Returns the cameras Z
*
* @return Camera Z
*/
std::int32_t GetY();
/**
* @brief Returns the cameras Z
*
* @return Camera Z
*/
std::int32_t GetZ();
/**
* @brief Returns the cameras Yaw
*
* @return Camera Yaw
*/
std::int32_t GetYaw();
2018-06-07 03:43:38 +00:00
2018-12-27 18:17:09 +00:00
/**
* @brief Returns the camera/compass angle in degrees
*
* @return the camera/compass angle in degrees
*/
double GetAngle();
/**
* @brief Returns the camera pitch
*
* @return the camera pitch
*/
std::int32_t GetPitch();
/**
* @brief Returns the camera zoom as a percentage
*
* @return the camera zoom as a percentage (0.00 - 1.00)
*/
double GetZoom();
2018-06-07 03:43:38 +00:00
2018-12-27 18:17:09 +00:00
/**
* @brief Rotates the camera to the passed angle/degree
*
* @param Angle or degree
* @return true if it rotates within (+/-) 10 of the passed angle
*/
bool RotateTo(std::int32_t Angle);
/**
* @brief Rotates the camera to the passed direction (Camera::NORTH/EAST/SOUTH/WEST)
*
* @param Direction Camera::NORTH / EAST / SOUTH / WEST
* @return true if it rotates within (+/-) 10 of the passed direction
*/
bool RotateTo(COMPASS_DIRECTION Direction);
/**
* @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
* @return true if it rotates within (+/-) 10 of the passed tile and angle
*/
bool RotateTo(const Tile& T, std::int32_t Angle = 0);
/**
* @brief Rotates the camera to the passed tile, with an optional desired direction
*
* @param T tile to rotate to
* @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);
2018-06-07 03:43:38 +00:00
2018-12-27 18:17:09 +00:00
/**
* @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);
2018-06-07 03:43:38 +00:00
};
/** @} */
#endif // CAMERA_HPP_INCLUDED