diff options
Diffstat (limited to 'scene/3d/proximity_group_3d.h')
-rw-r--r-- | scene/3d/proximity_group_3d.h | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/scene/3d/proximity_group_3d.h b/scene/3d/proximity_group_3d.h index 751bfbdb52..e45adc3040 100644 --- a/scene/3d/proximity_group_3d.h +++ b/scene/3d/proximity_group_3d.h @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2021 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 */ @@ -34,9 +34,7 @@ #include "node_3d.h" class ProximityGroup3D : public Node3D { - GDCLASS(ProximityGroup3D, Node3D); - OBJ_CATEGORY("3D"); public: enum DispatchMode { @@ -44,25 +42,25 @@ public: MODE_SIGNAL, }; -public: - void clear_groups(); - void update_groups(); - - void _notification(int p_what); - - DispatchMode dispatch_mode; - +private: Map<StringName, uint32_t> groups; + String group_name; + DispatchMode dispatch_mode = MODE_PROXY; + Vector3 grid_radius = Vector3(1, 1, 1); - float cell_size; - Vector3 grid_radius; - uint32_t group_version; + real_t cell_size = 1.0; + uint32_t group_version = 0; - void add_groups(int *p_cell, String p_base, int p_depth); + void _clear_groups(); + void _update_groups(); + void _add_groups(int *p_cell, String p_base, int p_depth); void _new_group(StringName p_name); - void _proximity_group_broadcast(String p_name, Variant p_params); + void _proximity_group_broadcast(String p_method, Variant p_parameters); + +protected: + void _notification(int p_what); static void _bind_methods(); @@ -76,12 +74,12 @@ public: void set_grid_radius(const Vector3 &p_radius); Vector3 get_grid_radius() const; - void broadcast(String p_name, Variant p_params); + void broadcast(String p_method, Variant p_parameters); ProximityGroup3D(); - ~ProximityGroup3D(); + ~ProximityGroup3D() {} }; VARIANT_ENUM_CAST(ProximityGroup3D::DispatchMode); -#endif +#endif // PROXIMITY_GROUP_H |