![]() |
NaN error. - Printable Version +- Forums (https://www.vdrift.net/Forum) +-- Forum: Project (https://www.vdrift.net/Forum/forumdisplay.php?fid=4) +--- Forum: Development (https://www.vdrift.net/Forum/forumdisplay.php?fid=9) +--- Thread: NaN error. (/showthread.php?tid=460) |
NaN error. - pwp71 - 11-30-2006 What does it mean "Detected NaN in origin vector" and what I have to do? Thanks. PwP71 - thelusiv - 11-30-2006 It's hard to tell what we need to do to fix these. They are caused by bugs in the collision detection code. - pwp71 - 12-19-2006 ok, I've understood what is the problem in some NaN cases ![]() Keep attention to: - division by 0 - sqrt( -x ) are the root cause of many problem. In this case some "Detected NaN in elevation" were due to this formula: u = alpha / ((v * (alpha_11 - (1.0))) + (1.0)); Sometimes, v = 1 and alpha_11 = 0, so -> u = alpha / 0 -> NaN "Detected NaN in origin vector" is still open but I'm working also on it. Tell me a feedback about "Detected NaN in elevation". Thanks. pwp71 P.S. done, rev. 1439 - joevenzon - 12-19-2006 Good catch! Are you sure we should be returning false for this case, though? - pwp71 - 12-20-2006 I've tried to use: u = alpha / 0.00001 or return false both work. I've preferred to use "return false" looking at other code, like: Code: if (D < 0) return false; You know this code much better than me, feel free to modify my solution. pwp71 - thelusiv - 12-21-2006 Good work, I have been playing a lot while testing cars lately, and haven't hit a NaN error in a long time! Thanks very much ![]() - pwp71 - 12-27-2006 Some "Detected NaN in origin vector" are due at this operation: FIle: Suspension.cc line 163: Code: m_angle = asin (z / m_radius_magnitude); "z / m_radius_magnitude" should be included between -1.0 and 1.0 Some values are <or> and this make NaN error. I've used this code Code: if( (z / m_radius_magnitude) > 1.0 ) The stability of game getting better, but there are something wrong. So, I've continued to investigate. The problem seem to be: file: Whell.cc line 146: Code: Three_Vector disp = One of my trials was to substitute : back_project -> project Code: Three_Vector disp = With this modify the game is very stable about NaN error, but is more sensible when car hit an object. Sometime, the car also goes in free fall. I don't understand what happen yet ![]() Someone have any idea. Try my modifies and tell me what do you think about that. If is your opinion is ok I'll commit two files. Thanks. pwp71. - joevenzon - 12-27-2006 You should keep it as back_project. I checked in a change that should ensure that back_project never sets anything to NaN. There was already a check for this, but I tried to enhance it. - pwp71 - 12-28-2006 The modify doesn't work. To generate a simple,origin NaN error, you must: - use pau circuit - go to double curves with a statue on the left - go out of the main roads passing between the statue and guardrail "dunloop" - go to the corner, turn on the right and point sidewalk on the left. - when 3 tires go up to the sidewalk NaN error occurs. Use before: Suspension.cc line ~163 Code: instead: pwp71 P.S. I've done a replay, but I don't know where download them. Is it possible to have a common area to download files? [/code] - joevenzon - 12-28-2006 I tried your substitution into suspension.cc, and it makes sense, but I never get the cout statements. What car are you using? I don't get NaN errors at that point in Pau in the T73 or AX2, although the cars do flip out. - joevenzon - 12-28-2006 pwp71 and I had a chat on IRC and I checked in some fixes. |