4#include <alicorn/cpp/math.hpp>
5#include <alicorn/std/string.hpp>
6#include <Covellite/App/Settings.hpp>
31 using TimePoint_t = ::std::chrono::time_point<::std::chrono::system_clock>;
32 using String_t = ::alicorn::extension::std::String;
38 static const float Distance;
39 static const float Fov;
40 static const float Pitch;
44 static constexpr auto BackOffset = 7.5f;
45 static const float NearClippingPlane;
46 static const float FarClippingPlane;
49 inline static float Squaring(
const float _Value) {
return _Value * _Value; }
56 static const float Height;
57 static const String_t ComponentPositionId;
58 static const String_t ComponentRotationId;
62 static const TimePoint_t BeginTime;
63 static constexpr auto TimeStepSecond = 0.5f;
64 static const int CellRadius;
65 static const int CellSize;
69 inline static T GetSettings(const ::alicorn::extension::std::String & _Name)
71 return ::covellite::app::Settings_t::GetInstance()[uT(
"Demo")].Get<T>(_Name);
75namespace math = ::alicorn::extension::cpp::math;
77 const float Constant::Camera::Distance =
79 const float Constant::Camera::Fov =
80 math::Constant<float>::Pi / 3.0f;
81 const float Constant::Camera::Pitch = - math::Constant<float>::Pi *
82 (::alicorn::extension::cpp::IS_DEBUG_CONFIGURATION ? 0.25f : 0.22f);
83 const float Constant::Camera::NearClippingPlane =
84 Constant::Camera::Squaring(Constant::Camera::BackOffset - 0.75f);
86 const float Constant::Player::Height =
88 const Constant::String_t Constant::Player::ComponentPositionId =
89 uT(
"Demo.Player.Position");
90 const Constant::String_t Constant::Player::ComponentRotationId =
91 uT(
"Demo.Player.Rotation");
93 const Constant::TimePoint_t Constant::BeginTime =
94 ::std::chrono::system_clock::now();
95 const int Constant::CellRadius =
96 static_cast<int>(1.33f *
97 (-Constant::Player::Height + Constant::Camera::Distance *
98 math::radian::Sin(Constant::Camera::Pitch)) / math::radian::Tan(
99 Constant::Camera::Pitch + Constant::Camera::Fov / 2.0f));
100 const int Constant::CellSize =
103 const float Constant::Camera::FarClippingPlane =
104 Constant::Camera::Squaring(
105 Constant::Camera::BackOffset + Constant::CellRadius - 1);