diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2015-03-19 23:53:54 +0000 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2015-03-24 18:46:26 +0000 |
commit | 4b3b5eba86d89e65e751b9e9b8e901a17f8e35ef (patch) | |
tree | 491ef9e63e84f03c4784c2805f40166820088fc4 /servers/physics | |
parent | ba194115bc3e450ac653191b2fc52b89417ddc28 (diff) |
Use Vector for storing areas
Diffstat (limited to 'servers/physics')
-rw-r--r-- | servers/physics/body_sw.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/servers/physics/body_sw.h b/servers/physics/body_sw.h index ee3c76e455..021245fe50 100644 --- a/servers/physics/body_sw.h +++ b/servers/physics/body_sw.h @@ -84,13 +84,13 @@ class BodySW : public CollisionObjectSW { struct AreaCMP { AreaSW *area; - _FORCE_INLINE_ bool operator<(const AreaCMP& p_cmp) const { return area->get_self() < p_cmp.area->get_self() ; } + _FORCE_INLINE_ bool operator==(const AreaCMP& p_cmp) const { return area->get_self() == p_cmp.area->get_self();} + _FORCE_INLINE_ bool operator<(const AreaCMP a) const { return area->get_priority() < a.area->get_priority();} _FORCE_INLINE_ AreaCMP() {} _FORCE_INLINE_ AreaCMP(AreaSW *p_area) { area=p_area;} }; - - VSet<AreaCMP> areas; + Vector<AreaCMP> areas; struct Contact { @@ -134,8 +134,7 @@ public: void set_force_integration_callback(ObjectID p_id,const StringName& p_method,const Variant& p_udata=Variant()); - - _FORCE_INLINE_ void add_area(AreaSW *p_area) { areas.insert(AreaCMP(p_area)); } + _FORCE_INLINE_ void add_area(AreaSW *p_area) { areas.ordered_insert(AreaCMP(p_area)); } _FORCE_INLINE_ void remove_area(AreaSW *p_area) { areas.erase(AreaCMP(p_area)); } _FORCE_INLINE_ void set_max_contacts_reported(int p_size) { contacts.resize(p_size); contact_count=0; if (mode==PhysicsServer::BODY_MODE_KINEMATIC && p_size) set_active(true);} |