The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled C# Code
Posted by: Unknown | March 21, 2008 @ 7:14pm
C# Code
[
Download
]
/* check slope to determine if two points should connect - assumes anything more than 45 degrees is impassable */ member IsSteep(float FromX, float FromY, float FromZ, float ToX, float ToY, float ToZ) { /* determine horizontal distance and vertical distance between points */ variable float slope = 0 variable float maxslope = 0.8 variable float horizontal = ${Math.Distance[${FromX}, ${FromY}, ${ToZ},${ToX}, ${ToY},${ToZ}]} variable float vertical = ${Math.Distance[${ToX}, ${ToY}, ${FromZ}, ${ToX}, ${ToY}, ${ToZ}]} /* did we move? */ if ${horizontal} < 1.5 { return FALSE } /* adjust for greater distance */ if ${horizontal} > 5 { maxslope:Set[0.65] } /* calculate slope by dividing vertical distance by horizontal */ slope:Set[${vertical}/${horizontal}] /* if slope is greater than 1, the slope is greater than a 45 degree angle - lets not map it */ if ${slope} > ${maxslope} { return TRUE } return FALSE } }
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.64 / 8
153 Votes
http://codebin.yi.org/147
page generated in 0.00 seconds