本文整理汇总了C++中PrismaticJoint类的典型用法代码示例。如果您正苦于以下问题:C++ PrismaticJoint类的具体用法?C++ PrismaticJoint怎么用?C++ PrismaticJoint使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PrismaticJoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: w_PrismaticJoint_getMotorForce
int w_PrismaticJoint_getMotorForce(lua_State *L)
{
PrismaticJoint *t = luax_checkprismaticjoint(L, 1);
float inv_dt = (float)luaL_checknumber(L, 2);
lua_pushnumber(L, t->getMotorForce(inv_dt));
return 1;
}
示例2: testClosedKinematicLoop2
bool testClosedKinematicLoop2()
{
SharedPtr<Group> group = new Group("Group");
MobileRootJoint* mechanicRootJoint = new MobileRootJoint("RootJoint");
group->addChild(mechanicRootJoint);
RigidBody* rigidBody = new RigidBody("RigidBody");
group->addChild(rigidBody);
group->connect(mechanicRootJoint->getPort("link"),
rigidBody->addLink("rootLink"));
PrismaticJoint* prismaticJoint = new PrismaticJoint("PrismaticJoint");
group->addChild(prismaticJoint);
group->connect(rigidBody->addLink("jointLink0"),
prismaticJoint->getPort("link0"));
group->connect(rigidBody->addLink("jointLink1"),
prismaticJoint->getPort("link1"));
SharedPtr<System> system = new System("Closed kinematic Loop 1");
system->setNode(group);
if (system->init()) {
std::cerr << "Detection of klosed kinematic loop failed!" << std::endl;
return false;
}
return true;
}
示例3: w_PrismaticJoint_setLowerLimit
int w_PrismaticJoint_setLowerLimit(lua_State *L)
{
PrismaticJoint *t = luax_checkprismaticjoint(L, 1);
float arg1 = (float)luaL_checknumber(L, 2);
luax_catchexcept(L, [&](){ t->setLowerLimit(arg1); });
return 0;
}
示例4: w_PrismaticJoint_setMotorSpeed
int w_PrismaticJoint_setMotorSpeed(lua_State * L)
{
PrismaticJoint * t = luax_checkprismaticjoint(L, 1);
float arg1 = (float)luaL_checknumber(L, 2);
t->setMotorSpeed(arg1);
return 0;
}
示例5: _wrap_PrismaticJoint_setMaxMotorForce
int _wrap_PrismaticJoint_setMaxMotorForce(lua_State * L)
{
PrismaticJoint * t = luax_checkprismaticjoint(L, 1);
float arg1 = (float)luaL_checknumber(L, 2);
t->setMaxMotorForce(arg1);
return 0;
}
示例6: _wrap_PrismaticJoint_setLowerLimit
int _wrap_PrismaticJoint_setLowerLimit(lua_State * L)
{
PrismaticJoint * t = luax_checkprismaticjoint(L, 1);
float arg1 = (float)luaL_checknumber(L, 2);
t->setLowerLimit(arg1);
return 0;
}
示例7: w_PrismaticJoint_setLimitsEnabled
int w_PrismaticJoint_setLimitsEnabled(lua_State * L)
{
PrismaticJoint * t = luax_checkprismaticjoint(L, 1);
bool arg1 = luax_toboolean(L, 2);
t->setLimitsEnabled(arg1);
return 0;
}
示例8:
PrismaticJoint *luax_checkprismaticjoint(lua_State *L, int idx)
{
PrismaticJoint *j = luax_checktype<PrismaticJoint>(L, idx, "PrismaticJoint", PHYSICS_PRISMATIC_JOINT_T);
if (!j->isValid())
luaL_error(L, "Attempt to use destroyed joint.");
return j;
}
示例9: w_PrismaticJoint_setLimits
int w_PrismaticJoint_setLimits(lua_State * L)
{
PrismaticJoint * t = luax_checkprismaticjoint(L, 1);
float arg1 = (float)luaL_checknumber(L, 2);
float arg2 = (float)luaL_checknumber(L, 3);
t->setLimits(arg1, arg2);
return 0;
}
示例10: PX_CHECK_AND_RETURN_NULL
PxPrismaticJoint* physx::PxPrismaticJointCreate(PxPhysics& physics,
PxRigidActor* actor0, const PxTransform& localFrame0,
PxRigidActor* actor1, const PxTransform& localFrame1)
{
PX_CHECK_AND_RETURN_NULL(localFrame0.isValid(), "PxPrismaticJointCreate: local frame 0 is not a valid transform");
PX_CHECK_AND_RETURN_NULL(localFrame1.isValid(), "PxPrismaticJointCreate: local frame 1 is not a valid transform");
PX_CHECK_AND_RETURN_NULL(actor0 && actor0->is<PxRigidBody>() || actor1 && actor1->is<PxRigidBody>(), "PxPrismaticJointCreate: at least one actor must be dynamic");
PrismaticJoint* j = PX_NEW(PrismaticJoint)(physics.getTolerancesScale(), actor0, localFrame0, actor1, localFrame1);
if(j->attach(physics, actor0, actor1))
return j;
PX_DELETE(j);
return NULL;
}
示例11: setProperties
//==============================================================================
void PrismaticJoint::copy(const PrismaticJoint& _otherJoint)
{
if(this == &_otherJoint)
return;
setProperties(_otherJoint.getPrismaticJointProperties());
}
示例12: main
int main(void) {
using namespace mbslib;
MbsCompoundWithBuilder mbs;
mbs.addFixedBase();
mbs.addFork();
PrismaticJoint * pj = mbs.addPrismaticJoint(TVector3(1, 0, 0));
Endpoint * s1End1 = mbs.addEndpoint();
mbs.addFixedTranslation(TVector3(1, 0, 0));
mbs.addFork();
Endpoint * s1Midpoint = mbs.addEndpoint();
mbs.addFixedTranslation(TVector3(1, 0, 0));
RevoluteJoint * rj = mbs.addRevoluteJoint(TVector3(0, 0, 1));
mbs.addFork();
mbs.addFixedTranslation(TVector3(0, 1, 0));
Endpoint * s1End2 = mbs.addEndpoint();
mbs.addRigidLink(TVector3(1, 0, 0), TVector3::Zero(), 1, TMatrix3x3::Zero());
Endpoint * tcp = mbs.addEndpoint();
LinearSpringWithRopeModel springModel(1, 0, 1);
Spring3D * spring = mbs.addSpring(springModel);
(*spring) << s1End1 << s1Midpoint << s1End2;
//mbs.doDirkin();
//spring.resetForce();
//spring.applyForce();
mbs.doRne();
std::cout << s1End1->getCoordinateFrame().r.transpose() << std::endl;
std::cout << s1End2->getCoordinateFrame().r.transpose() << std::endl;
std::cout << tcp->getCoordinateFrame().r.transpose() << std::endl;
std::cout << spring->getSpringForce() << std::endl;
std::cout << pj->getJointForceTorque() << std::endl;
std::cout << rj->getJointForceTorque() << std::endl;
}
示例13: w_PrismaticJoint_getMotorForce
int w_PrismaticJoint_getMotorForce(lua_State * L)
{
PrismaticJoint * t = luax_checkprismaticjoint(L, 1);
lua_pushnumber(L, t->getMotorForce());
return 1;
}
示例14: _wrap_PrismaticJoint_isLimitsEnabled
int _wrap_PrismaticJoint_isLimitsEnabled(lua_State * L)
{
PrismaticJoint * t = luax_checkprismaticjoint(L, 1);
luax_pushboolean(L, t->isLimitsEnabled());
return 1;
}
示例15: w_PrismaticJoint_isMotorEnabled
int w_PrismaticJoint_isMotorEnabled(lua_State * L)
{
PrismaticJoint * t = luax_checkprismaticjoint(L, 1);
luax_pushboolean(L, t->isMotorEnabled());
return 1;
}