diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-12 17:01:17 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 10:01:56 +0200 |
commit | 1f6f364a56319eabd02c050746fe7df3f55ffee3 (patch) | |
tree | 8bebdce946466ce8e9476ccd46c9dba62c323938 /modules/gdnavigation/nav_map.h | |
parent | e7c9d818766a119089873e4941e4865fb36883ec (diff) | |
download | redot-engine-1f6f364a56319eabd02c050746fe7df3f55ffee3.tar.gz |
Port member initialization from constructor to declaration (C++11)
Using `clang-tidy`'s `modernize-use-default-member-init` check and
manual review of the changes, and some extra manual changes that
`clang-tidy` failed to do.
Also went manually through all of `core` to find occurrences that
`clang-tidy` couldn't handle, especially all initializations done
in a constructor without using initializer lists.
Diffstat (limited to 'modules/gdnavigation/nav_map.h')
-rw-r--r-- | modules/gdnavigation/nav_map.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/gdnavigation/nav_map.h b/modules/gdnavigation/nav_map.h index 4543f00926..d39e301511 100644 --- a/modules/gdnavigation/nav_map.h +++ b/modules/gdnavigation/nav_map.h @@ -48,17 +48,17 @@ class NavRegion; class NavMap : public NavRid { /// Map Up - Vector3 up; + Vector3 up = Vector3(0, 1, 0); /// To find the polygons edges the vertices are displaced in a grid where /// each cell has the following cell_size. - real_t cell_size; + real_t cell_size = 0.3; /// This value is used to detect the near edges to connect. - real_t edge_connection_margin; + real_t edge_connection_margin = 5.0; - bool regenerate_polygons; - bool regenerate_links; + bool regenerate_polygons = true; + bool regenerate_links = true; std::vector<NavRegion *> regions; @@ -69,7 +69,7 @@ class NavMap : public NavRid { RVO::KdTree rvo; /// Is agent array modified? - bool agents_dirty; + bool agents_dirty = false; /// All the Agents (even the controlled one) std::vector<RvoAgent *> agents; @@ -78,13 +78,13 @@ class NavMap : public NavRid { std::vector<RvoAgent *> controlled_agents; /// Physics delta time - real_t deltatime; + real_t deltatime = 0.0; /// Change the id each time the map is updated. - uint32_t map_update_id; + uint32_t map_update_id = 0; public: - NavMap(); + NavMap() {} void set_up(Vector3 p_up); Vector3 get_up() const { |