“LlAxisAngle2Rot”的版本间的差异
(创建页面,内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {{函数详情 |函数名=Function: rotation llAxisAngle2Rot( vector axis, float angle ); |参…”) |
(没有差异)
|
2020年5月18日 (一) 10:09的最新版本
| 首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials |
| 函数名 |
|---|
| Function: rotation llAxisAngle2Rot( vector axis, float angle ); |
| 返回绕轴生成的角度的旋转 |
| •矢量轴
•浮动角度-以弧度表示。 轴不需要标准化,只有方向是重要的。 角度必须介于0<angle<PI(高于PI的值会导致2*PI角度)之间,因为旋转不是真正的旋转(更像是刚性运动/镜像),最终目的地是旋转。(换句话说:不管你是向左旋转90度还是向右旋转270度,它都会返回相同的旋转) |
| 注意事项 |
|---|
| Search JIRA for related Bugs |
| 示例 |
|---|
default
{
state_entry()
{
vector axis = <0.0, 0.0, 1.0>;
float angle = 90.0 * DEG_TO_RAD;
rotation rot = llAxisAngle2Rot(axis, angle);
vector euler = llRot2Euler(rot) * RAD_TO_DEG;
llOwnerSay((string) euler);
//Says <0.0, 0.0, 90.0> since it is rotating 90 degrees on the Z axis caused by the 1.0 placed in the Z vector spot.
}
}
|
| 相关函数 |
|---|
| • llRot2Angle |
| 相关事件 |
|---|
| rotation llAxisAngle2Rot( vector axis, float angle )
{ axis = llVecNorm( axis ) * llSin( angle/2 ); return <axis.x, axis.y, axis.z, llCos( angle/2 )>; } |