summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Zinnschlag <marc@zpages.de>2016-12-19 15:28:49 +0100
committerMarc Zinnschlag <marc@zpages.de>2016-12-19 15:28:49 +0100
commit3c89b035681f66184c6b1fa71520cedb1759e059 (patch)
tree670efc768ce70224ae7d25d0343e46f33cdbc09f
parent9c56ecac770dd22e107917840f59777b437d7b48 (diff)
parentf2f0e9f1e71660d08bfc7df7509f7e3dc4faf246 (diff)
Merge remote-tracking branch 'origin/openmw-41' into openmw-41openmw-0.41.0
-rw-r--r--apps/openmw/mwphysics/physicssystem.cpp3
-rw-r--r--apps/openmw/mwrender/creatureanimation.cpp2
-rw-r--r--apps/openmw/mwrender/npcanimation.cpp2
-rw-r--r--components/sceneutil/skeleton.cpp12
-rw-r--r--components/sceneutil/skeleton.hpp6
5 files changed, 18 insertions, 7 deletions
diff --git a/apps/openmw/mwphysics/physicssystem.cpp b/apps/openmw/mwphysics/physicssystem.cpp
index fece18d20c..14bce06e3b 100644
--- a/apps/openmw/mwphysics/physicssystem.cpp
+++ b/apps/openmw/mwphysics/physicssystem.cpp
@@ -1349,7 +1349,8 @@ namespace MWPhysics
else if (physicActor->getCollisionMode() && canMoveToWaterSurface(iter->first, waterlevel))
{
const osg::Vec3f actorPosition = physicActor->getPosition();
- physicActor->setPosition(osg::Vec3f(actorPosition.x(), actorPosition.y(), waterlevel));
+ physicActor->setPosition(osg::Vec3f(actorPosition.x(), actorPosition.y(), waterlevel));
+ waterCollision = true;
}
}
physicActor->setCanWaterWalk(waterCollision);
diff --git a/apps/openmw/mwrender/creatureanimation.cpp b/apps/openmw/mwrender/creatureanimation.cpp
index a095d5dd42..36a0f4085a 100644
--- a/apps/openmw/mwrender/creatureanimation.cpp
+++ b/apps/openmw/mwrender/creatureanimation.cpp
@@ -110,8 +110,6 @@ void CreatureWeaponAnimation::updatePart(PartHolderPtr& scene, int slot)
osg::ref_ptr<osg::Node> node = mResourceSystem->getSceneManager()->getInstance(item.getClass().getModel(item));
osg::ref_ptr<osg::Node> attached = SceneUtil::attach(node, mObjectRoot, bonename, bonename);
mResourceSystem->getSceneManager()->notifyAttached(attached);
- if (mSkeleton)
- mSkeleton->markDirty();
scene.reset(new PartHolder(attached));
diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp
index d9dd1a89eb..53eaf0996d 100644
--- a/apps/openmw/mwrender/npcanimation.cpp
+++ b/apps/openmw/mwrender/npcanimation.cpp
@@ -671,8 +671,6 @@ PartHolderPtr NpcAnimation::insertBoundedPart(const std::string& model, const st
{
osg::ref_ptr<osg::Node> instance = mResourceSystem->getSceneManager()->getInstance(model);
osg::ref_ptr<osg::Node> attached = SceneUtil::attach(instance, mObjectRoot, bonefilter, bonename);
- if (mSkeleton)
- mSkeleton->markDirty();
mResourceSystem->getSceneManager()->notifyAttached(attached);
if (enchantedGlow)
addGlow(attached, *glowColor);
diff --git a/components/sceneutil/skeleton.cpp b/components/sceneutil/skeleton.cpp
index 390a8e8235..f3c2aef77e 100644
--- a/components/sceneutil/skeleton.cpp
+++ b/components/sceneutil/skeleton.cpp
@@ -148,6 +148,8 @@ void Skeleton::markDirty()
{
mTraversedEvenFrame = false;
mTraversedOddFrame = false;
+ mBoneCache.clear();
+ mBoneCacheInit = false;
}
void Skeleton::traverse(osg::NodeVisitor& nv)
@@ -160,6 +162,16 @@ void Skeleton::traverse(osg::NodeVisitor& nv)
osg::Group::traverse(nv);
}
+void Skeleton::childInserted(unsigned int)
+{
+ markDirty();
+}
+
+void Skeleton::childRemoved(unsigned int, unsigned int)
+{
+ markDirty();
+}
+
Bone::Bone()
: mNode(NULL)
{
diff --git a/components/sceneutil/skeleton.hpp b/components/sceneutil/skeleton.hpp
index 764b7f6459..24dcc6b3f4 100644
--- a/components/sceneutil/skeleton.hpp
+++ b/components/sceneutil/skeleton.hpp
@@ -53,10 +53,12 @@ namespace SceneUtil
bool getActive() const;
- /// If a new RigGeometry is added after the Skeleton has already been rendered, you must call markDirty().
+ void traverse(osg::NodeVisitor& nv);
+
void markDirty();
- void traverse(osg::NodeVisitor& nv);
+ virtual void childInserted(unsigned int);
+ virtual void childRemoved(unsigned int, unsigned int);
private:
// The root bone is not a "real" bone, it has no corresponding node in the scene graph.