* refactor: as per a recent opensim-dev thread, rename InnerScene to SceneGraph to make it more descriptive of its intended function

0.6.1-post-fixes
Justin Clarke Casey 2008-11-12 20:16:46 +00:00
parent 1ac613a948
commit cec112c87a
9 changed files with 119 additions and 107 deletions

View File

@ -261,7 +261,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
((SceneObjectGroup)scene.Entities[uuid]).DetachFromBackup(); ((SceneObjectGroup)scene.Entities[uuid]).DetachFromBackup();
scene.PhysicsScene.RemovePrim(((SceneObjectGroup)scene.Entities[uuid]).RootPart.PhysActor); scene.PhysicsScene.RemovePrim(((SceneObjectGroup)scene.Entities[uuid]).RootPart.PhysActor);
scene.SendKillObject(scene.Entities[uuid].LocalId); scene.SendKillObject(scene.Entities[uuid].LocalId);
scene.m_innerScene.DeleteSceneObject(uuid, false); scene.m_sceneGraph.DeleteSceneObject(uuid, false);
((SceneObjectGroup)scene.Entities[uuid]).DeleteGroup(false); ((SceneObjectGroup)scene.Entities[uuid]).DeleteGroup(false);
} }
catch(Exception e) catch(Exception e)

View File

@ -260,7 +260,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
// Filter entities so that we only have scene objects. // Filter entities so that we only have scene objects.
// FIXME: Would be nicer to have this as a proper list in InnerScene, since lots of methods // FIXME: Would be nicer to have this as a proper list in SceneGraph, since lots of methods
// end up having to do this // end up having to do this
foreach (EntityBase entity in entities) foreach (EntityBase entity in entities)
{ {

View File

@ -490,7 +490,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
} }
else if (reportType == 0) else if (reportType == 0)
{ {
SceneData = m_scene.m_innerScene.GetTopScripts(); SceneData = m_scene.m_sceneGraph.GetTopScripts();
} }
List<LandStatReportItem> SceneReport = new List<LandStatReportItem>(); List<LandStatReportItem> SceneReport = new List<LandStatReportItem>();

View File

@ -2342,7 +2342,7 @@ namespace OpenSim.Region.Environment.Scenes
public UUID RezSingleAttachment(IClientAPI remoteClient, UUID itemID, public UUID RezSingleAttachment(IClientAPI remoteClient, UUID itemID,
uint AttachmentPt) uint AttachmentPt)
{ {
SceneObjectGroup att = m_innerScene.RezSingleAttachment(remoteClient, itemID, AttachmentPt); SceneObjectGroup att = m_sceneGraph.RezSingleAttachment(remoteClient, itemID, AttachmentPt);
if (att == null) if (att == null)
{ {
@ -2375,7 +2375,7 @@ namespace OpenSim.Region.Environment.Scenes
public void AttachObject(IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos, bool silent) public void AttachObject(IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos, bool silent)
{ {
m_innerScene.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent); m_sceneGraph.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent);
} }
public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att) public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att)
@ -2455,7 +2455,8 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
m_innerScene.DetachSingleAttachmentToInv(itemID, remoteClient);
m_sceneGraph.DetachSingleAttachmentToInv(itemID, remoteClient);
} }
public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)

View File

@ -71,7 +71,11 @@ namespace OpenSim.Region.Environment.Scenes
protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>(); protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>();
protected List<RegionInfo> m_neighbours = new List<RegionInfo>(); protected List<RegionInfo> m_neighbours = new List<RegionInfo>();
public InnerScene m_innerScene; /// <value>
/// The scene graph for this scene
/// </value>
/// TODO: Possibly stop other classes being able to manipulate this directly.
public SceneGraph m_sceneGraph;
private int m_timePhase = 24; private int m_timePhase = 24;
@ -179,14 +183,14 @@ namespace OpenSim.Region.Environment.Scenes
// an instance to the physics plugin's Scene object. // an instance to the physics plugin's Scene object.
public PhysicsScene PhysicsScene public PhysicsScene PhysicsScene
{ {
set { m_innerScene.PhysicsScene = value; } set { m_sceneGraph.PhysicsScene = value; }
get { return (m_innerScene.PhysicsScene); } get { return (m_sceneGraph.PhysicsScene); }
} }
// This gets locked so things stay thread safe. // This gets locked so things stay thread safe.
public object SyncRoot public object SyncRoot
{ {
get { return m_innerScene.m_syncRoot; } get { return m_sceneGraph.m_syncRoot; }
} }
public float TimeDilation public float TimeDilation
@ -212,23 +216,23 @@ namespace OpenSim.Region.Environment.Scenes
get { return m_defaultScriptEngine; } get { return m_defaultScriptEngine; }
} }
// Local reference to the objects in the scene (which are held in innerScene) // Local reference to the objects in the scene (which are held in the scenegraph)
// public Dictionary<UUID, SceneObjectGroup> Objects // public Dictionary<UUID, SceneObjectGroup> Objects
// { // {
// get { return m_innerScene.SceneObjects; } // get { return m_sceneGraph.SceneObjects; }
// } // }
// Reference to all of the agents in the scene (root and child) // Reference to all of the agents in the scene (root and child)
protected Dictionary<UUID, ScenePresence> m_scenePresences protected Dictionary<UUID, ScenePresence> m_scenePresences
{ {
get { return m_innerScene.ScenePresences; } get { return m_sceneGraph.ScenePresences; }
set { m_innerScene.ScenePresences = value; } set { m_sceneGraph.ScenePresences = value; }
} }
// protected Dictionary<UUID, SceneObjectGroup> m_sceneObjects // protected Dictionary<UUID, SceneObjectGroup> m_sceneObjects
// { // {
// get { return m_innerScene.SceneObjects; } // get { return m_sceneGraph.SceneObjects; }
// set { m_innerScene.SceneObjects = value; } // set { m_sceneGraph.SceneObjects = value; }
// } // }
/// <summary> /// <summary>
@ -241,14 +245,14 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
public Dictionary<UUID, EntityBase> Entities public Dictionary<UUID, EntityBase> Entities
{ {
get { return m_innerScene.Entities; } get { return m_sceneGraph.Entities; }
set { m_innerScene.Entities = value; } set { m_sceneGraph.Entities = value; }
} }
public Dictionary<UUID, ScenePresence> m_restorePresences public Dictionary<UUID, ScenePresence> m_restorePresences
{ {
get { return m_innerScene.RestorePresences; } get { return m_sceneGraph.RestorePresences; }
set { m_innerScene.RestorePresences = value; } set { m_sceneGraph.RestorePresences = value; }
} }
public int objectCapacity = 45000; public int objectCapacity = 45000;
@ -296,15 +300,15 @@ namespace OpenSim.Region.Environment.Scenes
EventManager.OnLandObjectRemoved += EventManager.OnLandObjectRemoved +=
new EventManager.LandObjectRemoved(m_storageManager.DataStore.RemoveLandObject); new EventManager.LandObjectRemoved(m_storageManager.DataStore.RemoveLandObject);
m_innerScene = new InnerScene(this, m_regInfo); m_sceneGraph = new SceneGraph(this, m_regInfo);
// If the Inner scene has an Unrecoverable error, restart this sim. // If the scene graph has an Unrecoverable error, restart this sim.
// Currently the only thing that causes it to happen is two kinds of specific // Currently the only thing that causes it to happen is two kinds of specific
// Physics based crashes. // Physics based crashes.
// //
// Out of memory // Out of memory
// Operating system has killed the plugin // Operating system has killed the plugin
m_innerScene.UnRecoverableError += RestartNow; m_sceneGraph.UnRecoverableError += RestartNow;
RegisterDefaultSceneEvents(); RegisterDefaultSceneEvents();
@ -644,11 +648,13 @@ namespace OpenSim.Region.Environment.Scenes
// Stop all client threads. // Stop all client threads.
ForEachScenePresence(delegate(ScenePresence avatar) { avatar.ControllingClient.Close(true); }); ForEachScenePresence(delegate(ScenePresence avatar) { avatar.ControllingClient.Close(true); });
// Stop updating the scene objects and agents. // Stop updating the scene objects and agents.
//m_heartbeatTimer.Close(); //m_heartbeatTimer.Close();
shuttingdown = true; shuttingdown = true;
// close the inner scene
m_innerScene.Close(); m_sceneGraph.Close();
// De-register with region communications (events cleanup) // De-register with region communications (events cleanup)
UnRegisterRegionWithComms(); UnRegisterRegionWithComms();
@ -726,7 +732,7 @@ namespace OpenSim.Region.Environment.Scenes
//updateLock.WaitOne(); //updateLock.WaitOne();
float physicsFPS = 0; float physicsFPS = 0;
//m_log.Info("sadfadf" + m_neighbours.Count.ToString()); //m_log.Info("sadfadf" + m_neighbours.Count.ToString());
int agentsInScene = m_innerScene.GetRootAgentCount() + m_innerScene.GetChildAgentCount(); int agentsInScene = m_sceneGraph.GetRootAgentCount() + m_sceneGraph.GetChildAgentCount();
if (agentsInScene > 21) if (agentsInScene > 21)
{ {
@ -757,15 +763,15 @@ namespace OpenSim.Region.Environment.Scenes
physicsMS2 = System.Environment.TickCount; physicsMS2 = System.Environment.TickCount;
if ((m_frame % m_update_physics == 0) && m_physics_enabled) if ((m_frame % m_update_physics == 0) && m_physics_enabled)
m_innerScene.UpdatePreparePhysics(); m_sceneGraph.UpdatePreparePhysics();
physicsMS2 = System.Environment.TickCount - physicsMS2; physicsMS2 = System.Environment.TickCount - physicsMS2;
if (m_frame % m_update_entitymovement == 0) if (m_frame % m_update_entitymovement == 0)
m_innerScene.UpdateEntityMovement(); m_sceneGraph.UpdateEntityMovement();
physicsMS = System.Environment.TickCount; physicsMS = System.Environment.TickCount;
if ((m_frame % m_update_physics == 0) && m_physics_enabled) if ((m_frame % m_update_physics == 0) && m_physics_enabled)
physicsFPS = m_innerScene.UpdatePhysics( physicsFPS = m_sceneGraph.UpdatePhysics(
Math.Max(SinceLastFrame.TotalSeconds, m_timespan) Math.Max(SinceLastFrame.TotalSeconds, m_timespan)
); );
if (m_frame % m_update_physics == 0 && SynchronizeScene != null) if (m_frame % m_update_physics == 0 && SynchronizeScene != null)
@ -777,16 +783,16 @@ namespace OpenSim.Region.Environment.Scenes
otherMS = System.Environment.TickCount; otherMS = System.Environment.TickCount;
// run through all entities looking for updates (slow) // run through all entities looking for updates (slow)
if (m_frame % m_update_entities == 0) if (m_frame % m_update_entities == 0)
m_innerScene.UpdateEntities(); m_sceneGraph.UpdateEntities();
// run through entities that have scheduled themselves for // run through entities that have scheduled themselves for
// updates looking for updates(faster) // updates looking for updates(faster)
if (m_frame % m_update_entitiesquick == 0) if (m_frame % m_update_entitiesquick == 0)
m_innerScene.ProcessUpdates(); m_sceneGraph.ProcessUpdates();
// Run through scenepresences looking for updates // Run through scenepresences looking for updates
if (m_frame % m_update_presences == 0) if (m_frame % m_update_presences == 0)
m_innerScene.UpdatePresences(); m_sceneGraph.UpdatePresences();
// Delete temp-on-rez stuff // Delete temp-on-rez stuff
if (m_frame % m_update_backup == 0) if (m_frame % m_update_backup == 0)
@ -814,16 +820,16 @@ namespace OpenSim.Region.Environment.Scenes
m_statsReporter.AddTimeDilation(m_timedilation); m_statsReporter.AddTimeDilation(m_timedilation);
m_statsReporter.AddFPS(1); m_statsReporter.AddFPS(1);
m_statsReporter.AddInPackets(0); m_statsReporter.AddInPackets(0);
m_statsReporter.SetRootAgents(m_innerScene.GetRootAgentCount()); m_statsReporter.SetRootAgents(m_sceneGraph.GetRootAgentCount());
m_statsReporter.SetChildAgents(m_innerScene.GetChildAgentCount()); m_statsReporter.SetChildAgents(m_sceneGraph.GetChildAgentCount());
m_statsReporter.SetObjects(m_innerScene.GetTotalObjectsCount()); m_statsReporter.SetObjects(m_sceneGraph.GetTotalObjectsCount());
m_statsReporter.SetActiveObjects(m_innerScene.GetActiveObjectsCount()); m_statsReporter.SetActiveObjects(m_sceneGraph.GetActiveObjectsCount());
frameMS = System.Environment.TickCount - frameMS; frameMS = System.Environment.TickCount - frameMS;
m_statsReporter.addFrameMS(frameMS); m_statsReporter.addFrameMS(frameMS);
m_statsReporter.addPhysicsMS(physicsMS); m_statsReporter.addPhysicsMS(physicsMS);
m_statsReporter.addOtherMS(otherMS); m_statsReporter.addOtherMS(otherMS);
m_statsReporter.SetActiveScripts(m_innerScene.GetActiveScriptsCount()); m_statsReporter.SetActiveScripts(m_sceneGraph.GetActiveScriptsCount());
m_statsReporter.addScriptLines(m_innerScene.GetScriptLPS()); m_statsReporter.addScriptLines(m_sceneGraph.GetScriptLPS());
} }
} }
catch (NotImplementedException) catch (NotImplementedException)
@ -1163,7 +1169,7 @@ namespace OpenSim.Region.Environment.Scenes
//AXdirection = new Vector3(direction.X, direction.Y, direction.Z); //AXdirection = new Vector3(direction.X, direction.Y, direction.Z);
//testRay = new Ray(AXOrigin, AXdirection); //testRay = new Ray(AXOrigin, AXdirection);
//rt = m_innerScene.GetClosestIntersectingPrim(testRay); //rt = m_sceneGraph.GetClosestIntersectingPrim(testRay);
//if (rt.HitTF) //if (rt.HitTF)
//{ //{
@ -1642,7 +1648,7 @@ namespace OpenSim.Region.Environment.Scenes
// TODO: Raytrace better here // TODO: Raytrace better here
//EntityIntersection ei = m_innerScene.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection)); //EntityIntersection ei = m_sceneGraph.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection));
Ray NewRay = new Ray(AXOrigin, AXdirection); Ray NewRay = new Ray(AXOrigin, AXdirection);
// Ray Trace against target here // Ray Trace against target here
@ -1676,7 +1682,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
// We don't have a target here, so we're going to raytrace all the objects in the scene. // We don't have a target here, so we're going to raytrace all the objects in the scene.
EntityIntersection ei = m_innerScene.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection), true, false); EntityIntersection ei = m_sceneGraph.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection), true, false);
// Un-comment the following line to print the raytrace results to the console. // Un-comment the following line to print the raytrace results to the console.
//m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString()); //m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString());
@ -1790,7 +1796,7 @@ namespace OpenSim.Region.Environment.Scenes
public bool AddRestoredSceneObject( public bool AddRestoredSceneObject(
SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted)
{ {
return m_innerScene.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted); return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted);
} }
/// <summary> /// <summary>
@ -1803,7 +1809,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </param> /// </param>
public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup)
{ {
return m_innerScene.AddNewSceneObject(sceneObject, attachToBackup); return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup);
} }
/// <summary> /// <summary>
@ -1869,7 +1875,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns>true if the object was in the scene, false if it was not</returns> /// <returns>true if the object was in the scene, false if it was not</returns>
public bool UnlinkSceneObject(UUID uuid, bool resultOfLinkingObjects) public bool UnlinkSceneObject(UUID uuid, bool resultOfLinkingObjects)
{ {
if (m_innerScene.DeleteSceneObject(uuid, resultOfLinkingObjects)) if (m_sceneGraph.DeleteSceneObject(uuid, resultOfLinkingObjects))
{ {
if (!resultOfLinkingObjects) if (!resultOfLinkingObjects)
m_storageManager.DataStore.RemoveObject(uuid, m_storageManager.DataStore.RemoveObject(uuid,
@ -2203,7 +2209,7 @@ namespace OpenSim.Region.Environment.Scenes
presence.initializeScenePresence(client, RegionInfo, this); presence.initializeScenePresence(client, RegionInfo, this);
m_innerScene.AddScenePresence(presence); m_sceneGraph.AddScenePresence(presence);
lock (m_restorePresences) lock (m_restorePresences)
{ {
@ -2228,40 +2234,40 @@ namespace OpenSim.Region.Environment.Scenes
{ {
client.OnRegionHandShakeReply += SendLayerData; client.OnRegionHandShakeReply += SendLayerData;
client.OnAddPrim += AddNewPrim; client.OnAddPrim += AddNewPrim;
client.OnUpdatePrimGroupPosition += m_innerScene.UpdatePrimPosition; client.OnUpdatePrimGroupPosition += m_sceneGraph.UpdatePrimPosition;
client.OnUpdatePrimSinglePosition += m_innerScene.UpdatePrimSinglePosition; client.OnUpdatePrimSinglePosition += m_sceneGraph.UpdatePrimSinglePosition;
client.OnUpdatePrimGroupRotation += m_innerScene.UpdatePrimRotation; client.OnUpdatePrimGroupRotation += m_sceneGraph.UpdatePrimRotation;
client.OnUpdatePrimGroupMouseRotation += m_innerScene.UpdatePrimRotation; client.OnUpdatePrimGroupMouseRotation += m_sceneGraph.UpdatePrimRotation;
client.OnUpdatePrimSingleRotation += m_innerScene.UpdatePrimSingleRotation; client.OnUpdatePrimSingleRotation += m_sceneGraph.UpdatePrimSingleRotation;
client.OnUpdatePrimScale += m_innerScene.UpdatePrimScale; client.OnUpdatePrimScale += m_sceneGraph.UpdatePrimScale;
client.OnUpdatePrimGroupScale += m_innerScene.UpdatePrimGroupScale; client.OnUpdatePrimGroupScale += m_sceneGraph.UpdatePrimGroupScale;
client.OnUpdateExtraParams += m_innerScene.UpdateExtraParam; client.OnUpdateExtraParams += m_sceneGraph.UpdateExtraParam;
client.OnUpdatePrimShape += m_innerScene.UpdatePrimShape; client.OnUpdatePrimShape += m_sceneGraph.UpdatePrimShape;
//client.OnRequestMapBlocks += RequestMapBlocks; // handled in a module now. //client.OnRequestMapBlocks += RequestMapBlocks; // handled in a module now.
client.OnUpdatePrimTexture += m_innerScene.UpdatePrimTexture; client.OnUpdatePrimTexture += m_sceneGraph.UpdatePrimTexture;
client.OnTeleportLocationRequest += RequestTeleportLocation; client.OnTeleportLocationRequest += RequestTeleportLocation;
client.OnTeleportLandmarkRequest += RequestTeleportLandmark; client.OnTeleportLandmarkRequest += RequestTeleportLandmark;
client.OnObjectSelect += SelectPrim; client.OnObjectSelect += SelectPrim;
client.OnObjectDeselect += DeselectPrim; client.OnObjectDeselect += DeselectPrim;
client.OnGrabUpdate += m_innerScene.MoveObject; client.OnGrabUpdate += m_sceneGraph.MoveObject;
client.OnDeRezObject += DeRezObject; client.OnDeRezObject += DeRezObject;
client.OnRezObject += RezObject; client.OnRezObject += RezObject;
client.OnRezSingleAttachmentFromInv += RezSingleAttachment; client.OnRezSingleAttachmentFromInv += RezSingleAttachment;
client.OnDetachAttachmentIntoInv += DetachSingleAttachmentToInv; client.OnDetachAttachmentIntoInv += DetachSingleAttachmentToInv;
client.OnObjectAttach += m_innerScene.AttachObject; client.OnObjectAttach += m_sceneGraph.AttachObject;
client.OnObjectDetach += m_innerScene.DetachObject; client.OnObjectDetach += m_sceneGraph.DetachObject;
client.OnObjectDrop += m_innerScene.DropObject; client.OnObjectDrop += m_sceneGraph.DropObject;
client.OnNameFromUUIDRequest += CommsManager.HandleUUIDNameRequest; client.OnNameFromUUIDRequest += CommsManager.HandleUUIDNameRequest;
client.OnObjectDescription += m_innerScene.PrimDescription; client.OnObjectDescription += m_sceneGraph.PrimDescription;
client.OnObjectName += m_innerScene.PrimName; client.OnObjectName += m_sceneGraph.PrimName;
client.OnObjectClickAction += m_innerScene.PrimClickAction; client.OnObjectClickAction += m_sceneGraph.PrimClickAction;
client.OnObjectMaterial += m_innerScene.PrimMaterial; client.OnObjectMaterial += m_sceneGraph.PrimMaterial;
client.OnLinkObjects += m_innerScene.LinkObjects; client.OnLinkObjects += m_sceneGraph.LinkObjects;
client.OnDelinkObjects += m_innerScene.DelinkObjects; client.OnDelinkObjects += m_sceneGraph.DelinkObjects;
client.OnObjectDuplicate += m_innerScene.DuplicateObject; client.OnObjectDuplicate += m_sceneGraph.DuplicateObject;
client.OnObjectDuplicateOnRay += doObjectDuplicateOnRay; client.OnObjectDuplicateOnRay += doObjectDuplicateOnRay;
client.OnUpdatePrimFlags += m_innerScene.UpdatePrimFlags; client.OnUpdatePrimFlags += m_sceneGraph.UpdatePrimFlags;
client.OnRequestObjectPropertiesFamily += m_innerScene.RequestObjectPropertiesFamily; client.OnRequestObjectPropertiesFamily += m_sceneGraph.RequestObjectPropertiesFamily;
client.OnRequestGodlikePowers += handleRequestGodlikePowers; client.OnRequestGodlikePowers += handleRequestGodlikePowers;
client.OnGodKickUser += HandleGodlikeKickUser; client.OnGodKickUser += HandleGodlikeKickUser;
client.OnObjectPermissions += HandleObjectPermissionsUpdate; client.OnObjectPermissions += HandleObjectPermissionsUpdate;
@ -2287,11 +2293,11 @@ namespace OpenSim.Region.Environment.Scenes
client.OnMoneyTransferRequest += ProcessMoneyTransferRequest; client.OnMoneyTransferRequest += ProcessMoneyTransferRequest;
client.OnParcelBuy += ProcessParcelBuy; client.OnParcelBuy += ProcessParcelBuy;
client.OnAvatarPickerRequest += ProcessAvatarPickerRequest; client.OnAvatarPickerRequest += ProcessAvatarPickerRequest;
client.OnObjectIncludeInSearch += m_innerScene.MakeObjectSearchable; client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable;
client.OnTeleportHomeRequest += TeleportClientHome; client.OnTeleportHomeRequest += TeleportClientHome;
client.OnSetStartLocationRequest += SetHomeRezPoint; client.OnSetStartLocationRequest += SetHomeRezPoint;
client.OnUndo += m_innerScene.HandleUndo; client.OnUndo += m_sceneGraph.HandleUndo;
client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate; client.OnObjectGroupRequest += m_sceneGraph.HandleObjectGroupUpdate;
client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel; client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel;
client.OnParcelSetOtherCleanTime += LandChannel.SetParcelOtherCleanTime; client.OnParcelSetOtherCleanTime += LandChannel.SetParcelOtherCleanTime;
client.OnObjectSaleInfo += ObjectSaleInfo; client.OnObjectSaleInfo += ObjectSaleInfo;
@ -2403,7 +2409,7 @@ namespace OpenSim.Region.Environment.Scenes
// TODO: Raytrace better here // TODO: Raytrace better here
//EntityIntersection ei = m_innerScene.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection)); //EntityIntersection ei = m_sceneGraph.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection));
Ray NewRay = new Ray(AXOrigin, AXdirection); Ray NewRay = new Ray(AXOrigin, AXdirection);
// Ray Trace against target here // Ray Trace against target here
@ -2433,14 +2439,14 @@ namespace OpenSim.Region.Environment.Scenes
{ {
Quaternion worldRot = target2.GetWorldRotation(); Quaternion worldRot = target2.GetWorldRotation();
// SceneObjectGroup obj = m_innerScene.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); // SceneObjectGroup obj = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot);
m_innerScene.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot);
//obj.Rotation = worldRot; //obj.Rotation = worldRot;
//obj.UpdateGroupRotation(worldRot); //obj.UpdateGroupRotation(worldRot);
} }
else else
{ {
m_innerScene.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID); m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID);
} }
} }
@ -2486,7 +2492,7 @@ namespace OpenSim.Region.Environment.Scenes
AvatarAppearance appearance = null; AvatarAppearance appearance = null;
GetAvatarAppearance(client, out appearance); GetAvatarAppearance(client, out appearance);
ScenePresence avatar = m_innerScene.CreateAndAddScenePresence(client, child, appearance); ScenePresence avatar = m_sceneGraph.CreateAndAddScenePresence(client, child, appearance);
return avatar; return avatar;
} }
@ -2538,11 +2544,11 @@ namespace OpenSim.Region.Environment.Scenes
if (avatar.IsChildAgent) if (avatar.IsChildAgent)
{ {
m_innerScene.removeUserCount(false); m_sceneGraph.removeUserCount(false);
} }
else else
{ {
m_innerScene.removeUserCount(true); m_sceneGraph.removeUserCount(true);
m_sceneGridService.LogOffUser(agentID, RegionInfo.RegionID, RegionInfo.RegionHandle, avatar.AbsolutePosition, avatar.Lookat); m_sceneGridService.LogOffUser(agentID, RegionInfo.RegionID, RegionInfo.RegionHandle, avatar.AbsolutePosition, avatar.Lookat);
List<ulong> childknownRegions = new List<ulong>(); List<ulong> childknownRegions = new List<ulong>();
List<ulong> ckn = avatar.GetKnownRegionList(); List<ulong> ckn = avatar.GetKnownRegionList();
@ -2587,7 +2593,7 @@ namespace OpenSim.Region.Environment.Scenes
agentTransactions.RemoveAgentAssetTransactions(agentID); agentTransactions.RemoveAgentAssetTransactions(agentID);
} }
m_innerScene.RemoveScenePresence(agentID); m_sceneGraph.RemoveScenePresence(agentID);
try try
{ {
@ -2807,7 +2813,7 @@ namespace OpenSim.Region.Environment.Scenes
cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset; cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset;
cap.TaskScriptUpdatedCall = CapsUpdateTaskInventoryScriptAsset; cap.TaskScriptUpdatedCall = CapsUpdateTaskInventoryScriptAsset;
cap.CAPSFetchInventoryDescendents = CommsManager.UserProfileCacheService.HandleFetchInventoryDescendentsCAPS; cap.CAPSFetchInventoryDescendents = CommsManager.UserProfileCacheService.HandleFetchInventoryDescendentsCAPS;
cap.GetClient = m_innerScene.GetControllingClient; cap.GetClient = m_sceneGraph.GetControllingClient;
m_capsHandlers[agentId] = cap; m_capsHandlers[agentId] = cap;
} }
@ -2917,18 +2923,18 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="agentID"></param> /// <param name="agentID"></param>
public bool CloseConnection(UUID agentID) public bool CloseConnection(UUID agentID)
{ {
ScenePresence presence = m_innerScene.GetScenePresence(agentID); ScenePresence presence = m_sceneGraph.GetScenePresence(agentID);
if (presence != null) if (presence != null)
{ {
// Nothing is removed here, so down count it as such // Nothing is removed here, so down count it as such
// if (presence.IsChildAgent) // if (presence.IsChildAgent)
// { // {
// m_innerScene.removeUserCount(false); // m_sceneGraph.removeUserCount(false);
// } // }
// else // else
// { // {
// m_innerScene.removeUserCount(true); // m_sceneGraph.removeUserCount(true);
// } // }
// Tell a single agent to disconnect from the region. // Tell a single agent to disconnect from the region.
@ -3501,7 +3507,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
else else
{ {
m_innerScene.removeUserCount(!m_scenePresences[agentID].IsChildAgent); m_sceneGraph.removeUserCount(!m_scenePresences[agentID].IsChildAgent);
m_scenePresences[agentID].ControllingClient.Kick(Utils.BytesToString(reason)); m_scenePresences[agentID].ControllingClient.Kick(Utils.BytesToString(reason));
m_scenePresences[agentID].ControllingClient.Close(true); m_scenePresences[agentID].ControllingClient.Close(true);
@ -3872,7 +3878,7 @@ namespace OpenSim.Region.Environment.Scenes
#endregion #endregion
#region InnerScene wrapper methods #region SceneGraph wrapper methods
/// <summary> /// <summary>
/// ///
@ -3881,22 +3887,22 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns> /// <returns></returns>
public UUID ConvertLocalIDToFullID(uint localID) public UUID ConvertLocalIDToFullID(uint localID)
{ {
return m_innerScene.ConvertLocalIDToFullID(localID); return m_sceneGraph.ConvertLocalIDToFullID(localID);
} }
public void SwapRootAgentCount(bool rootChildChildRootTF) public void SwapRootAgentCount(bool rootChildChildRootTF)
{ {
m_innerScene.SwapRootChildAgent(rootChildChildRootTF); m_sceneGraph.SwapRootChildAgent(rootChildChildRootTF);
} }
public void AddPhysicalPrim(int num) public void AddPhysicalPrim(int num)
{ {
m_innerScene.AddPhysicalPrim(num); m_sceneGraph.AddPhysicalPrim(num);
} }
public void RemovePhysicalPrim(int num) public void RemovePhysicalPrim(int num)
{ {
m_innerScene.RemovePhysicalPrim(num); m_sceneGraph.RemovePhysicalPrim(num);
} }
//The idea is to have a group of method that return a list of avatars meeting some requirement //The idea is to have a group of method that return a list of avatars meeting some requirement
@ -3909,7 +3915,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns> /// <returns></returns>
public List<ScenePresence> GetAvatars() public List<ScenePresence> GetAvatars()
{ {
return m_innerScene.GetAvatars(); return m_sceneGraph.GetAvatars();
} }
/// <summary> /// <summary>
@ -3919,7 +3925,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns> /// <returns></returns>
public List<ScenePresence> GetScenePresences() public List<ScenePresence> GetScenePresences()
{ {
return m_innerScene.GetScenePresences(); return m_sceneGraph.GetScenePresences();
} }
/// <summary> /// <summary>
@ -3930,7 +3936,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns> /// <returns></returns>
public List<ScenePresence> GetScenePresences(FilterAvatarList filter) public List<ScenePresence> GetScenePresences(FilterAvatarList filter)
{ {
return m_innerScene.GetScenePresences(filter); return m_sceneGraph.GetScenePresences(filter);
} }
/// <summary> /// <summary>
@ -3940,7 +3946,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns> /// <returns></returns>
public ScenePresence GetScenePresence(UUID avatarID) public ScenePresence GetScenePresence(UUID avatarID)
{ {
return m_innerScene.GetScenePresence(avatarID); return m_sceneGraph.GetScenePresence(avatarID);
} }
/// <summary> /// <summary>
@ -4005,7 +4011,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns> /// <returns></returns>
public SceneObjectPart GetSceneObjectPart(string name) public SceneObjectPart GetSceneObjectPart(string name)
{ {
return m_innerScene.GetSceneObjectPart(name); return m_sceneGraph.GetSceneObjectPart(name);
} }
/// <summary> /// <summary>
@ -4015,7 +4021,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns> /// <returns></returns>
public SceneObjectPart GetSceneObjectPart(uint localID) public SceneObjectPart GetSceneObjectPart(uint localID)
{ {
return m_innerScene.GetSceneObjectPart(localID); return m_sceneGraph.GetSceneObjectPart(localID);
} }
/// <summary> /// <summary>
@ -4025,22 +4031,22 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns> /// <returns></returns>
public SceneObjectPart GetSceneObjectPart(UUID fullID) public SceneObjectPart GetSceneObjectPart(UUID fullID)
{ {
return m_innerScene.GetSceneObjectPart(fullID); return m_sceneGraph.GetSceneObjectPart(fullID);
} }
internal bool TryGetAvatar(UUID avatarId, out ScenePresence avatar) internal bool TryGetAvatar(UUID avatarId, out ScenePresence avatar)
{ {
return m_innerScene.TryGetAvatar(avatarId, out avatar); return m_sceneGraph.TryGetAvatar(avatarId, out avatar);
} }
internal bool TryGetAvatarByName(string avatarName, out ScenePresence avatar) internal bool TryGetAvatarByName(string avatarName, out ScenePresence avatar)
{ {
return m_innerScene.TryGetAvatarByName(avatarName, out avatar); return m_sceneGraph.TryGetAvatarByName(avatarName, out avatar);
} }
internal void ForEachClient(Action<IClientAPI> action) internal void ForEachClient(Action<IClientAPI> action)
{ {
m_innerScene.ForEachClient(action); m_sceneGraph.ForEachClient(action);
} }
/// <summary> /// <summary>
@ -4050,7 +4056,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns> /// <returns></returns>
public List<EntityBase> GetEntities() public List<EntityBase> GetEntities()
{ {
return m_innerScene.GetEntities(); return m_sceneGraph.GetEntities();
} }
#endregion #endregion

View File

@ -39,7 +39,11 @@ namespace OpenSim.Region.Environment.Scenes
{ {
public delegate void PhysicsCrash(); public delegate void PhysicsCrash();
public class InnerScene /// <summary>
/// This class used to be called InnerScene and may not yet truly be a SceneGraph. The non scene graph components
/// should be migrated out over time.
/// </summary>
public class SceneGraph
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -77,7 +81,7 @@ namespace OpenSim.Region.Environment.Scenes
#endregion #endregion
protected internal InnerScene(Scene parent, RegionInfo regInfo) protected internal SceneGraph(Scene parent, RegionInfo regInfo)
{ {
m_parentScene = parent; m_parentScene = parent;
m_regInfo = regInfo; m_regInfo = regInfo;
@ -1698,6 +1702,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
return null; return null;
} }
/// <summary> /// <summary>
/// Calculates the distance between two Vector3s /// Calculates the distance between two Vector3s
/// </summary> /// </summary>

View File

@ -1051,13 +1051,13 @@ namespace OpenSim.Region.Environment.Scenes
scriptScore = 0; scriptScore = 0;
scriptScore += (float)count; scriptScore += (float)count;
InnerScene d = m_scene.m_innerScene; SceneGraph d = m_scene.m_sceneGraph;
d.AddToScriptLPS(count); d.AddToScriptLPS(count);
} }
public void AddActiveScriptCount(int count) public void AddActiveScriptCount(int count)
{ {
InnerScene d = m_scene.m_innerScene; SceneGraph d = m_scene.m_sceneGraph;
d.AddActiveScripts(count); d.AddActiveScripts(count);
} }
@ -1672,7 +1672,7 @@ namespace OpenSim.Region.Environment.Scenes
public void QueueForUpdateCheck() public void QueueForUpdateCheck()
{ {
m_scene.m_innerScene.AddToUpdateList(this); m_scene.m_sceneGraph.AddToUpdateList(this);
} }
/// <summary> /// <summary>

View File

@ -2483,7 +2483,7 @@ namespace OpenSim.Region.Environment.Scenes
foreach (SceneObjectGroup grp in m_attachments) foreach (SceneObjectGroup grp in m_attachments)
{ {
// ControllingClient may be null at this point! // ControllingClient may be null at this point!
m_scene.m_innerScene.DetachSingleAttachmentToInv(grp.GetFromAssetID(), ControllingClient); m_scene.m_sceneGraph.DetachSingleAttachmentToInv(grp.GetFromAssetID(), ControllingClient);
} }
} }
catch (InvalidOperationException) catch (InvalidOperationException)

View File

@ -40,7 +40,7 @@ namespace OpenSim.Region.Physics.Manager
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// The only thing that should register for this event is the InnerScene // The only thing that should register for this event is the SceneGraph
// Anything else could cause problems. // Anything else could cause problems.
public event physicsCrash OnPhysicsCrash; public event physicsCrash OnPhysicsCrash;