From b87773a62d81d1544523c0d363b650c1af0c2ef0 Mon Sep 17 00:00:00 2001 From: Sotiris Papatheodorou Date: Thu, 29 Sep 2022 12:49:48 +0100 Subject: [PATCH] Fix .binvox files being saved with the inverse scale According to the specification the scale stored in binvox should be what the normalized voxel coordinates (in the interval [0, 1]) should be scaled by. https://www.patrickmin.com/binvox/binvox.html --- Unreal/Plugins/AirSim/Source/WorldSimApi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Unreal/Plugins/AirSim/Source/WorldSimApi.cpp b/Unreal/Plugins/AirSim/Source/WorldSimApi.cpp index 6e289a190a..7fc2d96f0f 100644 --- a/Unreal/Plugins/AirSim/Source/WorldSimApi.cpp +++ b/Unreal/Plugins/AirSim/Source/WorldSimApi.cpp @@ -226,7 +226,7 @@ bool WorldSimApi::createVoxelGrid(const Vector3r& position, const int& x_size, c output << "#binvox 1\n"; output << "dim " << ncells_x << " " << ncells_z << " " << ncells_y << "\n"; output << "translate " << -x_size * 0.5 << " " << -y_size * 0.5 << " " << -z_size * 0.5 << "\n"; - output << "scale " << 1.0f / x_size << "\n"; + output << "scale " << x_size << "\n"; output << "data\n"; bool run_value = voxel_grid_[0]; unsigned int run_length = 0;