* Rename PrimIDAllocate() to more effectively convey what it does, and put the verb at the front

0.6.0-stable
Justin Clarke Casey 2008-11-07 21:50:03 +00:00
parent 47e3d4d1f0
commit fb694fb177
6 changed files with 15 additions and 14 deletions

View File

@ -146,7 +146,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
public AuraMetaEntity CreateAuraForNewlyCreatedEntity(SceneObjectPart part) public AuraMetaEntity CreateAuraForNewlyCreatedEntity(SceneObjectPart part)
{ {
AuraMetaEntity ent = new AuraMetaEntity(part.ParentGroup.Scene, AuraMetaEntity ent = new AuraMetaEntity(part.ParentGroup.Scene,
part.ParentGroup.Scene.PrimIDAllocate(), part.ParentGroup.Scene.AllocateLocalPrimId(),
part.GetWorldPosition(), part.GetWorldPosition(),
MetaEntity.TRANSLUCENT, MetaEntity.TRANSLUCENT,
new Vector3(0,254,0), new Vector3(0,254,0),

View File

@ -153,7 +153,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
else else
{ {
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
m_Entity.Scene.PrimIDAllocate(), m_Entity.Scene.AllocateLocalPrimId(),
part.GetWorldPosition(), part.GetWorldPosition(),
MetaEntity.TRANSLUCENT, MetaEntity.TRANSLUCENT,
new Vector3(254,0,0), new Vector3(254,0,0),
@ -260,7 +260,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID); m_BeamEntities.Remove(m_UnchangedEntity.RootPart.UUID);
} }
BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene, BeamMetaEntity beamGroup = new BeamMetaEntity(m_Entity.Scene,
m_Entity.Scene.PrimIDAllocate(), m_Entity.Scene.AllocateLocalPrimId(),
m_UnchangedEntity.RootPart.GetWorldPosition(), m_UnchangedEntity.RootPart.GetWorldPosition(),
MetaEntity.TRANSLUCENT, MetaEntity.TRANSLUCENT,
sceneEntityPart, sceneEntityPart,
@ -275,7 +275,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
m_AuraEntities.Remove(UnchangedPart.UUID); m_AuraEntities.Remove(UnchangedPart.UUID);
} }
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
m_Entity.Scene.PrimIDAllocate(), m_Entity.Scene.AllocateLocalPrimId(),
UnchangedPart.GetWorldPosition(), UnchangedPart.GetWorldPosition(),
MetaEntity.TRANSLUCENT, MetaEntity.TRANSLUCENT,
new Vector3(0,0,254), new Vector3(0,0,254),
@ -309,7 +309,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
m_AuraEntities.Remove(UnchangedPart.UUID); m_AuraEntities.Remove(UnchangedPart.UUID);
} }
AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene,
m_Entity.Scene.PrimIDAllocate(), m_Entity.Scene.AllocateLocalPrimId(),
UnchangedPart.GetWorldPosition(), UnchangedPart.GetWorldPosition(),
MetaEntity.TRANSLUCENT, MetaEntity.TRANSLUCENT,
new Vector3(254,0,0), new Vector3(254,0,0),

View File

@ -168,7 +168,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
// make new localids // make new localids
foreach (SceneObjectPart part in m_Entity.Children.Values) foreach (SceneObjectPart part in m_Entity.Children.Values)
part.LocalId = m_Entity.Scene.PrimIDAllocate(); part.LocalId = m_Entity.Scene.AllocateLocalPrimId();
//finalize //finalize
m_Entity.RootPart.PhysActor = null; m_Entity.RootPart.PhysActor = null;

View File

@ -1621,7 +1621,7 @@ namespace OpenSim.Region.Environment.Scenes
/// Returns a new unallocated local primitive ID /// Returns a new unallocated local primitive ID
/// </summary> /// </summary>
/// <returns>A brand new local primitive ID</returns> /// <returns>A brand new local primitive ID</returns>
public uint PrimIDAllocate() public uint AllocateLocalPrimId()
{ {
uint myID; uint myID;

View File

@ -567,7 +567,7 @@ namespace OpenSim.Region.Environment.Scenes
RegionHandle = m_scene.RegionInfo.RegionHandle; RegionHandle = m_scene.RegionInfo.RegionHandle;
m_rootPart.ParentID = 0; m_rootPart.ParentID = 0;
m_rootPart.LocalId = m_scene.PrimIDAllocate(); m_rootPart.LocalId = m_scene.AllocateLocalPrimId();
// No need to lock here since the object isn't yet in a scene // No need to lock here since the object isn't yet in a scene
foreach (SceneObjectPart part in m_parts.Values) foreach (SceneObjectPart part in m_parts.Values)
@ -575,7 +575,7 @@ namespace OpenSim.Region.Environment.Scenes
if (Object.ReferenceEquals(part, m_rootPart)) if (Object.ReferenceEquals(part, m_rootPart))
continue; continue;
part.LocalId = m_scene.PrimIDAllocate(); part.LocalId = m_scene.AllocateLocalPrimId();
part.ParentID = m_rootPart.LocalId; part.ParentID = m_rootPart.LocalId;
//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);
} }
@ -1394,7 +1394,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="cGroupID"></param> /// <param name="cGroupID"></param>
public void CopyRootPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed) public void CopyRootPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
{ {
SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate(), OwnerID, GroupID, m_parts.Count, userExposed); SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalPrimId(), OwnerID, GroupID, m_parts.Count, userExposed);
newPart.SetParent(this); newPart.SetParent(this);
lock (m_parts) lock (m_parts)
@ -1514,7 +1514,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="cGroupID"></param> /// <param name="cGroupID"></param>
public void CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed) public void CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
{ {
SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate(), OwnerID, GroupID, m_parts.Count, userExposed); SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalPrimId(), OwnerID, GroupID, m_parts.Count, userExposed);
newPart.SetParent(this); newPart.SetParent(this);
lock (m_parts) lock (m_parts)
@ -2676,13 +2676,14 @@ namespace OpenSim.Region.Environment.Scenes
scriptPosTarget waypoint = new scriptPosTarget(); scriptPosTarget waypoint = new scriptPosTarget();
waypoint.targetPos = target; waypoint.targetPos = target;
waypoint.tolerance = tolerance; waypoint.tolerance = tolerance;
uint handle = m_scene.PrimIDAllocate(); uint handle = m_scene.AllocateLocalPrimId();
lock (m_targets) lock (m_targets)
{ {
m_targets.Add(handle, waypoint); m_targets.Add(handle, waypoint);
} }
return (int)handle; return (int)handle;
} }
public void unregisterTargetWaypoint(int handle) public void unregisterTargetWaypoint(int handle)
{ {
lock (m_targets) lock (m_targets)

View File

@ -104,7 +104,7 @@ namespace OpenSim.Region.Examples.SimpleModule
// { // {
// Vector3 posOffset = new Vector3((i % objs) * 4, ((i % (objs*objs)) / (objs)) * 4, (i / (objs*objs)) * 4); // Vector3 posOffset = new Vector3((i % objs) * 4, ((i % (objs*objs)) / (objs)) * 4, (i / (objs*objs)) * 4);
// ComplexObject complexObject = // ComplexObject complexObject =
// new ComplexObject(m_scene, regionInfo.RegionHandle, UUID.Zero, m_scene.PrimIDAllocate(), // new ComplexObject(m_scene, regionInfo.RegionHandle, UUID.Zero, m_scene.AllocateLocalPrimId(),
// pos + posOffset); // pos + posOffset);
// m_scene.AddNewSceneObject(complexObject, true); // m_scene.AddNewSceneObject(complexObject, true);
// } // }
@ -113,7 +113,7 @@ namespace OpenSim.Region.Examples.SimpleModule
// private void AddCpuCounter(RegionInfo regionInfo, Vector3 pos) // private void AddCpuCounter(RegionInfo regionInfo, Vector3 pos)
// { // {
// SceneObjectGroup sceneObject = // SceneObjectGroup sceneObject =
// new CpuCounterObject(m_scene, regionInfo.RegionHandle, UUID.Zero, m_scene.PrimIDAllocate(), // new CpuCounterObject(m_scene, regionInfo.RegionHandle, UUID.Zero, m_scene.AllocateLocalPrimId(),
// pos + new Vector3(1f, 1f, 1f)); // pos + new Vector3(1f, 1f, 1f));
// m_scene.AddNewSceneObject(sceneObject, true); // m_scene.AddNewSceneObject(sceneObject, true);
// } // }