Removed the unused debug header as it was causing building compile problems with the Debug build under Windows

This commit is contained in:
Robert Osfield
2016-10-05 14:00:46 +01:00
parent 70e931fda2
commit 0fab759c1b
2 changed files with 0 additions and 47 deletions

View File

@@ -20,7 +20,6 @@ SET(TARGET_H
AABBonBoneVisitor
AnimationCleanerVisitor
BindPerVertexVisitor
debug
DetachPrimitiveVisitor
DisableAnimationVisitor
DrawArrayVisitor

View File

@@ -1,46 +0,0 @@
#include <osgDB/ReaderWriter>
#include <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include <osgDB/Registry>
#include <osgDB/FileUtils>
#include <osgDB/FileNameUtils>
#include <fstream>
#include <sstream>
inline void save_debug(osg::Node& node, const std::string& path) {
osg::ref_ptr<osgDB::Registry> registry = osgDB::Registry::instance();
std::string ext = osgDB::getLowerCaseFileExtension(path);
osgDB::ReaderWriter* writer = registry->getReaderWriterForExtension(ext);
if(writer) {
writer->writeNode(node, path.c_str());
}
}
inline void save_debug(osg::Geometry& geometry, const std::string& path) {
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
geode->addDrawable(&geometry);
save_debug(*geode, path);
}
template<typename VV>
std::string dump(const VV& v) {
std::ostringstream oss;
oss << "(" << v[0];
for(int i = 1 ; i < VV::num_components ; ++ i) {
oss << ", " << v[i];
}
oss << ")";
return oss.str();
}
template<typename VV>
float length(const VV& v) {
float l = 0;
for(int i = 0 ; i < VV::num_components ; ++ i) {
l += v[i] * v[i];
}
return std::sqrt(l);
}