bug setting a new position to a dynamic object

User avatar
cippyboy
Posts: 36
Joined: Fri Aug 25, 2006 1:00 am
Location: Bucharest

bug setting a new position to a dynamic object

Post by cippyboy »

*Still using Bullet 1.9*

The thing is like this : I have a ball that I control, initially I put a position in the MotionState and create the object and then (I saw that modifing the motionsate afterwards doesn't do anything, it's just used to copy data from somewhere else) I used the ccdPhysicsController->setPosition which works but... I have my ball on the surface and I save it's position and next time I wanna load the position, the thing is that if I do this without exiting the program and going back in, it all works fine but when I go back in, my object is pushed away really-really far, and now I gotta add 0.5 to Y to fix that, is that a bug or I was missing something or... I must upgrade ?

BTW: Bullet has these Vector2/Vector3 Classes, which I got as well,so if I wanna upgrade I gotta rename them as I did before, and it's a pain, a namespace of something could sort it out or something like BulletVector3 or btVector3 ? If this is different on recent release then let me know.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: bug setting a new position to a dynamic object

Post by Erwin Coumans »

Please upgrade to Bullet 2.33 and read its Bullet User Manual and all should be fixed:
- All Bullet classes start with bt, so its btVector3 now.
- to set the position/transform of a dynamic body, just call rigidbody->setCenterOfMassTransform(newtrans).

Cheers,
Erwin


cippyboy wrote:*Still using Bullet 1.9*

The thing is like this : I have a ball that I control, initially I put a position in the MotionState and create the object and then (I saw that modifing the motionsate afterwards doesn't do anything, it's just used to copy data from somewhere else) I used the ccdPhysicsController->setPosition which works but... I have my ball on the surface and I save it's position and next time I wanna load the position, the thing is that if I do this without exiting the program and going back in, it all works fine but when I go back in, my object is pushed away really-really far, and now I gotta add 0.5 to Y to fix that, is that a bug or I was missing something or... I must upgrade ?

BTW: Bullet has these Vector2/Vector3 Classes, which I got as well,so if I wanna upgrade I gotta rename them as I did before, and it's a pain, a namespace of something could sort it out or something like BulletVector3 or btVector3 ? If this is different on recent release then let me know.
User avatar
cippyboy
Posts: 36
Joined: Fri Aug 25, 2006 1:00 am
Location: Bucharest

Post by cippyboy »

Cool, I was avoiding that, thanks.