rename SOG.UpdatePrimFlags as just UpdateFlags since this is relative to the group never individual prims/parts and so confusing
parent
aff9c345dd
commit
457551d069
|
@ -855,7 +855,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <see cref="Scene.DeleteSceneObject"/>,
|
/// <see cref="Scene.DeleteSceneObject"/>,
|
||||||
/// <see cref="Scene.SelectPrim"/>,
|
/// <see cref="Scene.SelectPrim"/>,
|
||||||
/// <see cref="Scene.DeselectPrim"/>,
|
/// <see cref="Scene.DeselectPrim"/>,
|
||||||
/// <see cref="SceneObjectGroup.UpdatePrimFlags"/>,
|
/// <see cref="SceneObjectGroup.UpdateFlags"/>,
|
||||||
/// <see cref="SceneObjectGroup.AbsolutePosition"/>
|
/// <see cref="SceneObjectGroup.AbsolutePosition"/>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public event ParcelPrimCountTainted OnParcelPrimCountTainted;
|
public event ParcelPrimCountTainted OnParcelPrimCountTainted;
|
||||||
|
|
|
@ -1649,7 +1649,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
else // else turn it off
|
else // else turn it off
|
||||||
vdtc = false;
|
vdtc = false;
|
||||||
|
|
||||||
group.UpdatePrimFlags(localID, UsePhysics, SetTemporary, SetPhantom, vdtc);
|
group.UpdateFlags(UsePhysics, SetTemporary, SetPhantom, vdtc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -2718,35 +2718,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
RootPart.KeyframeMotion.Stop();
|
RootPart.KeyframeMotion.Stop();
|
||||||
RootPart.KeyframeMotion = null;
|
RootPart.KeyframeMotion = null;
|
||||||
}
|
}
|
||||||
UpdatePrimFlags(RootPart.LocalId, usePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
|
UpdateFlags(usePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ScriptSetTemporaryStatus(bool makeTemporary)
|
public void ScriptSetTemporaryStatus(bool makeTemporary)
|
||||||
{
|
{
|
||||||
UpdatePrimFlags(RootPart.LocalId, UsesPhysics, makeTemporary, IsPhantom, IsVolumeDetect);
|
UpdateFlags(UsesPhysics, makeTemporary, IsPhantom, IsVolumeDetect);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ScriptSetPhantomStatus(bool makePhantom)
|
public void ScriptSetPhantomStatus(bool makePhantom)
|
||||||
{
|
{
|
||||||
UpdatePrimFlags(RootPart.LocalId, UsesPhysics, IsTemporary, makePhantom, IsVolumeDetect);
|
UpdateFlags(UsesPhysics, IsTemporary, makePhantom, IsVolumeDetect);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ScriptSetVolumeDetect(bool makeVolumeDetect)
|
public void ScriptSetVolumeDetect(bool makeVolumeDetect)
|
||||||
{
|
{
|
||||||
UpdatePrimFlags(RootPart.LocalId, UsesPhysics, IsTemporary, IsPhantom, makeVolumeDetect);
|
UpdateFlags(UsesPhysics, IsTemporary, IsPhantom, makeVolumeDetect);
|
||||||
|
|
||||||
/*
|
|
||||||
ScriptSetPhantomStatus(false); // What ever it was before, now it's not phantom anymore
|
|
||||||
|
|
||||||
if (PhysActor != null) // Should always be the case now
|
|
||||||
{
|
|
||||||
PhysActor.SetVolumeDetect(param);
|
|
||||||
}
|
|
||||||
if (param != 0)
|
|
||||||
AddFlag(PrimFlags.Phantom);
|
|
||||||
|
|
||||||
ScheduleFullUpdate();
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void applyImpulse(Vector3 impulse)
|
public void applyImpulse(Vector3 impulse)
|
||||||
|
@ -4031,84 +4018,80 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="SetTemporary"></param>
|
/// <param name="SetTemporary"></param>
|
||||||
/// <param name="SetPhantom"></param>
|
/// <param name="SetPhantom"></param>
|
||||||
/// <param name="SetVolumeDetect"></param>
|
/// <param name="SetVolumeDetect"></param>
|
||||||
public void UpdatePrimFlags(uint localID, bool UsePhysics, bool SetTemporary, bool SetPhantom, bool SetVolumeDetect)
|
public void UpdateFlags(bool UsePhysics, bool SetTemporary, bool SetPhantom, bool SetVolumeDetect)
|
||||||
{
|
{
|
||||||
|
if (m_scene == null || IsDeleted)
|
||||||
|
return;
|
||||||
|
|
||||||
HasGroupChanged = true;
|
HasGroupChanged = true;
|
||||||
|
|
||||||
SceneObjectPart selectionPart = GetPart(localID);
|
if (SetTemporary)
|
||||||
|
|
||||||
if (Scene != null)
|
|
||||||
{
|
{
|
||||||
if (SetTemporary)
|
DetachFromBackup();
|
||||||
{
|
// Remove from database and parcel prim count
|
||||||
DetachFromBackup();
|
//
|
||||||
// Remove from database and parcel prim count
|
m_scene.DeleteFromStorage(UUID);
|
||||||
//
|
}
|
||||||
m_scene.DeleteFromStorage(UUID);
|
else if (!Backup)
|
||||||
}
|
{
|
||||||
else if (!Backup)
|
// Previously been temporary now switching back so make it
|
||||||
{
|
// available for persisting again
|
||||||
// Previously been temporary now switching back so make it
|
AttachToBackup();
|
||||||
// available for persisting again
|
|
||||||
AttachToBackup();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_scene.EventManager.TriggerParcelPrimCountTainted();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectionPart != null)
|
|
||||||
|
SceneObjectPart[] parts = m_parts.GetArray();
|
||||||
|
|
||||||
|
if (UsePhysics)
|
||||||
{
|
{
|
||||||
SceneObjectPart[] parts = m_parts.GetArray();
|
int maxprims = m_scene.m_linksetPhysCapacity;
|
||||||
|
bool checkShape = (maxprims > 0 &&
|
||||||
|
parts.Length > maxprims);
|
||||||
|
|
||||||
if (Scene != null && UsePhysics)
|
for (int i = 0; i < parts.Length; i++)
|
||||||
{
|
{
|
||||||
int maxprims = m_scene.m_linksetPhysCapacity;
|
SceneObjectPart part = parts[i];
|
||||||
bool checkShape = (maxprims > 0 &&
|
|
||||||
parts.Length > maxprims);
|
|
||||||
|
|
||||||
for (int i = 0; i < parts.Length; i++)
|
if(part.PhysicsShapeType == (byte)PhysicsShapeType.None)
|
||||||
|
continue; // assuming root type was checked elsewhere
|
||||||
|
|
||||||
|
if (checkShape)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = parts[i];
|
if (--maxprims < 0)
|
||||||
|
|
||||||
if(part.PhysicsShapeType == (byte)PhysicsShapeType.None)
|
|
||||||
continue; // assuming root type was checked elsewhere
|
|
||||||
|
|
||||||
if (checkShape)
|
|
||||||
{
|
{
|
||||||
if (--maxprims < 0)
|
UsePhysics = false;
|
||||||
{
|
|
||||||
UsePhysics = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (part.Scale.X > m_scene.m_maxPhys ||
|
|
||||||
part.Scale.Y > m_scene.m_maxPhys ||
|
|
||||||
part.Scale.Z > m_scene.m_maxPhys )
|
|
||||||
{
|
|
||||||
UsePhysics = false; // Reset physics
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (parts.Length > 1)
|
if (part.Scale.X > m_scene.m_maxPhys ||
|
||||||
{
|
part.Scale.Y > m_scene.m_maxPhys ||
|
||||||
m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, true);
|
part.Scale.Z > m_scene.m_maxPhys )
|
||||||
|
|
||||||
for (int i = 0; i < parts.Length; i++)
|
|
||||||
{
|
{
|
||||||
|
UsePhysics = false; // Reset physics
|
||||||
if (parts[i].UUID != m_rootPart.UUID)
|
break;
|
||||||
parts[i].UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_rootPart.PhysActor != null)
|
|
||||||
m_rootPart.PhysActor.Building = false;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parts.Length > 1)
|
||||||
|
{
|
||||||
|
m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, true);
|
||||||
|
|
||||||
|
for (int i = 0; i < parts.Length; i++)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (parts[i].UUID != m_rootPart.UUID)
|
||||||
|
parts[i].UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_rootPart.PhysActor != null)
|
||||||
|
m_rootPart.PhysActor.Building = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, false);
|
||||||
|
|
||||||
|
m_scene.EventManager.TriggerParcelPrimCountTainted();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data)
|
public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data)
|
||||||
|
|
Loading…
Reference in New Issue