%{ #include "OgreMath.h" %} /** * Make sure that Radian parameters can take Degree values * * Thanks to Bruce */ %typemap(typecheck, precedence=4000) Ogre::Radian, Ogre::Degree, Ogre::Radian*, Ogre::Degree*, const Ogre::Radian&, const Ogre::Degree&, Ogre::Radian*, Ogre::Degree& { void *angle; int res1 = SWIG_ConvertPtr($input, &angle, SWIGTYPE_p_Ogre__Radian, 0); int res2 = SWIG_ConvertPtr($input, &angle, SWIGTYPE_p_Ogre__Degree, 0); if (SWIG_IsOK(res1) || SWIG_IsOK(res2)) $1 = 1; else $1 = 0; } %typemap(in) Ogre::Radian, Ogre::Radian*, Ogre::Radian&, const Ogre::Radian& { void* angle = 0; int res1 = SWIG_ConvertPtr($input, &angle, SWIGTYPE_p_Ogre__Radian, 0); $1 = (Ogre::Radian*) angle; if (!SWIG_IsOK(res1)) { int res2 = SWIG_ConvertPtr($input, &angle, SWIGTYPE_p_Ogre__Degree, 0); // TODO Figure out wtf this line means, because it's generating a TON of gcc warnings $1 = &Ogre::Radian(*((Ogre::Degree*)angle)); if (!SWIG_IsOK(res2)) SWIG_exception_fail(SWIG_ArgError(res2), "argument type must be Ogre::Degree or Ogre::Radian"); } } %include "OgreMath.h"