I thought, it's a calculation problem of my own code.
After some tests I found out that the problem is Ogre related.
My test results:
- Vertical rays always return the correct result.
- Non-vertical rays often return wrong values.
Code: Select all
position = rayOrigin + rayDirection * distance_of_rayQueryResultEntity
Even when the ray origin is close to the terrain surface, the incorrectness of the returned distance is huge. But only if the ray is not vertical.
This behaviour is very bad for my simulation application, because I need more precision than +/-1 Ogre Unit.
Here is an image which shows different rays and "detected" positions (red pixels).
Click image for full size. Has anybody an idea what's the problem?
Great would be a bugfix. (Although I think nearly nobody is interested in improving the dropped Terrain Scene Manager.)
On the other hand:
If the problem is also related to ray queries with other terrain systems, then it would be important for many other Ogre users, too.