Merge pull request #2001 from AnyOldName3/enable-osg-logging

Allow OSG objects to be sent to the debug log.
pull/541/head
AnyOldName3 6 years ago committed by GitHub
commit 0208cb8616
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,7 +3,6 @@
#include <components/bullethelpers/operators.hpp>
#include <components/detournavigator/debug.hpp>
#include <components/osghelpers/operators.hpp>
#include <deque>
#include <iomanip>

@ -115,17 +115,6 @@ static std::ostream& operator <<(std::ostream& stream, const btCollisionShape* v
return value ? stream << "&" << *value : stream << "nullptr";
}
namespace osg
{
static std::ostream& operator <<(std::ostream& stream, const Vec3f& value)
{
return stream << "osg::Vec3f {"
<< value.x() << ", "
<< value.y() << ", "
<< value.z() << "}";
}
}
namespace std
{
static std::ostream& operator <<(std::ostream& stream, const map<int, int>& value)
@ -153,7 +142,7 @@ namespace Resource
return stream << "Resource::BulletShape {"
<< value.mCollisionShape << ", "
<< value.mAvoidCollisionShape << ", "
<< value.mCollisionBoxHalfExtents << ", "
<< "osg::Vec3f {" << value.mCollisionBoxHalfExtents << "}" << ", "
<< value.mAnimatedShapes
<< "}";
}

@ -4,6 +4,8 @@
#include <mutex>
#include <iostream>
#include <osg/io_utils>
namespace Debug
{
enum Level

@ -3,9 +3,10 @@
#include "tilebounds.hpp"
#include <osg/io_utils>
#include <components/bullethelpers/operators.hpp>
#include <components/misc/guarded.hpp>
#include <components/osghelpers/operators.hpp>
#include <chrono>
#include <fstream>

@ -1,35 +0,0 @@
#ifndef OPENMW_COMPONENTS_OSGHELPERS_OPERATORS_H
#define OPENMW_COMPONENTS_OSGHELPERS_OPERATORS_H
#include <iomanip>
#include <limits>
#include <ostream>
#include <osg/Vec2i>
#include <osg/Vec2f>
#include <osg/Vec3f>
namespace osg
{
inline std::ostream& operator <<(std::ostream& stream, const Vec2i& value)
{
return stream << "osg::Vec2i(" << value.x() << ", " << value.y() << ")";
}
inline std::ostream& operator <<(std::ostream& stream, const Vec2f& value)
{
return stream << "osg::Vec2f(" << std::setprecision(std::numeric_limits<float>::max_exponent10) << value.x()
<< ", " << std::setprecision(std::numeric_limits<float>::max_exponent10) << value.y()
<< ')';
}
inline std::ostream& operator <<(std::ostream& stream, const Vec3f& value)
{
return stream << "osg::Vec3f(" << std::setprecision(std::numeric_limits<float>::max_exponent10) << value.x()
<< ", " << std::setprecision(std::numeric_limits<float>::max_exponent10) << value.y()
<< ", " << std::setprecision(std::numeric_limits<float>::max_exponent10) << value.z()
<< ')';
}
}
#endif
Loading…
Cancel
Save