Can anyone translate this into Lite-C?
Quote:
We create two vectors: one from the last joint position to the endpoint of the last bone (the effector) and another from the same last joint to the target we are trying to reach. Now we can compute the angle between these two vectors by computing the dot product of their unit vectors. Notice that we have the angle between two vectors, but we need to make sure we rotate in the appropriate direction to make the shortest path possible. Again, we can use our AI knowledge by performing a cross product between the two vectors to obtain a third, perpendicular vector. Then, we use the sign of the Z coordinate of the newly computed vector. This sign determines the direction at which we must rotate, and the arc-cosine of the dot product will give you the angle.


I can understand two vec_to_angle for finding bone direction and destination direction, and one ang_diff between the two angles, but nothing more grin

Can anyone clarify?

PS.: Any thoughts on how to get the length of a bone by script? Cant find any functions in the Manual...

Thanks.

*** EDIT ***
Or, how to get the bone pos?? Cant find a function for that either grin
Oops, found it: vec_for_bone() gives the hinge(joint) before that bone, I think. Could be used to get a bone starting pos...

Last edited by EpsiloN; 07/10/15 20:49.

Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201