Difference between revisions of "LlRotBetween/ja"

From Second Life Wiki
Jump to navigation Jump to search
(New page: {{multi-lang}}{{LSL_Function/ja |func_id=21|func_sleep=0.0|func_energy=10.0 |func=llRotBetween |return_type=rotation|p1_type=vector|p1_name=start|p2_type=vector|p2_name=end |func_footnote ...)
 
m
Line 1: Line 1:
{{multi-lang}}{{LSL_Function/ja
{{LSL_Function/ja
|func_id=21|func_sleep=0.0|func_energy=10.0
|func_id=21|func_sleep=0.0|func_energy=10.0
|func=llRotBetween
|func=llRotBetween
Line 37: Line 37:
}//Strife Onizuka</lsl>
}//Strife Onizuka</lsl>
|deprecated
|deprecated
|cat1=Math/3D/ja
|cat1=Math/3D
|cat2=Rotation/ja
|cat2=Rotation
|cat3
|cat3
|cat4
|cat4
}}
}}

Revision as of 00:14, 19 April 2008

要約

関数: rotation llRotBetween( vector start, vector end );

start方向とend方向の間の回転を rotation で返します。

• vector start
• vector end

仕様

startendは原点<0.0, 0.0, 0.0>に相対的な方向です。異なる原点と相対的な構成の場合、入力ベクトルから原点を引き算します。

警告

  • start * llRotBetween(start, end) == endstartendが両方とも0ではない同等の規模の場合のみtrueです。(回避策はllRotBetween#Notesを参照します)
All Issues ~ Search JIRA for related Bugs

サンプル

llRotBetween(<1.0, 0.0, 0.0>, <0.0, -1.0, 0.0>)
// will return <0.00000, 0.00000, -0.70711, 0.70711> (which represents -45 degrees on the z axis)

llRotBetween(<0.0, 0.0, 0.0>, <0.0, -1.0, 0.0>)
// will return <0.00000, 0.00000, 0.00000, 1.00000> (which represents a zero angle on all axis)
// because <0.0, 0.0, 0.0> does not convey a direction.

注意点

この関数はクオータニオンの規模に適応し、つまりstart * llRotBetween(start, end) == endはどちらも0でない限りはtrueです。これらは同じ規模にすべきではありません。 <lsl>rotation RotBetween(vector start, vector end) //adjusts quaternion magnitude so (start * return == end) {//Authors note: I have never had a use for this but it's good to know how to do it if I did.

   rotation rot = llRotBetween(start, end);
   if(start)
   {
       if(end)
       {
           float d = llSqrt(llVecMag(end) / llVecMag(start));
           return <rot.x * d, rot.y * d, rot.z * d, rot.s * d>;
       }
   }
   return rot;

}//Strife Onizuka</lsl>

関連項目

関数

•  llAngleBetween

特記事項

Search JIRA for related Issues

Signature

function rotation llRotBetween( vector start, vector end );
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。