(I cant host code so i'll post it here ok?)
Code: Select all
#ifndef IRR_OUT_H
#define IRR_OUT_H
#include <irrlicht.h>
#include <iostream>
template <class T>
inline std::ostream & operator<<( std::ostream &os, const irr::core::vector3d<T> &pos )
{ return os << "(" << pos.X << "," << pos.Y << "," << pos.Z << ")"; }
template <class T>
inline std::ostream & operator<<( std::ostream &os, const irr::core::rect<T> &rect )
{ return os << "(" << rect.UpperLeftCorner << "," << rect.LowerRightCorner << ")"; }
template <class T>
inline std::ostream & operator<<( std::ostream &os, const irr::core::vector2d<T> &pos )
{ return os << "(" << pos.X << "," << pos.Y << ")"; }
template <class T>
inline std::ostream & operator<<( std::ostream &os, const irr::core::aabbox3d<T> &box )
{ return os << "(" << box.MinEdge << "," << box.MaxEdge << ")"; }
template <class T>
inline std::ostream & operator<<( std::ostream &os, const irr::core::array<T> &ls )
{
os << "[" << ls.size() << "/" << ls.allocated_size() << "](";
for(int i = 0; i < ls.size(); ++i)
{
os << ls[i] << ((i == ls.size() - 1) ? ")" : ",");
}
return os;
}
template <class T>
inline std::ostream & operator<<( std::ostream &os, const irr::core::dimension2d<T> &dim )
{ return os << "(" << dim.Height << "," << dim.Width << ")"; }
template <class T>
inline std::ostream & operator<<( std::ostream &os, const irr::core::line2d<T> &ln )
{ return os << "(" << ln.start << "," << ln.start << ")";}
template <class T>
inline std::ostream & operator<<( std::ostream &os, const irr::core::line3d<T> &ln )
{ return os << "(" << ln.start << "," << ln.start << ")";}
template <class T>
inline std::ostream & operator<<( std::ostream &os, const irr::core::list<T> &ls )
{
os << "[" << ls.getSize() << "](";
for(irr::core::list<T>::Iterator i = ls.begin(); i != ls.end(); ++i)
{
os << (*i) << ",";
}
return os;
}
inline std::ostream &operator<<(std::ostream &os, const irr::core::matrix4 &m )
{
os << "(";
for(int i = 0; i < 4; ++i)
for(int j = 0; j < 4; ++j)
os << m(i,j) << (i == 3 && j == 3) ? ")" : ",";
return os;
}
template <class T>
inline std::ostream & operator<<( std::ostream &os, const irr::core::plane3d<T> &p)
{ return os << "(" << p.D << p.Normal << ")"; }
template <class T>
inline std::ostream &operator<<( std::ostream &os, const irr::core::position2d<T> &pos)
{ return os << "(" << pos.X << "," << pos.Y << ")"; }
inline std::ostream &operator<<(std::ostream &os, const irr::core::quaternion &q)
{ return os << "(" << q.W << "," << q.X << "," << q.Y << "," << q.Z << ")"; }
inline std::ostream &operator<<(std::ostream &os, const irr::video::SColor &c)
{ return os << "(" << os.hex << c.color << os.dec << ")"; }
#endif
std::cout << AbsoluteTransformation << RelativeRotation << RelativeScale; etc. (derefercing pointers would pose problems I suppose)
Anyways I know irrlicht doesn't depend on std:: at all but thought this might help.