diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index b49beea0b..75f6756f8 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -39,7 +39,7 @@ add_component_dir (resource ) add_component_dir (sceneutil - clone attach lightmanager visitor util statesetupdater controller + clone attach lightmanager visitor util statesetupdater controller skeleton riggeometry ) add_component_dir (nif @@ -47,7 +47,7 @@ add_component_dir (nif ) add_component_dir (nifosg - nifloader controller particle userdata skeleton riggeometry + nifloader controller particle userdata ) #add_component_dir (nifcache diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index eb78a0632..301c487da 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -41,11 +41,11 @@ #include #include +#include +#include #include "particle.hpp" #include "userdata.hpp" -#include "skeleton.hpp" -#include "riggeometry.hpp" namespace { @@ -279,7 +279,7 @@ namespace for (osg::NodePath::iterator it = path.begin(); it != path.end(); ++it) { - if (dynamic_cast(*it)) + if (dynamic_cast(*it)) { path.erase(path.begin(), it+1); // the bone's transform in skeleton space @@ -535,7 +535,7 @@ namespace NifOsg osg::ref_ptr textkeys (new TextKeyMapHolder); - osg::ref_ptr skel = new Skeleton; + osg::ref_ptr skel = new SceneUtil::Skeleton; handleNode(nifNode, skel, textureManager, true, std::map(), 0, 0, false, &textkeys->mTextKeys); skel->getOrCreateUserDataContainer()->addUserObject(textkeys); @@ -1168,13 +1168,13 @@ namespace NifOsg osg::ref_ptr geometry (new osg::Geometry); triShapeToGeometry(triShape, geometry, geode, boundTextures, animflags); - osg::ref_ptr rig(new RigGeometry); + osg::ref_ptr rig(new SceneUtil::RigGeometry); rig->setSourceGeometry(geometry); const Nif::NiSkinInstance *skin = triShape->skin.getPtr(); // Assign bone weights - osg::ref_ptr map (new RigGeometry::InfluenceMap); + osg::ref_ptr map (new SceneUtil::RigGeometry::InfluenceMap); const Nif::NiSkinData *data = skin->data.getPtr(); const Nif::NodeList &bones = skin->bones; @@ -1182,7 +1182,7 @@ namespace NifOsg { std::string boneName = bones[i].getPtr()->name; - RigGeometry::BoneInfluence influence; + SceneUtil::RigGeometry::BoneInfluence influence; const std::vector &weights = data->bones[i].weights; //influence.mWeights.reserve(weights.size()); for(size_t j = 0;j < weights.size();j++) diff --git a/components/sceneutil/attach.cpp b/components/sceneutil/attach.cpp index b88bddc8d..9f9d63619 100644 --- a/components/sceneutil/attach.cpp +++ b/components/sceneutil/attach.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include "visitor.hpp" @@ -47,7 +47,7 @@ namespace SceneUtil osg::ref_ptr attach(osg::ref_ptr toAttach, osg::Node *master, const std::string &filter, const std::string &attachNode) { - if (dynamic_cast(toAttach.get())) + if (dynamic_cast(toAttach.get())) { osg::ref_ptr handle = new osg::Group; diff --git a/components/nifosg/riggeometry.cpp b/components/sceneutil/riggeometry.cpp similarity index 99% rename from components/nifosg/riggeometry.cpp rename to components/sceneutil/riggeometry.cpp index 0217a7ac0..00f80c829 100644 --- a/components/nifosg/riggeometry.cpp +++ b/components/sceneutil/riggeometry.cpp @@ -11,7 +11,7 @@ #include -namespace NifOsg +namespace SceneUtil { // TODO: make threadsafe for multiple cull threads diff --git a/components/nifosg/riggeometry.hpp b/components/sceneutil/riggeometry.hpp similarity index 98% rename from components/nifosg/riggeometry.hpp rename to components/sceneutil/riggeometry.hpp index 7c8ea83bc..e99bc757e 100644 --- a/components/nifosg/riggeometry.hpp +++ b/components/sceneutil/riggeometry.hpp @@ -4,7 +4,7 @@ #include #include -namespace NifOsg +namespace SceneUtil { class Skeleton; diff --git a/components/nifosg/skeleton.cpp b/components/sceneutil/skeleton.cpp similarity index 99% rename from components/nifosg/skeleton.cpp rename to components/sceneutil/skeleton.cpp index b9d113d34..c1ab36136 100644 --- a/components/nifosg/skeleton.cpp +++ b/components/sceneutil/skeleton.cpp @@ -5,7 +5,7 @@ #include -namespace NifOsg +namespace SceneUtil { class InitBoneCacheVisitor : public osg::NodeVisitor diff --git a/components/nifosg/skeleton.hpp b/components/sceneutil/skeleton.hpp similarity index 98% rename from components/nifosg/skeleton.hpp rename to components/sceneutil/skeleton.hpp index 5344f9f5d..c241844f1 100644 --- a/components/nifosg/skeleton.hpp +++ b/components/sceneutil/skeleton.hpp @@ -5,7 +5,7 @@ #include -namespace NifOsg +namespace SceneUtil { // Defines a Bone hierarchy, used for updating of skeleton-space bone matrices.