summaryrefslogtreecommitdiff
path: root/modules/gridmap
diff options
context:
space:
mode:
authorAnilforextra <anilforextra@gmail.com>2021-09-29 09:36:34 +0545
committerAnilforextra <anilforextra@gmail.com>2021-09-29 09:36:34 +0545
commitfc9767abb14348c2236b487f0bc6d18de65a38fd (patch)
treeef480b9a349b88a51b75296eae844c27a2504469 /modules/gridmap
parent5aa099aaed359df6ff79fe31616b5601db2a42c5 (diff)
Use functions defined in the their classes.
Diffstat (limited to 'modules/gridmap')
-rw-r--r--modules/gridmap/grid_map.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index 487e6deac0..116c0e00f9 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -377,10 +377,7 @@ int GridMap::get_cell_item_orientation(const Vector3i &p_position) const {
}
Vector3i GridMap::world_to_map(const Vector3 &p_world_position) const {
- Vector3 map_position = p_world_position / cell_size;
- map_position.x = floor(map_position.x);
- map_position.y = floor(map_position.y);
- map_position.z = floor(map_position.z);
+ Vector3 map_position = (p_world_position / cell_size).floor();
return Vector3i(map_position);
}