intersectsWithLine()

Previously I mentioned about the manipulators being successfully rendered in-front of everything else but then the problem came: visually it looks like it is in-front of the house, but technically it is still actually hidden inside the house model.

There are quite a lot of people helped me out with this issue, one of which telling me to set bitmask parameter in getSceneNodeFromRayBB() function but I’ve tried that and I don’t know why it doesn’t work, maybe I did something wrong with that method.

Then I tried the second option which is using

intersectsWithLine  ( const vector3d< T > &  linemiddle, const vector3d< T > &  linevect, T  halflength)   const [inline]

and that works out pretty well!

What I did was I manually cast a ray 2 times from the camera, which the first one detects the existence of the manipulators, and if it doesn’t, cast the second ray to detect existence of a 3d object which exists and is under the cursor.

This is surely mad, but you get the satisfaction when you have reached the goal.

Leave a Reply