AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
dtQueryFilterExt Class Reference

#include "DetourExtended.h"

Inheritance diagram for dtQueryFilterExt:

Public Member Functions

float getCost (const float *pa, const float *pb, const dtPolyRef prevRef, const dtMeshTile *prevTile, const dtPoly *prevPoly, const dtPolyRef curRef, const dtMeshTile *curTile, const dtPoly *curPoly, const dtPolyRef nextRef, const dtMeshTile *nextTile, const dtPoly *nextPoly) const override
 

Detailed Description

Member Function Documentation

◆ getCost()

float dtQueryFilterExt::getCost ( const float *  pa,
const float *  pb,
const dtPolyRef  prevRef,
const dtMeshTile *  prevTile,
const dtPoly *  prevPoly,
const dtPolyRef  curRef,
const dtMeshTile *  curTile,
const dtPoly *  curPoly,
const dtPolyRef  nextRef,
const dtMeshTile *  nextTile,
const dtPoly *  nextPoly 
) const
override
13{
14 float startX = pa[2], startY = pa[0], startZ = pa[1];
15 float destX = pb[2], destY = pb[0], destZ = pb[1];
16 float slopeAngle = getSlopeAngle(startX, startY, startZ, destX, destY, destZ);
17 float slopeAngleDegree = (slopeAngle * 180.0f / M_PI);
18 float cost = slopeAngleDegree > 0 ? 1.0f + (1.0f * (slopeAngleDegree / 100)) : 1.0f;
19 float dist = dtVdist(pa, pb);
20 auto totalCost = dist * cost * getAreaCost(curPoly->getArea());
21 return totalCost;
22}
float getSlopeAngle(float startX, float startY, float startZ, float destX, float destY, float destZ)
Definition: Geometry.h:42

References getSlopeAngle().