Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Get Sector at Pos for JK
Get Sector at Pos for JK
2005-03-05, 9:07 PM #1
I wrote two cogs for getting the sector at a position in JK. The result will either be the sector that contains that position, or -1 if there is no sector there. They are pretty simple so it would be easy to just copy and paste the code into whatever cog you would want to use it in.

The benefit of this is that you don't need to have a thing at whatever position just to find what the sector is...and, you can test points that are not in sectors.

There was some example of this in the datamaster (as zeq pointed out to me), but it is interesting at best :p

The difference between the simple and heap version is that the heap version precomputes some values and stores them as well as the surface normals in the heap to speed things up.

Both should be quite fast, and the heap version isn't really any more complicated either...

To try out my sample cogs, rename either one to item_fieldlight.cog and activate the fieldight. It'll show you the player's sector, using GetThingPos and my cog's results every second.

http://www.hellraiser64.com/jkhub/download/file/jksectoratpos.zip
Air Master 3D (my iPhone game)
My Programming Website
2005-03-06, 3:38 AM #2
I desperately needed something like that 2 years ago :(.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)

↑ Up to the top!