btBvhTriangleMeshShape link error

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
JohnBoyMan
Posts: 14
Joined: Tue Jun 28, 2011 4:11 am

btBvhTriangleMeshShape link error

Post by JohnBoyMan »

Hello. I am trying to use the btBvhTriangleMeshShapes like this.

Code: Select all


    btTriangleMesh *    mTriMesh = new btTriangleMesh();
	Ogre::Vector3        *vertices;
        unsigned int numFaces = 2 / 3;
		  int *indices;
        btVector3    vertexPos[3];
        for (size_t n = 0; n < numFaces; ++n)
        {
            for (unsigned int i = 0; i < 3; ++i)
            {
                const Ogre::Vector3 &vec = vertices[*indices];
                vertexPos[i][0] = vec.x;
                vertexPos[i][1] = vec.y;
                vertexPos[i][2] = vec.z;
                *indices++;
            }

            mTriMesh->addTriangle(vertexPos[0], vertexPos[1], vertexPos[2]);
        }

		const bool useQuantizedAABB = true;
        btBvhTriangleMeshShape *mShape = new btBvhTriangleMeshShape(mTriMesh, useQuantizedAABB);

    btTransform groundTransform11;
    groundTransform11.setIdentity();
    	
	groundTransform11.setOrigin(btVector3(BtOgre::Convert::toBullet( mW[k2] + Ogre::Vector3( 0,6,0 ) )));
    btScalar mass1( 0.0 );
    //bool isDynamic1 = ( mass1 != 0.f );
  
	btVector3 localInertia1( 0,0,0 );
    //if ( isDynamic1 )
    //mGroundShape->calculateLocalInertia( mass1,localInertia );


	MyMotionState* motionState11 = new MyMotionState( groundTransform11,rampNode[k2] );
    btRigidBody::btRigidBodyConstructionInfo rbInfo1( 1,motionState11,mShape,localInertia1 );
    body7[0] = new btRigidBody( rbInfo1 );
	body7[0]->setFriction( 0.1f ); 
    //body->setCollisionFlags(body->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); // It should be kinematic
    body7[0]->setActivationState(DISABLE_DEACTIVATION); //It should do it's job each and every frame
	//add the body to the dynamics world
    //errror source of access violation called before initializd
     //  rampNode[k2] ->setPosition(mW[k2] + Ogre::Vector3( 0,0,0 ));
	//buildDynamicsworld();
	  
	dynamicsWorld->addRigidBody(body7[0]);



I get this error

Error 1 error LNK2005: "public: virtual __thiscall btPolyhedralConvexShape::~btPolyhedralConvexShape(void)" (??1btPolyhedralConvexShape@@UAE@XZ) already defined in OgreBulletCollisions.lib(OgreBulletCollisionsTriangleShape.obj) C:\Users\john\documents\visual studio 2010\Projects\game\game\BulletCollision.lib(btPolyhedralConvexShape.obj) game
All the right libs and headers are referenced. Its soooo annoying please help.
Post Reply