View topic - Spring.TraceScreenRay that ignores units



All times are UTC + 1 hour


Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: 23 Oct 2010, 03:14 
User avatar

Joined: 07 Dec 2008, 02:35
Currently there is no way to trace a screen ray that completely ignores units, i.e. only intersects with the ground, which would be very useful for many widgets (some of which are bugged without it i.e. the very popular custom formations)

As it stands, TraceScreenRay will always intersect with units and either return the unitID or the point of collision, both of which are useless when you are looking for intersection with the ground (if the unit hit is in the air then the collision point returned is also way up in the air...)

Requested Feature:
Optional boolean argument added to Spring.TraceScreenRay that determines whether units/features will be considered (by changing the usual ray trace used to one which only checks the ground)


Top
 Offline Profile  
 
PostPosted: 23 Oct 2010, 03:21 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
http://springrts.com/wiki/Lua_UnsyncedRead#Screen_Trace

The optional argument "onlyCoords" already exist. I guess what you want to say is that when "onlyCoords" is set, then it returns the coordinates of the point of collision with any passing unit, instead of ignoring units.

It would say it is not a feature request, but a bug report.

We don't want an extra boolean. We want the already existing boolean to behave in a sensible way.


Top
 Offline Profile  
 
PostPosted: 23 Oct 2010, 10:34 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
i found this:
http://github.com/spring/spring/blob/ma ... ead.h#L204

as stated in the comments, these are not implemented. i neither know why, nor why they are in synced instead of unsynced. i would be glad if some of the other engine devs could comment on this.

these 4 lines were added by trepan in June 2007:
http://github.com/spring/spring/commit/ ... 80e#L3R145

i would think, they should be in unsynced. implementing should mainly consist in mapping it to the respective functions in rts/Game/GameHelper.h. i could do that if it makes sense this way.


Top
 Offline Profile  
 
PostPosted: 23 Oct 2010, 17:02 
User avatar

Joined: 21 Feb 2005, 03:38
Location: Herding cats uphill whilst wearing roller skates.
+1 to making it work consistently; I would really prefer to have it return coordinates by default, return Unit collisions if option = true, but whichever, so long as it works and allows for ignoring Units. The lack of this working in a consistent way has made me have to do some annoying hack-arounds for various things.


Top
 Offline Profile  
 
PostPosted: 23 Oct 2010, 17:18 
Spring Developer
User avatar

Joined: 28 Jun 2007, 06:30
hoijui wrote:
The synced ones aren't for screen space/mouse cursor raytracing, they were for weapon's line of fire checking etc. (they shouldn't interpolate the unit positions etc.)


Top
 Offline Profile  
 
PostPosted: 23 Oct 2010, 21:26 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
ah..
so would it make sense to have these 3 implemented, and have an other 3 equal ones in unsynced, that use the inexact unit positions and other unsynced stuff, if any?


Top
 Offline Profile  
 
PostPosted: 24 Oct 2010, 03:04 
Spring Developer
User avatar

Joined: 28 Jun 2007, 06:30
I would prefer 2 functions with one (or more) argument(s) for the collision types.


Top
 Offline Profile  
 
PostPosted: 24 Oct 2010, 09:31 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
i see.. cram these 4 into a single one, and duplicate on the unsynced part, yeah?


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


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:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.