move refresh forces into applyphysics

LSLKeyTest
UbitUmarov 2016-07-27 21:11:39 +01:00
parent e951f4cc96
commit 8c46ab02c7
2 changed files with 13 additions and 14 deletions

View File

@ -741,7 +741,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
rootPart.RemFlag(PrimFlags.TemporaryOnRez); rootPart.RemFlag(PrimFlags.TemporaryOnRez);
so.ApplyPhysics(); so.ApplyPhysics(false);
rootPart.Rezzed = DateTime.Now; rootPart.Rezzed = DateTime.Now;
so.AttachToBackup(); so.AttachToBackup();

View File

@ -1237,14 +1237,7 @@ namespace OpenSim.Region.Framework.Scenes
//m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID); //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
} }
ApplyPhysics(); ApplyPhysics(true);
if (RootPart.PhysActor != null)
RootPart.Force = RootPart.Force;
if (RootPart.PhysActor != null)
RootPart.Torque = RootPart.Torque;
if (RootPart.PhysActor != null)
RootPart.Buoyancy = RootPart.Buoyancy;
// Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
// for the same object with very different properties. The caller must schedule the update. // for the same object with very different properties. The caller must schedule the update.
@ -1853,7 +1846,7 @@ namespace OpenSim.Region.Framework.Scenes
AttachmentPoint = (byte)0; AttachmentPoint = (byte)0;
// must check if buildind should be true or false here // must check if buildind should be true or false here
// m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive,false); // m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive,false);
ApplyPhysics(); ApplyPhysics(false);
HasGroupChanged = true; HasGroupChanged = true;
RootPart.Rezzed = DateTime.Now; RootPart.Rezzed = DateTime.Now;
@ -2158,7 +2151,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary> /// <summary>
/// Apply physics to this group /// Apply physics to this group
/// </summary> /// </summary>
public void ApplyPhysics() public void ApplyPhysics(bool refreshForces)
{ {
SceneObjectPart[] parts = m_parts.GetArray(); SceneObjectPart[] parts = m_parts.GetArray();
if (parts.Length > 1) if (parts.Length > 1)
@ -2177,16 +2170,22 @@ namespace OpenSim.Region.Framework.Scenes
} }
// Hack to get the physics scene geometries in the right spot // Hack to get the physics scene geometries in the right spot
// ResetChildPrimPhysicsPositions(); // ResetChildPrimPhysicsPositions();
if (m_rootPart.PhysActor != null) if (m_rootPart.PhysActor != null)
{
m_rootPart.PhysActor.Building = false; m_rootPart.PhysActor.Building = false;
}
} }
else else
{ {
// Apply physics to the root prim // Apply physics to the root prim
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, false); m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, false);
} }
if (m_rootPart.PhysActor != null && refreshForces)
{
m_rootPart.Force = m_rootPart.Force;
m_rootPart.Torque = m_rootPart.Torque;
m_rootPart.Buoyancy = m_rootPart.Buoyancy;
}
} }
public void SetOwnerId(UUID userId) public void SetOwnerId(UUID userId)
@ -3080,7 +3079,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
// cancel physics // cancel physics
RootPart.Flags &= ~PrimFlags.Physics; RootPart.Flags &= ~PrimFlags.Physics;
ApplyPhysics(); ApplyPhysics(false);
} }
} }