Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a bounding sphere and a bounding box that should be intersecting, however, Intersects(...) is returning false. For example, the following returns false:

new BoundingSphere(new Vector3(500, 105, 0), 25).Intersects(
    new BoundingBox(new Vector3(466,219,0), new Vector3(519,26,0))
)
share|improve this question

1 Answer 1

up vote 7 down vote accepted

According to http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.boundingbox.boundingbox.aspx

The constructor of BoundingBox expects minimum and maximum points. Your second vector's y is less than your first vector's y. This might break the intersection test.

share|improve this answer
2  
No might about it. It will break it and that is the problem. Good answer. –  Steve H Jun 19 '13 at 23:14
    
True enough. That was it. A silly issue, and the one I haven't noticed because I still think of y as going towards the bottom. Thanks. –  Stonehead Jun 19 '13 at 23:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.