summaryrefslogtreecommitdiff
path: root/modules/gridmap/grid_map_editor_plugin.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-03-23 00:10:04 +0100
committerGitHub <noreply@github.com>2021-03-23 00:10:04 +0100
commit11718dbef926365ca5bd24e17604e264b82f5f00 (patch)
tree3bfddd3c7bb4c2339c087493ab1c96d208ca8db1 /modules/gridmap/grid_map_editor_plugin.cpp
parent32aea7b40fe42b4369b74875f57bcf06431e3c7e (diff)
parentaffe3c817ac2f6f048a4862d9dbc96e67aa638c3 (diff)
Merge pull request #45562 from aaronfranke/core-modules-real_t
Use real_t in GridMap and VariantParser
Diffstat (limited to 'modules/gridmap/grid_map_editor_plugin.cpp')
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index da9cdb9bc5..3472f29505 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -386,13 +386,13 @@ bool GridMapEditor::do_input_action(Camera3D *p_camera, const Point2 &p_point, b
}
int cell[3];
- float cell_size[3] = { node->get_cell_size().x, node->get_cell_size().y, node->get_cell_size().z };
+ Vector3 cell_size = node->get_cell_size();
for (int i = 0; i < 3; i++) {
if (i == edit_axis) {
cell[i] = edit_floor[i];
} else {
- cell[i] = inters[i] / node->get_cell_size()[i];
+ cell[i] = inters[i] / cell_size[i];
if (inters[i] < 0) {
cell[i] -= 1; // Compensate negative.
}
@@ -436,6 +436,7 @@ bool GridMapEditor::do_input_action(Camera3D *p_camera, const Point2 &p_point, b
}
return true;
}
+
if (input_action == INPUT_PAINT) {
SetItem si;
si.position = Vector3i(cell[0], cell[1], cell[2]);
@@ -545,7 +546,7 @@ void GridMapEditor::_update_paste_indicator() {
return;
}
- Vector3 center = 0.5 * Vector3(float(node->get_center_x()), float(node->get_center_y()), float(node->get_center_z()));
+ Vector3 center = 0.5 * Vector3(real_t(node->get_center_x()), real_t(node->get_center_y()), real_t(node->get_center_z()));
Vector3 scale = (Vector3(1, 1, 1) + (paste_indicator.end - paste_indicator.begin)) * node->get_cell_size();
Transform xf;
xf.scale(scale);