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 Medo3337   Members   -  Reputation: 665

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++.

Sponsor:

#2 Krohm   Crossbones+   -  Reputation: 2960

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.

#3 Medo3337   Members   -  Reputation: 665

Like
0Likes
Like

Posted 29 October 2012 - 11:09 AM

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

#4 rongshuxiacy   Members   -  Reputation: 122

Like
0Likes
Like

Posted 30 October 2012 - 01:51 AM

Could anyone give us some part of code?

#5 Olof Hedman   Crossbones+   -  Reputation: 2642

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 Medo3337   Members   -  Reputation: 665

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.



PARTNERS