[fixed]release mode error

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
dehseth
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am
Contact:

[fixed]release mode error

Post by dehseth »

I have a piece of code which works totally fine at Debug mode:

Code: Select all

scene::IMeshBuffer* m = m_mesh->getMeshBuffer(0);
	core::aabbox3df box = m->getBoundingBox();
	m_node->getAbsoluteTransformation().transformBoxEx(box);
	
	if (ball->GetNode()->getTransformedBoundingBox().isFullInside(box))
	{
		return true;
	}

	return false;
but the same project (and this part of code) fails on Release mode! It returns true while I see, the first bounding box is not inside of the second one, with my eyes.....

is there any known error about this?
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Unitialized values?
dehseth
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am
Contact:

Post by dehseth »

well no there isn't any uninitialized values. like I said, I draw and see two bounding boxes, and it just does not work properly...

-----------------------------------------------------------------------

I just find out in debug mode this function also does not work also... Well I guess this function needs to be fixed
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

what's the reason why you check a bounding box of a mesh (that always is at position 0,0,0) against an absolute bb of a node ??? :shock:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
dehseth
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am
Contact:

Post by dehseth »

I need to know that my first (constant) bounding box encapsulates the second one. If it's true that means the ball (second bb) is in right place where user wins level, if not keep playing...

The function "getTransformedBoundingBox" returns the tranformed position of boundng box right (which is not (0,0,0)) ?

Also the function works till some point, and suddenly it fails and I just cannot figure that out.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Sorry, but that is not enough information to reproduce the problem, so we can't really help you (uninitialized values is just the best guess as it's probably the most common reason for this sort of bug, but can really be any kind of memory problem like wrong sized arrays, etc).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
dehseth
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am
Contact:

Post by dehseth »

Ok I guess you need to consider this guys... In debug mode everything works just fine but in release mode there's a problem about "isFullInside" function.

This is my function :

Code: Select all

bool CLevel::IsSuccess(CBall* ball)
{
	scene::IMeshBuffer* m = m_mesh->getMeshBuffer(m_finishMeshNumber);
	core::aabbox3df box = m->getBoundingBox();
	m_node->getAbsoluteTransformation().transformBoxEx(box);
	
	if (ball->GetNode()->getTransformedBoundingBox().isFullInside(box))
	{
#define _DEBUG
#ifdef _DEBUG
		char m[250];
		core::aabbox3df ballBox = ball->GetNode()->getTransformedBoundingBox();
		sprintf(m, "BOX min[%.2f, %.2f, %.2f] max[%.2f, %.2f, %.2f]  BALL min[%.2f, %.2f, %.2f] max[%.2f, %.2f, %.2f] \n", 
				box.MinEdge.X, box.MinEdge.Y, box.MinEdge.Z, box.MaxEdge.X, box.MaxEdge.Y, box.MaxEdge.Z,
				ballBox.MinEdge.X, ballBox.MinEdge.Y, ballBox.MinEdge.Z, ballBox.MaxEdge.X, ballBox.MaxEdge.Y, ballBox.MaxEdge.Z);
		OutputDebugStringA(m);
#endif

		return true;
	}

	return false;
}
And this is what I see in debug output window:

BOX min[-0.44, -2.21, 10.76] max[3.41, 1.72, 14.45] BALL min[1.30, 2.50, -12.50] max[2.30, 3.50, -11.50]
BOX min[-0.44, -2.21, 10.76] max[3.41, 1.72, 14.45] BALL min[1.30, 2.43, -12.50] max[2.30, 3.43, -11.50]
BOX min[-0.44, -2.21, 10.76] max[3.41, 1.72, 14.45] BALL min[1.30, 2.39, -12.50] max[2.30, 3.39, -11.50]
BOX min[-0.44, -2.21, 10.76] max[3.41, 1.72, 14.45] BALL min[1.30, 2.31, -12.50] max[2.30, 3.31, -11.50]
BOX min[-0.44, -2.21, 10.76] max[3.41, 1.72, 14.45] BALL min[1.30, 2.24, -12.50] max[2.30, 3.24, -11.50]
BOX min[-0.44, -2.21, 10.76] max[3.41, 1.72, 14.45] BALL min[1.30, 2.16, -12.50] max[2.30, 3.19, -11.48]


As you can see the ball's box is not inside the bigger box (notice Z vector's sign) What do you think about this guys?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Are you still using Irrlicht 1.7? This looks like the bug which was the reason for the 1.7.1 release. If you are not sure - check if this patch is applied in your version: http://irrlicht.svn.sourceforge.net/vie ... 05&r2=3202 (right side is the newer version).

To fix - update to 1.7.1.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
dehseth
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am
Contact:

Post by dehseth »

ummm :oops: I was using a different irrlicht library while compiling in Release mode... I changed it to latest version and it works just fine. Sorry guys... :roll:
Post Reply