realbasic-games
[Top] [All Lists]

Re: Bounds3D

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Bounds3D
From: Joseph Nastasi <joe at pyramiddesign dot us>
Date: Mon, 15 Aug 2005 12:20:27 -0400
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <0a64f2569014c15c578d5116b4d8e13b at pyramiddesign dot us> <a0620070dbf265db72822 at [10 dot 0 dot 1 dot 2]>

On Aug 15, 2005, at 10:59 AM, Joseph J. Strout wrote:

At 7:30 AM -0400 8/15/05, Joseph Nastasi wrote:

If I do the following:
        Self.Planet.Bounds = New Bounds3D(New Vector3D,6078137)

The value 6,078,137 should be the tripping point for this:
If Self.Model.Bounds.Intersects(Simulation.NaturalSystem.Planet.Bounds) Then

Correct?

Well, something close to that, yes. That's a pretty big number, and remember that these are stored internally in singles, not doubles. Also, of course, it depends on how big Self.Model.Bounds is.

Sorry, the actual number is 1/10th that:
        Self.Planet.Bounds = New Bounds3D(New Vector3D,607813)

After executing this, the Radius is correct.

What happens is the if statement is satisfied when Self.Model.Position.Y is at 639,114 <-- corrected number

Well, how big is your model?

Tiny, in comparison. But here's the odd thing. If I show the Bounds3D in the debugger, Center(!), Minimum and Maximum are all NIL. Radius is 20.22 and the Type is correctly set to 2, which _means_ we should be seeing Minimum and Maximum, not Radius (and center in all cases). So, if the values are truly NIL, then who knows what the Intersect is really doing?

Assume they are okay. The Model is at 0,0,0 with a Radius of 20.22. Planet.Position is at 0,-637989,0 and has a radius of 607813. Given this, it doesn't seem like the Intersect should have returned True. There should be 30156 of space between the two. (Planet.Position.Y - Planet.Bounds.Radius - Model.Bounds.Radius or 637989 - 607813 - 20) I know Bounds3D isn't extremely accurate, but this seems like a big gap to miss.


Also, there is a bug in 2005 (any version) where only the radius and center are displayed in the debugger, regardless of Bounds Type.
http://www.realsoftware.com/feedback/viewreport.php?reportid=vxznzqii

I doubt that's a bug. I don't have the code in front of me, but the debugger shows what properties are available; radius and center are properties, and yes, they're available regardless of the bounds type. The others are methods. (And yes, I realize that the docs may not accurately reflect which ones are methods and which are properties -- it groups things conceptually rather than how they appear in the debugger.)

Okay, except in the above example, Center is NIL as well.

Thanks for the help,
Joe
--
Joseph Nastasi
Pyramid Design - a software development firm
http://www.pyramiddesign.us
Voice 609 601-0814      Fax 609 601-0815
Products:
A-OK! Spacecraft Simulation System - http://aok.pyramiddesign.us
A-OK! The Wings of Mercury
FTP Suite for REALbasic - http://ftpsuite.pyramiddesign.us
Proud Sponsors of REALbasic Olympics 2005




_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>