try to replicate SL bug of PRIM_ROTATION also for avas, est a fix to other cases

avinationmerge
UbitUmarov 2012-06-12 08:05:40 +01:00
parent 5784b3eb31
commit f51ef99bd5
1 changed files with 10 additions and 3 deletions

View File

@ -7983,9 +7983,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
LSL_Rotation r = rules.GetQuaternionItem(idx++); LSL_Rotation r = rules.GetQuaternionItem(idx++);
Quaternion rot = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s); // requested world rotation Quaternion rot = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s); // requested world rotation
Quaternion srot = sitpart.GetWorldRotation(); // need to replicate SL bug
rot *= Quaternion.Conjugate(srot); // removed sit part world rotation
SceneObjectGroup sitgrp = sitpart.ParentGroup;
if (sitgrp != null && sitgrp.RootPart != sitpart)
{
rot *= sitgrp.RootPart.RotationOffset;
}
Quaternion srot = sitpart.GetWorldRotation();
rot = Quaternion.Conjugate(srot) * rot; // removed sit part world rotation
av.Rotation = rot; av.Rotation = rot;
av.SendAvatarDataToAllAgents(); av.SendAvatarDataToAllAgents();
} }
@ -8003,7 +8010,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
Quaternion rot = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s); // requested offset rotation Quaternion rot = new Quaternion((float)r.x, (float)r.y, (float)r.z, (float)r.s); // requested offset rotation
Quaternion srot = sitpart.RotationOffset; Quaternion srot = sitpart.RotationOffset;
rot *= Quaternion.Conjugate(srot); // remove sit part offset rotation rot = Quaternion.Conjugate(srot) * rot; // remove sit part offset rotation
av.Rotation = rot; av.Rotation = rot;
av.SendAvatarDataToAllAgents(); av.SendAvatarDataToAllAgents();