I have the following error when i try to build an object composed of two different shapes:
error C3861: 'localCreateRigidBody': identifier not found
I use Bullet 2.78 and I ve introduced the files linearMath, BulletCollision, BulletDynamics, btBulletDynamicsCommon.h.
What file should I introduce in order to use localcreaterigidbody? or do you have any alternative to create a rigid body from 2 different shapes A and B?
Thanks
error C3861: 'localCreateRigidBody': identifier not found
-
- Posts: 5
- Joined: Sun May 22, 2011 6:09 pm
-
- Posts: 225
- Joined: Wed Jan 07, 2009 11:43 am
- Location: London
Re: error C3861: 'localCreateRigidBody': identifier not foun
localCreateRigidBody is just a shortcut method in the demo classes for creating and adding a rigid body to the world.
it sounds like what you're actually looking for is a CompoundCollisionShape?
it sounds like what you're actually looking for is a CompoundCollisionShape?
-
- Posts: 5
- Joined: Sun May 22, 2011 6:09 pm
Re: error C3861: 'localCreateRigidBody': identifier not foun
Well, I use CompoundCollisionShape but what should I use to create the final Rigid Body that will collide composed of the two objects A and B. In the demos, they use localcreaterigidbody to create the fork in the demo forklift. So what should I use?
Thanks
Thanks
-
- Posts: 225
- Joined: Wed Jan 07, 2009 11:43 am
- Location: London
Re: error C3861: 'localCreateRigidBody': identifier not foun
You can look at BasicDemo.cpp for this (relevant code below)
Code: Select all
//We can also use DemoApplication::localCreateRigidBody, but for clarity it is provided here:
{
btScalar mass(0.);
//rigidbody is dynamic if and only if mass is non zero, otherwise static
bool isDynamic = (mass != 0.f);
btVector3 localInertia(0,0,0);
if (isDynamic)
groundShape->calculateLocalInertia(mass,localInertia);
//using motionstate is recommended, it provides interpolation capabilities, and only synchronizes 'active' objects
btDefaultMotionState* myMotionState = new btDefaultMotionState(groundTransform);
btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,myMotionState,groundShape,localInertia);
btRigidBody* body = new btRigidBody(rbInfo);
//add the body to the dynamics world
m_dynamicsWorld->addRigidBody(body);
}