Hello !
I have a big problem with integrating havok and ogre3d, to be more specific with collision. Position of my ogre mesh is not synchronized with my rigidbody's position.
This is my function to synchronize position and orientation(conversion of vectors and quaternions i found on this forum):
void Ship::update(){
hkVector4 p=rigidBody->getPosition();
node->setPosition(OgreHavokObj::hkVector4ToOgre(p));
hkQuaternion q =rigidBody->getRotation();
node->setOrientation(OgreHavokObj::hkQuatToOgre(q));
}
This is my function which updates world:
void Renderer::update(double& dt){
if(m_world!=HK_NULL){
if(dt>0.5)dt=0.5;
//if(lastD/dt>=4.0f)dt=(2*lastD)/3;
m_world->stepMultithreaded(m_pJobQueue,m_pThreadPool,dt);
m_world->lock();
if(objArray.size()!=0){
for(int i=0;i
if(objArray[i]!=NULL){
objArray[i]->applyForces();
objArray[i]->update(dt);
}
}
}
m_world->unlock();
if(m_bVisualDebuggerActive){
m_pPhysicsContext->syncTimers( m_pThreadPool );
m_pVisualDebugger->step();
}
hkMonitorStream::getInstance().reset();
m_pThreadPool->clearTimerData();
}
}
and this the usual result of collision: http://imageshack.us/photo/my-images/543/failmm.png/ Could somebody point out what i am doing worng? Thanks for the help.



