Jump to content

  • Log In with Google      Sign In   
  • Create Account

How to change RigidBody rotation in Bullet Physics?


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
5 replies to this topic

#1   Members   

891
Like
0Likes
Like

Posted 27 October 2012 - 04:50 PM

How can I change (Pitch, Yaw, Roll) of a RigidBody in Bullet Physics?

I am using DirectX and C++.

#2   Members   

4976
Like
0Likes
Like

Posted 29 October 2012 - 12:48 AM

Kinematic rigid bodies: you update a new quaternion using its MotionState. It is also possible to fetch it directly to the object (you probably want to do the former).
Dynamic rigid bodies: in line of concept you should do that by injecting forces. I don't recommend to do that.
Static rigid bodies: just don't.

Previously "Krohm"


#3   Members   

891
Like
0Likes
Like

Posted 29 October 2012 - 11:09 AM

Any sample code to apply Pitch, Yaw, Roll to RigidBody?

#4   Members   

124
Like
0Likes
Like

Posted 30 October 2012 - 01:51 AM

Could anyone give us some part of code?

#5   Members   

5703
Like
0Likes
Like

Posted 30 October 2012 - 02:10 AM

Create a rotation:

btQuaternion rotation(yaw,pitch,roll);

Then implement btMotionState, (in your class that represent the object) and in getWorldTransform do this:

worldTrans.setRotation(rotation);

#6   Members   

891
Like
0Likes
Like

Posted 30 October 2012 - 01:36 PM

I tried the above code, it's rotating weirdly when I just change rotation X value.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.