mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-05 15:21:06 +00:00
rename loadUrdf -> loadMultiBodyFromUrdf in lua script
remove unused m_usrd2mblink
This commit is contained in:
parent
e196ed1edb
commit
c9a630e7c6
@ -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()
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ class MyMultiBodyCreator : public MultiBodyCreationInterface
|
||||
|
||||
public:
|
||||
|
||||
btAlignedObjectArray<int> m_urdf2mbLink;
|
||||
btAlignedObjectArray<int> m_mb2urdfLink;
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user