Stop attachments from causing an update to be sent on every frame in which

an avatar moves.
This commit is contained in:
Melanie Thielker
2008-11-10 05:21:51 +00:00
parent ce37b80c68
commit fc6f3edec6
4 changed files with 13 additions and 7 deletions

View File

@@ -1575,6 +1575,8 @@ namespace OpenSim.Region.Environment.Scenes
lock (m_parts)
{
bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
//if (IsAttachment)
//{
//foreach (SceneObjectPart part in m_parts.Values)
@@ -1584,7 +1586,7 @@ namespace OpenSim.Region.Environment.Scenes
//return;
//}
if (Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02)
if ((Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02) && UsePhysics)
{
m_rootPart.UpdateFlag = 1;
lastPhysGroupPos = AbsolutePosition;
@@ -1596,10 +1598,11 @@ namespace OpenSim.Region.Environment.Scenes
checkAtTargets();
if ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1)
if (((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1)
|| (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1)
|| (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1)
|| (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1))
&& UsePhysics)
{
m_rootPart.UpdateFlag = 1;