Template:Needs Translation/
函数名
|
Function: rotation llAxes2Rot( vector fwd, vector left, vector up );
|
返回由3个坐标轴定义的旋转
|
•矢量fwd
•矢量左
•矢量向上
这三个向量必须是相互正交的单位向量。
|
示例
|
default
{
state_entry()
{
vector i = < 1.0, 0.0, 0.0>;
vector j = < 0.0, 1.0, 0.0>;
vector k = < 0.0, 0.0, 1.0>;
rotation rot = llAxes2Rot( j, -i, k );
llSay(0, (string) (llRot2Euler(rot) * RAD_TO_DEG) );
}
}
This script displays:
Object: <-0.00000, 0.00000, 90.00000>
which shows that (j, -i, k) is obtained by rotating (i, j, k) 90 degrees around z direction.
|
相关事件
|
从技术上讲,仅需要前两个向量来定义此旋转,这可以通过调用以下任意一个来完成:
llAxes2Rot(fwd, left, fwd % left);
llAxes2Rot(left % up, left, up);
llAxes2Rot(fwd, up % fwd, up);
|