Fix skinning bug

c++11
scrawl 10 years ago
parent 5b8c28f641
commit c334a76a6f

@ -546,12 +546,10 @@ void SkyManager::create()
mCloudNode->accept(modClouds);
mCloudUpdater = new CloudUpdater;
//mCloudNode->addUpdateCallback(mCloudUpdater);
mCloudNode->addUpdateCallback(mCloudUpdater);
mCloudNode->getOrCreateStateSet()->setAttributeAndModes(createAlphaTrackingUnlitMaterial(), osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);
mCloudNode->setNodeMask(0);
osg::ref_ptr<osg::Depth> depth = new osg::Depth;
depth->setWriteMask(false);
mRootNode->getOrCreateStateSet()->setAttributeAndModes(depth, osg::StateAttribute::ON);
@ -568,8 +566,7 @@ SkyManager::~SkyManager()
int SkyManager::getMasserPhase() const
{
if (!mCreated) return 0;
return 0;
//return mMasser->getPhaseInt();
return mMasser->getPhaseInt();
}
int SkyManager::getSecundaPhase() const

@ -222,21 +222,12 @@ namespace
// Callback method called by the NodeVisitor when visiting a node.
void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
if (nv && nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
{
osgAnimation::Bone* b = dynamic_cast<osgAnimation::Bone*>(node);
if (!b)
{
OSG_WARN << "Warning: UpdateBone set on non-Bone object." << std::endl;
return;
}
osgAnimation::Bone* parent = b->getBoneParent();
if (parent)
b->setMatrixInSkeletonSpace(b->getMatrixInBoneSpace() * parent->getMatrixInSkeletonSpace());
else
b->setMatrixInSkeletonSpace(b->getMatrixInBoneSpace());
}
osgAnimation::Bone* b = static_cast<osgAnimation::Bone*>(node);
osgAnimation::Bone* parent = b->getBoneParent();
if (parent)
b->setMatrixInSkeletonSpace(b->getMatrixInBoneSpace() * parent->getMatrixInSkeletonSpace());
else
b->setMatrixInSkeletonSpace(b->getMatrixInBoneSpace());
traverse(node,nv);
}
};

@ -96,6 +96,7 @@ namespace SceneUtil
bone->addUpdateCallback(old);
}
}
traverse(node);
}
private:

Loading…
Cancel
Save