Calculation of Slope/Passability

Calculation of Slope/Passability

Discuss maps & map creation - from concept to execution to the ever elusive release.

Moderator: Moderators

Post Reply
User avatar
fc14159
Posts: 153
Joined: 06 Jul 2007, 17:27

Calculation of Slope/Passability

Post by fc14159 »

As far as I know, maps are ultimately composed of right isosceles triangles, whose vertices are defined by the heightmap, like this:
square.jpg
square.jpg (16.3 KiB) Viewed 722 times
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.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Calculation of Slope/Passability

Post by hoijui »

from rts/ExternalAI/Interface/SSkirmishAICallback.h:

Code: Select all

The values are 1 minus the y-component of the (average) facenormal of the square.
Post Reply

Return to “Map Creation”