Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Set a position.
PostPosted: Sat Jul 17, 2010 8:55 am 
Offline

Joined: Sat Jul 17, 2010 8:48 am
Posts: 2
I've just been using translate() in the following manner:

Code:
btTransform trans;
    body->getMotionState()->getWorldTransform(trans);
    body->translate(btVector3(newPosition - trans.getOrigin().getX(), 0, 0));


to set position.

This function stops doing anything after a little while, destroying and recreating the body fixs it.

How exactly are you meant to set a position?
Why is this happening?


Top
 Profile  
 
 Post subject: Re: Set a position.
PostPosted: Sun Oct 10, 2010 6:15 am 
Offline

Joined: Sun Oct 10, 2010 6:13 am
Posts: 4
I have this same problem and would like to know as well.

Just started looking into Bullet, running off the HelloWorld tutorial so far.


Top
 Profile  
 
 Post subject: Re: Set a position.
PostPosted: Sun Oct 10, 2010 6:34 am 
Offline

Joined: Sun Oct 10, 2010 6:13 am
Posts: 4
Getting closer. Found this on rigidBodies:

"Kinematic objects, which are objects without mass, but the user can move them. There is on-way interaction, and Bullet calculates a velocity based on the timestep and previous and current world transform. Bullet automatically deactivates dynamic rigid bodies, when the velocity is below a threshold for a given time. Deactivated (sleeping) rigid bodies don't take any processing time, except a minor broadphase collision detection impact (to allow active objects to activate/wake up sleeping objects)" - http://bulletphysics.com/Bullet/BulletFull/


Top
 Profile  
 
 Post subject: Re: Set a position.
PostPosted: Sun Oct 10, 2010 6:39 am 
Offline

Joined: Sun Oct 10, 2010 6:13 am
Posts: 4
Found it. Here you go:


fallRigidBody->setActivationState(ACTIVE_TAG);


Top
 Profile  
 
 Post subject: Re: Set a position.
PostPosted: Sun Oct 10, 2010 6:50 am 
Offline

Joined: Sun Oct 10, 2010 6:13 am
Posts: 4
One problem still.

If gravity is set too low (-47 or less) I can still change the position, but the gravitational pull stops.


Top
 Profile  
 
 Post subject: Re: Set a position.
PostPosted: Mon Nov 29, 2010 12:10 am 
Offline

Joined: Sat Jul 17, 2010 8:48 am
Posts: 2
Imago wrote:
Found it. Here you go:
fallRigidBody->setActivationState(ACTIVE_TAG);


Hmm, still didn't work for me. Just has the same result. At the moment I am recreating the body every time I wish to set the position. Let's hope this isn't too expensive doing many times.

Best of luck with your project.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group