Problem: Physics Objects(Kinematic) with IPO curves

View previous topic View next topic Go down

Problem: Physics Objects(Kinematic) with IPO curves

Post  jimmyz on 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

View user profile

Back to top Go down

Re: Problem: Physics Objects(Kinematic) with IPO curves

Post  sio2interactive on 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!

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

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

View user profile http://sio2interactive.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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