Fixing bugs with pathfinding, bump version
This commit is contained in:
1 parent
8e2b019c92
commit
f1cc28ab31
22 files changed
+1119
-759
No files matched your search
@@ -13,6 +13,16 @@ void require(bool condition, const char* message)
|
||||
std::exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
FRG::Vec3fp point(float x, float y, float z)
|
||||
{
|
||||
return {FRG::fp(x), FRG::fp(y), FRG::fp(z)};
|
||||
}
|
||||
|
||||
bool samePoint(const FRG::Vec3fp& left, const FRG::Vec3fp& right)
|
||||
{
|
||||
return left.x == right.x && left.y == right.y && left.z == right.z;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main()
|
||||
@@ -49,7 +59,7 @@ int main()
|
||||
|
||||
FRG::DestinationInputMessage input;
|
||||
input.clientSequence = 7;
|
||||
input.target = Eigen::Vector3f(1.234f, 0.f, -5.678f);
|
||||
input.target = point(1.234f, 0.f, -5.678f);
|
||||
FRG::DestinationInputMessage parsedInput;
|
||||
require(
|
||||
FRG::parseDestinationInputMessage(
|
||||
@@ -57,7 +67,7 @@ int main()
|
||||
"destination input did not round trip");
|
||||
require(
|
||||
parsedInput.clientSequence == 7 &&
|
||||
parsedInput.target.isApprox(Eigen::Vector3f(1.23f, 0.f, -5.68f)),
|
||||
samePoint(parsedInput.target, input.target),
|
||||
"destination input was not normalized");
|
||||
|
||||
FRG::CharacterActionInputMessage actionInput{
|
||||
@@ -147,9 +157,9 @@ int main()
|
||||
|
||||
FRG::LockstepTimeline timeline(2);
|
||||
const std::uint64_t firstSequence =
|
||||
timeline.schedule("player1", Eigen::Vector3f(1.f, 0.f, 1.f));
|
||||
timeline.schedule("player1", point(1.f, 0.f, 1.f));
|
||||
const std::uint64_t secondSequence =
|
||||
timeline.schedule("player2", Eigen::Vector3f(2.f, 0.f, 2.f));
|
||||
timeline.schedule("player2", point(2.f, 0.f, 2.f));
|
||||
const FRG::TickMessage emptyTick = timeline.advance();
|
||||
require(
|
||||
emptyTick.tickId == 1 && emptyTick.commands.empty(),
|
||||
|
||||
Reference in new issue
Block a user