Page 2 of 2

Posted: Fri Nov 21, 2008 9:15 am
by darkmaster83
B@z wrote:

Code: Select all

IAnimatedMeshSceneNode* RepairBoundingBox(IAnimatedMeshSceneNode* node)
{
	IAnimatedMesh * mesh = node->getMesh();
		
	aabbox3df box;
	for (u32 i = 0; i < mesh->getMeshBufferCount(); i++)
	{
		mesh->getMesh(1)->getMeshBuffer(i)->recalculateBoundingBox();
		box.addInternalBox(mesh->getMesh(1)->getMeshBuffer(i)->getBoundingBox());
	}
	mesh->setBoundingBox(box);
	node->setMesh(mesh);
	return node;
}
dont know it helps, i used it for make the bounding box equal to the first frame's bounding box.
try it maybe it'll solve your problem
Thank you anyway. :)
I'm sorry, I try to use this function in the game loop, after movement by skeletal animation, but the rendering is too slow (only 2-3 FPS) and using:

Code: Select all

ode->setDebugDataVisible(EDS_BBOX);
I don't see the updating of bounding boxes after the movement...maybe it's a limit of the Irrlicht's actual version...but I don't want to think it, because an animation system that doesn't update bounding boxes is totally useless for almost all applications...

Posted: Fri Nov 21, 2008 12:26 pm
by rogerborg
It's a known problem, and is on the list for fixing before 1.5 is cut. I think Luke has been hijacked into meatspace though, so anyone else who wants to investigate it and suggest solutions would be very welcome.

Posted: Fri Nov 21, 2008 12:51 pm
by B@z
darkmaster83: nono, dont call it in loop.
just when you create your node.

Code: Select all

mynode = smgr->addAnimatedMeshSceneNode(....);
..
mynode = RepairBoundingBox(IAnimatedMeshSceneNode* node);
...
//and use it
it only changes the bbox to the same as the first frames bbox. thats all

Posted: Fri Nov 21, 2008 11:22 pm
by rogerborg
SVN 1805 attempts to fix this. Feel free to let me know that it breaks all your apps.