Geometry.BoxBoundProbe not working as intended?

Hi,

yesterday I was writing the collision detection code, and I had a really pain, figuring why the code:

Geometry.BoxBoundProbe(BoundingMin, BoundingMax, Position, Direction);

isn't the same as:

if(BoundingMin.X<(Position.X + Direction.X) && (Position.X + Direction.X)<BoundingMax.X)
   if(BoundingMin.Y<(Position.Y + Direction.Y) && (Position.Y + Direction.Y)<BoundingMax.Y)
      if(BoundingMin.Z<(Position.Z + Direction.Z) && (Position.Z + Direction.Z)<BoundingMax.Z)
         return(true);

return(false);

I tought so... actually I use the above function, but if I could use the Geometry class, i'll be happy.

I'm using the Apr 2005 Dx9 SDK.



Answer this question

Geometry.BoxBoundProbe not working as intended?

  • adepumadhu

    Is there a reason you haven't updated to the latest SDK   Generally speaking, that's the first question we're going to ask you Smile

    You can always find the latest SDK at http://msdn.com/directx/sdk

  • Flopik

    Because your function is computing if the point in space (Position+Direction) is contained within the bounding box.

    BoxBoundProbe computes if a ray with a certain direction, that passes through a position intersects with the box. The documentation isn't specific enough so I don't know if its an infinite ray through that point or a ray that starts at Position and ends at Position+direction.


  • Ed Lorenz

    I'm using Windows 2000, and the latest SDK (jun) refuse to install on my system. That's why I keep running on the April release.

    ZMan: I find generally the D3DX documentation a bit unclear. Sometimes, it is a real pain to figure out what each parameter does...

  • epepping

    Yes, it is an infinite ray starting at the given position with the given direction.  (You normally should transform this ray to object space for collision detection.)

    -Juan

  • Geometry.BoxBoundProbe not working as intended?