I'm having the same problem as the guy in this thread http://bulletphysics.org/Bullet/phpBB3/ ... 50&start=0
I'm really confused about this.
How can I actually rotate dynamic rigid body around Y axis manually?
I need this for First person game and I don't want to use Kinematic charachter controller(Not that I don't know how to, I just don't want to).
How to rotate dynamic rigidbody around Y axis?
-
- Posts: 22
- Joined: Mon Dec 20, 2010 7:13 pm
-
- Posts: 15
- Joined: Mon Oct 04, 2010 5:55 pm
Re: How to rotate dynamic rigidbody around Y axis?
Get it's matrix, use rotation on it, set the matrix back on the body.
-
- Posts: 22
- Joined: Mon Dec 20, 2010 7:13 pm
Re: How to rotate dynamic rigidbody around Y axis?
Thanks for your reply, I taught this forum was dead.
I'll try to rotate it with matrix'es, tough I'm don't really know much about them.
Again thanks for replying.
I'll try to rotate it with matrix'es, tough I'm don't really know much about them.
Again thanks for replying.
-
- Posts: 15
- Joined: Mon Oct 04, 2010 5:55 pm
Re: How to rotate dynamic rigidbody around Y axis?
I do it like this
This is written from memory, so actual names may differ.
Code: Select all
btRidigBody myBody;
btTransform transform;
btScalar matrix[16];
transform = myBody->getCenterOfMassTransform();
matrix = transform.getOpenGLMatrix();
multiply with rotation matrix
transform.setFromOpenGLMatrix(matrix);
myBody->setTransform(transform);
-
- Posts: 22
- Joined: Mon Dec 20, 2010 7:13 pm
Re: How to rotate dynamic rigidbody around Y axis?
Thanks mate, I wouldn't have solved this by myself! 
