refactor(Collision): update some methods to UpperCamelCase (#6486)

This commit is contained in:
Kitzunu
2021-06-27 16:37:22 +02:00
committed by GitHub
parent a2a01e19d1
commit b84f9b8a4b
18 changed files with 63 additions and 61 deletions

View File

@@ -86,7 +86,7 @@ namespace VMAP
return tilefilename.str();
}
bool StaticMapTree::getAreaInfo(Vector3& pos, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const
bool StaticMapTree::GetAreaInfo(Vector3& pos, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const
{
AreaInfoCallback intersectionCallBack(iTreeValues);
iTree.intersectPoint(pos, intersectionCallBack);
@@ -131,7 +131,7 @@ namespace VMAP
Else, pMaxDist is not modified and returns false;
*/
bool StaticMapTree::getIntersectionTime(const G3D::Ray& pRay, float& pMaxDist, bool StopAtFirstHit) const
bool StaticMapTree::GetIntersectionTime(const G3D::Ray& pRay, float& pMaxDist, bool StopAtFirstHit) const
{
float distance = pMaxDist;
MapRayCallback intersectionCallBack(iTreeValues);
@@ -162,8 +162,10 @@ namespace VMAP
}
// direction with length of 1
G3D::Ray ray = G3D::Ray::fromOriginAndDirection(pos1, (pos2 - pos1) / maxDist);
if (getIntersectionTime(ray, maxDist, true))
if (GetIntersectionTime(ray, maxDist, true))
{
return false;
}
@@ -175,7 +177,7 @@ namespace VMAP
Return the hit pos or the original dest pos
*/
bool StaticMapTree::getObjectHitPos(const Vector3& pPos1, const Vector3& pPos2, Vector3& pResultHitPos, float pModifyDist) const
bool StaticMapTree::GetObjectHitPos(const Vector3& pPos1, const Vector3& pPos2, Vector3& pResultHitPos, float pModifyDist) const
{
bool result = false;
float maxDist = (pPos2 - pPos1).magnitude();
@@ -190,7 +192,7 @@ namespace VMAP
Vector3 dir = (pPos2 - pPos1) / maxDist; // direction with length of 1
G3D::Ray ray(pPos1, dir);
float dist = maxDist;
if (getIntersectionTime(ray, dist, false))
if (GetIntersectionTime(ray, dist, false))
{
pResultHitPos = pPos1 + dir * dist;
if (pModifyDist < 0)
@@ -226,7 +228,7 @@ namespace VMAP
Vector3 dir = Vector3(0, 0, -1);
G3D::Ray ray(pPos, dir); // direction with length of 1
float maxDist = maxSearchDist;
if (getIntersectionTime(ray, maxDist, false))
if (GetIntersectionTime(ray, maxDist, false))
{
height = pPos.z - maxDist;
}
@@ -507,7 +509,7 @@ namespace VMAP
iLoadedTiles.erase(tile);
}
void StaticMapTree::getModelInstances(ModelInstance*& models, uint32& count)
void StaticMapTree::GetModelInstances(ModelInstance*& models, uint32& count)
{
models = iTreeValues;
count = iNTreeValues;

View File

@@ -45,7 +45,7 @@ namespace VMAP
std::string iBasePath;
private:
bool getIntersectionTime(const G3D::Ray& pRay, float& pMaxDist, bool StopAtFirstHit) const;
bool GetIntersectionTime(const G3D::Ray& pRay, float& pMaxDist, bool StopAtFirstHit) const;
//bool containsLoadedMapTile(unsigned int pTileIdent) const { return(iLoadedMapTiles.containsKey(pTileIdent)); }
public:
static std::string getTileFileName(uint32 mapID, uint32 tileX, uint32 tileY);
@@ -57,9 +57,9 @@ namespace VMAP
~StaticMapTree();
[[nodiscard]] bool isInLineOfSight(const G3D::Vector3& pos1, const G3D::Vector3& pos2) const;
bool getObjectHitPos(const G3D::Vector3& pos1, const G3D::Vector3& pos2, G3D::Vector3& pResultHitPos, float pModifyDist) const;
bool GetObjectHitPos(const G3D::Vector3& pos1, const G3D::Vector3& pos2, G3D::Vector3& pResultHitPos, float pModifyDist) const;
[[nodiscard]] float getHeight(const G3D::Vector3& pPos, float maxSearchDist) const;
bool getAreaInfo(G3D::Vector3& pos, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const;
bool GetAreaInfo(G3D::Vector3& pos, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const;
bool GetLocationInfo(const G3D::Vector3& pos, LocationInfo& info) const;
bool InitMap(const std::string& fname, VMapManager2* vm);
@@ -68,7 +68,7 @@ namespace VMAP
void UnloadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm);
[[nodiscard]] bool isTiled() const { return iIsTiled; }
[[nodiscard]] uint32 numLoadedTiles() const { return iLoadedTiles.size(); }
void getModelInstances(ModelInstance*& models, uint32& count);
void GetModelInstances(ModelInstance*& models, uint32& count);
};
struct AreaInfo

View File

@@ -20,7 +20,7 @@ using std::pair;
template<> struct BoundsTrait<VMAP::ModelSpawn*>
{
static void getBounds(const VMAP::ModelSpawn* const& obj, G3D::AABox& out) { out = obj->getBounds(); }
static void GetBounds(const VMAP::ModelSpawn* const& obj, G3D::AABox& out) { out = obj->GetBounds(); }
};
namespace VMAP
@@ -92,7 +92,7 @@ namespace VMAP
try
{
pTree.build(mapSpawns, BoundsTrait<ModelSpawn*>::getBounds);
pTree.build(mapSpawns, BoundsTrait<ModelSpawn*>::GetBounds);
}
catch (std::exception& e)
{