AlpacaLibrary/Include/Game/Tools/Camera.hpp

91 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>
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
std::int32_t GetX();
std::int32_t GetY();
std::int32_t GetZ();
std::int32_t GetYaw();
double GetAngle();
std::int32_t GetPitch();
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
2020-06-25 18:13:21 +00:00
* @param Tolerance angle tolerance used to determine if it no longer needs to keep rotating (+/-)
2018-12-27 18:17:09 +00:00
* @return true if it rotates within (+/-) 10 of the passed angle
*/
2019-06-17 16:44:48 +00:00
bool RotateTo(std::int32_t Angle, std::int32_t Tolerance = 10);
2018-12-27 18:17:09 +00:00
/**
* @brief Rotates the camera to the passed direction (Camera::NORTH/EAST/SOUTH/WEST)
*
* @param Direction Camera::NORTH / EAST / SOUTH / WEST
2020-06-25 18:13:21 +00:00
* @param Tolerance angle tolerance used to determine if it no longer needs to keep rotating (+/-)
2018-12-27 18:17:09 +00:00
* @return true if it rotates within (+/-) 10 of the passed direction
*/
2019-06-17 16:44:48 +00:00
bool RotateTo(COMPASS_DIRECTION Direction, std::int32_t Tolerance = 10);
2018-12-27 18:17:09 +00:00
/**
* @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
2020-06-25 18:13:21 +00:00
* @param Tolerance angle tolerance used to determine if it no longer needs to keep rotating (+/-)
2018-12-27 18:17:09 +00:00
* @return true if it rotates within (+/-) 10 of the passed tile and angle
*/
2019-06-17 16:44:48 +00:00
bool RotateTo(const Tile& T, std::int32_t Angle = 0, std::int32_t Tolerance = 10);
2018-12-27 18:17:09 +00:00
/**
* @brief Rotates the camera to the passed tile, with an optional desired direction
*
* @param T tile to rotate to
2020-06-25 18:13:21 +00:00
* @param Tolerance angle tolerance used to determine if it no longer needs to keep rotating (+/-)
2018-12-27 18:17:09 +00:00
* @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
*/
2019-06-17 16:44:48 +00:00
bool RotateTo(const Tile& T, COMPASS_DIRECTION Direction = NORTH, std::int32_t Tolerance = 10);
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);
2020-06-25 18:13:21 +00:00
/* *//**
* @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);*/
2018-12-31 21:52:58 +00:00
}
2018-06-07 03:43:38 +00:00
#endif // CAMERA_HPP_INCLUDED