chore: Remove dpEntity pointers from collision checking (#1529)

* chore: Remove dpEntity pointers from collision checking

* Update fn documentation in ProximityMonitorComponent.h

* use more idiomatic method to calculate vector index

* feedback

* missed a ranges::find replacement

* adjust for feedback. last changes tonight.

* okay, also remove unneeded include. then sleep.

* for real tho

* update to use unordered_set instead of set
This commit is contained in:
jadebenn
2024-04-05 00:52:26 -05:00
committed by GitHub
parent b340d7c8f9
commit 06e7d57e0d
8 changed files with 51 additions and 51 deletions

View File

@@ -6,6 +6,8 @@
#ifndef PROXIMITYMONITORCOMPONENT_H
#define PROXIMITYMONITORCOMPONENT_H
#include <unordered_set>
#include "BitStream.h"
#include "Entity.h"
#include "dpWorld.h"
@@ -42,9 +44,9 @@ public:
/**
* Returns the last of entities that are used to check proximity, given a name
* @param name the proximity name to retrieve physics objects for
* @return a map of physics entities for this name, indexed by object ID
* @return a set of physics entity object IDs for this name
*/
const std::map<LWOOBJID, dpEntity*>& GetProximityObjects(const std::string& name);
const std::unordered_set<LWOOBJID>& GetProximityObjects(const std::string& name);
/**
* Checks if the passed object is in proximity of the named proximity sensor
@@ -70,7 +72,7 @@ private:
/**
* Default value for the proximity data
*/
static const std::map<LWOOBJID, dpEntity*> m_EmptyObjectMap;
static const std::unordered_set<LWOOBJID> m_EmptyObjectSet;
};
#endif // PROXIMITYMONITORCOMPONENT_H