From Paul Martz, fixes for static build
This commit is contained in:
@@ -1196,7 +1196,7 @@ osgDB::ReaderWriter::WriteResult ReaderWriter3DS::doWriteNode(const osg::Node& n
|
||||
|
||||
bool ReaderWriter3DS::createFileObject(const osg::Node& node, Lib3dsFile * file3ds,const std::string& fileName, const osgDB::ReaderWriter::Options* options) const
|
||||
{
|
||||
WriterNodeVisitor w(file3ds, fileName, options, osgDB::getFilePath(node.getName()));
|
||||
plugin3ds::WriterNodeVisitor w(file3ds, fileName, options, osgDB::getFilePath(node.getName()));
|
||||
const_cast<osg::Node &>(node).accept(w); // Ugly const_cast<> for visitor...
|
||||
if (!w.succeeded()) return false;
|
||||
w.writeMaterials();
|
||||
|
||||
@@ -126,6 +126,11 @@ bool is3DSpath(const std::string & s, bool extendedFilePaths)
|
||||
}
|
||||
|
||||
|
||||
// Use namespace qualification to avoid static-link symbol collitions
|
||||
// from multiply defined symbols.
|
||||
namespace plugin3ds
|
||||
{
|
||||
|
||||
|
||||
/** writes all primitives of a primitive-set out to a stream, decomposes quads to triangles, line-strips to lines etc */
|
||||
class PrimitiveIndexWriter : public osg::PrimitiveIndexFunctor
|
||||
@@ -1055,3 +1060,6 @@ void WriterNodeVisitor::apply3DSMatrixNode(osg::Node &node, const osg::Matrix *
|
||||
lib3ds_file_append_node(file3ds, reinterpret_cast<Lib3dsNode*>(node3ds), reinterpret_cast<Lib3dsNode*>(parent));
|
||||
_cur3dsNode = node3ds;
|
||||
}
|
||||
|
||||
// end namespace plugin3ds
|
||||
}
|
||||
|
||||
@@ -48,6 +48,9 @@ void copyOsgMatrixToLib3dsMatrix(Lib3dsMatrix lib3ds_matrix, const osg::Matrix&
|
||||
typedef std::map<std::pair<unsigned int, unsigned int>, unsigned int> MapIndices;
|
||||
typedef std::vector<std::pair<Triangle, int> > ListTriangle; //the int is the drawable of the triangle
|
||||
|
||||
namespace plugin3ds
|
||||
{
|
||||
|
||||
class WriterNodeVisitor: public osg::NodeVisitor
|
||||
{
|
||||
public:
|
||||
@@ -213,4 +216,7 @@ class WriterNodeVisitor: public osg::NodeVisitor
|
||||
std::set<osg::Image *> _imageSet;
|
||||
};
|
||||
|
||||
// end namespace plugin3ds
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -424,7 +424,7 @@ osgDB::ReaderWriter::WriteResult ReaderWriterFBX::writeNode(
|
||||
}
|
||||
|
||||
KFbxScene* pScene = KFbxScene::Create(pSdkManager, "");
|
||||
WriterNodeVisitor writerNodeVisitor(pScene, pSdkManager, filename,
|
||||
pluginfbx::WriterNodeVisitor writerNodeVisitor(pScene, pSdkManager, filename,
|
||||
options, osgDB::getFilePath(node.getName().empty() ? filename : node.getName()));
|
||||
if (useFbxRoot && isBasicRootNode(node))
|
||||
{
|
||||
|
||||
@@ -25,6 +25,13 @@
|
||||
#include "WriterNodeVisitor.h"
|
||||
#include <limits.h>
|
||||
|
||||
|
||||
// Use namespace qualification to avoid static-link symbol collitions
|
||||
// from multiply defined symbols.
|
||||
namespace pluginfbx
|
||||
{
|
||||
|
||||
|
||||
/** writes all primitives of a primitive-set out to a stream, decomposes quads to triangles, line-strips to lines etc */
|
||||
class PrimitiveIndexWriter : public osg::PrimitiveIndexFunctor
|
||||
{
|
||||
@@ -782,3 +789,6 @@ void WriterNodeVisitor::apply(osg::MatrixTransform& node)
|
||||
traverse(node);
|
||||
_curFbxNode = parent;
|
||||
}
|
||||
|
||||
// end namespace pluginfbx
|
||||
}
|
||||
|
||||
@@ -59,6 +59,8 @@ struct VertexIndex
|
||||
typedef std::vector<std::pair<Triangle, int> > ListTriangle; //the int is the drawable of the triangle
|
||||
typedef std::map<VertexIndex, unsigned int> MapIndices; ///< Map OSG indices to FBX mesh indices
|
||||
|
||||
namespace pluginfbx
|
||||
{
|
||||
|
||||
///\author Capo (Thibault Caporal), Sukender (Benoit Neil)
|
||||
class WriterNodeVisitor: public osg::NodeVisitor
|
||||
@@ -261,4 +263,7 @@ class WriterNodeVisitor: public osg::NodeVisitor
|
||||
const std::string _srcDirectory;
|
||||
};
|
||||
|
||||
// end namespace pluginfbx
|
||||
}
|
||||
|
||||
#endif // _FBX_WRITER_NODE_VISITOR_HEADER__
|
||||
|
||||
Reference in New Issue
Block a user