Esempio n. 1
0
/** void ofVec2f::set(float _scalar)
 * api/openFrameworks/math/ofVec2f.h:37
 */
static int ofVec2f_set(lua_State *L) {
  try {
    ofVec2f *self = *((ofVec2f **)dub_checksdata(L, 1, "ofVec2f"));
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      float _x = dub_checknumber(L, 2);
      float _y = dub_checknumber(L, 3);
      self->set(_x, _y);
      return 0;
    } else {
      int type__ = lua_type(L, 2);
      if (type__ == LUA_TNUMBER) {
        float _scalar = dub_checknumber(L, 2);
        self->set(_scalar);
        return 0;
      } else {
        ofVec2f *vec = *((ofVec2f **)dub_checksdata(L, 2, "ofVec2f"));
        self->set(*vec);
        return 0;
      }
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "set: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "set: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 2
0
/** bool ofPolyline::inside(float x, float y)
 * api/openFrameworks/graphics/ofPolyline.h:107
 */
static int ofPolyline_inside(lua_State *L) {
  try {
    ofPolyline *self = *((ofPolyline **)dub_checksdata(L, 1, "ofPolyline"));
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      float x = dub_checknumber(L, 2);
      float y = dub_checknumber(L, 3);
      ofPolyline *polyline = *((ofPolyline **)dub_checksdata(L, 4, "ofPolyline"));
      lua_pushboolean(L, ofPolyline::inside(x, y, *polyline));
      return 1;
    } else if (top__ >= 3) {
      int type__ = lua_type(L, 2);
      if (type__ == LUA_TNUMBER) {
        float x = dub_checknumber(L, 2);
        float y = dub_checknumber(L, 3);
        lua_pushboolean(L, self->inside(x, y));
        return 1;
      } else {
        ofVec3f *p = *((ofVec3f **)dub_checksdata(L, 2, "ofVec3f"));
        ofPolyline *polyline = *((ofPolyline **)dub_checksdata(L, 3, "ofPolyline"));
        lua_pushboolean(L, ofPolyline::inside(*p, *polyline));
        return 1;
      }
    } else {
      ofVec3f *p = *((ofVec3f **)dub_checksdata(L, 2, "ofVec3f"));
      lua_pushboolean(L, self->inside(*p));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "inside: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "inside: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 3
0
/** void ofPolyline::addVertex(const ofPoint &p)
 * api/openFrameworks/graphics/ofPolyline.h:23
 */
static int ofPolyline_addVertex(lua_State *L) {
  try {
    ofPolyline *self = *((ofPolyline **)dub_checksdata(L, 1, "ofPolyline"));
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      float x = dub_checknumber(L, 2);
      float y = dub_checknumber(L, 3);
      float z = dub_checknumber(L, 4);
      self->addVertex(x, y, z);
      return 0;
    } else if (top__ >= 3) {
      float x = dub_checknumber(L, 2);
      float y = dub_checknumber(L, 3);
      self->addVertex(x, y);
      return 0;
    } else {
      ofVec3f *p = *((ofVec3f **)dub_checksdata(L, 2, "ofVec3f"));
      self->addVertex(*p);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "addVertex: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "addVertex: Unknown exception");
  }
  return dub_error(L);
}
/** btRigidBody::btRigidBodyConstructionInfo::btRigidBodyConstructionInfo(btScalar mass, btMotionState *motionState, btCollisionShape *collisionShape, const btVector3 &localInertia=btVector3(0, 0, 0))
 * src/vendor/bullet/src/BulletDynamics/Dynamics/btRigidBody.h:166
 */
static int btRigidBodyConstructionInfo_btRigidBodyConstructionInfo(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      btScalar mass = dub_checknumber(L, 1);
      btMotionState *motionState = *((btMotionState **)dub_checksdata(L, 2, "bt.MotionState"));
      btCollisionShape *collisionShape = *((btCollisionShape **)dub_checksdata(L, 3, "bt.CollisionShape"));
      btVector3 *localInertia = *((btVector3 **)dub_checksdata(L, 4, "bt.Vector3"));
      btRigidBody::btRigidBodyConstructionInfo *retval__ = new btRigidBody::btRigidBodyConstructionInfo(mass, motionState, collisionShape, *localInertia);
      dub_pushudata(L, retval__, "bt.RigidBody.RigidBodyConstructionInfo", true);
      return 1;
    } else {
      btScalar mass = dub_checknumber(L, 1);
      btMotionState *motionState = *((btMotionState **)dub_checksdata(L, 2, "bt.MotionState"));
      btCollisionShape *collisionShape = *((btCollisionShape **)dub_checksdata(L, 3, "bt.CollisionShape"));
      btRigidBody::btRigidBodyConstructionInfo *retval__ = new btRigidBody::btRigidBodyConstructionInfo(mass, motionState, collisionShape);
      dub_pushudata(L, retval__, "bt.RigidBody.RigidBodyConstructionInfo", 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. 5
0
/** void Pen::setHsva(float h, float s=1.0, float v=1.0, float a=1.0)
 * include/mimas/Pen.h:69
 */
static int Pen_setHsva(lua_State *L) {
  try {
    Pen *self = *((Pen **)dub_checksdata(L, 1, "mimas.Pen"));
    int top__ = lua_gettop(L);
    if (top__ >= 5) {
      float h = dub_checknumber(L, 2);
      float s = dub_checknumber(L, 3);
      float v = dub_checknumber(L, 4);
      float a = dub_checknumber(L, 5);
      self->setHsva(h, s, v, a);
      return 0;
    } else if (top__ >= 4) {
      float h = dub_checknumber(L, 2);
      float s = dub_checknumber(L, 3);
      float v = dub_checknumber(L, 4);
      self->setHsva(h, s, v);
      return 0;
    } else if (top__ >= 3) {
      float h = dub_checknumber(L, 2);
      float s = dub_checknumber(L, 3);
      self->setHsva(h, s);
      return 0;
    } else {
      float h = dub_checknumber(L, 2);
      self->setHsva(h);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "setHsva: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setHsva: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 6
0
/** void QWidget::setMinimumSize(float w, float h)
 * bind/QWidget.h:25
 */
static int TableView_setMinimumSize(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    float w = dub_checknumber(L, 2);
    float h = dub_checknumber(L, 3);
    self->setMinimumSize(w, h);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setMinimumSize: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setMinimumSize: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 7
0
/** void ofPolyline::arcNegative(const ofPoint &center, float radiusX, float radiusY, float angleBegin, float angleEnd, int curveResolution=20)
 * api/openFrameworks/graphics/ofPolyline.h:52
 */
static int ofPolyline_arcNegative(lua_State *L) {
  try {
    ofPolyline *self = *((ofPolyline **)dub_checksdata(L, 1, "ofPolyline"));
    int top__ = lua_gettop(L);
    if (top__ >= 7) {
      ofVec3f *center = *((ofVec3f **)dub_checksdata(L, 2, "ofVec3f"));
      float radiusX = dub_checknumber(L, 3);
      float radiusY = dub_checknumber(L, 4);
      float angleBegin = dub_checknumber(L, 5);
      float angleEnd = dub_checknumber(L, 6);
      int curveResolution = dub_checkint(L, 7);
      self->arcNegative(*center, radiusX, radiusY, angleBegin, angleEnd, curveResolution);
      return 0;
    } else {
      ofVec3f *center = *((ofVec3f **)dub_checksdata(L, 2, "ofVec3f"));
      float radiusX = dub_checknumber(L, 3);
      float radiusY = dub_checknumber(L, 4);
      float angleBegin = dub_checknumber(L, 5);
      float angleEnd = dub_checknumber(L, 6);
      self->arcNegative(*center, radiusX, radiusY, angleBegin, angleEnd);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "arcNegative: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "arcNegative: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 8
0
/** void btHingeConstraint::setMotorTarget(btScalar targetAngle, btScalar dt)
 * bind/btHingeConstraint.h:36
 */
static int btHingeConstraint_setMotorTarget(lua_State *L) {
  try {
    btHingeConstraint *self = *((btHingeConstraint **)dub_checksdata(L, 1, "bt.HingeConstraint"));
    btScalar targetAngle = dub_checknumber(L, 2);
    btScalar dt = dub_checknumber(L, 3);
    self->setMotorTarget(targetAngle, dt);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setMotorTarget: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setMotorTarget: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 9
0
/** void ofVideoGrabber::setAnchorPoint(float x, float y)
 * api/openFrameworks/video/ofVideoGrabber.h:45
 */
static int ofVideoGrabber_setAnchorPoint(lua_State *L) {
  try {
    ofVideoGrabber *self = *((ofVideoGrabber **)dub_checksdata(L, 1, "ofVideoGrabber"));
    float x = dub_checknumber(L, 2);
    float y = dub_checknumber(L, 3);
    self->setAnchorPoint(x, y);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setAnchorPoint: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setAnchorPoint: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 10
0
/** void ofFbo::setAnchorPercent(float xPct, float yPct)
 * api/openFrameworks/gl/ofFbo.h:22
 */
static int ofFbo_setAnchorPercent(lua_State *L) {
  try {
    ofFbo *self = *((ofFbo **)dub_checksdata(L, 1, "ofFbo"));
    float xPct = dub_checknumber(L, 2);
    float yPct = dub_checknumber(L, 3);
    self->setAnchorPercent(xPct, yPct);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setAnchorPercent: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setAnchorPercent: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 11
0
/** void b2Color::Set(float32 ri, float32 gi, float32 bi)
 * vendor/Box2D/Box2D/Common/b2Draw.h:29
 */
static int b2Color_Set(lua_State *L) {
    try {
        b2Color *self = *((b2Color **)dub_checksdata(L, 1, "b2.Color"));
        float32 ri = dub_checknumber(L, 2);
        float32 gi = dub_checknumber(L, 3);
        float32 bi = dub_checknumber(L, 4);
        self->Set(ri, gi, bi);
        return 0;
    } catch (std::exception &e) {
        lua_pushfstring(L, "Set: %s", e.what());
    } catch (...) {
        lua_pushfstring(L, "Set: Unknown exception");
    }
    return dub_error(L);
}
Esempio n. 12
0
/** void btHingeConstraint::enableAngularMotor(bool enableMotor, btScalar targetVelocity, btScalar maxMotorImpulse)
 * bind/btHingeConstraint.h:34
 */
static int btHingeConstraint_enableAngularMotor(lua_State *L) {
  try {
    btHingeConstraint *self = *((btHingeConstraint **)dub_checksdata(L, 1, "bt.HingeConstraint"));
    bool enableMotor = dub_checkboolean(L, 2);
    btScalar targetVelocity = dub_checknumber(L, 3);
    btScalar maxMotorImpulse = dub_checknumber(L, 4);
    self->enableAngularMotor(enableMotor, targetVelocity, maxMotorImpulse);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "enableAngularMotor: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "enableAngularMotor: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 13
0
/** void btMatrix3x3::getEulerYPR(btScalar &yaw, btScalar &pitch, btScalar &roll) const
 * src/vendor/bullet/src/LinearMath/btMatrix3x3.h:488
 */
static int btMatrix3x3_getEulerYPR(lua_State *L) {
  try {
    btMatrix3x3 *self = *((btMatrix3x3 **)dub_checksdata(L, 1, "bt.Matrix3x3"));
    btScalar yaw = dub_checknumber(L, 2);
    btScalar pitch = dub_checknumber(L, 3);
    btScalar roll = dub_checknumber(L, 4);
    self->getEulerYPR(yaw, pitch, roll);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "getEulerYPR: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "getEulerYPR: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 14
0
/** void btMatrix3x3::setEulerZYX(btScalar eulerX, btScalar eulerY, btScalar eulerZ)
 * src/vendor/bullet/src/LinearMath/btMatrix3x3.h:293
 */
static int btMatrix3x3_setEulerZYX(lua_State *L) {
  try {
    btMatrix3x3 *self = *((btMatrix3x3 **)dub_checksdata(L, 1, "bt.Matrix3x3"));
    btScalar eulerX = dub_checknumber(L, 2);
    btScalar eulerY = dub_checknumber(L, 3);
    btScalar eulerZ = dub_checknumber(L, 4);
    self->setEulerZYX(eulerX, eulerY, eulerZ);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setEulerZYX: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setEulerZYX: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 15
0
/** virtual void btConvexShape::project(const btTransform &trans, const btVector3 &dir, btScalar &min, btScalar &max) const
 * src/vendor/bullet/src/BulletCollision/CollisionShapes/btConvexShape.h:55
 */
static int btPolyhedralConvexShape_project(lua_State *L) {
    try {
        btPolyhedralConvexShape *self = *((btPolyhedralConvexShape **)dub_checksdata(L, 1, "bt.PolyhedralConvexShape"));
        btTransform *trans = *((btTransform **)dub_checksdata(L, 2, "bt.Transform"));
        btVector3 *dir = *((btVector3 **)dub_checksdata(L, 3, "bt.Vector3"));
        btScalar min = dub_checknumber(L, 4);
        btScalar max = dub_checknumber(L, 5);
        self->project(*trans, *dir, min, max);
        return 0;
    } catch (std::exception &e) {
        lua_pushfstring(L, "project: %s", e.what());
    } catch (...) {
        lua_pushfstring(L, "project: Unknown exception");
    }
    return dub_error(L);
}
Esempio n. 16
0
/** void btCollisionWorld::convexSweepTest(const btConvexShape *castShape, const btTransform &from, const btTransform &to, ConvexResultCallback &resultCallback, btScalar allowedCcdPenetration=btScalar(0.)) const
 * src/vendor/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.h:445
 */
static int btCollisionWorld_convexSweepTest(lua_State *L) {
  try {
    btCollisionWorld *self = *((btCollisionWorld **)dub_checksdata(L, 1, "bt.CollisionWorld"));
    int top__ = lua_gettop(L);
    if (top__ >= 6) {
      btConvexShape *castShape = *((btConvexShape **)dub_checksdata(L, 2, "bt.ConvexShape"));
      btTransform *from = *((btTransform **)dub_checksdata(L, 3, "bt.Transform"));
      btTransform *to = *((btTransform **)dub_checksdata(L, 4, "bt.Transform"));
      btCollisionWorld::ConvexResultCallback *resultCallback = *((btCollisionWorld::ConvexResultCallback **)dub_checksdata(L, 5, "bt.CollisionWorld.ConvexResultCallback"));
      btScalar allowedCcdPenetration = dub_checknumber(L, 6);
      self->convexSweepTest(castShape, *from, *to, *resultCallback, allowedCcdPenetration);
      return 0;
    } else {
      btConvexShape *castShape = *((btConvexShape **)dub_checksdata(L, 2, "bt.ConvexShape"));
      btTransform *from = *((btTransform **)dub_checksdata(L, 3, "bt.Transform"));
      btTransform *to = *((btTransform **)dub_checksdata(L, 4, "bt.Transform"));
      btCollisionWorld::ConvexResultCallback *resultCallback = *((btCollisionWorld::ConvexResultCallback **)dub_checksdata(L, 5, "bt.CollisionWorld.ConvexResultCallback"));
      self->convexSweepTest(castShape, *from, *to, *resultCallback);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "convexSweepTest: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "convexSweepTest: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 17
0
/** void QWidget::globalMove(float x, float y)
 * bind/QWidget.h:79
 */
static int TableView_globalMove(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    float x = dub_checknumber(L, 2);
    float y = dub_checknumber(L, 3);
    self->move(
      self->mapToParent(
        self->mapFromGlobal(QPoint(x, y))
      )
    );
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "globalMove: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "globalMove: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 18
0
/** ofVec2f& ofVec2f::rotateRad(float angle)
 * api/openFrameworks/math/ofVec2f.h:95
 */
static int ofVec2f_rotateRad(lua_State *L) {
  try {
    ofVec2f *self = *((ofVec2f **)dub_checksdata(L, 1, "ofVec2f"));
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      float angle = dub_checknumber(L, 2);
      ofVec2f *pivot = *((ofVec2f **)dub_checksdata(L, 3, "ofVec2f"));
      dub_pushudata(L, &self->rotateRad(angle, *pivot), "ofVec2f", false);
      return 1;
    } else {
      float angle = dub_checknumber(L, 2);
      dub_pushudata(L, &self->rotateRad(angle), "ofVec2f", false);
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "rotateRad: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "rotateRad: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 19
0
/** ofVec2f::ofVec2f()
 * api/openFrameworks/math/ofVec2f.h:13
 */
static int ofVec2f_ofVec2f(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      float _x = dub_checknumber(L, 1);
      float _y = dub_checknumber(L, 2);
      ofVec2f *retval__ = new ofVec2f(_x, _y);
      dub_pushudata(L, retval__, "ofVec2f", true);
      return 1;
    } else if (top__ >= 1) {
      int type__ = lua_type(L, 1);
      void **ptr1__;
      if (type__ == LUA_TNUMBER) {
        float _scalar = dub_checknumber(L, 1);
        ofVec2f *retval__ = new ofVec2f(_scalar);
        dub_pushudata(L, retval__, "ofVec2f", true);
        return 1;
      } else if ( (ptr1__ = dub_issdata(L, 1, "ofVec3f", type__)) ) {
        ofVec3f *vec = *((ofVec3f **)ptr1__);
        ofVec2f *retval__ = new ofVec2f(*vec);
        dub_pushudata(L, retval__, "ofVec2f", true);
        return 1;
      } else {
        ofVec4f *vec = *((ofVec4f **)dub_checksdata(L, 1, "ofVec4f"));
        ofVec2f *retval__ = new ofVec2f(*vec);
        dub_pushudata(L, retval__, "ofVec2f", true);
        return 1;
      }
    } else {
      ofVec2f *retval__ = new ofVec2f();
      dub_pushudata(L, retval__, "ofVec2f", 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. 20
0
/** void btMatrix3x3::getEulerZYX(btScalar &yaw, btScalar &pitch, btScalar &roll, unsigned int solution_number=1) const
 * src/vendor/bullet/src/LinearMath/btMatrix3x3.h:517
 */
static int btMatrix3x3_getEulerZYX(lua_State *L) {
  try {
    btMatrix3x3 *self = *((btMatrix3x3 **)dub_checksdata(L, 1, "bt.Matrix3x3"));
    int top__ = lua_gettop(L);
    if (top__ >= 5) {
      btScalar yaw = dub_checknumber(L, 2);
      btScalar pitch = dub_checknumber(L, 3);
      btScalar roll = dub_checknumber(L, 4);
      unsigned int solution_number = dub_checkint(L, 5);
      self->getEulerZYX(yaw, pitch, roll, solution_number);
      return 0;
    } else {
      btScalar yaw = dub_checknumber(L, 2);
      btScalar pitch = dub_checknumber(L, 3);
      btScalar roll = dub_checknumber(L, 4);
      self->getEulerZYX(yaw, pitch, roll);
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "getEulerZYX: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "getEulerZYX: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 21
0
/** void btHingeConstraint::setMaxMotorImpulse(btScalar maxMotorImpulse)
 * bind/btHingeConstraint.h:39
 */
static int btHingeConstraint_setMaxMotorImpulse(lua_State *L) {
  try {
    btHingeConstraint *self = *((btHingeConstraint **)dub_checksdata(L, 1, "bt.HingeConstraint"));
    btScalar maxMotorImpulse = dub_checknumber(L, 2);
    self->setMaxMotorImpulse(maxMotorImpulse);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setMaxMotorImpulse: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setMaxMotorImpulse: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 22
0
/** ofPolyline ofPolyline::getResampledBySpacing(float spacing)
 * api/openFrameworks/graphics/ofPolyline.h:90
 */
static int ofPolyline_getResampledBySpacing(lua_State *L) {
  try {
    ofPolyline *self = *((ofPolyline **)dub_checksdata(L, 1, "ofPolyline"));
    float spacing = dub_checknumber(L, 2);
    dub_pushudata(L, new ofPolyline(self->getResampledBySpacing(spacing)), "ofPolyline", true);
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "getResampledBySpacing: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "getResampledBySpacing: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 23
0
/** virtual void btConvexInternalShape::setMargin(btScalar margin)
 * src/vendor/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.h:110
 */
static int btPolyhedralConvexShape_setMargin(lua_State *L) {
    try {
        btPolyhedralConvexShape *self = *((btPolyhedralConvexShape **)dub_checksdata(L, 1, "bt.PolyhedralConvexShape"));
        btScalar margin = dub_checknumber(L, 2);
        self->setMargin(margin);
        return 0;
    } catch (std::exception &e) {
        lua_pushfstring(L, "setMargin: %s", e.what());
    } catch (...) {
        lua_pushfstring(L, "setMargin: Unknown exception");
    }
    return dub_error(L);
}
Esempio n. 24
0
/** virtual btScalar btCollisionShape::getContactBreakingThreshold(btScalar defaultContactThresholdFactor) const
 * src/vendor/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.h:53
 */
static int btPolyhedralConvexShape_getContactBreakingThreshold(lua_State *L) {
    try {
        btPolyhedralConvexShape *self = *((btPolyhedralConvexShape **)dub_checksdata(L, 1, "bt.PolyhedralConvexShape"));
        btScalar defaultContactThresholdFactor = dub_checknumber(L, 2);
        lua_pushnumber(L, self->getContactBreakingThreshold(defaultContactThresholdFactor));
        return 1;
    } catch (std::exception &e) {
        lua_pushfstring(L, "getContactBreakingThreshold: %s", e.what());
    } catch (...) {
        lua_pushfstring(L, "getContactBreakingThreshold: Unknown exception");
    }
    return dub_error(L);
}
Esempio n. 25
0
/** b2Color::b2Color()
 * vendor/Box2D/Box2D/Common/b2Draw.h:27
 */
static int b2Color_b2Color(lua_State *L) {
    try {
        int top__ = lua_gettop(L);
        if (top__ >= 3) {
            float32 r = dub_checknumber(L, 1);
            float32 g = dub_checknumber(L, 2);
            float32 b = dub_checknumber(L, 3);
            b2Color *retval__ = new b2Color(r, g, b);
            dub_pushudata(L, retval__, "b2.Color", true);
            return 1;
        } else {
            b2Color *retval__ = new b2Color();
            dub_pushudata(L, retval__, "b2.Color", true);
            return 1;
        }
    } catch (std::exception &e) {
        lua_pushfstring(L, "b2Color: %s", e.what());
    } catch (...) {
        lua_pushfstring(L, "b2Color: Unknown exception");
    }
    return dub_error(L);
}
Esempio n. 26
0
/** b2Vec2 b2MouseJoint::GetReactionForce(float32 inv_dt) const
 * vendor/Box2D/Box2D/Dynamics/Joints/b2MouseJoint.h:71
 */
static int b2MouseJoint_GetReactionForce(lua_State *L) {
  try {
    b2MouseJoint *self = *((b2MouseJoint **)dub_checksdata(L, 1, "b2.MouseJoint"));
    float32 inv_dt = dub_checknumber(L, 2);
    dub_pushudata(L, new b2Vec2(self->GetReactionForce(inv_dt)), "b2.Vec2", true);
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "GetReactionForce: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "GetReactionForce: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 27
0
/** void b2MouseJoint::SetDampingRatio(float32 ratio)
 * vendor/Box2D/Box2D/Dynamics/Joints/b2MouseJoint.h:89
 */
static int b2MouseJoint_SetDampingRatio(lua_State *L) {
  try {
    b2MouseJoint *self = *((b2MouseJoint **)dub_checksdata(L, 1, "b2.MouseJoint"));
    float32 ratio = dub_checknumber(L, 2);
    self->SetDampingRatio(ratio);
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "SetDampingRatio: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "SetDampingRatio: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 28
0
/** ofVec2f& ofVec2f::scale(const float length)
 * api/openFrameworks/math/ofVec2f.h:87
 */
static int ofVec2f_scale(lua_State *L) {
  try {
    ofVec2f *self = *((ofVec2f **)dub_checksdata(L, 1, "ofVec2f"));
    const float length = dub_checknumber(L, 2);
    dub_pushudata(L, &self->scale(length), "ofVec2f", false);
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "scale: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "scale: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 29
0
/** ofVec2f& ofVec2f::limit(float max)
 * api/openFrameworks/math/ofVec2f.h:144
 */
static int ofVec2f_limit(lua_State *L) {
  try {
    ofVec2f *self = *((ofVec2f **)dub_checksdata(L, 1, "ofVec2f"));
    float max = dub_checknumber(L, 2);
    dub_pushudata(L, &self->limit(max), "ofVec2f", false);
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "limit: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "limit: Unknown exception");
  }
  return dub_error(L);
}
Esempio n. 30
0
/** ofVec2f ofVec2f::getLimited(float max) const
 * api/openFrameworks/math/ofVec2f.h:143
 */
static int ofVec2f_getLimited(lua_State *L) {
  try {
    ofVec2f *self = *((ofVec2f **)dub_checksdata(L, 1, "ofVec2f"));
    float max = dub_checknumber(L, 2);
    dub_pushudata(L, new ofVec2f(self->getLimited(max)), "ofVec2f", true);
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "getLimited: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "getLimited: Unknown exception");
  }
  return dub_error(L);
}