FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Problem: Physics Objects(Kinematic) with IPO curves

2 posters

Go down

kinematic - Problem: Physics Objects(Kinematic) with IPO curves Empty Problem: Physics Objects(Kinematic) with IPO curves

Post  jimmyz Thu Oct 08, 2009 12:07 pm

I found a problem with the IPO rendering when trying to make some moving platforms using KINEMATIC objects with Bullet. These are needed if you want static object that can push dynamic objects around or have things stick to them and apply friction.


The object render function doesn't update the MotionState so the collision object never gets and updated position.

I had to change this line in sio2ObjectRender to get it to work.

Code:


if( _SIO2object->_SIO2objectphysic && _SIO2object->_SIO2objectphysic->_btRigidBody )
{
  //_SIO2object->_SIO2objectphysic->_btRigidBody->getWorldTransform().setFromOpenGLMatrix( _SIO2object->_SIO2transform->mat );
  btTransform trans;
  trans.setFromOpenGLMatrix( _SIO2object->_SIO2transform->mat );
  _SIO2object->_SIO2objectphysic->_btRigidBody->getMotionState()->setWorldTransform( trans );

}


jimmyz

Posts : 2
Join date : 2009-10-07

Back to top Go down

kinematic - Problem: Physics Objects(Kinematic) with IPO curves Empty Re: Problem: Physics Objects(Kinematic) with IPO curves

Post  sio2interactive Thu Oct 08, 2009 12:17 pm

You're absolutely right... the previous code won't work with kinematic objects... Like that it work for both. tks for the fix!
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 44
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum