Hi, some questions of joint motors

devachan

23-12-2006 17:52:15

Hi. I am playing with the tutorials of NxOgre (0.4RC2) and Physx. at the moment in the Lesson205 of physx. I have some questions of concepts and other practices.

1° I use the same values for velTarget, maxForce, freeSpin, MaxAngularVelocity ... , that in Lesson205. My motor works well at low speeds (10), but loses its anchor at high speeds (1000). Some idea on this?



2° I do not know clearly the difference between MaxAngularVelocity and velTarget. Veltarget can be greater than MaxAngularVelocity. I think that the imporante is the value of VelTarget. That roll plays MaxAngularVelocity?

3° I have read of tutorial of cars, but I believe that he is not in the NxOgre tutorials 0.4RC2

my code

void start(){

mWorld = new world(mRoot);
mScene = mWorld->createScene("Myescena",mSceneMgr);
mScene->hasGravity();
mScene->hasFloor();

mBodySup = mScene->createBody("BodySuperior","Cube.1m-2m-1m.mesh",new CubeShape(Vector3(1,2,1)),10.0f,Vector3(0,5,0));
mBodySup->setKinematic(true);

mBodyInf = mScene->createBody("BodyInferior","Cube.1m-2m-1m.mesh",new cubeShape(Vector3(1,2,1)),10.0f,Vector3(0,3,0));

mBodyInf->setIgnoreGravity(true);
mBodyInf->mActor->setMaxAngularVelocity(700);
mBodyInf->setAngularDamping(0);

mMotor = mScene->createMotorisedJoint(mBodySup,mBodyInf,Vector3(0.5,4,0),Vector3(0,0,-1));
mMotor->setFreeSpin(true);

}

void newFrame(float _time){

if (mInputDevice->isKeyDown(KC_P))
mMotor->setVelocityTarget(1000);

if (mInputDevice->isKeyDown(KC_V))
mMotor->setVelocityTarget(10);
}



exists some important difference when creating a motor of the 2 following ways?

mMotor = mScene->createMotorisedJoint();
or
mScene->createJoint(new motorisedJoint());


thanks. happy year end