Unverified Commit 0208cb86 authored by AnyOldName3's avatar AnyOldName3 Committed by GitHub

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

Allow OSG objects to be sent to the debug log.
parents 341c6d57 6bbc1cb3
Pipeline #35024056 (#189) passed with stage
......@@ -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>
......
#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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment