Skeleton and Bone BoundingBox

Interesting discovery. The Min or Max coordinates of a node/bone WSBoundingBox can extend beyond the relative Min or Max of the skeleton's WSBoundingBox that the node exists in.

ie. DzNode.getWSBoundingBox().getMin().m_y < DzSkeleton.getWSBoundingBox().getMin().m_y where DzNode is in DzSkeleton e.g. lFoot is in Genesis2

I can understand it for oriented box but not for axis aligned.

That has to be a fault.

 

Comments

  • rbtwhizrbtwhiz Posts: 2,178
    edited October 2018

    If a DzSkeleton has geometry, the WSBoundingBox for that node will be the bounding box for the used vertices of the geometry on that node; it is a node regardless of whether or not it has bones. If a DzSkeleton does not have geometry, the WSBoundingBox of that node is built from the WSBoundingBox of its bones; which may or may not have geometry of their own (not likely since 4.0.2.55, but possible). To get the WSBoundingBox of a DzSkeleton with geometry that includes the WSBoundingBoxes of its bones, you can use something like the following:

    inline DzBox3 calcWSSkeletonBoundingBox( DzSkeleton* skeleton ) const{	if ( !skeleton )	{		return DzBox3();	}	DzBox3 bbox = skeleton-&gt;getWSBoundingBox();	DzBoneList bones;	skeleton-&gt;getAllBones( bones );	for ( int i = 0, n = bones.count(); i &lt; n; i++ )	{		bbox.include( bones[i]-&gt;getWSBoundingBox() );	}	return bbox;}

     

    -Rob

    Post edited by rbtwhiz on
  • surrealsurreal Posts: 155

    Thank you Rob for the explaination.

    So I must have been looking at a skeleton that has geometry.

    As I need the skeleton's boundingbox which includes its geometry and all its bones, I will need to modify my code as you recommend.

Sign In or Register to comment.