[fixed]CTerrainSceneNode's BoundingBox

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Anthony
Posts: 121
Joined: Sun Jan 09, 2011 12:03 pm

[fixed]CTerrainSceneNode's BoundingBox

Post by Anthony »

Posted this 'FLT_MAX? isn't there something like F32_MAX' at the forum.

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)),
my directory search didn't give me more results then these two files when seaking for 99999
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.
No :shock: I am no noob, just checking if your not one too :roll:

Thanks to Niko and all others that made Irrlicht possible.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Anthony
Posts: 121
Joined: Sun Jan 09, 2011 12:03 pm

Post by Anthony »

Yeah that was smart of me 8)
No :shock: I am no noob, just checking if your not one too :roll:

Thanks to Niko and all others that made Irrlicht possible.
Post Reply