Show the calculated speed of the route on the map

This commit is contained in:
Martin Asprusten
2025-06-30 14:30:34 +02:00
parent 8f0759fc63
commit f0b4479664
7 changed files with 74 additions and 33 deletions
+3 -1
View File
@@ -279,7 +279,7 @@ float calculate_speed(float starting_speed, float horizontal_distance, float hei
if (final_speed < minimum_speed) {
return -1;
} else {
return std::min(final_speed, maximum_speed);
return std::fmin(final_speed, maximum_speed);
}
}
@@ -759,6 +759,8 @@ EMSCRIPTEN_BINDINGS(my_module) {
.property("nodeId", &JSNodeInfo::nodeId)
.property("positionX", &JSNodeInfo::positionX)
.property("positionY", &JSNodeInfo::positionY)
.property("positionZ", &JSNodeInfo::positionZ)
.property("currentSpeed", &JSNodeInfo::currentSpeed)
.property("distanceFromStart", &JSNodeInfo::distanceFromStart);
emscripten::class_<JSSearchResult>("SearchResult")