NxOgre + Novint Falcon

otaku19

02-03-2008 05:47:41

Hello again....

Firts excuse my english, i am very bad written.

I am working on academic project with nxogre and falcon.
i am movint a kinematic object around the world with the falcon cordinates.

but I don't know to feedback the force to the haptic when collision with some object
I have this code for the ball


NxOgre::SphereShape* shapeBall = new NxOgre::SphereShape(2,"CCDDynamicFlag: true, generateCCD; yes");

NxOgre::Material* materialBall = mScene->createMaterial("MaterialBall");
materialBall->setRestitution(1);
materialBall->setDynamicFriction(0.5);
materialBall->setStaticFriction(0.5);
shapeBall->mParams.mMaterialAsIndex = materialBall->getMaterialIndex();

Bodyball = mScene->createBody("sphere.2m.mesh",shapeBall,NxOgre::Pose(Ogre::Vector3(0,50,0)),"mass: 10" );
Bodyball->getEntity()->setCastShadows(true);
Bodyball->setLinearDamping(0.01);
Bodyball->setAngularDamping(0.01);



and this is the code for the haptic representation


//Haptic representation
haptic = mScene->createBody("plato jug 1.mesh",new NxOgre::CubeShape(3,3,0.2),NxOgre::Pose(Ogre::Quaternion(-0.49999991,-0.49999994,0.5,-0.50000006)),"mass: 1, kinematic: yes, node-scale: 1.222525 1.222525 1.222525");
haptic->getEntity()->setCastShadows(true);
boundingBox = haptic->getEntity()->getBoundingBox();



i am currenly detecting the collision with the wall.

but i need calcule the force with the haptic hit the ball or vice.

some body know, how can I calcule this???

THX

NickM

02-03-2008 10:31:23

If you have set up a collision callback, you should be able to get the force of the collision from that.

I've just remembered that I had to alter the NxOgre code so that it passed me the NxContactPair information but I can't remember whether that was to get the collision force or something else I needed.