tengil
04-01-2007 18:44:08
Hi!
I have a small question about the joints. Perhaps somebody can help me...
Whatever I try the joints behave like they aren't 'strong' enough... The Bodies bouncing around.
Some test runs (different densities):
http://freenet-homepage.de/tengil001/number1.avi
http://freenet-homepage.de/tengil001/number2.avi
http://freenet-homepage.de/tengil001/number3.avi
http://freenet-homepage.de/tengil001/number4.avi
http://freenet-homepage.de/tengil001/number5.avi
It seems not to be the bounce variable:
...but I can not find such a bounce variable for the joints???
Does anybody know how to 'strengthen' the joints?
best regards
Tengil
I have a small question about the joints. Perhaps somebody can help me...
Whatever I try the joints behave like they aren't 'strong' enough... The Bodies bouncing around.
Some test runs (different densities):
http://freenet-homepage.de/tengil001/number1.avi
http://freenet-homepage.de/tengil001/number2.avi
http://freenet-homepage.de/tengil001/number3.avi
http://freenet-homepage.de/tengil001/number4.avi
http://freenet-homepage.de/tengil001/number5.avi
It seems not to be the bounce variable:
mScene->findBody("1st")->mShape[0]->mMaterial->setBounce(0);
mScene->findBody("2nd")->mShape[0]->mMaterial->setBounce(0);
mScene->findBody("3rd")->mShape[0]->mMaterial->setBounce(0);
mScene->findBody("4th")->mShape[0]->mMaterial->setBounce(0);
...but I can not find such a bounce variable for the joints???
Does anybody know how to 'strengthen' the joints?
best regards
Tengil
world::getSingleton().setDebug(world::DEBUG_VISUAL_EVERYTHING, true);
material *aMaterial = mScene->createMaterial("a",0.5,0.5,0.0);
mScene->createBody(
"1st",
"cube.1m.mesh",
new nxOgre::cubeShape(Vector3(4.0f,1.0f,2.0f), Vector3(0, 0, 0), aMaterial),
100.0f,
Vector3(0.0f,0.5f,0.0f)
);
mScene->findBody("1st")->mNode->scale(4.0f,1.0f,2.0f);
mScene->findBody("1st")->setAngularDamping(0.0f);
mScene->findBody("1st")->setLinearDamping(0.0f);
mScene->findBody("1st")->mShape[0]->mMaterial->setBounce(0);
mScene->createBody(
"2nd",
"cube.1m.mesh",
new nxOgre::cubeShape(Vector3(1.0, 0.1, 1.0), Vector3(0, 0, 0), aMaterial),
100.0f,
Vector3(1.5f,2.052f,0.0f)
);
mScene->findBody("2nd")->mNode->scale(1.0,0.1,1.0);
mScene->findBody("2nd")->setAngularDamping(0.0f);
mScene->findBody("2nd")->setLinearDamping(0.0f);
mScene->findBody("2nd")->mShape[0]->mMaterial->setBounce(0);
mJointLeftRight = mScene->createMotorisedJoint(
mScene->findBody("1st"),
mScene->findBody("2nd"),
Vector3(1.5f,2.051f,0),
Vector3(0,1,0),
true);
mJointLeftRight->setVelocityTarget(0.0);
mScene->createBody(
"3rd",
"cube.1m.mesh",
new nxOgre::cubeShape(Vector3(4.0f,0.5f,2.0f), Vector3(0, 0, 0), aMaterial),
100.0f,
Vector3(0.0f,2.352f,0)
);
mScene->findBody("3rd")->mNode->scale(4.0f,0.5f,2.0f);
mScene->findBody("3rd")->setAngularDamping(0.0f);
mScene->findBody("3rd")->setLinearDamping(0.0f);
mScene->findBody("3rd")->mShape[0]->mMaterial->setBounce(0);
mJointUpDown = mScene->createMotorisedJoint(
mScene->findBody("2nd"),
mScene->findBody("3rd"),
Vector3(1.5f,2.351f,0),
Vector3(0,0,-1),
false);
mJointUpDown->setVelocityTarget(0.0);
mJointUpDown->setFreeSpin(true);
mScene->createBody(
"4th",
"cube.1m.mesh",
new nxOgre::cubeShape(Vector3(4.0f,0.4f,1.9f), Vector3(0, 0, 0), aMaterial),
100.0f,
//Vector3(0.0f,2.367f,0)
Vector3(-1.0f,2.367f,0)
);
mScene->findBody("4th")->mNode->scale(4.0f,0.4f,1.9f);
mScene->findBody("4th")->setAngularDamping(0.0f);
mScene->findBody("4th")->setLinearDamping(0.0f);
mScene->findBody("4th")->mShape[0]->mMaterial->setBounce(0);
mJointInOut = mScene->createJoint(
new nxOgre::cylindricalJoint(
mScene->findBody("3rd"),
mScene->findBody("4th"),
Vector3(1.5f,2.351f,0),
Vector3(1,0,0))
);
mJointUpDown->setMaxForce(10000000000000000000000000000000000000.0);
mJointUpDown->setVelocityTarget(-0.5);
std::cout << "\n############################# DEBUG ############################\n\n";
std::cout << "Mass 1st: ";
std::cout << mScene->findBody("1st")->getMass();
std::cout << "\n";
std::cout << "Mass 2nd: ";
std::cout << mScene->findBody("2nd")->getMass();
std::cout << "\n";
std::cout << "Mass 3rd: ";
std::cout << mScene->findBody("3rd")->getMass();
std::cout << "\n";
std::cout << "Mass 4th: ";
std::cout << mScene->findBody("4th")->getMass();
std::cout << "\n";