View unanswered posts | View active topics It is currently Thu Aug 22, 2019 9:09 am

 Page 2 of 2 [ 18 posts ] Go to page Previous  1, 2
 Print view Previous topic | Next topic
2 small questions
Author Message
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Re: 2 small questions
TheLastBanana wrote:
You may want to set the third argument of SceneMan:ShortestDistance to true. Otherwise, it won't account for wrapping over the map's seam.

No. The API documentation is very clear on this:

TFM wrote:
ShortestDistance

Calculates the shortest distance between two points in scene coordinates, taking into account all wrapping and out of bounds of the two points.

Arguments:
The two Vector coordinates of the two positions to find the shortest distance between.
Whether to check if the passed in points are outside the scene, and to wrap them if they are.

Return value:

The resulting vector screen shows the shortest distance, spanning over wrapping borders etc. Basically the ideal pos2 - pos1.

So you usually don't want to set the third argument to true, because that will move e.g. Vector(0,-100) to somewhere inside the scene. It also means that using SceneMan.SceneWrapsX as the third argument, as you sometimes see people do, does not have the effect intended by the modder.

Mon Aug 08, 2011 11:50 am

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Re: 2 small questions
Okay, I'll change it to false.

Does anyone know what's wrong at this point?

Mon Aug 08, 2011 1:53 pm
DRL Developer

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3134
Location: A little south and a lot west of Moscow
Re: 2 small questions
Ah, I see what you mean. I assumed that applied even if wrapping is on - a point with an x coordinate of 500 could be considered "outside" of a 400-width scene even if it wraps horizontally, as that's how the wrapping argument works on, for instance, CastWeaknessRay. It looks like you're right, though, so thanks for clearing that up.

Mon Aug 08, 2011 8:26 pm
Display posts from previous:  Sort by
 Page 2 of 2 [ 18 posts ] Go to page Previous  1, 2

#### Who is online

Users browsing this forum: No registered users

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ Cortex Command    Dev Log    Wiki    Game Discussion    Game and Licensing Support    Mod Making       Lua Scripting       Requests    Mod Releases       Older Mods    Scene Releases       Scene Making Planetoid Pioneers    Game Discussion    Pioneer Program Lounge Data Realms Off-Topic    Off Topic Chat       Gaming       Forum Games    Site Support & Feedback