Inside3D!
     

trace->fraction

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



Joined: 13 Nov 2004
Posts: 483

PostPosted: Mon Jul 19, 2010 9:48 am    Post subject: trace->fraction Reply with quote

I was messing around with this in SV_RecursiveHullCheck
Code:

   if (trace->fraction <= p1f)
   {
      Con_DPrintf("SV_RecursiveHullCheck: trace->fraction <= p1f\n");
      return false;      
   }


and noticed that after a memset (&trace, 0, sizeof(trace));
like in void TraceLine (vec3_t start, vec3_t end, vec3_t impact)

the above condition fubar'd the chase_active code.
Which led me to initialize trace.fraction = 1; whenever i started a trace. Now is this good practice or just paranoia?

(BTW, it's 4:50am and i've been up all night so my brain is melting)
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Mon Jul 19, 2010 10:11 am    Post subject: Reply with quote

recursivehullcheck does not initialise the trace, you need to do that in the caller. Initialising fraction to 1 will cause it to go the full distance when it starts solid. It won't affect anything if it actually hits a wall.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine 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