summaryrefslogtreecommitdiff
path: root/servers/physics_2d/area_2d_sw.h
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-08-28 05:10:15 +0200
committerGitHub <noreply@github.com>2021-08-28 05:10:15 +0200
commitdcf2d09231c03c444cf5374b4d250f327f1333e4 (patch)
treed7494603ae727fe82b3119decaa477357b8572e5 /servers/physics_2d/area_2d_sw.h
parentd04aa9a114811e27c672e9874c262e91299216f0 (diff)
parent9c9e528e3e5b8598186183f381b9d2131e52682e (diff)
Merge pull request #52070 from nekomatata/area-point-gravity-fix
Fix point gravity calculation
Diffstat (limited to 'servers/physics_2d/area_2d_sw.h')
-rw-r--r--servers/physics_2d/area_2d_sw.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/servers/physics_2d/area_2d_sw.h b/servers/physics_2d/area_2d_sw.h
index 3bf603b30d..d9147d6f1d 100644
--- a/servers/physics_2d/area_2d_sw.h
+++ b/servers/physics_2d/area_2d_sw.h
@@ -34,7 +34,6 @@
#include "collision_object_2d_sw.h"
#include "core/templates/self_list.h"
#include "servers/physics_server_2d.h"
-//#include "servers/physics_3d/query_sw.h"
class Space2DSW;
class Body2DSW;
@@ -94,17 +93,12 @@ class Area2DSW : public CollisionObject2DSW {
Map<BodyKey, BodyState> monitored_bodies;
Map<BodyKey, BodyState> monitored_areas;
- //virtual void shape_changed_notify(Shape2DSW *p_shape);
- //virtual void shape_deleted_notify(Shape2DSW *p_shape);
Set<Constraint2DSW *> constraints;
virtual void _shapes_changed();
void _queue_monitor_update();
public:
- //_FORCE_INLINE_ const Matrix32& get_inverse_transform() const { return inverse_transform; }
- //_FORCE_INLINE_ SpaceSW* get_owner() { return owner; }
-
void set_monitor_callback(ObjectID p_id, const StringName &p_method);
_FORCE_INLINE_ bool has_monitor_callback() const { return monitor_callback_id.is_valid(); }
@@ -161,6 +155,8 @@ public:
void call_queries();
+ void compute_gravity(const Vector2 &p_position, Vector2 &r_gravity) const;
+
Area2DSW();
~Area2DSW();
};