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.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h
index 879489fc70..5e367e149d 100644
--- a/modules/gridmap/grid_map.h
+++ b/modules/gridmap/grid_map.h
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
+/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,6 +38,8 @@
//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 PhysicsMaterial;
+
class GridMap : public Node3D {
GDCLASS(GridMap, Node3D);
@@ -134,6 +136,7 @@ class GridMap : public Node3D {
uint32_t collision_layer = 1;
uint32_t collision_mask = 1;
+ Ref<PhysicsMaterial> physics_material;
bool bake_navigation = false;
uint32_t navigation_layers = 1;
@@ -147,14 +150,8 @@ class GridMap : public Node3D {
bool center_z = true;
float cell_scale = 1.0;
- bool clip = false;
- bool clip_above = true;
- int clip_floor = 0;
-
bool recreating_octants = false;
- Vector3::Axis clip_axis = Vector3::AXIS_Z;
-
Ref<MeshLibrary> mesh_library;
Map<OctantKey, Octant *> octant_map;
@@ -184,7 +181,7 @@ class GridMap : public Node3D {
void _queue_octants_dirty();
void _update_octants_callback();
- void resource_changed(const RES &p_res);
+ void resource_changed(const Ref<Resource> &p_res);
void _clear_internal();
@@ -223,6 +220,11 @@ public:
void set_collision_mask_value(int p_layer_number, bool p_value);
bool get_collision_mask_value(int p_layer_number) const;
+ void set_physics_material(Ref<PhysicsMaterial> p_material);
+ Ref<PhysicsMaterial> get_physics_material() const;
+
+ Array get_collision_shapes() const;
+
void set_bake_navigation(bool p_bake_navigation);
bool is_baking_navigation();
@@ -252,14 +254,13 @@ public:
Vector3i world_to_map(const Vector3 &p_world_position) const;
Vector3 map_to_world(const Vector3i &p_map_position) const;
- void set_clip(bool p_enabled, bool p_clip_above = true, int p_floor = 0, Vector3::Axis p_axis = Vector3::AXIS_X);
-
void set_cell_scale(float p_scale);
float get_cell_scale() const;
Array get_used_cells() const;
+ Array get_used_cells_by_item(int p_item) const;
- Array get_meshes();
+ Array get_meshes() const;
void clear_baked_meshes();
void make_baked_meshes(bool p_gen_lightmap_uv = false, float p_lightmap_uv_texel_size = 0.1);