If you have one vector pointing in a direction (like say the X-axis of
an object) and another that points where you'd like the first vector to
be pointing after applying the torque, then ComputeRotSpeedToAlignAxes()
will calculate an angular velocity (this is mass/inertia independent)
that rotates the first axis in the direction of the second axis taking
into account the current rotational velocity of the object.

So I think you have the right idea when you say they are normal that
show the desired and current alignment.  "testAxis" is the current
alignment, "alignAxis" is the desired alignment in your case.  It
doesn't matter what space you use as long as you know that the current
and desired axes as well as the output angular velocity are in that
space.  Also, this function has a pretty specific purpose so it may not
be tuned exactly for your situation; it doesn't take time into account
for example.  Shadow controllers have a better concept of hitting a
target position/orientation while obeying some physical constraints.
Maybe that is a better tool for what you are trying to do.

When you ask how to change the rotation axis of a physics object you
aren't asking a very precise question.  Applying a torque to the object
will most likely change the rotation axis of the object.  The center of
mass is the point around which all applied torques rotate, but there are
infinitely many rotation axes passing through that point.

Jay


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of coderdude
> Sent: Wednesday, February 06, 2008 8:31 AM
> To: hlcoders@list.valvesoftware.com
> Subject: [hlcoders] snapping objects to a specific position
>
> How do I calculate the torque needed to move an object to
> it's goal position? How to change the rotation axis of a phys
> object? will PhysSetMassCenterOverride() do the job? I want
> the object to point a specific direction, but fail on extreme
> conditions (obstacle), I looked at
> ComputeRotSpeedToAlignAxes() but I don't know the parameters.
> Are they normals which show the desired, then current
> alignment? Or maybe the other way around? Local or world space?
>
> Dam, it's hard to use APIs when you don't know what they do :/
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list
> archives, please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to