Rotate rigidbody

Hello, so I have just one more question on rotation… I have a control which rotates a spatial, in this case a pivotNode, by let’s say half pi. Now, since I have attached a door Spatial to the pivot, and moved the pivot slightly off-center, I can now rotate a door open and closed using tpf! However, here’s the catch. The RigidBodyControl attached to the door spatial does not rotate with the spatial, as kind of expected. I am not sure how to fix so that it does, because the actual rotation takes place on the pivotNode, and not on the spatial, so there is no direct link from the rotation of the pivot to the rotation of the physics part. Here is the code which rotates the pivot (in the rotation class extending abstractcontrol, in controlUpdate):

[java]
spatial.rotate(0,rotateSpeedtpf,0);
amountToRotate -= rotateSpeed
tpf;
//rbc.setPhysicsRotation(spatial.getLocalRotation()); //Not working
if( (amountToRotate <= 0 && rotateSpeed>0) || (amountToRotate>=0 && rotateSpeed<0)) {
spatial.removeControl(this);
}
[/java]

I tried setting the physicsrotation of the rigidBodycontrol, as you can see in the commented out part, but since the pivot’s rotation is quite different from the actual spatial’s rotation … (Imagine the pivot as the hinges and the spatial as the door itself). So, how could I fix this problem, if someone at all understands my ramblings…

For doors and things that you want to move programmatically anyway you can set the physics control to kinematic mode, which will make it follow the spatial instead of the other way around. It won’t be affected by physics forces then though but that shouldn’t be a problem for a door.