View unanswered posts | View active topics It is currently Thu Mar 28, 2024 7:26 pm



Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
 2 small questions 
Author Message
DRL Developer
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Reply with quote
Post 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
Profile
User avatar

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

Does anyone know what's wrong at this point?


Mon Aug 08, 2011 1:53 pm
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post 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
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 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 forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.031s | 15 Queries | GZIP : Off ]