As far as I know, maps are ultimately composed of right isosceles triangles, whose vertices are defined by the heightmap, like this:
My question is how slope/passability are calculated. Is a slope defined for each triangle, or each square? Are the slopes calculated from the edges, or the faces?
Note: I need to know this for more than just testing for passability, so please don't tell me to just use tools to see the passability or whatever.
Calculation of Slope/Passability
Moderator: Moderators
Re: Calculation of Slope/Passability
from rts/ExternalAI/Interface/SSkirmishAICallback.h:
Code: Select all
The values are 1 minus the y-component of the (average) facenormal of the square.