Bodies don't move

tuxbook
Posts: 10
Joined: Sun Aug 03, 2008 8:40 am

Re: Bodies don't move

Post by tuxbook »

Ok, I set-up my graphics object to inherit from btMotionState. I defined getWorldTransform() and setWorldTransform() as follows:

Code: Select all

void GraphicsObject::getWorldTransform(btTransform& worldTrans) const
{
	worldTrans.setOrigin(btVector3(position.x, position.y, position.z));
}

void GraphicsObject::setWorldTransform(const btTransform& worldTrans)
{
	D3DXVECTOR3 old = position;
	position.x = worldTrans.getOrigin().x();
	position.y = worldTrans.getOrigin().y();
	position.z = worldTrans.getOrigin().z();
	if (position != old)
		std::cout << "changed! ";
}
This prints "changed!" twice for each object (it used to only print it once per object). So still the same problem of nothing moving.

Do I have the right idea here?
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: Bodies don't move

Post by sparkprime »

Yeah, I think it's time you pasted your whole code. Also give this code a try:

http://www.bulletphysics.com/Bullet/php ... f=9&t=2192

It has zero dependencies so should work for you.

Also look at the demos and verify they work.
tuxbook
Posts: 10
Joined: Sun Aug 03, 2008 8:40 am

Re: Bodies don't move

Post by tuxbook »

I went through the link you gave me, and my code looks nearly identical.

I tried running it on a different computer AND IT WORKS!! Yay!!!!

So I suppose it has something to do with my computer's set-up. I'll try re-building Bullet when I get home.