refactor(Core/Misc): add braces and impove codestyle (#6402)
This commit is contained in:
parent
33c271cc7c
commit
3c24b511f2
72 changed files with 1486 additions and 401 deletions
|
|
@ -11,12 +11,12 @@ float dtQueryFilterExt::getCost(const float* pa, const float* pb,
|
|||
const dtPolyRef /*curRef*/, const dtMeshTile* /*curTile*/, const dtPoly* curPoly,
|
||||
const dtPolyRef /*nextRef*/, const dtMeshTile* /*nextTile*/, const dtPoly* /*nextPoly*/) const
|
||||
{
|
||||
float startX=pa[2], startY=pa[0], startZ=pa[1];
|
||||
float destX=pb[2], destY=pb[0], destZ=pb[1];
|
||||
float slopeAngle = getSlopeAngle(startX, startY, startZ, destX, destY, destZ);
|
||||
float slopeAngleDegree = (slopeAngle * 180.0f / M_PI);
|
||||
float cost = slopeAngleDegree > 0 ? 1.0f + (1.0f * (slopeAngleDegree/100)) : 1.0f;
|
||||
float dist = dtVdist(pa, pb);
|
||||
auto totalCost = dist * cost * getAreaCost(curPoly->getArea());
|
||||
return totalCost;
|
||||
float startX = pa[2], startY = pa[0], startZ = pa[1];
|
||||
float destX = pb[2], destY = pb[0], destZ = pb[1];
|
||||
float slopeAngle = getSlopeAngle(startX, startY, startZ, destX, destY, destZ);
|
||||
float slopeAngleDegree = (slopeAngle * 180.0f / M_PI);
|
||||
float cost = slopeAngleDegree > 0 ? 1.0f + (1.0f * (slopeAngleDegree / 100)) : 1.0f;
|
||||
float dist = dtVdist(pa, pb);
|
||||
auto totalCost = dist * cost * getAreaCost(curPoly->getArea());
|
||||
return totalCost;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue