This content has been marked as final. Show 3 replies
You could try to make the model of the rigidbody a child of the model you rotate. Make sure you use it with the #preserveworld to not screw up their positions.
I think this should work.
It's been a while, and I don't have director in front of me to check the syntax, but I believe something like this might work for you:
desiredRotation = plainModel.transform.rotation.axisAngle
rigidBody.rotation = desiredRotation
and run that everyframe or whenever is appropriate to keep it updated. Hope that helps some....
you should keep in mind that a havok body should be only conltrolled with the havok comands! the havok world is inside the havok castmember and it is invisible. the objects in the visual world only a representation of things happening in havok-land. That means, if a model is turned into a havok model, it should not be manipulated with normal lingo comands.
The havok bodies should be moved by forces, impulses, angularvelocity, linearvelocity ... (all in the havok-lingo-reference)
It's possible to set the rotation and the position of a havok body with havok-lingo-comands, but in setting the position and rotation without the use of forces, will exclude the model from the collision detection. Using "rotation" and "position" is in this case similar to "beam" the object to a new position by ignoring the physical rules.
but to stick a object to a lingo controlled model you can use dashpods. If you use a angular dashpod, you can update its rotation and set it to the rotation of the lingo-controlled model. By making this agualar dashpod very strong, it will try to be very close to the given rotation.
this is not a good idea because it will not move the havok body, only the visual representation. The havok model will not move. havok models can only be moved by havok comands.
>desiredRotation = plainModel.transform.rotation.axisAngle
>rigidBody.rotation = desiredRotation
this will work, but exclude the collision detection.
Apply a angulardashpod to that havok model and set its rotation like this:
this should work. depending on the strenght of this dashpot, the motion will be applied. You should also take a look into the havok-lingo-reference on how to use "registerstepcallback" to build a handler that will execute the havok-code on havok timesteps.
hope this is a littel help...