Possible typo in btDbvt.cpp getmaxdepth()

jhurliman
Posts: 5
Joined: Thu Mar 25, 2010 8:03 am

Possible typo in btDbvt.cpp getmaxdepth()

Post by jhurliman »

btDbvt.cpp lines 63 and 64 in getmaxdepth() are identical in my checkout of the code.

Code: Select all

static void						getmaxdepth(const btDbvtNode* node,int depth,int& maxdepth)
{
	if(node->isinternal())
	{
		getmaxdepth(node->childs[0],depth+1,maxdepth);
		getmaxdepth(node->childs[0],depth+1,maxdepth);
	} else maxdepth=btMax(maxdepth,depth);
}
That should be node->childs[1] on the second line, correct?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Possible typo in btDbvt.cpp getmaxdepth()

Post by Erwin Coumans »

This is a bug indeed, fixed now in latest trunk: http://code.google.com/p/bullet/source/detail?r=2076

It seems 'maxdepth' isn't use in the code, is it?

Thanks,
Erwin
jhurliman
Posts: 5
Joined: Thu Mar 25, 2010 8:03 am

Re: Possible typo in btDbvt.cpp getmaxdepth()

Post by jhurliman »

No I don't think this feature is used in Bullet. I only noticed it when I was implementing my own dynamic AABB tree (in C#) based on the Bullet implementation.