Inside3D!
     

Traceline Questions

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Junrall



Joined: 21 Sep 2009
Posts: 136
Location: North West Oregon, USA

PostPosted: Mon Sep 21, 2009 12:51 am    Post subject: Traceline Questions Reply with quote

Hello all!

I'm playing around with traceline and am trying to figure out what trace_allsolid and trace_startsolid are and how they are used.

So far all I can determine about trace_allsolid and trace_startsolid is that both will return a 1 when ever the starting point of a traceline touches a solid. They seem to act exactly alike.

What is the difference between trace_allsolid and trace_startsolid?
Are they able give more info... other than a 1 or 0?

Thanks!!
Back to top
View user's profile Send private message
Electro



Joined: 29 Dec 2004
Posts: 241
Location: Brisbane, Australia

PostPosted: Mon Sep 21, 2009 1:33 am    Post subject: Reply with quote

If the start and end points of the traceline were all inside solid, then allsolid is TRUE.

Otherwise, if it just starts in a solid, but ends up in open space, only startsolid is set.
_________________
Unit reporting!
http://www.bendarling.net/
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Junrall



Joined: 21 Sep 2009
Posts: 136
Location: North West Oregon, USA

PostPosted: Wed Sep 23, 2009 5:01 am    Post subject: Traceline and trace_allsolid Reply with quote

Ok... maybe traceline and trace_allsolid is not working properly or I'm doing something wrong. Here is the code I'm using... and here is a short in-game avi video ( http://www.megaupload.com/?d=O0C3KJI8 ) of my traceline being drawn with two X's and some bubbles. The red X is the starting point and the blue X is the stopping point. I am centerprinting the value of trace_allsolid.
As you can see, in the video, the only time that trace_allsolid returns a 1 is when the start of trace line touches a solid... it doesn't matter if the end point is in or out of a solid.
Any tidbit of info would be greatly appreciated.
Code:

float() test_obstruction =
{
   local vector start, stop, ang;
   local float hgt;
   local string h;
   
   makevectors (self.angles);
   
   ang = normalize(v_forward) * 60;   
   ang_z = 0;
   
   start = self.origin + ang;
      
   stop = start;
   stop_y = stop_y + 60;
   
   traceline(start, stop, TRUE, self);
   
   h = ftos(trace_allsolid);
   centerprint(self, h);

   if (trace_allsolid)
   {      
      return;
   }
      
};
Back to top
View user's profile Send private message
r00k



Joined: 13 Nov 2004
Posts: 483

PostPosted: Thu Sep 24, 2009 3:49 am    Post subject: Reply with quote

return true;
?
Back to top
View user's profile Send private message
Junrall



Joined: 21 Sep 2009
Posts: 136
Location: North West Oregon, USA

PostPosted: Thu Sep 24, 2009 5:34 am    Post subject: Reply with quote

r00k wrote:
return true;
?


The 'if' statement and 'return' are remnants of previous code. I should have removed it before posting... sorry 'bout that.

I am using centerprint to print the output of trace_allsolid. It will print 1 (TRUE) or 0 (FALSE)... depending on whether or not the traceline's starting point is in a solid.

I had thought that the entire traceline had to be in a solid before trace_allsolid would return a 1 (TRUE)... this is not the case. It will return a 1 (TRUE) any time the start of the trace line is in a solid... even if the end of the traceline is not in a solid.
Infact, trace_allsolid and trace_startsolid act exactly the same.

If I wasn't bald... I'd be pulling my hair out!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2004 phpBB Group