Use the traversalNumber as frame number

openmw-38
scrawl 9 years ago
parent 52901ec10c
commit 21e25f4756

@ -100,14 +100,13 @@ namespace
virtual void traverse(osg::NodeVisitor& nv)
{
const osg::FrameStamp* stamp = nv.getFrameStamp();
if (!stamp || nv.getTraversalMode() != osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN)
if (nv.getTraversalMode() != osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN)
osg::Group::traverse(nv);
else
{
for (unsigned int i=0; i<getNumChildren(); ++i)
{
if (i%2 == stamp->getFrameNumber()%2)
if (i%2 == nv.getTraversalNumber()%2)
getChild(i)->accept(nv);
}
}
@ -182,9 +181,9 @@ namespace
if (!geom)
return false;
if (mLastFrameNumber == nv->getFrameStamp()->getFrameNumber())
if (mLastFrameNumber == nv->getTraversalNumber())
return false;
mLastFrameNumber = nv->getFrameStamp()->getFrameNumber();
mLastFrameNumber = nv->getTraversalNumber();
geom->transformSoftwareMethod();
return false;

@ -294,9 +294,9 @@ namespace SceneUtil
// update light list if necessary
// makes sure we don't update it more than once per frame when rendering with multiple cameras
if (mLastFrameNumber != nv->getFrameStamp()->getFrameNumber())
if (mLastFrameNumber != nv->getTraversalNumber())
{
mLastFrameNumber = nv->getFrameStamp()->getFrameNumber();
mLastFrameNumber = nv->getTraversalNumber();
// Don't use Camera::getViewMatrix, that one might be relative to another camera!
const osg::RefMatrix* viewMatrix = cv->getCurrentRenderStage()->getInitialViewMatrix();

@ -218,9 +218,9 @@ void RigGeometry::update(osg::NodeVisitor* nv)
if (!mSkeleton->getActive() && mLastFrameNumber != 0)
return;
if (mLastFrameNumber == nv->getFrameStamp()->getFrameNumber())
if (mLastFrameNumber == nv->getTraversalNumber())
return;
mLastFrameNumber = nv->getFrameStamp()->getFrameNumber();
mLastFrameNumber = nv->getTraversalNumber();
mSkeleton->updateBoneMatrices(nv);

@ -104,10 +104,10 @@ Bone* Skeleton::getBone(const std::string &name)
void Skeleton::updateBoneMatrices(osg::NodeVisitor* nv)
{
if (nv->getFrameStamp()->getFrameNumber() != mLastFrameNumber)
if (nv->getTraversalNumber() != mLastFrameNumber)
mNeedToUpdateBoneMatrices = true;
mLastFrameNumber = nv->getFrameStamp()->getFrameNumber();
mLastFrameNumber = nv->getTraversalNumber();
if (mNeedToUpdateBoneMatrices)
{

Loading…
Cancel
Save