* Some more ApplyPhysics voodoo
parent
a553e6f67c
commit
c1fdba8a6f
|
@ -173,7 +173,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
set { m_rootPart.OwnerID = value; }
|
set { m_rootPart.OwnerID = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public Color Color
|
public Color Color
|
||||||
{
|
{
|
||||||
get { return m_rootPart.Color; }
|
get { return m_rootPart.Color; }
|
||||||
set { m_rootPart.Color = value; }
|
set { m_rootPart.Color = value; }
|
||||||
|
@ -228,26 +228,28 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public SceneObjectGroup()
|
public SceneObjectGroup()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This constructor creates a SceneObjectGroup using a pre-existing SceneObjectPart.
|
/// This constructor creates a SceneObjectGroup using a pre-existing SceneObjectPart.
|
||||||
/// The original SceneObjectPart will be used rather than a copy, preserving
|
/// The original SceneObjectPart will be used rather than a copy, preserving
|
||||||
/// its existing localID and UUID.
|
/// its existing localID and UUID.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public SceneObjectGroup(Scene scene, ulong regionHandle, SceneObjectPart part)
|
public SceneObjectGroup(Scene scene, ulong regionHandle, SceneObjectPart part)
|
||||||
{
|
{
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
m_regionHandle = regionHandle;
|
m_regionHandle = regionHandle;
|
||||||
|
|
||||||
part.SetParent(this);
|
part.SetParent(this);
|
||||||
part.ParentID = 0;
|
part.ParentID = 0;
|
||||||
|
|
||||||
m_parts.Add(part.UUID, part);
|
m_parts.Add(part.UUID, part);
|
||||||
SetPartAsRoot(part);
|
SetPartAsRoot(part);
|
||||||
|
|
||||||
AttachToBackup();
|
AttachToBackup();
|
||||||
|
|
||||||
ScheduleGroupForFullUpdate();
|
ApplyPhysics();
|
||||||
|
|
||||||
|
ScheduleGroupForFullUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -281,7 +283,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
part.RegionHandle = m_regionHandle;
|
part.RegionHandle = m_regionHandle;
|
||||||
|
|
||||||
part.ApplyPermissions();
|
part.ApplyPermissions();
|
||||||
part.ApplyPhysics();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XmlNodeType.EndElement:
|
case XmlNodeType.EndElement:
|
||||||
|
@ -291,7 +292,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
reader.Close();
|
reader.Close();
|
||||||
sr.Close();
|
sr.Close();
|
||||||
|
|
||||||
AddPart( m_rootPart );
|
AddPart(m_rootPart);
|
||||||
|
|
||||||
m_rootPart.LocalID = m_scene.PrimIDAllocate();
|
m_rootPart.LocalID = m_scene.PrimIDAllocate();
|
||||||
m_rootPart.ParentID = 0;
|
m_rootPart.ParentID = 0;
|
||||||
|
@ -300,6 +301,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
AttachToBackup();
|
AttachToBackup();
|
||||||
|
|
||||||
|
ApplyPhysics();
|
||||||
|
|
||||||
ScheduleGroupForFullUpdate();
|
ScheduleGroupForFullUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -369,25 +372,27 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
foreach (SceneObjectPart part in m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
|
|
||||||
Vector3 partPosition = new Vector3(part.AbsolutePosition.X,part.AbsolutePosition.Y,part.AbsolutePosition.Z);
|
Vector3 partPosition = new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z);
|
||||||
Quaternion parentrotation = new Quaternion(GroupRotation.W,GroupRotation.X,GroupRotation.Y,GroupRotation.Z);
|
Quaternion parentrotation = new Quaternion(GroupRotation.W, GroupRotation.X, GroupRotation.Y, GroupRotation.Z);
|
||||||
|
|
||||||
// Telling the prim to raytrace.
|
// Telling the prim to raytrace.
|
||||||
EntityIntersection inter = part.TestIntersection(hRay,parentrotation);
|
EntityIntersection inter = part.TestIntersection(hRay, parentrotation);
|
||||||
|
|
||||||
// This may need to be updated to the maximum draw distance possible..
|
// This may need to be updated to the maximum draw distance possible..
|
||||||
// We might (and probably will) be checking for prim creation from other sims
|
// We might (and probably will) be checking for prim creation from other sims
|
||||||
// when the camera crosses the border.
|
// when the camera crosses the border.
|
||||||
float idist = 256f;
|
float idist = 256f;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (inter.HitTF) {
|
|
||||||
|
if (inter.HitTF)
|
||||||
|
{
|
||||||
// We need to find the closest prim to return to the testcaller along the ray
|
// We need to find the closest prim to return to the testcaller along the ray
|
||||||
if (inter.distance < idist) {
|
if (inter.distance < idist)
|
||||||
|
{
|
||||||
|
|
||||||
idist = inter.distance;
|
idist = inter.distance;
|
||||||
returnresult.HitTF = true;
|
returnresult.HitTF = true;
|
||||||
returnresult.ipoint = inter.ipoint;
|
returnresult.ipoint = inter.ipoint;
|
||||||
|
@ -396,13 +401,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
returnresult.distance = inter.distance;
|
returnresult.distance = inter.distance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return returnresult;
|
return returnresult;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -429,6 +434,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
SetPartAsRoot(newPart);
|
SetPartAsRoot(newPart);
|
||||||
|
|
||||||
AttachToBackup();
|
AttachToBackup();
|
||||||
|
|
||||||
|
ApplyPhysics();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -512,7 +519,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public SceneObjectGroup Copy(LLUUID cAgentID, LLUUID cGroupID)
|
public SceneObjectGroup Copy(LLUUID cAgentID, LLUUID cGroupID)
|
||||||
{
|
{
|
||||||
SceneObjectGroup dupe = (SceneObjectGroup) MemberwiseClone();
|
SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
|
||||||
dupe.m_parts = new Dictionary<LLUUID, SceneObjectPart>();
|
dupe.m_parts = new Dictionary<LLUUID, SceneObjectPart>();
|
||||||
dupe.m_parts.Clear();
|
dupe.m_parts.Clear();
|
||||||
//dupe.OwnerID = AgentID;
|
//dupe.OwnerID = AgentID;
|
||||||
|
@ -520,7 +527,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
dupe.AbsolutePosition = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
|
dupe.AbsolutePosition = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
|
||||||
dupe.m_scene = m_scene;
|
dupe.m_scene = m_scene;
|
||||||
dupe.m_regionHandle = m_regionHandle;
|
dupe.m_regionHandle = m_regionHandle;
|
||||||
|
|
||||||
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID);
|
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID);
|
||||||
|
|
||||||
|
|
||||||
|
@ -539,7 +546,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z),
|
dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z),
|
||||||
dupe.RootPart.PhysActor.IsPhysical);
|
dupe.RootPart.PhysActor.IsPhysical);
|
||||||
dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
|
dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
// Now we've made a copy that replaces this one, we need to
|
// Now we've made a copy that replaces this one, we need to
|
||||||
// switch the owner to the person who did the copying
|
// switch the owner to the person who did the copying
|
||||||
|
@ -554,7 +561,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
if (part.UUID != m_rootPart.UUID)
|
if (part.UUID != m_rootPart.UUID)
|
||||||
{
|
{
|
||||||
dupe.CopyPart(part,OwnerID, GroupID);
|
dupe.CopyPart(part, OwnerID, GroupID);
|
||||||
SetPartOwner(part, cAgentID, cGroupID);
|
SetPartOwner(part, cAgentID, cGroupID);
|
||||||
part.ScheduleFullUpdate();
|
part.ScheduleFullUpdate();
|
||||||
|
|
||||||
|
@ -579,7 +586,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_parts.Add(newPart.UUID, newPart);
|
m_parts.Add(newPart.UUID, newPart);
|
||||||
SetPartAsRoot(newPart);
|
SetPartAsRoot(newPart);
|
||||||
}
|
}
|
||||||
public void SetRootPartOwner(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID) {
|
public void SetRootPartOwner(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID)
|
||||||
|
{
|
||||||
part.LastOwnerID = part.OwnerID;
|
part.LastOwnerID = part.OwnerID;
|
||||||
part.OwnerID = cAgentID;
|
part.OwnerID = cAgentID;
|
||||||
part.GroupID = cGroupID;
|
part.GroupID = cGroupID;
|
||||||
|
@ -613,7 +621,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="part"></param>
|
/// <param name="part"></param>
|
||||||
public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient,LLUUID AgentID, uint RequestFlags)
|
public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, LLUUID AgentID, uint RequestFlags)
|
||||||
{
|
{
|
||||||
//RootPart.ServiceObjectPropertiesFamilyRequest(remoteClient, AgentID, RequestFlags);
|
//RootPart.ServiceObjectPropertiesFamilyRequest(remoteClient, AgentID, RequestFlags);
|
||||||
ObjectPropertiesFamilyPacket objPropFamilyPack = new ObjectPropertiesFamilyPacket();
|
ObjectPropertiesFamilyPacket objPropFamilyPack = new ObjectPropertiesFamilyPacket();
|
||||||
|
@ -627,7 +635,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
objPropDB.GroupMask = RootPart.GroupMask;
|
objPropDB.GroupMask = RootPart.GroupMask;
|
||||||
objPropDB.EveryoneMask = RootPart.EveryoneMask;
|
objPropDB.EveryoneMask = RootPart.EveryoneMask;
|
||||||
objPropDB.NextOwnerMask = RootPart.NextOwnerMask;
|
objPropDB.NextOwnerMask = RootPart.NextOwnerMask;
|
||||||
|
|
||||||
// TODO: More properties are needed in SceneObjectPart!
|
// TODO: More properties are needed in SceneObjectPart!
|
||||||
objPropDB.OwnershipCost = RootPart.OwnershipCost;
|
objPropDB.OwnershipCost = RootPart.OwnershipCost;
|
||||||
objPropDB.SaleType = RootPart.ObjectSaleType;
|
objPropDB.SaleType = RootPart.ObjectSaleType;
|
||||||
|
@ -839,12 +847,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
Quaternion parentRot =
|
Quaternion parentRot =
|
||||||
new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
|
new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
|
||||||
m_rootPart.RotationOffset.Z);
|
m_rootPart.RotationOffset.Z);
|
||||||
axPos = parentRot.Inverse()*axPos;
|
axPos = parentRot.Inverse() * axPos;
|
||||||
linkPart.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z);
|
linkPart.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z);
|
||||||
Quaternion oldRot =
|
Quaternion oldRot =
|
||||||
new Quaternion(linkPart.RotationOffset.W, linkPart.RotationOffset.X, linkPart.RotationOffset.Y,
|
new Quaternion(linkPart.RotationOffset.W, linkPart.RotationOffset.X, linkPart.RotationOffset.Y,
|
||||||
linkPart.RotationOffset.Z);
|
linkPart.RotationOffset.Z);
|
||||||
Quaternion newRot = parentRot.Inverse()*oldRot;
|
Quaternion newRot = parentRot.Inverse() * oldRot;
|
||||||
linkPart.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
|
linkPart.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
|
||||||
linkPart.ParentID = m_rootPart.LocalID;
|
linkPart.ParentID = m_rootPart.LocalID;
|
||||||
m_parts.Add(linkPart.UUID, linkPart);
|
m_parts.Add(linkPart.UUID, linkPart);
|
||||||
|
@ -873,50 +881,50 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
objectGroup.DeleteParts();
|
objectGroup.DeleteParts();
|
||||||
ScheduleGroupForFullUpdate();
|
ScheduleGroupForFullUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delink the given prim from this group. The delinked prim is established as
|
/// Delink the given prim from this group. The delinked prim is established as
|
||||||
/// an independent SceneObjectGroup.
|
/// an independent SceneObjectGroup.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="partID"></param>
|
/// <param name="partID"></param>
|
||||||
public void DelinkFromGroup(uint partID)
|
public void DelinkFromGroup(uint partID)
|
||||||
{
|
{
|
||||||
SceneObjectPart linkPart = GetChildPart(partID);
|
SceneObjectPart linkPart = GetChildPart(partID);
|
||||||
|
|
||||||
if (null != linkPart)
|
if (null != linkPart)
|
||||||
{
|
{
|
||||||
// Remove the part from this object
|
// Remove the part from this object
|
||||||
m_parts.Remove(linkPart.UUID);
|
m_parts.Remove(linkPart.UUID);
|
||||||
|
|
||||||
// We need to reset the child part's position
|
// We need to reset the child part's position
|
||||||
// ready for life as a separate object after being a part of another object
|
// ready for life as a separate object after being a part of another object
|
||||||
Quaternion parentRot
|
Quaternion parentRot
|
||||||
= new Quaternion(
|
= new Quaternion(
|
||||||
m_rootPart.RotationOffset.W,
|
m_rootPart.RotationOffset.W,
|
||||||
m_rootPart.RotationOffset.X,
|
m_rootPart.RotationOffset.X,
|
||||||
m_rootPart.RotationOffset.Y,
|
m_rootPart.RotationOffset.Y,
|
||||||
m_rootPart.RotationOffset.Z);
|
m_rootPart.RotationOffset.Z);
|
||||||
|
|
||||||
Vector3 axPos
|
Vector3 axPos
|
||||||
= new Vector3(
|
= new Vector3(
|
||||||
linkPart.OffsetPosition.X,
|
linkPart.OffsetPosition.X,
|
||||||
linkPart.OffsetPosition.Y,
|
linkPart.OffsetPosition.Y,
|
||||||
linkPart.OffsetPosition.Z);
|
linkPart.OffsetPosition.Z);
|
||||||
|
|
||||||
axPos = parentRot * axPos;
|
axPos = parentRot * axPos;
|
||||||
linkPart.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z);
|
linkPart.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z);
|
||||||
linkPart.GroupPosition = AbsolutePosition + linkPart.OffsetPosition;
|
linkPart.GroupPosition = AbsolutePosition + linkPart.OffsetPosition;
|
||||||
linkPart.OffsetPosition = new LLVector3(0, 0, 0);
|
linkPart.OffsetPosition = new LLVector3(0, 0, 0);
|
||||||
|
|
||||||
Quaternion oldRot
|
Quaternion oldRot
|
||||||
= new Quaternion(
|
= new Quaternion(
|
||||||
linkPart.RotationOffset.W,
|
linkPart.RotationOffset.W,
|
||||||
linkPart.RotationOffset.X,
|
linkPart.RotationOffset.X,
|
||||||
linkPart.RotationOffset.Y,
|
linkPart.RotationOffset.Y,
|
||||||
linkPart.RotationOffset.Z);
|
linkPart.RotationOffset.Z);
|
||||||
Quaternion newRot = parentRot * oldRot;
|
Quaternion newRot = parentRot * oldRot;
|
||||||
linkPart.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
|
linkPart.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
|
||||||
|
|
||||||
// Add physics information back to delinked part if appropriate
|
// Add physics information back to delinked part if appropriate
|
||||||
// XXX This is messy and should be refactorable with the similar section in
|
// XXX This is messy and should be refactorable with the similar section in
|
||||||
// SceneObjectPart.UpdatePrimFlags()
|
// SceneObjectPart.UpdatePrimFlags()
|
||||||
|
@ -932,13 +940,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
linkPart.RotationOffset.Y, linkPart.RotationOffset.Z),
|
linkPart.RotationOffset.Y, linkPart.RotationOffset.Z),
|
||||||
m_rootPart.PhysActor.IsPhysical);
|
m_rootPart.PhysActor.IsPhysical);
|
||||||
m_rootPart.DoPhysicsPropertyUpdate(m_rootPart.PhysActor.IsPhysical, true);
|
m_rootPart.DoPhysicsPropertyUpdate(m_rootPart.PhysActor.IsPhysical, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneObjectGroup objectGroup = new SceneObjectGroup(m_scene, m_regionHandle, linkPart);
|
SceneObjectGroup objectGroup = new SceneObjectGroup(m_scene, m_regionHandle, linkPart);
|
||||||
|
|
||||||
m_scene.AddEntity(objectGroup);
|
m_scene.AddEntity(objectGroup);
|
||||||
|
|
||||||
ScheduleGroupForFullUpdate();
|
ScheduleGroupForFullUpdate();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -946,7 +954,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
OpenSim.Framework.Console.MainLog.Instance.Verbose("SCENE",
|
OpenSim.Framework.Console.MainLog.Instance.Verbose("SCENE",
|
||||||
"DelinkFromGroup(): Child prim local id {0} not found in object with root prim id {1}",
|
"DelinkFromGroup(): Child prim local id {0} not found in object with root prim id {1}",
|
||||||
partID, LocalId);
|
partID, LocalId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DetachFromBackup(SceneObjectGroup objectGroup)
|
private void DetachFromBackup(SceneObjectGroup objectGroup)
|
||||||
|
@ -961,7 +969,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_parts.Add(part.UUID, part);
|
m_parts.Add(part.UUID, part);
|
||||||
|
|
||||||
Vector3 axiomOldPos = new Vector3(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z);
|
Vector3 axiomOldPos = new Vector3(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z);
|
||||||
axiomOldPos = oldGroupRotation*axiomOldPos;
|
axiomOldPos = oldGroupRotation * axiomOldPos;
|
||||||
axiomOldPos += oldGroupPosition;
|
axiomOldPos += oldGroupPosition;
|
||||||
LLVector3 oldAbsolutePosition = new LLVector3(axiomOldPos.x, axiomOldPos.y, axiomOldPos.z);
|
LLVector3 oldAbsolutePosition = new LLVector3(axiomOldPos.x, axiomOldPos.y, axiomOldPos.z);
|
||||||
part.OffsetPosition = oldAbsolutePosition - AbsolutePosition;
|
part.OffsetPosition = oldAbsolutePosition - AbsolutePosition;
|
||||||
|
@ -971,15 +979,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_rootPart.RotationOffset.Z);
|
m_rootPart.RotationOffset.Z);
|
||||||
|
|
||||||
Vector3 axiomPos = new Vector3(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z);
|
Vector3 axiomPos = new Vector3(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z);
|
||||||
axiomPos = axiomRootRotation.Inverse()*axiomPos;
|
axiomPos = axiomRootRotation.Inverse() * axiomPos;
|
||||||
part.OffsetPosition = new LLVector3(axiomPos.x, axiomPos.y, axiomPos.z);
|
part.OffsetPosition = new LLVector3(axiomPos.x, axiomPos.y, axiomPos.z);
|
||||||
|
|
||||||
Quaternion axiomPartRotation =
|
Quaternion axiomPartRotation =
|
||||||
new Quaternion(part.RotationOffset.W, part.RotationOffset.X, part.RotationOffset.Y,
|
new Quaternion(part.RotationOffset.W, part.RotationOffset.X, part.RotationOffset.Y,
|
||||||
part.RotationOffset.Z);
|
part.RotationOffset.Z);
|
||||||
|
|
||||||
axiomPartRotation = oldGroupRotation*axiomPartRotation;
|
axiomPartRotation = oldGroupRotation * axiomPartRotation;
|
||||||
axiomPartRotation = axiomRootRotation.Inverse()*axiomPartRotation;
|
axiomPartRotation = axiomRootRotation.Inverse() * axiomPartRotation;
|
||||||
part.RotationOffset =
|
part.RotationOffset =
|
||||||
new LLQuaternion(axiomPartRotation.x, axiomPartRotation.y, axiomPartRotation.z, axiomPartRotation.w);
|
new LLQuaternion(axiomPartRotation.x, axiomPartRotation.y, axiomPartRotation.z, axiomPartRotation.w);
|
||||||
}
|
}
|
||||||
|
@ -996,7 +1004,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
AbsolutePosition = pos;
|
AbsolutePosition = pos;
|
||||||
m_rootPart.SendTerseUpdateToAllClients();
|
m_rootPart.SendTerseUpdateToAllClients();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1009,12 +1017,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1];
|
proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1];
|
||||||
proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock();
|
proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock();
|
||||||
proper.ObjectData[0].ItemID = LLUUID.Zero;
|
proper.ObjectData[0].ItemID = LLUUID.Zero;
|
||||||
proper.ObjectData[0].CreationDate = (ulong) m_rootPart.CreationDate;
|
proper.ObjectData[0].CreationDate = (ulong)m_rootPart.CreationDate;
|
||||||
proper.ObjectData[0].CreatorID = m_rootPart.CreatorID;
|
proper.ObjectData[0].CreatorID = m_rootPart.CreatorID;
|
||||||
proper.ObjectData[0].FolderID = LLUUID.Zero;
|
proper.ObjectData[0].FolderID = LLUUID.Zero;
|
||||||
proper.ObjectData[0].FromTaskID = LLUUID.Zero;
|
proper.ObjectData[0].FromTaskID = LLUUID.Zero;
|
||||||
proper.ObjectData[0].GroupID = LLUUID.Zero;
|
proper.ObjectData[0].GroupID = LLUUID.Zero;
|
||||||
proper.ObjectData[0].InventorySerial = (short) m_rootPart.InventorySerial;
|
proper.ObjectData[0].InventorySerial = (short)m_rootPart.InventorySerial;
|
||||||
proper.ObjectData[0].LastOwnerID = m_rootPart.LastOwnerID;
|
proper.ObjectData[0].LastOwnerID = m_rootPart.LastOwnerID;
|
||||||
proper.ObjectData[0].ObjectID = UUID;
|
proper.ObjectData[0].ObjectID = UUID;
|
||||||
proper.ObjectData[0].OwnerID = m_rootPart.OwnerID;
|
proper.ObjectData[0].OwnerID = m_rootPart.OwnerID;
|
||||||
|
@ -1244,7 +1252,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_rootPart.PhysActor.IsPhysical);
|
m_rootPart.PhysActor.IsPhysical);
|
||||||
bool UsePhysics = ((m_rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0);
|
bool UsePhysics = ((m_rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0);
|
||||||
m_rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
|
m_rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1329,7 +1337,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
Quaternion partRotation =
|
Quaternion partRotation =
|
||||||
new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
|
new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
|
||||||
m_rootPart.RotationOffset.Z);
|
m_rootPart.RotationOffset.Z);
|
||||||
axDiff = partRotation.Inverse()*axDiff;
|
axDiff = partRotation.Inverse() * axDiff;
|
||||||
diff.X = axDiff.x;
|
diff.X = axDiff.x;
|
||||||
diff.Y = axDiff.y;
|
diff.Y = axDiff.y;
|
||||||
diff.Z = axDiff.z;
|
diff.Z = axDiff.z;
|
||||||
|
@ -1431,14 +1439,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (prim.UUID != m_rootPart.UUID)
|
if (prim.UUID != m_rootPart.UUID)
|
||||||
{
|
{
|
||||||
Vector3 axPos = new Vector3(prim.OffsetPosition.X, prim.OffsetPosition.Y, prim.OffsetPosition.Z);
|
Vector3 axPos = new Vector3(prim.OffsetPosition.X, prim.OffsetPosition.Y, prim.OffsetPosition.Z);
|
||||||
axPos = oldParentRot*axPos;
|
axPos = oldParentRot * axPos;
|
||||||
axPos = axRot.Inverse()*axPos;
|
axPos = axRot.Inverse() * axPos;
|
||||||
prim.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z);
|
prim.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z);
|
||||||
Quaternion primsRot =
|
Quaternion primsRot =
|
||||||
new Quaternion(prim.RotationOffset.W, prim.RotationOffset.X, prim.RotationOffset.Y,
|
new Quaternion(prim.RotationOffset.W, prim.RotationOffset.X, prim.RotationOffset.Y,
|
||||||
prim.RotationOffset.Z);
|
prim.RotationOffset.Z);
|
||||||
Quaternion newRot = oldParentRot*primsRot;
|
Quaternion newRot = oldParentRot * primsRot;
|
||||||
newRot = axRot.Inverse()*newRot;
|
newRot = axRot.Inverse() * newRot;
|
||||||
prim.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
|
prim.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
|
||||||
prim.ScheduleTerseUpdate();
|
prim.ScheduleTerseUpdate();
|
||||||
}
|
}
|
||||||
|
@ -1515,7 +1523,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1656,7 +1664,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
avatars[i].StandUp();
|
avatars[i].StandUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalID);
|
avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1670,19 +1678,16 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public override void SetText(string text, Vector3 color, double alpha)
|
public override void SetText(string text, Vector3 color, double alpha)
|
||||||
{
|
{
|
||||||
Color = Color.FromArgb (0xff - (int)(alpha * 0xff),
|
Color = Color.FromArgb(0xff - (int)(alpha * 0xff),
|
||||||
(int)(color.x * 0xff),
|
(int)(color.x * 0xff),
|
||||||
(int)(color.y * 0xff),
|
(int)(color.y * 0xff),
|
||||||
(int)(color.z * 0xff));
|
(int)(color.z * 0xff));
|
||||||
Text = text;
|
Text = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ApplyPhysics()
|
public void ApplyPhysics()
|
||||||
{
|
{
|
||||||
foreach(SceneObjectPart part in m_parts.Values )
|
m_rootPart.ApplyPhysics();
|
||||||
{
|
|
||||||
part.ApplyPhysics();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -473,7 +473,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
LLObject.ObjectFlags.ObjectOwnerModify;
|
LLObject.ObjectFlags.ObjectOwnerModify;
|
||||||
|
|
||||||
ApplyPermissions();
|
ApplyPermissions();
|
||||||
ApplyPhysics();
|
|
||||||
|
|
||||||
ScheduleFullUpdate();
|
ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
|
@ -512,7 +511,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
ObjectFlags = flags;
|
ObjectFlags = flags;
|
||||||
|
|
||||||
ApplyPermissions();
|
ApplyPermissions();
|
||||||
ApplyPhysics();
|
// ApplyPhysics();
|
||||||
|
|
||||||
ScheduleFullUpdate();
|
ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue