.X animation file from 3d Studio 9 Bounding box problem

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
cuatro
Posts: 11
Joined: Tue May 08, 2007 2:29 am

.X animation file from 3d Studio 9 Bounding box problem

Post by cuatro »

with my newly created model with some basic auto-key generated animation every thing is showing up just fine and animating properly in irrlicht. however when i am doing my picking of this object the bounding box of the animation object is set to (0,0,0) which means its impossible to use getSceneNodeFromScreenCoordinatesBB() to select this object.

now if i remove the animation its has no problem picking the object with getSceneNodeFromScreenCoordinatesBB its only when there is animation data in the .X file.

ive done a quick fix in my build of irrlicht in

CXAnimationPlayer::updateBoundingBoxFromAnimation() by pretty much commenting out the entire method except for 1 line. like so:

Code: Select all

void CXAnimationPlayer::updateBoundingBoxFromAnimation()
{
//	if (!Joints.size())
//		return;

//	bool first = true;

//	for (u32 i=0; i<Joints.size(); ++i)
// I think there should be two vectors from aabbox of each joint should
// be used instead of just (0,0,0)
//		if (!Joints[i].Weights.empty())
/*		{
			core::vector3df p(0,0,0);
			Joints[i].AnimatedMatrix.transformVect(p);

			if (first)
				Box.reset(p);
			else
				Box.addInternalPoint(p);

			first = false;
		}
*/
	AnimatedMesh->BoundingBox = Box;
}

and it works like i want it to. is there something i am missing here? like if i have more advanced animation this will end up hurting me by causing some crazy behavior?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

This is an open issue, so I'll move this thread to bug forum. However, your solution does also not work because the bounding box changes due to animation. This is obviously not reflected anymore by your code.
cuatro
Posts: 11
Joined: Tue May 08, 2007 2:29 am

Post by cuatro »

thanks hybrid.

i figured my solution would not work for that reason, but my models and animations are so basic and simple it works for me until the issue is resolved. :lol:
Post Reply