|
|
Massimo Valentini wrote:
>
> This is a snippet from cones.cpp (lines ~ 220-235). In the second 'if'
> I think the second test should be .. && (t2 < Max_Distance). And the
> same typo is at line 291 in the same file.
>
I seems to agree with you, at least on the t1 vs t2 issue.
> The question concerns the divisions t1 / len and t2 /len. I think
> that you should test for the validity of the intersection after the
> division because otherwise you could discard some objects based on
> a 'transformed' distance rather the real one.
>
I do not see why there is a limitation at Max_Distance,
I would simply remove that part of the test (It looks like an old
optimisation: if it is enough away, remove it... it's bad, IMHO).
[...]
> An other one could be to avoid the normalization of the
> direction of the ray, it appears to me useless.
It is NOT useless. When CSG operation/object (union & merge, at least)
will ask its component, it will orders the intersections by depth order
before answering to the upper level. Thus, putting back the depth from
object space to global space is mandatory (otherwise, strange things
will happens).
Same goes when more than a single cone/cylinder get intersected by the
ray, the engine need to order them correctly, in the global space!
Post a reply to this message
|
|