NQ
21-06-2007 01:29:10
I've got a spherical joint, and now I want to apply a specific torque to it (of course that means relative to the two attached bodies).
According to the PhysX API there are joint motors, which work like:
But that seems built for the purpose of wanting a certain end speed... not for a certain torque. I don't really care which speed it reaches! All I want is to apply a specific torque. Also, I don't want a constant motor: I need to change the motor torque every frame!
[edit]
Actually, what I really want is a joint->applyTorque(100) function. That way I can run it manually whenever I feel like it. But there doesn't seem to exist such a function?
Anyone got a nice tip on how get me what I want? It doesn't seem very difficult, but still I can't quite figure out how to modify it.
Thanks in advance!
[edit2]
Now that I've thuroughly looked through the API, there doesn't even seem to be motors for spherical joints! Only for revolving joints. The only solution seems to be to apply a torque to one of the bodies - like how they do in the sampleprograms where they demonstrate spherical joints. I'll try to accomplish the same effect by applying torque to the involved bodies, but this isn't really the same thing as I really want, is it?
According to the PhysX API there are joint motors, which work like:
revDesc.flags |= NX_RJF_MOTOR_ENABLED;
NxMotorDesc motorDesc;
motorDesc.velTarget = 1000;
motorDesc.maxForce = 500;
motorDesc.freeSpin = true;
revDesc.motor = motorDesc;
But that seems built for the purpose of wanting a certain end speed... not for a certain torque. I don't really care which speed it reaches! All I want is to apply a specific torque. Also, I don't want a constant motor: I need to change the motor torque every frame!
[edit]
Actually, what I really want is a joint->applyTorque(100) function. That way I can run it manually whenever I feel like it. But there doesn't seem to exist such a function?
Anyone got a nice tip on how get me what I want? It doesn't seem very difficult, but still I can't quite figure out how to modify it.
Thanks in advance!
[edit2]
Now that I've thuroughly looked through the API, there doesn't even seem to be motors for spherical joints! Only for revolving joints. The only solution seems to be to apply a torque to one of the bodies - like how they do in the sampleprograms where they demonstrate spherical joints. I'll try to accomplish the same effect by applying torque to the involved bodies, but this isn't really the same thing as I really want, is it?