mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
* refactor: cleanup AllocateLocalPrimId() a bit more
This commit is contained in:
@@ -57,14 +57,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
#region Constructors
|
||||
|
||||
//transparency of root part, NOT particle system. Should probably add support for changing particle system transparency.
|
||||
public AuraMetaEntity(Scene scene, uint LocalId, Vector3 groupPos, float transparency, Vector3 color, Vector3 scale)
|
||||
: base(scene, LocalId, groupPos, transparency)
|
||||
public AuraMetaEntity(Scene scene, Vector3 groupPos, float transparency, Vector3 color, Vector3 scale)
|
||||
: base(scene, groupPos, transparency)
|
||||
{
|
||||
SetAura(color, scale);
|
||||
}
|
||||
|
||||
public AuraMetaEntity(Scene scene, UUID uuid, uint LocalId, Vector3 groupPos, float transparency, Vector3 color, Vector3 scale)
|
||||
: base(scene, uuid, LocalId, groupPos, transparency)
|
||||
public AuraMetaEntity(Scene scene, UUID uuid, Vector3 groupPos, float transparency, Vector3 color, Vector3 scale)
|
||||
: base(scene, uuid, groupPos, transparency)
|
||||
{
|
||||
SetAura(color, scale);
|
||||
}
|
||||
|
||||
@@ -56,14 +56,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
public BeamMetaEntity(Scene scene, uint LocalId, Vector3 groupPos, float transparency, SceneObjectPart To, Vector3 color)
|
||||
: base(scene, LocalId, groupPos, transparency)
|
||||
public BeamMetaEntity(Scene scene, Vector3 groupPos, float transparency, SceneObjectPart To, Vector3 color)
|
||||
: base(scene, groupPos, transparency)
|
||||
{
|
||||
SetBeamToUUID(To, color);
|
||||
}
|
||||
|
||||
public BeamMetaEntity(Scene scene, UUID uuid, uint LocalId, Vector3 groupPos, float transparency, SceneObjectPart To, Vector3 color)
|
||||
: base(scene, uuid, LocalId, groupPos, transparency)
|
||||
public BeamMetaEntity(Scene scene, UUID uuid, Vector3 groupPos, float transparency, SceneObjectPart To, Vector3 color)
|
||||
: base(scene, uuid, groupPos, transparency)
|
||||
{
|
||||
SetBeamToUUID(To, color);
|
||||
}
|
||||
|
||||
@@ -146,7 +146,6 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
public AuraMetaEntity CreateAuraForNewlyCreatedEntity(SceneObjectPart part)
|
||||
{
|
||||
AuraMetaEntity ent = new AuraMetaEntity(part.ParentGroup.Scene,
|
||||
part.ParentGroup.Scene.AllocateLocalPrimId(),
|
||||
part.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
new Vector3(0,254,0),
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
if (m_MetaEntityCollection.Auras.ContainsKey(((SceneObjectPart)missingPart).UUID))
|
||||
continue;
|
||||
newList.Add(m_MetaEntityCollection.CreateAuraForNewlyCreatedEntity((SceneObjectPart)missingPart));
|
||||
newList.Add(m_MetaEntityCollection.CreateAuraForNewlyCreatedEntity((SceneObjectPart)missingPart));
|
||||
}
|
||||
m_log.Info("Number of missing objects found: " + newList.Count);
|
||||
return newList;
|
||||
|
||||
@@ -153,7 +153,6 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
else
|
||||
{
|
||||
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
|
||||
m_Entity.Scene.AllocateLocalPrimId(),
|
||||
part.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
new Vector3(254,0,0),
|
||||
@@ -260,7 +259,6 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
|
||||
}
|
||||
BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene,
|
||||
m_Entity.Scene.AllocateLocalPrimId(),
|
||||
m_UnchangedEntity.RootPart.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
sceneEntityPart,
|
||||
@@ -275,7 +273,6 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
m_AuraEntities.Remove(UnchangedPart.UUID);
|
||||
}
|
||||
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
|
||||
m_Entity.Scene.AllocateLocalPrimId(),
|
||||
UnchangedPart.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
new Vector3(0,0,254),
|
||||
@@ -309,7 +306,6 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
m_AuraEntities.Remove(UnchangedPart.UUID);
|
||||
}
|
||||
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
|
||||
m_Entity.Scene.AllocateLocalPrimId(),
|
||||
UnchangedPart.GetWorldPosition(),
|
||||
MetaEntity.TRANSLUCENT,
|
||||
new Vector3(254,0,0),
|
||||
@@ -317,7 +313,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
);
|
||||
m_AuraEntities.Add(UnchangedPart.UUID, auraGroup);
|
||||
SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT);
|
||||
|
||||
|
||||
DiffersFromSceneGroup = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,10 +166,6 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
parts.Add(part.UUID, part);
|
||||
}
|
||||
|
||||
// make new localids
|
||||
foreach (SceneObjectPart part in m_Entity.Children.Values)
|
||||
part.LocalId = m_Entity.Scene.AllocateLocalPrimId();
|
||||
|
||||
//finalize
|
||||
m_Entity.RootPart.PhysActor = null;
|
||||
m_Entity.Children = parts;
|
||||
|
||||
@@ -56,17 +56,17 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
public PointMetaEntity(Scene scene, uint LocalId, Vector3 groupPos, float transparency)
|
||||
public PointMetaEntity(Scene scene, Vector3 groupPos, float transparency)
|
||||
: base()
|
||||
{
|
||||
CreatePointEntity(scene, UUID.Random(), LocalId, groupPos);
|
||||
CreatePointEntity(scene, UUID.Random(), groupPos);
|
||||
SetPartTransparency(m_Entity.RootPart, transparency);
|
||||
}
|
||||
|
||||
public PointMetaEntity(Scene scene, UUID uuid, uint LocalId, Vector3 groupPos, float transparency)
|
||||
public PointMetaEntity(Scene scene, UUID uuid, Vector3 groupPos, float transparency)
|
||||
: base()
|
||||
{
|
||||
CreatePointEntity(scene, uuid, LocalId, groupPos);
|
||||
CreatePointEntity(scene, uuid, groupPos);
|
||||
SetPartTransparency(m_Entity.RootPart, transparency);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void CreatePointEntity(Scene scene, UUID uuid, uint LocalId, Vector3 groupPos)
|
||||
private void CreatePointEntity(Scene scene, UUID uuid, Vector3 groupPos)
|
||||
{
|
||||
SceneObjectGroup x = new SceneObjectGroup();
|
||||
SceneObjectPart y = new SceneObjectPart();
|
||||
@@ -88,8 +88,6 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
|
||||
y.LastOwnerID = UUID.Zero;
|
||||
y.UUID = uuid;
|
||||
|
||||
y.LocalId = LocalId;
|
||||
|
||||
y.Shape = PrimitiveBaseShape.CreateBox();
|
||||
y.Scale = new Vector3(0.01f,0.01f,0.01f);
|
||||
y.LastOwnerID = UUID.Zero;
|
||||
|
||||
Reference in New Issue
Block a user