nargil
08-08-2009 17:18:37
A movie: http://www.youtube.com/watch?v=Ms7x4PTCkHQ
Is this a solver problem, just because i use setPosition in the editor, and everything will be fine if I use the character->move() or throw rigid bodies at it ?
Or maybe isn't 1 revolute joint enough ?
the code from the editor, and in the comments the values typed in in the editor
I also noticed that if I place the door in the air, and create a revolute joint in the same way as above the door tends to fall a little bit (the greater the mass - the more). I'd want it to be always straight up. No matter the mass.
Is this a solver problem, just because i use setPosition in the editor, and everything will be fine if I use the character->move() or throw rigid bodies at it ?
Or maybe isn't 1 revolute joint enough ?
the code from the editor, and in the comments the values typed in in the editor
NxRevoluteJointDesc revDesc;
revDesc.setToDefault();
revDesc.actor[0] = actor0; // the door
revDesc.actor[1] = actor1; // null
revDesc.spring.spring = this->GetPropertyByName("sprSpr")->GetValue().GetDouble(); // 100
revDesc.spring.damper = this->GetPropertyByName("sprDamp")->GetValue().GetDouble(); // 10
revDesc.spring.targetValue = this->GetPropertyByName("sprTarget")->GetValue().GetDouble(); // 0
revDesc.limit.low.setToDefault();
revDesc.limit.high.setToDefault();
revDesc.limit.low.value = this->GetPropertyByName("minAngle")->GetValue().GetDouble() * Ogre::Math::PI /180; // -90 * PI / 180
revDesc.limit.high.value = this->GetPropertyByName("maxAngle")->GetValue().GetDouble() * Ogre::Math::PI /180; // 90 * PI / 180
revDesc.flags|=NX_RJF_SPRING_ENABLED;
revDesc.flags|=NX_RJF_LIMIT_ENABLED;
revDesc.setGlobalAxis(NxOgre::NxConvert<NxVec3,Ogre::Vector3>(globalAxis)); // (0,1,0)
revDesc.setGlobalAnchor(NxOgre::NxConvert<NxVec3,Ogre::Vector3>(globalAnchor)); // placed at the left side of the door
NxRevoluteJoint *revJoint=(NxRevoluteJoint *)WxEngine::getSingletonPtr()->getScene()->getNxScene()->createJoint(revDesc);
I also noticed that if I place the door in the air, and create a revolute joint in the same way as above the door tends to fall a little bit (the greater the mass - the more). I'd want it to be always straight up. No matter the mass.