I've got a problem
I want to push object 2 with the help of object 1. When I press 5 key, object 1 move and push object 2. With this code I can do what I want, but I've got strange problem. If I press 5 key after I run the programm everything work fine and object 1 push object 2, but if I wait about 5-6 seconds after the programm start, object 1 move, but don't push object 2. It passes through the object 2.
Code: Select all
CIrrBPManager *bulletPhysMgr = createBulletManager(device);
bulletPhysMgr->getWorld()->setGravity(vector3df(0,-9.8,0));
Tube *tube = new Tube(smgr->getRootSceneNode(), smgr, 1000); //obj 2
CIrrBPRigidBody *tubeBody = bulletPhysMgr->addRigidBox(tube,1000000.0f);
detail cube(smgr, "../data/models/cube.X", vector3df(-95,98,120), vector3df(0,90,0)); //obj 1
CIrrBPRigidBody *cubeBody = bulletPhysMgr->addRigidBox(cube.node,0);
vector3df nodePosition = cubeBody->getPosition();
while(device->run())
{
if (receiver.IsKeyDown(KEY_KEY_5) && isMove == false)
{
isMove = true;
}
if (isMove)
{
if(nodePosition.Z>10)
{
nodePosition.Z -= 1;
cubeBody->setPosition(nodePosition);
}
else
{
isMove = false;
}
}
bulletPhysMgr->stepSimulation();

of not

Maybe someone know what's the problem?
sorry for my bad english