Hopefully fixed the bugs in primitives rotation editing

afrisby
MW 2007-08-25 14:12:40 +00:00
parent c35e3b1f35
commit 573fb3a609
3 changed files with 9 additions and 6 deletions

View File

@ -109,7 +109,7 @@ namespace OpenSim.Region.ClientStack
if (OnUpdatePrimSingleRotation != null) if (OnUpdatePrimSingleRotation != null)
{ {
LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true);
// Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); //System.Console.WriteLine("new tab rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W);
OnUpdatePrimSingleRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this); OnUpdatePrimSingleRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this);
} }
} }
@ -118,7 +118,7 @@ namespace OpenSim.Region.ClientStack
if (OnUpdatePrimSingleRotation != null) if (OnUpdatePrimSingleRotation != null)
{ {
libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 12, true); libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 12, true);
// Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); //System.Console.WriteLine("new mouse rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W);
OnUpdatePrimSingleRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this); OnUpdatePrimSingleRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this);
} }
} }

View File

@ -897,13 +897,14 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="rot"></param> /// <param name="rot"></param>
private void UpdateRootRotation(LLQuaternion rot) private void UpdateRootRotation(LLQuaternion rot)
{ {
Axiom.Math.Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z);
Axiom.Math.Quaternion oldParentRot = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z);
this.m_rootPart.UpdateRotation(rot); this.m_rootPart.UpdateRotation(rot);
if (m_rootPart.PhysActor != null) if (m_rootPart.PhysActor != null)
{ {
m_rootPart.PhysActor.Orientation = new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z); m_rootPart.PhysActor.Orientation = new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z);
} }
Axiom.Math.Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z);
Axiom.Math.Quaternion oldParentRot = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z);
foreach (SceneObjectPart prim in this.m_parts.Values) foreach (SceneObjectPart prim in this.m_parts.Values)
{ {
@ -916,7 +917,8 @@ namespace OpenSim.Region.Environment.Scenes
Axiom.Math.Quaternion primsRot = new Quaternion(prim.RotationOffset.W, prim.RotationOffset.X, prim.RotationOffset.Y, prim.RotationOffset.Z); Axiom.Math.Quaternion primsRot = new Quaternion(prim.RotationOffset.W, prim.RotationOffset.X, prim.RotationOffset.Y, prim.RotationOffset.Z);
Axiom.Math.Quaternion newRot = oldParentRot * primsRot; Axiom.Math.Quaternion newRot = oldParentRot * primsRot;
newRot = axRot.Inverse() * newRot; newRot = axRot.Inverse() * newRot;
prim.RotationOffset = new LLQuaternion(newRot.w, newRot.x, newRot.y, newRot.z); prim.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
prim.ScheduleTerseUpdate();
} }
} }
this.m_rootPart.ScheduleTerseUpdate(); this.m_rootPart.ScheduleTerseUpdate();

View File

@ -244,7 +244,8 @@ namespace OpenSim.Region.Environment.Scenes
m_folderID = LLUUID.Random(); m_folderID = LLUUID.Random();
m_flags = 0; m_flags = 0;
m_flags |= LLObject.ObjectFlags.ObjectModify | m_flags |= LLObject.ObjectFlags.Physics |
LLObject.ObjectFlags.ObjectModify |
LLObject.ObjectFlags.ObjectCopy | LLObject.ObjectFlags.ObjectCopy |
LLObject.ObjectFlags.ObjectYouOwner | LLObject.ObjectFlags.ObjectYouOwner |
LLObject.ObjectFlags.Touch | LLObject.ObjectFlags.Touch |