trace->fraction
Moderator: InsideQC Admins
2 posts
• Page 1 of 1
trace->fraction
I was messing around with this in SV_RecursiveHullCheck
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)
- Code: Select all
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)
- r00k
- Posts: 1110
- Joined: Sat Nov 13, 2004 10:39 pm
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.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest