Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

Do I Have To Normalize The Direction Vector For D3Dxboxboundprobe?

This topic is 788 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Do I need to normalize the direction vector for this function called D3DXBoxBoundProbe?

 

Update:

After looking in the MSDN, it says it doesn't need to...

https://msdn.microsoft.com/en-us/library/windows/desktop/bb172713(v=vs.85).aspx

 

Update2:

When I was iterating all the bounding boxes in my octree, there are several simultaneous hits by the same ray.

How do I pick the bounding box that is closest to the pivot?

 

Thanks

Jack

bHit = D3DXBoxBoundProbe(&vMin, &vMax, &this->getRelPivot(), &D3DXVECTOR3(-1, -1, 1));
Edited by lucky6969b

Share this post


Link to post
Share on other sites
Advertisement

Update2: When I was iterating all the bounding boxes in my octree, there are several simultaneous hits by the same ray. How do I pick the bounding box that is closest to the pivot?

 

You will probably get much better responses to this question if you post it as a separate topic. 

 

You could store a list of all the boxes that the ray hits, and choose whichever has the shortest distance between the ray's source and the box' centre. If you are doing this hierachially, which I assume you are since it's an octree, then I think the most hits you can get is 3 but don't take my word on that as I am getting very confused trying to work it out in my head. Easiest option would probably be to store only the 'closest so far'.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!