realbasic-games
[Top] [All Lists]

Re: Bug? LineSegmentIntersection

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Bug? LineSegmentIntersection
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Thu, 22 Sep 2005 13:30:46 -0600
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <A62133C5-26E7-4F77-85C7-3CBD6D5AC3CA at miensoftware dot com> <a06200716bf573a7915d2 at [10 dot 0 dot 1 dot 4]> <cf5e37425c407f3b08607da02bda38f7 at mindspring dot com>
At 12:05 PM -0700 9/22/05, Jeff Quan wrote:

Instead of simplifying existing code, I decided to write an app from scratch in RB2005r3 to view the problem. Apologies for cutting non-2005 users out, as I wanted to use the trimesh functions to create a visual line. Here's a link to my code:
<http://www.geocities.com/jeffq_cnet/BoundsTest.zip>

You can move the line by passing your mouse over the RB3D space. Things get really wonky if you click the "Animate line" checkbox. In this case, I really hope I'm doing something wrong!

That's a neat app. It worked fine for me until I clicked Animate Line, which moves the other end of the line segment (the one that doesn't track the mouse). For me, when this end is higher than about Y=20 or so, then it starts acting as though the bounds radius is larger that it should be. The higher this end of the line, the more the collision radius grows.

Here's the code snippet I've been looking for:

  Dim v0 As New Vector3D(-200, 28, 0)
  Dim v1 As New Vector3D(  -70, 28, 0)
  Dim b As New Bounds3D( New Vector3D, 50)

  Dim result As Vector3D
  result = b.LineSegmentIntersection( v0, v1 )
  if result <> nil then
    MsgBox "WRONG! Found collision at " _
    + str(result.x) + "," + str(result.y) + "," + str(result.z) _
    + ", a distance of " + str(result.Length)
  end if

...which clearly demonstrates that it's finding a collision that is well outside the bounds radius. We'll look into this.

Thanks,
- Joe

--
Joe Strout                          REAL Software, Inc.

Vote for REALbasic (twice!) in the LinuxWorld Reader's Choice Awards:
http://linux.sys-con.com/general/readerschoice.htm
_______________________________________________
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>