mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-30 19:45:40 +00:00
Add operators for osg types
This commit is contained in:
parent
c01be7b07f
commit
4f2bfa1e9d
1 changed files with 35 additions and 0 deletions
35
components/osghelpers/operators.hpp
Normal file
35
components/osghelpers/operators.hpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
#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…
Reference in a new issue