diff --git a/data/init_physics.lua b/data/init_physics.lua index 12ff73f07..9d764533f 100644 --- a/data/init_physics.lua +++ b/data/init_physics.lua @@ -1,8 +1,6 @@ -- Very basic Lua script to create some Bullet objects. --- See also Demos3/AllBullet2Demos using Demos3/bullet2/LuaDemo +-- See also examples/LuaDemo ---right now we cannot interleave adding instances of different shapes, they have to be added in-order ---hence the two loops. this will be fixed soon world = createDefaultDynamicsWorld() diff --git a/data/init_urdf.lua b/data/init_urdf.lua index 681ed21d3..7997a8fdd 100644 --- a/data/init_urdf.lua +++ b/data/init_urdf.lua @@ -14,7 +14,7 @@ body = createRigidBody(world,cubeshape,mass,pos,orn) pos={0,10,0} orn = {0,0,0,1} -mb = loadUrdf(world,"r2d2.urdf", pos, orn); +mb = loadMultiBodyFromUrdf(world,"r2d2.urdf", pos, orn); pos={2,2,0} orn = {0,0,0,1} -mb = loadUrdf(world,"r2d2.urdf", pos, orn); +mb = loadMultiBodyFromUrdf(world,"r2d2.urdf", pos, orn); diff --git a/examples/Importers/ImportURDFDemo/MyMultiBodyCreator.cpp b/examples/Importers/ImportURDFDemo/MyMultiBodyCreator.cpp index c0f60066d..60226271b 100644 --- a/examples/Importers/ImportURDFDemo/MyMultiBodyCreator.cpp +++ b/examples/Importers/ImportURDFDemo/MyMultiBodyCreator.cpp @@ -20,7 +20,7 @@ MyMultiBodyCreator::MyMultiBodyCreator(GUIHelperInterface* guiHelper) class btMultiBody* MyMultiBodyCreator::allocateMultiBody(int /* urdfLinkIndex */, int totalNumJoints,btScalar mass, const btVector3& localInertiaDiagonal, bool isFixedBase, bool canSleep, bool multiDof) { - m_urdf2mbLink.resize(totalNumJoints+1,-2); +// m_urdf2mbLink.resize(totalNumJoints+1,-2); m_mb2urdfLink.resize(totalNumJoints+1,-2); m_bulletMultiBody = new btMultiBody(totalNumJoints,mass,localInertiaDiagonal,isFixedBase,canSleep,multiDof); @@ -50,7 +50,7 @@ class btGeneric6DofSpring2Constraint* MyMultiBodyCreator::allocateGeneric6DofSpr void MyMultiBodyCreator::addLinkMapping(int urdfLinkIndex, int mbLinkIndex) { - m_urdf2mbLink[urdfLinkIndex] = mbLinkIndex; +// m_urdf2mbLink[urdfLinkIndex] = mbLinkIndex; m_mb2urdfLink[mbLinkIndex] = urdfLinkIndex; } diff --git a/examples/Importers/ImportURDFDemo/MyMultiBodyCreator.h b/examples/Importers/ImportURDFDemo/MyMultiBodyCreator.h index f28360313..71b2f18f2 100644 --- a/examples/Importers/ImportURDFDemo/MyMultiBodyCreator.h +++ b/examples/Importers/ImportURDFDemo/MyMultiBodyCreator.h @@ -19,7 +19,6 @@ class MyMultiBodyCreator : public MultiBodyCreationInterface public: - btAlignedObjectArray m_urdf2mbLink; btAlignedObjectArray m_mb2urdfLink; diff --git a/examples/LuaDemo/LuaPhysicsSetup.cpp b/examples/LuaDemo/LuaPhysicsSetup.cpp index 5d9a4f39b..bb55e54a6 100644 --- a/examples/LuaDemo/LuaPhysicsSetup.cpp +++ b/examples/LuaDemo/LuaPhysicsSetup.cpp @@ -269,7 +269,7 @@ static int gCreateRigidBody (lua_State *L) if (!lua_isuserdata(L,2)) { - std::cerr << "error: second argument to b3CreateRigidbody should be world"; + std::cerr << "error: second argument to b3CreateRigidbody should be collision shape"; return 0; } @@ -291,7 +291,6 @@ static int gCreateRigidBody (lua_State *L) } - btRigidBody* body = new btRigidBody(mass,0,colShape,inertia); body->getWorldTransform().setOrigin(pos); body->getWorldTransform().setRotation(orn); @@ -409,7 +408,8 @@ void LuaPhysicsSetup::initPhysics() lua_register(L, "deleteDynamicsWorld", gDeleteDynamicsWorld); lua_register(L, "createCubeShape", gCreateCubeShape); lua_register(L, "createSphereShape", gCreateSphereShape); - lua_register(L, "loadUrdf",gLoadMultiBodyFromUrdf); + lua_register(L, "loadMultiBodyFromUrdf",gLoadMultiBodyFromUrdf); + lua_register(L, "createRigidBody", gCreateRigidBody); lua_register(L, "setBodyPosition", gSetBodyPosition); lua_register(L, "setBodyOrientation", gSetBodyOrientation);