11 [[
nodiscard]] std::expected<InterpolationVec3, PieceJailPlanError>
12 point(std::uint8_t square)
noexcept
20 std::uint8_t square, std::uint64_t
base)
noexcept
22 if (square > 10 && square < 30)
23 return base + 5U *
static_cast<std::uint64_t
>(square - 10);
25 return base + 5U *
static_cast<std::uint64_t
>(50 - square);
26 return base + 5U *
static_cast<std::uint64_t
>(10 - square);
30 InterpolationVec3
a, InterpolationVec3
b,
31 InterpolationVec3
c, InterpolationVec3
d,
41 if (
length <= 0.000001F)
return {};
46 std::expected<PieceJailRoutePlan, PieceJailPlanError>
55 result.path.startTick = startTick;
61 result.skipMotion =
true;
62 result.path.endTick = startTick;
67 if (!
token)
return std::unexpected(
token.error());
72 const auto p9 = point(9);
73 if (!
p9)
return std::unexpected(
p9.error());
74 auto v1 = *
p9;
v1.z += 59.0F;
76 auto v4 =
t4;
v4.z += 19.0F;
77 auto v3 =
v4;
v4.x -= 32.0F;
v3.x += 3.0F;
78 const auto v2 = 0.5F * (
v1 +
v3);
81 auto t3 =
t4;
t3.z += 8.0F;
91 const auto jail = point(10);
92 if (!jail)
return std::unexpected(jail.error());
93 auto v1 = *jail;
v1.x -= 10.0F;
95 auto v4 =
t4;
v4.x -= 78.0F;
96 const auto v2 = 0.7F *
v1 + 0.3F *
v4;
97 auto v3 = 0.3F *
v1 + 0.7F *
v4;
102 auto t2 =
v4;
t2.x += 8.0F;
103 v4 =
t4;
v4.x -= 39.0F;
v4.z += 22.0F;
107 auto t3 =
t4;
t3.x -= 8.0F;
117 const auto jail = point(10);
119 if (!jail)
return std::unexpected(jail.error());
123 auto v3 =
v4;
v3.z += 26.0F;
v3.x += 5.0F;
124 const auto v2 = 0.5F * (
v3 +
v1);
131 auto b2 = 0.7F *
v1 + 0.3F *
v4;
132 v3 = 0.3F *
v1 + 0.7F *
v4;
136 auto t2 =
v4;
t2.z -= 8.0F;
137 v4 =
t4;
v4.z += 39.0F;
v4.y += 25.0F;
141 auto t3 =
t4;
t3.z += 8.0F;
150 const auto p9 = point(9);
151 const auto go = point(0);
152 const auto p39 = point(39);
153 if (!
p9)
return std::unexpected(
p9.error());
154 if (!
go)
return std::unexpected(
go.error());
155 if (!
p39)
return std::unexpected(
p39.error());
156 auto v1 = *
p9;
v1.z += 39.0F;
159 auto v2 = 0.5F * (
v1 +
v3);
v2.x += 5.0F;
160 v4.x -= 16.0F;
v4.z -= 16.0F;
166 auto t3 = 0.5F * (
t4 +
v3);
178 std::expected<PieceJailRoutePlan, PieceJailPlanError>
184 const auto drop = point(11);
185 if (!
drop)
return std::unexpected(
drop.error());
189 result.path.startTick = startTick;
197 const auto jail = point(10);
198 if (!jail)
return std::unexpected(jail.error());
199 auto v3 = *jail;
v3.x -= 20.0F;
v3.z -= 5.0F;
200 const auto v2 = 0.5F * (
v1 +
v3);
209 const auto v2 = 0.7F *
v1 + 0.3F *
t4;
210 const auto v3 = 0.3F *
v1 + 0.7F *
t4;
224 const auto v2 = 0.6F *
v1 + 0.4F *
v3;
230 v3 =
t4;
v3.x += 20.0F;
v3.z -= 5.0F;
231 v4 =
t4;
v4.z += 20.0F;
v4.x += 20.0F;
235 auto t3 =
t4;
t3.x += 14.0F;
240 result.path.lengths[2] *= 2.0F;
245 const auto go = point(0);
246 const auto jail = point(10);
247 if (!
go)
return std::unexpected(
go.error());
248 if (!jail)
return std::unexpected(jail.error());
250 auto v3 =
v4;
v3.z -= 24.0F;
v3.x -= 5.0F;
251 const auto v2 = 0.6F *
v1 + 0.4F *
v3;
254 auto t3 = *jail;
t3.x -= 34.0F;
t3.z += 6.0F;
255 const auto t2 = 0.5F * (
v4 +
t3);
std::optional< TokenPose > tokenOrientation(std::uint8_t boardSquare) noexcept
constexpr float BezierTangentDelta
std::expected< PieceJailRoutePlan, PieceJailPlanError > planPaddyToJail(std::uint8_t tokenSquare, InterpolationVec3 startLocation, std::uint64_t startTick)
bool addBezierSegmentSmooth(PieceInterpolationPath &path, std::size_t index, InterpolationVec3 c, InterpolationVec3 d, float tangentDelta) noexcept
bool addBezierSegment(PieceInterpolationPath &path, std::size_t index, InterpolationVec3 a, InterpolationVec3 b, InterpolationVec3 c, InterpolationVec3 d, float tangentDelta) noexcept
std::expected< PieceJailRoutePlan, PieceJailPlanError > planPaddyToToken(std::uint8_t tokenSquare, std::uint64_t startTick, std::uint8_t randomBit)
BoardCameraView pickCameraFor15Squares(std::int32_t square) noexcept