Core/vmaps: Removed vmap lookup functions duplicating functionality of each other

Port From (https://github.com/TrinityCore/TrinityCore/commit/45ee989c70682c001d4467d97bf1ecedcf7dbcc3)
This commit is contained in:
hondacrx
2024-03-12 23:04:13 -04:00
parent 5b938c1a3e
commit ccf73e23e3
16 changed files with 131 additions and 349 deletions
@@ -120,37 +120,6 @@ namespace Game.Collision
return hit;
}
public void IntersectPoint(Vector3 p, AreaInfo info)
{
if (iModel == null)
return;
// M2 files don't contain area info, only WMO files
if (iModel.IsM2())
return;
if (!iBound.contains(p))
return;
// child bounds are defined in object space:
Vector3 pModel = iInvRot.Multiply(p - iPos) * iInvScale;
Vector3 zDirModel = iInvRot.Multiply(new Vector3(0.0f, 0.0f, -1.0f));
float zDist;
if (iModel.IntersectPoint(pModel, zDirModel, out zDist, info))
{
Vector3 modelGround = pModel + zDist * zDirModel;
// Transform back to world space. Note that:
// Mat * vec == vec * Mat.transpose()
// and for rotation matrices: Mat.inverse() == Mat.transpose()
float world_Z = (iInvRot.Multiply(modelGround) * iScale + iPos).Z;
if (info.ground_Z < world_Z)
{
info.ground_Z = world_Z;
info.adtId = adtId;
}
}
}
public bool GetLiquidLevel(Vector3 p, LocationInfo info, ref float liqHeight)
{
// child bounds are defined in object space: