• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dub_checknumber函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中dub_checknumber函数的典型用法代码示例。如果您正苦于以下问题:C++ dub_checknumber函数的具体用法?C++ dub_checknumber怎么用?C++ dub_checknumber使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了dub_checknumber函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ofVec2f_set

/** 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);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:31,代码来源:ofVec2f.cpp


示例2: ofPolyline_inside

/** 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);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:38,代码来源:ofPolyline.cpp


示例3: ofPolyline_addVertex

/** 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);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:30,代码来源:ofPolyline.cpp


示例4: btRigidBodyConstructionInfo_btRigidBodyConstructionInfo

/** 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);
}
开发者ID:lubyk,项目名称:old_bt,代码行数:29,代码来源:bt_RigidBody_RigidBodyConstructionInfo.cpp


示例5: Pen_setHsva

/** 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);
}
开发者ID:lubyk,项目名称:mimas,代码行数:37,代码来源:mimas_Pen.cpp


示例6: TableView_setMinimumSize

/** 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);
}
开发者ID:lubyk,项目名称:mimas,代码行数:17,代码来源:mimas_TableView.cpp


示例7: ofPolyline_arcNegative

/** 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);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:32,代码来源:ofPolyline.cpp


示例8: btHingeConstraint_setMotorTarget

/** 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);
}
开发者ID:lubyk,项目名称:old_bt,代码行数:17,代码来源:bt_HingeConstraint.cpp


示例9: ofVideoGrabber_setAnchorPoint

/** 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);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:17,代码来源:ofVideoGrabber.cpp


示例10: ofFbo_setAnchorPercent

/** 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);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:17,代码来源:ofFbo.cpp


示例11: b2Color_Set

/** 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);
}
开发者ID:lubyk,项目名称:b2,代码行数:18,代码来源:b2_Color.cpp


示例12: btHingeConstraint_enableAngularMotor

/** 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);
}
开发者ID:lubyk,项目名称:old_bt,代码行数:18,代码来源:bt_HingeConstraint.cpp


示例13: btMatrix3x3_getEulerYPR

/** 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);
}
开发者ID:lubyk,项目名称:old_bt,代码行数:18,代码来源:bt_Matrix3x3.cpp


示例14: btMatrix3x3_setEulerZYX

/** 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);
}
开发者ID:lubyk,项目名称:old_bt,代码行数:18,代码来源:bt_Matrix3x3.cpp


示例15: btPolyhedralConvexShape_project

/** 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);
}
开发者ID:lubyk,项目名称:old_bt,代码行数:19,代码来源:bt_PolyhedralConvexShape.cpp


示例16: btCollisionWorld_convexSweepTest

/** 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);
}
开发者ID:lubyk,项目名称:old_bt,代码行数:30,代码来源:bt_CollisionWorld.cpp


示例17: TableView_globalMove

/** 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);
}
开发者ID:lubyk,项目名称:mimas,代码行数:21,代码来源:mimas_TableView.cpp


示例18: ofVec2f_rotateRad

/** 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);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:24,代码来源:ofVec2f.cpp


示例19: ofVec2f_ofVec2f

/** 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);
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:43,代码来源:ofVec2f.cpp


示例20: btMatrix3x3_getEulerZYX

/** 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);
}
开发者ID:lubyk,项目名称:old_bt,代码行数:28,代码来源:bt_Matrix3x3.cpp



注:本文中的dub_checknumber函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dub_checksdata函数代码示例发布时间:2022-05-30
下一篇:
C++ dub_checkint函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap