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 just fixed a bug where rays starting and ending in an octree node were not detected as octree node hits (because the ray doesn't hit the sides).

I'm changing the code to check if a ray starts in the octree node, then it is an automatic node hit.

Any reason to not do this?

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

If your ray starts in an octree node, then it could, of course, hit something in that node. If you ignored the node in which the ray starts, you risk missing the closest hit.

So, no, there is no reason not to do it because you should do it.

share|improve this answer
add comment

That's exactly the way to do it, provided that's a leaf node. If not, you need to drill down to subsequent levels to raymarch there.

share|improve this answer
add comment

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.