OpenSim/llLookAt
をテンプレートにして作成
[
トップ
] [
タイトル一覧
|
ページ一覧
|
新規
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*** llLookAt() by Janus Dugong [#wb1da18a]
public void llLookAt(LSL_Vector target, double st...
{
m_host.AddScriptLPS(1);
// Determine where we are looking from
LSL_Vector from = llGetPos();
// normalized direction to target
LSL_Vector dir = llVecNorm(target - from);
// Janus Dugong & Fumi.Hax
if (LSL_Vector.Mag(dir)<=0.0) return;
//
LSL_Vector vec_yaw = new LSL_Vector(0.0, 0.0,...
LSL_Vector vec_pth = new LSL_Vector(0.0, Math...
LSL_Rotation rot_yaw = llEuler2Rot(vec_yaw);
LSL_Rotation rot_pth = llEuler2Rot(vec_pth);
LSL_Rotation rot = rot_pth * rot_yaw;
// Per discussion with Melanie, for non-physi...
// set the rotation of the object, copy that ...
PhysicsActor pa = m_host.PhysActor;
if (strength == 0 || pa == null || !pa.IsPhys...
{
llSetRot(rot);
}
else
{
m_host.StartLookAt(rot, (float)strength, ...
}
}
終了行:
*** llLookAt() by Janus Dugong [#wb1da18a]
public void llLookAt(LSL_Vector target, double st...
{
m_host.AddScriptLPS(1);
// Determine where we are looking from
LSL_Vector from = llGetPos();
// normalized direction to target
LSL_Vector dir = llVecNorm(target - from);
// Janus Dugong & Fumi.Hax
if (LSL_Vector.Mag(dir)<=0.0) return;
//
LSL_Vector vec_yaw = new LSL_Vector(0.0, 0.0,...
LSL_Vector vec_pth = new LSL_Vector(0.0, Math...
LSL_Rotation rot_yaw = llEuler2Rot(vec_yaw);
LSL_Rotation rot_pth = llEuler2Rot(vec_pth);
LSL_Rotation rot = rot_pth * rot_yaw;
// Per discussion with Melanie, for non-physi...
// set the rotation of the object, copy that ...
PhysicsActor pa = m_host.PhysActor;
if (strength == 0 || pa == null || !pa.IsPhys...
{
llSetRot(rot);
}
else
{
m_host.StartLookAt(rot, (float)strength, ...
}
}
ページ名: