how to change the the velocity of a joint without rebuilding

hitwangxiaolu

27-11-2010 10:39:25

look at the code .how to rewrite it with detritus.I can`t find the function like saveToDesc() and loadfromDec();
void haltRotation(SDFJoint *joint) {
if(joint!=NULL){
NxD6JointDesc d6Desc;
joint->mJoint->saveToDesc(d6Desc);

d6Desc.twistMotion = NX_D6JOINT_MOTION_LOCKED;
d6Desc.twistDrive.driveType = NX_D6JOINT_DRIVE_VELOCITY;
d6Desc.twistDrive.forceLimit = HALT_FORCE_LIMIT;
d6Desc.driveAngularVelocity = NxVec3(0,0,0);
d6Desc.projectionMode = NX_JPM_NONE;

// Projection settings (currently commented out; see note in rotateClockwise())
//d6Desc.projectionMode = NX_JPM_POINT_MINDIST;
//d6Desc.projectionDistance = 0.1f;
//d6Desc.projectionAngle = 0.0872f; // About 5 degrees

// Set the Global Anchor and Axis so that it doesn't move back its original position
// This is where the "joint separation" bug probably occurs
// It probably comes from floating point precision errors

d6Desc.setGlobalAnchor(joint->mJoint->getGlobalAnchor());
d6Desc.setGlobalAxis(joint->mJoint->getGlobalAxis());

joint->mJoint->loadFromDesc(d6Desc);
}
}

i can create a joint with a initial velocity,then i want to chang it ;
i want to change the velocity like this tempD6Joint->setDriveAngularVelocity(NxOgre::Vec3(0.1,0,0));
but get a link error:
shiyan3D.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall NxOgre::D6Joint::setDriveLinearVelocity(class NxOgre::Vec3 const &)" (__imp_?setDriveLinearVelocity@D6Joint@NxOgre@@QAEXABVVec3@2@@Z) referenced in function "protected: virtual bool __thiscall shiyan3D::mousePressed(class OIS::MouseEvent const &,enum OIS::MouseButtonID)" (?mousePressed@shiyan3D@@MAE_NABVMouseEvent@OIS@@W4MouseButtonID@3@@Z)
1>bin\Debug\shiyan3D.exe : fatal error LNK1120: 1 unresolved externals

so what`s the solution,plz help me! thanks in advance.

hitwangxiaolu

29-11-2010 07:13:29

:( nobody helped me :(
betajaen is the man who create detritus,he did a wonderful work.
when i come to the joint control ,i don`t konw how to reconfig d6joint without rebuilding it.
in physx Docs,savetoDesc() and loadfromDesc() are used to reconfig d6joint,and that looks good,but can detritus do that work ?
or detritus do that in another way.
plz tell me if know something about it .giving some advises is also appreciated.
:( that question bothered me a lot :(

plz forgive me if i didn`t tell clear for my bad english. :oops: