Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / dbObjectPositionX Returns NAN (not a number) ?!?

Author
Message
Grayvyn
16
Years of Service
User Offline
Joined: 30th Oct 2008
Location: Southern California
Posted: 11th Mar 2009 23:23
What would cause dbObjectPositionX (and Y and Z alts) to return a NAN (not a number) value?

Here is some basic code...



The code works fine until I load another object to the scene. Then it returns NAN for about 8 Sync() calls then it starts to return valid numbers.

A work around I am using is the _isnan() function.
Sorry I can't post the real code. It jumps a lot and is network event driven so who knows what order functions get called. I am just really interested in what condition might cause this then I can look at my code and see where I am triggering the effect.

Thanks!

HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th Mar 2009 10:41
in Daarkbasic this command only returns a integer not a float, does that help.

Dark Physics makes any hot drink go cold.
Grayvyn
16
Years of Service
User Offline
Joined: 30th Oct 2008
Location: Southern California
Posted: 12th Mar 2009 18:18
@HowDo
In the GDK, it returns a float. One of the special representative cases for a float is NAN. The GDK doc doesn't say anything about return value ever being NAN. I think the TGC Developers are the only ones that can answer this question but *shrugs*.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Mar 2009 19:12
I'd suggest that you check your own code for buffer overflows or use of dangling pointers - if this was a standard occurrence, you would not have been the first to mention it as a problem, and we would also be seeing it in DBPro.

Login to post a reply

Server time is: 2024-11-25 17:31:58
Your offset time is: 2024-11-25 17:31:58