RigidBody Rotation

Started by
11 comments, last by Medo Mex 11 years, 5 months ago
A little digging in the bullet docs revealed:
btMatrix3x3::setEulerYPR ( const btScalar & yaw,
const btScalar & pitch,
const btScalar & roll
)

So I'm assuming you could use that to create a btMatrix3x3, and then apply that to a btTransform's origin that can be applied to the btRigidBody.


If someone could update the two commented lines with the appropriate code, it will be exactly what I want.
[/quote]

No one is here to just write your code for you. You're explicitly asking people to do that. Try and have a little courtesy, it's a forum for information sharing, not task orders.

Hazard Pay :: FPS/RTS in SharpDX (gathering dust, retained for... historical purposes)
DeviantArt :: Because right-brain needs love too (also pretty neglected these days)

Advertisement
You got pretty much exactly what you wanted in the first post.
Here its modified with setting yaw, pitch and roll:


btMatrix3x3 orn = m_pRigidBody->getWorldTransform().getBasis(); //get basis of world transformation
btMatrix ypr;
ypr.setEulerYPR(0.2f,0.1f,0.1f);
orn *= ypr //Multiply it by rotation matrix, yaw, pitch, roll
m_pRigidBody->getWorldTransform().setBasis(orn); //set new rotation for the object


Edit:

No one is here to just write your code for you
[/quote]

Oops :)
@Olof Hedman: That was exactly what I was looking for! Thank you!

@BCullis:
No one is here to just write your code for you.[/quote]
Trust me, writing 5 lines of code is easier to understand and will save a lot of time ;)

This topic is closed to new replies.

Advertisement