* refactor: cleanup AllocateLocalPrimId() a bit more
parent
fb694fb177
commit
ba1d9ca26b
|
@ -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),
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1606,6 +1606,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
m_log.ErrorFormat("[SCENE] Found a SceneObjectGroup with m_rootPart == null and {0} children",
|
||||
group.Children == null ? 0 : group.Children.Count);
|
||||
}
|
||||
|
||||
AddRestoredSceneObject(group, true, true);
|
||||
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
|
||||
rootPart.ObjectFlags &= ~(uint)PrimFlags.Scripted;
|
||||
|
@ -1621,7 +1622,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
/// Returns a new unallocated local primitive ID
|
||||
/// </summary>
|
||||
/// <returns>A brand new local primitive ID</returns>
|
||||
public uint AllocateLocalPrimId()
|
||||
protected internal uint AllocateLocalPrimId()
|
||||
{
|
||||
uint myID;
|
||||
|
||||
|
|
|
@ -104,8 +104,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
|||
// {
|
||||
// Vector3 posOffset = new Vector3((i % objs) * 4, ((i % (objs*objs)) / (objs)) * 4, (i / (objs*objs)) * 4);
|
||||
// ComplexObject complexObject =
|
||||
// new ComplexObject(m_scene, regionInfo.RegionHandle, UUID.Zero, m_scene.AllocateLocalPrimId(),
|
||||
// pos + posOffset);
|
||||
// new ComplexObject(m_scene, regionInfo.RegionHandle, UUID.Zero, pos + posOffset);
|
||||
// m_scene.AddNewSceneObject(complexObject, true);
|
||||
// }
|
||||
// }
|
||||
|
@ -113,8 +112,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
|||
// private void AddCpuCounter(RegionInfo regionInfo, Vector3 pos)
|
||||
// {
|
||||
// SceneObjectGroup sceneObject =
|
||||
// new CpuCounterObject(m_scene, regionInfo.RegionHandle, UUID.Zero, m_scene.AllocateLocalPrimId(),
|
||||
// pos + new Vector3(1f, 1f, 1f));
|
||||
// new CpuCounterObject(m_scene, regionInfo.RegionHandle, UUID.Zero, pos + new Vector3(1f, 1f, 1f));
|
||||
// m_scene.AddNewSceneObject(sceneObject, true);
|
||||
// }
|
||||
|
||||
|
|
Loading…
Reference in New Issue