Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Top-down object movement
PostPosted: Sun Oct 14, 2012 7:10 am 
Offline

Joined: Fri Sep 14, 2012 3:14 am
Posts: 6
If I was looking at a btRigidBody from top down and I wanted to have the movement be so that when I press forward it will always go in its forward direction, even after I turn it, how would I apply forward movement and rotation?

For direction it appears that I would use applyCentralForce, what what force? Is there a way to apply the forward direction as a force?
For rotation would it be as simple as just rotating the transform?


Top
 Profile  
 
PostPosted: Fri Oct 19, 2012 6:47 am 
Offline

Joined: Fri Sep 14, 2012 3:14 am
Posts: 6
Am I missing any information that may provide assistance with my question?


Top
 Profile  
 
PostPosted: Thu Oct 25, 2012 6:03 am 
Offline

Joined: Fri Sep 14, 2012 3:14 am
Posts: 6
Is there anyone that could help me with this?


Top
 Profile  
 
PostPosted: Thu Oct 25, 2012 6:14 am 
Offline

Joined: Thu Oct 25, 2012 6:12 am
Posts: 1
what type of help you want.


Top
 Profile  
 
PostPosted: Thu Oct 25, 2012 6:25 am 
Offline

Joined: Fri Sep 14, 2012 3:14 am
Posts: 6
harrybro wrote:
what type of help you want.


With my original question, or if my original question is missing information, why information is it missing?


Top
 Profile  
 
PostPosted: Fri Oct 26, 2012 4:37 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3860
Location: California, USA
The 'forward' direction you refer to is likely one of the local principal axis, such as the X, Y or Z axis.

You can use btVector3 localXdir = rigidbody->getWorldTransform().getBasis().getColumn(0); to get the local x axis,
use 1 or 2 for Y and Z.

Attached is a simple BasicDemo replacement, just unzip and copy the files over the existing demo in Bullet/Demos/BasicDemo and use the cursor keys to move around.
The sample is too simple to be practical, but it gives you an idea about movement.

Thanks,
Erwin


Attachments:
BasicDemo.zip [4.27 KiB]
Downloaded 203 times
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: Exabot [Bot] and 7 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