summaryrefslogtreecommitdiff
path: root/modules/gridmap/grid_map.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gridmap/grid_map.h')
-rw-r--r--modules/gridmap/grid_map.h41
1 files changed, 21 insertions, 20 deletions
diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h
index 7af1e08eb2..9e1d250680 100644
--- a/modules/gridmap/grid_map.h
+++ b/modules/gridmap/grid_map.h
@@ -3,7 +3,7 @@
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
-/* http://www.godotengine.org */
+/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
@@ -38,8 +38,6 @@
//heh heh, godotsphir!! this shares no code and the design is completely different with previous projects i've done..
//should scale better with hardware that supports instancing
-class BakedLightInstance;
-
class GridMap : public Spatial {
GDCLASS(GridMap, Spatial);
@@ -96,21 +94,25 @@ class GridMap : public Spatial {
Transform xform;
};
- struct ItemInstances {
- Set<IndexKey> cells;
- Ref<Mesh> mesh;
- Ref<Shape> shape;
- Ref<MultiMesh> multimesh;
- RID multimesh_instance;
- Ref<NavigationMesh> navmesh;
+ struct MultimeshInstance {
+ RID instance;
+ RID multimesh;
+ struct Item {
+ int index;
+ Transform transform;
+ IndexKey key;
+ };
+
+ Vector<Item> items; //tools only, for changing visibility
};
+ Vector<MultimeshInstance> multimesh_instances;
+ Set<IndexKey> cells;
RID collision_debug;
RID collision_debug_instance;
bool dirty;
RID static_body;
- Map<int, ItemInstances> items;
Map<IndexKey, NavMesh> navmesh_ids;
};
@@ -137,7 +139,7 @@ class GridMap : public Spatial {
Transform last_transform;
bool _in_tree;
- float cell_size;
+ Vector3 cell_size;
int octant_size;
bool center_x, center_y, center_z;
float cell_scale;
@@ -169,15 +171,14 @@ class GridMap : public Spatial {
}
void _octant_enter_world(const OctantKey &p_key);
- void _octant_enter_tree(const OctantKey &p_key);
void _octant_exit_world(const OctantKey &p_key);
- void _octant_update(const OctantKey &p_key);
+ bool _octant_update(const OctantKey &p_key);
+ void _octant_clean_up(const OctantKey &p_key);
void _octant_transform(const OctantKey &p_key);
- void _octant_clear_navmesh(const GridMap::OctantKey &);
bool awaiting_update;
- void _queue_dirty_map();
- void _update_dirty_map_callback();
+ void _queue_octants_dirty();
+ void _update_octants_callback();
void resource_changed(const RES &p_res);
@@ -199,8 +200,8 @@ public:
void set_theme(const Ref<MeshLibrary> &p_theme);
Ref<MeshLibrary> get_theme() const;
- void set_cell_size(float p_size);
- float get_cell_size() const;
+ void set_cell_size(const Vector3 &p_size);
+ Vector3 get_cell_size() const;
void set_octant_size(int p_size);
int get_octant_size() const;
@@ -229,4 +230,4 @@ public:
~GridMap();
};
-#endif // CUBE_GRID_MAP_H
+#endif // GRID_MAP_H