Submitted with fixes by Julian Valentin

This commit is contained in:
Cedric Pinson
2016-06-25 07:49:56 +01:00
committed by Robert Osfield
parent 295da33cdf
commit 0ecb52ff82
26 changed files with 298 additions and 189 deletions

View File

@@ -24,7 +24,7 @@ osg::BoundingBox RigComputeBoundingBoxCallback::computeBound(const osg::Drawable
{
const osgAnimation::RigGeometry& rig = dynamic_cast<const osgAnimation::RigGeometry&>(drawable);
// if a valid initial bounding box is set we use it without asking more
// if a valid inital bounding box is set we use it without asking more
if (rig.getInitialBound().valid())
return rig.getInitialBound();
@@ -32,7 +32,7 @@ osg::BoundingBox RigComputeBoundingBoxCallback::computeBound(const osg::Drawable
return _boundingBox;
// if the computing of bb is invalid (like no geometry inside)
// then don't tag the bounding box as computed
// then dont tag the bounding box as computed
osg::BoundingBox bb = rig.computeBoundingBox();
if (!bb.valid())
return bb;
@@ -58,8 +58,7 @@ RigGeometry::RigGeometry()
_needToComputeMatrix = true;
_matrixFromSkeletonToGeometry = _invMatrixFromSkeletonToGeometry = osg::Matrix::identity();
// disable the computation of boundingbox for the rig mesh
setComputeBoundingBoxCallback(new RigComputeBoundingBoxCallback);
}
@@ -70,8 +69,8 @@ RigGeometry::RigGeometry(const RigGeometry& b, const osg::CopyOp& copyop) :
_vertexInfluenceMap(b._vertexInfluenceMap),
_needToComputeMatrix(b._needToComputeMatrix)
{
// we don't copy the RigImplementation yet. because the RigImplementation need to be initialized in a valid graph, with a skeleton ...
// don't know yet what to do with a clone of a RigGeometry
// we dont copy the RigImplementation yet. because the RigImplementation need to be initialized in a valid graph, with a skeleton ...
// dont know yet what to do with a clone of a RigGeometry
}
@@ -113,7 +112,9 @@ void RigGeometry::computeMatrixFromRootSkeleton()
osg::Matrix notRoot = _root->getMatrix();
_matrixFromSkeletonToGeometry = mtxList[0] * osg::Matrix::inverse(notRoot);
_invMatrixFromSkeletonToGeometry = osg::Matrix::inverse(_matrixFromSkeletonToGeometry);
_needToComputeMatrix = false;
_needToComputeMatrix = false;
// disable the computation of boundingbox for the rig mesh
setComputeBoundingBoxCallback(new RigComputeBoundingBoxCallback);
}
void RigGeometry::update()