Fred
02-03-2008 00:34:16
Hi there,
I've a very strange problem moving my objects. I have create a player which can be moved by the user and some crates on which the player should move. My problem is that the player don't really can't move on my crates. At the end of one crate and at the beginning of the other crate the player stops. I can't move it further. It is like running against a wall. the player tries to get trough, but it doesn't work.
Of course every crate has the same properties.
My question: What could be wrong?
Because I don't know what code I shall post, here are some excerpts:
Creating Physics:
Creating an object(this is the same procedure for every object(crates are static objects in this case))
Thanks for help
Fred
I've a very strange problem moving my objects. I have create a player which can be moved by the user and some crates on which the player should move. My problem is that the player don't really can't move on my crates. At the end of one crate and at the beginning of the other crate the player stops. I can't move it further. It is like running against a wall. the player tries to get trough, but it doesn't work.
Of course every crate has the same properties.
My question: What could be wrong?
Because I don't know what code I shall post, here are some excerpts:
Creating Physics:
m_pWorld = new OgreOde::World(m_pSmgr);
m_pWorld->setCFM(10e-5);
m_pWorld->setERP(0.8);
m_pWorld->setAutoSleep(true);
m_pWorld->setAutoSleepAverageSamplesCount(10);
m_pWorld->setContactCorrectionVelocity(1.0);
m_pStepHandler = new OgreOde::ExactVariableStepHandler(m_pWorld, OgreOde::StepHandler::QuickStep);
Creating an object(this is the same procedure for every object(crates are static objects in this case))
m_pEntity = m_Level.getSceneManager()->createEntity(m_ID, m_MeshFilename);
m_pEntity->setCastShadows(true);
m_pEntity->setNormaliseNormals(true);
m_pEntity->setQueryFlags(1<<2);
m_pSceneNode = m_Level.getSceneManager()->getRootSceneNode()->createChildSceneNode(m_ID + std::string("_node"));
m_pSceneNode->attachObject(m_pEntity);
m_pSceneNode->setPosition(m_Position);
m_pSceneNode->rotate(m_RotationDirection, Ogre::Radian(m_RotationDegree));
OgreOde::EntityInformer* pEntInfo;
pEntInfo = m_StaticBody ? new OgreOde::EntityInformer(m_pEntity, m_pSceneNode->_getFullTransform()) : new OgreOde::EntityInformer(m_pEntity);
m_pGeometry = pEntInfo->createStaticTriangleMesh(m_Level.getWorld(), m_Level.getWorld()->getDefaultSpace());
if(!m_StaticBody)
{
m_pBody = new OgreOde::Body(m_Level.getWorld());
m_pGeometry->setBody(m_pBody);
m_pSceneNode->attachObject(m_pBody);
OgreOde::BoxMass mass(m_Mass, pEntInfo->getSize());
mass.setDensity(m_Density, pEntInfo->getSize());
m_pBody->setMass(mass);
}
m_pEntity->setUserObject(m_pGeometry);
m_pGeometry->setUserObject(this);
//m_pGeometry->setDebug(true);
Thanks for help
Fred