コード例 #1
0
ファイル: b2_SolverData.cpp プロジェクト: lubyk/b2
/** Set attributes (key, value)
 * 
 */
static int b2SolverData__set_(lua_State *L) {

  b2SolverData *self = *((b2SolverData **)dub_checksdata_n(L, 1, "b2.SolverData"));
  const char *key = luaL_checkstring(L, 2);
  int key_h = dub_hash(key, 4);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "step")) break;
      self->step = **((b2TimeStep **)dub_checksdata_n(L, 3, "b2.TimeStep"));
      return 0;
    }
    case 2: {
      if (DUB_ASSERT_KEY(key, "positions")) break;
      dub_protect(L, 1, 3, "positions");
      self->positions = *((b2Position **)dub_checksdata_n(L, 3, "b2.Position"));
      return 0;
    }
    case 3: {
      if (DUB_ASSERT_KEY(key, "velocities")) break;
      dub_protect(L, 1, 3, "velocities");
      self->velocities = *((b2Velocity **)dub_checksdata_n(L, 3, "b2.Velocity"));
      return 0;
    }
  }
  if (lua_istable(L, 1)) {
    lua_rawset(L, 1);
  } else {
    luaL_error(L, KEY_EXCEPTION_MSG, key);
  }
  return 0;
}
コード例 #2
0
ファイル: b2_Manifold.cpp プロジェクト: lubyk/b2
/** Set attributes (key, value)
 * 
 */
static int b2Manifold__set_(lua_State *L) {

  b2Manifold *self = *((b2Manifold **)dub_checksdata_n(L, 1, "b2.Manifold"));
  const char *key = luaL_checkstring(L, 2);
  int key_h = dub_hash(key, 9);
  switch(key_h) {
    case 3: {
      if (DUB_ASSERT_KEY(key, "localNormal")) break;
      self->localNormal = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 8: {
      if (DUB_ASSERT_KEY(key, "localPoint")) break;
      self->localPoint = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "type")) break;
      self->type = (b2Manifold::Type)luaL_checkint(L, 3);
      return 0;
    }
    case 7: {
      if (DUB_ASSERT_KEY(key, "pointCount")) break;
      self->pointCount = luaL_checkint(L, 3);
      return 0;
    }
  }
  if (lua_istable(L, 1)) {
    lua_rawset(L, 1);
  } else {
    luaL_error(L, KEY_EXCEPTION_MSG, key);
  }
  return 0;
}
コード例 #3
0
ファイル: b2_CircleShape.cpp プロジェクト: lubyk/b2
/** Set attributes (key, value)
 * 
 */
static int b2CircleShape__set_(lua_State *L) {

  b2CircleShape *self = *((b2CircleShape **)dub_checksdata_n(L, 1, "b2.CircleShape"));
  const char *key = luaL_checkstring(L, 2);
  int key_h = dub_hash(key, 7);
  switch(key_h) {
    case 1: {
      if (DUB_ASSERT_KEY(key, "m_p")) break;
      self->m_p = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 2: {
      if (DUB_ASSERT_KEY(key, "m_type")) break;
      self->m_type = (b2Shape::Type)luaL_checkint(L, 3);
      return 0;
    }
    case 4: {
      if (DUB_ASSERT_KEY(key, "m_radius")) break;
      self->m_radius = luaL_checknumber(L, 3);
      return 0;
    }
  }
  if (lua_istable(L, 1)) {
    lua_rawset(L, 1);
  } else {
    luaL_error(L, KEY_EXCEPTION_MSG, key);
  }
  return 0;
}
コード例 #4
0
/** Get attributes (key)
 * 
 */
static int ofKeyEventArgs__get_(lua_State *L) {

  ofKeyEventArgs *self = *((ofKeyEventArgs **)dub_checksdata_n(L, 1, "ofKeyEventArgs", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "type")) break;
      dub_pushudata(L, &self->type, "enum ofKeyEventArgs::Type", false);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "key")) break;
      lua_pushnumber(L, self->key);
      return 1;
    }
  }
  return 0;
}
コード例 #5
0
ファイル: DataSource.cpp プロジェクト: lubyk/mimas
QVariant DataSource::headerData(int section, Qt::Orientation orientation, int role) const {
  lua_State *L = const_cast<lua_State*>(dub_L);
  if (role == Qt::DisplayRole) {
    if (!dub_pushcallback("header")) return QVariant();
    lua_pushnumber(L, section + 1);
    lua_pushnumber(L, orientation);
    // <func> <self> <section> <orientation>
    if (!dub_call(3, 1)) {
      return QVariant();
    }
    QVariant res = variantFromLua(L, -1);
    lua_pop(L, 1);
    return res;
  } else if (role == Qt::BackgroundRole || role == Qt::ForegroundRole) {
    if (!dub_pushcallback(
         role == Qt::BackgroundRole ? "background" : "foreground"
        )) return QVariant();
    lua_pushnumber(L, section + 1);
    // <func> <self> <section>
    if (!dub_call(2, 1)) {
      return QVariant();
    }
    if (!lua_isnil(L, -1)) {
      try {
        Color *color = *((Color **)dub_checksdata_n(L, -1, "mimas.Color"));
        QVariant res = *color;
        lua_pop(L, 1);
        return res;
      } catch(dub::Exception) {
        return QVariant();
      }
    }
  }
  return QVariant();
}
コード例 #6
0
ファイル: b2_Color.cpp プロジェクト: lubyk/b2
/** Set attributes (key, value)
 *
 */
static int b2Color__set_(lua_State *L) {

    b2Color *self = *((b2Color **)dub_checksdata_n(L, 1, "b2.Color"));
    const char *key = luaL_checkstring(L, 2);
    int key_h = dub_hash(key, 3);
    switch(key_h) {
    case 0: {
        if (DUB_ASSERT_KEY(key, "r")) break;
        self->r = luaL_checknumber(L, 3);
        return 0;
    }
    case 1: {
        if (DUB_ASSERT_KEY(key, "g")) break;
        self->g = luaL_checknumber(L, 3);
        return 0;
    }
    case 2: {
        if (DUB_ASSERT_KEY(key, "b")) break;
        self->b = luaL_checknumber(L, 3);
        return 0;
    }
    }
    if (lua_istable(L, 1)) {
        lua_rawset(L, 1);
    } else {
        luaL_error(L, KEY_EXCEPTION_MSG, key);
    }
    return 0;
}
コード例 #7
0
ファイル: mimas_TableView.cpp プロジェクト: lubyk/mimas
/** Cast (class_name)
 * 
 */
static int TableView__cast_(lua_State *L) {

  TableView *self = *((TableView **)dub_checksdata_n(L, 1, "mimas.TableView"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 3);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "mimas.QTableView")) break;
      *retval__ = static_cast<QTableView *>(self);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "mimas.QWidget")) break;
      *retval__ = static_cast<QWidget *>(self);
      return 1;
    }
    case 2: {
      if (DUB_ASSERT_KEY(key, "mimas.QObject")) break;
      *retval__ = static_cast<QObject *>(self);
      return 1;
    }
  }
  return 0;
}
コード例 #8
0
/** Cast (class_name)
 * 
 */
static int ofVideoGrabber__cast_(lua_State *L) {

  ofVideoGrabber *self = *((ofVideoGrabber **)dub_checksdata_n(L, 1, "ofVideoGrabber"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 7);
  switch(key_h) {
    case 3: {
      if (DUB_ASSERT_KEY(key, "ofBaseVideoGrabber")) break;
      *retval__ = static_cast<ofBaseVideoGrabber *>(self);
      return 1;
    }
    case 5: {
      if (DUB_ASSERT_KEY(key, "ofBaseVideo")) break;
      *retval__ = static_cast<ofBaseVideo *>(self);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "ofBaseUpdates")) break;
      *retval__ = static_cast<ofBaseUpdates *>(self);
      return 1;
    }
    case 6: {
      if (DUB_ASSERT_KEY(key, "ofBaseVideoDraws")) break;
      *retval__ = static_cast<ofBaseVideoDraws *>(self);
      return 1;
    }
  }
  return 0;
}
コード例 #9
0
ファイル: mimas_MenuBar.cpp プロジェクト: lubyk/mimas
/** Cast (class_name)
 * 
 */
static int MenuBar__cast_(lua_State *L) {

  MenuBar *self = *((MenuBar **)dub_checksdata_n(L, 1, "mimas.MenuBar"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 8);
  switch(key_h) {
    case 6: {
      if (DUB_ASSERT_KEY(key, "mimas.QMenuBar")) break;
      *retval__ = static_cast<QMenuBar *>(self);
      return 1;
    }
    case 2: {
      if (DUB_ASSERT_KEY(key, "mimas.QWidget")) break;
      *retval__ = static_cast<QWidget *>(self);
      return 1;
    }
    case 5: {
      if (DUB_ASSERT_KEY(key, "mimas.QObject")) break;
      *retval__ = static_cast<QObject *>(self);
      return 1;
    }
  }
  return 0;
}
コード例 #10
0
ファイル: b2_ClipVertex.cpp プロジェクト: lubyk/b2
/** Get attributes (key)
 * 
 */
static int b2ClipVertex__get_(lua_State *L) {

  b2ClipVertex *self = *((b2ClipVertex **)dub_checksdata_n(L, 1, "b2.ClipVertex", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "v")) break;
      dub_pushudata(L, &self->v, "b2.Vec2", false);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "id")) break;
      dub_pushudata(L, &self->id, "b2.ContactID", false);
      return 1;
    }
  }
  return 0;
}
コード例 #11
0
/** Get attributes (key)
 * 
 */
static int ofVideoGrabber__get_(lua_State *L) {

  ofVideoGrabber *self = *((ofVideoGrabber **)dub_checksdata_n(L, 1, "ofVideoGrabber", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 1: {
      if (DUB_ASSERT_KEY(key, "height")) break;
      lua_pushnumber(L, self->height);
      return 1;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "width")) break;
      lua_pushnumber(L, self->width);
      return 1;
    }
  }
  return 0;
}
コード例 #12
0
ファイル: b2_Shape.cpp プロジェクト: lubyk/b2
/** Get attributes (key)
 * 
 */
static int b2Shape__get_(lua_State *L) {

  b2Shape *self = *((b2Shape **)dub_checksdata_n(L, 1, "b2.Shape", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 5);
  switch(key_h) {
    case 2: {
      if (DUB_ASSERT_KEY(key, "m_type")) break;
      lua_pushnumber(L, self->m_type);
      return 1;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "m_radius")) break;
      lua_pushnumber(L, self->m_radius);
      return 1;
    }
  }
  return 0;
}
コード例 #13
0
ファイル: mimas_HBoxLayout.cpp プロジェクト: lubyk/mimas
/** Cast (class_name)
 * 
 */
static int HBoxLayout__cast_(lua_State *L) {

  HBoxLayout *self = *((HBoxLayout **)dub_checksdata_n(L, 1, "mimas.HBoxLayout"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 4);
  switch(key_h) {
    case 3: {
      if (DUB_ASSERT_KEY(key, "mimas.QBoxLayout")) break;
      *retval__ = static_cast<QBoxLayout *>(self);
      return 1;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "mimas.QLayout")) break;
      *retval__ = static_cast<QLayout *>(self);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "mimas.QObject")) break;
      *retval__ = static_cast<QObject *>(self);
      return 1;
    }
  }
  return 0;
}
コード例 #14
0
ファイル: b2_ContactID.cpp プロジェクト: lubyk/b2
/** Get attributes (key)
 * 
 */
static int b2ContactID__get_(lua_State *L) {

  b2ContactID *self = *((b2ContactID **)dub_checksdata_n(L, 1, "b2.ContactID", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 5);
  switch(key_h) {
    case 3: {
      if (DUB_ASSERT_KEY(key, "cf")) break;
      dub_pushudata(L, &self->cf, "b2.ContactFeature", false);
      return 1;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "key")) break;
      lua_pushnumber(L, self->key);
      return 1;
    }
  }
  return 0;
}
コード例 #15
0
/** Cast (class_name)
 *
 */
static int btPolyhedralConvexShape__cast_(lua_State *L) {

    btPolyhedralConvexShape *self = *((btPolyhedralConvexShape **)dub_checksdata_n(L, 1, "bt.PolyhedralConvexShape"));
    const char *key = luaL_checkstring(L, 2);
    void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
    int key_h = dub_hash(key, 3);
    switch(key_h) {
    case 0: {
        if (DUB_ASSERT_KEY(key, "bt.ConvexInternalShape")) break;
        *retval__ = static_cast<btConvexInternalShape *>(self);
        return 1;
    }
    case 1: {
        if (DUB_ASSERT_KEY(key, "bt.ConvexShape")) break;
        *retval__ = static_cast<btConvexShape *>(self);
        return 1;
    }
    case 2: {
        if (DUB_ASSERT_KEY(key, "bt.CollisionShape")) break;
        *retval__ = static_cast<btCollisionShape *>(self);
        return 1;
    }
    }
    return 0;
}
コード例 #16
0
ファイル: b2_ContactManager.cpp プロジェクト: lubyk/b2
/** Get attributes (key)
 * 
 */
static int b2ContactManager__get_(lua_State *L) {

  b2ContactManager *self = *((b2ContactManager **)dub_checksdata_n(L, 1, "b2.ContactManager", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 14);
  switch(key_h) {
    case 5: {
      if (DUB_ASSERT_KEY(key, "m_broadPhase")) break;
      dub_pushudata(L, &self->m_broadPhase, "b2.BroadPhase", false);
      return 1;
    }
    case 12: {
      if (DUB_ASSERT_KEY(key, "m_contactList")) break;
      b2Contact *retval__ = self->m_contactList;
      if (!retval__) return 0;
      dub_pushudata(L, retval__, "Contact", false);
      return 1;
    }
    case 13: {
      if (DUB_ASSERT_KEY(key, "m_contactCount")) break;
      lua_pushnumber(L, self->m_contactCount);
      return 1;
    }
    case 10: {
      if (DUB_ASSERT_KEY(key, "m_contactFilter")) break;
      b2ContactFilter *retval__ = self->m_contactFilter;
      if (!retval__) return 0;
      dub_pushudata(L, retval__, "b2.ContactFilter", false);
      return 1;
    }
    case 8: {
      if (DUB_ASSERT_KEY(key, "m_contactListener")) break;
      b2ContactListener *retval__ = self->m_contactListener;
      if (!retval__) return 0;
      dub_pushudata(L, retval__, "b2.ContactListener", false);
      return 1;
    }
    case 3: {
      if (DUB_ASSERT_KEY(key, "m_allocator")) break;
      b2BlockAllocator *retval__ = self->m_allocator;
      if (!retval__) return 0;
      dub_pushudata(L, retval__, "b2.BlockAllocator", false);
      return 1;
    }
  }
  return 0;
}
コード例 #17
0
ファイル: b2_Sweep.cpp プロジェクト: lubyk/b2
/** Set attributes (key, value)
 * 
 */
static int b2Sweep__set_(lua_State *L) {

  b2Sweep *self = *((b2Sweep **)dub_checksdata_n(L, 1, "b2.Sweep"));
  const char *key = luaL_checkstring(L, 2);
  int key_h = dub_hash(key, 8);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "localCenter")) break;
      self->localCenter = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 5: {
      if (DUB_ASSERT_KEY(key, "c0")) break;
      self->c0 = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 3: {
      if (DUB_ASSERT_KEY(key, "c")) break;
      self->c = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 7: {
      if (DUB_ASSERT_KEY(key, "a0")) break;
      self->a0 = luaL_checknumber(L, 3);
      return 0;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "a")) break;
      self->a = luaL_checknumber(L, 3);
      return 0;
    }
    case 2: {
      if (DUB_ASSERT_KEY(key, "alpha0")) break;
      self->alpha0 = luaL_checknumber(L, 3);
      return 0;
    }
  }
  if (lua_istable(L, 1)) {
    lua_rawset(L, 1);
  } else {
    luaL_error(L, KEY_EXCEPTION_MSG, key);
  }
  return 0;
}
コード例 #18
0
ファイル: bt_Matrix3x3.cpp プロジェクト: lubyk/old_bt
/** btVector3& btMatrix3x3::operator[](int i)
 * src/vendor/bullet/src/LinearMath/btMatrix3x3.h:146
 */
static int btMatrix3x3__get_(lua_State *L) {

  btMatrix3x3 *self = *((btMatrix3x3 **)dub_checksdata_n(L, 1, "bt.Matrix3x3", true));
  if (lua_type(L, 2) != LUA_TSTRING) {
    int i = luaL_checkint(L, 2);
    dub_pushudata(L, const_cast<btVector3*>(&self->operator[](i)), "bt.Vector3", false);
    return 1;
  }
  return 0;
}
コード例 #19
0
/** const ofPoint& ofPolyline::operator[](int index) const
 * api/openFrameworks/graphics/ofPolyline.h:114
 */
static int ofPolyline__get_(lua_State *L) {

  ofPolyline *self = *((ofPolyline **)dub_checksdata_n(L, 1, "ofPolyline", true));
  if (lua_type(L, 2) != LUA_TSTRING) {
    int index = luaL_checkint(L, 2);
    dub_pushudata(L, &self->operator[](index), "ofVec3f", false);
    return 1;
  }
  return 0;
}
コード例 #20
0
ファイル: b2_Sweep.cpp プロジェクト: lubyk/b2
/** Get attributes (key)
 * 
 */
static int b2Sweep__get_(lua_State *L) {

  b2Sweep *self = *((b2Sweep **)dub_checksdata_n(L, 1, "b2.Sweep", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 8);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "localCenter")) break;
      dub_pushudata(L, &self->localCenter, "b2.Vec2", false);
      return 1;
    }
    case 5: {
      if (DUB_ASSERT_KEY(key, "c0")) break;
      dub_pushudata(L, &self->c0, "b2.Vec2", false);
      return 1;
    }
    case 3: {
      if (DUB_ASSERT_KEY(key, "c")) break;
      dub_pushudata(L, &self->c, "b2.Vec2", false);
      return 1;
    }
    case 7: {
      if (DUB_ASSERT_KEY(key, "a0")) break;
      lua_pushnumber(L, self->a0);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "a")) break;
      lua_pushnumber(L, self->a);
      return 1;
    }
    case 2: {
      if (DUB_ASSERT_KEY(key, "alpha0")) break;
      lua_pushnumber(L, self->alpha0);
      return 1;
    }
  }
  return 0;
}
コード例 #21
0
ファイル: b2_RopeJointDef.cpp プロジェクト: lubyk/b2
/** Set attributes (key, value)
 * 
 */
static int b2RopeJointDef__set_(lua_State *L) {

  b2RopeJointDef *self = *((b2RopeJointDef **)dub_checksdata_n(L, 1, "b2.RopeJointDef"));
  const char *key = luaL_checkstring(L, 2);
  int key_h = dub_hash(key, 19);
  switch(key_h) {
    case 18: {
      if (DUB_ASSERT_KEY(key, "localAnchorA")) break;
      self->localAnchorA = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "localAnchorB")) break;
      self->localAnchorB = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 3: {
      if (DUB_ASSERT_KEY(key, "maxLength")) break;
      self->maxLength = luaL_checknumber(L, 3);
      return 0;
    }
    case 9: {
      if (DUB_ASSERT_KEY(key, "type")) break;
      self->type = (b2JointType)luaL_checkint(L, 3);
      return 0;
    }
    case 6: {
      if (DUB_ASSERT_KEY(key, "userData")) break;
      dub_protect(L, 1, 3, "userData");
      self->userData = *((void **)dub_checksdata_n(L, 3, "void"));
      return 0;
    }
    case 7: {
      if (DUB_ASSERT_KEY(key, "bodyA")) break;
      dub_protect(L, 1, 3, "bodyA");
      self->bodyA = *((b2Body **)dub_checksdata_n(L, 3, "b2.Body"));
      return 0;
    }
    case 8: {
      if (DUB_ASSERT_KEY(key, "bodyB")) break;
      dub_protect(L, 1, 3, "bodyB");
      self->bodyB = *((b2Body **)dub_checksdata_n(L, 3, "b2.Body"));
      return 0;
    }
    case 15: {
      if (DUB_ASSERT_KEY(key, "collideConnected")) break;
      self->collideConnected = luaL_checkboolean(L, 3);
      return 0;
    }
  }
  if (lua_istable(L, 1)) {
    lua_rawset(L, 1);
  } else {
    luaL_error(L, KEY_EXCEPTION_MSG, key);
  }
  return 0;
}
コード例 #22
0
ファイル: b2_CircleShape.cpp プロジェクト: lubyk/b2
/** Cast (class_name)
 * 
 */
static int b2CircleShape__cast_(lua_State *L) {

  b2CircleShape *self = *((b2CircleShape **)dub_checksdata_n(L, 1, "b2.CircleShape"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 1: {
      if (DUB_ASSERT_KEY(key, "b2.Shape")) break;
      *retval__ = static_cast<b2Shape *>(self);
      return 1;
    }
  }
  return 0;
}
コード例 #23
0
ファイル: b2_ClipVertex.cpp プロジェクト: lubyk/b2
/** Set attributes (key, value)
 * 
 */
static int b2ClipVertex__set_(lua_State *L) {

  b2ClipVertex *self = *((b2ClipVertex **)dub_checksdata_n(L, 1, "b2.ClipVertex"));
  const char *key = luaL_checkstring(L, 2);
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "v")) break;
      self->v = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "id")) break;
      self->id = **((b2ContactID **)dub_checksdata_n(L, 3, "b2.ContactID"));
      return 0;
    }
  }
  if (lua_istable(L, 1)) {
    lua_rawset(L, 1);
  } else {
    luaL_error(L, KEY_EXCEPTION_MSG, key);
  }
  return 0;
}
コード例 #24
0
/** Cast (class_name)
 * 
 */
static int btDefaultCollisionConfiguration__cast_(lua_State *L) {

  btDefaultCollisionConfiguration *self = *((btDefaultCollisionConfiguration **)dub_checksdata_n(L, 1, "bt.DefaultCollisionConfiguration"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "bt.CollisionConfiguration")) break;
      *retval__ = static_cast<btCollisionConfiguration *>(self);
      return 1;
    }
  }
  return 0;
}
コード例 #25
0
ファイル: b2_ContactID.cpp プロジェクト: lubyk/b2
/** Set attributes (key, value)
 * 
 */
static int b2ContactID__set_(lua_State *L) {

  b2ContactID *self = *((b2ContactID **)dub_checksdata_n(L, 1, "b2.ContactID"));
  const char *key = luaL_checkstring(L, 2);
  int key_h = dub_hash(key, 5);
  switch(key_h) {
    case 3: {
      if (DUB_ASSERT_KEY(key, "cf")) break;
      self->cf = **((b2ContactFeature **)dub_checksdata_n(L, 3, "b2.ContactFeature"));
      return 0;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "key")) break;
      self->key = luaL_checkint(L, 3);
      return 0;
    }
  }
  if (lua_istable(L, 1)) {
    lua_rawset(L, 1);
  } else {
    luaL_error(L, KEY_EXCEPTION_MSG, key);
  }
  return 0;
}
コード例 #26
0
/** Cast (class_name)
 * 
 */
static int ofConsoleLoggerChannel__cast_(lua_State *L) {

  ofConsoleLoggerChannel *self = *((ofConsoleLoggerChannel **)dub_checksdata_n(L, 1, "ofConsoleLoggerChannel"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 1: {
      if (DUB_ASSERT_KEY(key, "ofBaseLoggerChannel")) break;
      *retval__ = static_cast<ofBaseLoggerChannel *>(self);
      return 1;
    }
  }
  return 0;
}
コード例 #27
0
ファイル: b2_BiFrictionJointDef.cpp プロジェクト: lubyk/b2
/** Cast (class_name)
 * 
 */
static int b2BiFrictionJointDef__cast_(lua_State *L) {

  b2BiFrictionJointDef *self = *((b2BiFrictionJointDef **)dub_checksdata_n(L, 1, "b2.BiFrictionJointDef"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 1: {
      if (DUB_ASSERT_KEY(key, "b2.JointDef")) break;
      *retval__ = static_cast<b2JointDef *>(self);
      return 1;
    }
  }
  return 0;
}
コード例 #28
0
ファイル: bt_HingeConstraint.cpp プロジェクト: lubyk/old_bt
/** Cast (class_name)
 * 
 */
static int btHingeConstraint__cast_(lua_State *L) {

  btHingeConstraint *self = *((btHingeConstraint **)dub_checksdata_n(L, 1, "bt.HingeConstraint"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 1: {
      if (DUB_ASSERT_KEY(key, "bt.TypedConstraint")) break;
      *retval__ = static_cast<btTypedConstraint *>(self);
      return 1;
    }
  }
  return 0;
}
コード例 #29
0
/** Set attributes (key, value)
 * 
 */
static int ofKeyEventArgs__set_(lua_State *L) {

  ofKeyEventArgs *self = *((ofKeyEventArgs **)dub_checksdata_n(L, 1, "ofKeyEventArgs"));
  const char *key = luaL_checkstring(L, 2);
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "type")) break;
      self->type = **((enum ofKeyEventArgs::Type **)dub_checksdata_n(L, 3, "enum ofKeyEventArgs::Type"));
      return 0;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "key")) break;
      self->key = luaL_checkint(L, 3);
      return 0;
    }
  }
  if (lua_istable(L, 1)) {
    lua_rawset(L, 1);
  } else {
    luaL_error(L, KEY_EXCEPTION_MSG, key);
  }
  return 0;
}
コード例 #30
0
/** Cast (class_name)
 * 
 */
static int ofKeyEventArgs__cast_(lua_State *L) {

  ofKeyEventArgs *self = *((ofKeyEventArgs **)dub_checksdata_n(L, 1, "ofKeyEventArgs"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "ofEventArgs")) break;
      *retval__ = static_cast<ofEventArgs *>(self);
      return 1;
    }
  }
  return 0;
}