javhago
Posts: 2 Joined: Sun Mar 27, 2016 1:52 am
Post
by javhago » Sun Mar 27, 2016 2:33 am
Hi everyone,
i'm new (noob) using bullet and i have this problem. i've been tried to rotate an object but it seems not working.
this is my code:
Code: Select all
btScalar yaw;
btScalar pitch;
btScalar roll;
double const pi=3.14159;
pitch=angle*(pi/180);
btTransform trans;
btQuaternion quat;
quat.setEuler(yaw,pitch,roll);
sphere->getMotionState()->getWorldTransform(trans);
trans.setRotation(quat);
sphere->setWorldTransform(trans);
thanks for your help!
PS: i've tried with this too:
Code: Select all
sphere->getCenterofMassTransform(trans);
aviator
Posts: 13 Joined: Thu Apr 02, 2015 5:15 pm
Post
by aviator » Sun Mar 27, 2016 1:34 pm
javhago wrote: Hi everyone,
i'm new (noob) using bullet and i have this problem. i've been tried to rotate an object but it seems not working.
this is my code:
Code: Select all
btScalar yaw;
btScalar pitch;
btScalar roll;
double const pi=3.14159;
pitch=angle*(pi/180);
btTransform trans;
btQuaternion quat;
quat.setEuler(yaw,pitch,roll);
sphere->getMotionState()->getWorldTransform(trans);
trans.setRotation(quat);
sphere->setWorldTransform(trans);
thanks for your help!
PS: i've tried with this too:
Code: Select all
sphere->getCenterofMassTransform(trans);
We have gone through this issue already ... for quite a few times ... you can't set directly transformation to the rigid body, but you could create your custom class that would inherit btActionInterface and include rigid body as an object, and with a help of that set transformation for the rigid body.
http://www.bulletphysics.org/Bullet/php ... =9&t=10518
javhago
Posts: 2 Joined: Sun Mar 27, 2016 1:52 am
Post
by javhago » Sun Mar 27, 2016 6:16 pm
Thanks a lot aviator.
I'm gonna try it that way. In fact, i've been searching for a few days but anyone said anything like it.