Did not find a bug but just an issue I am not certain of and maybe someone should take a look it it someday.
When looking at the code of the CTerrainSceneNode I saw the some vector3dfs are initialized to +-99999.9f.
Then I think about to get a better precision with float you use something like gameUnits = 100.f;
Code: Select all
PSEUDO:
Vertices.set_used(2)
Vertices[ 0 ].Pos = vector3df( 1001.0f, 200.0f, 500.0f )
Vertices[ 1 ].Pos = vector3df( -1100.0f, -2000.0f, -199.0f )
recalculateBoundingBox();
result:
BoundingBox = min ( 999.999f, 200.0f, 500.0 ) max ( -999.999f, -999.999f, 199.0f )
As 99999.9f / gameUnits = 999.999f
Code: Select all
line:
CTerrainSceneNode.h
244:and
253: BoundingBox(core::aabbox3df( 99999.9f, 99999.9f, 99999.9f, -99999.9f, -99999.9f, -99999.9f)),
CTerrainSceneNode.cpp
41: OldCameraPosition(core::vector3df(-99999.9f, -99999.9f, -99999.9f)),
42: OldCameraRotation(core::vector3df(-99999.9f, -99999.9f, -99999.9f)),
43: OldCameraUp(core::vector3df(-99999.9f, -99999.9f, -99999.9f)),
bitplane:
Unless grep fails me CTerrainSceneNode is the only place that uses a magic number instead of FLT_MAX. I guess either nobody has spotted this, or FLT_MAX will break things due to the lack of precision or overflows up there.
I suggest opening a bug on the tracker so this complaint gets investigated at some point in the future, rather than being buried here on the forums.