Obtain the property Force and Torque

RedSkull

03-04-2006 09:15:09

Hi, I would like to know how to get from a body his actual force and his actual torque.

Thanks.

betajaen

03-04-2006 09:36:51

I don't have the PhysX SDK on me handy, but there should be some functions to help you get the force and torque through directly accessing the NxActor:-

myBody->mActor->getForce();

You'll have to convert the NxVec3 into an Ogre::Vector3, so you do that through Vector3 myVec = NxTools::convert(v)

Hope this helps.

RedSkull

03-04-2006 10:43:10

The compiler raise an error with "myBody->mActor->getForce", saying 'getForce' is not a member of 'NxActor'.

betajaen

03-04-2006 12:35:27

The compiler raise an error with "myBody->mActor->getForce", saying 'getForce' is not a member of 'NxActor'.

Hmm..It might be getLocalForce(), but I'd check the PhysX documentation for the NxActor methods, else if you're using Visual Studio 2005 intellisense will list all the methods for you.

RedSkull

03-04-2006 13:14:16

I haven't found any 'get' method in Phyxs's docs to get the force of an actor. But it seems rare to me that any method does not exist.

betajaen

03-04-2006 13:22:13

It does, but I have seen some get methods for getting velocity and other things, it would make some sense that force and torque methods exist too.