mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 21:26:23 +00:00
feat(Core/CreatureAI): improve npc position during the combat (#3369)
+ tangent equation to find correct angle and distance when moving + implemented proper backward * Improved performance + random angle margin * chore: add tollerance calculation in instance * improved LOS checks with movements * implemented collisions using raycast (imported by TC) + improved collision detection for CanReachPositionAndGetCoords + improved collision check + set correct flags for the backward movement + first implementation of slope angle (to improve) Co-authored-by: Yehonal <yehonal.azeroth@gmail.com>
This commit is contained in:
@@ -643,7 +643,7 @@ struct MovementInfo
|
||||
// spline
|
||||
float splineElevation{0.0f};
|
||||
|
||||
MovementInfo()
|
||||
MovementInfo()
|
||||
{
|
||||
pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
transport.Reset();
|
||||
@@ -796,7 +796,10 @@ public:
|
||||
GetPosition(&pos);
|
||||
MovePosition(pos, dist, angle);
|
||||
}
|
||||
void MovePositionToFirstCollision(Position& pos, float dist, float angle);
|
||||
bool MovePositionToFirstCollision(Position& pos, float dist, float angle);
|
||||
Position GetFirstCollisionPosition(float startX, float startY, float startZ, float destX, float destY);
|
||||
Position GetFirstCollisionPosition(float destX, float destY, float destZ);
|
||||
Position GetFirstCollisionPosition(float dist, float angle);
|
||||
void GetFirstCollisionPosition(Position& pos, float dist, float angle)
|
||||
{
|
||||
GetPosition(&pos);
|
||||
@@ -1060,6 +1063,9 @@ public:
|
||||
[[nodiscard]] virtual float GetStationaryY() const { return GetPositionY(); }
|
||||
[[nodiscard]] virtual float GetStationaryZ() const { return GetPositionZ(); }
|
||||
[[nodiscard]] virtual float GetStationaryO() const { return GetOrientation(); }
|
||||
float GetMapHeight(float x, float y, float z, bool vmap = true, float distanceToSearch = 50.0f) const; // DEFAULT_HEIGHT_SEARCH in map.h
|
||||
|
||||
virtual float GetCollisionHeight() const { return 0.0f; }
|
||||
|
||||
protected:
|
||||
std::string m_name;
|
||||
|
||||
Reference in New Issue
Block a user