mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 08:06:27 +08:00
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
This commit is contained in:
@@ -1563,23 +1563,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (userExposed)
|
||||
dupe.m_rootPart.TrimPermissions();
|
||||
|
||||
/// may need to create a new Physics actor.
|
||||
if (dupe.RootPart.PhysActor != null && userExposed)
|
||||
{
|
||||
PrimitiveBaseShape pbs = dupe.RootPart.Shape;
|
||||
|
||||
dupe.RootPart.PhysActor = m_scene.PhysicsScene.AddPrimShape(
|
||||
dupe.RootPart.Name,
|
||||
pbs,
|
||||
dupe.RootPart.AbsolutePosition,
|
||||
dupe.RootPart.Scale,
|
||||
dupe.RootPart.RotationOffset,
|
||||
dupe.RootPart.PhysActor.IsPhysical);
|
||||
|
||||
dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId;
|
||||
dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
|
||||
}
|
||||
|
||||
List<SceneObjectPart> partList;
|
||||
|
||||
lock (m_parts)
|
||||
@@ -1598,11 +1581,28 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (part.UUID != m_rootPart.UUID)
|
||||
{
|
||||
SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
|
||||
|
||||
newPart.LinkNum = part.LinkNum;
|
||||
}
|
||||
}
|
||||
|
||||
// Need to duplicate the physics actor as well
|
||||
if (part.PhysActor != null && userExposed)
|
||||
{
|
||||
PrimitiveBaseShape pbs = part.Shape;
|
||||
|
||||
part.PhysActor
|
||||
= m_scene.PhysicsScene.AddPrimShape(
|
||||
part.Name,
|
||||
pbs,
|
||||
part.AbsolutePosition,
|
||||
part.Scale,
|
||||
part.RotationOffset,
|
||||
part.PhysActor.IsPhysical);
|
||||
|
||||
part.PhysActor.LocalID = part.LocalId;
|
||||
part.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (userExposed)
|
||||
{
|
||||
dupe.UpdateParentIDs();
|
||||
|
||||
@@ -150,8 +150,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// TODO: This needs to be persisted in next XML version update!
|
||||
[XmlIgnore]
|
||||
public readonly int[] PayPrice = {-2,-2,-2,-2,-2};
|
||||
|
||||
[XmlIgnore]
|
||||
public PhysicsActor PhysActor;
|
||||
public PhysicsActor PhysActor
|
||||
{
|
||||
get { return m_physActor; }
|
||||
set
|
||||
{
|
||||
// m_log.DebugFormat("[SOP]: PhysActor set to {0} for {1} {2}", value, Name, UUID);
|
||||
m_physActor = value;
|
||||
}
|
||||
}
|
||||
|
||||
//Xantor 20080528 Sound stuff:
|
||||
// Note: This isn't persisted in the database right now, as the fields for that aren't just there yet.
|
||||
@@ -297,6 +306,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
private byte m_updateFlag;
|
||||
|
||||
private PhysicsActor m_physActor;
|
||||
protected Vector3 m_acceleration;
|
||||
protected Vector3 m_angularVelocity;
|
||||
|
||||
@@ -396,7 +406,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from
|
||||
// the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log
|
||||
|
||||
_flags = 0;
|
||||
Flags = 0;
|
||||
CreateSelected = true;
|
||||
|
||||
TrimPermissions();
|
||||
@@ -424,7 +434,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private uint _groupMask = (uint)PermissionMask.None;
|
||||
private uint _everyoneMask = (uint)PermissionMask.None;
|
||||
private uint _nextOwnerMask = (uint)PermissionMask.All;
|
||||
private PrimFlags _flags = 0;
|
||||
private PrimFlags _flags = PrimFlags.None;
|
||||
private DateTime m_expires;
|
||||
private DateTime m_rezzed;
|
||||
private bool m_createSelected = false;
|
||||
@@ -471,10 +481,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
set { m_inventory.Items = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is idential to the Flags property, except that the returned value is uint rather than PrimFlags
|
||||
/// </summary>
|
||||
[Obsolete("Use Flags property instead")]
|
||||
public uint ObjectFlags
|
||||
{
|
||||
get { return (uint)_flags; }
|
||||
set { _flags = (PrimFlags)value; }
|
||||
get { return (uint)Flags; }
|
||||
set { Flags = (PrimFlags)value; }
|
||||
}
|
||||
|
||||
public UUID UUID
|
||||
@@ -1002,7 +1016,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public bool CreateSelected
|
||||
{
|
||||
get { return m_createSelected; }
|
||||
set { m_createSelected = value; }
|
||||
set
|
||||
{
|
||||
// m_log.DebugFormat("[SOP]: Setting CreateSelected to {0} for {1} {2}", value, Name, UUID);
|
||||
m_createSelected = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -1169,7 +1187,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public PrimFlags Flags
|
||||
{
|
||||
get { return _flags; }
|
||||
set { _flags = value; }
|
||||
set
|
||||
{
|
||||
// m_log.DebugFormat("[SOP]: Setting flags for {0} {1} to {2}", UUID, Name, value);
|
||||
_flags = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
@@ -1305,7 +1327,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if ((ObjectFlags & (uint) flag) == 0)
|
||||
{
|
||||
//m_log.Debug("Adding flag: " + ((PrimFlags) flag).ToString());
|
||||
_flags |= flag;
|
||||
Flags |= flag;
|
||||
|
||||
if (flag == PrimFlags.TemporaryOnRez)
|
||||
ResetExpire();
|
||||
@@ -1523,7 +1545,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat("[SPEW]: physics actor is null for {0} with parent {1}", UUID, this.ParentGroup.UUID);
|
||||
m_log.DebugFormat("[SOP]: physics actor is null for {0} with parent {1}", UUID, this.ParentGroup.UUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1793,7 +1815,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// that's not wholesome. Had to make Scene public
|
||||
//PhysActor = null;
|
||||
|
||||
if ((ObjectFlags & (uint)PrimFlags.Phantom) == 0)
|
||||
if ((Flags & PrimFlags.Phantom) == 0)
|
||||
{
|
||||
if (UsePhysics)
|
||||
{
|
||||
@@ -1940,12 +1962,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
public uint GetEffectiveObjectFlags()
|
||||
{
|
||||
PrimFlags f = _flags;
|
||||
if (m_parentGroup == null || m_parentGroup.RootPart == this)
|
||||
f &= ~(PrimFlags.Touch | PrimFlags.Money);
|
||||
{
|
||||
// Commenting this section of code out since it doesn't actually do anything, as enums are handled by
|
||||
// value rather than reference
|
||||
// PrimFlags f = _flags;
|
||||
// if (m_parentGroup == null || m_parentGroup.RootPart == this)
|
||||
// f &= ~(PrimFlags.Touch | PrimFlags.Money);
|
||||
|
||||
return (uint)_flags | (uint)LocalFlags;
|
||||
return (uint)Flags | (uint)LocalFlags;
|
||||
}
|
||||
|
||||
public Vector3 GetGeometricCenter()
|
||||
@@ -2696,10 +2720,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public void RemFlag(PrimFlags flag)
|
||||
{
|
||||
// PrimFlags prevflag = Flags;
|
||||
if ((ObjectFlags & (uint) flag) != 0)
|
||||
if ((Flags & flag) != 0)
|
||||
{
|
||||
//m_log.Debug("Removing flag: " + ((PrimFlags)flag).ToString());
|
||||
_flags &= ~flag;
|
||||
Flags &= ~flag;
|
||||
}
|
||||
//m_log.Debug("prev: " + prevflag.ToString() + " curr: " + Flags.ToString());
|
||||
//ScheduleFullUpdate();
|
||||
@@ -2990,10 +3014,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (remoteClient.AgentId == _ownerID)
|
||||
{
|
||||
if ((uint) (_flags & PrimFlags.CreateSelected) != 0)
|
||||
if ((Flags & PrimFlags.CreateSelected) != 0)
|
||||
{
|
||||
clientFlags |= (uint) PrimFlags.CreateSelected;
|
||||
_flags &= ~PrimFlags.CreateSelected;
|
||||
Flags &= ~PrimFlags.CreateSelected;
|
||||
}
|
||||
}
|
||||
//bool isattachment = IsAttachment;
|
||||
|
||||
@@ -48,24 +48,42 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
TestHelper.InMethod();
|
||||
Scene scene = SceneSetupHelpers.SetupScene();
|
||||
|
||||
UUID ownerUuid = new UUID("00000000-0000-0000-0000-000000000010");
|
||||
string objName = "obj1";
|
||||
UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001");
|
||||
UUID ownerId = new UUID("00000000-0000-0000-0000-000000000010");
|
||||
string part1Name = "part1";
|
||||
UUID part1Id = new UUID("00000000-0000-0000-0000-000000000001");
|
||||
string part2Name = "part2";
|
||||
UUID part2Id = new UUID("00000000-0000-0000-0000-000000000002");
|
||||
|
||||
SceneObjectPart part
|
||||
= new SceneObjectPart(ownerUuid, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
|
||||
{ Name = objName, UUID = objUuid };
|
||||
SceneObjectPart part1
|
||||
= new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
|
||||
{ Name = part1Name, UUID = part1Id };
|
||||
SceneObjectGroup so = new SceneObjectGroup(part1);
|
||||
SceneObjectPart part2
|
||||
= new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
|
||||
{ Name = part2Name, UUID = part2Id };
|
||||
so.AddPart(part2);
|
||||
|
||||
scene.AddNewSceneObject(new SceneObjectGroup(part), false);
|
||||
scene.AddNewSceneObject(so, false);
|
||||
|
||||
SceneObjectGroup duplicatedSo
|
||||
SceneObjectGroup dupeSo
|
||||
= scene.SceneGraph.DuplicateObject(
|
||||
part.LocalId, new Vector3(10, 0, 0), 0, ownerUuid, UUID.Zero, Quaternion.Identity);
|
||||
part1.LocalId, new Vector3(10, 0, 0), 0, ownerId, UUID.Zero, Quaternion.Identity);
|
||||
Assert.That(dupeSo.Children.Count, Is.EqualTo(2));
|
||||
|
||||
Assert.That(duplicatedSo.Children.Count, Is.EqualTo(1));
|
||||
Assert.That(duplicatedSo.RootPart.LocalId, Is.Not.EqualTo(part.LocalId));
|
||||
SceneObjectPart dupePart1 = dupeSo.GetLinkNumPart(1);
|
||||
SceneObjectPart dupePart2 = dupeSo.GetLinkNumPart(2);
|
||||
Assert.That(dupePart1.LocalId, Is.Not.EqualTo(part1.LocalId));
|
||||
Assert.That(dupePart2.LocalId, Is.Not.EqualTo(part2.LocalId));
|
||||
|
||||
//SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid);
|
||||
Assert.That(dupePart1.Flags, Is.EqualTo(part1.Flags));
|
||||
Assert.That(dupePart2.Flags, Is.EqualTo(part2.Flags));
|
||||
|
||||
/*
|
||||
Assert.That(part1.PhysActor, Is.Not.Null);
|
||||
Assert.That(part2.PhysActor, Is.Not.Null);
|
||||
Assert.That(dupePart1.PhysActor, Is.Not.Null);
|
||||
Assert.That(dupePart2.PhysActor, Is.Not.Null);
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user