Compare commits
2 Commits
0260b4a0a0
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| ee1cdeaeca | |||
| 2508f12e86 |
@@ -43,10 +43,6 @@ void EntityPositionInterpolator::interpolate_smoothed_entities(Clock::time_point
|
|||||||
m_registry->view<EntityPositionInterpolation, Transform>()
|
m_registry->view<EntityPositionInterpolation, Transform>()
|
||||||
.each([&](const auto entity, const EntityPositionInterpolation& interpolation, Transform& ts) {
|
.each([&](const auto entity, const EntityPositionInterpolation& interpolation, Transform& ts) {
|
||||||
auto [from, to, value] = interpolation.get_values_around(time_point);
|
auto [from, to, value] = interpolation.get_values_around(time_point);
|
||||||
spdlog::info("From: {} {} {} - To: {} {} {} - By: {}",
|
|
||||||
from.x, from.y, from.z,
|
|
||||||
to.x, to.y, to.z,
|
|
||||||
value);
|
|
||||||
ts.set_position(glm::mix(from, to, value));
|
ts.set_position(glm::mix(from, to, value));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,9 +112,25 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int main() {
|
int main(int argc, char** argv) {
|
||||||
const int NUM_CLIENTS = 300;
|
if(argc > 4) {
|
||||||
tw::net::Address address = {"127.0.0.1", 8101};
|
spdlog::error("Usage: {} [client_count] [host] [port]", argv[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint32_t NUM_CLIENTS = argc > 1 ? std::strtoul(argv[1], nullptr, 10) : 300;
|
||||||
|
const std::string host = argc > 2 ? argv[2] : "127.0.0.1";
|
||||||
|
const int port = argc > 3 ? std::atoi(argv[3]) : 8101;
|
||||||
|
|
||||||
|
auto address_r = tw::net::Address::resolve(host, port);
|
||||||
|
if(!address_r) {
|
||||||
|
spdlog::error("Failed to resolve {}:{}: {}", host, port, address_r.error().message());
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const tw::net::Address address = address_r.value();
|
||||||
|
|
||||||
|
spdlog::info("Starting {} clients against {}", NUM_CLIENTS, address.to_string());
|
||||||
|
|
||||||
std::vector<std::thread> threads;
|
std::vector<std::thread> threads;
|
||||||
for(uint32_t i = 0; i < NUM_CLIENTS; i++) {
|
for(uint32_t i = 0; i < NUM_CLIENTS; i++) {
|
||||||
@@ -129,7 +145,7 @@ int main() {
|
|||||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(uint32_t i = 0; i < NUM_CLIENTS; i++) {
|
for(uint32_t i = 0; i < threads.size(); i++) {
|
||||||
threads[i].join();
|
threads[i].join();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user