static bodies don't apear?

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

static bodies don't apear?

Post by JohnBoyMan »

Hello. I am trying to set up a static body like this. When i set the mass to zero nothing appears on my ogre window. When the mass is set to anything else it will appear. I don't understand. Is there a better way to do static bodies, thanks.

Code: Select all


	 btTransform startTransform6;
     startTransform6.setIdentity();
	 //Ogre::Vector3( Ogre::Vector3(mW[k].x,0,mW[k].z) + Ogre::Vector3(0 , buildsiteWall[k].height[0]+100 , 0) ))BtOgre::Convert::toBullet(Ogre::Vector3(mW[0].x,0,mW[0].z) + Ogre::Vector3(0 , buildsiteWall[0].height[0]+100 , 0))) 
     startTransform6.setOrigin( btVector3(btVector3(mW[0].x,0,mW[0].z) + btVector3(0 , buildsiteWall[0].height[0] + 10 , 0) ));
     btScalar mass6(0);
	 // colShape->setPosition(btTransform::getIdentity(), min, max);
     //rigidbody is dynamic if and only if mass is non zero, otherwise static
     // bool isDynamic1 = (mass6 != 0.f);
	 
     btVector3 localInertia8(0,0,0);
    // if (isDynamic1)
     //colShape->calculateLocalInertia( mass6, localInertia8 );
              
	     btScalar mass1( 0.0 );
  //  bool isDynamic1 = ( mass1 != 0.f );
  
   //	btVector3 localInertia8( 0,0,0 );
   // if ( isDynamic1 )
            colShape->calculateLocalInertia( mass1,localInertia8 );

	 myMotionState8 = new MyMotionState(startTransform6,wall1[0]);
     btRigidBody::btRigidBodyConstructionInfo rbInfo6(mass1,myMotionState8,colShape,localInertia8);
     body6[0] = new btRigidBody(rbInfo6);
	 body6[0]->setAngularFactor(.0f);
	 body6[0]->setFriction(0.8f); 

  	 body6[0]->setActivationState(DISABLE_DEACTIVATION);


User avatar
Dr.Shepherd
Posts: 168
Joined: Tue Jan 04, 2011 11:47 pm
Contact:

Re: static bodies don't apear?

Post by Dr.Shepherd »

I suppose there is no need to calculateLocalInertial for static object, try commenting out that sentence
Post Reply