From 9d9fcac0386ba6adc7a1f6c08f82bd5c0b6cd1d2 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Fri, 14 Aug 2009 17:16:41 +0900 Subject: Misc cleanup. --- OpenSim/Framework/LandData.cs | 2 +- .../Framework/Tests/AgentCircuitManagerTests.cs | 2 +- OpenSim/Framework/Tests/ThreadTrackerTests.cs | 2 +- .../InterGrid/OpenGridProtocolModule.cs | 14 +++--- OpenSim/Region/Framework/Scenes/EventManager.cs | 2 +- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 17 +++---- .../Region/Framework/Scenes/SceneObjectGroup.cs | 51 ++++++--------------- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 52 +++++++++++----------- .../Scripting/Minimodule/Interfaces/IObject.cs | 2 +- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 13 ++---- 10 files changed, 61 insertions(+), 96 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs index a24af04..e639da0 100644 --- a/OpenSim/Framework/LandData.cs +++ b/OpenSim/Framework/LandData.cs @@ -520,7 +520,7 @@ namespace OpenSim.Framework } /// - /// Depreciated idea. Number of visitors ~= free money + /// Deprecated idea. Number of visitors ~= free money /// public int Dwell { get { diff --git a/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs b/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs index ab5f04a..6c98897 100644 --- a/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs +++ b/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs @@ -64,7 +64,7 @@ namespace OpenSim.Framework.Tests Vector3 StartPos = new Vector3(5, 23, 125); UUID SecureSessionId = UUID.Random(); - UUID SessionId = UUID.Random(); + // TODO: unused: UUID SessionId = UUID.Random(); m_agentCircuitData1 = new AgentCircuitData(); m_agentCircuitData1.AgentID = AgentId1; diff --git a/OpenSim/Framework/Tests/ThreadTrackerTests.cs b/OpenSim/Framework/Tests/ThreadTrackerTests.cs index 37c75ef..15d5b73 100644 --- a/OpenSim/Framework/Tests/ThreadTrackerTests.cs +++ b/OpenSim/Framework/Tests/ThreadTrackerTests.cs @@ -161,7 +161,7 @@ namespace OpenSim.Framework.Tests /// Worker thread 0 /// /// - public void run( object o) + public void run(object o) { while (running) { diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs index bcf20be..e9c1e9d 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs @@ -450,7 +450,7 @@ namespace OpenSim.Region.CoreModules.InterGrid responseMap["sim_host"] = OSD.FromString(reg.ExternalHostName); - // DEPRECIATED + // DEPRECATED responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); responseMap["connect"] = OSD.FromBoolean(true); @@ -591,7 +591,7 @@ namespace OpenSim.Region.CoreModules.InterGrid httpaddr = httpsCN; } - // DEPRECIATED + // DEPRECATED responseMap["seed_capability"] = OSD.FromString( regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); @@ -764,7 +764,7 @@ namespace OpenSim.Region.CoreModules.InterGrid responseMap["sim_port"] = OSD.FromInteger(reg.InternalEndPoint.Port); responseMap["sim_host"] = OSD.FromString(reg.ExternalHostName);// + ":" + reg.InternalEndPoint.Port.ToString()); - // DEPRECIATED + // DEPRECATED responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); responseMap["session_id"] = OSD.FromUUID(SessionID); @@ -851,7 +851,7 @@ namespace OpenSim.Region.CoreModules.InterGrid string rezRespSeedCap = ""; - // DEPRECIATED + // DEPRECATED if (rezResponseMap.ContainsKey("seed_capability")) rezRespSeedCap = rezResponseMap["seed_capability"].AsString(); @@ -863,7 +863,7 @@ namespace OpenSim.Region.CoreModules.InterGrid if (rezResponseMap.ContainsKey("rez_avatar/rez")) rezRespSeedCap = rezResponseMap["rez_avatar/rez"].AsString(); - // DEPRECIATED + // DEPRECATED string rezRespSim_ip = rezResponseMap["sim_ip"].AsString(); string rezRespSim_host = rezResponseMap["sim_host"].AsString(); @@ -879,13 +879,13 @@ namespace OpenSim.Region.CoreModules.InterGrid { RezResponsePositionArray = (OSDArray)rezResponseMap["position"]; } - // DEPRECIATED + // DEPRECATED responseMap["seed_capability"] = OSD.FromString(rezRespSeedCap); // REPLACEMENT r3 responseMap["region_seed_capability"] = OSD.FromString(rezRespSeedCap); - // DEPRECIATED + // DEPRECATED responseMap["sim_ip"] = OSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString()); responseMap["sim_host"] = OSD.FromString(rezRespSim_host); diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 7bbe045..287d8d9 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -63,7 +63,7 @@ namespace OpenSim.Region.Framework.Scenes public delegate void OnNewClientDelegate(IClientAPI client); /// - /// Depreciated in favour of OnClientConnect. + /// Deprecated in favour of OnClientConnect. /// Will be marked Obsolete after IClientCore has 100% of IClientAPI interfaces. /// public event OnNewClientDelegate OnNewClient; diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 0e0999a..7771831 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -928,25 +928,22 @@ namespace OpenSim.Region.Framework.Scenes { // Primitive Ray Tracing float closestDistance = 280f; - EntityIntersection returnResult = new EntityIntersection(); + EntityIntersection result = new EntityIntersection(); List EntityList = GetEntities(); foreach (EntityBase ent in EntityList) { if (ent is SceneObjectGroup) { SceneObjectGroup reportingG = (SceneObjectGroup)ent; - EntityIntersection result = reportingG.TestIntersection(hray, frontFacesOnly, faceCenters); - if (result.HitTF) + EntityIntersection inter = reportingG.TestIntersection(hray, frontFacesOnly, faceCenters); + if (inter.HitTF && inter.distance < closestDistance) { - if (result.distance < closestDistance) - { - closestDistance = result.distance; - returnResult = result; - } + closestDistance = inter.distance; + result = inter; } } } - return returnResult; + return result; } /// @@ -979,7 +976,7 @@ namespace OpenSim.Region.Framework.Scenes { foreach (SceneObjectPart p in ((SceneObjectGroup) ent).GetParts()) { - if (p.Name==name) + if (p.Name == name) { return p; } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index c86e4a1..bc3d5c0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -555,7 +555,7 @@ namespace OpenSim.Region.Framework.Scenes // If we get a result, we're going to find the closest result to the origin of the ray // and send back the intersection information back to the innerscene. - EntityIntersection returnresult = new EntityIntersection(); + EntityIntersection result = new EntityIntersection(); lock (m_parts) { @@ -576,26 +576,23 @@ namespace OpenSim.Region.Framework.Scenes // when the camera crosses the border. float idist = Constants.RegionSize; - if (inter.HitTF) { // We need to find the closest prim to return to the testcaller along the ray if (inter.distance < idist) { - returnresult.HitTF = true; - returnresult.ipoint = inter.ipoint; - returnresult.obj = part; - returnresult.normal = inter.normal; - returnresult.distance = inter.distance; + result.HitTF = true; + result.ipoint = inter.ipoint; + result.obj = part; + result.normal = inter.normal; + result.distance = inter.distance; } } } } - return returnresult; + return result; } - - /// /// Gets a vector representing the size of the bounding box containing all the prims in the group /// Treats all prims as rectangular, so no shape (cut etc) is taken into account @@ -652,7 +649,6 @@ namespace OpenSim.Region.Framework.Scenes frontBottomRight.Y = orig.Y + (part.Scale.Y / 2); frontBottomRight.Z = orig.Z - (part.Scale.Z / 2); - backTopLeft.X = orig.X + (part.Scale.X / 2); backTopLeft.Y = orig.Y - (part.Scale.Y / 2); backTopLeft.Z = orig.Z + (part.Scale.Z / 2); @@ -839,7 +835,6 @@ namespace OpenSim.Region.Framework.Scenes if (backBottomLeft.Z < minZ) minZ = backBottomLeft.Z; } - } Vector3 boundingBox = new Vector3(maxX - minX, maxY - minY, maxZ - minZ); @@ -860,6 +855,7 @@ namespace OpenSim.Region.Framework.Scenes // m_log.InfoFormat("BoundingBox is {0} , {1} , {2} ", boundingBox.X, boundingBox.Y, boundingBox.Z); return boundingBox; } + #endregion public void SaveScriptedState(XmlTextWriter writer) @@ -1029,8 +1025,8 @@ namespace OpenSim.Region.Framework.Scenes //m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim); //AttachToBackup(); //m_rootPart.ScheduleFullUpdate(); - } + /// /// /// @@ -1130,6 +1126,7 @@ namespace OpenSim.Region.Framework.Scenes } } } + // helper provided for parts. public int GetSceneMaxUndo() { @@ -1183,7 +1180,6 @@ namespace OpenSim.Region.Framework.Scenes { SceneObjectPart part = GetChildPart(localId); OnGrabPart(part, offsetPos, remoteClient); - } } @@ -1267,28 +1263,10 @@ namespace OpenSim.Region.Framework.Scenes } } - if ((aggregateScriptEvents & scriptEvents.at_target) != 0) - { - m_scriptListens_atTarget = true; - } - else - { - m_scriptListens_atTarget = false; - } - - if ((aggregateScriptEvents & scriptEvents.not_at_target) != 0) - { - m_scriptListens_notAtTarget = true; - } - else - { - m_scriptListens_notAtTarget = false; - } + m_scriptListens_atTarget = ((aggregateScriptEvents & scriptEvents.at_target) != 0); + m_scriptListens_notAtTarget = ((aggregateScriptEvents & scriptEvents.not_at_target) != 0); - if (m_scriptListens_atTarget || m_scriptListens_notAtTarget) - { - } - else + if (!m_scriptListens_atTarget && !m_scriptListens_notAtTarget) { lock (m_targets) m_targets.Clear(); @@ -1787,9 +1765,6 @@ namespace OpenSim.Region.Framework.Scenes } } - - - /// /// Set the owner of the root part. /// diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 3646811..5a74bad 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2710,11 +2710,10 @@ if (m_shape != null) { public EntityIntersection TestIntersection(Ray iray, Quaternion parentrot) { - // In this case we're using a sphere with a radius of the largest dimention of the prim + // In this case we're using a sphere with a radius of the largest dimension of the prim // TODO: Change to take shape into account - - EntityIntersection returnresult = new EntityIntersection(); + EntityIntersection result = new EntityIntersection(); Vector3 vAbsolutePosition = AbsolutePosition; Vector3 vScale = Scale; Vector3 rOrigin = iray.Origin; @@ -2738,8 +2737,7 @@ if (m_shape != null) { Vector3 tmVal6 = vAbsolutePosition*rOrigin; - - // Set Radius to the largest dimention of the prim + // Set Radius to the largest dimension of the prim float radius = 0f; if (vScale.X > radius) radius = vScale.X; @@ -2765,7 +2763,7 @@ if (m_shape != null) { if (rootsqr < 0.0f) { // No intersection - return returnresult; + return result; } float root = ((-itestPart2) - (float) Math.Sqrt((double) rootsqr))/(itestPart1*2.0f); @@ -2778,7 +2776,7 @@ if (m_shape != null) { if (root < 0.0f) { // nope, no intersection - return returnresult; + return result; } } @@ -2788,12 +2786,12 @@ if (m_shape != null) { new Vector3(iray.Origin.X + (iray.Direction.X*root), iray.Origin.Y + (iray.Direction.Y*root), iray.Origin.Z + (iray.Direction.Z*root)); - returnresult.HitTF = true; - returnresult.ipoint = ipoint; + result.HitTF = true; + result.ipoint = ipoint; // Normal is calculated by the difference and then normalizing the result Vector3 normalpart = ipoint - vAbsolutePosition; - returnresult.normal = normalpart / normalpart.Length(); + result.normal = normalpart / normalpart.Length(); // It's funny how the Vector3 object has a Distance function, but the Axiom.Math object doesn't. // I can write a function to do it.. but I like the fact that this one is Static. @@ -2802,9 +2800,9 @@ if (m_shape != null) { Vector3 distanceConvert2 = new Vector3(ipoint.X, ipoint.Y, ipoint.Z); float distance = (float) Util.GetDistanceTo(distanceConvert1, distanceConvert2); - returnresult.distance = distance; + result.distance = distance; - return returnresult; + return result; } public EntityIntersection TestIntersectionOBB(Ray iray, Quaternion parentrot, bool frontFacesOnly, bool faceCenters) @@ -3008,9 +3006,9 @@ if (m_shape != null) { //distance[i] = (normals[i].X * AmBa.X + normals[i].Y * AmBa.Y + normals[i].Z * AmBa.Z) * -1; } - EntityIntersection returnresult = new EntityIntersection(); + EntityIntersection result = new EntityIntersection(); - returnresult.distance = 1024; + result.distance = 1024; float c = 0; float a = 0; float d = 0; @@ -3030,7 +3028,7 @@ if (m_shape != null) { //{ //if (iray.Origin.Dot(normals[i]) > d) //{ - //return returnresult; + //return result; //} // else //{ @@ -3044,7 +3042,7 @@ if (m_shape != null) { //{ //if (a > fmin) //{ - //return returnresult; + //return result; //} //fmax = a; //} @@ -3056,7 +3054,7 @@ if (m_shape != null) { //{ //if (a < 0 || a < fmax) //{ - //return returnresult; + //return result; //} //fmin = a; //} @@ -3112,17 +3110,17 @@ if (m_shape != null) { // distance2 = (float)GetDistanceTo(q, iray.Origin); //} - if (distance2 < returnresult.distance) + if (distance2 < result.distance) { - returnresult.distance = distance2; - returnresult.HitTF = true; - returnresult.ipoint = q; + result.distance = distance2; + result.HitTF = true; + result.ipoint = q; //m_log.Info("[FACE]:" + i.ToString()); //m_log.Info("[POINT]: " + q.ToString()); //m_log.Info("[DIST]: " + distance2.ToString()); if (faceCenters) { - returnresult.normal = AAfacenormals[i] * AXrot; + result.normal = AAfacenormals[i] * AXrot; Vector3 scaleComponent = AAfacenormals[i]; float ScaleOffset = 0.5f; @@ -3130,20 +3128,20 @@ if (m_shape != null) { if (scaleComponent.Y != 0) ScaleOffset = AXscale.Y; if (scaleComponent.Z != 0) ScaleOffset = AXscale.Z; ScaleOffset = Math.Abs(ScaleOffset); - Vector3 offset = returnresult.normal * ScaleOffset; - returnresult.ipoint = AXpos + offset; + Vector3 offset = result.normal * ScaleOffset; + result.ipoint = AXpos + offset; ///pos = (intersectionpoint + offset); } else { - returnresult.normal = normals[i]; + result.normal = normals[i]; } - returnresult.AAfaceNormal = AAfacenormals[i]; + result.AAfaceNormal = AAfacenormals[i]; } } } - return returnresult; + return result; } /// diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs index 6415250..19f7210 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs @@ -212,6 +212,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule bool Bright { get; set; } // SetPrimParms(FULLBRIGHT) double Bloom { get; set; } // SetPrimParms(GLOW) bool Shiny { get; set; } // SetPrimParms(SHINY) - bool BumpMap { get; set; } // SetPrimParms(BUMPMAP) [DEPRECIATE IN FAVOUR OF UUID?] + bool BumpMap { get; set; } // SetPrimParms(BUMPMAP) [DEPRECATE IN FAVOUR OF UUID?] } } diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 8fdc5a7..b7030f1 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -347,18 +347,13 @@ namespace OpenSim.Region.Physics.OdePlugin #endif } - // zero out a heightmap array float array (single dimention [flattened])) + // zero out a heightmap array float array (single dimension [flattened])) if ((int)Constants.RegionSize == 256) _heightmap = new float[514*514]; else _heightmap = new float[(((int)Constants.RegionSize + 2) * ((int)Constants.RegionSize + 2))]; _watermap = new float[258 * 258]; - - - - - // Zero out the prim spaces array (we split our space into smaller spaces so // we can hit test less. } @@ -2197,7 +2192,7 @@ namespace OpenSim.Region.Physics.OdePlugin } /// - /// Called when a static prim moves. Allocates a space for the prim based on it's position + /// Called when a static prim moves. Allocates a space for the prim based on its position /// /// the pointer to the geom that moved /// the position that the geom moved to @@ -3013,7 +3008,7 @@ namespace OpenSim.Region.Physics.OdePlugin float[] returnarr = new float[262144]; float[,] resultarr = new float[m_regionWidth, m_regionHeight]; - // Filling out the array into it's multi-dimentional components + // Filling out the array into its multi-dimensional components for (int y = 0; y < m_regionHeight; y++) { for (int x = 0; x < m_regionWidth; x++) @@ -3126,7 +3121,7 @@ namespace OpenSim.Region.Physics.OdePlugin float[] returnarr = new float[262144]; float[,] resultarr = new float[m_regionWidth,m_regionHeight]; - // Filling out the array into it's multi-dimentional components + // Filling out the array into its multi-dimensional components for (int y = 0; y < m_regionHeight; y++) { for (int x = 0; x < m_regionWidth; x++) -- cgit v1.1