/** virtual btScalar btSequentialImpulseConstraintSolver::solveGroup(btCollisionObject **bodies, int numBodies, btPersistentManifold **manifold, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &info, btIDebugDraw *debugDrawer, btStackAlloc *stackAlloc, btDispatcher *dispatcher)
 * src/vendor/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h:115
 */
static int btSequentialImpulseConstraintSolver_solveGroup(lua_State *L) {
  try {
    btSequentialImpulseConstraintSolver *self = *((btSequentialImpulseConstraintSolver **)dub_checksdata(L, 1, "bt.SequentialImpulseConstraintSolver"));
    btCollisionObject* *bodies = *((btCollisionObject* **)dub_checksdata(L, 2, "CollisionObject*"));
    int numBodies = dub_checkint(L, 3);
    btPersistentManifold* *manifold = *((btPersistentManifold* **)dub_checksdata(L, 4, "PersistentManifold*"));
    int numManifolds = dub_checkint(L, 5);
    btTypedConstraint* *constraints = *((btTypedConstraint* **)dub_checksdata(L, 6, "TypedConstraint*"));
    int numConstraints = dub_checkint(L, 7);
    btContactSolverInfo *info = *((btContactSolverInfo **)dub_checksdata(L, 8, "ContactSolverInfo"));
    btIDebugDraw *debugDrawer = *((btIDebugDraw **)dub_checksdata(L, 9, "bt.IDebugDraw"));
    btStackAlloc *stackAlloc = *((btStackAlloc **)dub_checksdata(L, 10, "StackAlloc"));
    btDispatcher *dispatcher = *((btDispatcher **)dub_checksdata(L, 11, "bt.Dispatcher"));
    lua_pushnumber(L, self->solveGroup(bodies, numBodies, manifold, numManifolds, constraints, numConstraints, *info, debugDrawer, stackAlloc, dispatcher));
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "solveGroup: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "solveGroup: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 2
0
/** void ofBuffer::append(const string &_buffer)
 * api/openFrameworks/utils/ofFileUtils.h:24
 */
static int ofBuffer_append(lua_State *L) {
  try {
    ofBuffer *self = *((ofBuffer **)dub_checksdata(L, 1, "ofBuffer"));
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      const char *_buffer = dub_checkstring(L, 2);
      unsigned int _size = dub_checkint(L, 3);
      self->append(_buffer, _size);
      return 0;
    } else {
      size_t _buffer_sz_;
      const char *_buffer = dub_checklstring(L, 2, &_buffer_sz_);
      self->append(std::string(_buffer, _buffer_sz_));
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "append: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "append: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 3
0
/** void btHingeConstraint::setLimit(btScalar low, btScalar high, btScalar _softness=0.9f, btScalar _biasFactor=0.3f, btScalar _relaxationFactor=1.0f)
 * bind/btHingeConstraint.h:32
 */
static int btHingeConstraint_setLimit(lua_State *L) {
  try {
    btHingeConstraint *self = *((btHingeConstraint **)dub_checksdata(L, 1, "bt.HingeConstraint"));
    int top__ = lua_gettop(L);
    if (top__ >= 6) {
      btScalar low = dub_checknumber(L, 2);
      btScalar high = dub_checknumber(L, 3);
      btScalar _softness = dub_checknumber(L, 4);
      btScalar _biasFactor = dub_checknumber(L, 5);
      btScalar _relaxationFactor = dub_checknumber(L, 6);
      self->setLimit(low, high, _softness, _biasFactor, _relaxationFactor);
      return 0;
    } else if (top__ >= 5) {
      btScalar low = dub_checknumber(L, 2);
      btScalar high = dub_checknumber(L, 3);
      btScalar _softness = dub_checknumber(L, 4);
      btScalar _biasFactor = dub_checknumber(L, 5);
      self->setLimit(low, high, _softness, _biasFactor);
      return 0;
    } else if (top__ >= 4) {
      btScalar low = dub_checknumber(L, 2);
      btScalar high = dub_checknumber(L, 3);
      btScalar _softness = dub_checknumber(L, 4);
      self->setLimit(low, high, _softness);
      return 0;
    } else {
      btScalar low = dub_checknumber(L, 2);
      btScalar high = dub_checknumber(L, 3);
      self->setLimit(low, high);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "setLimit: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setLimit: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 4
0
/** bool ofVideoGrabber::initGrabber(int w, int h)
 * api/openFrameworks/video/ofVideoGrabber.h:24
 */
static int ofVideoGrabber_initGrabber(lua_State *L) {
  try {
    ofVideoGrabber *self = *((ofVideoGrabber **)dub_checksdata(L, 1, "ofVideoGrabber"));
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      int w = dub_checkint(L, 2);
      int h = dub_checkint(L, 3);
      bool bTexture = dub_checkboolean(L, 4);
      lua_pushboolean(L, self->initGrabber(w, h, bTexture));
      return 1;
    } else {
      int w = dub_checkint(L, 2);
      int h = dub_checkint(L, 3);
      lua_pushboolean(L, self->initGrabber(w, h));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "initGrabber: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "initGrabber: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 5
0
/** Read points(size_t i)
 * 
 */
static int b2Manifold_points(lua_State *L) {
  try {
    b2Manifold *self = *((b2Manifold **)dub_checksdata(L, 1, "b2.Manifold"));
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      size_t i = dub_checkint(L, 2);
      b2ManifoldPoint *v = *((b2ManifoldPoint **)dub_checksdata(L, 3, "b2.ManifoldPoint"));
      if (!i || i > b2_maxManifoldPoints) return 0;
      self->points[i-1] = *v;
      return 0;
    } else {
      size_t i = dub_checkint(L, 2);
      if (!i || i > b2_maxManifoldPoints) return 0;
      dub_pushudata(L, new b2ManifoldPoint(self->points[i-1]), "b2.ManifoldPoint", true);
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "points: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "points: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 6
0
/** void QWidget::showFullScreen(bool enable=true)
 * bind/QWidget.h:61
 */
static int TableView_showFullScreen(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      bool enable = dub_checkboolean(L, 2);
      if (enable) {
        self->showFullScreen();
      } else {
        self->showNormal();
      }
      return 0;
    } else {
      self->showFullScreen();
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "showFullScreen: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "showFullScreen: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 7
0
/** void HBoxLayout::insertLayout(int pos, QLayout *layout, int stretch=0)
 * include/mimas/HBoxLayout.h:72
 */
static int HBoxLayout_insertLayout(lua_State *L) {
  try {
    HBoxLayout *self = *((HBoxLayout **)dub_checksdata(L, 1, "mimas.HBoxLayout"));
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      int pos = dub_checkint(L, 2);
      QLayout *layout = *((QLayout **)dub_checksdata(L, 3, "mimas.QLayout"));
      int stretch = dub_checkint(L, 4);
      self->insertLayout(pos, layout, stretch);
      return 0;
    } else {
      int pos = dub_checkint(L, 2);
      QLayout *layout = *((QLayout **)dub_checksdata(L, 3, "mimas.QLayout"));
      self->insertLayout(pos, layout);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "insertLayout: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "insertLayout: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 8
0
/** void ofFbo::allocate(int width, int height, int internalformat=GL_RGBA, int numSamples=0)
 * api/openFrameworks/gl/ofFbo.h:14
 */
static int ofFbo_allocate(lua_State *L) {
  try {
    ofFbo *self = *((ofFbo **)dub_checksdata(L, 1, "ofFbo"));
    int top__ = lua_gettop(L);
    if (top__ >= 5) {
      int width = dub_checkint(L, 2);
      int height = dub_checkint(L, 3);
      int internalformat = dub_checkint(L, 4);
      int numSamples = dub_checkint(L, 5);
      self->allocate(width, height, internalformat, numSamples);
      return 0;
    } else if (top__ >= 4) {
      int width = dub_checkint(L, 2);
      int height = dub_checkint(L, 3);
      int internalformat = dub_checkint(L, 4);
      self->allocate(width, height, internalformat);
      return 0;
    } else if (top__ >= 3) {
      int width = dub_checkint(L, 2);
      int height = dub_checkint(L, 3);
      self->allocate(width, height);
      return 0;
    } else if (top__ >= 2) {
      ofFbo::Settings *settings = *((ofFbo::Settings **)dub_checksdata(L, 2, "ofFbo.Settings"));
      self->allocate(*settings);
      return 0;
    } else {
      self->allocate();
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "allocate: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "allocate: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 9
0
/** void ofVbo::setTexCoordData(const ofVec2f *texCoords, int total, int usage)
 * api/openFrameworks/gl/ofVbo.h:26
 */
static int ofVbo_setTexCoordData(lua_State *L) {
  try {
    ofVbo *self = *((ofVbo **)dub_checksdata(L, 1, "ofVbo"));
    int top__ = lua_gettop(L);
    if (top__ >= 5) {
      float * texCoord0x = (float *) lua_touserdata (L, 2);
      
      int total = dub_checkint(L, 3);
      int usage = dub_checkint(L, 4);
      int stride = dub_checkint(L, 5);
      self->setTexCoordData((float *) texCoord0x, total, usage, stride);
      return 0;
    } else {
      int type__ = lua_type(L, 2);
      void **ptr2__;
      if ( (ptr2__ = dub_issdata(L, 2, "float *", type__)) ) {
        float * texCoord0x = (float *) lua_touserdata (L, 2);
        
        int total = dub_checkint(L, 3);
        int usage = dub_checkint(L, 4);
        self->setTexCoordData((float *) texCoord0x, total, usage);
        return 0;
      } else {
        ofVec2f *texCoords = *((ofVec2f **)dub_checksdata(L, 2, "ofVec2f"));
        int total = dub_checkint(L, 3);
        int usage = dub_checkint(L, 4);
        self->setTexCoordData(texCoords, total, usage);
        return 0;
      }
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "setTexCoordData: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setTexCoordData: Unknown exception");
  }
  return dub_error(L);
}
/** void btDefaultCollisionConfiguration::setPlaneConvexMultipointIterations(int numPerturbationIterations=3, int minimumPointsPerturbationThreshold=3)
 * src/vendor/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h:130
 */
static int btDefaultCollisionConfiguration_setPlaneConvexMultipointIterations(lua_State *L) {
  try {
    btDefaultCollisionConfiguration *self = *((btDefaultCollisionConfiguration **)dub_checksdata(L, 1, "bt.DefaultCollisionConfiguration"));
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      int numPerturbationIterations = dub_checkint(L, 2);
      int minimumPointsPerturbationThreshold = dub_checkint(L, 3);
      self->setPlaneConvexMultipointIterations(numPerturbationIterations, minimumPointsPerturbationThreshold);
      return 0;
    } else if (top__ >= 2) {
      int numPerturbationIterations = dub_checkint(L, 2);
      self->setPlaneConvexMultipointIterations(numPerturbationIterations);
      return 0;
    } else {
      self->setPlaneConvexMultipointIterations();
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "setPlaneConvexMultipointIterations: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setPlaneConvexMultipointIterations: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 11
0
/** void ofVbo::updateNormalData(const ofVec3f *normals, int total)
 * api/openFrameworks/gl/ofVbo.h:39
 */
static int ofVbo_updateNormalData(lua_State *L) {
  try {
    ofVbo *self = *((ofVbo **)dub_checksdata(L, 1, "ofVbo"));
    int type__ = lua_type(L, 2);
    void **ptr2__;
    if ( (ptr2__ = dub_issdata(L, 2, "ofVec3f", type__)) ) {
      ofVec3f *normals = *((ofVec3f **)ptr2__);
      int total = dub_checkint(L, 3);
      self->updateNormalData(normals, total);
      return 0;
    } else {
      float * normal0x = (float *) lua_touserdata (L, 2);
      
      int total = dub_checkint(L, 3);
      self->updateNormalData((float *) normal0x, total);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "updateNormalData: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "updateNormalData: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 12
0
/** void btConvexInternalShape::setSafeMargin(btScalar minDimension, btScalar defaultMarginMultiplier=0.1f)
 * src/vendor/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.h:71
 */
static int btPolyhedralConvexShape_setSafeMargin(lua_State *L) {
    try {
        btPolyhedralConvexShape *self = *((btPolyhedralConvexShape **)dub_checksdata(L, 1, "bt.PolyhedralConvexShape"));
        int top__ = lua_gettop(L);
        if (top__ >= 3) {
            int type__ = lua_type(L, 2);
            if (type__ == LUA_TNUMBER) {
                btScalar minDimension = dub_checknumber(L, 2);
                btScalar defaultMarginMultiplier = dub_checknumber(L, 3);
                self->setSafeMargin(minDimension, defaultMarginMultiplier);
                return 0;
            } else {
                btVector3 *halfExtents = *((btVector3 **)dub_checksdata(L, 2, "bt.Vector3"));
                btScalar defaultMarginMultiplier = dub_checknumber(L, 3);
                self->setSafeMargin(*halfExtents, defaultMarginMultiplier);
                return 0;
            }
        } else {
            int type__ = lua_type(L, 2);
            if (type__ == LUA_TNUMBER) {
                btScalar minDimension = dub_checknumber(L, 2);
                self->setSafeMargin(minDimension);
                return 0;
            } else {
                btVector3 *halfExtents = *((btVector3 **)dub_checksdata(L, 2, "bt.Vector3"));
                self->setSafeMargin(*halfExtents);
                return 0;
            }
        }
    } catch (std::exception &e) {
        lua_pushfstring(L, "setSafeMargin: %s", e.what());
    } catch (...) {
        lua_pushfstring(L, "setSafeMargin: Unknown exception");
    }
    return dub_error(L);
}
Esempio n. 13
0
/** void ofThread::startThread(bool blocking=true, bool verbose=false)
 * api/openFrameworks/utils/ofThread.h:36
 */
static int ofURLFileLoader_startThread(lua_State *L) {
  try {
    ofURLFileLoader *self = *((ofURLFileLoader **)dub_checksdata(L, 1, "ofURLFileLoader"));
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      bool blocking = dub_checkboolean(L, 2);
      bool verbose = dub_checkboolean(L, 3);
      self->startThread(blocking, verbose);
      return 0;
    } else if (top__ >= 2) {
      bool blocking = dub_checkboolean(L, 2);
      self->startThread(blocking);
      return 0;
    } else {
      self->startThread();
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "startThread: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "startThread: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 14
0
/** int ofURLFileLoader::getAsync(string url, string name="")
 * api/openFrameworks/utils/ofURLFileLoader.h:84
 */
static int ofURLFileLoader_getAsync(lua_State *L) {
  try {
    ofURLFileLoader *self = *((ofURLFileLoader **)dub_checksdata(L, 1, "ofURLFileLoader"));
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      size_t url_sz_;
      const char *url = dub_checklstring(L, 2, &url_sz_);
      size_t name_sz_;
      const char *name = dub_checklstring(L, 3, &name_sz_);
      lua_pushnumber(L, self->getAsync(std::string(url, url_sz_), std::string(name, name_sz_)));
      return 1;
    } else {
      size_t url_sz_;
      const char *url = dub_checklstring(L, 2, &url_sz_);
      lua_pushnumber(L, self->getAsync(std::string(url, url_sz_)));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "getAsync: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "getAsync: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 15
0
/** void ofVideoGrabber::draw(float x, float y, float w, float h)
 * api/openFrameworks/video/ofVideoGrabber.h:38
 */
static int ofVideoGrabber_draw(lua_State *L) {
  try {
    ofVideoGrabber *self = *((ofVideoGrabber **)dub_checksdata(L, 1, "ofVideoGrabber"));
    int top__ = lua_gettop(L);
    if (top__ >= 5) {
      float x = dub_checknumber(L, 2);
      float y = dub_checknumber(L, 3);
      float w = dub_checknumber(L, 4);
      float h = dub_checknumber(L, 5);
      self->draw(x, y, w, h);
      return 0;
    } else {
      float x = dub_checknumber(L, 2);
      float y = dub_checknumber(L, 3);
      self->draw(x, y);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "draw: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "draw: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 16
0
/** void ofPolyline::quadBezierTo(float cx1, float cy1, float cz1, float cx2, float cy2, float cz2, float x, float y, float z, int curveResolution=16)
 * api/openFrameworks/graphics/ofPolyline.h:79
 */
static int ofPolyline_quadBezierTo(lua_State *L) {
  try {
    ofPolyline *self = *((ofPolyline **)dub_checksdata(L, 1, "ofPolyline"));
    int top__ = lua_gettop(L);
    if (top__ >= 11) {
      float cx1 = dub_checknumber(L, 2);
      float cy1 = dub_checknumber(L, 3);
      float cz1 = dub_checknumber(L, 4);
      float cx2 = dub_checknumber(L, 5);
      float cy2 = dub_checknumber(L, 6);
      float cz2 = dub_checknumber(L, 7);
      float x = dub_checknumber(L, 8);
      float y = dub_checknumber(L, 9);
      float z = dub_checknumber(L, 10);
      int curveResolution = dub_checkint(L, 11);
      self->quadBezierTo(cx1, cy1, cz1, cx2, cy2, cz2, x, y, z, curveResolution);
      return 0;
    } else if (top__ >= 10) {
      float cx1 = dub_checknumber(L, 2);
      float cy1 = dub_checknumber(L, 3);
      float cz1 = dub_checknumber(L, 4);
      float cx2 = dub_checknumber(L, 5);
      float cy2 = dub_checknumber(L, 6);
      float cz2 = dub_checknumber(L, 7);
      float x = dub_checknumber(L, 8);
      float y = dub_checknumber(L, 9);
      float z = dub_checknumber(L, 10);
      self->quadBezierTo(cx1, cy1, cz1, cx2, cy2, cz2, x, y, z);
      return 0;
    } else if (top__ >= 8) {
      float cx1 = dub_checknumber(L, 2);
      float cy1 = dub_checknumber(L, 3);
      float cx2 = dub_checknumber(L, 4);
      float cy2 = dub_checknumber(L, 5);
      float x = dub_checknumber(L, 6);
      float y = dub_checknumber(L, 7);
      int curveResolution = dub_checkint(L, 8);
      self->quadBezierTo(cx1, cy1, cx2, cy2, x, y, curveResolution);
      return 0;
    } else if (top__ >= 7) {
      float cx1 = dub_checknumber(L, 2);
      float cy1 = dub_checknumber(L, 3);
      float cx2 = dub_checknumber(L, 4);
      float cy2 = dub_checknumber(L, 5);
      float x = dub_checknumber(L, 6);
      float y = dub_checknumber(L, 7);
      self->quadBezierTo(cx1, cy1, cx2, cy2, x, y);
      return 0;
    } else if (top__ >= 5) {
      ofVec3f *p1 = *((ofVec3f **)dub_checksdata(L, 2, "ofVec3f"));
      ofVec3f *p2 = *((ofVec3f **)dub_checksdata(L, 3, "ofVec3f"));
      ofVec3f *p3 = *((ofVec3f **)dub_checksdata(L, 4, "ofVec3f"));
      int curveResolution = dub_checkint(L, 5);
      self->quadBezierTo(*p1, *p2, *p3, curveResolution);
      return 0;
    } else {
      ofVec3f *p1 = *((ofVec3f **)dub_checksdata(L, 2, "ofVec3f"));
      ofVec3f *p2 = *((ofVec3f **)dub_checksdata(L, 3, "ofVec3f"));
      ofVec3f *p3 = *((ofVec3f **)dub_checksdata(L, 4, "ofVec3f"));
      self->quadBezierTo(*p1, *p2, *p3);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "quadBezierTo: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "quadBezierTo: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 17
0
/** btHingeConstraint::btHingeConstraint(btRigidBody &rbA, const btTransform &rbAFrame, bool useReferenceFrameA=false)
 * bind/btHingeConstraint.h:7
 */
static int btHingeConstraint_btHingeConstraint(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 7) {
      btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
      btRigidBody *rbB = *((btRigidBody **)dub_checksdata(L, 2, "bt.RigidBody"));
      btVector3 *pivotInA = *((btVector3 **)dub_checksdata(L, 3, "bt.Vector3"));
      btVector3 *pivotInB = *((btVector3 **)dub_checksdata(L, 4, "bt.Vector3"));
      btVector3 *axisInA = *((btVector3 **)dub_checksdata(L, 5, "bt.Vector3"));
      btVector3 *axisInB = *((btVector3 **)dub_checksdata(L, 6, "bt.Vector3"));
      bool useReferenceFrameA = dub_checkboolean(L, 7);
      btHingeConstraint *retval__ = new btHingeConstraint(*rbA, *rbB, *pivotInA, *pivotInB, *axisInA, *axisInB, useReferenceFrameA);
      dub_pushudata(L, retval__, "bt.HingeConstraint", true);
      return 1;
    } else if (top__ >= 6) {
      btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
      btRigidBody *rbB = *((btRigidBody **)dub_checksdata(L, 2, "bt.RigidBody"));
      btVector3 *pivotInA = *((btVector3 **)dub_checksdata(L, 3, "bt.Vector3"));
      btVector3 *pivotInB = *((btVector3 **)dub_checksdata(L, 4, "bt.Vector3"));
      btVector3 *axisInA = *((btVector3 **)dub_checksdata(L, 5, "bt.Vector3"));
      btVector3 *axisInB = *((btVector3 **)dub_checksdata(L, 6, "bt.Vector3"));
      btHingeConstraint *retval__ = new btHingeConstraint(*rbA, *rbB, *pivotInA, *pivotInB, *axisInA, *axisInB);
      dub_pushudata(L, retval__, "bt.HingeConstraint", true);
      return 1;
    } else if (top__ >= 5) {
      btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
      btRigidBody *rbB = *((btRigidBody **)dub_checksdata(L, 2, "bt.RigidBody"));
      btTransform *rbAFrame = *((btTransform **)dub_checksdata(L, 3, "bt.Transform"));
      btTransform *rbBFrame = *((btTransform **)dub_checksdata(L, 4, "bt.Transform"));
      bool useReferenceFrameA = dub_checkboolean(L, 5);
      btHingeConstraint *retval__ = new btHingeConstraint(*rbA, *rbB, *rbAFrame, *rbBFrame, useReferenceFrameA);
      dub_pushudata(L, retval__, "bt.HingeConstraint", true);
      return 1;
    } else if (top__ >= 4) {
      int type__ = lua_type(L, 4);
      if (type__ == LUA_TBOOLEAN) {
        btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
        btVector3 *pivotInA = *((btVector3 **)dub_checksdata(L, 2, "bt.Vector3"));
        btVector3 *axisInA = *((btVector3 **)dub_checksdata(L, 3, "bt.Vector3"));
        bool useReferenceFrameA = dub_checkboolean(L, 4);
        btHingeConstraint *retval__ = new btHingeConstraint(*rbA, *pivotInA, *axisInA, useReferenceFrameA);
        dub_pushudata(L, retval__, "bt.HingeConstraint", true);
        return 1;
      } else {
        btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
        btRigidBody *rbB = *((btRigidBody **)dub_checksdata(L, 2, "bt.RigidBody"));
        btTransform *rbAFrame = *((btTransform **)dub_checksdata(L, 3, "bt.Transform"));
        btTransform *rbBFrame = *((btTransform **)dub_checksdata(L, 4, "bt.Transform"));
        btHingeConstraint *retval__ = new btHingeConstraint(*rbA, *rbB, *rbAFrame, *rbBFrame);
        dub_pushudata(L, retval__, "bt.HingeConstraint", true);
        return 1;
      }
    } else if (top__ >= 3) {
      int type__ = lua_type(L, 3);
      if (type__ == LUA_TBOOLEAN) {
        btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
        btTransform *rbAFrame = *((btTransform **)dub_checksdata(L, 2, "bt.Transform"));
        bool useReferenceFrameA = dub_checkboolean(L, 3);
        btHingeConstraint *retval__ = new btHingeConstraint(*rbA, *rbAFrame, useReferenceFrameA);
        dub_pushudata(L, retval__, "bt.HingeConstraint", true);
        return 1;
      } else {
        btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
        btVector3 *pivotInA = *((btVector3 **)dub_checksdata(L, 2, "bt.Vector3"));
        btVector3 *axisInA = *((btVector3 **)dub_checksdata(L, 3, "bt.Vector3"));
        btHingeConstraint *retval__ = new btHingeConstraint(*rbA, *pivotInA, *axisInA);
        dub_pushudata(L, retval__, "bt.HingeConstraint", true);
        return 1;
      }
    } else {
      btRigidBody *rbA = *((btRigidBody **)dub_checksdata(L, 1, "bt.RigidBody"));
      btTransform *rbAFrame = *((btTransform **)dub_checksdata(L, 2, "bt.Transform"));
      btHingeConstraint *retval__ = new btHingeConstraint(*rbA, *rbAFrame);
      dub_pushudata(L, retval__, "bt.HingeConstraint", true);
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "new: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "new: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 18
0
/** Brush::Brush()
 * include/mimas/Brush.h:44
 */
static int Brush_Brush(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 5) {
      float h = dub_checknumber(L, 1);
      float s = dub_checknumber(L, 2);
      float v = dub_checknumber(L, 3);
      float a = dub_checknumber(L, 4);
      int style = dub_checkint(L, 5);
      Brush *retval__ = new Brush(h, s, v, a, style);
      dub_pushudata(L, retval__, "mimas.Brush", true);
      return 1;
    } else if (top__ >= 4) {
      float h = dub_checknumber(L, 1);
      float s = dub_checknumber(L, 2);
      float v = dub_checknumber(L, 3);
      float a = dub_checknumber(L, 4);
      Brush *retval__ = new Brush(h, s, v, a);
      dub_pushudata(L, retval__, "mimas.Brush", true);
      return 1;
    } else if (top__ >= 3) {
      float h = dub_checknumber(L, 1);
      float s = dub_checknumber(L, 2);
      float v = dub_checknumber(L, 3);
      Brush *retval__ = new Brush(h, s, v);
      dub_pushudata(L, retval__, "mimas.Brush", true);
      return 1;
    } else if (top__ >= 2) {
      int type__ = lua_type(L, 1);
      if (type__ == LUA_TNUMBER) {
        float h = dub_checknumber(L, 1);
        float s = dub_checknumber(L, 2);
        Brush *retval__ = new Brush(h, s);
        dub_pushudata(L, retval__, "mimas.Brush", true);
        return 1;
      } else {
        Color *color = *((Color **)dub_checksdata(L, 1, "mimas.Color"));
        int style = dub_checkint(L, 2);
        Brush *retval__ = new Brush(*color, style);
        dub_pushudata(L, retval__, "mimas.Brush", true);
        return 1;
      }
    } else if (top__ >= 1) {
      int type__ = lua_type(L, 1);
      if (type__ == LUA_TNUMBER) {
        float h = dub_checknumber(L, 1);
        Brush *retval__ = new Brush(h);
        dub_pushudata(L, retval__, "mimas.Brush", true);
        return 1;
      } else {
        Color *color = *((Color **)dub_checksdata(L, 1, "mimas.Color"));
        Brush *retval__ = new Brush(*color);
        dub_pushudata(L, retval__, "mimas.Brush", true);
        return 1;
      }
    } else {
      Brush *retval__ = new Brush();
      dub_pushudata(L, retval__, "mimas.Brush", true);
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "new: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "new: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 19
0
/** Pen::Pen()
 * include/mimas/Pen.h:43
 */
static int Pen_Pen(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 5) {
      int type__ = lua_type(L, 2);
      if (type__ == LUA_TNUMBER) {
        float width = dub_checknumber(L, 1);
        float h = dub_checknumber(L, 2);
        float s = dub_checknumber(L, 3);
        float v = dub_checknumber(L, 4);
        float a = dub_checknumber(L, 5);
        Pen *retval__ = new Pen(width, h, s, v, a);
        dub_pushudata(L, retval__, "mimas.Pen", true);
        return 1;
      } else {
        float width = dub_checknumber(L, 1);
        Color *color = *((Color **)dub_checksdata(L, 2, "mimas.Color"));
        int style = dub_checkint(L, 3);
        int cap = dub_checkint(L, 4);
        int join = dub_checkint(L, 5);
        Pen *retval__ = new Pen(width, *color, style, cap, join);
        dub_pushudata(L, retval__, "mimas.Pen", true);
        return 1;
      }
    } else if (top__ >= 4) {
      int type__ = lua_type(L, 2);
      if (type__ == LUA_TNUMBER) {
        float width = dub_checknumber(L, 1);
        float h = dub_checknumber(L, 2);
        float s = dub_checknumber(L, 3);
        float v = dub_checknumber(L, 4);
        Pen *retval__ = new Pen(width, h, s, v);
        dub_pushudata(L, retval__, "mimas.Pen", true);
        return 1;
      } else {
        float width = dub_checknumber(L, 1);
        Color *color = *((Color **)dub_checksdata(L, 2, "mimas.Color"));
        int style = dub_checkint(L, 3);
        int cap = dub_checkint(L, 4);
        Pen *retval__ = new Pen(width, *color, style, cap);
        dub_pushudata(L, retval__, "mimas.Pen", true);
        return 1;
      }
    } else if (top__ >= 3) {
      int type__ = lua_type(L, 2);
      if (type__ == LUA_TNUMBER) {
        float width = dub_checknumber(L, 1);
        float h = dub_checknumber(L, 2);
        float s = dub_checknumber(L, 3);
        Pen *retval__ = new Pen(width, h, s);
        dub_pushudata(L, retval__, "mimas.Pen", true);
        return 1;
      } else {
        float width = dub_checknumber(L, 1);
        Color *color = *((Color **)dub_checksdata(L, 2, "mimas.Color"));
        int style = dub_checkint(L, 3);
        Pen *retval__ = new Pen(width, *color, style);
        dub_pushudata(L, retval__, "mimas.Pen", true);
        return 1;
      }
    } else if (top__ >= 2) {
      int type__ = lua_type(L, 2);
      if (type__ == LUA_TNUMBER) {
        float width = dub_checknumber(L, 1);
        float h = dub_checknumber(L, 2);
        Pen *retval__ = new Pen(width, h);
        dub_pushudata(L, retval__, "mimas.Pen", true);
        return 1;
      } else {
        float width = dub_checknumber(L, 1);
        Color *color = *((Color **)dub_checksdata(L, 2, "mimas.Color"));
        Pen *retval__ = new Pen(width, *color);
        dub_pushudata(L, retval__, "mimas.Pen", true);
        return 1;
      }
    } else {
      Pen *retval__ = new Pen();
      dub_pushudata(L, retval__, "mimas.Pen", true);
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "new: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "new: Unknown exception");
  }
  return dub_error(L);
}