Sha256: 6e2398a14b8fb2898afd1d50dd48b0b4d29ad2dba7ed3524e2ae2f941ee57c9a

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

%{
  #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"

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shattered_ogrerb-0.5.0.1 vendor/ogrerb/ogre/OgreMath.i
shattered_ogrerb-0.5.0.2 vendor/ogrerb/ogre/OgreMath.i
shattered_ogrerb-0.5.1 vendor/ogrerb/swig/ogre/OgreMath.i