summaryrefslogtreecommitdiff
path: root/scene/3d/proximity_group_3d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d/proximity_group_3d.cpp')
-rw-r--r--scene/3d/proximity_group_3d.cpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/scene/3d/proximity_group_3d.cpp b/scene/3d/proximity_group_3d.cpp
index 44ffabb655..cef3381fc1 100644
--- a/scene/3d/proximity_group_3d.cpp
+++ b/scene/3d/proximity_group_3d.cpp
@@ -33,7 +33,6 @@
#include "core/math/math_funcs.h"
void ProximityGroup3D::clear_groups() {
-
Map<StringName, uint32_t>::Element *E;
{
@@ -42,7 +41,6 @@ void ProximityGroup3D::clear_groups() {
E = groups.front();
int num = 0;
while (E && num < size) {
-
if (E->get() != group_version) {
remove_list[num++] = E->key();
};
@@ -50,7 +48,6 @@ void ProximityGroup3D::clear_groups() {
E = E->next();
};
for (int i = 0; i < num; i++) {
-
groups.erase(remove_list[i]);
};
};
@@ -61,7 +58,6 @@ void ProximityGroup3D::clear_groups() {
};
void ProximityGroup3D::update_groups() {
-
if (grid_radius == Vector3(0, 0, 0))
return;
@@ -77,10 +73,8 @@ void ProximityGroup3D::update_groups() {
};
void ProximityGroup3D::add_groups(int *p_cell, String p_base, int p_depth) {
-
p_base = p_base + "|";
if (grid_radius[p_depth] == 0) {
-
if (p_depth == 2) {
_new_group(p_base);
} else {
@@ -92,7 +86,6 @@ void ProximityGroup3D::add_groups(int *p_cell, String p_base, int p_depth) {
int end = p_cell[p_depth] + grid_radius[p_depth];
for (int i = start; i <= end; i++) {
-
String gname = p_base + itos(i);
if (p_depth == 2) {
_new_group(gname);
@@ -103,7 +96,6 @@ void ProximityGroup3D::add_groups(int *p_cell, String p_base, int p_depth) {
};
void ProximityGroup3D::_new_group(StringName p_name) {
-
const Map<StringName, uint32_t>::Element *E = groups.find(p_name);
if (!E) {
add_to_group(p_name);
@@ -113,9 +105,7 @@ void ProximityGroup3D::_new_group(StringName p_name) {
};
void ProximityGroup3D::_notification(int p_what) {
-
switch (p_what) {
-
case NOTIFICATION_EXIT_TREE:
++group_version;
clear_groups();
@@ -127,59 +117,47 @@ void ProximityGroup3D::_notification(int p_what) {
};
void ProximityGroup3D::broadcast(String p_name, Variant p_params) {
-
Map<StringName, uint32_t>::Element *E;
E = groups.front();
while (E) {
-
get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFAULT, E->key(), "_proximity_group_broadcast", p_name, p_params);
E = E->next();
};
};
void ProximityGroup3D::_proximity_group_broadcast(String p_name, Variant p_params) {
-
if (dispatch_mode == MODE_PROXY) {
-
get_parent()->call(p_name, p_params);
} else {
-
emit_signal("broadcast", p_name, p_params);
};
};
void ProximityGroup3D::set_group_name(const String &p_group_name) {
-
group_name = p_group_name;
};
String ProximityGroup3D::get_group_name() const {
-
return group_name;
};
void ProximityGroup3D::set_dispatch_mode(DispatchMode p_mode) {
-
dispatch_mode = p_mode;
};
ProximityGroup3D::DispatchMode ProximityGroup3D::get_dispatch_mode() const {
-
return dispatch_mode;
};
void ProximityGroup3D::set_grid_radius(const Vector3 &p_radius) {
-
grid_radius = p_radius;
};
Vector3 ProximityGroup3D::get_grid_radius() const {
-
return grid_radius;
};
void ProximityGroup3D::_bind_methods() {
-
ClassDB::bind_method(D_METHOD("set_group_name", "name"), &ProximityGroup3D::set_group_name);
ClassDB::bind_method(D_METHOD("get_group_name"), &ProximityGroup3D::get_group_name);
ClassDB::bind_method(D_METHOD("set_dispatch_mode", "mode"), &ProximityGroup3D::set_dispatch_mode);
@@ -200,7 +178,6 @@ void ProximityGroup3D::_bind_methods() {
};
ProximityGroup3D::ProximityGroup3D() {
-
group_version = 0;
dispatch_mode = MODE_PROXY;