|
DigitalCurling3
1.0.0
A curling simulation system for curling AIs
|
Go to the documentation of this file.
26 #ifndef DIGITALCURLING3_COORDINATE_HPP
27 #define DIGITALCURLING3_COORDINATE_HPP
37 constexpr
float kHogLineYOnSimulation = 10.9725f;
38 constexpr
float kTeeLineYOnSimulation = 17.3735f;
39 constexpr
float kBackLineYOnSimulation = 19.2025f;
40 constexpr
float kHackYOnSimulation = 21.0315f;
41 constexpr
float kBackBoardYOnSimulation = 22.8605f;
96 if (from == to)
return position;
102 return { position.x, position.y - detail::kHackYOnSimulation };
104 return { -position.x, -position.y + detail::kHackYOnSimulation };
114 return { position.x, position.y + detail::kHackYOnSimulation };
116 return { -position.x, -position.y + 2 * detail::kHackYOnSimulation };
126 return { -position.x, -position.y + detail::kHackYOnSimulation };
128 return { -position.x, -position.y + 2 * detail::kHackYOnSimulation };
151 if (from == to)
return velocity;
170 if (from == to)
return angle;
193 return angular_velocity;
216 auto y_simulation = side ? detail::kHogLineYOnSimulation : -detail::kHogLineYOnSimulation;
229 auto y_simulation = side ? detail::kTeeLineYOnSimulation : -detail::kTeeLineYOnSimulation;
242 auto y_simulation = side ? detail::kBackLineYOnSimulation : -detail::kBackLineYOnSimulation;
255 auto y_simulation = side ? detail::kHackYOnSimulation : -detail::kHackYOnSimulation;
268 auto y_simulation = side ? detail::kBackBoardYOnSimulation : -detail::kBackBoardYOnSimulation;
276 #endif // DIGITALCURLING3_COORDINATE_HPP
constexpr Vector2 TransformPosition(Vector2 position, Id from, Id to) noexcept
位置を座標変換する.
Definition: coordinate.hpp:94
Id
座標系ID
Definition: coordinate.hpp:54
2次元ベクトル
Definition: vector2.hpp:37
constexpr float GetHackY(bool side, Id coord) noexcept
ハックのy座標を得る.
Definition: coordinate.hpp:253
constexpr float TransformAngle(float angle, Id from, Id to) noexcept
角度を座標系間で変換する.
Definition: coordinate.hpp:168
float y
y座標
Definition: vector2.hpp:39
constexpr Id GetShotSide(std::uint8_t end) noexcept
エンドに対応するショット座標系を返す.
Definition: coordinate.hpp:77
constexpr float kPi
円周率
Definition: constants.hpp:34
@ kSimulation
シミュレーション座標系.
constexpr float GetBackLineY(bool side, Id coord) noexcept
バックラインのy座標を得る.
Definition: coordinate.hpp:240
constexpr float GetBackBoardY(bool side, Id coord) noexcept
バックボード(シートの端)のy座標を得る.
Definition: coordinate.hpp:266
constexpr float kHouseRadius
ハウスの半径
Definition: coordinate.hpp:49
constexpr float GetCenterLineX(Id coord) noexcept
センターラインのx座標を得る.
Definition: coordinate.hpp:202
constexpr Vector2 TransformVelocity(Vector2 velocity, Id from, Id to) noexcept
速度を座標系間で変換する.
Definition: coordinate.hpp:149
constexpr float GetHogLineY(bool side, Id coord) noexcept
ホグラインのy座標を得る.
Definition: coordinate.hpp:214
座標変換に関連するものを定義する名前空間
Definition: coordinate.hpp:32
constexpr float GetTeeLineY(bool side, Id coord) noexcept
ティーラインのy座標を得る.
Definition: coordinate.hpp:227
constexpr float TransformAngularVelocity(float angular_velocity, Id from, Id to) noexcept
角速度を座標系間で変換する.
Definition: coordinate.hpp:190