diff options
Diffstat (limited to 'OpenSim/Region')
218 files changed, 2673 insertions, 3462 deletions
diff --git a/OpenSim/Region/Application/OpenSimBackground.cs b/OpenSim/Region/Application/OpenSimBackground.cs index 008c6b0..15d9065 100644 --- a/OpenSim/Region/Application/OpenSimBackground.cs +++ b/OpenSim/Region/Application/OpenSimBackground.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim | |||
55 | base.Startup(); | 55 | base.Startup(); |
56 | 56 | ||
57 | m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}", | 57 | m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}", |
58 | m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : ""); | 58 | SceneManager.Scenes.Count, SceneManager.Scenes.Count > 1 ? "s" : ""); |
59 | 59 | ||
60 | WorldHasComeToAnEnd.WaitOne(); | 60 | WorldHasComeToAnEnd.WaitOne(); |
61 | WorldHasComeToAnEnd.Close(); | 61 | WorldHasComeToAnEnd.Close(); |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 9108e5d..a7ebff3 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -36,17 +36,15 @@ using log4net; | |||
36 | using Nini.Config; | 36 | using Nini.Config; |
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Communications; | ||
40 | using OpenSim.Framework.Console; | 39 | using OpenSim.Framework.Console; |
41 | using OpenSim.Framework.Servers; | 40 | using OpenSim.Framework.Servers; |
42 | using OpenSim.Framework.Servers.HttpServer; | 41 | using OpenSim.Framework.Servers.HttpServer; |
43 | using OpenSim.Framework.Monitoring; | 42 | using OpenSim.Framework.Monitoring; |
44 | using OpenSim.Region.ClientStack; | ||
45 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; | 43 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; |
46 | using OpenSim.Region.Framework; | 44 | using OpenSim.Region.Framework; |
47 | using OpenSim.Region.Framework.Interfaces; | 45 | using OpenSim.Region.Framework.Interfaces; |
48 | using OpenSim.Region.Framework.Scenes; | 46 | using OpenSim.Region.Framework.Scenes; |
49 | using OpenSim.Region.Physics.Manager; | 47 | using OpenSim.Region.PhysicsModules.SharedBase; |
50 | using OpenSim.Server.Base; | 48 | using OpenSim.Server.Base; |
51 | using OpenSim.Services.Base; | 49 | using OpenSim.Services.Base; |
52 | using OpenSim.Services.Interfaces; | 50 | using OpenSim.Services.Interfaces; |
@@ -121,19 +119,12 @@ namespace OpenSim | |||
121 | /// </value> | 119 | /// </value> |
122 | public OpenSimConfigSource ConfigSource { get; private set; } | 120 | public OpenSimConfigSource ConfigSource { get; private set; } |
123 | 121 | ||
124 | public List<IClientNetworkServer> ClientServers | ||
125 | { | ||
126 | get { return m_clientServers; } | ||
127 | } | ||
128 | |||
129 | protected EnvConfigSource m_EnvConfigSource = new EnvConfigSource(); | 122 | protected EnvConfigSource m_EnvConfigSource = new EnvConfigSource(); |
130 | 123 | ||
131 | public EnvConfigSource envConfigSource | 124 | public EnvConfigSource envConfigSource |
132 | { | 125 | { |
133 | get { return m_EnvConfigSource; } | 126 | get { return m_EnvConfigSource; } |
134 | } | 127 | } |
135 | |||
136 | protected List<IClientNetworkServer> m_clientServers = new List<IClientNetworkServer>(); | ||
137 | 128 | ||
138 | public uint HttpServerPort | 129 | public uint HttpServerPort |
139 | { | 130 | { |
@@ -371,9 +362,9 @@ namespace OpenSim | |||
371 | /// <param name="regionInfo"></param> | 362 | /// <param name="regionInfo"></param> |
372 | /// <param name="portadd_flag"></param> | 363 | /// <param name="portadd_flag"></param> |
373 | /// <returns></returns> | 364 | /// <returns></returns> |
374 | public List<IClientNetworkServer> CreateRegion(RegionInfo regionInfo, bool portadd_flag, out IScene scene) | 365 | public void CreateRegion(RegionInfo regionInfo, bool portadd_flag, out IScene scene) |
375 | { | 366 | { |
376 | return CreateRegion(regionInfo, portadd_flag, false, out scene); | 367 | CreateRegion(regionInfo, portadd_flag, false, out scene); |
377 | } | 368 | } |
378 | 369 | ||
379 | /// <summary> | 370 | /// <summary> |
@@ -381,9 +372,9 @@ namespace OpenSim | |||
381 | /// </summary> | 372 | /// </summary> |
382 | /// <param name="regionInfo"></param> | 373 | /// <param name="regionInfo"></param> |
383 | /// <returns></returns> | 374 | /// <returns></returns> |
384 | public List<IClientNetworkServer> CreateRegion(RegionInfo regionInfo, out IScene scene) | 375 | public void CreateRegion(RegionInfo regionInfo, out IScene scene) |
385 | { | 376 | { |
386 | return CreateRegion(regionInfo, false, true, out scene); | 377 | CreateRegion(regionInfo, false, true, out scene); |
387 | } | 378 | } |
388 | 379 | ||
389 | /// <summary> | 380 | /// <summary> |
@@ -393,7 +384,7 @@ namespace OpenSim | |||
393 | /// <param name="portadd_flag"></param> | 384 | /// <param name="portadd_flag"></param> |
394 | /// <param name="do_post_init"></param> | 385 | /// <param name="do_post_init"></param> |
395 | /// <returns></returns> | 386 | /// <returns></returns> |
396 | public List<IClientNetworkServer> CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init, out IScene mscene) | 387 | public void CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init, out IScene mscene) |
397 | { | 388 | { |
398 | int port = regionInfo.InternalEndPoint.Port; | 389 | int port = regionInfo.InternalEndPoint.Port; |
399 | 390 | ||
@@ -418,8 +409,7 @@ namespace OpenSim | |||
418 | Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName); | 409 | Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName); |
419 | } | 410 | } |
420 | 411 | ||
421 | List<IClientNetworkServer> clientServers; | 412 | Scene scene = SetupScene(regionInfo, proxyOffset, Config); |
422 | Scene scene = SetupScene(regionInfo, proxyOffset, Config, out clientServers); | ||
423 | 413 | ||
424 | m_log.Info("[MODULES]: Loading Region's modules (old style)"); | 414 | m_log.Info("[MODULES]: Loading Region's modules (old style)"); |
425 | 415 | ||
@@ -511,14 +501,14 @@ namespace OpenSim | |||
511 | 501 | ||
512 | SceneManager.Add(scene); | 502 | SceneManager.Add(scene); |
513 | 503 | ||
514 | if (m_autoCreateClientStack) | 504 | //if (m_autoCreateClientStack) |
515 | { | 505 | //{ |
516 | foreach (IClientNetworkServer clientserver in clientServers) | 506 | // foreach (IClientNetworkServer clientserver in clientServers) |
517 | { | 507 | // { |
518 | m_clientServers.Add(clientserver); | 508 | // m_clientServers.Add(clientserver); |
519 | clientserver.Start(); | 509 | // clientserver.Start(); |
520 | } | 510 | // } |
521 | } | 511 | //} |
522 | 512 | ||
523 | if (scene.SnmpService != null) | 513 | if (scene.SnmpService != null) |
524 | { | 514 | { |
@@ -534,7 +524,7 @@ namespace OpenSim | |||
534 | scene.SnmpService.LinkUp(scene); | 524 | scene.SnmpService.LinkUp(scene); |
535 | } | 525 | } |
536 | 526 | ||
537 | return clientServers; | 527 | //return clientServers; |
538 | } | 528 | } |
539 | 529 | ||
540 | /// <summary> | 530 | /// <summary> |
@@ -673,7 +663,7 @@ namespace OpenSim | |||
673 | 663 | ||
674 | scene.DeleteAllSceneObjects(); | 664 | scene.DeleteAllSceneObjects(); |
675 | SceneManager.CloseScene(scene); | 665 | SceneManager.CloseScene(scene); |
676 | ShutdownClientServer(scene.RegionInfo); | 666 | //ShutdownClientServer(scene.RegionInfo); |
677 | 667 | ||
678 | if (!cleanup) | 668 | if (!cleanup) |
679 | return; | 669 | return; |
@@ -734,7 +724,7 @@ namespace OpenSim | |||
734 | } | 724 | } |
735 | 725 | ||
736 | SceneManager.CloseScene(scene); | 726 | SceneManager.CloseScene(scene); |
737 | ShutdownClientServer(scene.RegionInfo); | 727 | //ShutdownClientServer(scene.RegionInfo); |
738 | } | 728 | } |
739 | 729 | ||
740 | /// <summary> | 730 | /// <summary> |
@@ -755,9 +745,9 @@ namespace OpenSim | |||
755 | /// <param name="regionInfo"></param> | 745 | /// <param name="regionInfo"></param> |
756 | /// <param name="clientServer"> </param> | 746 | /// <param name="clientServer"> </param> |
757 | /// <returns></returns> | 747 | /// <returns></returns> |
758 | protected Scene SetupScene(RegionInfo regionInfo, out List<IClientNetworkServer> clientServer) | 748 | protected Scene SetupScene(RegionInfo regionInfo) |
759 | { | 749 | { |
760 | return SetupScene(regionInfo, 0, null, out clientServer); | 750 | return SetupScene(regionInfo, 0, null); |
761 | } | 751 | } |
762 | 752 | ||
763 | /// <summary> | 753 | /// <summary> |
@@ -768,55 +758,18 @@ namespace OpenSim | |||
768 | /// <param name="configSource"></param> | 758 | /// <param name="configSource"></param> |
769 | /// <param name="clientServer"> </param> | 759 | /// <param name="clientServer"> </param> |
770 | /// <returns></returns> | 760 | /// <returns></returns> |
771 | protected Scene SetupScene( | 761 | protected Scene SetupScene(RegionInfo regionInfo, int proxyOffset, IConfigSource configSource) |
772 | RegionInfo regionInfo, int proxyOffset, IConfigSource configSource, out List<IClientNetworkServer> clientServer) | ||
773 | { | 762 | { |
774 | List<IClientNetworkServer> clientNetworkServers = null; | 763 | //List<IClientNetworkServer> clientNetworkServers = null; |
775 | 764 | ||
776 | AgentCircuitManager circuitManager = new AgentCircuitManager(); | 765 | AgentCircuitManager circuitManager = new AgentCircuitManager(); |
777 | IPAddress listenIP = regionInfo.InternalEndPoint.Address; | ||
778 | //if (!IPAddress.TryParse(regionInfo.InternalEndPoint, out listenIP)) | ||
779 | // listenIP = IPAddress.Parse("0.0.0.0"); | ||
780 | |||
781 | uint port = (uint) regionInfo.InternalEndPoint.Port; | ||
782 | |||
783 | if (m_autoCreateClientStack) | ||
784 | { | ||
785 | clientNetworkServers = m_clientStackManager.CreateServers( | ||
786 | listenIP, ref port, proxyOffset, regionInfo.m_allow_alternate_ports, configSource, | ||
787 | circuitManager); | ||
788 | } | ||
789 | else | ||
790 | { | ||
791 | clientServer = null; | ||
792 | } | ||
793 | |||
794 | regionInfo.InternalEndPoint.Port = (int) port; | ||
795 | |||
796 | Scene scene = CreateScene(regionInfo, m_simulationDataService, m_estateDataService, circuitManager); | 766 | Scene scene = CreateScene(regionInfo, m_simulationDataService, m_estateDataService, circuitManager); |
797 | 767 | ||
798 | if (m_autoCreateClientStack) | ||
799 | { | ||
800 | foreach (IClientNetworkServer clientnetserver in clientNetworkServers) | ||
801 | { | ||
802 | clientnetserver.AddScene(scene); | ||
803 | } | ||
804 | } | ||
805 | clientServer = clientNetworkServers; | ||
806 | scene.LoadWorldMap(); | 768 | scene.LoadWorldMap(); |
807 | 769 | ||
808 | scene.PhysicsScene.RequestAssetMethod = scene.PhysicsRequestAsset; | ||
809 | scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised()); | ||
810 | scene.PhysicsScene.SetWaterLevel((float) regionInfo.RegionSettings.WaterHeight); | ||
811 | |||
812 | return scene; | 770 | return scene; |
813 | } | 771 | } |
814 | 772 | ||
815 | protected override ClientStackManager CreateClientStackManager() | ||
816 | { | ||
817 | return new ClientStackManager(m_configSettings.ClientstackDll); | ||
818 | } | ||
819 | |||
820 | protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, | 773 | protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, |
821 | IEstateDataService estateDataService, AgentCircuitManager circuitManager) | 774 | IEstateDataService estateDataService, AgentCircuitManager circuitManager) |
822 | { | 775 | { |
@@ -825,42 +778,18 @@ namespace OpenSim | |||
825 | SceneCommunicationService sceneGridService = new SceneCommunicationService(); | 778 | SceneCommunicationService sceneGridService = new SceneCommunicationService(); |
826 | 779 | ||
827 | return new Scene( | 780 | return new Scene( |
828 | regionInfo, circuitManager, physicsScene, sceneGridService, | 781 | regionInfo, circuitManager, |
829 | simDataService, estateDataService, | 782 | simDataService, estateDataService, |
830 | Config, m_version); | 783 | Config, m_version); |
831 | } | 784 | } |
832 | 785 | ||
833 | protected void ShutdownClientServer(RegionInfo whichRegion) | ||
834 | { | ||
835 | // Close and remove the clientserver for a region | ||
836 | bool foundClientServer = false; | ||
837 | int clientServerElement = 0; | ||
838 | Location location = new Location(whichRegion.RegionHandle); | ||
839 | |||
840 | for (int i = 0; i < m_clientServers.Count; i++) | ||
841 | { | ||
842 | if (m_clientServers[i].HandlesRegion(location)) | ||
843 | { | ||
844 | clientServerElement = i; | ||
845 | foundClientServer = true; | ||
846 | break; | ||
847 | } | ||
848 | } | ||
849 | |||
850 | if (foundClientServer) | ||
851 | { | ||
852 | m_clientServers[clientServerElement].Stop(); | ||
853 | m_clientServers.RemoveAt(clientServerElement); | ||
854 | } | ||
855 | } | ||
856 | |||
857 | protected virtual void HandleRestartRegion(RegionInfo whichRegion) | 786 | protected virtual void HandleRestartRegion(RegionInfo whichRegion) |
858 | { | 787 | { |
859 | m_log.InfoFormat( | 788 | m_log.InfoFormat( |
860 | "[OPENSIM]: Got restart signal from SceneManager for region {0} ({1},{2})", | 789 | "[OPENSIM]: Got restart signal from SceneManager for region {0} ({1},{2})", |
861 | whichRegion.RegionName, whichRegion.RegionLocX, whichRegion.RegionLocY); | 790 | whichRegion.RegionName, whichRegion.RegionLocX, whichRegion.RegionLocY); |
862 | 791 | ||
863 | ShutdownClientServer(whichRegion); | 792 | //ShutdownClientServer(whichRegion); |
864 | IScene scene; | 793 | IScene scene; |
865 | CreateRegion(whichRegion, true, out scene); | 794 | CreateRegion(whichRegion, true, out scene); |
866 | scene.Start(); | 795 | scene.Start(); |
@@ -868,12 +797,6 @@ namespace OpenSim | |||
868 | 797 | ||
869 | # region Setup methods | 798 | # region Setup methods |
870 | 799 | ||
871 | protected override PhysicsScene GetPhysicsScene(string osSceneIdentifier, Vector3 regionExtent) | ||
872 | { | ||
873 | return GetPhysicsScene( | ||
874 | m_configSettings.PhysicsEngine, m_configSettings.MeshEngineName, Config, osSceneIdentifier, regionExtent); | ||
875 | } | ||
876 | |||
877 | /// <summary> | 800 | /// <summary> |
878 | /// Handler to supply the current status of this sim | 801 | /// Handler to supply the current status of this sim |
879 | /// </summary> | 802 | /// </summary> |
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/Application/RegionApplicationBase.cs index 332bff9..ba92fd6 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/Application/RegionApplicationBase.cs | |||
@@ -32,16 +32,15 @@ using log4net; | |||
32 | using Nini.Config; | 32 | using Nini.Config; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | ||
36 | using OpenSim.Framework.Servers; | 35 | using OpenSim.Framework.Servers; |
37 | using OpenSim.Framework.Servers.HttpServer; | 36 | using OpenSim.Framework.Servers.HttpServer; |
38 | using OpenSim.Region.Framework; | 37 | using OpenSim.Region.Framework; |
39 | using OpenSim.Region.Framework.Interfaces; | 38 | using OpenSim.Region.Framework.Interfaces; |
40 | using OpenSim.Region.Framework.Scenes; | 39 | using OpenSim.Region.Framework.Scenes; |
41 | using OpenSim.Region.Physics.Manager; | 40 | using OpenSim.Region.PhysicsModules.SharedBase; |
42 | using OpenSim.Services.Interfaces; | 41 | using OpenSim.Services.Interfaces; |
43 | 42 | ||
44 | namespace OpenSim.Region.ClientStack | 43 | namespace OpenSim |
45 | { | 44 | { |
46 | public abstract class RegionApplicationBase : BaseOpenSimServer | 45 | public abstract class RegionApplicationBase : BaseOpenSimServer |
47 | { | 46 | { |
@@ -53,7 +52,6 @@ namespace OpenSim.Region.ClientStack | |||
53 | protected uint m_httpServerPort; | 52 | protected uint m_httpServerPort; |
54 | protected ISimulationDataService m_simulationDataService; | 53 | protected ISimulationDataService m_simulationDataService; |
55 | protected IEstateDataService m_estateDataService; | 54 | protected IEstateDataService m_estateDataService; |
56 | protected ClientStackManager m_clientStackManager; | ||
57 | 55 | ||
58 | public SceneManager SceneManager { get; protected set; } | 56 | public SceneManager SceneManager { get; protected set; } |
59 | public NetworkServersInfo NetServersInfo { get { return m_networkServersInfo; } } | 57 | public NetworkServersInfo NetServersInfo { get { return m_networkServersInfo; } } |
@@ -62,23 +60,11 @@ namespace OpenSim.Region.ClientStack | |||
62 | 60 | ||
63 | protected abstract void Initialize(); | 61 | protected abstract void Initialize(); |
64 | 62 | ||
65 | /// <summary> | ||
66 | /// Get a new physics scene. | ||
67 | /// </summary> | ||
68 | /// | ||
69 | /// <param name="osSceneIdentifier"> | ||
70 | /// The name of the OpenSim scene this physics scene is serving. This will be used in log messages. | ||
71 | /// </param> | ||
72 | /// <returns></returns> | ||
73 | protected abstract PhysicsScene GetPhysicsScene(string osSceneIdentifier, Vector3 regionExtent); | ||
74 | |||
75 | protected abstract ClientStackManager CreateClientStackManager(); | ||
76 | protected abstract Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, IEstateDataService estateDataService, AgentCircuitManager circuitManager); | 63 | protected abstract Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, IEstateDataService estateDataService, AgentCircuitManager circuitManager); |
77 | 64 | ||
78 | protected override void StartupSpecific() | 65 | protected override void StartupSpecific() |
79 | { | 66 | { |
80 | SceneManager = SceneManager.Instance; | 67 | SceneManager = SceneManager.Instance; |
81 | m_clientStackManager = CreateClientStackManager(); | ||
82 | 68 | ||
83 | Initialize(); | 69 | Initialize(); |
84 | 70 | ||
@@ -125,23 +111,5 @@ namespace OpenSim.Region.ClientStack | |||
125 | base.StartupSpecific(); | 111 | base.StartupSpecific(); |
126 | } | 112 | } |
127 | 113 | ||
128 | /// <summary> | ||
129 | /// Get a new physics scene. | ||
130 | /// </summary> | ||
131 | /// <param name="engine">The name of the physics engine to use</param> | ||
132 | /// <param name="meshEngine">The name of the mesh engine to use</param> | ||
133 | /// <param name="config">The configuration data to pass to the physics and mesh engines</param> | ||
134 | /// <param name="osSceneIdentifier"> | ||
135 | /// The name of the OpenSim scene this physics scene is serving. This will be used in log messages. | ||
136 | /// </param> | ||
137 | /// <returns></returns> | ||
138 | protected PhysicsScene GetPhysicsScene( | ||
139 | string engine, string meshEngine, IConfigSource config, string osSceneIdentifier, Vector3 regionExtent) | ||
140 | { | ||
141 | PhysicsPluginManager physicsPluginManager; | ||
142 | physicsPluginManager = new PhysicsPluginManager(); | ||
143 | physicsPluginManager.LoadPluginsFromAssemblies("Physics"); | ||
144 | return physicsPluginManager.GetPhysicsScene(engine, meshEngine, config, osSceneIdentifier, regionExtent); | ||
145 | } | ||
146 | } | 114 | } |
147 | } | 115 | } |
diff --git a/OpenSim/Region/ClientStack/ClientStackManager.cs b/OpenSim/Region/ClientStack/ClientStackManager.cs deleted file mode 100644 index 3ec968f..0000000 --- a/OpenSim/Region/ClientStack/ClientStackManager.cs +++ /dev/null | |||
@@ -1,147 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Net; | ||
31 | using System.Reflection; | ||
32 | using log4net; | ||
33 | using Nini.Config; | ||
34 | using OpenSim.Framework; | ||
35 | |||
36 | namespace OpenSim.Region.ClientStack | ||
37 | { | ||
38 | public class ClientStackManager | ||
39 | { | ||
40 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
41 | |||
42 | private List<Type> plugin = new List<Type>(); | ||
43 | private List<Assembly> pluginAssembly = new List<Assembly>(); | ||
44 | |||
45 | public ClientStackManager(string pDllName) | ||
46 | { | ||
47 | List<string> clientstacks = new List<string>(); | ||
48 | if (pDllName.Contains(",")) | ||
49 | { | ||
50 | clientstacks = new List<string>(pDllName.Split(',')); | ||
51 | } | ||
52 | else | ||
53 | { | ||
54 | clientstacks.Add(pDllName); | ||
55 | } | ||
56 | foreach (string dllName in clientstacks) | ||
57 | { | ||
58 | m_log.Info("[CLIENTSTACK]: Attempting to load " + dllName); | ||
59 | |||
60 | try | ||
61 | { | ||
62 | //plugin = null; | ||
63 | Assembly itemAssembly = Assembly.LoadFrom(dllName); | ||
64 | pluginAssembly.Add(itemAssembly); | ||
65 | |||
66 | foreach (Type pluginType in itemAssembly.GetTypes()) | ||
67 | { | ||
68 | if (pluginType.IsPublic) | ||
69 | { | ||
70 | Type typeInterface = pluginType.GetInterface("IClientNetworkServer"); | ||
71 | |||
72 | if (typeInterface != null) | ||
73 | { | ||
74 | m_log.Info("[CLIENTSTACK]: Added IClientNetworkServer Interface"); | ||
75 | plugin.Add(pluginType); | ||
76 | break; | ||
77 | } | ||
78 | } | ||
79 | } | ||
80 | } | ||
81 | catch (ReflectionTypeLoadException e) | ||
82 | { | ||
83 | foreach (Exception e2 in e.LoaderExceptions) | ||
84 | { | ||
85 | m_log.Error(e2.ToString()); | ||
86 | } | ||
87 | throw e; | ||
88 | } | ||
89 | } | ||
90 | } | ||
91 | |||
92 | /// <summary> | ||
93 | /// Create a server that can set up sessions for virtual world client <-> server communications | ||
94 | /// </summary> | ||
95 | /// <param name="_listenIP"></param> | ||
96 | /// <param name="port"></param> | ||
97 | /// <param name="proxyPortOffset"></param> | ||
98 | /// <param name="allow_alternate_port"></param> | ||
99 | /// <param name="assetCache"></param> | ||
100 | /// <param name="authenticateClass"></param> | ||
101 | /// <returns></returns> | ||
102 | public List<IClientNetworkServer> CreateServers( | ||
103 | IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, | ||
104 | AgentCircuitManager authenticateClass) | ||
105 | { | ||
106 | return CreateServers( | ||
107 | _listenIP, ref port, proxyPortOffset, allow_alternate_port, null, authenticateClass); | ||
108 | } | ||
109 | |||
110 | /// <summary> | ||
111 | /// Create a server that can set up sessions for virtual world client <-> server communications | ||
112 | /// </summary> | ||
113 | /// <param name="_listenIP"></param> | ||
114 | /// <param name="port"></param> | ||
115 | /// <param name="proxyPortOffset"></param> | ||
116 | /// <param name="allow_alternate_port"></param> | ||
117 | /// <param name="configSource"> | ||
118 | /// Can be null, in which case default values are used | ||
119 | /// </param> | ||
120 | /// <param name="assetCache"></param> | ||
121 | /// <param name="authenticateClass"></param> | ||
122 | /// <returns></returns> | ||
123 | public List<IClientNetworkServer> CreateServers( | ||
124 | IPAddress _listenIP, ref uint port, int proxyPortOffset, bool allow_alternate_port, IConfigSource configSource, | ||
125 | AgentCircuitManager authenticateClass) | ||
126 | { | ||
127 | List<IClientNetworkServer> servers = new List<IClientNetworkServer>(); | ||
128 | if (plugin != null) | ||
129 | { | ||
130 | for (int i = 0; i < plugin.Count; i++) | ||
131 | { | ||
132 | IClientNetworkServer server = | ||
133 | (IClientNetworkServer) Activator.CreateInstance(pluginAssembly[i].GetType(plugin[i].ToString())); | ||
134 | |||
135 | server.Initialise( | ||
136 | _listenIP, ref port, proxyPortOffset, allow_alternate_port, | ||
137 | configSource, authenticateClass); | ||
138 | servers.Add(server); | ||
139 | } | ||
140 | return servers; | ||
141 | } | ||
142 | |||
143 | m_log.Error("[CLIENTSTACK]: Couldn't initialize a new server"); | ||
144 | return null; | ||
145 | } | ||
146 | } | ||
147 | } | ||
diff --git a/OpenSim/Region/ClientStack/IClientNetworkServer.cs b/OpenSim/Region/ClientStack/IClientNetworkServer.cs deleted file mode 100644 index bb7e6d0..0000000 --- a/OpenSim/Region/ClientStack/IClientNetworkServer.cs +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System.Net; | ||
29 | using System.Net.Sockets; | ||
30 | using Nini.Config; | ||
31 | using OpenSim.Framework; | ||
32 | |||
33 | namespace OpenSim.Region.ClientStack | ||
34 | { | ||
35 | public interface IClientNetworkServer | ||
36 | { | ||
37 | void Initialise( | ||
38 | IPAddress _listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, | ||
39 | AgentCircuitManager authenticateClass); | ||
40 | |||
41 | bool HandlesRegion(Location x); | ||
42 | |||
43 | /// <summary> | ||
44 | /// Add the given scene to be handled by this IClientNetworkServer. | ||
45 | /// </summary> | ||
46 | /// <param name='scene'></param> | ||
47 | void AddScene(IScene scene); | ||
48 | |||
49 | /// <summary> | ||
50 | /// Start sending and receiving data. | ||
51 | /// </summary> | ||
52 | void Start(); | ||
53 | |||
54 | /// <summary> | ||
55 | /// Stop sending and receiving data. | ||
56 | /// </summary> | ||
57 | void Stop(); | ||
58 | } | ||
59 | } | ||
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index cb05e8f..b5bdd46 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -40,8 +40,9 @@ using OpenSim.Framework; | |||
40 | using OpenSim.Framework.Console; | 40 | using OpenSim.Framework.Console; |
41 | using OpenSim.Framework.Monitoring; | 41 | using OpenSim.Framework.Monitoring; |
42 | using OpenSim.Region.Framework.Scenes; | 42 | using OpenSim.Region.Framework.Scenes; |
43 | using OpenSim.Region.Framework.Interfaces; | ||
43 | using OpenMetaverse; | 44 | using OpenMetaverse; |
44 | 45 | using Mono.Addins; | |
45 | using TokenBucket = OpenSim.Region.ClientStack.LindenUDP.TokenBucket; | 46 | using TokenBucket = OpenSim.Region.ClientStack.LindenUDP.TokenBucket; |
46 | 47 | ||
47 | namespace OpenSim.Region.ClientStack.LindenUDP | 48 | namespace OpenSim.Region.ClientStack.LindenUDP |
@@ -49,14 +50,55 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
49 | /// <summary> | 50 | /// <summary> |
50 | /// A shim around LLUDPServer that implements the IClientNetworkServer interface | 51 | /// A shim around LLUDPServer that implements the IClientNetworkServer interface |
51 | /// </summary> | 52 | /// </summary> |
52 | public sealed class LLUDPServerShim : IClientNetworkServer | 53 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LLUDPServerShim")] |
54 | public sealed class LLUDPServerShim : INonSharedRegionModule | ||
53 | { | 55 | { |
56 | private bool m_Enabled = true; | ||
57 | private IConfigSource m_Config; | ||
54 | LLUDPServer m_udpServer; | 58 | LLUDPServer m_udpServer; |
55 | 59 | ||
56 | public LLUDPServerShim() | 60 | #region INonSharedRegionModule |
61 | public string Name | ||
62 | { | ||
63 | get { return "LLUDPServerShim"; } | ||
64 | } | ||
65 | |||
66 | public Type ReplaceableInterface | ||
67 | { | ||
68 | get { return null; } | ||
69 | } | ||
70 | |||
71 | public void Initialise(IConfigSource source) | ||
72 | { | ||
73 | m_Config = source; | ||
74 | } | ||
75 | |||
76 | public void Close() | ||
77 | { | ||
78 | } | ||
79 | |||
80 | public void AddRegion(Scene scene) | ||
57 | { | 81 | { |
82 | uint port = (uint)scene.RegionInfo.InternalEndPoint.Port; | ||
83 | |||
84 | IPAddress listenIP = scene.RegionInfo.InternalEndPoint.Address; | ||
85 | Initialise(listenIP, ref port, scene.RegionInfo.ProxyOffset, scene.RegionInfo.m_allow_alternate_ports, m_Config, scene.AuthenticateHandler); | ||
86 | scene.RegionInfo.InternalEndPoint.Port = (int)port; | ||
87 | |||
88 | AddScene(scene); | ||
58 | } | 89 | } |
59 | 90 | ||
91 | public void RemoveRegion(Scene scene) | ||
92 | { | ||
93 | Stop(); | ||
94 | } | ||
95 | |||
96 | public void RegionLoaded(Scene scene) | ||
97 | { | ||
98 | Start(); | ||
99 | } | ||
100 | #endregion | ||
101 | |||
60 | public void Initialise(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) | 102 | public void Initialise(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) |
61 | { | 103 | { |
62 | m_udpServer = new LLUDPServer(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager); | 104 | m_udpServer = new LLUDPServer(listenIP, ref port, proxyPortOffsetParm, allow_alternate_port, configSource, circuitManager); |
@@ -200,6 +242,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
200 | { | 242 | { |
201 | m_udpServer.Stop(); | 243 | m_udpServer.Stop(); |
202 | } | 244 | } |
245 | |||
203 | } | 246 | } |
204 | 247 | ||
205 | /// <summary> | 248 | /// <summary> |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Properties/AssemblyInfo.cs b/OpenSim/Region/ClientStack/Linden/UDP/Properties/AssemblyInfo.cs index 8795c0c..a1ff69e 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/Properties/AssemblyInfo.cs | |||
@@ -1,6 +1,7 @@ | |||
1 | using System.Reflection; | 1 | using System.Reflection; |
2 | using System.Runtime.CompilerServices; | 2 | using System.Runtime.CompilerServices; |
3 | using System.Runtime.InteropServices; | 3 | using System.Runtime.InteropServices; |
4 | using Mono.Addins; | ||
4 | 5 | ||
5 | // General Information about an assembly is controlled through the following | 6 | // General Information about an assembly is controlled through the following |
6 | // set of attributes. Change these attribute values to modify the information | 7 | // set of attributes. Change these attribute values to modify the information |
@@ -31,3 +32,5 @@ using System.Runtime.InteropServices; | |||
31 | // | 32 | // |
32 | [assembly: AssemblyVersion("0.8.2.*")] | 33 | [assembly: AssemblyVersion("0.8.2.*")] |
33 | 34 | ||
35 | [assembly: Addin("LindenUDP", OpenSim.VersionInfo.VersionNumber)] | ||
36 | [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index b632774..7d9609f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | |||
@@ -37,7 +37,6 @@ using Nini.Config; | |||
37 | using NUnit.Framework; | 37 | using NUnit.Framework; |
38 | using OpenMetaverse; | 38 | using OpenMetaverse; |
39 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
40 | using OpenSim.Framework.Communications; | ||
41 | using OpenSim.Framework.Servers; | 40 | using OpenSim.Framework.Servers; |
42 | using OpenSim.Framework.Servers.HttpServer; | 41 | using OpenSim.Framework.Servers.HttpServer; |
43 | using OpenSim.Region.CoreModules.Avatar.Attachments; | 42 | using OpenSim.Region.CoreModules.Avatar.Attachments; |
diff --git a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs index b8a1dba..7bec18f 100644 --- a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs | |||
@@ -38,7 +38,6 @@ using System.Reflection; | |||
38 | using log4net; | 38 | using log4net; |
39 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
40 | using OpenSim.Framework.ServiceAuth; | 40 | using OpenSim.Framework.ServiceAuth; |
41 | using OpenSim.Framework.Communications; | ||
42 | using OpenSim.Region.Framework.Interfaces; | 41 | using OpenSim.Region.Framework.Interfaces; |
43 | using OpenSim.Region.Framework.Scenes; | 42 | using OpenSim.Region.Framework.Scenes; |
44 | using OpenSim.Services.Interfaces; | 43 | using OpenSim.Services.Interfaces; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 7ab568e..08e7dd2 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -38,7 +38,6 @@ using OpenMetaverse; | |||
38 | using Mono.Addins; | 38 | using Mono.Addins; |
39 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
40 | using OpenSim.Framework.Servers.HttpServer; | 40 | using OpenSim.Framework.Servers.HttpServer; |
41 | using OpenSim.Framework.Communications; | ||
42 | using OpenSim.Framework.Servers; | 41 | using OpenSim.Framework.Servers; |
43 | using OpenSim.Region.Framework.Interfaces; | 42 | using OpenSim.Region.Framework.Interfaces; |
44 | using OpenSim.Region.Framework.Scenes; | 43 | using OpenSim.Region.Framework.Scenes; |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs index 7ce2813..315d372 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs | |||
@@ -32,7 +32,6 @@ using Nini.Config; | |||
32 | using Mono.Addins; | 32 | using Mono.Addins; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | ||
36 | using OpenSim.Framework.Servers; | 35 | using OpenSim.Framework.Servers; |
37 | using OpenSim.Framework.Client; | 36 | using OpenSim.Framework.Client; |
38 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 1650097..ac89f52 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs | |||
@@ -32,7 +32,6 @@ using Mono.Addins; | |||
32 | using Nini.Config; | 32 | using Nini.Config; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | ||
36 | using OpenSim.Framework.Servers; | 35 | using OpenSim.Framework.Servers; |
37 | using OpenSim.Framework.Client; | 36 | using OpenSim.Framework.Client; |
38 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index 5295ba3..8d11d20 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | |||
@@ -34,7 +34,6 @@ using NDesk.Options; | |||
34 | using Nini.Config; | 34 | using Nini.Config; |
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Communications; | ||
38 | using OpenSim.Framework.Console; | 37 | using OpenSim.Framework.Console; |
39 | using OpenSim.Region.Framework.Interfaces; | 38 | using OpenSim.Region.Framework.Interfaces; |
40 | using OpenSim.Region.Framework.Scenes; | 39 | using OpenSim.Region.Framework.Scenes; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs index 84f9f3f..c2e645f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadPathTests.cs | |||
@@ -36,7 +36,6 @@ using OpenSim.Data; | |||
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Serialization; | 37 | using OpenSim.Framework.Serialization; |
38 | using OpenSim.Framework.Serialization.External; | 38 | using OpenSim.Framework.Serialization.External; |
39 | using OpenSim.Framework.Communications; | ||
40 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; | 39 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; |
41 | using OpenSim.Region.CoreModules.World.Serialiser; | 40 | using OpenSim.Region.CoreModules.World.Serialiser; |
42 | using OpenSim.Region.Framework.Scenes; | 41 | using OpenSim.Region.Framework.Scenes; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs index d5f3a22..57b4f80 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveLoadTests.cs | |||
@@ -36,7 +36,6 @@ using OpenSim.Data; | |||
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Serialization; | 37 | using OpenSim.Framework.Serialization; |
38 | using OpenSim.Framework.Serialization.External; | 38 | using OpenSim.Framework.Serialization.External; |
39 | using OpenSim.Framework.Communications; | ||
40 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; | 39 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; |
41 | using OpenSim.Region.CoreModules.World.Serialiser; | 40 | using OpenSim.Region.CoreModules.World.Serialiser; |
42 | using OpenSim.Region.Framework.Scenes; | 41 | using OpenSim.Region.Framework.Scenes; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs index b614c18..7265405 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveSaveTests.cs | |||
@@ -36,7 +36,6 @@ using OpenSim.Data; | |||
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Serialization; | 37 | using OpenSim.Framework.Serialization; |
38 | using OpenSim.Framework.Serialization.External; | 38 | using OpenSim.Framework.Serialization.External; |
39 | using OpenSim.Framework.Communications; | ||
40 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; | 39 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; |
41 | using OpenSim.Region.CoreModules.World.Serialiser; | 40 | using OpenSim.Region.CoreModules.World.Serialiser; |
42 | using OpenSim.Region.Framework.Scenes; | 41 | using OpenSim.Region.Framework.Scenes; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs index 4b015d7..519c697 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs | |||
@@ -36,7 +36,6 @@ using OpenSim.Data; | |||
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Serialization; | 37 | using OpenSim.Framework.Serialization; |
38 | using OpenSim.Framework.Serialization.External; | 38 | using OpenSim.Framework.Serialization.External; |
39 | using OpenSim.Framework.Communications; | ||
40 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; | 39 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; |
41 | using OpenSim.Region.CoreModules.World.Serialiser; | 40 | using OpenSim.Region.CoreModules.World.Serialiser; |
42 | using OpenSim.Region.Framework.Scenes; | 41 | using OpenSim.Region.Framework.Scenes; |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 9a57599..3cbde62 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -36,7 +36,7 @@ using OpenSim.Framework.Client; | |||
36 | using OpenSim.Framework.Monitoring; | 36 | using OpenSim.Framework.Monitoring; |
37 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
39 | using OpenSim.Region.Physics.Manager; | 39 | using OpenSim.Region.PhysicsModules.SharedBase; |
40 | using OpenSim.Services.Interfaces; | 40 | using OpenSim.Services.Interfaces; |
41 | 41 | ||
42 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 42 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs index 54ec751..e3c6c0d 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs | |||
@@ -38,7 +38,7 @@ using OpenSim.Framework.Capabilities; | |||
38 | using OpenSim.Framework.Client; | 38 | using OpenSim.Framework.Client; |
39 | using OpenSim.Region.Framework.Interfaces; | 39 | using OpenSim.Region.Framework.Interfaces; |
40 | using OpenSim.Region.Framework.Scenes; | 40 | using OpenSim.Region.Framework.Scenes; |
41 | using OpenSim.Region.Physics.Manager; | 41 | using OpenSim.Region.PhysicsModules.SharedBase; |
42 | using OpenSim.Services.Interfaces; | 42 | using OpenSim.Services.Interfaces; |
43 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 43 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
44 | 44 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs index c64ab44..1d91165 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs | |||
@@ -37,7 +37,6 @@ using OpenSim.Data; | |||
37 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Serialization; | 38 | using OpenSim.Framework.Serialization; |
39 | using OpenSim.Framework.Serialization.External; | 39 | using OpenSim.Framework.Serialization.External; |
40 | using OpenSim.Framework.Communications; | ||
41 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; | 40 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; |
42 | using OpenSim.Region.CoreModules.Framework.InventoryAccess; | 41 | using OpenSim.Region.CoreModules.Framework.InventoryAccess; |
43 | using OpenSim.Region.Framework.Scenes; | 42 | using OpenSim.Region.Framework.Scenes; |
diff --git a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs index d10c9b4..862f0b7 100644 --- a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs | |||
@@ -30,7 +30,6 @@ using System.IO; | |||
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | 31 | ||
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Framework.Communications; | ||
34 | 33 | ||
35 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; | 34 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; |
36 | using OpenSim.Region.Framework; | 35 | using OpenSim.Region.Framework; |
@@ -159,7 +158,7 @@ namespace OpenSim.Region.CoreModules.Framework.Library | |||
159 | } | 158 | } |
160 | 159 | ||
161 | RegionInfo regInfo = new RegionInfo(); | 160 | RegionInfo regInfo = new RegionInfo(); |
162 | Scene m_MockScene = new Scene(regInfo, null); | 161 | Scene m_MockScene = new Scene(regInfo); |
163 | LocalInventoryService invService = new LocalInventoryService(lib); | 162 | LocalInventoryService invService = new LocalInventoryService(lib); |
164 | m_MockScene.RegisterModuleInterface<IInventoryService>(invService); | 163 | m_MockScene.RegisterModuleInterface<IInventoryService>(invService); |
165 | m_MockScene.RegisterModuleInterface<IAssetService>(m_Scene.AssetService); | 164 | m_MockScene.RegisterModuleInterface<IAssetService>(m_Scene.AssetService); |
diff --git a/OpenSim/Region/CoreModules/Framework/Statistics/Logging/LogWriter.cs b/OpenSim/Region/CoreModules/Framework/Statistics/Logging/LogWriter.cs deleted file mode 100755 index a176958..0000000 --- a/OpenSim/Region/CoreModules/Framework/Statistics/Logging/LogWriter.cs +++ /dev/null | |||
@@ -1,181 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.IO; | ||
30 | using System.Text; | ||
31 | using log4net; | ||
32 | |||
33 | namespace OpenSim.Region.CoreModules.Framework.Statistics.Logging | ||
34 | { | ||
35 | /// <summary> | ||
36 | /// Class for writing a high performance, high volume log file. | ||
37 | /// Sometimes, to debug, one has a high volume logging to do and the regular | ||
38 | /// log file output is not appropriate. | ||
39 | /// Create a new instance with the parameters needed and | ||
40 | /// call Write() to output a line. Call Close() when finished. | ||
41 | /// If created with no parameters, it will not log anything. | ||
42 | /// </summary> | ||
43 | public class LogWriter : IDisposable | ||
44 | { | ||
45 | public bool Enabled { get; private set; } | ||
46 | |||
47 | private string m_logDirectory = "."; | ||
48 | private int m_logMaxFileTimeMin = 5; // 5 minutes | ||
49 | public String LogFileHeader { get; set; } | ||
50 | |||
51 | private StreamWriter m_logFile = null; | ||
52 | private TimeSpan m_logFileLife; | ||
53 | private DateTime m_logFileEndTime; | ||
54 | private Object m_logFileWriteLock = new Object(); | ||
55 | private bool m_flushWrite; | ||
56 | |||
57 | // set externally when debugging. If let 'null', this does not write any error messages. | ||
58 | public ILog ErrorLogger = null; | ||
59 | private string LogHeader = "[LOG WRITER]"; | ||
60 | |||
61 | /// <summary> | ||
62 | /// Create a log writer that will not write anything. Good for when not enabled | ||
63 | /// but the write statements are still in the code. | ||
64 | /// </summary> | ||
65 | public LogWriter() | ||
66 | { | ||
67 | Enabled = false; | ||
68 | m_logFile = null; | ||
69 | } | ||
70 | |||
71 | /// <summary> | ||
72 | /// Create a log writer instance. | ||
73 | /// </summary> | ||
74 | /// <param name="dir">The directory to create the log file in. May be 'null' for default.</param> | ||
75 | /// <param name="headr">The characters that begin the log file name. May be 'null' for default.</param> | ||
76 | /// <param name="maxFileTime">Maximum age of a log file in minutes. If zero, will set default.</param> | ||
77 | /// <param name="flushWrite">Whether to do a flush after every log write. Best left off but | ||
78 | /// if one is looking for a crash, this is a good thing to turn on.</param> | ||
79 | public LogWriter(string dir, string headr, int maxFileTime, bool flushWrite) | ||
80 | { | ||
81 | m_logDirectory = dir == null ? "." : dir; | ||
82 | |||
83 | LogFileHeader = headr == null ? "log-" : headr; | ||
84 | |||
85 | m_logMaxFileTimeMin = maxFileTime; | ||
86 | if (m_logMaxFileTimeMin < 1) | ||
87 | m_logMaxFileTimeMin = 5; | ||
88 | |||
89 | m_logFileLife = new TimeSpan(0, m_logMaxFileTimeMin, 0); | ||
90 | m_logFileEndTime = DateTime.Now + m_logFileLife; | ||
91 | |||
92 | m_flushWrite = flushWrite; | ||
93 | |||
94 | Enabled = true; | ||
95 | } | ||
96 | // Constructor that assumes flushWrite is off. | ||
97 | public LogWriter(string dir, string headr, int maxFileTime) : this(dir, headr, maxFileTime, false) | ||
98 | { | ||
99 | } | ||
100 | |||
101 | public void Dispose() | ||
102 | { | ||
103 | this.Close(); | ||
104 | } | ||
105 | |||
106 | public void Close() | ||
107 | { | ||
108 | Enabled = false; | ||
109 | if (m_logFile != null) | ||
110 | { | ||
111 | m_logFile.Close(); | ||
112 | m_logFile.Dispose(); | ||
113 | m_logFile = null; | ||
114 | } | ||
115 | } | ||
116 | |||
117 | public void Write(string line, params object[] args) | ||
118 | { | ||
119 | if (!Enabled) return; | ||
120 | Write(String.Format(line, args)); | ||
121 | } | ||
122 | |||
123 | public void Flush() | ||
124 | { | ||
125 | if (!Enabled) return; | ||
126 | if (m_logFile != null) | ||
127 | { | ||
128 | m_logFile.Flush(); | ||
129 | } | ||
130 | } | ||
131 | |||
132 | public void Write(string line) | ||
133 | { | ||
134 | if (!Enabled) return; | ||
135 | try | ||
136 | { | ||
137 | lock (m_logFileWriteLock) | ||
138 | { | ||
139 | DateTime now = DateTime.UtcNow; | ||
140 | if (m_logFile == null || now > m_logFileEndTime) | ||
141 | { | ||
142 | if (m_logFile != null) | ||
143 | { | ||
144 | m_logFile.Close(); | ||
145 | m_logFile.Dispose(); | ||
146 | m_logFile = null; | ||
147 | } | ||
148 | |||
149 | // First log file or time has expired, start writing to a new log file | ||
150 | m_logFileEndTime = now + m_logFileLife; | ||
151 | string path = (m_logDirectory.Length > 0 ? m_logDirectory | ||
152 | + System.IO.Path.DirectorySeparatorChar.ToString() : "") | ||
153 | + String.Format("{0}{1}.log", LogFileHeader, now.ToString("yyyyMMddHHmmss")); | ||
154 | m_logFile = new StreamWriter(File.Open(path, FileMode.Append, FileAccess.Write, FileShare.ReadWrite)); | ||
155 | } | ||
156 | if (m_logFile != null) | ||
157 | { | ||
158 | StringBuilder buff = new StringBuilder(line.Length + 25); | ||
159 | buff.Append(now.ToString("yyyyMMddHHmmssfff")); | ||
160 | // buff.Append(now.ToString("yyyyMMddHHmmss")); | ||
161 | buff.Append(","); | ||
162 | buff.Append(line); | ||
163 | buff.Append("\r\n"); | ||
164 | m_logFile.Write(buff.ToString()); | ||
165 | if (m_flushWrite) | ||
166 | m_logFile.Flush(); | ||
167 | } | ||
168 | } | ||
169 | } | ||
170 | catch (Exception e) | ||
171 | { | ||
172 | if (ErrorLogger != null) | ||
173 | { | ||
174 | ErrorLogger.ErrorFormat("{0}: FAILURE WRITING TO LOGFILE: {1}", LogHeader, e); | ||
175 | } | ||
176 | Enabled = false; | ||
177 | } | ||
178 | return; | ||
179 | } | ||
180 | } | ||
181 | } | ||
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index c0faad8..87f4798 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs | |||
@@ -37,7 +37,6 @@ using System.Security.Cryptography.X509Certificates; | |||
37 | using Nini.Config; | 37 | using Nini.Config; |
38 | using OpenMetaverse; | 38 | using OpenMetaverse; |
39 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
40 | using OpenSim.Framework.Communications; | ||
41 | using OpenSim.Framework.Servers; | 40 | using OpenSim.Framework.Servers; |
42 | using OpenSim.Framework.Servers.HttpServer; | 41 | using OpenSim.Framework.Servers.HttpServer; |
43 | using OpenSim.Region.Framework.Interfaces; | 42 | using OpenSim.Region.Framework.Interfaces; |
diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs index 7462ebd..d45962f 100644 --- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs | |||
@@ -32,7 +32,7 @@ using System.Net; | |||
32 | using Nini.Config; | 32 | using Nini.Config; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenMetaverse.Imaging; | 34 | using OpenMetaverse.Imaging; |
35 | using OpenSim.Framework.Communications; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Region.CoreModules.Scripting.DynamicTexture; | 36 | using OpenSim.Region.CoreModules.Scripting.DynamicTexture; |
37 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs index 8df30d4..c33f7f5 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs | |||
@@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests | |||
85 | r1.ExternalHostName = "127.0.0.1"; | 85 | r1.ExternalHostName = "127.0.0.1"; |
86 | r1.HttpPort = 9001; | 86 | r1.HttpPort = 9001; |
87 | r1.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); | 87 | r1.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); |
88 | Scene s = new Scene(new RegionInfo(), null); | 88 | Scene s = new Scene(new RegionInfo()); |
89 | s.RegionInfo.RegionID = r1.RegionID; | 89 | s.RegionInfo.RegionID = r1.RegionID; |
90 | m_LocalConnector.AddRegion(s); | 90 | m_LocalConnector.AddRegion(s); |
91 | 91 | ||
@@ -97,7 +97,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests | |||
97 | r2.ExternalHostName = "127.0.0.1"; | 97 | r2.ExternalHostName = "127.0.0.1"; |
98 | r2.HttpPort = 9002; | 98 | r2.HttpPort = 9002; |
99 | r2.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); | 99 | r2.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); |
100 | s = new Scene(new RegionInfo(), null); | 100 | s = new Scene(new RegionInfo()); |
101 | s.RegionInfo.RegionID = r2.RegionID; | 101 | s.RegionInfo.RegionID = r2.RegionID; |
102 | m_LocalConnector.AddRegion(s); | 102 | m_LocalConnector.AddRegion(s); |
103 | 103 | ||
@@ -109,7 +109,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests | |||
109 | r3.ExternalHostName = "127.0.0.1"; | 109 | r3.ExternalHostName = "127.0.0.1"; |
110 | r3.HttpPort = 9003; | 110 | r3.HttpPort = 9003; |
111 | r3.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); | 111 | r3.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); |
112 | s = new Scene(new RegionInfo(), null); | 112 | s = new Scene(new RegionInfo()); |
113 | s.RegionInfo.RegionID = r3.RegionID; | 113 | s.RegionInfo.RegionID = r3.RegionID; |
114 | m_LocalConnector.AddRegion(s); | 114 | m_LocalConnector.AddRegion(s); |
115 | 115 | ||
@@ -121,7 +121,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests | |||
121 | r4.ExternalHostName = "127.0.0.1"; | 121 | r4.ExternalHostName = "127.0.0.1"; |
122 | r4.HttpPort = 9004; | 122 | r4.HttpPort = 9004; |
123 | r4.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); | 123 | r4.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); |
124 | s = new Scene(new RegionInfo(), null); | 124 | s = new Scene(new RegionInfo()); |
125 | s.RegionInfo.RegionID = r4.RegionID; | 125 | s.RegionInfo.RegionID = r4.RegionID; |
126 | m_LocalConnector.AddRegion(s); | 126 | m_LocalConnector.AddRegion(s); |
127 | 127 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 12ffc01..c1daae9 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -38,7 +38,6 @@ using Nini.Config; | |||
38 | using OpenMetaverse; | 38 | using OpenMetaverse; |
39 | using OpenMetaverse.StructuredData; | 39 | using OpenMetaverse.StructuredData; |
40 | using OpenSim.Framework; | 40 | using OpenSim.Framework; |
41 | using OpenSim.Framework.Communications; | ||
42 | using OpenSim.Region.Framework.Interfaces; | 41 | using OpenSim.Region.Framework.Interfaces; |
43 | using OpenSim.Region.Framework.Scenes; | 42 | using OpenSim.Region.Framework.Scenes; |
44 | using OpenSim.Region.Framework.Scenes.Serialization; | 43 | using OpenSim.Region.Framework.Scenes.Serialization; |
diff --git a/OpenSim/Region/CoreModules/World/Estate/XEstateModule.cs b/OpenSim/Region/CoreModules/World/Estate/XEstateModule.cs index f54ab2c..4bb3799 100644 --- a/OpenSim/Region/CoreModules/World/Estate/XEstateModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/XEstateModule.cs | |||
@@ -34,7 +34,6 @@ using Nini.Config; | |||
34 | using Nwc.XmlRpc; | 34 | using Nwc.XmlRpc; |
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Communications; | ||
38 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
39 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
40 | using OpenSim.Services.Interfaces; | 39 | using OpenSim.Services.Interfaces; |
diff --git a/OpenSim/Region/CoreModules/World/Land/DwellModule.cs b/OpenSim/Region/CoreModules/World/Land/DwellModule.cs index d17c517..70c6028 100644 --- a/OpenSim/Region/CoreModules/World/Land/DwellModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/DwellModule.cs | |||
@@ -45,7 +45,7 @@ using OpenSim.Framework.Servers.HttpServer; | |||
45 | using OpenSim.Region.CoreModules.Framework.InterfaceCommander; | 45 | using OpenSim.Region.CoreModules.Framework.InterfaceCommander; |
46 | using OpenSim.Region.Framework.Interfaces; | 46 | using OpenSim.Region.Framework.Interfaces; |
47 | using OpenSim.Region.Framework.Scenes; | 47 | using OpenSim.Region.Framework.Scenes; |
48 | using OpenSim.Region.Physics.Manager; | 48 | using OpenSim.Region.PhysicsModules.SharedBase; |
49 | using OpenSim.Services.Interfaces; | 49 | using OpenSim.Services.Interfaces; |
50 | using Caps = OpenSim.Framework.Capabilities.Caps; | 50 | using Caps = OpenSim.Framework.Capabilities.Caps; |
51 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 51 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 749c2cc..ad6793f 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -44,7 +44,7 @@ using OpenSim.Framework.Servers; | |||
44 | using OpenSim.Framework.Servers.HttpServer; | 44 | using OpenSim.Framework.Servers.HttpServer; |
45 | using OpenSim.Region.Framework.Interfaces; | 45 | using OpenSim.Region.Framework.Interfaces; |
46 | using OpenSim.Region.Framework.Scenes; | 46 | using OpenSim.Region.Framework.Scenes; |
47 | using OpenSim.Region.Physics.Manager; | 47 | using OpenSim.Region.PhysicsModules.SharedBase; |
48 | using OpenSim.Services.Interfaces; | 48 | using OpenSim.Services.Interfaces; |
49 | using Caps = OpenSim.Framework.Capabilities.Caps; | 49 | using Caps = OpenSim.Framework.Capabilities.Caps; |
50 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 50 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs index 8e843ee..443eee1 100644 --- a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs | |||
@@ -41,7 +41,7 @@ using Mono.Addins; | |||
41 | using OpenSim.Framework; | 41 | using OpenSim.Framework; |
42 | using OpenSim.Region.Framework.Interfaces; | 42 | using OpenSim.Region.Framework.Interfaces; |
43 | using OpenSim.Region.Framework.Scenes; | 43 | using OpenSim.Region.Framework.Scenes; |
44 | using OpenSim.Region.Physics.Manager; | 44 | using OpenSim.Region.PhysicsModules.SharedBase; |
45 | using OpenSim.Services.Interfaces; | 45 | using OpenSim.Services.Interfaces; |
46 | 46 | ||
47 | using OpenMetaverse; | 47 | using OpenMetaverse; |
diff --git a/OpenSim/Region/DataSnapshot/Properties/AssemblyInfo.cs b/OpenSim/Region/DataSnapshot/Properties/AssemblyInfo.cs deleted file mode 100644 index e60d3ae..0000000 --- a/OpenSim/Region/DataSnapshot/Properties/AssemblyInfo.cs +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Region.DataSnapshot")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("06c36944-a28d-470e-912c-654c3edaba6b")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.8.2.*")] | ||
33 | |||
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index ade908d..e80a33b 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -35,7 +35,7 @@ using OpenMetaverse; | |||
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
37 | using OpenSim.Region.Framework.Scenes; | 37 | using OpenSim.Region.Framework.Scenes; |
38 | using OpenSim.Region.Physics.Manager; | 38 | using OpenSim.Region.PhysicsModules.SharedBase; |
39 | 39 | ||
40 | namespace OpenSim.Region.Framework.Scenes.Animation | 40 | namespace OpenSim.Region.Framework.Scenes.Animation |
41 | { | 41 | { |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 22b8e4d..0a6bca4 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -635,8 +635,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
635 | /// Triggered by <see cref="TriggerScriptCollidingStart"/> | 635 | /// Triggered by <see cref="TriggerScriptCollidingStart"/> |
636 | /// in <see cref="SceneObjectPart.SendCollisionEvent"/> | 636 | /// in <see cref="SceneObjectPart.SendCollisionEvent"/> |
637 | /// via <see cref="SceneObjectPart.PhysicsCollision"/> | 637 | /// via <see cref="SceneObjectPart.PhysicsCollision"/> |
638 | /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.OnCollisionUpdate"/> | 638 | /// via <see cref="OpenSim.Region.PhysicsModule.SharedBase.PhysicsActor.OnCollisionUpdate"/> |
639 | /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.SendCollisionUpdate"/> | 639 | /// via <see cref="OpenSim.Region.PhysicsModule.SharedBase.PhysicsActor.SendCollisionUpdate"/> |
640 | /// </remarks> | 640 | /// </remarks> |
641 | public event ScriptColliding OnScriptColliderStart; | 641 | public event ScriptColliding OnScriptColliderStart; |
642 | 642 | ||
@@ -649,8 +649,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
649 | /// Triggered by <see cref="TriggerScriptColliding"/> | 649 | /// Triggered by <see cref="TriggerScriptColliding"/> |
650 | /// in <see cref="SceneObjectPart.SendCollisionEvent"/> | 650 | /// in <see cref="SceneObjectPart.SendCollisionEvent"/> |
651 | /// via <see cref="SceneObjectPart.PhysicsCollision"/> | 651 | /// via <see cref="SceneObjectPart.PhysicsCollision"/> |
652 | /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.OnCollisionUpdate"/> | 652 | /// via <see cref="OpenSim.Region.PhysicsModule.SharedBase.PhysicsActor.OnCollisionUpdate"/> |
653 | /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.SendCollisionUpdate"/> | 653 | /// via <see cref="OpenSim.Region.PhysicsModule.SharedBase.PhysicsActor.SendCollisionUpdate"/> |
654 | /// </remarks> | 654 | /// </remarks> |
655 | public event ScriptColliding OnScriptColliding; | 655 | public event ScriptColliding OnScriptColliding; |
656 | 656 | ||
@@ -662,8 +662,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
662 | /// Triggered by <see cref="TriggerScriptCollidingEnd"/> | 662 | /// Triggered by <see cref="TriggerScriptCollidingEnd"/> |
663 | /// in <see cref="SceneObjectPart.SendCollisionEvent"/> | 663 | /// in <see cref="SceneObjectPart.SendCollisionEvent"/> |
664 | /// via <see cref="SceneObjectPart.PhysicsCollision"/> | 664 | /// via <see cref="SceneObjectPart.PhysicsCollision"/> |
665 | /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.OnCollisionUpdate"/> | 665 | /// via <see cref="OpenSim.Region.PhysicsModule.SharedBase.PhysicsActor.OnCollisionUpdate"/> |
666 | /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.SendCollisionUpdate"/> | 666 | /// via <see cref="OpenSim.Region.PhysicsModule.SharedBase.PhysicsActor.SendCollisionUpdate"/> |
667 | /// </remarks> | 667 | /// </remarks> |
668 | public event ScriptColliding OnScriptCollidingEnd; | 668 | public event ScriptColliding OnScriptCollidingEnd; |
669 | 669 | ||
@@ -675,8 +675,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
675 | /// Triggered by <see cref="TriggerScriptLandCollidingStart"/> | 675 | /// Triggered by <see cref="TriggerScriptLandCollidingStart"/> |
676 | /// in <see cref="SceneObjectPart.SendLandCollisionEvent"/> | 676 | /// in <see cref="SceneObjectPart.SendLandCollisionEvent"/> |
677 | /// via <see cref="SceneObjectPart.PhysicsCollision"/> | 677 | /// via <see cref="SceneObjectPart.PhysicsCollision"/> |
678 | /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.OnCollisionUpdate"/> | 678 | /// via <see cref="OpenSim.Region.PhysicsModule.SharedBase.PhysicsActor.OnCollisionUpdate"/> |
679 | /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.SendCollisionUpdate"/> | 679 | /// via <see cref="OpenSim.Region.PhysicsModule.SharedBase.PhysicsActor.SendCollisionUpdate"/> |
680 | /// </remarks> | 680 | /// </remarks> |
681 | public event ScriptColliding OnScriptLandColliderStart; | 681 | public event ScriptColliding OnScriptLandColliderStart; |
682 | 682 | ||
@@ -688,8 +688,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
688 | /// Triggered by <see cref="TriggerScriptLandColliding"/> | 688 | /// Triggered by <see cref="TriggerScriptLandColliding"/> |
689 | /// in <see cref="SceneObjectPart.SendLandCollisionEvent"/> | 689 | /// in <see cref="SceneObjectPart.SendLandCollisionEvent"/> |
690 | /// via <see cref="SceneObjectPart.PhysicsCollision"/> | 690 | /// via <see cref="SceneObjectPart.PhysicsCollision"/> |
691 | /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.OnCollisionUpdate"/> | 691 | /// via <see cref="OpenSim.Region.PhysicsModule.SharedBase.PhysicsActor.OnCollisionUpdate"/> |
692 | /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.SendCollisionUpdate"/> | 692 | /// via <see cref="OpenSim.Region.PhysicsModule.SharedBase.PhysicsActor.SendCollisionUpdate"/> |
693 | /// </remarks> | 693 | /// </remarks> |
694 | public event ScriptColliding OnScriptLandColliding; | 694 | public event ScriptColliding OnScriptLandColliding; |
695 | 695 | ||
@@ -701,8 +701,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
701 | /// Triggered by <see cref="TriggerScriptLandCollidingEnd"/> | 701 | /// Triggered by <see cref="TriggerScriptLandCollidingEnd"/> |
702 | /// in <see cref="SceneObjectPart.SendLandCollisionEvent"/> | 702 | /// in <see cref="SceneObjectPart.SendLandCollisionEvent"/> |
703 | /// via <see cref="SceneObjectPart.PhysicsCollision"/> | 703 | /// via <see cref="SceneObjectPart.PhysicsCollision"/> |
704 | /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.OnCollisionUpdate"/> | 704 | /// via <see cref="OpenSim.Region.PhysicsModule.SharedBase.PhysicsActor.OnCollisionUpdate"/> |
705 | /// via <see cref="OpenSim.Region.Physics.Manager.PhysicsActor.SendCollisionUpdate"/> | 705 | /// via <see cref="OpenSim.Region.PhysicsModule.SharedBase.PhysicsActor.SendCollisionUpdate"/> |
706 | /// </remarks> | 706 | /// </remarks> |
707 | public event ScriptColliding OnScriptLandColliderEnd; | 707 | public event ScriptColliding OnScriptLandColliderEnd; |
708 | 708 | ||
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs index c00190a..cdd8d2d 100644 --- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs +++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | |||
@@ -36,7 +36,7 @@ using System.Threading; | |||
36 | using OpenMetaverse; | 36 | using OpenMetaverse; |
37 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | using OpenSim.Region.Framework.Interfaces; | 38 | using OpenSim.Region.Framework.Interfaces; |
39 | using OpenSim.Region.Physics.Manager; | 39 | using OpenSim.Region.PhysicsModules.SharedBase; |
40 | using OpenSim.Region.Framework.Scenes.Serialization; | 40 | using OpenSim.Region.Framework.Scenes.Serialization; |
41 | using System.Runtime.Serialization.Formatters.Binary; | 41 | using System.Runtime.Serialization.Formatters.Binary; |
42 | using System.Runtime.Serialization; | 42 | using System.Runtime.Serialization; |
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index c0405ad..bd9d580 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs | |||
@@ -31,7 +31,7 @@ using log4net; | |||
31 | using Nini.Config; | 31 | using Nini.Config; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Region.Physics.Manager; | 34 | using OpenSim.Region.PhysicsModules.SharedBase; |
35 | 35 | ||
36 | /* | 36 | /* |
37 | * Steps to add a new prioritization policy: | 37 | * Steps to add a new prioritization policy: |
diff --git a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs index f208afb..3b31281 100644 --- a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs +++ b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs | |||
@@ -35,7 +35,6 @@ using Nini.Config; | |||
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenMetaverse.StructuredData; | 36 | using OpenMetaverse.StructuredData; |
37 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Communications; | ||
39 | using OpenSim.Framework.Console; | 38 | using OpenSim.Framework.Console; |
40 | using OpenSim.Framework.Servers; | 39 | using OpenSim.Framework.Servers; |
41 | using OpenSim.Framework.Servers.HttpServer; | 40 | using OpenSim.Framework.Servers.HttpServer; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 20767e5..0b0e458 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -31,7 +31,6 @@ using System.Threading; | |||
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenMetaverse.Packets; | 32 | using OpenMetaverse.Packets; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Communications; | ||
35 | using OpenSim.Services.Interfaces; | 34 | using OpenSim.Services.Interfaces; |
36 | 35 | ||
37 | namespace OpenSim.Region.Framework.Scenes | 36 | namespace OpenSim.Region.Framework.Scenes |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 52e03b2..05edd20 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -42,12 +42,11 @@ using OpenMetaverse.Imaging; | |||
42 | using OpenSim.Framework; | 42 | using OpenSim.Framework; |
43 | using OpenSim.Framework.Monitoring; | 43 | using OpenSim.Framework.Monitoring; |
44 | using OpenSim.Services.Interfaces; | 44 | using OpenSim.Services.Interfaces; |
45 | using OpenSim.Framework.Communications; | ||
46 | using OpenSim.Framework.Console; | 45 | using OpenSim.Framework.Console; |
47 | using OpenSim.Region.Framework.Interfaces; | 46 | using OpenSim.Region.Framework.Interfaces; |
48 | using OpenSim.Region.Framework.Scenes.Scripting; | 47 | using OpenSim.Region.Framework.Scenes.Scripting; |
49 | using OpenSim.Region.Framework.Scenes.Serialization; | 48 | using OpenSim.Region.Framework.Scenes.Serialization; |
50 | using OpenSim.Region.Physics.Manager; | 49 | using OpenSim.Region.PhysicsModules.SharedBase; |
51 | using Timer = System.Timers.Timer; | 50 | using Timer = System.Timers.Timer; |
52 | using TPFlags = OpenSim.Framework.Constants.TeleportFlags; | 51 | using TPFlags = OpenSim.Framework.Constants.TeleportFlags; |
53 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 52 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
@@ -855,11 +854,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
855 | 854 | ||
856 | #region Constructors | 855 | #region Constructors |
857 | 856 | ||
858 | public Scene(RegionInfo regInfo, AgentCircuitManager authen, PhysicsScene physicsScene, | 857 | public Scene(RegionInfo regInfo, AgentCircuitManager authen, |
859 | SceneCommunicationService sceneGridService, | ||
860 | ISimulationDataService simDataService, IEstateDataService estateDataService, | 858 | ISimulationDataService simDataService, IEstateDataService estateDataService, |
861 | IConfigSource config, string simulatorVersion) | 859 | IConfigSource config, string simulatorVersion) |
862 | : this(regInfo, physicsScene) | 860 | : this(regInfo) |
863 | { | 861 | { |
864 | m_config = config; | 862 | m_config = config; |
865 | MinFrameTime = 0.089f; | 863 | MinFrameTime = 0.089f; |
@@ -870,7 +868,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
870 | 868 | ||
871 | m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue / 2)) + (uint)(uint.MaxValue / 4); | 869 | m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue / 2)) + (uint)(uint.MaxValue / 4); |
872 | m_authenticateHandler = authen; | 870 | m_authenticateHandler = authen; |
873 | m_sceneGridService = sceneGridService; | 871 | m_sceneGridService = new SceneCommunicationService(); |
874 | m_SimulationDataService = simDataService; | 872 | m_SimulationDataService = simDataService; |
875 | m_EstateDataService = estateDataService; | 873 | m_EstateDataService = estateDataService; |
876 | 874 | ||
@@ -1088,11 +1086,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1088 | } | 1086 | } |
1089 | } | 1087 | } |
1090 | 1088 | ||
1091 | string[] possibleAccessControlConfigSections = new string[] { "AccessControl", "Startup" }; | 1089 | string[] possibleAccessControlConfigSections = new string[] { "Startup", "AccessControl"}; |
1092 | 1090 | ||
1093 | string grant | 1091 | string grant |
1094 | = Util.GetConfigVarFromSections<string>( | 1092 | = Util.GetConfigVarFromSections<string>( |
1095 | config, "AllowedClients", possibleAccessControlConfigSections, ""); | 1093 | config, "AllowedClients", possibleAccessControlConfigSections, string.Empty); |
1096 | 1094 | ||
1097 | if (grant.Length > 0) | 1095 | if (grant.Length > 0) |
1098 | { | 1096 | { |
@@ -1104,7 +1102,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1104 | 1102 | ||
1105 | grant | 1103 | grant |
1106 | = Util.GetConfigVarFromSections<string>( | 1104 | = Util.GetConfigVarFromSections<string>( |
1107 | config, "BannedClients", possibleAccessControlConfigSections, ""); | 1105 | config, "DeniedClients", possibleAccessControlConfigSections, String.Empty); |
1106 | // Deal with the mess of someone having used a different word at some point | ||
1107 | if (grant == String.Empty) | ||
1108 | grant = Util.GetConfigVarFromSections<string>( | ||
1109 | config, "BannedClients", possibleAccessControlConfigSections, String.Empty); | ||
1108 | 1110 | ||
1109 | if (grant.Length > 0) | 1111 | if (grant.Length > 0) |
1110 | { | 1112 | { |
@@ -1201,11 +1203,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1201 | MainConsole.Instance.Commands.AddCommand("scene", false, "gc collect", "gc collect", "gc collect", "Cause the garbage collector to make a single pass", HandleGcCollect); | 1203 | MainConsole.Instance.Commands.AddCommand("scene", false, "gc collect", "gc collect", "gc collect", "Cause the garbage collector to make a single pass", HandleGcCollect); |
1202 | } | 1204 | } |
1203 | 1205 | ||
1204 | public Scene(RegionInfo regInfo, PhysicsScene physicsScene) | 1206 | public Scene(RegionInfo regInfo) |
1205 | : base(regInfo) | 1207 | : base(regInfo) |
1206 | { | 1208 | { |
1207 | m_sceneGraph = new SceneGraph(this); | 1209 | m_sceneGraph = new SceneGraph(this); |
1208 | m_sceneGraph.PhysicsScene = physicsScene; | ||
1209 | 1210 | ||
1210 | // If the scene graph has an Unrecoverable error, restart this sim. | 1211 | // If the scene graph has an Unrecoverable error, restart this sim. |
1211 | // Currently the only thing that causes it to happen is two kinds of specific | 1212 | // Currently the only thing that causes it to happen is two kinds of specific |
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index df7a72a..28df1c1 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -35,7 +35,6 @@ using OpenMetaverse.StructuredData; | |||
35 | using log4net; | 35 | using log4net; |
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Client; | 37 | using OpenSim.Framework.Client; |
38 | using OpenSim.Framework.Communications; | ||
39 | using OpenSim.Framework.Capabilities; | 38 | using OpenSim.Framework.Capabilities; |
40 | using OpenSim.Region.Framework.Interfaces; | 39 | using OpenSim.Region.Framework.Interfaces; |
41 | using OpenSim.Services.Interfaces; | 40 | using OpenSim.Services.Interfaces; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index c9c88d3..0a22bb3 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -34,7 +34,7 @@ using OpenMetaverse.Packets; | |||
34 | using log4net; | 34 | using log4net; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Region.Framework.Scenes.Types; | 36 | using OpenSim.Region.Framework.Scenes.Types; |
37 | using OpenSim.Region.Physics.Manager; | 37 | using OpenSim.Region.PhysicsModules.SharedBase; |
38 | using OpenSim.Region.Framework.Interfaces; | 38 | using OpenSim.Region.Framework.Interfaces; |
39 | 39 | ||
40 | namespace OpenSim.Region.Framework.Scenes | 40 | namespace OpenSim.Region.Framework.Scenes |
@@ -121,7 +121,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
121 | 121 | ||
122 | public PhysicsScene PhysicsScene | 122 | public PhysicsScene PhysicsScene |
123 | { | 123 | { |
124 | get { return _PhyScene; } | 124 | get |
125 | { | ||
126 | if (_PhyScene == null) | ||
127 | _PhyScene = m_parentScene.RequestModuleInterface<PhysicsScene>(); | ||
128 | return _PhyScene; | ||
129 | } | ||
125 | set | 130 | set |
126 | { | 131 | { |
127 | // If we're not doing the initial set | 132 | // If we're not doing the initial set |
@@ -172,9 +177,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
172 | 177 | ||
173 | // PhysX does this (runs in the background). | 178 | // PhysX does this (runs in the background). |
174 | 179 | ||
175 | if (_PhyScene.IsThreaded) | 180 | if (PhysicsScene.IsThreaded) |
176 | { | 181 | { |
177 | _PhyScene.GetResults(); | 182 | PhysicsScene.GetResults(); |
178 | } | 183 | } |
179 | } | 184 | } |
180 | 185 | ||
@@ -214,7 +219,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
214 | // position). | 219 | // position). |
215 | // | 220 | // |
216 | // Therefore, JointMoved and JointDeactivated events will be fired as a result of the following Simulate(). | 221 | // Therefore, JointMoved and JointDeactivated events will be fired as a result of the following Simulate(). |
217 | return _PhyScene.Simulate((float)elapsed); | 222 | return PhysicsScene.Simulate((float)elapsed); |
218 | } | 223 | } |
219 | 224 | ||
220 | protected internal void UpdateScenePresenceMovement() | 225 | protected internal void UpdateScenePresenceMovement() |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 5e1801a..b3bd7e0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -39,7 +39,7 @@ using OpenMetaverse; | |||
39 | using OpenMetaverse.Packets; | 39 | using OpenMetaverse.Packets; |
40 | using OpenSim.Framework; | 40 | using OpenSim.Framework; |
41 | using OpenSim.Region.Framework.Interfaces; | 41 | using OpenSim.Region.Framework.Interfaces; |
42 | using OpenSim.Region.Physics.Manager; | 42 | using OpenSim.Region.PhysicsModules.SharedBase; |
43 | using OpenSim.Region.Framework.Scenes.Serialization; | 43 | using OpenSim.Region.Framework.Scenes.Serialization; |
44 | using PermissionMask = OpenSim.Framework.PermissionMask; | 44 | using PermissionMask = OpenSim.Framework.PermissionMask; |
45 | 45 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index c300b96..ea96d9e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -42,7 +42,7 @@ using OpenSim.Framework; | |||
42 | using OpenSim.Region.Framework.Interfaces; | 42 | using OpenSim.Region.Framework.Interfaces; |
43 | using OpenSim.Region.Framework.Scenes.Scripting; | 43 | using OpenSim.Region.Framework.Scenes.Scripting; |
44 | using OpenSim.Region.Framework.Scenes.Serialization; | 44 | using OpenSim.Region.Framework.Scenes.Serialization; |
45 | using OpenSim.Region.Physics.Manager; | 45 | using OpenSim.Region.PhysicsModules.SharedBase; |
46 | using PermissionMask = OpenSim.Framework.PermissionMask; | 46 | using PermissionMask = OpenSim.Framework.PermissionMask; |
47 | 47 | ||
48 | namespace OpenSim.Region.Framework.Scenes | 48 | namespace OpenSim.Region.Framework.Scenes |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 4c346b7..29362d7 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -41,7 +41,7 @@ using OpenSim.Framework.Monitoring; | |||
41 | using OpenSim.Region.Framework.Interfaces; | 41 | using OpenSim.Region.Framework.Interfaces; |
42 | using OpenSim.Region.Framework.Scenes.Animation; | 42 | using OpenSim.Region.Framework.Scenes.Animation; |
43 | using OpenSim.Region.Framework.Scenes.Types; | 43 | using OpenSim.Region.Framework.Scenes.Types; |
44 | using OpenSim.Region.Physics.Manager; | 44 | using OpenSim.Region.PhysicsModules.SharedBase; |
45 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 45 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; |
46 | using OpenSim.Services.Interfaces; | 46 | using OpenSim.Services.Interfaces; |
47 | using TeleportFlags = OpenSim.Framework.Constants.TeleportFlags; | 47 | using TeleportFlags = OpenSim.Framework.Constants.TeleportFlags; |
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs index a3485d2..3c03130 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs | |||
@@ -34,7 +34,7 @@ using OpenMetaverse; | |||
34 | using log4net; | 34 | using log4net; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
37 | using OpenSim.Region.Physics.Manager; | 37 | using OpenSim.Region.PhysicsModules.SharedBase; |
38 | 38 | ||
39 | namespace OpenSim.Region.Framework.Scenes.Serialization | 39 | namespace OpenSim.Region.Framework.Scenes.Serialization |
40 | { | 40 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs index 766ce83..da18941 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs | |||
@@ -34,7 +34,6 @@ using Nini.Config; | |||
34 | using NUnit.Framework; | 34 | using NUnit.Framework; |
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Communications; | ||
38 | using OpenSim.Region.Framework.Scenes; | 37 | using OpenSim.Region.Framework.Scenes; |
39 | using OpenSim.Tests.Common; | 38 | using OpenSim.Tests.Common; |
40 | 39 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs index b6b3344..ee7c8a9 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs | |||
@@ -32,7 +32,6 @@ using System.Text; | |||
32 | using NUnit.Framework; | 32 | using NUnit.Framework; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | ||
36 | using OpenSim.Region.Framework.Scenes; | 35 | using OpenSim.Region.Framework.Scenes; |
37 | using OpenSim.Tests.Common; | 36 | using OpenSim.Tests.Common; |
38 | 37 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneManagerTests.cs index 6118004..3172227 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneManagerTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneManagerTests.cs | |||
@@ -32,7 +32,6 @@ using System.Threading; | |||
32 | using NUnit.Framework; | 32 | using NUnit.Framework; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | ||
36 | using OpenSim.Region.Framework.Scenes; | 35 | using OpenSim.Region.Framework.Scenes; |
37 | using OpenSim.Services.Interfaces; | 36 | using OpenSim.Services.Interfaces; |
38 | using OpenSim.Tests.Common; | 37 | using OpenSim.Tests.Common; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index bdf0700..098f1b4 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | |||
@@ -33,7 +33,6 @@ using Nini.Config; | |||
33 | using NUnit.Framework; | 33 | using NUnit.Framework; |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Communications; | ||
37 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
38 | using OpenSim.Services.Interfaces; | 37 | using OpenSim.Services.Interfaces; |
39 | using OpenSim.Tests.Common; | 38 | using OpenSim.Tests.Common; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs index 93ac34f..dc3b717 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCopyTests.cs | |||
@@ -32,7 +32,6 @@ using Nini.Config; | |||
32 | using NUnit.Framework; | 32 | using NUnit.Framework; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | ||
36 | using OpenSim.Region.CoreModules.Framework.EntityTransfer; | 35 | using OpenSim.Region.CoreModules.Framework.EntityTransfer; |
37 | using OpenSim.Region.CoreModules.Framework.InventoryAccess; | 36 | using OpenSim.Region.CoreModules.Framework.InventoryAccess; |
38 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; | 37 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs index b7e9499..f980209 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs | |||
@@ -32,7 +32,6 @@ using Nini.Config; | |||
32 | using NUnit.Framework; | 32 | using NUnit.Framework; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | ||
36 | using OpenSim.Region.CoreModules.Framework.EntityTransfer; | 35 | using OpenSim.Region.CoreModules.Framework.EntityTransfer; |
37 | using OpenSim.Region.CoreModules.Framework.InventoryAccess; | 36 | using OpenSim.Region.CoreModules.Framework.InventoryAccess; |
38 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; | 37 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index c2e0ae3..e6d5a2f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | |||
@@ -31,7 +31,6 @@ using System.Reflection; | |||
31 | using NUnit.Framework; | 31 | using NUnit.Framework; |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Communications; | ||
35 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
36 | using OpenSim.Tests.Common; | 35 | using OpenSim.Tests.Common; |
37 | using log4net; | 36 | using log4net; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs index ce7fc0e..9a665f6 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs | |||
@@ -30,7 +30,6 @@ using System.Reflection; | |||
30 | using NUnit.Framework; | 30 | using NUnit.Framework; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Framework.Communications; | ||
34 | using OpenSim.Region.Framework.Scenes; | 33 | using OpenSim.Region.Framework.Scenes; |
35 | using OpenSim.Tests.Common; | 34 | using OpenSim.Tests.Common; |
36 | 35 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs index fdbe7ae..8a2d2af 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectScriptTests.cs | |||
@@ -31,7 +31,6 @@ using System.Reflection; | |||
31 | using NUnit.Framework; | 31 | using NUnit.Framework; |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Communications; | ||
35 | using OpenSim.Region.Framework.Interfaces; | 34 | using OpenSim.Region.Framework.Interfaces; |
36 | using OpenSim.Region.Framework.Scenes; | 35 | using OpenSim.Region.Framework.Scenes; |
37 | using OpenSim.Tests.Common; | 36 | using OpenSim.Tests.Common; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSerializationTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSerializationTests.cs index 927d8e8..e3ceb04 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSerializationTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSerializationTests.cs | |||
@@ -36,7 +36,6 @@ using NUnit.Framework; | |||
36 | using OpenMetaverse; | 36 | using OpenMetaverse; |
37 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Serialization.External; | 38 | using OpenSim.Framework.Serialization.External; |
39 | using OpenSim.Framework.Communications; | ||
40 | using OpenSim.Region.Framework.Scenes; | 39 | using OpenSim.Region.Framework.Scenes; |
41 | using OpenSim.Region.Framework.Scenes.Serialization; | 40 | using OpenSim.Region.Framework.Scenes.Serialization; |
42 | using OpenSim.Services.Interfaces; | 41 | using OpenSim.Services.Interfaces; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs index 974529a..e00defd 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs | |||
@@ -31,7 +31,6 @@ using System.Threading; | |||
31 | using NUnit.Framework; | 31 | using NUnit.Framework; |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Communications; | ||
35 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
36 | using OpenSim.Tests.Common; | 35 | using OpenSim.Tests.Common; |
37 | 36 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs index 5ba754c..1737e3c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs | |||
@@ -31,7 +31,6 @@ using System.Reflection; | |||
31 | using NUnit.Framework; | 31 | using NUnit.Framework; |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Communications; | ||
35 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
36 | using OpenSim.Tests.Common; | 35 | using OpenSim.Tests.Common; |
37 | 36 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs index cdebe25..af3ce8e 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs | |||
@@ -30,7 +30,6 @@ using System.Reflection; | |||
30 | using NUnit.Framework; | 30 | using NUnit.Framework; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Framework.Communications; | ||
34 | using OpenSim.Region.Framework.Scenes; | 33 | using OpenSim.Region.Framework.Scenes; |
35 | using OpenSim.Tests.Common; | 34 | using OpenSim.Tests.Common; |
36 | 35 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs index 32d6649..a92e364 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs | |||
@@ -32,7 +32,6 @@ using Nini.Config; | |||
32 | using NUnit.Framework; | 32 | using NUnit.Framework; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | ||
36 | using OpenSim.Region.CoreModules.Avatar.InstantMessage; | 35 | using OpenSim.Region.CoreModules.Avatar.InstantMessage; |
37 | using OpenSim.Region.CoreModules.World.Permissions; | 36 | using OpenSim.Region.CoreModules.World.Permissions; |
38 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs index 06e6423..96d112d 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs | |||
@@ -36,7 +36,6 @@ using Nini.Config; | |||
36 | using NUnit.Framework; | 36 | using NUnit.Framework; |
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Communications; | ||
40 | using OpenSim.Region.Framework.Scenes; | 39 | using OpenSim.Region.Framework.Scenes; |
41 | using OpenSim.Region.Framework.Interfaces; | 40 | using OpenSim.Region.Framework.Interfaces; |
42 | using OpenSim.Region.ClientStack.Linden; | 41 | using OpenSim.Region.ClientStack.Linden; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs index 42cfa1b..42d91b9 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAnimationTests.cs | |||
@@ -35,13 +35,12 @@ using Nini.Config; | |||
35 | using NUnit.Framework; | 35 | using NUnit.Framework; |
36 | using OpenMetaverse; | 36 | using OpenMetaverse; |
37 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Communications; | ||
39 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
40 | using OpenSim.Region.Framework.Interfaces; | 39 | using OpenSim.Region.Framework.Interfaces; |
41 | using OpenSim.Region.CoreModules.Framework.EntityTransfer; | 40 | using OpenSim.Region.CoreModules.Framework.EntityTransfer; |
42 | using OpenSim.Region.CoreModules.World.Serialiser; | 41 | using OpenSim.Region.CoreModules.World.Serialiser; |
43 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; | 42 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; |
44 | using OpenSim.Region.Physics.Manager; | 43 | using OpenSim.Region.PhysicsModules.SharedBase; |
45 | using OpenSim.Tests.Common; | 44 | using OpenSim.Tests.Common; |
46 | 45 | ||
47 | namespace OpenSim.Region.Framework.Scenes.Tests | 46 | namespace OpenSim.Region.Framework.Scenes.Tests |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs index c6e3b8b..e5c847e 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs | |||
@@ -33,7 +33,6 @@ using Nini.Config; | |||
33 | using NUnit.Framework; | 33 | using NUnit.Framework; |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Communications; | ||
37 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.Framework.Scenes; | 37 | using OpenSim.Region.Framework.Scenes; |
39 | using OpenSim.Tests.Common; | 38 | using OpenSim.Tests.Common; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCapabilityTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCapabilityTests.cs index 45bfbff..aa26767 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCapabilityTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCapabilityTests.cs | |||
@@ -36,7 +36,6 @@ using Nini.Config; | |||
36 | using NUnit.Framework; | 36 | using NUnit.Framework; |
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Communications; | ||
40 | using OpenSim.Framework.Servers; | 39 | using OpenSim.Framework.Servers; |
41 | using OpenSim.Framework.Servers.HttpServer; | 40 | using OpenSim.Framework.Servers.HttpServer; |
42 | using OpenSim.Region.ClientStack.Linden; | 41 | using OpenSim.Region.ClientStack.Linden; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs index c193a97..37eec52 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceCrossingTests.cs | |||
@@ -32,7 +32,6 @@ using Nini.Config; | |||
32 | using NUnit.Framework; | 32 | using NUnit.Framework; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | ||
36 | using OpenSim.Framework.Servers; | 35 | using OpenSim.Framework.Servers; |
37 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.CoreModules.Framework; | 37 | using OpenSim.Region.CoreModules.Framework; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs index 0025e9b..64f11cd 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs | |||
@@ -32,7 +32,6 @@ using Nini.Config; | |||
32 | using NUnit.Framework; | 32 | using NUnit.Framework; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | ||
36 | using OpenSim.Framework.Servers; | 35 | using OpenSim.Framework.Servers; |
37 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; | 37 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs index 42276dd..226ed6e 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs | |||
@@ -35,7 +35,6 @@ using Nini.Config; | |||
35 | using NUnit.Framework; | 35 | using NUnit.Framework; |
36 | using OpenMetaverse; | 36 | using OpenMetaverse; |
37 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Communications; | ||
39 | using OpenSim.Framework.Servers; | 38 | using OpenSim.Framework.Servers; |
40 | using OpenSim.Region.Framework.Interfaces; | 39 | using OpenSim.Region.Framework.Interfaces; |
41 | using OpenSim.Region.CoreModules.Framework; | 40 | using OpenSim.Region.CoreModules.Framework; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneStatisticsTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneStatisticsTests.cs index 2d36214..045fd3c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneStatisticsTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneStatisticsTests.cs | |||
@@ -31,7 +31,6 @@ using System.Reflection; | |||
31 | using NUnit.Framework; | 31 | using NUnit.Framework; |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Communications; | ||
35 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
36 | using OpenSim.Tests.Common; | 35 | using OpenSim.Tests.Common; |
37 | 36 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs index 33ef83b..517faf1 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs | |||
@@ -36,7 +36,6 @@ using Nini.Config; | |||
36 | using NUnit.Framework; | 36 | using NUnit.Framework; |
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Communications; | ||
40 | using OpenSim.Region.Framework.Scenes; | 39 | using OpenSim.Region.Framework.Scenes; |
41 | using OpenSim.Region.Framework.Interfaces; | 40 | using OpenSim.Region.Framework.Interfaces; |
42 | using OpenSim.Region.CoreModules.World.Serialiser; | 41 | using OpenSim.Region.CoreModules.World.Serialiser; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index 3caea8b..33a630c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | |||
@@ -37,7 +37,6 @@ using NUnit.Framework; | |||
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
38 | using OpenMetaverse.Assets; | 38 | using OpenMetaverse.Assets; |
39 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
40 | using OpenSim.Framework.Communications; | ||
41 | using OpenSim.Region.Framework.Scenes; | 40 | using OpenSim.Region.Framework.Scenes; |
42 | using OpenSim.Region.Framework.Interfaces; | 41 | using OpenSim.Region.Framework.Interfaces; |
43 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; | 42 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs index edc0a52..8250e6c 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UserInventoryTests.cs | |||
@@ -37,7 +37,6 @@ using NUnit.Framework; | |||
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
38 | using OpenMetaverse.Assets; | 38 | using OpenMetaverse.Assets; |
39 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
40 | using OpenSim.Framework.Communications; | ||
41 | using OpenSim.Region.Framework.Scenes; | 40 | using OpenSim.Region.Framework.Scenes; |
42 | using OpenSim.Region.Framework.Interfaces; | 41 | using OpenSim.Region.Framework.Interfaces; |
43 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; | 42 | using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index ed1bab4..eef3c92 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -35,7 +35,6 @@ using Nini.Config; | |||
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenMetaverse.StructuredData; | 36 | using OpenMetaverse.StructuredData; |
37 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Communications; | ||
39 | using OpenSim.Region.Framework.Interfaces; | 38 | using OpenSim.Region.Framework.Interfaces; |
40 | using OpenSim.Region.Framework.Scenes; | 39 | using OpenSim.Region.Framework.Scenes; |
41 | using OpenSim.Services.Interfaces; | 40 | using OpenSim.Services.Interfaces; |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs index 8095b28..1cb4747 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs | |||
@@ -42,7 +42,6 @@ using OpenMetaverse; | |||
42 | using OpenMetaverse.StructuredData; | 42 | using OpenMetaverse.StructuredData; |
43 | 43 | ||
44 | using OpenSim.Framework; | 44 | using OpenSim.Framework; |
45 | using OpenSim.Framework.Communications; | ||
46 | using OpenSim.Region.Framework.Interfaces; | 45 | using OpenSim.Region.Framework.Interfaces; |
47 | using OpenSim.Services.Interfaces; | 46 | using OpenSim.Services.Interfaces; |
48 | 47 | ||
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs index e03e71d..9a42bac 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs | |||
@@ -37,7 +37,6 @@ using OpenMetaverse.Messages.Linden; | |||
37 | using OpenMetaverse.Packets; | 37 | using OpenMetaverse.Packets; |
38 | using OpenMetaverse.StructuredData; | 38 | using OpenMetaverse.StructuredData; |
39 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
40 | using OpenSim.Framework.Communications; | ||
41 | using OpenSim.Framework.Servers; | 40 | using OpenSim.Framework.Servers; |
42 | using OpenSim.Framework.Servers.HttpServer; | 41 | using OpenSim.Framework.Servers.HttpServer; |
43 | using OpenSim.Region.ClientStack.Linden; | 42 | using OpenSim.Region.ClientStack.Linden; |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index a040f43..20555e4 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs | |||
@@ -41,7 +41,6 @@ using OpenMetaverse; | |||
41 | using OpenMetaverse.StructuredData; | 41 | using OpenMetaverse.StructuredData; |
42 | 42 | ||
43 | using OpenSim.Framework; | 43 | using OpenSim.Framework; |
44 | using OpenSim.Framework.Communications; | ||
45 | using OpenSim.Region.Framework.Interfaces; | 44 | using OpenSim.Region.Framework.Interfaces; |
46 | using OpenSim.Services.Interfaces; | 45 | using OpenSim.Services.Interfaces; |
47 | 46 | ||
diff --git a/OpenSim/Region/DataSnapshot/DataRequestHandler.cs b/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs index 50276ae..50276ae 100644 --- a/OpenSim/Region/DataSnapshot/DataRequestHandler.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs | |||
diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs index 0f39273..4e766eb 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs | |||
@@ -39,14 +39,10 @@ using Nini.Config; | |||
39 | using OpenMetaverse; | 39 | using OpenMetaverse; |
40 | using Mono.Addins; | 40 | using Mono.Addins; |
41 | using OpenSim.Framework; | 41 | using OpenSim.Framework; |
42 | using OpenSim.Framework.Communications; | ||
43 | using OpenSim.Region.DataSnapshot.Interfaces; | 42 | using OpenSim.Region.DataSnapshot.Interfaces; |
44 | using OpenSim.Region.Framework.Interfaces; | 43 | using OpenSim.Region.Framework.Interfaces; |
45 | using OpenSim.Region.Framework.Scenes; | 44 | using OpenSim.Region.Framework.Scenes; |
46 | 45 | ||
47 | [assembly: Addin("DataSnapshot", OpenSim.VersionInfo.VersionNumber)] | ||
48 | [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] | ||
49 | |||
50 | namespace OpenSim.Region.DataSnapshot | 46 | namespace OpenSim.Region.DataSnapshot |
51 | { | 47 | { |
52 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DataSnapshotManager")] | 48 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DataSnapshotManager")] |
diff --git a/OpenSim/Region/DataSnapshot/EstateSnapshot.cs b/OpenSim/Region/OptionalModules/DataSnapshot/EstateSnapshot.cs index 8da9e8c..8da9e8c 100644 --- a/OpenSim/Region/DataSnapshot/EstateSnapshot.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/EstateSnapshot.cs | |||
diff --git a/OpenSim/Region/DataSnapshot/Interfaces/IDataSnapshot.cs b/OpenSim/Region/OptionalModules/DataSnapshot/Interfaces/IDataSnapshot.cs index 3b3db65..3b3db65 100644 --- a/OpenSim/Region/DataSnapshot/Interfaces/IDataSnapshot.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/Interfaces/IDataSnapshot.cs | |||
diff --git a/OpenSim/Region/DataSnapshot/Interfaces/IDataSnapshotProvider.cs b/OpenSim/Region/OptionalModules/DataSnapshot/Interfaces/IDataSnapshotProvider.cs index daea373..daea373 100644 --- a/OpenSim/Region/DataSnapshot/Interfaces/IDataSnapshotProvider.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/Interfaces/IDataSnapshotProvider.cs | |||
diff --git a/OpenSim/Region/DataSnapshot/LLSDDiscovery.cs b/OpenSim/Region/OptionalModules/DataSnapshot/LLSDDiscovery.cs index 54a87f9..54a87f9 100644 --- a/OpenSim/Region/DataSnapshot/LLSDDiscovery.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/LLSDDiscovery.cs | |||
diff --git a/OpenSim/Region/DataSnapshot/LandSnapshot.cs b/OpenSim/Region/OptionalModules/DataSnapshot/LandSnapshot.cs index b8c90cd..b8c90cd 100644 --- a/OpenSim/Region/DataSnapshot/LandSnapshot.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/LandSnapshot.cs | |||
diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/OptionalModules/DataSnapshot/ObjectSnapshot.cs index 0bb4044..0bb4044 100644 --- a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/ObjectSnapshot.cs | |||
diff --git a/OpenSim/Region/DataSnapshot/SnapshotStore.cs b/OpenSim/Region/OptionalModules/DataSnapshot/SnapshotStore.cs index 480aaaf..480aaaf 100644 --- a/OpenSim/Region/DataSnapshot/SnapshotStore.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/SnapshotStore.cs | |||
diff --git a/OpenSim/Region/OptionalModules/PhysicsParameters/PhysicsParameters.cs b/OpenSim/Region/OptionalModules/PhysicsParameters/PhysicsParameters.cs index 3083a33..1d9179c 100755 --- a/OpenSim/Region/OptionalModules/PhysicsParameters/PhysicsParameters.cs +++ b/OpenSim/Region/OptionalModules/PhysicsParameters/PhysicsParameters.cs | |||
@@ -36,7 +36,7 @@ using OpenSim.Framework.Console; | |||
36 | using OpenSim.Region.CoreModules.Framework.InterfaceCommander; | 36 | using OpenSim.Region.CoreModules.Framework.InterfaceCommander; |
37 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
39 | using OpenSim.Region.Physics.Manager; | 39 | using OpenSim.Region.PhysicsModules.SharedBase; |
40 | 40 | ||
41 | namespace OpenSim.Region.OptionalModules.PhysicsParameters | 41 | namespace OpenSim.Region.OptionalModules.PhysicsParameters |
42 | { | 42 | { |
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerClientEventForwarder.cs b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerClientEventForwarder.cs index 721d396..721d396 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerClientEventForwarder.cs +++ b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerClientEventForwarder.cs | |||
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs index 83732e2..83732e2 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs +++ b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs | |||
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerLargeLandChannel.cs index e5e76e9..e5e76e9 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs +++ b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerLargeLandChannel.cs | |||
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerModule.cs index 0fe3ab0..98b0ae1 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerModule.cs | |||
@@ -36,7 +36,7 @@ using OpenSim.Framework.Client; | |||
36 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
37 | using OpenSim.Region.Framework.Scenes; | 37 | using OpenSim.Region.Framework.Scenes; |
38 | using OpenSim.Framework.Console; | 38 | using OpenSim.Framework.Console; |
39 | using OpenSim.Region.Physics.Manager; | 39 | using OpenSim.Region.PhysicsModules.SharedBase; |
40 | using Mono.Addins; | 40 | using Mono.Addins; |
41 | 41 | ||
42 | namespace OpenSim.Region.RegionCombinerModule | 42 | namespace OpenSim.Region.RegionCombinerModule |
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerPermissionModule.cs b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerPermissionModule.cs index ddfe3e0..ddfe3e0 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerPermissionModule.cs +++ b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerPermissionModule.cs | |||
diff --git a/OpenSim/Region/RegionCombinerModule/RegionConnections.cs b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionConnections.cs index 6bf1c4a..6bf1c4a 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionConnections.cs +++ b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionConnections.cs | |||
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCourseLocation.cs b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCourseLocation.cs index 224ac99..224ac99 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCourseLocation.cs +++ b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCourseLocation.cs | |||
diff --git a/OpenSim/Region/RegionCombinerModule/RegionData.cs b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionData.cs index 42fca9f..42fca9f 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionData.cs +++ b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionData.cs | |||
diff --git a/OpenSim/Region/OptionalModules/Scripting/ExtendedPhysics/ExtendedPhysics.cs b/OpenSim/Region/OptionalModules/Scripting/ExtendedPhysics/ExtendedPhysics.cs deleted file mode 100755 index ff4afbf..0000000 --- a/OpenSim/Region/OptionalModules/Scripting/ExtendedPhysics/ExtendedPhysics.cs +++ /dev/null | |||
@@ -1,623 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyrightD | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | using System; | ||
28 | using System.Collections.Generic; | ||
29 | using System.Linq; | ||
30 | using System.Reflection; | ||
31 | using System.Text; | ||
32 | using System.Threading; | ||
33 | |||
34 | using OpenSim.Framework; | ||
35 | using OpenSim.Region.CoreModules; | ||
36 | using OpenSim.Region.Framework; | ||
37 | using OpenSim.Region.Framework.Interfaces; | ||
38 | using OpenSim.Region.Framework.Scenes; | ||
39 | using OpenSim.Region.Physics.Manager; | ||
40 | |||
41 | using Mono.Addins; | ||
42 | using Nini.Config; | ||
43 | using log4net; | ||
44 | using OpenMetaverse; | ||
45 | |||
46 | namespace OpenSim.Region.OptionalModules.Scripting | ||
47 | { | ||
48 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | ||
49 | public class ExtendedPhysics : INonSharedRegionModule | ||
50 | { | ||
51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
52 | private static string LogHeader = "[EXTENDED PHYSICS]"; | ||
53 | |||
54 | // ============================================================= | ||
55 | // Since BulletSim is a plugin, this these values aren't defined easily in one place. | ||
56 | // This table must correspond to an identical table in BSScene. | ||
57 | |||
58 | // Per scene functions. See BSScene. | ||
59 | |||
60 | // Per avatar functions. See BSCharacter. | ||
61 | |||
62 | // Per prim functions. See BSPrim. | ||
63 | public const string PhysFunctGetLinksetType = "BulletSim.GetLinksetType"; | ||
64 | public const string PhysFunctSetLinksetType = "BulletSim.SetLinksetType"; | ||
65 | public const string PhysFunctChangeLinkFixed = "BulletSim.ChangeLinkFixed"; | ||
66 | public const string PhysFunctChangeLinkType = "BulletSim.ChangeLinkType"; | ||
67 | public const string PhysFunctGetLinkType = "BulletSim.GetLinkType"; | ||
68 | public const string PhysFunctChangeLinkParams = "BulletSim.ChangeLinkParams"; | ||
69 | public const string PhysFunctAxisLockLimits = "BulletSim.AxisLockLimits"; | ||
70 | |||
71 | // ============================================================= | ||
72 | |||
73 | private IConfig Configuration { get; set; } | ||
74 | private bool Enabled { get; set; } | ||
75 | private Scene BaseScene { get; set; } | ||
76 | private IScriptModuleComms Comms { get; set; } | ||
77 | |||
78 | #region INonSharedRegionModule | ||
79 | |||
80 | public string Name { get { return this.GetType().Name; } } | ||
81 | |||
82 | public void Initialise(IConfigSource config) | ||
83 | { | ||
84 | BaseScene = null; | ||
85 | Enabled = false; | ||
86 | Configuration = null; | ||
87 | Comms = null; | ||
88 | |||
89 | try | ||
90 | { | ||
91 | if ((Configuration = config.Configs["ExtendedPhysics"]) != null) | ||
92 | { | ||
93 | Enabled = Configuration.GetBoolean("Enabled", Enabled); | ||
94 | } | ||
95 | } | ||
96 | catch (Exception e) | ||
97 | { | ||
98 | m_log.ErrorFormat("{0} Initialization error: {0}", LogHeader, e); | ||
99 | } | ||
100 | |||
101 | m_log.InfoFormat("{0} module {1} enabled", LogHeader, (Enabled ? "is" : "is not")); | ||
102 | } | ||
103 | |||
104 | public void Close() | ||
105 | { | ||
106 | if (BaseScene != null) | ||
107 | { | ||
108 | BaseScene.EventManager.OnObjectAddedToScene -= EventManager_OnObjectAddedToScene; | ||
109 | BaseScene.EventManager.OnSceneObjectPartUpdated -= EventManager_OnSceneObjectPartUpdated; | ||
110 | BaseScene = null; | ||
111 | } | ||
112 | } | ||
113 | |||
114 | public void AddRegion(Scene scene) | ||
115 | { | ||
116 | } | ||
117 | |||
118 | public void RemoveRegion(Scene scene) | ||
119 | { | ||
120 | if (BaseScene != null && BaseScene == scene) | ||
121 | { | ||
122 | Close(); | ||
123 | } | ||
124 | } | ||
125 | |||
126 | public void RegionLoaded(Scene scene) | ||
127 | { | ||
128 | if (!Enabled) return; | ||
129 | |||
130 | BaseScene = scene; | ||
131 | |||
132 | Comms = BaseScene.RequestModuleInterface<IScriptModuleComms>(); | ||
133 | if (Comms == null) | ||
134 | { | ||
135 | m_log.WarnFormat("{0} ScriptModuleComms interface not defined", LogHeader); | ||
136 | Enabled = false; | ||
137 | |||
138 | return; | ||
139 | } | ||
140 | |||
141 | // Register as LSL functions all the [ScriptInvocation] marked methods. | ||
142 | Comms.RegisterScriptInvocations(this); | ||
143 | Comms.RegisterConstants(this); | ||
144 | |||
145 | // When an object is modified, we might need to update its extended physics parameters | ||
146 | BaseScene.EventManager.OnObjectAddedToScene += EventManager_OnObjectAddedToScene; | ||
147 | BaseScene.EventManager.OnSceneObjectPartUpdated += EventManager_OnSceneObjectPartUpdated; | ||
148 | |||
149 | } | ||
150 | |||
151 | public Type ReplaceableInterface { get { return null; } } | ||
152 | |||
153 | #endregion // INonSharedRegionModule | ||
154 | |||
155 | private void EventManager_OnObjectAddedToScene(SceneObjectGroup obj) | ||
156 | { | ||
157 | } | ||
158 | |||
159 | // Event generated when some property of a prim changes. | ||
160 | private void EventManager_OnSceneObjectPartUpdated(SceneObjectPart sop, bool isFullUpdate) | ||
161 | { | ||
162 | } | ||
163 | |||
164 | [ScriptConstant] | ||
165 | public const int PHYS_CENTER_OF_MASS = 1 << 0; | ||
166 | |||
167 | [ScriptInvocation] | ||
168 | public string physGetEngineType(UUID hostID, UUID scriptID) | ||
169 | { | ||
170 | string ret = string.Empty; | ||
171 | |||
172 | if (BaseScene.PhysicsScene != null) | ||
173 | { | ||
174 | ret = BaseScene.PhysicsScene.EngineType; | ||
175 | } | ||
176 | |||
177 | return ret; | ||
178 | } | ||
179 | |||
180 | // Code for specifying params. | ||
181 | // The choice if 14700 is arbitrary and only serves to catch parameter code misuse. | ||
182 | [ScriptConstant] | ||
183 | public const int PHYS_AXIS_LOCK_LINEAR = 14700; | ||
184 | [ScriptConstant] | ||
185 | public const int PHYS_AXIS_LOCK_LINEAR_X = 14701; | ||
186 | [ScriptConstant] | ||
187 | public const int PHYS_AXIS_LIMIT_LINEAR_X = 14702; | ||
188 | [ScriptConstant] | ||
189 | public const int PHYS_AXIS_LOCK_LINEAR_Y = 14703; | ||
190 | [ScriptConstant] | ||
191 | public const int PHYS_AXIS_LIMIT_LINEAR_Y = 14704; | ||
192 | [ScriptConstant] | ||
193 | public const int PHYS_AXIS_LOCK_LINEAR_Z = 14705; | ||
194 | [ScriptConstant] | ||
195 | public const int PHYS_AXIS_LIMIT_LINEAR_Z = 14706; | ||
196 | [ScriptConstant] | ||
197 | public const int PHYS_AXIS_LOCK_ANGULAR = 14707; | ||
198 | [ScriptConstant] | ||
199 | public const int PHYS_AXIS_LOCK_ANGULAR_X = 14708; | ||
200 | [ScriptConstant] | ||
201 | public const int PHYS_AXIS_LIMIT_ANGULAR_X = 14709; | ||
202 | [ScriptConstant] | ||
203 | public const int PHYS_AXIS_LOCK_ANGULAR_Y = 14710; | ||
204 | [ScriptConstant] | ||
205 | public const int PHYS_AXIS_LIMIT_ANGULAR_Y = 14711; | ||
206 | [ScriptConstant] | ||
207 | public const int PHYS_AXIS_LOCK_ANGULAR_Z = 14712; | ||
208 | [ScriptConstant] | ||
209 | public const int PHYS_AXIS_LIMIT_ANGULAR_Z = 14713; | ||
210 | [ScriptConstant] | ||
211 | public const int PHYS_AXIS_UNLOCK_LINEAR = 14714; | ||
212 | [ScriptConstant] | ||
213 | public const int PHYS_AXIS_UNLOCK_LINEAR_X = 14715; | ||
214 | [ScriptConstant] | ||
215 | public const int PHYS_AXIS_UNLOCK_LINEAR_Y = 14716; | ||
216 | [ScriptConstant] | ||
217 | public const int PHYS_AXIS_UNLOCK_LINEAR_Z = 14717; | ||
218 | [ScriptConstant] | ||
219 | public const int PHYS_AXIS_UNLOCK_ANGULAR = 14718; | ||
220 | [ScriptConstant] | ||
221 | public const int PHYS_AXIS_UNLOCK_ANGULAR_X = 14719; | ||
222 | [ScriptConstant] | ||
223 | public const int PHYS_AXIS_UNLOCK_ANGULAR_Y = 14720; | ||
224 | [ScriptConstant] | ||
225 | public const int PHYS_AXIS_UNLOCK_ANGULAR_Z = 14721; | ||
226 | [ScriptConstant] | ||
227 | public const int PHYS_AXIS_UNLOCK = 14722; | ||
228 | // physAxisLockLimits() | ||
229 | [ScriptInvocation] | ||
230 | public int physAxisLock(UUID hostID, UUID scriptID, object[] parms) | ||
231 | { | ||
232 | int ret = -1; | ||
233 | if (!Enabled) return ret; | ||
234 | |||
235 | PhysicsActor rootPhysActor; | ||
236 | if (GetRootPhysActor(hostID, out rootPhysActor)) | ||
237 | { | ||
238 | object[] parms2 = AddToBeginningOfArray(rootPhysActor, null, parms); | ||
239 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctAxisLockLimits, parms2)); | ||
240 | } | ||
241 | |||
242 | return ret; | ||
243 | } | ||
244 | |||
245 | [ScriptConstant] | ||
246 | public const int PHYS_LINKSET_TYPE_CONSTRAINT = 0; | ||
247 | [ScriptConstant] | ||
248 | public const int PHYS_LINKSET_TYPE_COMPOUND = 1; | ||
249 | [ScriptConstant] | ||
250 | public const int PHYS_LINKSET_TYPE_MANUAL = 2; | ||
251 | |||
252 | [ScriptInvocation] | ||
253 | public int physSetLinksetType(UUID hostID, UUID scriptID, int linksetType) | ||
254 | { | ||
255 | int ret = -1; | ||
256 | if (!Enabled) return ret; | ||
257 | |||
258 | // The part that is requesting the change. | ||
259 | SceneObjectPart requestingPart = BaseScene.GetSceneObjectPart(hostID); | ||
260 | |||
261 | if (requestingPart != null) | ||
262 | { | ||
263 | // The change is always made to the root of a linkset. | ||
264 | SceneObjectGroup containingGroup = requestingPart.ParentGroup; | ||
265 | SceneObjectPart rootPart = containingGroup.RootPart; | ||
266 | |||
267 | if (rootPart != null) | ||
268 | { | ||
269 | PhysicsActor rootPhysActor = rootPart.PhysActor; | ||
270 | if (rootPhysActor != null) | ||
271 | { | ||
272 | if (rootPhysActor.IsPhysical) | ||
273 | { | ||
274 | // Change a physical linkset by making non-physical, waiting for one heartbeat so all | ||
275 | // the prim and linkset state is updated, changing the type and making the | ||
276 | // linkset physical again. | ||
277 | containingGroup.ScriptSetPhysicsStatus(false); | ||
278 | Thread.Sleep(150); // longer than one heartbeat tick | ||
279 | |||
280 | // A kludge for the moment. | ||
281 | // Since compound linksets move the children but don't generate position updates to the | ||
282 | // simulator, it is possible for compound linkset children to have out-of-sync simulator | ||
283 | // and physical positions. The following causes the simulator to push the real child positions | ||
284 | // down into the physics engine to get everything synced. | ||
285 | containingGroup.UpdateGroupPosition(containingGroup.AbsolutePosition); | ||
286 | containingGroup.UpdateGroupRotationR(containingGroup.GroupRotation); | ||
287 | |||
288 | object[] parms2 = { rootPhysActor, null, linksetType }; | ||
289 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctSetLinksetType, parms2)); | ||
290 | Thread.Sleep(150); // longer than one heartbeat tick | ||
291 | |||
292 | containingGroup.ScriptSetPhysicsStatus(true); | ||
293 | } | ||
294 | else | ||
295 | { | ||
296 | // Non-physical linksets don't have a physical instantiation so there is no state to | ||
297 | // worry about being updated. | ||
298 | object[] parms2 = { rootPhysActor, null, linksetType }; | ||
299 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctSetLinksetType, parms2)); | ||
300 | } | ||
301 | } | ||
302 | else | ||
303 | { | ||
304 | m_log.WarnFormat("{0} physSetLinksetType: root part does not have a physics actor. rootName={1}, hostID={2}", | ||
305 | LogHeader, rootPart.Name, hostID); | ||
306 | } | ||
307 | } | ||
308 | else | ||
309 | { | ||
310 | m_log.WarnFormat("{0} physSetLinksetType: root part does not exist. RequestingPartName={1}, hostID={2}", | ||
311 | LogHeader, requestingPart.Name, hostID); | ||
312 | } | ||
313 | } | ||
314 | else | ||
315 | { | ||
316 | m_log.WarnFormat("{0} physSetLinsetType: cannot find script object in scene. hostID={1}", LogHeader, hostID); | ||
317 | } | ||
318 | return ret; | ||
319 | } | ||
320 | |||
321 | [ScriptInvocation] | ||
322 | public int physGetLinksetType(UUID hostID, UUID scriptID) | ||
323 | { | ||
324 | int ret = -1; | ||
325 | if (!Enabled) return ret; | ||
326 | |||
327 | PhysicsActor rootPhysActor; | ||
328 | if (GetRootPhysActor(hostID, out rootPhysActor)) | ||
329 | { | ||
330 | object[] parms2 = { rootPhysActor, null }; | ||
331 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctGetLinksetType, parms2)); | ||
332 | } | ||
333 | else | ||
334 | { | ||
335 | m_log.WarnFormat("{0} physGetLinsetType: cannot find script object in scene. hostID={1}", LogHeader, hostID); | ||
336 | } | ||
337 | return ret; | ||
338 | } | ||
339 | |||
340 | [ScriptConstant] | ||
341 | public const int PHYS_LINK_TYPE_FIXED = 1234; | ||
342 | [ScriptConstant] | ||
343 | public const int PHYS_LINK_TYPE_HINGE = 4; | ||
344 | [ScriptConstant] | ||
345 | public const int PHYS_LINK_TYPE_SPRING = 9; | ||
346 | [ScriptConstant] | ||
347 | public const int PHYS_LINK_TYPE_6DOF = 6; | ||
348 | [ScriptConstant] | ||
349 | public const int PHYS_LINK_TYPE_SLIDER = 7; | ||
350 | |||
351 | // physChangeLinkType(integer linkNum, integer typeCode) | ||
352 | [ScriptInvocation] | ||
353 | public int physChangeLinkType(UUID hostID, UUID scriptID, int linkNum, int typeCode) | ||
354 | { | ||
355 | int ret = -1; | ||
356 | if (!Enabled) return ret; | ||
357 | |||
358 | PhysicsActor rootPhysActor; | ||
359 | PhysicsActor childPhysActor; | ||
360 | |||
361 | if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor)) | ||
362 | { | ||
363 | object[] parms2 = { rootPhysActor, childPhysActor, typeCode }; | ||
364 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctChangeLinkType, parms2)); | ||
365 | } | ||
366 | |||
367 | return ret; | ||
368 | } | ||
369 | |||
370 | // physGetLinkType(integer linkNum) | ||
371 | [ScriptInvocation] | ||
372 | public int physGetLinkType(UUID hostID, UUID scriptID, int linkNum) | ||
373 | { | ||
374 | int ret = -1; | ||
375 | if (!Enabled) return ret; | ||
376 | |||
377 | PhysicsActor rootPhysActor; | ||
378 | PhysicsActor childPhysActor; | ||
379 | |||
380 | if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor)) | ||
381 | { | ||
382 | object[] parms2 = { rootPhysActor, childPhysActor }; | ||
383 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctGetLinkType, parms2)); | ||
384 | } | ||
385 | |||
386 | return ret; | ||
387 | } | ||
388 | |||
389 | // physChangeLinkFixed(integer linkNum) | ||
390 | // Change the link between the root and the linkNum into a fixed, static physical connection. | ||
391 | [ScriptInvocation] | ||
392 | public int physChangeLinkFixed(UUID hostID, UUID scriptID, int linkNum) | ||
393 | { | ||
394 | int ret = -1; | ||
395 | if (!Enabled) return ret; | ||
396 | |||
397 | PhysicsActor rootPhysActor; | ||
398 | PhysicsActor childPhysActor; | ||
399 | |||
400 | if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor)) | ||
401 | { | ||
402 | object[] parms2 = { rootPhysActor, childPhysActor , PHYS_LINK_TYPE_FIXED }; | ||
403 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctChangeLinkType, parms2)); | ||
404 | } | ||
405 | |||
406 | return ret; | ||
407 | } | ||
408 | |||
409 | // Code for specifying params. | ||
410 | // The choice if 14400 is arbitrary and only serves to catch parameter code misuse. | ||
411 | public const int PHYS_PARAM_MIN = 14401; | ||
412 | |||
413 | [ScriptConstant] | ||
414 | public const int PHYS_PARAM_FRAMEINA_LOC = 14401; | ||
415 | [ScriptConstant] | ||
416 | public const int PHYS_PARAM_FRAMEINA_ROT = 14402; | ||
417 | [ScriptConstant] | ||
418 | public const int PHYS_PARAM_FRAMEINB_LOC = 14403; | ||
419 | [ScriptConstant] | ||
420 | public const int PHYS_PARAM_FRAMEINB_ROT = 14404; | ||
421 | [ScriptConstant] | ||
422 | public const int PHYS_PARAM_LINEAR_LIMIT_LOW = 14405; | ||
423 | [ScriptConstant] | ||
424 | public const int PHYS_PARAM_LINEAR_LIMIT_HIGH = 14406; | ||
425 | [ScriptConstant] | ||
426 | public const int PHYS_PARAM_ANGULAR_LIMIT_LOW = 14407; | ||
427 | [ScriptConstant] | ||
428 | public const int PHYS_PARAM_ANGULAR_LIMIT_HIGH = 14408; | ||
429 | [ScriptConstant] | ||
430 | public const int PHYS_PARAM_USE_FRAME_OFFSET = 14409; | ||
431 | [ScriptConstant] | ||
432 | public const int PHYS_PARAM_ENABLE_TRANSMOTOR = 14410; | ||
433 | [ScriptConstant] | ||
434 | public const int PHYS_PARAM_TRANSMOTOR_MAXVEL = 14411; | ||
435 | [ScriptConstant] | ||
436 | public const int PHYS_PARAM_TRANSMOTOR_MAXFORCE = 14412; | ||
437 | [ScriptConstant] | ||
438 | public const int PHYS_PARAM_CFM = 14413; | ||
439 | [ScriptConstant] | ||
440 | public const int PHYS_PARAM_ERP = 14414; | ||
441 | [ScriptConstant] | ||
442 | public const int PHYS_PARAM_SOLVER_ITERATIONS = 14415; | ||
443 | [ScriptConstant] | ||
444 | public const int PHYS_PARAM_SPRING_AXIS_ENABLE = 14416; | ||
445 | [ScriptConstant] | ||
446 | public const int PHYS_PARAM_SPRING_DAMPING = 14417; | ||
447 | [ScriptConstant] | ||
448 | public const int PHYS_PARAM_SPRING_STIFFNESS = 14418; | ||
449 | [ScriptConstant] | ||
450 | public const int PHYS_PARAM_LINK_TYPE = 14419; | ||
451 | [ScriptConstant] | ||
452 | public const int PHYS_PARAM_USE_LINEAR_FRAMEA = 14420; | ||
453 | [ScriptConstant] | ||
454 | public const int PHYS_PARAM_SPRING_EQUILIBRIUM_POINT = 14421; | ||
455 | |||
456 | public const int PHYS_PARAM_MAX = 14421; | ||
457 | |||
458 | // Used when specifying a parameter that has settings for the three linear and three angular axis | ||
459 | [ScriptConstant] | ||
460 | public const int PHYS_AXIS_ALL = -1; | ||
461 | [ScriptConstant] | ||
462 | public const int PHYS_AXIS_LINEAR_ALL = -2; | ||
463 | [ScriptConstant] | ||
464 | public const int PHYS_AXIS_ANGULAR_ALL = -3; | ||
465 | [ScriptConstant] | ||
466 | public const int PHYS_AXIS_LINEAR_X = 0; | ||
467 | [ScriptConstant] | ||
468 | public const int PHYS_AXIS_LINEAR_Y = 1; | ||
469 | [ScriptConstant] | ||
470 | public const int PHYS_AXIS_LINEAR_Z = 2; | ||
471 | [ScriptConstant] | ||
472 | public const int PHYS_AXIS_ANGULAR_X = 3; | ||
473 | [ScriptConstant] | ||
474 | public const int PHYS_AXIS_ANGULAR_Y = 4; | ||
475 | [ScriptConstant] | ||
476 | public const int PHYS_AXIS_ANGULAR_Z = 5; | ||
477 | |||
478 | // physChangeLinkParams(integer linkNum, [ PHYS_PARAM_*, value, PHYS_PARAM_*, value, ...]) | ||
479 | [ScriptInvocation] | ||
480 | public int physChangeLinkParams(UUID hostID, UUID scriptID, int linkNum, object[] parms) | ||
481 | { | ||
482 | int ret = -1; | ||
483 | if (!Enabled) return ret; | ||
484 | |||
485 | PhysicsActor rootPhysActor; | ||
486 | PhysicsActor childPhysActor; | ||
487 | |||
488 | if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor)) | ||
489 | { | ||
490 | object[] parms2 = AddToBeginningOfArray(rootPhysActor, childPhysActor, parms); | ||
491 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctChangeLinkParams, parms2)); | ||
492 | } | ||
493 | |||
494 | return ret; | ||
495 | } | ||
496 | |||
497 | private bool GetRootPhysActor(UUID hostID, out PhysicsActor rootPhysActor) | ||
498 | { | ||
499 | SceneObjectGroup containingGroup; | ||
500 | SceneObjectPart rootPart; | ||
501 | return GetRootPhysActor(hostID, out containingGroup, out rootPart, out rootPhysActor); | ||
502 | } | ||
503 | |||
504 | private bool GetRootPhysActor(UUID hostID, out SceneObjectGroup containingGroup, out SceneObjectPart rootPart, out PhysicsActor rootPhysActor) | ||
505 | { | ||
506 | bool ret = false; | ||
507 | rootPhysActor = null; | ||
508 | containingGroup = null; | ||
509 | rootPart = null; | ||
510 | |||
511 | SceneObjectPart requestingPart; | ||
512 | |||
513 | requestingPart = BaseScene.GetSceneObjectPart(hostID); | ||
514 | if (requestingPart != null) | ||
515 | { | ||
516 | // The type is is always on the root of a linkset. | ||
517 | containingGroup = requestingPart.ParentGroup; | ||
518 | if (containingGroup != null && !containingGroup.IsDeleted) | ||
519 | { | ||
520 | rootPart = containingGroup.RootPart; | ||
521 | if (rootPart != null) | ||
522 | { | ||
523 | rootPhysActor = rootPart.PhysActor; | ||
524 | if (rootPhysActor != null) | ||
525 | { | ||
526 | ret = true; | ||
527 | } | ||
528 | else | ||
529 | { | ||
530 | m_log.WarnFormat("{0} GetRootAndChildPhysActors: Root part does not have a physics actor. rootName={1}, hostID={2}", | ||
531 | LogHeader, rootPart.Name, hostID); | ||
532 | } | ||
533 | } | ||
534 | else | ||
535 | { | ||
536 | m_log.WarnFormat("{0} GetRootAndChildPhysActors: Root part does not exist. RequestingPartName={1}, hostID={2}", | ||
537 | LogHeader, requestingPart.Name, hostID); | ||
538 | } | ||
539 | } | ||
540 | else | ||
541 | { | ||
542 | m_log.WarnFormat("{0} GetRootAndChildPhysActors: Containing group missing or deleted. hostID={1}", LogHeader, hostID); | ||
543 | } | ||
544 | } | ||
545 | else | ||
546 | { | ||
547 | m_log.WarnFormat("{0} GetRootAndChildPhysActors: cannot find script object in scene. hostID={1}", LogHeader, hostID); | ||
548 | } | ||
549 | |||
550 | return ret; | ||
551 | } | ||
552 | |||
553 | // Find the root and child PhysActors based on the linkNum. | ||
554 | // Return 'true' if both are found and returned. | ||
555 | private bool GetRootAndChildPhysActors(UUID hostID, int linkNum, out PhysicsActor rootPhysActor, out PhysicsActor childPhysActor) | ||
556 | { | ||
557 | bool ret = false; | ||
558 | rootPhysActor = null; | ||
559 | childPhysActor = null; | ||
560 | |||
561 | SceneObjectGroup containingGroup; | ||
562 | SceneObjectPart rootPart; | ||
563 | |||
564 | if (GetRootPhysActor(hostID, out containingGroup, out rootPart, out rootPhysActor)) | ||
565 | { | ||
566 | SceneObjectPart linkPart = containingGroup.GetLinkNumPart(linkNum); | ||
567 | if (linkPart != null) | ||
568 | { | ||
569 | childPhysActor = linkPart.PhysActor; | ||
570 | if (childPhysActor != null) | ||
571 | { | ||
572 | ret = true; | ||
573 | } | ||
574 | else | ||
575 | { | ||
576 | m_log.WarnFormat("{0} GetRootAndChildPhysActors: Link part has no physical actor. rootName={1}, hostID={2}, linknum={3}", | ||
577 | LogHeader, rootPart.Name, hostID, linkNum); | ||
578 | } | ||
579 | } | ||
580 | else | ||
581 | { | ||
582 | m_log.WarnFormat("{0} GetRootAndChildPhysActors: Could not find linknum part. rootName={1}, hostID={2}, linknum={3}", | ||
583 | LogHeader, rootPart.Name, hostID, linkNum); | ||
584 | } | ||
585 | } | ||
586 | else | ||
587 | { | ||
588 | m_log.WarnFormat("{0} GetRootAndChildPhysActors: Root part does not have a physics actor. rootName={1}, hostID={2}", | ||
589 | LogHeader, rootPart.Name, hostID); | ||
590 | } | ||
591 | |||
592 | return ret; | ||
593 | } | ||
594 | |||
595 | // Return an array of objects with the passed object as the first object of a new array | ||
596 | private object[] AddToBeginningOfArray(object firstOne, object secondOne, object[] prevArray) | ||
597 | { | ||
598 | object[] newArray = new object[2 + prevArray.Length]; | ||
599 | newArray[0] = firstOne; | ||
600 | newArray[1] = secondOne; | ||
601 | prevArray.CopyTo(newArray, 2); | ||
602 | return newArray; | ||
603 | } | ||
604 | |||
605 | // Extension() returns an object. Convert that object into the integer error we expect to return. | ||
606 | private int MakeIntError(object extensionRet) | ||
607 | { | ||
608 | int ret = -1; | ||
609 | if (extensionRet != null) | ||
610 | { | ||
611 | try | ||
612 | { | ||
613 | ret = (int)extensionRet; | ||
614 | } | ||
615 | catch | ||
616 | { | ||
617 | ret = -1; | ||
618 | } | ||
619 | } | ||
620 | return ret; | ||
621 | } | ||
622 | } | ||
623 | } | ||
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index 5ed1514..47b9c09 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs | |||
@@ -34,7 +34,7 @@ using OpenSim.Framework; | |||
34 | using OpenSim.Region.Framework.Interfaces; | 34 | using OpenSim.Region.Framework.Interfaces; |
35 | using OpenSim.Region.Framework.Scenes; | 35 | using OpenSim.Region.Framework.Scenes; |
36 | using OpenSim.Region.OptionalModules.Scripting.Minimodule.Object; | 36 | using OpenSim.Region.OptionalModules.Scripting.Minimodule.Object; |
37 | using OpenSim.Region.Physics.Manager; | 37 | using OpenSim.Region.PhysicsModules.SharedBase; |
38 | using PrimType=OpenSim.Region.OptionalModules.Scripting.Minimodule.Object.PrimType; | 38 | using PrimType=OpenSim.Region.OptionalModules.Scripting.Minimodule.Object.PrimType; |
39 | using SculptType=OpenSim.Region.OptionalModules.Scripting.Minimodule.Object.SculptType; | 39 | using SculptType=OpenSim.Region.OptionalModules.Scripting.Minimodule.Object.SculptType; |
40 | 40 | ||
diff --git a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs index 97133c0..4b7295d 100644 --- a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs | |||
@@ -35,7 +35,6 @@ using OpenMetaverse; | |||
35 | using Mono.Addins; | 35 | using Mono.Addins; |
36 | 36 | ||
37 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Communications; | ||
39 | using OpenSim.Framework.Servers; | 38 | using OpenSim.Framework.Servers; |
40 | using OpenSim.Framework.Servers.HttpServer; | 39 | using OpenSim.Framework.Servers.HttpServer; |
41 | using OpenSim.Framework.Client; | 40 | using OpenSim.Framework.Client; |
diff --git a/OpenSim/Region/UserStatistics/ActiveConnectionsAJAX.cs b/OpenSim/Region/OptionalModules/UserStatistics/ActiveConnectionsAJAX.cs index 6a1112c..6a1112c 100644 --- a/OpenSim/Region/UserStatistics/ActiveConnectionsAJAX.cs +++ b/OpenSim/Region/OptionalModules/UserStatistics/ActiveConnectionsAJAX.cs | |||
diff --git a/OpenSim/Region/UserStatistics/Clients_report.cs b/OpenSim/Region/OptionalModules/UserStatistics/Clients_report.cs index 4a6f7be..4a6f7be 100644 --- a/OpenSim/Region/UserStatistics/Clients_report.cs +++ b/OpenSim/Region/OptionalModules/UserStatistics/Clients_report.cs | |||
diff --git a/OpenSim/Region/UserStatistics/Default_Report.cs b/OpenSim/Region/OptionalModules/UserStatistics/Default_Report.cs index fabe3d4..fabe3d4 100644 --- a/OpenSim/Region/UserStatistics/Default_Report.cs +++ b/OpenSim/Region/OptionalModules/UserStatistics/Default_Report.cs | |||
diff --git a/OpenSim/Region/UserStatistics/HTMLUtil.cs b/OpenSim/Region/OptionalModules/UserStatistics/HTMLUtil.cs index c07619f..c07619f 100644 --- a/OpenSim/Region/UserStatistics/HTMLUtil.cs +++ b/OpenSim/Region/OptionalModules/UserStatistics/HTMLUtil.cs | |||
diff --git a/OpenSim/Region/UserStatistics/IStatsReport.cs b/OpenSim/Region/OptionalModules/UserStatistics/IStatsReport.cs index 80c4487..80c4487 100644 --- a/OpenSim/Region/UserStatistics/IStatsReport.cs +++ b/OpenSim/Region/OptionalModules/UserStatistics/IStatsReport.cs | |||
diff --git a/OpenSim/Region/UserStatistics/LogLinesAJAX.cs b/OpenSim/Region/OptionalModules/UserStatistics/LogLinesAJAX.cs index 4d45b80..4d45b80 100644 --- a/OpenSim/Region/UserStatistics/LogLinesAJAX.cs +++ b/OpenSim/Region/OptionalModules/UserStatistics/LogLinesAJAX.cs | |||
diff --git a/OpenSim/Region/UserStatistics/Prototype_distributor.cs b/OpenSim/Region/OptionalModules/UserStatistics/Prototype_distributor.cs index 6f8b2aa..6f8b2aa 100644 --- a/OpenSim/Region/UserStatistics/Prototype_distributor.cs +++ b/OpenSim/Region/OptionalModules/UserStatistics/Prototype_distributor.cs | |||
diff --git a/OpenSim/Region/UserStatistics/Sessions_Report.cs b/OpenSim/Region/OptionalModules/UserStatistics/Sessions_Report.cs index 0e94912..0e94912 100644 --- a/OpenSim/Region/UserStatistics/Sessions_Report.cs +++ b/OpenSim/Region/OptionalModules/UserStatistics/Sessions_Report.cs | |||
diff --git a/OpenSim/Region/UserStatistics/SimStatsAJAX.cs b/OpenSim/Region/OptionalModules/UserStatistics/SimStatsAJAX.cs index 06d9e91..06d9e91 100644 --- a/OpenSim/Region/UserStatistics/SimStatsAJAX.cs +++ b/OpenSim/Region/OptionalModules/UserStatistics/SimStatsAJAX.cs | |||
diff --git a/OpenSim/Region/UserStatistics/Updater_distributor.cs b/OpenSim/Region/OptionalModules/UserStatistics/Updater_distributor.cs index 601e06b..601e06b 100644 --- a/OpenSim/Region/UserStatistics/Updater_distributor.cs +++ b/OpenSim/Region/OptionalModules/UserStatistics/Updater_distributor.cs | |||
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs index 8ccb751..bd5289f 100644 --- a/OpenSim/Region/UserStatistics/WebStatsModule.cs +++ b/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs | |||
@@ -50,9 +50,6 @@ using Caps = OpenSim.Framework.Capabilities.Caps; | |||
50 | using OSD = OpenMetaverse.StructuredData.OSD; | 50 | using OSD = OpenMetaverse.StructuredData.OSD; |
51 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; | 51 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; |
52 | 52 | ||
53 | [assembly: Addin("WebStats", OpenSim.VersionInfo.VersionNumber)] | ||
54 | [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] | ||
55 | |||
56 | namespace OpenSim.Region.UserStatistics | 53 | namespace OpenSim.Region.UserStatistics |
57 | { | 54 | { |
58 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "WebStatsModule")] | 55 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "WebStatsModule")] |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs index 2345e38..a892cf4 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs | |||
@@ -33,7 +33,6 @@ using Nini.Config; | |||
33 | using NUnit.Framework; | 33 | using NUnit.Framework; |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Communications; | ||
37 | using OpenSim.Region.CoreModules.Avatar.Attachments; | 36 | using OpenSim.Region.CoreModules.Avatar.Attachments; |
38 | using OpenSim.Region.CoreModules.Avatar.AvatarFactory; | 37 | using OpenSim.Region.CoreModules.Avatar.AvatarFactory; |
39 | using OpenSim.Region.CoreModules.Framework.InventoryAccess; | 38 | using OpenSim.Region.CoreModules.Framework.InventoryAccess; |
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs deleted file mode 100644 index 373c7e0..0000000 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using Nini.Config; | ||
31 | using OpenSim.Framework; | ||
32 | using OpenSim.Region.Physics.Manager; | ||
33 | |||
34 | namespace OpenSim.Region.Physics.BasicPhysicsPlugin | ||
35 | { | ||
36 | /// <summary> | ||
37 | /// Effectively a physics plugin that simulates no physics at all. | ||
38 | /// </summary> | ||
39 | public class BasicPhysicsPlugin : IPhysicsPlugin | ||
40 | { | ||
41 | public BasicPhysicsPlugin() | ||
42 | { | ||
43 | } | ||
44 | |||
45 | public bool Init() | ||
46 | { | ||
47 | return true; | ||
48 | } | ||
49 | |||
50 | public PhysicsScene GetScene(string sceneIdentifier) | ||
51 | { | ||
52 | return new BasicScene(GetName(), sceneIdentifier); | ||
53 | } | ||
54 | |||
55 | public string GetName() | ||
56 | { | ||
57 | return ("basicphysics"); | ||
58 | } | ||
59 | |||
60 | public void Dispose() | ||
61 | { | ||
62 | } | ||
63 | } | ||
64 | } | ||
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPlugin.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPlugin.cs deleted file mode 100644 index 9442854..0000000 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPlugin.cs +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyrightD | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | using System; | ||
28 | using System.Collections.Generic; | ||
29 | using OpenSim.Framework; | ||
30 | using OpenSim.Region.Physics.Manager; | ||
31 | using OpenMetaverse; | ||
32 | |||
33 | namespace OpenSim.Region.Physics.BulletSPlugin | ||
34 | { | ||
35 | /// <summary> | ||
36 | /// Entry for a port of Bullet (http://bulletphysics.org/) to OpenSim. | ||
37 | /// This module interfaces to an unmanaged C++ library which makes the | ||
38 | /// actual calls into the Bullet physics engine. | ||
39 | /// The unmanaged library is found in opensim-libs::trunk/unmanaged/BulletSim/. | ||
40 | /// The unmanaged library is compiled and linked statically with Bullet | ||
41 | /// to create BulletSim.dll and libBulletSim.so (for both 32 and 64 bit). | ||
42 | /// </summary> | ||
43 | public class BSPlugin : IPhysicsPlugin | ||
44 | { | ||
45 | //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
46 | |||
47 | private BSScene _mScene; | ||
48 | |||
49 | public BSPlugin() | ||
50 | { | ||
51 | } | ||
52 | |||
53 | public bool Init() | ||
54 | { | ||
55 | return true; | ||
56 | } | ||
57 | |||
58 | public PhysicsScene GetScene(String sceneIdentifier) | ||
59 | { | ||
60 | if (_mScene == null) | ||
61 | { | ||
62 | _mScene = new BSScene(GetName(), sceneIdentifier); | ||
63 | } | ||
64 | return (_mScene); | ||
65 | } | ||
66 | |||
67 | public string GetName() | ||
68 | { | ||
69 | return ("BulletSim"); | ||
70 | } | ||
71 | |||
72 | public void Dispose() | ||
73 | { | ||
74 | } | ||
75 | } | ||
76 | } | ||
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs deleted file mode 100644 index 0bace14..0000000 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ /dev/null | |||
@@ -1,1283 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyrightD | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | using System; | ||
28 | using System.Collections.Generic; | ||
29 | using System.Linq; | ||
30 | using System.Reflection; | ||
31 | using System.Runtime.InteropServices; | ||
32 | using System.Text; | ||
33 | using System.Threading; | ||
34 | using OpenSim.Framework; | ||
35 | using OpenSim.Framework.Monitoring; | ||
36 | using OpenSim.Region.Framework; | ||
37 | using OpenSim.Region.CoreModules; | ||
38 | using Logging = OpenSim.Region.CoreModules.Framework.Statistics.Logging; | ||
39 | using OpenSim.Region.Physics.Manager; | ||
40 | using Nini.Config; | ||
41 | using log4net; | ||
42 | using OpenMetaverse; | ||
43 | |||
44 | namespace OpenSim.Region.Physics.BulletSPlugin | ||
45 | { | ||
46 | public sealed class BSScene : PhysicsScene, IPhysicsParameters | ||
47 | { | ||
48 | internal static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
49 | internal static readonly string LogHeader = "[BULLETS SCENE]"; | ||
50 | |||
51 | // The name of the region we're working for. | ||
52 | public string RegionName { get; private set; } | ||
53 | |||
54 | public string BulletSimVersion = "?"; | ||
55 | |||
56 | // The handle to the underlying managed or unmanaged version of Bullet being used. | ||
57 | public string BulletEngineName { get; private set; } | ||
58 | public BSAPITemplate PE; | ||
59 | |||
60 | // If the physics engine is running on a separate thread | ||
61 | public Thread m_physicsThread; | ||
62 | |||
63 | public Dictionary<uint, BSPhysObject> PhysObjects; | ||
64 | public BSShapeCollection Shapes; | ||
65 | |||
66 | // Keeping track of the objects with collisions so we can report begin and end of a collision | ||
67 | public HashSet<BSPhysObject> ObjectsWithCollisions = new HashSet<BSPhysObject>(); | ||
68 | public HashSet<BSPhysObject> ObjectsWithNoMoreCollisions = new HashSet<BSPhysObject>(); | ||
69 | |||
70 | // All the collision processing is protected with this lock object | ||
71 | public Object CollisionLock = new Object(); | ||
72 | |||
73 | // Properties are updated here | ||
74 | public Object UpdateLock = new Object(); | ||
75 | public HashSet<BSPhysObject> ObjectsWithUpdates = new HashSet<BSPhysObject>(); | ||
76 | |||
77 | // Keep track of all the avatars so we can send them a collision event | ||
78 | // every tick so OpenSim will update its animation. | ||
79 | private HashSet<BSPhysObject> AvatarsInScene = new HashSet<BSPhysObject>(); | ||
80 | private Object AvatarsInSceneLock = new Object(); | ||
81 | |||
82 | // let my minuions use my logger | ||
83 | public ILog Logger { get { return m_log; } } | ||
84 | |||
85 | public IMesher mesher; | ||
86 | public uint WorldID { get; private set; } | ||
87 | public BulletWorld World { get; private set; } | ||
88 | |||
89 | // All the constraints that have been allocated in this instance. | ||
90 | public BSConstraintCollection Constraints { get; private set; } | ||
91 | |||
92 | // Simulation parameters | ||
93 | //internal float m_physicsStepTime; // if running independently, the interval simulated by default | ||
94 | |||
95 | internal int m_maxSubSteps; | ||
96 | internal float m_fixedTimeStep; | ||
97 | |||
98 | internal float m_simulatedTime; // the time simulated previously. Used for physics framerate calc. | ||
99 | |||
100 | internal long m_simulationStep = 0; // The current simulation step. | ||
101 | public long SimulationStep { get { return m_simulationStep; } } | ||
102 | // A number to use for SimulationStep that is probably not any step value | ||
103 | // Used by the collision code (which remembers the step when a collision happens) to remember not any simulation step. | ||
104 | public static long NotASimulationStep = -1234; | ||
105 | |||
106 | internal float LastTimeStep { get; private set; } // The simulation time from the last invocation of Simulate() | ||
107 | |||
108 | internal float NominalFrameRate { get; set; } // Parameterized ideal frame rate that simulation is scaled to | ||
109 | |||
110 | // Physical objects can register for prestep or poststep events | ||
111 | public delegate void PreStepAction(float timeStep); | ||
112 | public delegate void PostStepAction(float timeStep); | ||
113 | public event PreStepAction BeforeStep; | ||
114 | public event PostStepAction AfterStep; | ||
115 | |||
116 | // A value of the time 'now' so all the collision and update routines do not have to get their own | ||
117 | // Set to 'now' just before all the prims and actors are called for collisions and updates | ||
118 | public int SimulationNowTime { get; private set; } | ||
119 | |||
120 | // True if initialized and ready to do simulation steps | ||
121 | private bool m_initialized = false; | ||
122 | |||
123 | // Flag which is true when processing taints. | ||
124 | // Not guaranteed to be correct all the time (don't depend on this) but good for debugging. | ||
125 | public bool InTaintTime { get; private set; } | ||
126 | |||
127 | // Pinned memory used to pass step information between managed and unmanaged | ||
128 | internal int m_maxCollisionsPerFrame; | ||
129 | internal CollisionDesc[] m_collisionArray; | ||
130 | |||
131 | internal int m_maxUpdatesPerFrame; | ||
132 | internal EntityProperties[] m_updateArray; | ||
133 | |||
134 | /// <summary> | ||
135 | /// Used to control physics simulation timing if Bullet is running on its own thread. | ||
136 | /// </summary> | ||
137 | private ManualResetEvent m_updateWaitEvent; | ||
138 | |||
139 | public const uint TERRAIN_ID = 0; // OpenSim senses terrain with a localID of zero | ||
140 | public const uint GROUNDPLANE_ID = 1; | ||
141 | public const uint CHILDTERRAIN_ID = 2; // Terrain allocated based on our mega-prim childre start here | ||
142 | |||
143 | public float SimpleWaterLevel { get; set; } | ||
144 | public BSTerrainManager TerrainManager { get; private set; } | ||
145 | |||
146 | public ConfigurationParameters Params | ||
147 | { | ||
148 | get { return UnmanagedParams[0]; } | ||
149 | } | ||
150 | public Vector3 DefaultGravity | ||
151 | { | ||
152 | get { return new Vector3(0f, 0f, Params.gravity); } | ||
153 | } | ||
154 | // Just the Z value of the gravity | ||
155 | public float DefaultGravityZ | ||
156 | { | ||
157 | get { return Params.gravity; } | ||
158 | } | ||
159 | |||
160 | // When functions in the unmanaged code must be called, it is only | ||
161 | // done at a known time just before the simulation step. The taint | ||
162 | // system saves all these function calls and executes them in | ||
163 | // order before the simulation. | ||
164 | public delegate void TaintCallback(); | ||
165 | private struct TaintCallbackEntry | ||
166 | { | ||
167 | public String originator; | ||
168 | public String ident; | ||
169 | public TaintCallback callback; | ||
170 | public TaintCallbackEntry(string pIdent, TaintCallback pCallBack) | ||
171 | { | ||
172 | originator = BSScene.DetailLogZero; | ||
173 | ident = pIdent; | ||
174 | callback = pCallBack; | ||
175 | } | ||
176 | public TaintCallbackEntry(string pOrigin, string pIdent, TaintCallback pCallBack) | ||
177 | { | ||
178 | originator = pOrigin; | ||
179 | ident = pIdent; | ||
180 | callback = pCallBack; | ||
181 | } | ||
182 | } | ||
183 | private Object _taintLock = new Object(); // lock for using the next object | ||
184 | private List<TaintCallbackEntry> _taintOperations; | ||
185 | private Dictionary<string, TaintCallbackEntry> _postTaintOperations; | ||
186 | private List<TaintCallbackEntry> _postStepOperations; | ||
187 | |||
188 | // A pointer to an instance if this structure is passed to the C++ code | ||
189 | // Used to pass basic configuration values to the unmanaged code. | ||
190 | internal ConfigurationParameters[] UnmanagedParams; | ||
191 | |||
192 | // Sometimes you just have to log everything. | ||
193 | public Logging.LogWriter PhysicsLogging; | ||
194 | private bool m_physicsLoggingEnabled; | ||
195 | private string m_physicsLoggingDir; | ||
196 | private string m_physicsLoggingPrefix; | ||
197 | private int m_physicsLoggingFileMinutes; | ||
198 | private bool m_physicsLoggingDoFlush; | ||
199 | private bool m_physicsPhysicalDumpEnabled; | ||
200 | public int PhysicsMetricDumpFrames { get; set; } | ||
201 | // 'true' of the vehicle code is to log lots of details | ||
202 | public bool VehicleLoggingEnabled { get; private set; } | ||
203 | public bool VehiclePhysicalLoggingEnabled { get; private set; } | ||
204 | |||
205 | #region Construction and Initialization | ||
206 | public BSScene(string engineType, string identifier) | ||
207 | { | ||
208 | m_initialized = false; | ||
209 | |||
210 | // The name of the region we're working for is passed to us. Keep for identification. | ||
211 | RegionName = identifier; | ||
212 | |||
213 | // Set identifying variables in the PhysicsScene interface. | ||
214 | EngineType = engineType; | ||
215 | Name = EngineType + "/" + RegionName; | ||
216 | } | ||
217 | |||
218 | // Old version of initialization that assumes legacy sized regions (256x256) | ||
219 | public override void Initialise(IMesher meshmerizer, IConfigSource config) | ||
220 | { | ||
221 | m_log.ErrorFormat("{0} WARNING WARNING WARNING! BulletSim initialized without region extent specification. Terrain will be messed up."); | ||
222 | Vector3 regionExtent = new Vector3( Constants.RegionSize, Constants.RegionSize, Constants.RegionSize); | ||
223 | Initialise(meshmerizer, config, regionExtent); | ||
224 | |||
225 | } | ||
226 | |||
227 | public override void Initialise(IMesher meshmerizer, IConfigSource config, Vector3 regionExtent) | ||
228 | { | ||
229 | mesher = meshmerizer; | ||
230 | _taintOperations = new List<TaintCallbackEntry>(); | ||
231 | _postTaintOperations = new Dictionary<string, TaintCallbackEntry>(); | ||
232 | _postStepOperations = new List<TaintCallbackEntry>(); | ||
233 | PhysObjects = new Dictionary<uint, BSPhysObject>(); | ||
234 | Shapes = new BSShapeCollection(this); | ||
235 | |||
236 | m_simulatedTime = 0f; | ||
237 | LastTimeStep = 0.1f; | ||
238 | |||
239 | // Allocate pinned memory to pass parameters. | ||
240 | UnmanagedParams = new ConfigurationParameters[1]; | ||
241 | |||
242 | // Set default values for physics parameters plus any overrides from the ini file | ||
243 | GetInitialParameterValues(config); | ||
244 | |||
245 | // Force some parameters to values depending on other configurations | ||
246 | // Only use heightmap terrain implementation if terrain larger than legacy size | ||
247 | if ((uint)regionExtent.X > Constants.RegionSize || (uint)regionExtent.Y > Constants.RegionSize) | ||
248 | { | ||
249 | m_log.WarnFormat("{0} Forcing terrain implementation to heightmap for large region", LogHeader); | ||
250 | BSParam.TerrainImplementation = (float)BSTerrainPhys.TerrainImplementation.Heightmap; | ||
251 | } | ||
252 | |||
253 | // Get the connection to the physics engine (could be native or one of many DLLs) | ||
254 | PE = SelectUnderlyingBulletEngine(BulletEngineName); | ||
255 | |||
256 | // Enable very detailed logging. | ||
257 | // By creating an empty logger when not logging, the log message invocation code | ||
258 | // can be left in and every call doesn't have to check for null. | ||
259 | if (m_physicsLoggingEnabled) | ||
260 | { | ||
261 | PhysicsLogging = new Logging.LogWriter(m_physicsLoggingDir, m_physicsLoggingPrefix, m_physicsLoggingFileMinutes, m_physicsLoggingDoFlush); | ||
262 | PhysicsLogging.ErrorLogger = m_log; // for DEBUG. Let's the logger output its own error messages. | ||
263 | } | ||
264 | else | ||
265 | { | ||
266 | PhysicsLogging = new Logging.LogWriter(); | ||
267 | } | ||
268 | |||
269 | // Allocate memory for returning of the updates and collisions from the physics engine | ||
270 | m_collisionArray = new CollisionDesc[m_maxCollisionsPerFrame]; | ||
271 | m_updateArray = new EntityProperties[m_maxUpdatesPerFrame]; | ||
272 | |||
273 | // The bounding box for the simulated world. The origin is 0,0,0 unless we're | ||
274 | // a child in a mega-region. | ||
275 | // Bullet actually doesn't care about the extents of the simulated | ||
276 | // area. It tracks active objects no matter where they are. | ||
277 | Vector3 worldExtent = regionExtent; | ||
278 | |||
279 | World = PE.Initialize(worldExtent, Params, m_maxCollisionsPerFrame, ref m_collisionArray, m_maxUpdatesPerFrame, ref m_updateArray); | ||
280 | |||
281 | Constraints = new BSConstraintCollection(World); | ||
282 | |||
283 | TerrainManager = new BSTerrainManager(this, worldExtent); | ||
284 | TerrainManager.CreateInitialGroundPlaneAndTerrain(); | ||
285 | |||
286 | // Put some informational messages into the log file. | ||
287 | m_log.InfoFormat("{0} Linksets implemented with {1}", LogHeader, (BSLinkset.LinksetImplementation)BSParam.LinksetImplementation); | ||
288 | |||
289 | InTaintTime = false; | ||
290 | m_initialized = true; | ||
291 | |||
292 | // If the physics engine runs on its own thread, start same. | ||
293 | if (BSParam.UseSeparatePhysicsThread) | ||
294 | { | ||
295 | // The physics simulation should happen independently of the heartbeat loop | ||
296 | m_physicsThread | ||
297 | = WorkManager.StartThread( | ||
298 | BulletSPluginPhysicsThread, | ||
299 | string.Format("{0} ({1})", BulletEngineName, RegionName), | ||
300 | ThreadPriority.Normal, | ||
301 | true, | ||
302 | true); | ||
303 | } | ||
304 | } | ||
305 | |||
306 | // All default parameter values are set here. There should be no values set in the | ||
307 | // variable definitions. | ||
308 | private void GetInitialParameterValues(IConfigSource config) | ||
309 | { | ||
310 | ConfigurationParameters parms = new ConfigurationParameters(); | ||
311 | UnmanagedParams[0] = parms; | ||
312 | |||
313 | BSParam.SetParameterDefaultValues(this); | ||
314 | |||
315 | if (config != null) | ||
316 | { | ||
317 | // If there are specifications in the ini file, use those values | ||
318 | IConfig pConfig = config.Configs["BulletSim"]; | ||
319 | if (pConfig != null) | ||
320 | { | ||
321 | BSParam.SetParameterConfigurationValues(this, pConfig); | ||
322 | |||
323 | // There are two Bullet implementations to choose from | ||
324 | BulletEngineName = pConfig.GetString("BulletEngine", "BulletUnmanaged"); | ||
325 | |||
326 | // Very detailed logging for physics debugging | ||
327 | // TODO: the boolean values can be moved to the normal parameter processing. | ||
328 | m_physicsLoggingEnabled = pConfig.GetBoolean("PhysicsLoggingEnabled", false); | ||
329 | m_physicsLoggingDir = pConfig.GetString("PhysicsLoggingDir", "."); | ||
330 | m_physicsLoggingPrefix = pConfig.GetString("PhysicsLoggingPrefix", "physics-%REGIONNAME%-"); | ||
331 | m_physicsLoggingFileMinutes = pConfig.GetInt("PhysicsLoggingFileMinutes", 5); | ||
332 | m_physicsLoggingDoFlush = pConfig.GetBoolean("PhysicsLoggingDoFlush", false); | ||
333 | m_physicsPhysicalDumpEnabled = pConfig.GetBoolean("PhysicsPhysicalDumpEnabled", false); | ||
334 | // Very detailed logging for vehicle debugging | ||
335 | VehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false); | ||
336 | VehiclePhysicalLoggingEnabled = pConfig.GetBoolean("VehiclePhysicalLoggingEnabled", false); | ||
337 | |||
338 | // Do any replacements in the parameters | ||
339 | m_physicsLoggingPrefix = m_physicsLoggingPrefix.Replace("%REGIONNAME%", RegionName); | ||
340 | } | ||
341 | else | ||
342 | { | ||
343 | // Nothing in the configuration INI file so assume unmanaged and other defaults. | ||
344 | BulletEngineName = "BulletUnmanaged"; | ||
345 | m_physicsLoggingEnabled = false; | ||
346 | VehicleLoggingEnabled = false; | ||
347 | } | ||
348 | |||
349 | // The material characteristics. | ||
350 | BSMaterials.InitializeFromDefaults(Params); | ||
351 | if (pConfig != null) | ||
352 | { | ||
353 | // Let the user add new and interesting material property values. | ||
354 | BSMaterials.InitializefromParameters(pConfig); | ||
355 | } | ||
356 | } | ||
357 | } | ||
358 | |||
359 | // A helper function that handles a true/false parameter and returns the proper float number encoding | ||
360 | float ParamBoolean(IConfig config, string parmName, float deflt) | ||
361 | { | ||
362 | float ret = deflt; | ||
363 | if (config.Contains(parmName)) | ||
364 | { | ||
365 | ret = ConfigurationParameters.numericFalse; | ||
366 | if (config.GetBoolean(parmName, false)) | ||
367 | { | ||
368 | ret = ConfigurationParameters.numericTrue; | ||
369 | } | ||
370 | } | ||
371 | return ret; | ||
372 | } | ||
373 | |||
374 | // Select the connection to the actual Bullet implementation. | ||
375 | // The main engine selection is the engineName up to the first hypen. | ||
376 | // So "Bullet-2.80-OpenCL-Intel" specifies the 'bullet' class here and the whole name | ||
377 | // is passed to the engine to do its special selection, etc. | ||
378 | private BSAPITemplate SelectUnderlyingBulletEngine(string engineName) | ||
379 | { | ||
380 | // For the moment, do a simple switch statement. | ||
381 | // Someday do fancyness with looking up the interfaces in the assembly. | ||
382 | BSAPITemplate ret = null; | ||
383 | |||
384 | string selectionName = engineName.ToLower(); | ||
385 | int hyphenIndex = engineName.IndexOf("-"); | ||
386 | if (hyphenIndex > 0) | ||
387 | selectionName = engineName.ToLower().Substring(0, hyphenIndex - 1); | ||
388 | |||
389 | switch (selectionName) | ||
390 | { | ||
391 | case "bullet": | ||
392 | case "bulletunmanaged": | ||
393 | ret = new BSAPIUnman(engineName, this); | ||
394 | break; | ||
395 | case "bulletxna": | ||
396 | ret = new BSAPIXNA(engineName, this); | ||
397 | // Disable some features that are not implemented in BulletXNA | ||
398 | m_log.InfoFormat("{0} Disabling some physics features not implemented by BulletXNA", LogHeader); | ||
399 | m_log.InfoFormat("{0} Disabling ShouldUseBulletHACD", LogHeader); | ||
400 | BSParam.ShouldUseBulletHACD = false; | ||
401 | m_log.InfoFormat("{0} Disabling ShouldUseSingleConvexHullForPrims", LogHeader); | ||
402 | BSParam.ShouldUseSingleConvexHullForPrims = false; | ||
403 | m_log.InfoFormat("{0} Disabling ShouldUseGImpactShapeForPrims", LogHeader); | ||
404 | BSParam.ShouldUseGImpactShapeForPrims = false; | ||
405 | m_log.InfoFormat("{0} Setting terrain implimentation to Heightmap", LogHeader); | ||
406 | BSParam.TerrainImplementation = (float)BSTerrainPhys.TerrainImplementation.Heightmap; | ||
407 | break; | ||
408 | } | ||
409 | |||
410 | if (ret == null) | ||
411 | { | ||
412 | m_log.ErrorFormat("{0} COULD NOT SELECT BULLET ENGINE: '[BulletSim]PhysicsEngine' must be either 'BulletUnmanaged-*' or 'BulletXNA-*'", LogHeader); | ||
413 | } | ||
414 | else | ||
415 | { | ||
416 | m_log.InfoFormat("{0} Selected bullet engine {1} -> {2}/{3}", LogHeader, engineName, ret.BulletEngineName, ret.BulletEngineVersion); | ||
417 | } | ||
418 | |||
419 | return ret; | ||
420 | } | ||
421 | |||
422 | public override void Dispose() | ||
423 | { | ||
424 | // m_log.DebugFormat("{0}: Dispose()", LogHeader); | ||
425 | |||
426 | // make sure no stepping happens while we're deleting stuff | ||
427 | m_initialized = false; | ||
428 | |||
429 | lock (PhysObjects) | ||
430 | { | ||
431 | foreach (KeyValuePair<uint, BSPhysObject> kvp in PhysObjects) | ||
432 | { | ||
433 | kvp.Value.Destroy(); | ||
434 | } | ||
435 | PhysObjects.Clear(); | ||
436 | } | ||
437 | |||
438 | // Now that the prims are all cleaned up, there should be no constraints left | ||
439 | if (Constraints != null) | ||
440 | { | ||
441 | Constraints.Dispose(); | ||
442 | Constraints = null; | ||
443 | } | ||
444 | |||
445 | if (Shapes != null) | ||
446 | { | ||
447 | Shapes.Dispose(); | ||
448 | Shapes = null; | ||
449 | } | ||
450 | |||
451 | if (TerrainManager != null) | ||
452 | { | ||
453 | TerrainManager.ReleaseGroundPlaneAndTerrain(); | ||
454 | TerrainManager.Dispose(); | ||
455 | TerrainManager = null; | ||
456 | } | ||
457 | |||
458 | // Anything left in the unmanaged code should be cleaned out | ||
459 | PE.Shutdown(World); | ||
460 | |||
461 | // Not logging any more | ||
462 | PhysicsLogging.Close(); | ||
463 | } | ||
464 | #endregion // Construction and Initialization | ||
465 | |||
466 | #region Prim and Avatar addition and removal | ||
467 | |||
468 | public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 velocity, Vector3 size, bool isFlying) | ||
469 | { | ||
470 | m_log.ErrorFormat("{0}: CALL TO AddAvatar in BSScene. NOT IMPLEMENTED", LogHeader); | ||
471 | return null; | ||
472 | } | ||
473 | |||
474 | public override PhysicsActor AddAvatar(uint localID, string avName, Vector3 position, Vector3 velocity, Vector3 size, bool isFlying) | ||
475 | { | ||
476 | // m_log.DebugFormat("{0}: AddAvatar: {1}", LogHeader, avName); | ||
477 | |||
478 | if (!m_initialized) return null; | ||
479 | |||
480 | BSCharacter actor = new BSCharacter(localID, avName, this, position, velocity, size, isFlying); | ||
481 | lock (PhysObjects) | ||
482 | PhysObjects.Add(localID, actor); | ||
483 | |||
484 | // TODO: Remove kludge someday. | ||
485 | // We must generate a collision for avatars whether they collide or not. | ||
486 | // This is required by OpenSim to update avatar animations, etc. | ||
487 | lock (AvatarsInSceneLock) | ||
488 | AvatarsInScene.Add(actor); | ||
489 | |||
490 | return actor; | ||
491 | } | ||
492 | |||
493 | public override void RemoveAvatar(PhysicsActor actor) | ||
494 | { | ||
495 | // m_log.DebugFormat("{0}: RemoveAvatar", LogHeader); | ||
496 | |||
497 | if (!m_initialized) return; | ||
498 | |||
499 | BSCharacter bsactor = actor as BSCharacter; | ||
500 | if (bsactor != null) | ||
501 | { | ||
502 | try | ||
503 | { | ||
504 | lock (PhysObjects) | ||
505 | PhysObjects.Remove(bsactor.LocalID); | ||
506 | // Remove kludge someday | ||
507 | lock (AvatarsInSceneLock) | ||
508 | AvatarsInScene.Remove(bsactor); | ||
509 | } | ||
510 | catch (Exception e) | ||
511 | { | ||
512 | m_log.WarnFormat("{0}: Attempt to remove avatar that is not in physics scene: {1}", LogHeader, e); | ||
513 | } | ||
514 | bsactor.Destroy(); | ||
515 | // bsactor.dispose(); | ||
516 | } | ||
517 | else | ||
518 | { | ||
519 | m_log.ErrorFormat("{0}: Requested to remove avatar that is not a BSCharacter. ID={1}, type={2}", | ||
520 | LogHeader, actor.LocalID, actor.GetType().Name); | ||
521 | } | ||
522 | } | ||
523 | |||
524 | public override void RemovePrim(PhysicsActor prim) | ||
525 | { | ||
526 | if (!m_initialized) return; | ||
527 | |||
528 | BSPhysObject bsprim = prim as BSPhysObject; | ||
529 | if (bsprim != null) | ||
530 | { | ||
531 | DetailLog("{0},RemovePrim,call", bsprim.LocalID); | ||
532 | // m_log.DebugFormat("{0}: RemovePrim. id={1}/{2}", LogHeader, bsprim.Name, bsprim.LocalID); | ||
533 | try | ||
534 | { | ||
535 | lock (PhysObjects) PhysObjects.Remove(bsprim.LocalID); | ||
536 | } | ||
537 | catch (Exception e) | ||
538 | { | ||
539 | m_log.ErrorFormat("{0}: Attempt to remove prim that is not in physics scene: {1}", LogHeader, e); | ||
540 | } | ||
541 | bsprim.Destroy(); | ||
542 | // bsprim.dispose(); | ||
543 | } | ||
544 | else | ||
545 | { | ||
546 | m_log.ErrorFormat("{0}: Attempt to remove prim that is not a BSPrim type.", LogHeader); | ||
547 | } | ||
548 | } | ||
549 | |||
550 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
551 | Vector3 size, Quaternion rotation, bool isPhysical, uint localID) | ||
552 | { | ||
553 | // m_log.DebugFormat("{0}: AddPrimShape2: {1}", LogHeader, primName); | ||
554 | |||
555 | if (!m_initialized) return null; | ||
556 | |||
557 | // DetailLog("{0},BSScene.AddPrimShape,call", localID); | ||
558 | |||
559 | BSPhysObject prim = new BSPrimLinkable(localID, primName, this, position, size, rotation, pbs, isPhysical); | ||
560 | lock (PhysObjects) PhysObjects.Add(localID, prim); | ||
561 | return prim; | ||
562 | } | ||
563 | |||
564 | // This is a call from the simulator saying that some physical property has been updated. | ||
565 | // The BulletSim driver senses the changing of relevant properties so this taint | ||
566 | // information call is not needed. | ||
567 | public override void AddPhysicsActorTaint(PhysicsActor prim) { } | ||
568 | |||
569 | #endregion // Prim and Avatar addition and removal | ||
570 | |||
571 | #region Simulation | ||
572 | |||
573 | // Call from the simulator to send physics information to the simulator objects. | ||
574 | // This pushes all the collision and property update events into the objects in | ||
575 | // the simulator and, since it is on the heartbeat thread, there is an implicit | ||
576 | // locking of those data structures from other heartbeat events. | ||
577 | // If the physics engine is running on a separate thread, the update information | ||
578 | // will be in the ObjectsWithCollions and ObjectsWithUpdates structures. | ||
579 | public override float Simulate(float timeStep) | ||
580 | { | ||
581 | if (!BSParam.UseSeparatePhysicsThread) | ||
582 | { | ||
583 | DoPhysicsStep(timeStep); | ||
584 | } | ||
585 | return SendUpdatesToSimulator(timeStep); | ||
586 | } | ||
587 | |||
588 | // Call the physics engine to do one 'timeStep' and collect collisions and updates | ||
589 | // into ObjectsWithCollisions and ObjectsWithUpdates data structures. | ||
590 | private void DoPhysicsStep(float timeStep) | ||
591 | { | ||
592 | // prevent simulation until we've been initialized | ||
593 | if (!m_initialized) return; | ||
594 | |||
595 | LastTimeStep = timeStep; | ||
596 | |||
597 | int updatedEntityCount = 0; | ||
598 | int collidersCount = 0; | ||
599 | |||
600 | int beforeTime = Util.EnvironmentTickCount(); | ||
601 | int simTime = 0; | ||
602 | |||
603 | int numTaints = _taintOperations.Count; | ||
604 | InTaintTime = true; // Only used for debugging so locking is not necessary. | ||
605 | |||
606 | // update the prim states while we know the physics engine is not busy | ||
607 | ProcessTaints(); | ||
608 | |||
609 | // Some of the physical objects requre individual, pre-step calls | ||
610 | // (vehicles and avatar movement, in particular) | ||
611 | TriggerPreStepEvent(timeStep); | ||
612 | |||
613 | // the prestep actions might have added taints | ||
614 | numTaints += _taintOperations.Count; | ||
615 | ProcessTaints(); | ||
616 | |||
617 | InTaintTime = false; // Only used for debugging so locking is not necessary. | ||
618 | |||
619 | // The following causes the unmanaged code to output ALL the values found in ALL the objects in the world. | ||
620 | // Only enable this in a limited test world with few objects. | ||
621 | if (m_physicsPhysicalDumpEnabled) | ||
622 | PE.DumpAllInfo(World); | ||
623 | |||
624 | // step the physical world one interval | ||
625 | m_simulationStep++; | ||
626 | int numSubSteps = 0; | ||
627 | try | ||
628 | { | ||
629 | numSubSteps = PE.PhysicsStep(World, timeStep, m_maxSubSteps, m_fixedTimeStep, out updatedEntityCount, out collidersCount); | ||
630 | |||
631 | } | ||
632 | catch (Exception e) | ||
633 | { | ||
634 | m_log.WarnFormat("{0},PhysicsStep Exception: nTaints={1}, substeps={2}, updates={3}, colliders={4}, e={5}", | ||
635 | LogHeader, numTaints, numSubSteps, updatedEntityCount, collidersCount, e); | ||
636 | DetailLog("{0},PhysicsStepException,call, nTaints={1}, substeps={2}, updates={3}, colliders={4}", | ||
637 | DetailLogZero, numTaints, numSubSteps, updatedEntityCount, collidersCount); | ||
638 | updatedEntityCount = 0; | ||
639 | collidersCount = 0; | ||
640 | } | ||
641 | |||
642 | // Make the physics engine dump useful statistics periodically | ||
643 | if (PhysicsMetricDumpFrames != 0 && ((m_simulationStep % PhysicsMetricDumpFrames) == 0)) | ||
644 | PE.DumpPhysicsStatistics(World); | ||
645 | |||
646 | // Get a value for 'now' so all the collision and update routines don't have to get their own. | ||
647 | SimulationNowTime = Util.EnvironmentTickCount(); | ||
648 | |||
649 | // Send collision information to the colliding objects. The objects decide if the collision | ||
650 | // is 'real' (like linksets don't collide with themselves) and the individual objects | ||
651 | // know if the simulator has subscribed to collisions. | ||
652 | lock (CollisionLock) | ||
653 | { | ||
654 | if (collidersCount > 0) | ||
655 | { | ||
656 | lock (PhysObjects) | ||
657 | { | ||
658 | for (int ii = 0; ii < collidersCount; ii++) | ||
659 | { | ||
660 | uint cA = m_collisionArray[ii].aID; | ||
661 | uint cB = m_collisionArray[ii].bID; | ||
662 | Vector3 point = m_collisionArray[ii].point; | ||
663 | Vector3 normal = m_collisionArray[ii].normal; | ||
664 | float penetration = m_collisionArray[ii].penetration; | ||
665 | SendCollision(cA, cB, point, normal, penetration); | ||
666 | SendCollision(cB, cA, point, -normal, penetration); | ||
667 | } | ||
668 | } | ||
669 | } | ||
670 | } | ||
671 | |||
672 | // If any of the objects had updated properties, tell the managed objects about the update | ||
673 | // and remember that there was a change so it will be passed to the simulator. | ||
674 | lock (UpdateLock) | ||
675 | { | ||
676 | if (updatedEntityCount > 0) | ||
677 | { | ||
678 | lock (PhysObjects) | ||
679 | { | ||
680 | for (int ii = 0; ii < updatedEntityCount; ii++) | ||
681 | { | ||
682 | EntityProperties entprop = m_updateArray[ii]; | ||
683 | BSPhysObject pobj; | ||
684 | if (PhysObjects.TryGetValue(entprop.ID, out pobj)) | ||
685 | { | ||
686 | if (pobj.IsInitialized) | ||
687 | pobj.UpdateProperties(entprop); | ||
688 | } | ||
689 | } | ||
690 | } | ||
691 | } | ||
692 | } | ||
693 | |||
694 | // Some actors want to know when the simulation step is complete. | ||
695 | TriggerPostStepEvent(timeStep); | ||
696 | |||
697 | simTime = Util.EnvironmentTickCountSubtract(beforeTime); | ||
698 | if (PhysicsLogging.Enabled) | ||
699 | { | ||
700 | DetailLog("{0},DoPhysicsStep,complete,frame={1}, nTaints={2}, simTime={3}, substeps={4}, updates={5}, colliders={6}, objWColl={7}", | ||
701 | DetailLogZero, m_simulationStep, numTaints, simTime, numSubSteps, | ||
702 | updatedEntityCount, collidersCount, ObjectsWithCollisions.Count); | ||
703 | } | ||
704 | |||
705 | // The following causes the unmanaged code to output ALL the values found in ALL the objects in the world. | ||
706 | // Only enable this in a limited test world with few objects. | ||
707 | if (m_physicsPhysicalDumpEnabled) | ||
708 | PE.DumpAllInfo(World); | ||
709 | |||
710 | // The physics engine returns the number of milliseconds it simulated this call. | ||
711 | // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS. | ||
712 | // Multiply by a fixed nominal frame rate to give a rate similar to the simulator (usually 55). | ||
713 | // m_simulatedTime += (float)numSubSteps * m_fixedTimeStep * 1000f * NominalFrameRate; | ||
714 | m_simulatedTime += (float)numSubSteps * m_fixedTimeStep; | ||
715 | } | ||
716 | |||
717 | // Called by a BSPhysObject to note that it has changed properties and this information | ||
718 | // should be passed up to the simulator at the proper time. | ||
719 | // Note: this is called by the BSPhysObject from invocation via DoPhysicsStep() above so | ||
720 | // this is is under UpdateLock. | ||
721 | public void PostUpdate(BSPhysObject updatee) | ||
722 | { | ||
723 | lock (UpdateLock) | ||
724 | { | ||
725 | ObjectsWithUpdates.Add(updatee); | ||
726 | } | ||
727 | } | ||
728 | |||
729 | // The simulator thinks it is physics time so return all the collisions and position | ||
730 | // updates that were collected in actual physics simulation. | ||
731 | private float SendUpdatesToSimulator(float timeStep) | ||
732 | { | ||
733 | if (!m_initialized) return 5.0f; | ||
734 | |||
735 | DetailLog("{0},SendUpdatesToSimulator,collisions={1},updates={2},simedTime={3}", | ||
736 | BSScene.DetailLogZero, ObjectsWithCollisions.Count, ObjectsWithUpdates.Count, m_simulatedTime); | ||
737 | // Push the collisions into the simulator. | ||
738 | lock (CollisionLock) | ||
739 | { | ||
740 | if (ObjectsWithCollisions.Count > 0) | ||
741 | { | ||
742 | foreach (BSPhysObject bsp in ObjectsWithCollisions) | ||
743 | if (!bsp.SendCollisions()) | ||
744 | { | ||
745 | // If the object is done colliding, see that it's removed from the colliding list | ||
746 | ObjectsWithNoMoreCollisions.Add(bsp); | ||
747 | } | ||
748 | } | ||
749 | |||
750 | // This is a kludge to get avatar movement updates. | ||
751 | // The simulator expects collisions for avatars even if there are have been no collisions. | ||
752 | // The event updates avatar animations and stuff. | ||
753 | // If you fix avatar animation updates, remove this overhead and let normal collision processing happen. | ||
754 | // Note that we get a copy of the list to search because SendCollision() can take a while. | ||
755 | HashSet<BSPhysObject> tempAvatarsInScene; | ||
756 | lock (AvatarsInSceneLock) | ||
757 | { | ||
758 | tempAvatarsInScene = new HashSet<BSPhysObject>(AvatarsInScene); | ||
759 | } | ||
760 | foreach (BSPhysObject actor in tempAvatarsInScene) | ||
761 | { | ||
762 | if (!ObjectsWithCollisions.Contains(actor)) // don't call avatars twice | ||
763 | actor.SendCollisions(); | ||
764 | } | ||
765 | tempAvatarsInScene = null; | ||
766 | |||
767 | // Objects that are done colliding are removed from the ObjectsWithCollisions list. | ||
768 | // Not done above because it is inside an iteration of ObjectWithCollisions. | ||
769 | // This complex collision processing is required to create an empty collision | ||
770 | // event call after all real collisions have happened on an object. This allows | ||
771 | // the simulator to generate the 'collision end' event. | ||
772 | if (ObjectsWithNoMoreCollisions.Count > 0) | ||
773 | { | ||
774 | foreach (BSPhysObject po in ObjectsWithNoMoreCollisions) | ||
775 | ObjectsWithCollisions.Remove(po); | ||
776 | ObjectsWithNoMoreCollisions.Clear(); | ||
777 | } | ||
778 | } | ||
779 | |||
780 | // Call the simulator for each object that has physics property updates. | ||
781 | HashSet<BSPhysObject> updatedObjects = null; | ||
782 | lock (UpdateLock) | ||
783 | { | ||
784 | if (ObjectsWithUpdates.Count > 0) | ||
785 | { | ||
786 | updatedObjects = ObjectsWithUpdates; | ||
787 | ObjectsWithUpdates = new HashSet<BSPhysObject>(); | ||
788 | } | ||
789 | } | ||
790 | if (updatedObjects != null) | ||
791 | { | ||
792 | foreach (BSPhysObject obj in updatedObjects) | ||
793 | { | ||
794 | obj.RequestPhysicsterseUpdate(); | ||
795 | } | ||
796 | updatedObjects.Clear(); | ||
797 | } | ||
798 | |||
799 | // Return the framerate simulated to give the above returned results. | ||
800 | // (Race condition here but this is just bookkeeping so rare mistakes do not merit a lock). | ||
801 | // undo math above | ||
802 | float simTime = m_simulatedTime / timeStep; | ||
803 | m_simulatedTime = 0f; | ||
804 | return simTime; | ||
805 | } | ||
806 | |||
807 | // Something has collided | ||
808 | private void SendCollision(uint localID, uint collidingWith, Vector3 collidePoint, Vector3 collideNormal, float penetration) | ||
809 | { | ||
810 | if (localID <= TerrainManager.HighestTerrainID) | ||
811 | { | ||
812 | return; // don't send collisions to the terrain | ||
813 | } | ||
814 | |||
815 | BSPhysObject collider; | ||
816 | // NOTE that PhysObjects was locked before the call to SendCollision(). | ||
817 | if (!PhysObjects.TryGetValue(localID, out collider)) | ||
818 | { | ||
819 | // If the object that is colliding cannot be found, just ignore the collision. | ||
820 | DetailLog("{0},BSScene.SendCollision,colliderNotInObjectList,id={1},with={2}", DetailLogZero, localID, collidingWith); | ||
821 | return; | ||
822 | } | ||
823 | |||
824 | // Note: the terrain is not in the physical object list so 'collidee' can be null when Collide() is called. | ||
825 | BSPhysObject collidee = null; | ||
826 | PhysObjects.TryGetValue(collidingWith, out collidee); | ||
827 | |||
828 | // DetailLog("{0},BSScene.SendCollision,collide,id={1},with={2}", DetailLogZero, localID, collidingWith); | ||
829 | |||
830 | if (collider.IsInitialized) | ||
831 | { | ||
832 | if (collider.Collide(collidingWith, collidee, collidePoint, collideNormal, penetration)) | ||
833 | { | ||
834 | // If a collision was 'good', remember to send it to the simulator | ||
835 | lock (CollisionLock) | ||
836 | { | ||
837 | ObjectsWithCollisions.Add(collider); | ||
838 | } | ||
839 | } | ||
840 | } | ||
841 | |||
842 | return; | ||
843 | } | ||
844 | |||
845 | public void BulletSPluginPhysicsThread() | ||
846 | { | ||
847 | Thread.CurrentThread.Priority = ThreadPriority.Highest; | ||
848 | m_updateWaitEvent = new ManualResetEvent(false); | ||
849 | |||
850 | while (m_initialized) | ||
851 | { | ||
852 | int beginSimulationRealtimeMS = Util.EnvironmentTickCount(); | ||
853 | |||
854 | if (BSParam.Active) | ||
855 | DoPhysicsStep(BSParam.PhysicsTimeStep); | ||
856 | |||
857 | int simulationRealtimeMS = Util.EnvironmentTickCountSubtract(beginSimulationRealtimeMS); | ||
858 | int simulationTimeVsRealtimeDifferenceMS = ((int)(BSParam.PhysicsTimeStep*1000f)) - simulationRealtimeMS; | ||
859 | |||
860 | if (simulationTimeVsRealtimeDifferenceMS > 0) | ||
861 | { | ||
862 | // The simulation of the time interval took less than realtime. | ||
863 | // Do a wait for the rest of realtime. | ||
864 | m_updateWaitEvent.WaitOne(simulationTimeVsRealtimeDifferenceMS); | ||
865 | //Thread.Sleep(simulationTimeVsRealtimeDifferenceMS); | ||
866 | } | ||
867 | else | ||
868 | { | ||
869 | // The simulation took longer than realtime. | ||
870 | // Do some scaling of simulation time. | ||
871 | // TODO. | ||
872 | DetailLog("{0},BulletSPluginPhysicsThread,longerThanRealtime={1}", BSScene.DetailLogZero, simulationTimeVsRealtimeDifferenceMS); | ||
873 | } | ||
874 | |||
875 | Watchdog.UpdateThread(); | ||
876 | } | ||
877 | |||
878 | Watchdog.RemoveThread(); | ||
879 | } | ||
880 | |||
881 | #endregion // Simulation | ||
882 | |||
883 | public override void GetResults() { } | ||
884 | |||
885 | #region Terrain | ||
886 | |||
887 | public override void SetTerrain(float[] heightMap) { | ||
888 | TerrainManager.SetTerrain(heightMap); | ||
889 | } | ||
890 | |||
891 | public override void SetWaterLevel(float baseheight) | ||
892 | { | ||
893 | SimpleWaterLevel = baseheight; | ||
894 | } | ||
895 | |||
896 | public override void DeleteTerrain() | ||
897 | { | ||
898 | // m_log.DebugFormat("{0}: DeleteTerrain()", LogHeader); | ||
899 | } | ||
900 | |||
901 | // Although no one seems to check this, I do support combining. | ||
902 | public override bool SupportsCombining() | ||
903 | { | ||
904 | return TerrainManager.SupportsCombining(); | ||
905 | } | ||
906 | // This call says I am a child to region zero in a mega-region. 'pScene' is that | ||
907 | // of region zero, 'offset' is my offset from regions zero's origin, and | ||
908 | // 'extents' is the largest XY that is handled in my region. | ||
909 | public override void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) | ||
910 | { | ||
911 | TerrainManager.Combine(pScene, offset, extents); | ||
912 | } | ||
913 | |||
914 | // Unhook all the combining that I know about. | ||
915 | public override void UnCombine(PhysicsScene pScene) | ||
916 | { | ||
917 | TerrainManager.UnCombine(pScene); | ||
918 | } | ||
919 | |||
920 | #endregion // Terrain | ||
921 | |||
922 | public override Dictionary<uint, float> GetTopColliders() | ||
923 | { | ||
924 | Dictionary<uint, float> topColliders; | ||
925 | |||
926 | lock (PhysObjects) | ||
927 | { | ||
928 | foreach (KeyValuePair<uint, BSPhysObject> kvp in PhysObjects) | ||
929 | { | ||
930 | kvp.Value.ComputeCollisionScore(); | ||
931 | } | ||
932 | |||
933 | List<BSPhysObject> orderedPrims = new List<BSPhysObject>(PhysObjects.Values); | ||
934 | orderedPrims.OrderByDescending(p => p.CollisionScore); | ||
935 | topColliders = orderedPrims.Take(25).ToDictionary(p => p.LocalID, p => p.CollisionScore); | ||
936 | } | ||
937 | |||
938 | return topColliders; | ||
939 | } | ||
940 | |||
941 | public override bool IsThreaded { get { return false; } } | ||
942 | |||
943 | #region Extensions | ||
944 | public override object Extension(string pFunct, params object[] pParams) | ||
945 | { | ||
946 | DetailLog("{0} BSScene.Extension,op={1}", DetailLogZero, pFunct); | ||
947 | return base.Extension(pFunct, pParams); | ||
948 | } | ||
949 | #endregion // Extensions | ||
950 | |||
951 | public static string PrimitiveBaseShapeToString(PrimitiveBaseShape pbs) | ||
952 | { | ||
953 | float pathShearX = pbs.PathShearX < 128 ? (float)pbs.PathShearX * 0.01f : (float)(pbs.PathShearX - 256) * 0.01f; | ||
954 | float pathShearY = pbs.PathShearY < 128 ? (float)pbs.PathShearY * 0.01f : (float)(pbs.PathShearY - 256) * 0.01f; | ||
955 | float pathBegin = (float)pbs.PathBegin * 2.0e-5f; | ||
956 | float pathEnd = 1.0f - (float)pbs.PathEnd * 2.0e-5f; | ||
957 | float pathScaleX = (float)(200 - pbs.PathScaleX) * 0.01f; | ||
958 | float pathScaleY = (float)(200 - pbs.PathScaleY) * 0.01f; | ||
959 | float pathTaperX = pbs.PathTaperX * 0.01f; | ||
960 | float pathTaperY = pbs.PathTaperY * 0.01f; | ||
961 | |||
962 | float profileBegin = (float)pbs.ProfileBegin * 2.0e-5f; | ||
963 | float profileEnd = 1.0f - (float)pbs.ProfileEnd * 2.0e-5f; | ||
964 | float profileHollow = (float)pbs.ProfileHollow * 2.0e-5f; | ||
965 | if (profileHollow > 0.95f) | ||
966 | profileHollow = 0.95f; | ||
967 | |||
968 | StringBuilder buff = new StringBuilder(); | ||
969 | buff.Append("shape="); | ||
970 | buff.Append(((ProfileShape)pbs.ProfileShape).ToString()); | ||
971 | buff.Append(","); | ||
972 | buff.Append("hollow="); | ||
973 | buff.Append(((HollowShape)pbs.HollowShape).ToString()); | ||
974 | buff.Append(","); | ||
975 | buff.Append("pathCurve="); | ||
976 | buff.Append(((Extrusion)pbs.PathCurve).ToString()); | ||
977 | buff.Append(","); | ||
978 | buff.Append("profCurve="); | ||
979 | buff.Append(((Extrusion)pbs.ProfileCurve).ToString()); | ||
980 | buff.Append(","); | ||
981 | buff.Append("profHollow="); | ||
982 | buff.Append(profileHollow.ToString()); | ||
983 | buff.Append(","); | ||
984 | buff.Append("pathBegEnd="); | ||
985 | buff.Append(pathBegin.ToString()); | ||
986 | buff.Append("/"); | ||
987 | buff.Append(pathEnd.ToString()); | ||
988 | buff.Append(","); | ||
989 | buff.Append("profileBegEnd="); | ||
990 | buff.Append(profileBegin.ToString()); | ||
991 | buff.Append("/"); | ||
992 | buff.Append(profileEnd.ToString()); | ||
993 | buff.Append(","); | ||
994 | buff.Append("scaleXY="); | ||
995 | buff.Append(pathScaleX.ToString()); | ||
996 | buff.Append("/"); | ||
997 | buff.Append(pathScaleY.ToString()); | ||
998 | buff.Append(","); | ||
999 | buff.Append("shearXY="); | ||
1000 | buff.Append(pathShearX.ToString()); | ||
1001 | buff.Append("/"); | ||
1002 | buff.Append(pathShearY.ToString()); | ||
1003 | buff.Append(","); | ||
1004 | buff.Append("taperXY="); | ||
1005 | buff.Append(pbs.PathTaperX.ToString()); | ||
1006 | buff.Append("/"); | ||
1007 | buff.Append(pbs.PathTaperY.ToString()); | ||
1008 | buff.Append(","); | ||
1009 | buff.Append("skew="); | ||
1010 | buff.Append(pbs.PathSkew.ToString()); | ||
1011 | buff.Append(","); | ||
1012 | buff.Append("twist/Beg="); | ||
1013 | buff.Append(pbs.PathTwist.ToString()); | ||
1014 | buff.Append("/"); | ||
1015 | buff.Append(pbs.PathTwistBegin.ToString()); | ||
1016 | |||
1017 | return buff.ToString(); | ||
1018 | } | ||
1019 | |||
1020 | #region Taints | ||
1021 | // The simulation execution order is: | ||
1022 | // Simulate() | ||
1023 | // DoOneTimeTaints | ||
1024 | // TriggerPreStepEvent | ||
1025 | // DoOneTimeTaints | ||
1026 | // Step() | ||
1027 | // ProcessAndSendToSimulatorCollisions | ||
1028 | // ProcessAndSendToSimulatorPropertyUpdates | ||
1029 | // TriggerPostStepEvent | ||
1030 | |||
1031 | // Calls to the PhysicsActors can't directly call into the physics engine | ||
1032 | // because it might be busy. We delay changes to a known time. | ||
1033 | // We rely on C#'s closure to save and restore the context for the delegate. | ||
1034 | public void TaintedObject(string pOriginator, string pIdent, TaintCallback pCallback) | ||
1035 | { | ||
1036 | TaintedObject(false /*inTaintTime*/, pOriginator, pIdent, pCallback); | ||
1037 | } | ||
1038 | public void TaintedObject(uint pOriginator, String pIdent, TaintCallback pCallback) | ||
1039 | { | ||
1040 | TaintedObject(false /*inTaintTime*/, m_physicsLoggingEnabled ? pOriginator.ToString() : BSScene.DetailLogZero, pIdent, pCallback); | ||
1041 | } | ||
1042 | public void TaintedObject(bool inTaintTime, String pIdent, TaintCallback pCallback) | ||
1043 | { | ||
1044 | TaintedObject(inTaintTime, BSScene.DetailLogZero, pIdent, pCallback); | ||
1045 | } | ||
1046 | public void TaintedObject(bool inTaintTime, uint pOriginator, String pIdent, TaintCallback pCallback) | ||
1047 | { | ||
1048 | TaintedObject(inTaintTime, m_physicsLoggingEnabled ? pOriginator.ToString() : BSScene.DetailLogZero, pIdent, pCallback); | ||
1049 | } | ||
1050 | // Sometimes a potentially tainted operation can be used in and out of taint time. | ||
1051 | // This routine executes the command immediately if in taint-time otherwise it is queued. | ||
1052 | public void TaintedObject(bool inTaintTime, string pOriginator, string pIdent, TaintCallback pCallback) | ||
1053 | { | ||
1054 | if (!m_initialized) return; | ||
1055 | |||
1056 | if (inTaintTime) | ||
1057 | pCallback(); | ||
1058 | else | ||
1059 | { | ||
1060 | lock (_taintLock) | ||
1061 | { | ||
1062 | _taintOperations.Add(new TaintCallbackEntry(pOriginator, pIdent, pCallback)); | ||
1063 | } | ||
1064 | } | ||
1065 | } | ||
1066 | |||
1067 | private void TriggerPreStepEvent(float timeStep) | ||
1068 | { | ||
1069 | PreStepAction actions = BeforeStep; | ||
1070 | if (actions != null) | ||
1071 | actions(timeStep); | ||
1072 | |||
1073 | } | ||
1074 | |||
1075 | private void TriggerPostStepEvent(float timeStep) | ||
1076 | { | ||
1077 | PostStepAction actions = AfterStep; | ||
1078 | if (actions != null) | ||
1079 | actions(timeStep); | ||
1080 | |||
1081 | } | ||
1082 | |||
1083 | // When someone tries to change a property on a BSPrim or BSCharacter, the object queues | ||
1084 | // a callback into itself to do the actual property change. That callback is called | ||
1085 | // here just before the physics engine is called to step the simulation. | ||
1086 | public void ProcessTaints() | ||
1087 | { | ||
1088 | ProcessRegularTaints(); | ||
1089 | ProcessPostTaintTaints(); | ||
1090 | } | ||
1091 | |||
1092 | private void ProcessRegularTaints() | ||
1093 | { | ||
1094 | if (m_initialized && _taintOperations.Count > 0) // save allocating new list if there is nothing to process | ||
1095 | { | ||
1096 | // swizzle a new list into the list location so we can process what's there | ||
1097 | List<TaintCallbackEntry> oldList; | ||
1098 | lock (_taintLock) | ||
1099 | { | ||
1100 | oldList = _taintOperations; | ||
1101 | _taintOperations = new List<TaintCallbackEntry>(); | ||
1102 | } | ||
1103 | |||
1104 | foreach (TaintCallbackEntry tcbe in oldList) | ||
1105 | { | ||
1106 | try | ||
1107 | { | ||
1108 | DetailLog("{0},BSScene.ProcessTaints,doTaint,id={1}", tcbe.originator, tcbe.ident); // DEBUG DEBUG DEBUG | ||
1109 | tcbe.callback(); | ||
1110 | } | ||
1111 | catch (Exception e) | ||
1112 | { | ||
1113 | m_log.ErrorFormat("{0}: ProcessTaints: {1}: Exception: {2}", LogHeader, tcbe.ident, e); | ||
1114 | } | ||
1115 | } | ||
1116 | oldList.Clear(); | ||
1117 | } | ||
1118 | } | ||
1119 | |||
1120 | // Schedule an update to happen after all the regular taints are processed. | ||
1121 | // Note that new requests for the same operation ("ident") for the same object ("ID") | ||
1122 | // will replace any previous operation by the same object. | ||
1123 | public void PostTaintObject(String ident, uint ID, TaintCallback callback) | ||
1124 | { | ||
1125 | string IDAsString = ID.ToString(); | ||
1126 | string uniqueIdent = ident + "-" + IDAsString; | ||
1127 | lock (_taintLock) | ||
1128 | { | ||
1129 | _postTaintOperations[uniqueIdent] = new TaintCallbackEntry(IDAsString, uniqueIdent, callback); | ||
1130 | } | ||
1131 | |||
1132 | return; | ||
1133 | } | ||
1134 | |||
1135 | // Taints that happen after the normal taint processing but before the simulation step. | ||
1136 | private void ProcessPostTaintTaints() | ||
1137 | { | ||
1138 | if (m_initialized && _postTaintOperations.Count > 0) | ||
1139 | { | ||
1140 | Dictionary<string, TaintCallbackEntry> oldList; | ||
1141 | lock (_taintLock) | ||
1142 | { | ||
1143 | oldList = _postTaintOperations; | ||
1144 | _postTaintOperations = new Dictionary<string, TaintCallbackEntry>(); | ||
1145 | } | ||
1146 | |||
1147 | foreach (KeyValuePair<string,TaintCallbackEntry> kvp in oldList) | ||
1148 | { | ||
1149 | try | ||
1150 | { | ||
1151 | DetailLog("{0},BSScene.ProcessPostTaintTaints,doTaint,id={1}", DetailLogZero, kvp.Key); // DEBUG DEBUG DEBUG | ||
1152 | kvp.Value.callback(); | ||
1153 | } | ||
1154 | catch (Exception e) | ||
1155 | { | ||
1156 | m_log.ErrorFormat("{0}: ProcessPostTaintTaints: {1}: Exception: {2}", LogHeader, kvp.Key, e); | ||
1157 | } | ||
1158 | } | ||
1159 | oldList.Clear(); | ||
1160 | } | ||
1161 | } | ||
1162 | |||
1163 | // Only used for debugging. Does not change state of anything so locking is not necessary. | ||
1164 | public bool AssertInTaintTime(string whereFrom) | ||
1165 | { | ||
1166 | if (!InTaintTime) | ||
1167 | { | ||
1168 | DetailLog("{0},BSScene.AssertInTaintTime,NOT IN TAINT TIME,Region={1},Where={2}", DetailLogZero, RegionName, whereFrom); | ||
1169 | m_log.ErrorFormat("{0} NOT IN TAINT TIME!! Region={1}, Where={2}", LogHeader, RegionName, whereFrom); | ||
1170 | // Util.PrintCallStack(DetailLog); | ||
1171 | } | ||
1172 | return InTaintTime; | ||
1173 | } | ||
1174 | |||
1175 | #endregion // Taints | ||
1176 | |||
1177 | #region IPhysicsParameters | ||
1178 | // Get the list of parameters this physics engine supports | ||
1179 | public PhysParameterEntry[] GetParameterList() | ||
1180 | { | ||
1181 | BSParam.BuildParameterTable(); | ||
1182 | return BSParam.SettableParameters; | ||
1183 | } | ||
1184 | |||
1185 | // Set parameter on a specific or all instances. | ||
1186 | // Return 'false' if not able to set the parameter. | ||
1187 | // Setting the value in the m_params block will change the value the physics engine | ||
1188 | // will use the next time since it's pinned and shared memory. | ||
1189 | // Some of the values require calling into the physics engine to get the new | ||
1190 | // value activated ('terrainFriction' for instance). | ||
1191 | public bool SetPhysicsParameter(string parm, string val, uint localID) | ||
1192 | { | ||
1193 | bool ret = false; | ||
1194 | |||
1195 | BSParam.ParameterDefnBase theParam; | ||
1196 | if (BSParam.TryGetParameter(parm, out theParam)) | ||
1197 | { | ||
1198 | // Set the value in the C# code | ||
1199 | theParam.SetValue(this, val); | ||
1200 | |||
1201 | // Optionally set the parameter in the unmanaged code | ||
1202 | if (theParam.HasSetOnObject) | ||
1203 | { | ||
1204 | // update all the localIDs specified | ||
1205 | // If the local ID is APPLY_TO_NONE, just change the default value | ||
1206 | // If the localID is APPLY_TO_ALL change the default value and apply the new value to all the lIDs | ||
1207 | // If the localID is a specific object, apply the parameter change to only that object | ||
1208 | List<uint> objectIDs = new List<uint>(); | ||
1209 | switch (localID) | ||
1210 | { | ||
1211 | case PhysParameterEntry.APPLY_TO_NONE: | ||
1212 | // This will cause a call into the physical world if some operation is specified (SetOnObject). | ||
1213 | objectIDs.Add(TERRAIN_ID); | ||
1214 | TaintedUpdateParameter(parm, objectIDs, val); | ||
1215 | break; | ||
1216 | case PhysParameterEntry.APPLY_TO_ALL: | ||
1217 | lock (PhysObjects) objectIDs = new List<uint>(PhysObjects.Keys); | ||
1218 | TaintedUpdateParameter(parm, objectIDs, val); | ||
1219 | break; | ||
1220 | default: | ||
1221 | // setting only one localID | ||
1222 | objectIDs.Add(localID); | ||
1223 | TaintedUpdateParameter(parm, objectIDs, val); | ||
1224 | break; | ||
1225 | } | ||
1226 | } | ||
1227 | |||
1228 | ret = true; | ||
1229 | } | ||
1230 | return ret; | ||
1231 | } | ||
1232 | |||
1233 | // schedule the actual updating of the paramter to when the phys engine is not busy | ||
1234 | private void TaintedUpdateParameter(string parm, List<uint> lIDs, string val) | ||
1235 | { | ||
1236 | string xval = val; | ||
1237 | List<uint> xlIDs = lIDs; | ||
1238 | string xparm = parm; | ||
1239 | TaintedObject(DetailLogZero, "BSScene.UpdateParameterSet", delegate() { | ||
1240 | BSParam.ParameterDefnBase thisParam; | ||
1241 | if (BSParam.TryGetParameter(xparm, out thisParam)) | ||
1242 | { | ||
1243 | if (thisParam.HasSetOnObject) | ||
1244 | { | ||
1245 | foreach (uint lID in xlIDs) | ||
1246 | { | ||
1247 | BSPhysObject theObject = null; | ||
1248 | if (PhysObjects.TryGetValue(lID, out theObject)) | ||
1249 | thisParam.SetOnObject(this, theObject); | ||
1250 | } | ||
1251 | } | ||
1252 | } | ||
1253 | }); | ||
1254 | } | ||
1255 | |||
1256 | // Get parameter. | ||
1257 | // Return 'false' if not able to get the parameter. | ||
1258 | public bool GetPhysicsParameter(string parm, out string value) | ||
1259 | { | ||
1260 | string val = String.Empty; | ||
1261 | bool ret = false; | ||
1262 | BSParam.ParameterDefnBase theParam; | ||
1263 | if (BSParam.TryGetParameter(parm, out theParam)) | ||
1264 | { | ||
1265 | val = theParam.GetValue(this); | ||
1266 | ret = true; | ||
1267 | } | ||
1268 | value = val; | ||
1269 | return ret; | ||
1270 | } | ||
1271 | |||
1272 | #endregion IPhysicsParameters | ||
1273 | |||
1274 | // Invoke the detailed logger and output something if it's enabled. | ||
1275 | public void DetailLog(string msg, params Object[] args) | ||
1276 | { | ||
1277 | PhysicsLogging.Write(msg, args); | ||
1278 | } | ||
1279 | // Used to fill in the LocalID when there isn't one. It's the correct number of characters. | ||
1280 | public const string DetailLogZero = "0000000000"; | ||
1281 | |||
1282 | } | ||
1283 | } | ||
diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs deleted file mode 100644 index ddbe80b..0000000 --- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs +++ /dev/null | |||
@@ -1,250 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.IO; | ||
31 | using System.Reflection; | ||
32 | using Nini.Config; | ||
33 | using log4net; | ||
34 | using OpenSim.Framework; | ||
35 | using OpenMetaverse; | ||
36 | |||
37 | namespace OpenSim.Region.Physics.Manager | ||
38 | { | ||
39 | /// <summary> | ||
40 | /// Description of MyClass. | ||
41 | /// </summary> | ||
42 | public class PhysicsPluginManager | ||
43 | { | ||
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
45 | |||
46 | private Dictionary<string, IPhysicsPlugin> _PhysPlugins = new Dictionary<string, IPhysicsPlugin>(); | ||
47 | private Dictionary<string, IMeshingPlugin> _MeshPlugins = new Dictionary<string, IMeshingPlugin>(); | ||
48 | |||
49 | /// <summary> | ||
50 | /// Constructor. | ||
51 | /// </summary> | ||
52 | public PhysicsPluginManager() | ||
53 | { | ||
54 | // Load "plugins", that are hard coded and not existing in form of an external lib, and hence always | ||
55 | // available | ||
56 | IMeshingPlugin plugHard; | ||
57 | plugHard = new ZeroMesherPlugin(); | ||
58 | _MeshPlugins.Add(plugHard.GetName(), plugHard); | ||
59 | |||
60 | m_log.Info("[PHYSICS]: Added meshing engine: " + plugHard.GetName()); | ||
61 | } | ||
62 | |||
63 | // Legacy method for simulators before extent was passed | ||
64 | public PhysicsScene GetPhysicsScene(string physEngineName, string meshEngineName, | ||
65 | IConfigSource config, string regionName) | ||
66 | { | ||
67 | Vector3 extent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight); | ||
68 | return GetPhysicsScene(physEngineName, meshEngineName, config, regionName, extent); | ||
69 | } | ||
70 | |||
71 | /// <summary> | ||
72 | /// Get a physics scene for the given physics engine and mesher. | ||
73 | /// </summary> | ||
74 | /// <param name="physEngineName"></param> | ||
75 | /// <param name="meshEngineName"></param> | ||
76 | /// <param name="config"></param> | ||
77 | /// <returns></returns> | ||
78 | public PhysicsScene GetPhysicsScene(string physEngineName, string meshEngineName, | ||
79 | IConfigSource config, string regionName, Vector3 regionExtent) | ||
80 | { | ||
81 | if (String.IsNullOrEmpty(physEngineName)) | ||
82 | { | ||
83 | return PhysicsScene.Null; | ||
84 | } | ||
85 | |||
86 | if (String.IsNullOrEmpty(meshEngineName)) | ||
87 | { | ||
88 | return PhysicsScene.Null; | ||
89 | } | ||
90 | |||
91 | IMesher meshEngine = null; | ||
92 | if (_MeshPlugins.ContainsKey(meshEngineName)) | ||
93 | { | ||
94 | m_log.Info("[PHYSICS]: creating meshing engine " + meshEngineName); | ||
95 | meshEngine = _MeshPlugins[meshEngineName].GetMesher(config); | ||
96 | } | ||
97 | else | ||
98 | { | ||
99 | m_log.WarnFormat("[PHYSICS]: couldn't find meshingEngine: {0}", meshEngineName); | ||
100 | throw new ArgumentException(String.Format("couldn't find meshingEngine: {0}", meshEngineName)); | ||
101 | } | ||
102 | |||
103 | if (_PhysPlugins.ContainsKey(physEngineName)) | ||
104 | { | ||
105 | m_log.Info("[PHYSICS]: creating " + physEngineName); | ||
106 | PhysicsScene result = _PhysPlugins[physEngineName].GetScene(regionName); | ||
107 | result.Initialise(meshEngine, config, regionExtent); | ||
108 | return result; | ||
109 | } | ||
110 | else | ||
111 | { | ||
112 | m_log.WarnFormat("[PHYSICS]: couldn't find physicsEngine: {0}", physEngineName); | ||
113 | throw new ArgumentException(String.Format("couldn't find physicsEngine: {0}", physEngineName)); | ||
114 | } | ||
115 | } | ||
116 | |||
117 | /// <summary> | ||
118 | /// Load all plugins in assemblies at the given path | ||
119 | /// </summary> | ||
120 | /// <param name="pluginsPath"></param> | ||
121 | public void LoadPluginsFromAssemblies(string assembliesPath) | ||
122 | { | ||
123 | // Walk all assemblies (DLLs effectively) and see if they are home | ||
124 | // of a plugin that is of interest for us | ||
125 | string[] pluginFiles = Directory.GetFiles(assembliesPath, "*.dll"); | ||
126 | |||
127 | for (int i = 0; i < pluginFiles.Length; i++) | ||
128 | { | ||
129 | LoadPluginsFromAssembly(pluginFiles[i]); | ||
130 | } | ||
131 | } | ||
132 | |||
133 | /// <summary> | ||
134 | /// Load plugins from an assembly at the given path | ||
135 | /// </summary> | ||
136 | /// <param name="assemblyPath"></param> | ||
137 | public void LoadPluginsFromAssembly(string assemblyPath) | ||
138 | { | ||
139 | // TODO / NOTE | ||
140 | // The assembly named 'OpenSim.Region.Physics.BasicPhysicsPlugin' was loaded from | ||
141 | // 'file:///C:/OpenSim/trunk2/bin/Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll' | ||
142 | // using the LoadFrom context. The use of this context can result in unexpected behavior | ||
143 | // for serialization, casting and dependency resolution. In almost all cases, it is recommended | ||
144 | // that the LoadFrom context be avoided. This can be done by installing assemblies in the | ||
145 | // Global Assembly Cache or in the ApplicationBase directory and using Assembly. | ||
146 | // Load when explicitly loading assemblies. | ||
147 | Assembly pluginAssembly = null; | ||
148 | Type[] types = null; | ||
149 | |||
150 | try | ||
151 | { | ||
152 | pluginAssembly = Assembly.LoadFrom(assemblyPath); | ||
153 | } | ||
154 | catch (Exception ex) | ||
155 | { | ||
156 | m_log.Error("[PHYSICS]: Failed to load plugin from " + assemblyPath, ex); | ||
157 | } | ||
158 | |||
159 | if (pluginAssembly != null) | ||
160 | { | ||
161 | try | ||
162 | { | ||
163 | types = pluginAssembly.GetTypes(); | ||
164 | } | ||
165 | catch (ReflectionTypeLoadException ex) | ||
166 | { | ||
167 | m_log.Error("[PHYSICS]: Failed to enumerate types in plugin from " + assemblyPath + ": " + | ||
168 | ex.LoaderExceptions[0].Message, ex); | ||
169 | } | ||
170 | catch (Exception ex) | ||
171 | { | ||
172 | m_log.Error("[PHYSICS]: Failed to enumerate types in plugin from " + assemblyPath, ex); | ||
173 | } | ||
174 | |||
175 | if (types != null) | ||
176 | { | ||
177 | foreach (Type pluginType in types) | ||
178 | { | ||
179 | if (pluginType.IsPublic) | ||
180 | { | ||
181 | if (!pluginType.IsAbstract) | ||
182 | { | ||
183 | Type physTypeInterface = pluginType.GetInterface("IPhysicsPlugin"); | ||
184 | |||
185 | if (physTypeInterface != null) | ||
186 | { | ||
187 | IPhysicsPlugin plug = | ||
188 | (IPhysicsPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | ||
189 | plug.Init(); | ||
190 | if (!_PhysPlugins.ContainsKey(plug.GetName())) | ||
191 | { | ||
192 | _PhysPlugins.Add(plug.GetName(), plug); | ||
193 | m_log.Info("[PHYSICS]: Added physics engine: " + plug.GetName()); | ||
194 | } | ||
195 | } | ||
196 | |||
197 | Type meshTypeInterface = pluginType.GetInterface("IMeshingPlugin"); | ||
198 | |||
199 | if (meshTypeInterface != null) | ||
200 | { | ||
201 | IMeshingPlugin plug = | ||
202 | (IMeshingPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | ||
203 | if (!_MeshPlugins.ContainsKey(plug.GetName())) | ||
204 | { | ||
205 | _MeshPlugins.Add(plug.GetName(), plug); | ||
206 | m_log.Info("[PHYSICS]: Added meshing engine: " + plug.GetName()); | ||
207 | } | ||
208 | } | ||
209 | |||
210 | physTypeInterface = null; | ||
211 | meshTypeInterface = null; | ||
212 | } | ||
213 | } | ||
214 | } | ||
215 | } | ||
216 | } | ||
217 | |||
218 | pluginAssembly = null; | ||
219 | } | ||
220 | |||
221 | //--- | ||
222 | public static void PhysicsPluginMessage(string message, bool isWarning) | ||
223 | { | ||
224 | if (isWarning) | ||
225 | { | ||
226 | m_log.Warn("[PHYSICS]: " + message); | ||
227 | } | ||
228 | else | ||
229 | { | ||
230 | m_log.Info("[PHYSICS]: " + message); | ||
231 | } | ||
232 | } | ||
233 | |||
234 | //--- | ||
235 | } | ||
236 | |||
237 | public interface IPhysicsPlugin | ||
238 | { | ||
239 | bool Init(); | ||
240 | PhysicsScene GetScene(String sceneIdentifier); | ||
241 | string GetName(); | ||
242 | void Dispose(); | ||
243 | } | ||
244 | |||
245 | public interface IMeshingPlugin | ||
246 | { | ||
247 | string GetName(); | ||
248 | IMesher GetMesher(IConfigSource config); | ||
249 | } | ||
250 | } | ||
diff --git a/OpenSim/Region/Physics/Meshing/Properties/AssemblyInfo.cs b/OpenSim/Region/Physics/Meshing/Properties/AssemblyInfo.cs deleted file mode 100644 index ec968c0..0000000 --- a/OpenSim/Region/Physics/Meshing/Properties/AssemblyInfo.cs +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Region.Physics.Meshing")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("4b7e35c2-a9dd-4b10-b778-eb417f4f6884")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.8.2.*")] | ||
33 | |||
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs deleted file mode 100644 index 7e652fc..0000000 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using System.Runtime.InteropServices; | ||
32 | using System.Threading; | ||
33 | using System.IO; | ||
34 | using System.Diagnostics; | ||
35 | using log4net; | ||
36 | using Nini.Config; | ||
37 | using Ode.NET; | ||
38 | using OpenSim.Framework; | ||
39 | using OpenSim.Region.Physics.Manager; | ||
40 | using OpenMetaverse; | ||
41 | |||
42 | namespace OpenSim.Region.Physics.OdePlugin | ||
43 | { | ||
44 | /// <summary> | ||
45 | /// ODE plugin | ||
46 | /// </summary> | ||
47 | public class OdePlugin : IPhysicsPlugin | ||
48 | { | ||
49 | // private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
50 | |||
51 | private OdeScene m_scene; | ||
52 | |||
53 | public bool Init() | ||
54 | { | ||
55 | return true; | ||
56 | } | ||
57 | |||
58 | public PhysicsScene GetScene(String sceneIdentifier) | ||
59 | { | ||
60 | if (m_scene == null) | ||
61 | { | ||
62 | // We do this so that OpenSimulator on Windows loads the correct native ODE library depending on whether | ||
63 | // it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports | ||
64 | // will find it already loaded later on. | ||
65 | // | ||
66 | // This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be | ||
67 | // controlled in Ode.NET.dll.config | ||
68 | if (Util.IsWindows()) | ||
69 | Util.LoadArchSpecificWindowsDll("ode.dll"); | ||
70 | |||
71 | // Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to | ||
72 | // http://opensimulator.org/mantis/view.php?id=2750). | ||
73 | d.InitODE(); | ||
74 | |||
75 | m_scene = new OdeScene(GetName(), sceneIdentifier); | ||
76 | } | ||
77 | |||
78 | return m_scene; | ||
79 | } | ||
80 | |||
81 | public string GetName() | ||
82 | { | ||
83 | return ("OpenDynamicsEngine"); | ||
84 | } | ||
85 | |||
86 | public void Dispose() | ||
87 | { | ||
88 | } | ||
89 | } | ||
90 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs deleted file mode 100644 index ed086dd..0000000 --- a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using Nini.Config; | ||
31 | using OpenSim.Framework; | ||
32 | using OpenSim.Region.Physics.Manager; | ||
33 | |||
34 | namespace OpenSim.Region.Physics.POSPlugin | ||
35 | { | ||
36 | /// <summary> | ||
37 | /// for now will be a very POS physics engine | ||
38 | /// </summary> | ||
39 | public class POSPlugin : IPhysicsPlugin | ||
40 | { | ||
41 | public POSPlugin() | ||
42 | { | ||
43 | } | ||
44 | |||
45 | public bool Init() | ||
46 | { | ||
47 | return true; | ||
48 | } | ||
49 | |||
50 | public PhysicsScene GetScene(string sceneIdentifier) | ||
51 | { | ||
52 | return new POSScene(GetName(), sceneIdentifier); | ||
53 | } | ||
54 | |||
55 | public string GetName() | ||
56 | { | ||
57 | return ("POS"); | ||
58 | } | ||
59 | |||
60 | public void Dispose() | ||
61 | { | ||
62 | } | ||
63 | } | ||
64 | } | ||
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/AssemblyInfo.cs b/OpenSim/Region/PhysicsModules/BasicPhysics/AssemblyInfo.cs index 7d054dd..1765ae0 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/AssemblyInfo.cs +++ b/OpenSim/Region/PhysicsModules/BasicPhysics/AssemblyInfo.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System.Reflection; | 28 | using System.Reflection; |
29 | using System.Runtime.InteropServices; | 29 | using System.Runtime.InteropServices; |
30 | using Mono.Addins; | ||
30 | 31 | ||
31 | // Information about this assembly is defined by the following | 32 | // Information about this assembly is defined by the following |
32 | // attributes. | 33 | // attributes. |
@@ -34,11 +35,11 @@ using System.Runtime.InteropServices; | |||
34 | // change them to the information which is associated with the assembly | 35 | // change them to the information which is associated with the assembly |
35 | // you compile. | 36 | // you compile. |
36 | 37 | ||
37 | [assembly : AssemblyTitle("BasicPhysicsPlugin")] | 38 | [assembly : AssemblyTitle("BasicPhysicsModule")] |
38 | [assembly : AssemblyDescription("")] | 39 | [assembly : AssemblyDescription("")] |
39 | [assembly : AssemblyConfiguration("")] | 40 | [assembly : AssemblyConfiguration("")] |
40 | [assembly : AssemblyCompany("http://opensimulator.org")] | 41 | [assembly : AssemblyCompany("http://opensimulator.org")] |
41 | [assembly : AssemblyProduct("BasicPhysicsPlugin")] | 42 | [assembly : AssemblyProduct("BasicPhysicsModule")] |
42 | [assembly : AssemblyCopyright("Copyright (c) OpenSimulator.org Developers")] | 43 | [assembly : AssemblyCopyright("Copyright (c) OpenSimulator.org Developers")] |
43 | [assembly : AssemblyTrademark("")] | 44 | [assembly : AssemblyTrademark("")] |
44 | [assembly : AssemblyCulture("")] | 45 | [assembly : AssemblyCulture("")] |
@@ -56,3 +57,6 @@ using System.Runtime.InteropServices; | |||
56 | // numbers with the '*' character (the default): | 57 | // numbers with the '*' character (the default): |
57 | 58 | ||
58 | [assembly : AssemblyVersion("0.8.2.*")] | 59 | [assembly : AssemblyVersion("0.8.2.*")] |
60 | |||
61 | [assembly: Addin("OpenSim.Region.PhysicsModule.BasicPhysics", OpenSim.VersionInfo.VersionNumber)] | ||
62 | [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] | ||
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs b/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsActor.cs index 43fba7b..e7b30ba 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs +++ b/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsActor.cs | |||
@@ -30,9 +30,9 @@ using System.Collections.Generic; | |||
30 | using Nini.Config; | 30 | using Nini.Config; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Region.Physics.Manager; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | 34 | ||
35 | namespace OpenSim.Region.Physics.BasicPhysicsPlugin | 35 | namespace OpenSim.Region.PhysicsModule.BasicPhysics |
36 | { | 36 | { |
37 | public class BasicActor : PhysicsActor | 37 | public class BasicActor : PhysicsActor |
38 | { | 38 | { |
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPrim.cs b/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsPrim.cs index dfe4c19..5383f1b 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPrim.cs +++ b/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsPrim.cs | |||
@@ -30,9 +30,9 @@ using System.Collections.Generic; | |||
30 | using Nini.Config; | 30 | using Nini.Config; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Region.Physics.Manager; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | 34 | ||
35 | namespace OpenSim.Region.Physics.BasicPhysicsPlugin | 35 | namespace OpenSim.Region.PhysicsModule.BasicPhysics |
36 | { | 36 | { |
37 | public class BasicPhysicsPrim : PhysicsActor | 37 | public class BasicPhysicsPrim : PhysicsActor |
38 | { | 38 | { |
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs b/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsScene.cs index 0d28c8e..ac2c1f3 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs +++ b/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsScene.cs | |||
@@ -28,11 +28,14 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using Nini.Config; | 30 | using Nini.Config; |
31 | using Mono.Addins; | ||
31 | using OpenMetaverse; | 32 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
33 | using OpenSim.Region.Physics.Manager; | 34 | using OpenSim.Region.PhysicsModules.SharedBase; |
35 | using OpenSim.Region.Framework.Scenes; | ||
36 | using OpenSim.Region.Framework.Interfaces; | ||
34 | 37 | ||
35 | namespace OpenSim.Region.Physics.BasicPhysicsPlugin | 38 | namespace OpenSim.Region.PhysicsModule.BasicPhysics |
36 | { | 39 | { |
37 | /// <summary> | 40 | /// <summary> |
38 | /// This is an incomplete extremely basic physics implementation | 41 | /// This is an incomplete extremely basic physics implementation |
@@ -41,32 +44,74 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
41 | /// Not useful for anything at the moment apart from some regression testing in other components where some form | 44 | /// Not useful for anything at the moment apart from some regression testing in other components where some form |
42 | /// of physics plugin is needed. | 45 | /// of physics plugin is needed. |
43 | /// </remarks> | 46 | /// </remarks> |
44 | public class BasicScene : PhysicsScene | 47 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BasicPhysicsScene")] |
48 | public class BasicScene : PhysicsScene, INonSharedRegionModule | ||
45 | { | 49 | { |
46 | private List<BasicActor> _actors = new List<BasicActor>(); | 50 | private List<BasicActor> _actors = new List<BasicActor>(); |
47 | private List<BasicPhysicsPrim> _prims = new List<BasicPhysicsPrim>(); | 51 | private List<BasicPhysicsPrim> _prims = new List<BasicPhysicsPrim>(); |
48 | private float[] _heightMap; | 52 | private float[] _heightMap; |
49 | private Vector3 m_regionExtent; | 53 | private Vector3 m_regionExtent; |
50 | 54 | ||
55 | private bool m_Enabled = false; | ||
56 | |||
51 | //protected internal string sceneIdentifier; | 57 | //protected internal string sceneIdentifier; |
58 | #region INonSharedRegionModule | ||
59 | public string Name | ||
60 | { | ||
61 | get { return "basicphysics"; } | ||
62 | } | ||
52 | 63 | ||
53 | public BasicScene(string engineType, string _sceneIdentifier) | 64 | public Type ReplaceableInterface |
54 | { | 65 | { |
55 | EngineType = engineType; | 66 | get { return null; } |
56 | Name = EngineType + "/" + _sceneIdentifier; | ||
57 | //sceneIdentifier = _sceneIdentifier; | ||
58 | } | 67 | } |
59 | 68 | ||
60 | public override void Initialise(IMesher meshmerizer, IConfigSource config) | 69 | public void Initialise(IConfigSource source) |
61 | { | 70 | { |
62 | throw new Exception("Should not be called."); | 71 | // TODO: Move this out of Startup |
72 | IConfig config = source.Configs["Startup"]; | ||
73 | if (config != null) | ||
74 | { | ||
75 | string physics = config.GetString("physics", string.Empty); | ||
76 | if (physics == Name) | ||
77 | m_Enabled = true; | ||
78 | } | ||
79 | |||
63 | } | 80 | } |
64 | 81 | ||
65 | public override void Initialise(IMesher meshmerizer, IConfigSource config, Vector3 regionExtent) | 82 | public void Close() |
66 | { | 83 | { |
67 | m_regionExtent = regionExtent; | ||
68 | } | 84 | } |
69 | 85 | ||
86 | public void AddRegion(Scene scene) | ||
87 | { | ||
88 | if (!m_Enabled) | ||
89 | return; | ||
90 | |||
91 | EngineType = Name; | ||
92 | PhysicsSceneName = EngineType + "/" + scene.RegionInfo.RegionName; | ||
93 | |||
94 | scene.RegisterModuleInterface<PhysicsScene>(this); | ||
95 | m_regionExtent = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, scene.RegionInfo.RegionSizeZ); | ||
96 | base.Initialise(scene.PhysicsRequestAsset, | ||
97 | (scene.Heightmap != null ? scene.Heightmap.GetFloatsSerialised() : new float[scene.RegionInfo.RegionSizeX * scene.RegionInfo.RegionSizeY]), | ||
98 | (float)scene.RegionInfo.RegionSettings.WaterHeight); | ||
99 | |||
100 | } | ||
101 | |||
102 | public void RemoveRegion(Scene scene) | ||
103 | { | ||
104 | if (!m_Enabled) | ||
105 | return; | ||
106 | } | ||
107 | |||
108 | public void RegionLoaded(Scene scene) | ||
109 | { | ||
110 | if (!m_Enabled) | ||
111 | return; | ||
112 | } | ||
113 | #endregion | ||
114 | |||
70 | public override void Dispose() {} | 115 | public override void Dispose() {} |
71 | 116 | ||
72 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 117 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
@@ -119,8 +164,8 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
119 | Vector3 actorPosition = actor.Position; | 164 | Vector3 actorPosition = actor.Position; |
120 | Vector3 actorVelocity = actor.Velocity; | 165 | Vector3 actorVelocity = actor.Velocity; |
121 | 166 | ||
122 | // Console.WriteLine( | 167 | //Console.WriteLine( |
123 | // "Processing actor {0}, starting pos {1}, starting vel {2}", i, actorPosition, actorVelocity); | 168 | // "Processing actor {0}, starting pos {1}, starting vel {2}", i, actorPosition, actorVelocity); |
124 | 169 | ||
125 | actorPosition.X += actor.Velocity.X * timeStep; | 170 | actorPosition.X += actor.Velocity.X * timeStep; |
126 | actorPosition.Y += actor.Velocity.Y * timeStep; | 171 | actorPosition.Y += actor.Velocity.Y * timeStep; |
@@ -206,5 +251,6 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
206 | Dictionary<uint, float> returncolliders = new Dictionary<uint, float>(); | 251 | Dictionary<uint, float> returncolliders = new Dictionary<uint, float>(); |
207 | return returncolliders; | 252 | return returncolliders; |
208 | } | 253 | } |
254 | |||
209 | } | 255 | } |
210 | } | 256 | } |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs b/OpenSim/Region/PhysicsModules/BulletS/BSAPIUnman.cs index 3bd81d4..c4a923c 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSAPIUnman.cs | |||
@@ -35,7 +35,7 @@ using OpenSim.Framework; | |||
35 | 35 | ||
36 | using OpenMetaverse; | 36 | using OpenMetaverse; |
37 | 37 | ||
38 | namespace OpenSim.Region.Physics.BulletSPlugin | 38 | namespace OpenSim.Region.PhysicsModule.BulletS |
39 | { | 39 | { |
40 | public sealed class BSAPIUnman : BSAPITemplate | 40 | public sealed class BSAPIUnman : BSAPITemplate |
41 | { | 41 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs b/OpenSim/Region/PhysicsModules/BulletS/BSAPIXNA.cs index 741f8db..887311d 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSAPIXNA.cs | |||
@@ -40,7 +40,7 @@ using BulletXNA.BulletCollision; | |||
40 | using BulletXNA.BulletDynamics; | 40 | using BulletXNA.BulletDynamics; |
41 | using BulletXNA.BulletCollision.CollisionDispatch; | 41 | using BulletXNA.BulletCollision.CollisionDispatch; |
42 | 42 | ||
43 | namespace OpenSim.Region.Physics.BulletSPlugin | 43 | namespace OpenSim.Region.PhysicsModule.BulletS |
44 | { | 44 | { |
45 | public sealed class BSAPIXNA : BSAPITemplate | 45 | public sealed class BSAPIXNA : BSAPITemplate |
46 | { | 46 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs b/OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs index bde4557..0191893 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs | |||
@@ -31,11 +31,11 @@ using System.Linq; | |||
31 | using System.Text; | 31 | using System.Text; |
32 | 32 | ||
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Region.Physics.Manager; | 34 | using OpenSim.Region.PhysicsModules.SharedBase; |
35 | 35 | ||
36 | using OMV = OpenMetaverse; | 36 | using OMV = OpenMetaverse; |
37 | 37 | ||
38 | namespace OpenSim.Region.Physics.BulletSPlugin | 38 | namespace OpenSim.Region.PhysicsModule.BulletS |
39 | { | 39 | { |
40 | public class BSActorAvatarMove : BSActor | 40 | public class BSActorAvatarMove : BSActor |
41 | { | 41 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorHover.cs b/OpenSim/Region/PhysicsModules/BulletS/BSActorHover.cs index e54c27b..7ff171e 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSActorHover.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSActorHover.cs | |||
@@ -30,11 +30,11 @@ using System.Collections.Generic; | |||
30 | using System.Linq; | 30 | using System.Linq; |
31 | using System.Text; | 31 | using System.Text; |
32 | 32 | ||
33 | using OpenSim.Region.Physics.Manager; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | 34 | ||
35 | using OMV = OpenMetaverse; | 35 | using OMV = OpenMetaverse; |
36 | 36 | ||
37 | namespace OpenSim.Region.Physics.BulletSPlugin | 37 | namespace OpenSim.Region.PhysicsModule.BulletS |
38 | { | 38 | { |
39 | public class BSActorHover : BSActor | 39 | public class BSActorHover : BSActor |
40 | { | 40 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs b/OpenSim/Region/PhysicsModules/BulletS/BSActorLockAxis.cs index 3b3c161..78c1b6a 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSActorLockAxis.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSActorLockAxis.cs | |||
@@ -32,7 +32,7 @@ using System.Text; | |||
32 | 32 | ||
33 | using OMV = OpenMetaverse; | 33 | using OMV = OpenMetaverse; |
34 | 34 | ||
35 | namespace OpenSim.Region.Physics.BulletSPlugin | 35 | namespace OpenSim.Region.PhysicsModule.BulletS |
36 | { | 36 | { |
37 | public class BSActorLockAxis : BSActor | 37 | public class BSActorLockAxis : BSActor |
38 | { | 38 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorMoveToTarget.cs b/OpenSim/Region/PhysicsModules/BulletS/BSActorMoveToTarget.cs index 1145006..3db8f2c 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSActorMoveToTarget.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSActorMoveToTarget.cs | |||
@@ -30,11 +30,11 @@ using System.Collections.Generic; | |||
30 | using System.Linq; | 30 | using System.Linq; |
31 | using System.Text; | 31 | using System.Text; |
32 | 32 | ||
33 | using OpenSim.Region.Physics.Manager; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | 34 | ||
35 | using OMV = OpenMetaverse; | 35 | using OMV = OpenMetaverse; |
36 | 36 | ||
37 | namespace OpenSim.Region.Physics.BulletSPlugin | 37 | namespace OpenSim.Region.PhysicsModule.BulletS |
38 | { | 38 | { |
39 | public class BSActorMoveToTarget : BSActor | 39 | public class BSActorMoveToTarget : BSActor |
40 | { | 40 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorSetForce.cs b/OpenSim/Region/PhysicsModules/BulletS/BSActorSetForce.cs index 4e81363..ecb4b7f 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSActorSetForce.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSActorSetForce.cs | |||
@@ -30,11 +30,11 @@ using System.Collections.Generic; | |||
30 | using System.Linq; | 30 | using System.Linq; |
31 | using System.Text; | 31 | using System.Text; |
32 | 32 | ||
33 | using OpenSim.Region.Physics.Manager; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | 34 | ||
35 | using OMV = OpenMetaverse; | 35 | using OMV = OpenMetaverse; |
36 | 36 | ||
37 | namespace OpenSim.Region.Physics.BulletSPlugin | 37 | namespace OpenSim.Region.PhysicsModule.BulletS |
38 | { | 38 | { |
39 | public class BSActorSetForce : BSActor | 39 | public class BSActorSetForce : BSActor |
40 | { | 40 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorSetTorque.cs b/OpenSim/Region/PhysicsModules/BulletS/BSActorSetTorque.cs index 79e1d38..a1cf4db 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSActorSetTorque.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSActorSetTorque.cs | |||
@@ -30,11 +30,11 @@ using System.Collections.Generic; | |||
30 | using System.Linq; | 30 | using System.Linq; |
31 | using System.Text; | 31 | using System.Text; |
32 | 32 | ||
33 | using OpenSim.Region.Physics.Manager; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | 34 | ||
35 | using OMV = OpenMetaverse; | 35 | using OMV = OpenMetaverse; |
36 | 36 | ||
37 | namespace OpenSim.Region.Physics.BulletSPlugin | 37 | namespace OpenSim.Region.PhysicsModule.BulletS |
38 | { | 38 | { |
39 | public class BSActorSetTorque : BSActor | 39 | public class BSActorSetTorque : BSActor |
40 | { | 40 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActors.cs b/OpenSim/Region/PhysicsModules/BulletS/BSActors.cs index 7f45e2c..851347b 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSActors.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSActors.cs | |||
@@ -28,7 +28,7 @@ using System; | |||
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.Text; | 29 | using System.Text; |
30 | 30 | ||
31 | namespace OpenSim.Region.Physics.BulletSPlugin | 31 | namespace OpenSim.Region.PhysicsModule.BulletS |
32 | { | 32 | { |
33 | public class BSActorCollection | 33 | public class BSActorCollection |
34 | { | 34 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs b/OpenSim/Region/PhysicsModules/BulletS/BSApiTemplate.cs index 8491c0f..7756b10 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSApiTemplate.cs | |||
@@ -31,7 +31,7 @@ using System.Security; | |||
31 | using System.Text; | 31 | using System.Text; |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | 33 | ||
34 | namespace OpenSim.Region.Physics.BulletSPlugin { | 34 | namespace OpenSim.Region.PhysicsModule.BulletS { |
35 | 35 | ||
36 | // Constraint type values as defined by Bullet | 36 | // Constraint type values as defined by Bullet |
37 | public enum ConstraintType : int | 37 | public enum ConstraintType : int |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs index 9c3f160..83fc3a6 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs | |||
@@ -30,9 +30,9 @@ using System.Reflection; | |||
30 | using log4net; | 30 | using log4net; |
31 | using OMV = OpenMetaverse; | 31 | using OMV = OpenMetaverse; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Region.Physics.Manager; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | 34 | ||
35 | namespace OpenSim.Region.Physics.BulletSPlugin | 35 | namespace OpenSim.Region.PhysicsModule.BulletS |
36 | { | 36 | { |
37 | public sealed class BSCharacter : BSPhysObject | 37 | public sealed class BSCharacter : BSPhysObject |
38 | { | 38 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs b/OpenSim/Region/PhysicsModules/BulletS/BSConstraint.cs index b47e9a8..e42e868 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSConstraint.cs | |||
@@ -29,7 +29,7 @@ using System.Collections.Generic; | |||
29 | using System.Text; | 29 | using System.Text; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | 31 | ||
32 | namespace OpenSim.Region.Physics.BulletSPlugin | 32 | namespace OpenSim.Region.PhysicsModule.BulletS |
33 | { | 33 | { |
34 | 34 | ||
35 | public abstract class BSConstraint : IDisposable | 35 | public abstract class BSConstraint : IDisposable |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint6Dof.cs b/OpenSim/Region/PhysicsModules/BulletS/BSConstraint6Dof.cs index 7fcb75c..4bcde2b 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint6Dof.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSConstraint6Dof.cs | |||
@@ -29,7 +29,7 @@ using System.Collections.Generic; | |||
29 | using System.Text; | 29 | using System.Text; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | 31 | ||
32 | namespace OpenSim.Region.Physics.BulletSPlugin | 32 | namespace OpenSim.Region.PhysicsModule.BulletS |
33 | { | 33 | { |
34 | 34 | ||
35 | public class BSConstraint6Dof : BSConstraint | 35 | public class BSConstraint6Dof : BSConstraint |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs b/OpenSim/Region/PhysicsModules/BulletS/BSConstraintCollection.cs index 5c8d94e..5746ac1 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintCollection.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSConstraintCollection.cs | |||
@@ -30,7 +30,7 @@ using System.Text; | |||
30 | using log4net; | 30 | using log4net; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | 32 | ||
33 | namespace OpenSim.Region.Physics.BulletSPlugin | 33 | namespace OpenSim.Region.PhysicsModule.BulletS |
34 | { | 34 | { |
35 | 35 | ||
36 | public sealed class BSConstraintCollection : IDisposable | 36 | public sealed class BSConstraintCollection : IDisposable |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintConeTwist.cs b/OpenSim/Region/PhysicsModules/BulletS/BSConstraintConeTwist.cs index 7a76a9a..e7566a8 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintConeTwist.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSConstraintConeTwist.cs | |||
@@ -29,7 +29,7 @@ using System.Collections.Generic; | |||
29 | using System.Text; | 29 | using System.Text; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | 31 | ||
32 | namespace OpenSim.Region.Physics.BulletSPlugin | 32 | namespace OpenSim.Region.PhysicsModule.BulletS |
33 | { | 33 | { |
34 | 34 | ||
35 | public sealed class BSConstraintConeTwist : BSConstraint | 35 | public sealed class BSConstraintConeTwist : BSConstraint |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintHinge.cs b/OpenSim/Region/PhysicsModules/BulletS/BSConstraintHinge.cs index ed89f63..d20538d 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintHinge.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSConstraintHinge.cs | |||
@@ -29,7 +29,7 @@ using System.Collections.Generic; | |||
29 | using System.Text; | 29 | using System.Text; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | 31 | ||
32 | namespace OpenSim.Region.Physics.BulletSPlugin | 32 | namespace OpenSim.Region.PhysicsModule.BulletS |
33 | { | 33 | { |
34 | 34 | ||
35 | public sealed class BSConstraintHinge : BSConstraint | 35 | public sealed class BSConstraintHinge : BSConstraint |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintSlider.cs b/OpenSim/Region/PhysicsModules/BulletS/BSConstraintSlider.cs index 37cfa07..83d42af 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintSlider.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSConstraintSlider.cs | |||
@@ -29,7 +29,7 @@ using System.Collections.Generic; | |||
29 | using System.Text; | 29 | using System.Text; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | 31 | ||
32 | namespace OpenSim.Region.Physics.BulletSPlugin | 32 | namespace OpenSim.Region.PhysicsModule.BulletS |
33 | { | 33 | { |
34 | 34 | ||
35 | public sealed class BSConstraintSlider : BSConstraint | 35 | public sealed class BSConstraintSlider : BSConstraint |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintSpring.cs b/OpenSim/Region/PhysicsModules/BulletS/BSConstraintSpring.cs index 8e7ddff..563a1b1 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraintSpring.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSConstraintSpring.cs | |||
@@ -29,7 +29,7 @@ using System.Collections.Generic; | |||
29 | using System.Text; | 29 | using System.Text; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | 31 | ||
32 | namespace OpenSim.Region.Physics.BulletSPlugin | 32 | namespace OpenSim.Region.PhysicsModule.BulletS |
33 | { | 33 | { |
34 | 34 | ||
35 | public sealed class BSConstraintSpring : BSConstraint6Dof | 35 | public sealed class BSConstraintSpring : BSConstraint6Dof |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/PhysicsModules/BulletS/BSDynamics.cs index c6d6331..0fc5577 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSDynamics.cs | |||
@@ -36,9 +36,9 @@ using System.Reflection; | |||
36 | using System.Runtime.InteropServices; | 36 | using System.Runtime.InteropServices; |
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
38 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Region.Physics.Manager; | 39 | using OpenSim.Region.PhysicsModules.SharedBase; |
40 | 40 | ||
41 | namespace OpenSim.Region.Physics.BulletSPlugin | 41 | namespace OpenSim.Region.PhysicsModule.BulletS |
42 | { | 42 | { |
43 | public sealed class BSDynamics : BSActor | 43 | public sealed class BSDynamics : BSActor |
44 | { | 44 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs b/OpenSim/Region/PhysicsModules/BulletS/BSLinkset.cs index 87eba33..8312239 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSLinkset.cs | |||
@@ -30,7 +30,7 @@ using System.Text; | |||
30 | 30 | ||
31 | using OMV = OpenMetaverse; | 31 | using OMV = OpenMetaverse; |
32 | 32 | ||
33 | namespace OpenSim.Region.Physics.BulletSPlugin | 33 | namespace OpenSim.Region.PhysicsModule.BulletS |
34 | { | 34 | { |
35 | 35 | ||
36 | public abstract class BSLinkset | 36 | public abstract class BSLinkset |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs b/OpenSim/Region/PhysicsModules/BulletS/BSLinksetCompound.cs index cae9efa..953ddee 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSLinksetCompound.cs | |||
@@ -32,7 +32,7 @@ using OpenSim.Framework; | |||
32 | 32 | ||
33 | using OMV = OpenMetaverse; | 33 | using OMV = OpenMetaverse; |
34 | 34 | ||
35 | namespace OpenSim.Region.Physics.BulletSPlugin | 35 | namespace OpenSim.Region.PhysicsModule.BulletS |
36 | { | 36 | { |
37 | 37 | ||
38 | public sealed class BSLinksetCompound : BSLinkset | 38 | public sealed class BSLinksetCompound : BSLinkset |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs b/OpenSim/Region/PhysicsModules/BulletS/BSLinksetConstraints.cs index 4384cdc..c4b4c86 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSLinksetConstraints.cs | |||
@@ -28,11 +28,9 @@ using System; | |||
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.Text; | 29 | using System.Text; |
30 | 30 | ||
31 | using OpenSim.Region.OptionalModules.Scripting; | ||
32 | |||
33 | using OMV = OpenMetaverse; | 31 | using OMV = OpenMetaverse; |
34 | 32 | ||
35 | namespace OpenSim.Region.Physics.BulletSPlugin | 33 | namespace OpenSim.Region.PhysicsModule.BulletS |
36 | { | 34 | { |
37 | public sealed class BSLinksetConstraints : BSLinkset | 35 | public sealed class BSLinksetConstraints : BSLinkset |
38 | { | 36 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSMaterials.cs b/OpenSim/Region/PhysicsModules/BulletS/BSMaterials.cs index ee77d6e..0e44d03 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSMaterials.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSMaterials.cs | |||
@@ -30,7 +30,7 @@ using System.Text; | |||
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using Nini.Config; | 31 | using Nini.Config; |
32 | 32 | ||
33 | namespace OpenSim.Region.Physics.BulletSPlugin | 33 | namespace OpenSim.Region.PhysicsModule.BulletS |
34 | { | 34 | { |
35 | 35 | ||
36 | public struct MaterialAttributes | 36 | public struct MaterialAttributes |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSMotors.cs b/OpenSim/Region/PhysicsModules/BulletS/BSMotors.cs index 7693195..2faf2d4 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSMotors.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSMotors.cs | |||
@@ -31,7 +31,7 @@ using System.Text; | |||
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | 33 | ||
34 | namespace OpenSim.Region.Physics.BulletSPlugin | 34 | namespace OpenSim.Region.PhysicsModule.BulletS |
35 | { | 35 | { |
36 | public abstract class BSMotor | 36 | public abstract class BSMotor |
37 | { | 37 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs index 6d46fe6..c296008 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs | |||
@@ -29,12 +29,12 @@ using System.Collections.Generic; | |||
29 | using System.Reflection; | 29 | using System.Reflection; |
30 | using System.Text; | 30 | using System.Text; |
31 | 31 | ||
32 | using OpenSim.Region.Physics.Manager; | 32 | using OpenSim.Region.PhysicsModules.SharedBase; |
33 | 33 | ||
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using Nini.Config; | 35 | using Nini.Config; |
36 | 36 | ||
37 | namespace OpenSim.Region.Physics.BulletSPlugin | 37 | namespace OpenSim.Region.PhysicsModule.BulletS |
38 | { | 38 | { |
39 | public static class BSParam | 39 | public static class BSParam |
40 | { | 40 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs index 90da7a6..da3fc18 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs | |||
@@ -30,9 +30,9 @@ using System.Text; | |||
30 | 30 | ||
31 | using OMV = OpenMetaverse; | 31 | using OMV = OpenMetaverse; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Region.Physics.Manager; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | 34 | ||
35 | namespace OpenSim.Region.Physics.BulletSPlugin | 35 | namespace OpenSim.Region.PhysicsModule.BulletS |
36 | { | 36 | { |
37 | /* | 37 | /* |
38 | * Class to wrap all objects. | 38 | * Class to wrap all objects. |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs index a00991f..6f27ac7 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs | |||
@@ -32,11 +32,10 @@ using System.Xml; | |||
32 | using log4net; | 32 | using log4net; |
33 | using OMV = OpenMetaverse; | 33 | using OMV = OpenMetaverse; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Region.Physics.Manager; | 35 | using OpenSim.Region.PhysicsModules.SharedBase; |
36 | using OpenSim.Region.Physics.ConvexDecompositionDotNet; | 36 | using OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet; |
37 | using OpenSim.Region.OptionalModules.Scripting; // for ExtendedPhysics | ||
38 | 37 | ||
39 | namespace OpenSim.Region.Physics.BulletSPlugin | 38 | namespace OpenSim.Region.PhysicsModule.BulletS |
40 | { | 39 | { |
41 | 40 | ||
42 | [Serializable] | 41 | [Serializable] |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrimDisplaced.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPrimDisplaced.cs index 2eb1440..d8ed56b 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrimDisplaced.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSPrimDisplaced.cs | |||
@@ -31,11 +31,11 @@ using System.Reflection; | |||
31 | using System.Runtime.InteropServices; | 31 | using System.Runtime.InteropServices; |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Region.Physics.Manager; | 34 | using OpenSim.Region.PhysicsModules.SharedBase; |
35 | 35 | ||
36 | using OMV = OpenMetaverse; | 36 | using OMV = OpenMetaverse; |
37 | 37 | ||
38 | namespace OpenSim.Region.Physics.BulletSPlugin | 38 | namespace OpenSim.Region.PhysicsModule.BulletS |
39 | { | 39 | { |
40 | public class BSPrimDisplaced : BSPrim | 40 | public class BSPrimDisplaced : BSPrim |
41 | { | 41 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPrimLinkable.cs index 430d645..55b5da0 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSPrimLinkable.cs | |||
@@ -30,11 +30,10 @@ using System.Linq; | |||
30 | using System.Text; | 30 | using System.Text; |
31 | 31 | ||
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Region.OptionalModules.Scripting; | ||
34 | 33 | ||
35 | using OMV = OpenMetaverse; | 34 | using OMV = OpenMetaverse; |
36 | 35 | ||
37 | namespace OpenSim.Region.Physics.BulletSPlugin | 36 | namespace OpenSim.Region.PhysicsModule.BulletS |
38 | { | 37 | { |
39 | public class BSPrimLinkable : BSPrimDisplaced | 38 | public class BSPrimLinkable : BSPrimDisplaced |
40 | { | 39 | { |
@@ -72,7 +71,7 @@ public class BSPrimLinkable : BSPrimDisplaced | |||
72 | base.Destroy(); | 71 | base.Destroy(); |
73 | } | 72 | } |
74 | 73 | ||
75 | public override void link(Manager.PhysicsActor obj) | 74 | public override void link(OpenSim.Region.PhysicsModules.SharedBase.PhysicsActor obj) |
76 | { | 75 | { |
77 | BSPrimLinkable parent = obj as BSPrimLinkable; | 76 | BSPrimLinkable parent = obj as BSPrimLinkable; |
78 | if (parent != null) | 77 | if (parent != null) |
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs b/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs new file mode 100644 index 0000000..452ce55 --- /dev/null +++ b/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs | |||
@@ -0,0 +1,1333 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyrightD | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | using System; | ||
28 | using System.Collections.Generic; | ||
29 | using System.Linq; | ||
30 | using System.Reflection; | ||
31 | using System.Runtime.InteropServices; | ||
32 | using System.Text; | ||
33 | using System.Threading; | ||
34 | using OpenSim.Framework; | ||
35 | using OpenSim.Framework.Monitoring; | ||
36 | using OpenSim.Region.Framework.Scenes; | ||
37 | using OpenSim.Region.Framework.Interfaces; | ||
38 | using OpenSim.Region.PhysicsModules.SharedBase; | ||
39 | using Nini.Config; | ||
40 | using log4net; | ||
41 | using OpenMetaverse; | ||
42 | using Mono.Addins; | ||
43 | |||
44 | namespace OpenSim.Region.PhysicsModule.BulletS | ||
45 | { | ||
46 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BulletSPhysicsScene")] | ||
47 | public sealed class BSScene : PhysicsScene, IPhysicsParameters, INonSharedRegionModule | ||
48 | { | ||
49 | internal static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
50 | internal static readonly string LogHeader = "[BULLETS SCENE]"; | ||
51 | |||
52 | private bool m_Enabled = false; | ||
53 | private IConfigSource m_Config; | ||
54 | |||
55 | // The name of the region we're working for. | ||
56 | public string RegionName { get; private set; } | ||
57 | |||
58 | public string BulletSimVersion = "?"; | ||
59 | |||
60 | // The handle to the underlying managed or unmanaged version of Bullet being used. | ||
61 | public string BulletEngineName { get; private set; } | ||
62 | public BSAPITemplate PE; | ||
63 | |||
64 | // If the physics engine is running on a separate thread | ||
65 | public Thread m_physicsThread; | ||
66 | |||
67 | public Dictionary<uint, BSPhysObject> PhysObjects; | ||
68 | public BSShapeCollection Shapes; | ||
69 | |||
70 | // Keeping track of the objects with collisions so we can report begin and end of a collision | ||
71 | public HashSet<BSPhysObject> ObjectsWithCollisions = new HashSet<BSPhysObject>(); | ||
72 | public HashSet<BSPhysObject> ObjectsWithNoMoreCollisions = new HashSet<BSPhysObject>(); | ||
73 | |||
74 | // All the collision processing is protected with this lock object | ||
75 | public Object CollisionLock = new Object(); | ||
76 | |||
77 | // Properties are updated here | ||
78 | public Object UpdateLock = new Object(); | ||
79 | public HashSet<BSPhysObject> ObjectsWithUpdates = new HashSet<BSPhysObject>(); | ||
80 | |||
81 | // Keep track of all the avatars so we can send them a collision event | ||
82 | // every tick so OpenSim will update its animation. | ||
83 | private HashSet<BSPhysObject> AvatarsInScene = new HashSet<BSPhysObject>(); | ||
84 | private Object AvatarsInSceneLock = new Object(); | ||
85 | |||
86 | // let my minuions use my logger | ||
87 | public ILog Logger { get { return m_log; } } | ||
88 | |||
89 | public IMesher mesher; | ||
90 | public uint WorldID { get; private set; } | ||
91 | public BulletWorld World { get; private set; } | ||
92 | |||
93 | // All the constraints that have been allocated in this instance. | ||
94 | public BSConstraintCollection Constraints { get; private set; } | ||
95 | |||
96 | // Simulation parameters | ||
97 | //internal float m_physicsStepTime; // if running independently, the interval simulated by default | ||
98 | |||
99 | internal int m_maxSubSteps; | ||
100 | internal float m_fixedTimeStep; | ||
101 | |||
102 | internal float m_simulatedTime; // the time simulated previously. Used for physics framerate calc. | ||
103 | |||
104 | internal long m_simulationStep = 0; // The current simulation step. | ||
105 | public long SimulationStep { get { return m_simulationStep; } } | ||
106 | // A number to use for SimulationStep that is probably not any step value | ||
107 | // Used by the collision code (which remembers the step when a collision happens) to remember not any simulation step. | ||
108 | public static long NotASimulationStep = -1234; | ||
109 | |||
110 | internal float LastTimeStep { get; private set; } // The simulation time from the last invocation of Simulate() | ||
111 | |||
112 | internal float NominalFrameRate { get; set; } // Parameterized ideal frame rate that simulation is scaled to | ||
113 | |||
114 | // Physical objects can register for prestep or poststep events | ||
115 | public delegate void PreStepAction(float timeStep); | ||
116 | public delegate void PostStepAction(float timeStep); | ||
117 | public event PreStepAction BeforeStep; | ||
118 | public event PostStepAction AfterStep; | ||
119 | |||
120 | // A value of the time 'now' so all the collision and update routines do not have to get their own | ||
121 | // Set to 'now' just before all the prims and actors are called for collisions and updates | ||
122 | public int SimulationNowTime { get; private set; } | ||
123 | |||
124 | // True if initialized and ready to do simulation steps | ||
125 | private bool m_initialized = false; | ||
126 | |||
127 | // Flag which is true when processing taints. | ||
128 | // Not guaranteed to be correct all the time (don't depend on this) but good for debugging. | ||
129 | public bool InTaintTime { get; private set; } | ||
130 | |||
131 | // Pinned memory used to pass step information between managed and unmanaged | ||
132 | internal int m_maxCollisionsPerFrame; | ||
133 | internal CollisionDesc[] m_collisionArray; | ||
134 | |||
135 | internal int m_maxUpdatesPerFrame; | ||
136 | internal EntityProperties[] m_updateArray; | ||
137 | |||
138 | /// <summary> | ||
139 | /// Used to control physics simulation timing if Bullet is running on its own thread. | ||
140 | /// </summary> | ||
141 | private ManualResetEvent m_updateWaitEvent; | ||
142 | |||
143 | public const uint TERRAIN_ID = 0; // OpenSim senses terrain with a localID of zero | ||
144 | public const uint GROUNDPLANE_ID = 1; | ||
145 | public const uint CHILDTERRAIN_ID = 2; // Terrain allocated based on our mega-prim childre start here | ||
146 | |||
147 | public float SimpleWaterLevel { get; set; } | ||
148 | public BSTerrainManager TerrainManager { get; private set; } | ||
149 | |||
150 | public ConfigurationParameters Params | ||
151 | { | ||
152 | get { return UnmanagedParams[0]; } | ||
153 | } | ||
154 | public Vector3 DefaultGravity | ||
155 | { | ||
156 | get { return new Vector3(0f, 0f, Params.gravity); } | ||
157 | } | ||
158 | // Just the Z value of the gravity | ||
159 | public float DefaultGravityZ | ||
160 | { | ||
161 | get { return Params.gravity; } | ||
162 | } | ||
163 | |||
164 | // When functions in the unmanaged code must be called, it is only | ||
165 | // done at a known time just before the simulation step. The taint | ||
166 | // system saves all these function calls and executes them in | ||
167 | // order before the simulation. | ||
168 | public delegate void TaintCallback(); | ||
169 | private struct TaintCallbackEntry | ||
170 | { | ||
171 | public String originator; | ||
172 | public String ident; | ||
173 | public TaintCallback callback; | ||
174 | public TaintCallbackEntry(string pIdent, TaintCallback pCallBack) | ||
175 | { | ||
176 | originator = BSScene.DetailLogZero; | ||
177 | ident = pIdent; | ||
178 | callback = pCallBack; | ||
179 | } | ||
180 | public TaintCallbackEntry(string pOrigin, string pIdent, TaintCallback pCallBack) | ||
181 | { | ||
182 | originator = pOrigin; | ||
183 | ident = pIdent; | ||
184 | callback = pCallBack; | ||
185 | } | ||
186 | } | ||
187 | private Object _taintLock = new Object(); // lock for using the next object | ||
188 | private List<TaintCallbackEntry> _taintOperations; | ||
189 | private Dictionary<string, TaintCallbackEntry> _postTaintOperations; | ||
190 | private List<TaintCallbackEntry> _postStepOperations; | ||
191 | |||
192 | // A pointer to an instance if this structure is passed to the C++ code | ||
193 | // Used to pass basic configuration values to the unmanaged code. | ||
194 | internal ConfigurationParameters[] UnmanagedParams; | ||
195 | |||
196 | // Sometimes you just have to log everything. | ||
197 | public LogWriter PhysicsLogging; | ||
198 | private bool m_physicsLoggingEnabled; | ||
199 | private string m_physicsLoggingDir; | ||
200 | private string m_physicsLoggingPrefix; | ||
201 | private int m_physicsLoggingFileMinutes; | ||
202 | private bool m_physicsLoggingDoFlush; | ||
203 | private bool m_physicsPhysicalDumpEnabled; | ||
204 | public int PhysicsMetricDumpFrames { get; set; } | ||
205 | // 'true' of the vehicle code is to log lots of details | ||
206 | public bool VehicleLoggingEnabled { get; private set; } | ||
207 | public bool VehiclePhysicalLoggingEnabled { get; private set; } | ||
208 | |||
209 | #region INonSharedRegionModule | ||
210 | public string Name | ||
211 | { | ||
212 | get { return "BulletSim"; } | ||
213 | } | ||
214 | |||
215 | public Type ReplaceableInterface | ||
216 | { | ||
217 | get { return null; } | ||
218 | } | ||
219 | |||
220 | public void Initialise(IConfigSource source) | ||
221 | { | ||
222 | // TODO: Move this out of Startup | ||
223 | IConfig config = source.Configs["Startup"]; | ||
224 | if (config != null) | ||
225 | { | ||
226 | string physics = config.GetString("physics", string.Empty); | ||
227 | if (physics == Name) | ||
228 | { | ||
229 | m_Enabled = true; | ||
230 | m_Config = source; | ||
231 | } | ||
232 | } | ||
233 | |||
234 | } | ||
235 | |||
236 | public void Close() | ||
237 | { | ||
238 | } | ||
239 | |||
240 | public void AddRegion(Scene scene) | ||
241 | { | ||
242 | if (!m_Enabled) | ||
243 | return; | ||
244 | |||
245 | EngineType = Name; | ||
246 | RegionName = scene.RegionInfo.RegionName; | ||
247 | PhysicsSceneName = EngineType + "/" + RegionName; | ||
248 | |||
249 | scene.RegisterModuleInterface<PhysicsScene>(this); | ||
250 | Vector3 extent = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, scene.RegionInfo.RegionSizeZ); | ||
251 | Initialise(m_Config, extent); | ||
252 | |||
253 | base.Initialise(scene.PhysicsRequestAsset, | ||
254 | (scene.Heightmap != null ? scene.Heightmap.GetFloatsSerialised() : new float[scene.RegionInfo.RegionSizeX * scene.RegionInfo.RegionSizeY]), | ||
255 | (float)scene.RegionInfo.RegionSettings.WaterHeight); | ||
256 | |||
257 | } | ||
258 | |||
259 | public void RemoveRegion(Scene scene) | ||
260 | { | ||
261 | if (!m_Enabled) | ||
262 | return; | ||
263 | } | ||
264 | |||
265 | public void RegionLoaded(Scene scene) | ||
266 | { | ||
267 | if (!m_Enabled) | ||
268 | return; | ||
269 | |||
270 | mesher = scene.RequestModuleInterface<IMesher>(); | ||
271 | if (mesher == null) | ||
272 | m_log.WarnFormat("{0} No mesher. Things will not work well.", LogHeader); | ||
273 | |||
274 | scene.PhysicsEnabled = true; | ||
275 | } | ||
276 | #endregion | ||
277 | |||
278 | #region Initialization | ||
279 | |||
280 | private void Initialise(IConfigSource config, Vector3 regionExtent) | ||
281 | { | ||
282 | _taintOperations = new List<TaintCallbackEntry>(); | ||
283 | _postTaintOperations = new Dictionary<string, TaintCallbackEntry>(); | ||
284 | _postStepOperations = new List<TaintCallbackEntry>(); | ||
285 | PhysObjects = new Dictionary<uint, BSPhysObject>(); | ||
286 | Shapes = new BSShapeCollection(this); | ||
287 | |||
288 | m_simulatedTime = 0f; | ||
289 | LastTimeStep = 0.1f; | ||
290 | |||
291 | // Allocate pinned memory to pass parameters. | ||
292 | UnmanagedParams = new ConfigurationParameters[1]; | ||
293 | |||
294 | // Set default values for physics parameters plus any overrides from the ini file | ||
295 | GetInitialParameterValues(config); | ||
296 | |||
297 | // Force some parameters to values depending on other configurations | ||
298 | // Only use heightmap terrain implementation if terrain larger than legacy size | ||
299 | if ((uint)regionExtent.X > Constants.RegionSize || (uint)regionExtent.Y > Constants.RegionSize) | ||
300 | { | ||
301 | m_log.WarnFormat("{0} Forcing terrain implementation to heightmap for large region", LogHeader); | ||
302 | BSParam.TerrainImplementation = (float)BSTerrainPhys.TerrainImplementation.Heightmap; | ||
303 | } | ||
304 | |||
305 | // Get the connection to the physics engine (could be native or one of many DLLs) | ||
306 | PE = SelectUnderlyingBulletEngine(BulletEngineName); | ||
307 | |||
308 | // Enable very detailed logging. | ||
309 | // By creating an empty logger when not logging, the log message invocation code | ||
310 | // can be left in and every call doesn't have to check for null. | ||
311 | if (m_physicsLoggingEnabled) | ||
312 | { | ||
313 | PhysicsLogging = new LogWriter(m_physicsLoggingDir, m_physicsLoggingPrefix, m_physicsLoggingFileMinutes, m_physicsLoggingDoFlush); | ||
314 | PhysicsLogging.ErrorLogger = m_log; // for DEBUG. Let's the logger output its own error messages. | ||
315 | } | ||
316 | else | ||
317 | { | ||
318 | PhysicsLogging = new LogWriter(); | ||
319 | } | ||
320 | |||
321 | // Allocate memory for returning of the updates and collisions from the physics engine | ||
322 | m_collisionArray = new CollisionDesc[m_maxCollisionsPerFrame]; | ||
323 | m_updateArray = new EntityProperties[m_maxUpdatesPerFrame]; | ||
324 | |||
325 | // The bounding box for the simulated world. The origin is 0,0,0 unless we're | ||
326 | // a child in a mega-region. | ||
327 | // Bullet actually doesn't care about the extents of the simulated | ||
328 | // area. It tracks active objects no matter where they are. | ||
329 | Vector3 worldExtent = regionExtent; | ||
330 | |||
331 | World = PE.Initialize(worldExtent, Params, m_maxCollisionsPerFrame, ref m_collisionArray, m_maxUpdatesPerFrame, ref m_updateArray); | ||
332 | |||
333 | Constraints = new BSConstraintCollection(World); | ||
334 | |||
335 | TerrainManager = new BSTerrainManager(this, worldExtent); | ||
336 | TerrainManager.CreateInitialGroundPlaneAndTerrain(); | ||
337 | |||
338 | // Put some informational messages into the log file. | ||
339 | m_log.InfoFormat("{0} Linksets implemented with {1}", LogHeader, (BSLinkset.LinksetImplementation)BSParam.LinksetImplementation); | ||
340 | |||
341 | InTaintTime = false; | ||
342 | m_initialized = true; | ||
343 | |||
344 | // If the physics engine runs on its own thread, start same. | ||
345 | if (BSParam.UseSeparatePhysicsThread) | ||
346 | { | ||
347 | // The physics simulation should happen independently of the heartbeat loop | ||
348 | m_physicsThread | ||
349 | = WorkManager.StartThread( | ||
350 | BulletSPluginPhysicsThread, | ||
351 | string.Format("{0} ({1})", BulletEngineName, RegionName), | ||
352 | ThreadPriority.Normal, | ||
353 | true, | ||
354 | true); | ||
355 | } | ||
356 | } | ||
357 | |||
358 | // All default parameter values are set here. There should be no values set in the | ||
359 | // variable definitions. | ||
360 | private void GetInitialParameterValues(IConfigSource config) | ||
361 | { | ||
362 | ConfigurationParameters parms = new ConfigurationParameters(); | ||
363 | UnmanagedParams[0] = parms; | ||
364 | |||
365 | BSParam.SetParameterDefaultValues(this); | ||
366 | |||
367 | if (config != null) | ||
368 | { | ||
369 | // If there are specifications in the ini file, use those values | ||
370 | IConfig pConfig = config.Configs["BulletSim"]; | ||
371 | if (pConfig != null) | ||
372 | { | ||
373 | BSParam.SetParameterConfigurationValues(this, pConfig); | ||
374 | |||
375 | // There are two Bullet implementations to choose from | ||
376 | BulletEngineName = pConfig.GetString("BulletEngine", "BulletUnmanaged"); | ||
377 | |||
378 | // Very detailed logging for physics debugging | ||
379 | // TODO: the boolean values can be moved to the normal parameter processing. | ||
380 | m_physicsLoggingEnabled = pConfig.GetBoolean("PhysicsLoggingEnabled", false); | ||
381 | m_physicsLoggingDir = pConfig.GetString("PhysicsLoggingDir", "."); | ||
382 | m_physicsLoggingPrefix = pConfig.GetString("PhysicsLoggingPrefix", "physics-%REGIONNAME%-"); | ||
383 | m_physicsLoggingFileMinutes = pConfig.GetInt("PhysicsLoggingFileMinutes", 5); | ||
384 | m_physicsLoggingDoFlush = pConfig.GetBoolean("PhysicsLoggingDoFlush", false); | ||
385 | m_physicsPhysicalDumpEnabled = pConfig.GetBoolean("PhysicsPhysicalDumpEnabled", false); | ||
386 | // Very detailed logging for vehicle debugging | ||
387 | VehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false); | ||
388 | VehiclePhysicalLoggingEnabled = pConfig.GetBoolean("VehiclePhysicalLoggingEnabled", false); | ||
389 | |||
390 | // Do any replacements in the parameters | ||
391 | m_physicsLoggingPrefix = m_physicsLoggingPrefix.Replace("%REGIONNAME%", RegionName); | ||
392 | } | ||
393 | else | ||
394 | { | ||
395 | // Nothing in the configuration INI file so assume unmanaged and other defaults. | ||
396 | BulletEngineName = "BulletUnmanaged"; | ||
397 | m_physicsLoggingEnabled = false; | ||
398 | VehicleLoggingEnabled = false; | ||
399 | } | ||
400 | |||
401 | // The material characteristics. | ||
402 | BSMaterials.InitializeFromDefaults(Params); | ||
403 | if (pConfig != null) | ||
404 | { | ||
405 | // Let the user add new and interesting material property values. | ||
406 | BSMaterials.InitializefromParameters(pConfig); | ||
407 | } | ||
408 | } | ||
409 | } | ||
410 | |||
411 | // A helper function that handles a true/false parameter and returns the proper float number encoding | ||
412 | float ParamBoolean(IConfig config, string parmName, float deflt) | ||
413 | { | ||
414 | float ret = deflt; | ||
415 | if (config.Contains(parmName)) | ||
416 | { | ||
417 | ret = ConfigurationParameters.numericFalse; | ||
418 | if (config.GetBoolean(parmName, false)) | ||
419 | { | ||
420 | ret = ConfigurationParameters.numericTrue; | ||
421 | } | ||
422 | } | ||
423 | return ret; | ||
424 | } | ||
425 | |||
426 | // Select the connection to the actual Bullet implementation. | ||
427 | // The main engine selection is the engineName up to the first hypen. | ||
428 | // So "Bullet-2.80-OpenCL-Intel" specifies the 'bullet' class here and the whole name | ||
429 | // is passed to the engine to do its special selection, etc. | ||
430 | private BSAPITemplate SelectUnderlyingBulletEngine(string engineName) | ||
431 | { | ||
432 | // For the moment, do a simple switch statement. | ||
433 | // Someday do fancyness with looking up the interfaces in the assembly. | ||
434 | BSAPITemplate ret = null; | ||
435 | |||
436 | string selectionName = engineName.ToLower(); | ||
437 | int hyphenIndex = engineName.IndexOf("-"); | ||
438 | if (hyphenIndex > 0) | ||
439 | selectionName = engineName.ToLower().Substring(0, hyphenIndex - 1); | ||
440 | |||
441 | switch (selectionName) | ||
442 | { | ||
443 | case "bullet": | ||
444 | case "bulletunmanaged": | ||
445 | ret = new BSAPIUnman(engineName, this); | ||
446 | break; | ||
447 | case "bulletxna": | ||
448 | ret = new BSAPIXNA(engineName, this); | ||
449 | // Disable some features that are not implemented in BulletXNA | ||
450 | m_log.InfoFormat("{0} Disabling some physics features not implemented by BulletXNA", LogHeader); | ||
451 | m_log.InfoFormat("{0} Disabling ShouldUseBulletHACD", LogHeader); | ||
452 | BSParam.ShouldUseBulletHACD = false; | ||
453 | m_log.InfoFormat("{0} Disabling ShouldUseSingleConvexHullForPrims", LogHeader); | ||
454 | BSParam.ShouldUseSingleConvexHullForPrims = false; | ||
455 | m_log.InfoFormat("{0} Disabling ShouldUseGImpactShapeForPrims", LogHeader); | ||
456 | BSParam.ShouldUseGImpactShapeForPrims = false; | ||
457 | m_log.InfoFormat("{0} Setting terrain implimentation to Heightmap", LogHeader); | ||
458 | BSParam.TerrainImplementation = (float)BSTerrainPhys.TerrainImplementation.Heightmap; | ||
459 | break; | ||
460 | } | ||
461 | |||
462 | if (ret == null) | ||
463 | { | ||
464 | m_log.ErrorFormat("{0} COULD NOT SELECT BULLET ENGINE: '[BulletSim]PhysicsEngine' must be either 'BulletUnmanaged-*' or 'BulletXNA-*'", LogHeader); | ||
465 | } | ||
466 | else | ||
467 | { | ||
468 | m_log.InfoFormat("{0} Selected bullet engine {1} -> {2}/{3}", LogHeader, engineName, ret.BulletEngineName, ret.BulletEngineVersion); | ||
469 | } | ||
470 | |||
471 | return ret; | ||
472 | } | ||
473 | |||
474 | public override void Dispose() | ||
475 | { | ||
476 | // m_log.DebugFormat("{0}: Dispose()", LogHeader); | ||
477 | |||
478 | // make sure no stepping happens while we're deleting stuff | ||
479 | m_initialized = false; | ||
480 | |||
481 | lock (PhysObjects) | ||
482 | { | ||
483 | foreach (KeyValuePair<uint, BSPhysObject> kvp in PhysObjects) | ||
484 | { | ||
485 | kvp.Value.Destroy(); | ||
486 | } | ||
487 | PhysObjects.Clear(); | ||
488 | } | ||
489 | |||
490 | // Now that the prims are all cleaned up, there should be no constraints left | ||
491 | if (Constraints != null) | ||
492 | { | ||
493 | Constraints.Dispose(); | ||
494 | Constraints = null; | ||
495 | } | ||
496 | |||
497 | if (Shapes != null) | ||
498 | { | ||
499 | Shapes.Dispose(); | ||
500 | Shapes = null; | ||
501 | } | ||
502 | |||
503 | if (TerrainManager != null) | ||
504 | { | ||
505 | TerrainManager.ReleaseGroundPlaneAndTerrain(); | ||
506 | TerrainManager.Dispose(); | ||
507 | TerrainManager = null; | ||
508 | } | ||
509 | |||
510 | // Anything left in the unmanaged code should be cleaned out | ||
511 | PE.Shutdown(World); | ||
512 | |||
513 | // Not logging any more | ||
514 | PhysicsLogging.Close(); | ||
515 | } | ||
516 | #endregion // Construction and Initialization | ||
517 | |||
518 | #region Prim and Avatar addition and removal | ||
519 | |||
520 | public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 velocity, Vector3 size, bool isFlying) | ||
521 | { | ||
522 | m_log.ErrorFormat("{0}: CALL TO AddAvatar in BSScene. NOT IMPLEMENTED", LogHeader); | ||
523 | return null; | ||
524 | } | ||
525 | |||
526 | public override PhysicsActor AddAvatar(uint localID, string avName, Vector3 position, Vector3 velocity, Vector3 size, bool isFlying) | ||
527 | { | ||
528 | // m_log.DebugFormat("{0}: AddAvatar: {1}", LogHeader, avName); | ||
529 | |||
530 | if (!m_initialized) return null; | ||
531 | |||
532 | BSCharacter actor = new BSCharacter(localID, avName, this, position, velocity, size, isFlying); | ||
533 | lock (PhysObjects) | ||
534 | PhysObjects.Add(localID, actor); | ||
535 | |||
536 | // TODO: Remove kludge someday. | ||
537 | // We must generate a collision for avatars whether they collide or not. | ||
538 | // This is required by OpenSim to update avatar animations, etc. | ||
539 | lock (AvatarsInSceneLock) | ||
540 | AvatarsInScene.Add(actor); | ||
541 | |||
542 | return actor; | ||
543 | } | ||
544 | |||
545 | public override void RemoveAvatar(PhysicsActor actor) | ||
546 | { | ||
547 | // m_log.DebugFormat("{0}: RemoveAvatar", LogHeader); | ||
548 | |||
549 | if (!m_initialized) return; | ||
550 | |||
551 | BSCharacter bsactor = actor as BSCharacter; | ||
552 | if (bsactor != null) | ||
553 | { | ||
554 | try | ||
555 | { | ||
556 | lock (PhysObjects) | ||
557 | PhysObjects.Remove(bsactor.LocalID); | ||
558 | // Remove kludge someday | ||
559 | lock (AvatarsInSceneLock) | ||
560 | AvatarsInScene.Remove(bsactor); | ||
561 | } | ||
562 | catch (Exception e) | ||
563 | { | ||
564 | m_log.WarnFormat("{0}: Attempt to remove avatar that is not in physics scene: {1}", LogHeader, e); | ||
565 | } | ||
566 | bsactor.Destroy(); | ||
567 | // bsactor.dispose(); | ||
568 | } | ||
569 | else | ||
570 | { | ||
571 | m_log.ErrorFormat("{0}: Requested to remove avatar that is not a BSCharacter. ID={1}, type={2}", | ||
572 | LogHeader, actor.LocalID, actor.GetType().Name); | ||
573 | } | ||
574 | } | ||
575 | |||
576 | public override void RemovePrim(PhysicsActor prim) | ||
577 | { | ||
578 | if (!m_initialized) return; | ||
579 | |||
580 | BSPhysObject bsprim = prim as BSPhysObject; | ||
581 | if (bsprim != null) | ||
582 | { | ||
583 | DetailLog("{0},RemovePrim,call", bsprim.LocalID); | ||
584 | // m_log.DebugFormat("{0}: RemovePrim. id={1}/{2}", LogHeader, bsprim.Name, bsprim.LocalID); | ||
585 | try | ||
586 | { | ||
587 | lock (PhysObjects) PhysObjects.Remove(bsprim.LocalID); | ||
588 | } | ||
589 | catch (Exception e) | ||
590 | { | ||
591 | m_log.ErrorFormat("{0}: Attempt to remove prim that is not in physics scene: {1}", LogHeader, e); | ||
592 | } | ||
593 | bsprim.Destroy(); | ||
594 | // bsprim.dispose(); | ||
595 | } | ||
596 | else | ||
597 | { | ||
598 | m_log.ErrorFormat("{0}: Attempt to remove prim that is not a BSPrim type.", LogHeader); | ||
599 | } | ||
600 | } | ||
601 | |||
602 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
603 | Vector3 size, Quaternion rotation, bool isPhysical, uint localID) | ||
604 | { | ||
605 | // m_log.DebugFormat("{0}: AddPrimShape2: {1}", LogHeader, primName); | ||
606 | |||
607 | if (!m_initialized) return null; | ||
608 | |||
609 | // DetailLog("{0},BSScene.AddPrimShape,call", localID); | ||
610 | |||
611 | BSPhysObject prim = new BSPrimLinkable(localID, primName, this, position, size, rotation, pbs, isPhysical); | ||
612 | lock (PhysObjects) PhysObjects.Add(localID, prim); | ||
613 | return prim; | ||
614 | } | ||
615 | |||
616 | // This is a call from the simulator saying that some physical property has been updated. | ||
617 | // The BulletSim driver senses the changing of relevant properties so this taint | ||
618 | // information call is not needed. | ||
619 | public override void AddPhysicsActorTaint(PhysicsActor prim) { } | ||
620 | |||
621 | #endregion // Prim and Avatar addition and removal | ||
622 | |||
623 | #region Simulation | ||
624 | |||
625 | // Call from the simulator to send physics information to the simulator objects. | ||
626 | // This pushes all the collision and property update events into the objects in | ||
627 | // the simulator and, since it is on the heartbeat thread, there is an implicit | ||
628 | // locking of those data structures from other heartbeat events. | ||
629 | // If the physics engine is running on a separate thread, the update information | ||
630 | // will be in the ObjectsWithCollions and ObjectsWithUpdates structures. | ||
631 | public override float Simulate(float timeStep) | ||
632 | { | ||
633 | if (!BSParam.UseSeparatePhysicsThread) | ||
634 | { | ||
635 | DoPhysicsStep(timeStep); | ||
636 | } | ||
637 | return SendUpdatesToSimulator(timeStep); | ||
638 | } | ||
639 | |||
640 | // Call the physics engine to do one 'timeStep' and collect collisions and updates | ||
641 | // into ObjectsWithCollisions and ObjectsWithUpdates data structures. | ||
642 | private void DoPhysicsStep(float timeStep) | ||
643 | { | ||
644 | // prevent simulation until we've been initialized | ||
645 | if (!m_initialized) return; | ||
646 | |||
647 | LastTimeStep = timeStep; | ||
648 | |||
649 | int updatedEntityCount = 0; | ||
650 | int collidersCount = 0; | ||
651 | |||
652 | int beforeTime = Util.EnvironmentTickCount(); | ||
653 | int simTime = 0; | ||
654 | |||
655 | int numTaints = _taintOperations.Count; | ||
656 | InTaintTime = true; // Only used for debugging so locking is not necessary. | ||
657 | |||
658 | // update the prim states while we know the physics engine is not busy | ||
659 | ProcessTaints(); | ||
660 | |||
661 | // Some of the physical objects requre individual, pre-step calls | ||
662 | // (vehicles and avatar movement, in particular) | ||
663 | TriggerPreStepEvent(timeStep); | ||
664 | |||
665 | // the prestep actions might have added taints | ||
666 | numTaints += _taintOperations.Count; | ||
667 | ProcessTaints(); | ||
668 | |||
669 | InTaintTime = false; // Only used for debugging so locking is not necessary. | ||
670 | |||
671 | // The following causes the unmanaged code to output ALL the values found in ALL the objects in the world. | ||
672 | // Only enable this in a limited test world with few objects. | ||
673 | if (m_physicsPhysicalDumpEnabled) | ||
674 | PE.DumpAllInfo(World); | ||
675 | |||
676 | // step the physical world one interval | ||
677 | m_simulationStep++; | ||
678 | int numSubSteps = 0; | ||
679 | try | ||
680 | { | ||
681 | numSubSteps = PE.PhysicsStep(World, timeStep, m_maxSubSteps, m_fixedTimeStep, out updatedEntityCount, out collidersCount); | ||
682 | |||
683 | } | ||
684 | catch (Exception e) | ||
685 | { | ||
686 | m_log.WarnFormat("{0},PhysicsStep Exception: nTaints={1}, substeps={2}, updates={3}, colliders={4}, e={5}", | ||
687 | LogHeader, numTaints, numSubSteps, updatedEntityCount, collidersCount, e); | ||
688 | DetailLog("{0},PhysicsStepException,call, nTaints={1}, substeps={2}, updates={3}, colliders={4}", | ||
689 | DetailLogZero, numTaints, numSubSteps, updatedEntityCount, collidersCount); | ||
690 | updatedEntityCount = 0; | ||
691 | collidersCount = 0; | ||
692 | } | ||
693 | |||
694 | // Make the physics engine dump useful statistics periodically | ||
695 | if (PhysicsMetricDumpFrames != 0 && ((m_simulationStep % PhysicsMetricDumpFrames) == 0)) | ||
696 | PE.DumpPhysicsStatistics(World); | ||
697 | |||
698 | // Get a value for 'now' so all the collision and update routines don't have to get their own. | ||
699 | SimulationNowTime = Util.EnvironmentTickCount(); | ||
700 | |||
701 | // Send collision information to the colliding objects. The objects decide if the collision | ||
702 | // is 'real' (like linksets don't collide with themselves) and the individual objects | ||
703 | // know if the simulator has subscribed to collisions. | ||
704 | lock (CollisionLock) | ||
705 | { | ||
706 | if (collidersCount > 0) | ||
707 | { | ||
708 | lock (PhysObjects) | ||
709 | { | ||
710 | for (int ii = 0; ii < collidersCount; ii++) | ||
711 | { | ||
712 | uint cA = m_collisionArray[ii].aID; | ||
713 | uint cB = m_collisionArray[ii].bID; | ||
714 | Vector3 point = m_collisionArray[ii].point; | ||
715 | Vector3 normal = m_collisionArray[ii].normal; | ||
716 | float penetration = m_collisionArray[ii].penetration; | ||
717 | SendCollision(cA, cB, point, normal, penetration); | ||
718 | SendCollision(cB, cA, point, -normal, penetration); | ||
719 | } | ||
720 | } | ||
721 | } | ||
722 | } | ||
723 | |||
724 | // If any of the objects had updated properties, tell the managed objects about the update | ||
725 | // and remember that there was a change so it will be passed to the simulator. | ||
726 | lock (UpdateLock) | ||
727 | { | ||
728 | if (updatedEntityCount > 0) | ||
729 | { | ||
730 | lock (PhysObjects) | ||
731 | { | ||
732 | for (int ii = 0; ii < updatedEntityCount; ii++) | ||
733 | { | ||
734 | EntityProperties entprop = m_updateArray[ii]; | ||
735 | BSPhysObject pobj; | ||
736 | if (PhysObjects.TryGetValue(entprop.ID, out pobj)) | ||
737 | { | ||
738 | if (pobj.IsInitialized) | ||
739 | pobj.UpdateProperties(entprop); | ||
740 | } | ||
741 | } | ||
742 | } | ||
743 | } | ||
744 | } | ||
745 | |||
746 | // Some actors want to know when the simulation step is complete. | ||
747 | TriggerPostStepEvent(timeStep); | ||
748 | |||
749 | simTime = Util.EnvironmentTickCountSubtract(beforeTime); | ||
750 | if (PhysicsLogging.Enabled) | ||
751 | { | ||
752 | DetailLog("{0},DoPhysicsStep,complete,frame={1}, nTaints={2}, simTime={3}, substeps={4}, updates={5}, colliders={6}, objWColl={7}", | ||
753 | DetailLogZero, m_simulationStep, numTaints, simTime, numSubSteps, | ||
754 | updatedEntityCount, collidersCount, ObjectsWithCollisions.Count); | ||
755 | } | ||
756 | |||
757 | // The following causes the unmanaged code to output ALL the values found in ALL the objects in the world. | ||
758 | // Only enable this in a limited test world with few objects. | ||
759 | if (m_physicsPhysicalDumpEnabled) | ||
760 | PE.DumpAllInfo(World); | ||
761 | |||
762 | // The physics engine returns the number of milliseconds it simulated this call. | ||
763 | // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS. | ||
764 | // Multiply by a fixed nominal frame rate to give a rate similar to the simulator (usually 55). | ||
765 | m_simulatedTime += (float)numSubSteps * m_fixedTimeStep * 1000f * NominalFrameRate; | ||
766 | } | ||
767 | |||
768 | // Called by a BSPhysObject to note that it has changed properties and this information | ||
769 | // should be passed up to the simulator at the proper time. | ||
770 | // Note: this is called by the BSPhysObject from invocation via DoPhysicsStep() above so | ||
771 | // this is is under UpdateLock. | ||
772 | public void PostUpdate(BSPhysObject updatee) | ||
773 | { | ||
774 | lock (UpdateLock) | ||
775 | { | ||
776 | ObjectsWithUpdates.Add(updatee); | ||
777 | } | ||
778 | } | ||
779 | |||
780 | // The simulator thinks it is physics time so return all the collisions and position | ||
781 | // updates that were collected in actual physics simulation. | ||
782 | private float SendUpdatesToSimulator(float timeStep) | ||
783 | { | ||
784 | if (!m_initialized) return 5.0f; | ||
785 | |||
786 | DetailLog("{0},SendUpdatesToSimulator,collisions={1},updates={2},simedTime={3}", | ||
787 | BSScene.DetailLogZero, ObjectsWithCollisions.Count, ObjectsWithUpdates.Count, m_simulatedTime); | ||
788 | // Push the collisions into the simulator. | ||
789 | lock (CollisionLock) | ||
790 | { | ||
791 | if (ObjectsWithCollisions.Count > 0) | ||
792 | { | ||
793 | foreach (BSPhysObject bsp in ObjectsWithCollisions) | ||
794 | if (!bsp.SendCollisions()) | ||
795 | { | ||
796 | // If the object is done colliding, see that it's removed from the colliding list | ||
797 | ObjectsWithNoMoreCollisions.Add(bsp); | ||
798 | } | ||
799 | } | ||
800 | |||
801 | // This is a kludge to get avatar movement updates. | ||
802 | // The simulator expects collisions for avatars even if there are have been no collisions. | ||
803 | // The event updates avatar animations and stuff. | ||
804 | // If you fix avatar animation updates, remove this overhead and let normal collision processing happen. | ||
805 | // Note that we get a copy of the list to search because SendCollision() can take a while. | ||
806 | HashSet<BSPhysObject> tempAvatarsInScene; | ||
807 | lock (AvatarsInSceneLock) | ||
808 | { | ||
809 | tempAvatarsInScene = new HashSet<BSPhysObject>(AvatarsInScene); | ||
810 | } | ||
811 | foreach (BSPhysObject actor in tempAvatarsInScene) | ||
812 | { | ||
813 | if (!ObjectsWithCollisions.Contains(actor)) // don't call avatars twice | ||
814 | actor.SendCollisions(); | ||
815 | } | ||
816 | tempAvatarsInScene = null; | ||
817 | |||
818 | // Objects that are done colliding are removed from the ObjectsWithCollisions list. | ||
819 | // Not done above because it is inside an iteration of ObjectWithCollisions. | ||
820 | // This complex collision processing is required to create an empty collision | ||
821 | // event call after all real collisions have happened on an object. This allows | ||
822 | // the simulator to generate the 'collision end' event. | ||
823 | if (ObjectsWithNoMoreCollisions.Count > 0) | ||
824 | { | ||
825 | foreach (BSPhysObject po in ObjectsWithNoMoreCollisions) | ||
826 | ObjectsWithCollisions.Remove(po); | ||
827 | ObjectsWithNoMoreCollisions.Clear(); | ||
828 | } | ||
829 | } | ||
830 | |||
831 | // Call the simulator for each object that has physics property updates. | ||
832 | HashSet<BSPhysObject> updatedObjects = null; | ||
833 | lock (UpdateLock) | ||
834 | { | ||
835 | if (ObjectsWithUpdates.Count > 0) | ||
836 | { | ||
837 | updatedObjects = ObjectsWithUpdates; | ||
838 | ObjectsWithUpdates = new HashSet<BSPhysObject>(); | ||
839 | } | ||
840 | } | ||
841 | if (updatedObjects != null) | ||
842 | { | ||
843 | foreach (BSPhysObject obj in updatedObjects) | ||
844 | { | ||
845 | obj.RequestPhysicsterseUpdate(); | ||
846 | } | ||
847 | updatedObjects.Clear(); | ||
848 | } | ||
849 | |||
850 | // Return the framerate simulated to give the above returned results. | ||
851 | // (Race condition here but this is just bookkeeping so rare mistakes do not merit a lock). | ||
852 | float simTime = m_simulatedTime; | ||
853 | m_simulatedTime = 0f; | ||
854 | return simTime; | ||
855 | } | ||
856 | |||
857 | // Something has collided | ||
858 | private void SendCollision(uint localID, uint collidingWith, Vector3 collidePoint, Vector3 collideNormal, float penetration) | ||
859 | { | ||
860 | if (localID <= TerrainManager.HighestTerrainID) | ||
861 | { | ||
862 | return; // don't send collisions to the terrain | ||
863 | } | ||
864 | |||
865 | BSPhysObject collider; | ||
866 | // NOTE that PhysObjects was locked before the call to SendCollision(). | ||
867 | if (!PhysObjects.TryGetValue(localID, out collider)) | ||
868 | { | ||
869 | // If the object that is colliding cannot be found, just ignore the collision. | ||
870 | DetailLog("{0},BSScene.SendCollision,colliderNotInObjectList,id={1},with={2}", DetailLogZero, localID, collidingWith); | ||
871 | return; | ||
872 | } | ||
873 | |||
874 | // Note: the terrain is not in the physical object list so 'collidee' can be null when Collide() is called. | ||
875 | BSPhysObject collidee = null; | ||
876 | PhysObjects.TryGetValue(collidingWith, out collidee); | ||
877 | |||
878 | // DetailLog("{0},BSScene.SendCollision,collide,id={1},with={2}", DetailLogZero, localID, collidingWith); | ||
879 | |||
880 | if (collider.IsInitialized) | ||
881 | { | ||
882 | if (collider.Collide(collidingWith, collidee, collidePoint, collideNormal, penetration)) | ||
883 | { | ||
884 | // If a collision was 'good', remember to send it to the simulator | ||
885 | lock (CollisionLock) | ||
886 | { | ||
887 | ObjectsWithCollisions.Add(collider); | ||
888 | } | ||
889 | } | ||
890 | } | ||
891 | |||
892 | return; | ||
893 | } | ||
894 | |||
895 | public void BulletSPluginPhysicsThread() | ||
896 | { | ||
897 | Thread.CurrentThread.Priority = ThreadPriority.Highest; | ||
898 | m_updateWaitEvent = new ManualResetEvent(false); | ||
899 | |||
900 | while (m_initialized) | ||
901 | { | ||
902 | int beginSimulationRealtimeMS = Util.EnvironmentTickCount(); | ||
903 | |||
904 | if (BSParam.Active) | ||
905 | DoPhysicsStep(BSParam.PhysicsTimeStep); | ||
906 | |||
907 | int simulationRealtimeMS = Util.EnvironmentTickCountSubtract(beginSimulationRealtimeMS); | ||
908 | int simulationTimeVsRealtimeDifferenceMS = ((int)(BSParam.PhysicsTimeStep*1000f)) - simulationRealtimeMS; | ||
909 | |||
910 | if (simulationTimeVsRealtimeDifferenceMS > 0) | ||
911 | { | ||
912 | // The simulation of the time interval took less than realtime. | ||
913 | // Do a wait for the rest of realtime. | ||
914 | m_updateWaitEvent.WaitOne(simulationTimeVsRealtimeDifferenceMS); | ||
915 | //Thread.Sleep(simulationTimeVsRealtimeDifferenceMS); | ||
916 | } | ||
917 | else | ||
918 | { | ||
919 | // The simulation took longer than realtime. | ||
920 | // Do some scaling of simulation time. | ||
921 | // TODO. | ||
922 | DetailLog("{0},BulletSPluginPhysicsThread,longerThanRealtime={1}", BSScene.DetailLogZero, simulationTimeVsRealtimeDifferenceMS); | ||
923 | } | ||
924 | |||
925 | Watchdog.UpdateThread(); | ||
926 | } | ||
927 | |||
928 | Watchdog.RemoveThread(); | ||
929 | } | ||
930 | |||
931 | #endregion // Simulation | ||
932 | |||
933 | public override void GetResults() { } | ||
934 | |||
935 | #region Terrain | ||
936 | |||
937 | public override void SetTerrain(float[] heightMap) { | ||
938 | TerrainManager.SetTerrain(heightMap); | ||
939 | } | ||
940 | |||
941 | public override void SetWaterLevel(float baseheight) | ||
942 | { | ||
943 | SimpleWaterLevel = baseheight; | ||
944 | } | ||
945 | |||
946 | public override void DeleteTerrain() | ||
947 | { | ||
948 | // m_log.DebugFormat("{0}: DeleteTerrain()", LogHeader); | ||
949 | } | ||
950 | |||
951 | // Although no one seems to check this, I do support combining. | ||
952 | public override bool SupportsCombining() | ||
953 | { | ||
954 | return TerrainManager.SupportsCombining(); | ||
955 | } | ||
956 | // This call says I am a child to region zero in a mega-region. 'pScene' is that | ||
957 | // of region zero, 'offset' is my offset from regions zero's origin, and | ||
958 | // 'extents' is the largest XY that is handled in my region. | ||
959 | public override void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) | ||
960 | { | ||
961 | TerrainManager.Combine(pScene, offset, extents); | ||
962 | } | ||
963 | |||
964 | // Unhook all the combining that I know about. | ||
965 | public override void UnCombine(PhysicsScene pScene) | ||
966 | { | ||
967 | TerrainManager.UnCombine(pScene); | ||
968 | } | ||
969 | |||
970 | #endregion // Terrain | ||
971 | |||
972 | public override Dictionary<uint, float> GetTopColliders() | ||
973 | { | ||
974 | Dictionary<uint, float> topColliders; | ||
975 | |||
976 | lock (PhysObjects) | ||
977 | { | ||
978 | foreach (KeyValuePair<uint, BSPhysObject> kvp in PhysObjects) | ||
979 | { | ||
980 | kvp.Value.ComputeCollisionScore(); | ||
981 | } | ||
982 | |||
983 | List<BSPhysObject> orderedPrims = new List<BSPhysObject>(PhysObjects.Values); | ||
984 | orderedPrims.OrderByDescending(p => p.CollisionScore); | ||
985 | topColliders = orderedPrims.Take(25).ToDictionary(p => p.LocalID, p => p.CollisionScore); | ||
986 | } | ||
987 | |||
988 | return topColliders; | ||
989 | } | ||
990 | |||
991 | public override bool IsThreaded { get { return false; } } | ||
992 | |||
993 | #region Extensions | ||
994 | public override object Extension(string pFunct, params object[] pParams) | ||
995 | { | ||
996 | DetailLog("{0} BSScene.Extension,op={1}", DetailLogZero, pFunct); | ||
997 | return base.Extension(pFunct, pParams); | ||
998 | } | ||
999 | #endregion // Extensions | ||
1000 | |||
1001 | public static string PrimitiveBaseShapeToString(PrimitiveBaseShape pbs) | ||
1002 | { | ||
1003 | float pathShearX = pbs.PathShearX < 128 ? (float)pbs.PathShearX * 0.01f : (float)(pbs.PathShearX - 256) * 0.01f; | ||
1004 | float pathShearY = pbs.PathShearY < 128 ? (float)pbs.PathShearY * 0.01f : (float)(pbs.PathShearY - 256) * 0.01f; | ||
1005 | float pathBegin = (float)pbs.PathBegin * 2.0e-5f; | ||
1006 | float pathEnd = 1.0f - (float)pbs.PathEnd * 2.0e-5f; | ||
1007 | float pathScaleX = (float)(200 - pbs.PathScaleX) * 0.01f; | ||
1008 | float pathScaleY = (float)(200 - pbs.PathScaleY) * 0.01f; | ||
1009 | float pathTaperX = pbs.PathTaperX * 0.01f; | ||
1010 | float pathTaperY = pbs.PathTaperY * 0.01f; | ||
1011 | |||
1012 | float profileBegin = (float)pbs.ProfileBegin * 2.0e-5f; | ||
1013 | float profileEnd = 1.0f - (float)pbs.ProfileEnd * 2.0e-5f; | ||
1014 | float profileHollow = (float)pbs.ProfileHollow * 2.0e-5f; | ||
1015 | if (profileHollow > 0.95f) | ||
1016 | profileHollow = 0.95f; | ||
1017 | |||
1018 | StringBuilder buff = new StringBuilder(); | ||
1019 | buff.Append("shape="); | ||
1020 | buff.Append(((ProfileShape)pbs.ProfileShape).ToString()); | ||
1021 | buff.Append(","); | ||
1022 | buff.Append("hollow="); | ||
1023 | buff.Append(((HollowShape)pbs.HollowShape).ToString()); | ||
1024 | buff.Append(","); | ||
1025 | buff.Append("pathCurve="); | ||
1026 | buff.Append(((Extrusion)pbs.PathCurve).ToString()); | ||
1027 | buff.Append(","); | ||
1028 | buff.Append("profCurve="); | ||
1029 | buff.Append(((Extrusion)pbs.ProfileCurve).ToString()); | ||
1030 | buff.Append(","); | ||
1031 | buff.Append("profHollow="); | ||
1032 | buff.Append(profileHollow.ToString()); | ||
1033 | buff.Append(","); | ||
1034 | buff.Append("pathBegEnd="); | ||
1035 | buff.Append(pathBegin.ToString()); | ||
1036 | buff.Append("/"); | ||
1037 | buff.Append(pathEnd.ToString()); | ||
1038 | buff.Append(","); | ||
1039 | buff.Append("profileBegEnd="); | ||
1040 | buff.Append(profileBegin.ToString()); | ||
1041 | buff.Append("/"); | ||
1042 | buff.Append(profileEnd.ToString()); | ||
1043 | buff.Append(","); | ||
1044 | buff.Append("scaleXY="); | ||
1045 | buff.Append(pathScaleX.ToString()); | ||
1046 | buff.Append("/"); | ||
1047 | buff.Append(pathScaleY.ToString()); | ||
1048 | buff.Append(","); | ||
1049 | buff.Append("shearXY="); | ||
1050 | buff.Append(pathShearX.ToString()); | ||
1051 | buff.Append("/"); | ||
1052 | buff.Append(pathShearY.ToString()); | ||
1053 | buff.Append(","); | ||
1054 | buff.Append("taperXY="); | ||
1055 | buff.Append(pbs.PathTaperX.ToString()); | ||
1056 | buff.Append("/"); | ||
1057 | buff.Append(pbs.PathTaperY.ToString()); | ||
1058 | buff.Append(","); | ||
1059 | buff.Append("skew="); | ||
1060 | buff.Append(pbs.PathSkew.ToString()); | ||
1061 | buff.Append(","); | ||
1062 | buff.Append("twist/Beg="); | ||
1063 | buff.Append(pbs.PathTwist.ToString()); | ||
1064 | buff.Append("/"); | ||
1065 | buff.Append(pbs.PathTwistBegin.ToString()); | ||
1066 | |||
1067 | return buff.ToString(); | ||
1068 | } | ||
1069 | |||
1070 | #region Taints | ||
1071 | // The simulation execution order is: | ||
1072 | // Simulate() | ||
1073 | // DoOneTimeTaints | ||
1074 | // TriggerPreStepEvent | ||
1075 | // DoOneTimeTaints | ||
1076 | // Step() | ||
1077 | // ProcessAndSendToSimulatorCollisions | ||
1078 | // ProcessAndSendToSimulatorPropertyUpdates | ||
1079 | // TriggerPostStepEvent | ||
1080 | |||
1081 | // Calls to the PhysicsActors can't directly call into the physics engine | ||
1082 | // because it might be busy. We delay changes to a known time. | ||
1083 | // We rely on C#'s closure to save and restore the context for the delegate. | ||
1084 | public void TaintedObject(string pOriginator, string pIdent, TaintCallback pCallback) | ||
1085 | { | ||
1086 | TaintedObject(false /*inTaintTime*/, pOriginator, pIdent, pCallback); | ||
1087 | } | ||
1088 | public void TaintedObject(uint pOriginator, String pIdent, TaintCallback pCallback) | ||
1089 | { | ||
1090 | TaintedObject(false /*inTaintTime*/, m_physicsLoggingEnabled ? pOriginator.ToString() : BSScene.DetailLogZero, pIdent, pCallback); | ||
1091 | } | ||
1092 | public void TaintedObject(bool inTaintTime, String pIdent, TaintCallback pCallback) | ||
1093 | { | ||
1094 | TaintedObject(inTaintTime, BSScene.DetailLogZero, pIdent, pCallback); | ||
1095 | } | ||
1096 | public void TaintedObject(bool inTaintTime, uint pOriginator, String pIdent, TaintCallback pCallback) | ||
1097 | { | ||
1098 | TaintedObject(inTaintTime, m_physicsLoggingEnabled ? pOriginator.ToString() : BSScene.DetailLogZero, pIdent, pCallback); | ||
1099 | } | ||
1100 | // Sometimes a potentially tainted operation can be used in and out of taint time. | ||
1101 | // This routine executes the command immediately if in taint-time otherwise it is queued. | ||
1102 | public void TaintedObject(bool inTaintTime, string pOriginator, string pIdent, TaintCallback pCallback) | ||
1103 | { | ||
1104 | if (!m_initialized) return; | ||
1105 | |||
1106 | if (inTaintTime) | ||
1107 | pCallback(); | ||
1108 | else | ||
1109 | { | ||
1110 | lock (_taintLock) | ||
1111 | { | ||
1112 | _taintOperations.Add(new TaintCallbackEntry(pOriginator, pIdent, pCallback)); | ||
1113 | } | ||
1114 | } | ||
1115 | } | ||
1116 | |||
1117 | private void TriggerPreStepEvent(float timeStep) | ||
1118 | { | ||
1119 | PreStepAction actions = BeforeStep; | ||
1120 | if (actions != null) | ||
1121 | actions(timeStep); | ||
1122 | |||
1123 | } | ||
1124 | |||
1125 | private void TriggerPostStepEvent(float timeStep) | ||
1126 | { | ||
1127 | PostStepAction actions = AfterStep; | ||
1128 | if (actions != null) | ||
1129 | actions(timeStep); | ||
1130 | |||
1131 | } | ||
1132 | |||
1133 | // When someone tries to change a property on a BSPrim or BSCharacter, the object queues | ||
1134 | // a callback into itself to do the actual property change. That callback is called | ||
1135 | // here just before the physics engine is called to step the simulation. | ||
1136 | public void ProcessTaints() | ||
1137 | { | ||
1138 | ProcessRegularTaints(); | ||
1139 | ProcessPostTaintTaints(); | ||
1140 | } | ||
1141 | |||
1142 | private void ProcessRegularTaints() | ||
1143 | { | ||
1144 | if (m_initialized && _taintOperations.Count > 0) // save allocating new list if there is nothing to process | ||
1145 | { | ||
1146 | // swizzle a new list into the list location so we can process what's there | ||
1147 | List<TaintCallbackEntry> oldList; | ||
1148 | lock (_taintLock) | ||
1149 | { | ||
1150 | oldList = _taintOperations; | ||
1151 | _taintOperations = new List<TaintCallbackEntry>(); | ||
1152 | } | ||
1153 | |||
1154 | foreach (TaintCallbackEntry tcbe in oldList) | ||
1155 | { | ||
1156 | try | ||
1157 | { | ||
1158 | DetailLog("{0},BSScene.ProcessTaints,doTaint,id={1}", tcbe.originator, tcbe.ident); // DEBUG DEBUG DEBUG | ||
1159 | tcbe.callback(); | ||
1160 | } | ||
1161 | catch (Exception e) | ||
1162 | { | ||
1163 | m_log.ErrorFormat("{0}: ProcessTaints: {1}: Exception: {2}", LogHeader, tcbe.ident, e); | ||
1164 | } | ||
1165 | } | ||
1166 | oldList.Clear(); | ||
1167 | } | ||
1168 | } | ||
1169 | |||
1170 | // Schedule an update to happen after all the regular taints are processed. | ||
1171 | // Note that new requests for the same operation ("ident") for the same object ("ID") | ||
1172 | // will replace any previous operation by the same object. | ||
1173 | public void PostTaintObject(String ident, uint ID, TaintCallback callback) | ||
1174 | { | ||
1175 | string IDAsString = ID.ToString(); | ||
1176 | string uniqueIdent = ident + "-" + IDAsString; | ||
1177 | lock (_taintLock) | ||
1178 | { | ||
1179 | _postTaintOperations[uniqueIdent] = new TaintCallbackEntry(IDAsString, uniqueIdent, callback); | ||
1180 | } | ||
1181 | |||
1182 | return; | ||
1183 | } | ||
1184 | |||
1185 | // Taints that happen after the normal taint processing but before the simulation step. | ||
1186 | private void ProcessPostTaintTaints() | ||
1187 | { | ||
1188 | if (m_initialized && _postTaintOperations.Count > 0) | ||
1189 | { | ||
1190 | Dictionary<string, TaintCallbackEntry> oldList; | ||
1191 | lock (_taintLock) | ||
1192 | { | ||
1193 | oldList = _postTaintOperations; | ||
1194 | _postTaintOperations = new Dictionary<string, TaintCallbackEntry>(); | ||
1195 | } | ||
1196 | |||
1197 | foreach (KeyValuePair<string,TaintCallbackEntry> kvp in oldList) | ||
1198 | { | ||
1199 | try | ||
1200 | { | ||
1201 | DetailLog("{0},BSScene.ProcessPostTaintTaints,doTaint,id={1}", DetailLogZero, kvp.Key); // DEBUG DEBUG DEBUG | ||
1202 | kvp.Value.callback(); | ||
1203 | } | ||
1204 | catch (Exception e) | ||
1205 | { | ||
1206 | m_log.ErrorFormat("{0}: ProcessPostTaintTaints: {1}: Exception: {2}", LogHeader, kvp.Key, e); | ||
1207 | } | ||
1208 | } | ||
1209 | oldList.Clear(); | ||
1210 | } | ||
1211 | } | ||
1212 | |||
1213 | // Only used for debugging. Does not change state of anything so locking is not necessary. | ||
1214 | public bool AssertInTaintTime(string whereFrom) | ||
1215 | { | ||
1216 | if (!InTaintTime) | ||
1217 | { | ||
1218 | DetailLog("{0},BSScene.AssertInTaintTime,NOT IN TAINT TIME,Region={1},Where={2}", DetailLogZero, RegionName, whereFrom); | ||
1219 | m_log.ErrorFormat("{0} NOT IN TAINT TIME!! Region={1}, Where={2}", LogHeader, RegionName, whereFrom); | ||
1220 | // Util.PrintCallStack(DetailLog); | ||
1221 | } | ||
1222 | return InTaintTime; | ||
1223 | } | ||
1224 | |||
1225 | #endregion // Taints | ||
1226 | |||
1227 | #region IPhysicsParameters | ||
1228 | // Get the list of parameters this physics engine supports | ||
1229 | public PhysParameterEntry[] GetParameterList() | ||
1230 | { | ||
1231 | BSParam.BuildParameterTable(); | ||
1232 | return BSParam.SettableParameters; | ||
1233 | } | ||
1234 | |||
1235 | // Set parameter on a specific or all instances. | ||
1236 | // Return 'false' if not able to set the parameter. | ||
1237 | // Setting the value in the m_params block will change the value the physics engine | ||
1238 | // will use the next time since it's pinned and shared memory. | ||
1239 | // Some of the values require calling into the physics engine to get the new | ||
1240 | // value activated ('terrainFriction' for instance). | ||
1241 | public bool SetPhysicsParameter(string parm, string val, uint localID) | ||
1242 | { | ||
1243 | bool ret = false; | ||
1244 | |||
1245 | BSParam.ParameterDefnBase theParam; | ||
1246 | if (BSParam.TryGetParameter(parm, out theParam)) | ||
1247 | { | ||
1248 | // Set the value in the C# code | ||
1249 | theParam.SetValue(this, val); | ||
1250 | |||
1251 | // Optionally set the parameter in the unmanaged code | ||
1252 | if (theParam.HasSetOnObject) | ||
1253 | { | ||
1254 | // update all the localIDs specified | ||
1255 | // If the local ID is APPLY_TO_NONE, just change the default value | ||
1256 | // If the localID is APPLY_TO_ALL change the default value and apply the new value to all the lIDs | ||
1257 | // If the localID is a specific object, apply the parameter change to only that object | ||
1258 | List<uint> objectIDs = new List<uint>(); | ||
1259 | switch (localID) | ||
1260 | { | ||
1261 | case PhysParameterEntry.APPLY_TO_NONE: | ||
1262 | // This will cause a call into the physical world if some operation is specified (SetOnObject). | ||
1263 | objectIDs.Add(TERRAIN_ID); | ||
1264 | TaintedUpdateParameter(parm, objectIDs, val); | ||
1265 | break; | ||
1266 | case PhysParameterEntry.APPLY_TO_ALL: | ||
1267 | lock (PhysObjects) objectIDs = new List<uint>(PhysObjects.Keys); | ||
1268 | TaintedUpdateParameter(parm, objectIDs, val); | ||
1269 | break; | ||
1270 | default: | ||
1271 | // setting only one localID | ||
1272 | objectIDs.Add(localID); | ||
1273 | TaintedUpdateParameter(parm, objectIDs, val); | ||
1274 | break; | ||
1275 | } | ||
1276 | } | ||
1277 | |||
1278 | ret = true; | ||
1279 | } | ||
1280 | return ret; | ||
1281 | } | ||
1282 | |||
1283 | // schedule the actual updating of the paramter to when the phys engine is not busy | ||
1284 | private void TaintedUpdateParameter(string parm, List<uint> lIDs, string val) | ||
1285 | { | ||
1286 | string xval = val; | ||
1287 | List<uint> xlIDs = lIDs; | ||
1288 | string xparm = parm; | ||
1289 | TaintedObject(DetailLogZero, "BSScene.UpdateParameterSet", delegate() { | ||
1290 | BSParam.ParameterDefnBase thisParam; | ||
1291 | if (BSParam.TryGetParameter(xparm, out thisParam)) | ||
1292 | { | ||
1293 | if (thisParam.HasSetOnObject) | ||
1294 | { | ||
1295 | foreach (uint lID in xlIDs) | ||
1296 | { | ||
1297 | BSPhysObject theObject = null; | ||
1298 | if (PhysObjects.TryGetValue(lID, out theObject)) | ||
1299 | thisParam.SetOnObject(this, theObject); | ||
1300 | } | ||
1301 | } | ||
1302 | } | ||
1303 | }); | ||
1304 | } | ||
1305 | |||
1306 | // Get parameter. | ||
1307 | // Return 'false' if not able to get the parameter. | ||
1308 | public bool GetPhysicsParameter(string parm, out string value) | ||
1309 | { | ||
1310 | string val = String.Empty; | ||
1311 | bool ret = false; | ||
1312 | BSParam.ParameterDefnBase theParam; | ||
1313 | if (BSParam.TryGetParameter(parm, out theParam)) | ||
1314 | { | ||
1315 | val = theParam.GetValue(this); | ||
1316 | ret = true; | ||
1317 | } | ||
1318 | value = val; | ||
1319 | return ret; | ||
1320 | } | ||
1321 | |||
1322 | #endregion IPhysicsParameters | ||
1323 | |||
1324 | // Invoke the detailed logger and output something if it's enabled. | ||
1325 | public void DetailLog(string msg, params Object[] args) | ||
1326 | { | ||
1327 | PhysicsLogging.Write(msg, args); | ||
1328 | } | ||
1329 | // Used to fill in the LocalID when there isn't one. It's the correct number of characters. | ||
1330 | public const string DetailLogZero = "0000000000"; | ||
1331 | |||
1332 | } | ||
1333 | } | ||
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs b/OpenSim/Region/PhysicsModules/BulletS/BSShapeCollection.cs index d1de844..b100273 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSShapeCollection.cs | |||
@@ -29,10 +29,10 @@ using System.Collections.Generic; | |||
29 | using System.Text; | 29 | using System.Text; |
30 | using OMV = OpenMetaverse; | 30 | using OMV = OpenMetaverse; |
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Region.Physics.Manager; | 32 | using OpenSim.Region.PhysicsModules.SharedBase; |
33 | using OpenSim.Region.Physics.ConvexDecompositionDotNet; | 33 | using OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet; |
34 | 34 | ||
35 | namespace OpenSim.Region.Physics.BulletSPlugin | 35 | namespace OpenSim.Region.PhysicsModule.BulletS |
36 | { | 36 | { |
37 | public sealed class BSShapeCollection : IDisposable | 37 | public sealed class BSShapeCollection : IDisposable |
38 | { | 38 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs b/OpenSim/Region/PhysicsModules/BulletS/BSShapes.cs index 03a9ddc..79f1a89 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSShapes.cs | |||
@@ -30,13 +30,13 @@ using System.Collections.Generic; | |||
30 | using System.Text; | 30 | using System.Text; |
31 | 31 | ||
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Region.Physics.Manager; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | using OpenSim.Region.Physics.Meshing; | 34 | using OpenSim.Region.PhysicsModules.Meshing; |
35 | using OpenSim.Region.Physics.ConvexDecompositionDotNet; | 35 | using OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet; |
36 | 36 | ||
37 | using OMV = OpenMetaverse; | 37 | using OMV = OpenMetaverse; |
38 | 38 | ||
39 | namespace OpenSim.Region.Physics.BulletSPlugin | 39 | namespace OpenSim.Region.PhysicsModule.BulletS |
40 | { | 40 | { |
41 | // Information class that holds stats for the shape. Which values mean | 41 | // Information class that holds stats for the shape. Which values mean |
42 | // something depends on the type of shape. | 42 | // something depends on the type of shape. |
@@ -299,7 +299,7 @@ public abstract class BSShape | |||
299 | { | 299 | { |
300 | xprim.PrimAssetState = BSPhysObject.PrimAssetCondition.FailedAssetFetch; | 300 | xprim.PrimAssetState = BSPhysObject.PrimAssetCondition.FailedAssetFetch; |
301 | physicsScene.Logger.ErrorFormat("{0} Physical object requires asset but no asset provider. Name={1}", | 301 | physicsScene.Logger.ErrorFormat("{0} Physical object requires asset but no asset provider. Name={1}", |
302 | LogHeader, physicsScene.Name); | 302 | LogHeader, physicsScene.PhysicsSceneName); |
303 | } | 303 | } |
304 | } | 304 | } |
305 | else | 305 | else |
@@ -336,7 +336,7 @@ public abstract class BSShape | |||
336 | if (pScene != null) | 336 | if (pScene != null) |
337 | { | 337 | { |
338 | buff.Append("/rgn="); | 338 | buff.Append("/rgn="); |
339 | buff.Append(pScene.Name); | 339 | buff.Append(pScene.PhysicsSceneName); |
340 | } | 340 | } |
341 | return buff.ToString(); | 341 | return buff.ToString(); |
342 | } | 342 | } |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainHeightmap.cs b/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs index d70b2fb..42fc11b 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainHeightmap.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSTerrainHeightmap.cs | |||
@@ -30,15 +30,14 @@ using System.Text; | |||
30 | 30 | ||
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Region.Framework; | 32 | using OpenSim.Region.Framework; |
33 | using OpenSim.Region.CoreModules; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | using OpenSim.Region.Physics.Manager; | ||
35 | 34 | ||
36 | using Nini.Config; | 35 | using Nini.Config; |
37 | using log4net; | 36 | using log4net; |
38 | 37 | ||
39 | using OpenMetaverse; | 38 | using OpenMetaverse; |
40 | 39 | ||
41 | namespace OpenSim.Region.Physics.BulletSPlugin | 40 | namespace OpenSim.Region.PhysicsModule.BulletS |
42 | { | 41 | { |
43 | public sealed class BSTerrainHeightmap : BSTerrainPhys | 42 | public sealed class BSTerrainHeightmap : BSTerrainPhys |
44 | { | 43 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs b/OpenSim/Region/PhysicsModules/BulletS/BSTerrainManager.cs index 50f917a..d11baa6 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSTerrainManager.cs | |||
@@ -30,15 +30,14 @@ using System.Text; | |||
30 | 30 | ||
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Region.Framework; | 32 | using OpenSim.Region.Framework; |
33 | using OpenSim.Region.CoreModules; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | using OpenSim.Region.Physics.Manager; | ||
35 | 34 | ||
36 | using Nini.Config; | 35 | using Nini.Config; |
37 | using log4net; | 36 | using log4net; |
38 | 37 | ||
39 | using OpenMetaverse; | 38 | using OpenMetaverse; |
40 | 39 | ||
41 | namespace OpenSim.Region.Physics.BulletSPlugin | 40 | namespace OpenSim.Region.PhysicsModule.BulletS |
42 | { | 41 | { |
43 | 42 | ||
44 | // The physical implementation of the terrain is wrapped in this class. | 43 | // The physical implementation of the terrain is wrapped in this class. |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs b/OpenSim/Region/PhysicsModules/BulletS/BSTerrainMesh.cs index e4ca098..cd59b65 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainMesh.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSTerrainMesh.cs | |||
@@ -30,15 +30,14 @@ using System.Text; | |||
30 | 30 | ||
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Region.Framework; | 32 | using OpenSim.Region.Framework; |
33 | using OpenSim.Region.CoreModules; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | using OpenSim.Region.Physics.Manager; | ||
35 | 34 | ||
36 | using Nini.Config; | 35 | using Nini.Config; |
37 | using log4net; | 36 | using log4net; |
38 | 37 | ||
39 | using OpenMetaverse; | 38 | using OpenMetaverse; |
40 | 39 | ||
41 | namespace OpenSim.Region.Physics.BulletSPlugin | 40 | namespace OpenSim.Region.PhysicsModule.BulletS |
42 | { | 41 | { |
43 | public sealed class BSTerrainMesh : BSTerrainPhys | 42 | public sealed class BSTerrainMesh : BSTerrainPhys |
44 | { | 43 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs b/OpenSim/Region/PhysicsModules/BulletS/BulletSimData.cs index 5932461..3329395 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BulletSimData.cs | |||
@@ -29,7 +29,7 @@ using System.Collections.Generic; | |||
29 | using System.Text; | 29 | using System.Text; |
30 | using OMV = OpenMetaverse; | 30 | using OMV = OpenMetaverse; |
31 | 31 | ||
32 | namespace OpenSim.Region.Physics.BulletSPlugin | 32 | namespace OpenSim.Region.PhysicsModule.BulletS |
33 | { | 33 | { |
34 | // Classes to allow some type checking for the API | 34 | // Classes to allow some type checking for the API |
35 | // These hold pointers to allocated objects in the unmanaged space. | 35 | // These hold pointers to allocated objects in the unmanaged space. |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt b/OpenSim/Region/PhysicsModules/BulletS/BulletSimTODO.txt index 0453376..0453376 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt +++ b/OpenSim/Region/PhysicsModules/BulletS/BulletSimTODO.txt | |||
diff --git a/OpenSim/Region/PhysicsModules/BulletS/ExtendedPhysics.cs b/OpenSim/Region/PhysicsModules/BulletS/ExtendedPhysics.cs new file mode 100755 index 0000000..2ba3c5a --- /dev/null +++ b/OpenSim/Region/PhysicsModules/BulletS/ExtendedPhysics.cs | |||
@@ -0,0 +1,622 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyrightD | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | using System; | ||
28 | using System.Collections.Generic; | ||
29 | using System.Linq; | ||
30 | using System.Reflection; | ||
31 | using System.Text; | ||
32 | using System.Threading; | ||
33 | |||
34 | using OpenSim.Framework; | ||
35 | using OpenSim.Region.Framework; | ||
36 | using OpenSim.Region.Framework.Interfaces; | ||
37 | using OpenSim.Region.Framework.Scenes; | ||
38 | using OpenSim.Region.PhysicsModules.SharedBase; | ||
39 | |||
40 | using Mono.Addins; | ||
41 | using Nini.Config; | ||
42 | using log4net; | ||
43 | using OpenMetaverse; | ||
44 | |||
45 | namespace OpenSim.Region.PhysicsModule.BulletS | ||
46 | { | ||
47 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | ||
48 | public class ExtendedPhysics : INonSharedRegionModule | ||
49 | { | ||
50 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
51 | private static string LogHeader = "[EXTENDED PHYSICS]"; | ||
52 | |||
53 | // ============================================================= | ||
54 | // Since BulletSim is a plugin, this these values aren't defined easily in one place. | ||
55 | // This table must correspond to an identical table in BSScene. | ||
56 | |||
57 | // Per scene functions. See BSScene. | ||
58 | |||
59 | // Per avatar functions. See BSCharacter. | ||
60 | |||
61 | // Per prim functions. See BSPrim. | ||
62 | public const string PhysFunctGetLinksetType = "BulletSim.GetLinksetType"; | ||
63 | public const string PhysFunctSetLinksetType = "BulletSim.SetLinksetType"; | ||
64 | public const string PhysFunctChangeLinkFixed = "BulletSim.ChangeLinkFixed"; | ||
65 | public const string PhysFunctChangeLinkType = "BulletSim.ChangeLinkType"; | ||
66 | public const string PhysFunctGetLinkType = "BulletSim.GetLinkType"; | ||
67 | public const string PhysFunctChangeLinkParams = "BulletSim.ChangeLinkParams"; | ||
68 | public const string PhysFunctAxisLockLimits = "BulletSim.AxisLockLimits"; | ||
69 | |||
70 | // ============================================================= | ||
71 | |||
72 | private IConfig Configuration { get; set; } | ||
73 | private bool Enabled { get; set; } | ||
74 | private Scene BaseScene { get; set; } | ||
75 | private IScriptModuleComms Comms { get; set; } | ||
76 | |||
77 | #region INonSharedRegionModule | ||
78 | |||
79 | public string Name { get { return this.GetType().Name; } } | ||
80 | |||
81 | public void Initialise(IConfigSource config) | ||
82 | { | ||
83 | BaseScene = null; | ||
84 | Enabled = false; | ||
85 | Configuration = null; | ||
86 | Comms = null; | ||
87 | |||
88 | try | ||
89 | { | ||
90 | if ((Configuration = config.Configs["ExtendedPhysics"]) != null) | ||
91 | { | ||
92 | Enabled = Configuration.GetBoolean("Enabled", Enabled); | ||
93 | } | ||
94 | } | ||
95 | catch (Exception e) | ||
96 | { | ||
97 | m_log.ErrorFormat("{0} Initialization error: {0}", LogHeader, e); | ||
98 | } | ||
99 | |||
100 | m_log.InfoFormat("{0} module {1} enabled", LogHeader, (Enabled ? "is" : "is not")); | ||
101 | } | ||
102 | |||
103 | public void Close() | ||
104 | { | ||
105 | if (BaseScene != null) | ||
106 | { | ||
107 | BaseScene.EventManager.OnObjectAddedToScene -= EventManager_OnObjectAddedToScene; | ||
108 | BaseScene.EventManager.OnSceneObjectPartUpdated -= EventManager_OnSceneObjectPartUpdated; | ||
109 | BaseScene = null; | ||
110 | } | ||
111 | } | ||
112 | |||
113 | public void AddRegion(Scene scene) | ||
114 | { | ||
115 | } | ||
116 | |||
117 | public void RemoveRegion(Scene scene) | ||
118 | { | ||
119 | if (BaseScene != null && BaseScene == scene) | ||
120 | { | ||
121 | Close(); | ||
122 | } | ||
123 | } | ||
124 | |||
125 | public void RegionLoaded(Scene scene) | ||
126 | { | ||
127 | if (!Enabled) return; | ||
128 | |||
129 | BaseScene = scene; | ||
130 | |||
131 | Comms = BaseScene.RequestModuleInterface<IScriptModuleComms>(); | ||
132 | if (Comms == null) | ||
133 | { | ||
134 | m_log.WarnFormat("{0} ScriptModuleComms interface not defined", LogHeader); | ||
135 | Enabled = false; | ||
136 | |||
137 | return; | ||
138 | } | ||
139 | |||
140 | // Register as LSL functions all the [ScriptInvocation] marked methods. | ||
141 | Comms.RegisterScriptInvocations(this); | ||
142 | Comms.RegisterConstants(this); | ||
143 | |||
144 | // When an object is modified, we might need to update its extended physics parameters | ||
145 | BaseScene.EventManager.OnObjectAddedToScene += EventManager_OnObjectAddedToScene; | ||
146 | BaseScene.EventManager.OnSceneObjectPartUpdated += EventManager_OnSceneObjectPartUpdated; | ||
147 | |||
148 | } | ||
149 | |||
150 | public Type ReplaceableInterface { get { return null; } } | ||
151 | |||
152 | #endregion // INonSharedRegionModule | ||
153 | |||
154 | private void EventManager_OnObjectAddedToScene(SceneObjectGroup obj) | ||
155 | { | ||
156 | } | ||
157 | |||
158 | // Event generated when some property of a prim changes. | ||
159 | private void EventManager_OnSceneObjectPartUpdated(SceneObjectPart sop, bool isFullUpdate) | ||
160 | { | ||
161 | } | ||
162 | |||
163 | [ScriptConstant] | ||
164 | public const int PHYS_CENTER_OF_MASS = 1 << 0; | ||
165 | |||
166 | [ScriptInvocation] | ||
167 | public string physGetEngineType(UUID hostID, UUID scriptID) | ||
168 | { | ||
169 | string ret = string.Empty; | ||
170 | |||
171 | if (BaseScene.PhysicsScene != null) | ||
172 | { | ||
173 | ret = BaseScene.PhysicsScene.EngineType; | ||
174 | } | ||
175 | |||
176 | return ret; | ||
177 | } | ||
178 | |||
179 | // Code for specifying params. | ||
180 | // The choice if 14700 is arbitrary and only serves to catch parameter code misuse. | ||
181 | [ScriptConstant] | ||
182 | public const int PHYS_AXIS_LOCK_LINEAR = 14700; | ||
183 | [ScriptConstant] | ||
184 | public const int PHYS_AXIS_LOCK_LINEAR_X = 14701; | ||
185 | [ScriptConstant] | ||
186 | public const int PHYS_AXIS_LIMIT_LINEAR_X = 14702; | ||
187 | [ScriptConstant] | ||
188 | public const int PHYS_AXIS_LOCK_LINEAR_Y = 14703; | ||
189 | [ScriptConstant] | ||
190 | public const int PHYS_AXIS_LIMIT_LINEAR_Y = 14704; | ||
191 | [ScriptConstant] | ||
192 | public const int PHYS_AXIS_LOCK_LINEAR_Z = 14705; | ||
193 | [ScriptConstant] | ||
194 | public const int PHYS_AXIS_LIMIT_LINEAR_Z = 14706; | ||
195 | [ScriptConstant] | ||
196 | public const int PHYS_AXIS_LOCK_ANGULAR = 14707; | ||
197 | [ScriptConstant] | ||
198 | public const int PHYS_AXIS_LOCK_ANGULAR_X = 14708; | ||
199 | [ScriptConstant] | ||
200 | public const int PHYS_AXIS_LIMIT_ANGULAR_X = 14709; | ||
201 | [ScriptConstant] | ||
202 | public const int PHYS_AXIS_LOCK_ANGULAR_Y = 14710; | ||
203 | [ScriptConstant] | ||
204 | public const int PHYS_AXIS_LIMIT_ANGULAR_Y = 14711; | ||
205 | [ScriptConstant] | ||
206 | public const int PHYS_AXIS_LOCK_ANGULAR_Z = 14712; | ||
207 | [ScriptConstant] | ||
208 | public const int PHYS_AXIS_LIMIT_ANGULAR_Z = 14713; | ||
209 | [ScriptConstant] | ||
210 | public const int PHYS_AXIS_UNLOCK_LINEAR = 14714; | ||
211 | [ScriptConstant] | ||
212 | public const int PHYS_AXIS_UNLOCK_LINEAR_X = 14715; | ||
213 | [ScriptConstant] | ||
214 | public const int PHYS_AXIS_UNLOCK_LINEAR_Y = 14716; | ||
215 | [ScriptConstant] | ||
216 | public const int PHYS_AXIS_UNLOCK_LINEAR_Z = 14717; | ||
217 | [ScriptConstant] | ||
218 | public const int PHYS_AXIS_UNLOCK_ANGULAR = 14718; | ||
219 | [ScriptConstant] | ||
220 | public const int PHYS_AXIS_UNLOCK_ANGULAR_X = 14719; | ||
221 | [ScriptConstant] | ||
222 | public const int PHYS_AXIS_UNLOCK_ANGULAR_Y = 14720; | ||
223 | [ScriptConstant] | ||
224 | public const int PHYS_AXIS_UNLOCK_ANGULAR_Z = 14721; | ||
225 | [ScriptConstant] | ||
226 | public const int PHYS_AXIS_UNLOCK = 14722; | ||
227 | // physAxisLockLimits() | ||
228 | [ScriptInvocation] | ||
229 | public int physAxisLock(UUID hostID, UUID scriptID, object[] parms) | ||
230 | { | ||
231 | int ret = -1; | ||
232 | if (!Enabled) return ret; | ||
233 | |||
234 | PhysicsActor rootPhysActor; | ||
235 | if (GetRootPhysActor(hostID, out rootPhysActor)) | ||
236 | { | ||
237 | object[] parms2 = AddToBeginningOfArray(rootPhysActor, null, parms); | ||
238 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctAxisLockLimits, parms2)); | ||
239 | } | ||
240 | |||
241 | return ret; | ||
242 | } | ||
243 | |||
244 | [ScriptConstant] | ||
245 | public const int PHYS_LINKSET_TYPE_CONSTRAINT = 0; | ||
246 | [ScriptConstant] | ||
247 | public const int PHYS_LINKSET_TYPE_COMPOUND = 1; | ||
248 | [ScriptConstant] | ||
249 | public const int PHYS_LINKSET_TYPE_MANUAL = 2; | ||
250 | |||
251 | [ScriptInvocation] | ||
252 | public int physSetLinksetType(UUID hostID, UUID scriptID, int linksetType) | ||
253 | { | ||
254 | int ret = -1; | ||
255 | if (!Enabled) return ret; | ||
256 | |||
257 | // The part that is requesting the change. | ||
258 | SceneObjectPart requestingPart = BaseScene.GetSceneObjectPart(hostID); | ||
259 | |||
260 | if (requestingPart != null) | ||
261 | { | ||
262 | // The change is always made to the root of a linkset. | ||
263 | SceneObjectGroup containingGroup = requestingPart.ParentGroup; | ||
264 | SceneObjectPart rootPart = containingGroup.RootPart; | ||
265 | |||
266 | if (rootPart != null) | ||
267 | { | ||
268 | PhysicsActor rootPhysActor = rootPart.PhysActor; | ||
269 | if (rootPhysActor != null) | ||
270 | { | ||
271 | if (rootPhysActor.IsPhysical) | ||
272 | { | ||
273 | // Change a physical linkset by making non-physical, waiting for one heartbeat so all | ||
274 | // the prim and linkset state is updated, changing the type and making the | ||
275 | // linkset physical again. | ||
276 | containingGroup.ScriptSetPhysicsStatus(false); | ||
277 | Thread.Sleep(150); // longer than one heartbeat tick | ||
278 | |||
279 | // A kludge for the moment. | ||
280 | // Since compound linksets move the children but don't generate position updates to the | ||
281 | // simulator, it is possible for compound linkset children to have out-of-sync simulator | ||
282 | // and physical positions. The following causes the simulator to push the real child positions | ||
283 | // down into the physics engine to get everything synced. | ||
284 | containingGroup.UpdateGroupPosition(containingGroup.AbsolutePosition); | ||
285 | containingGroup.UpdateGroupRotationR(containingGroup.GroupRotation); | ||
286 | |||
287 | object[] parms2 = { rootPhysActor, null, linksetType }; | ||
288 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctSetLinksetType, parms2)); | ||
289 | Thread.Sleep(150); // longer than one heartbeat tick | ||
290 | |||
291 | containingGroup.ScriptSetPhysicsStatus(true); | ||
292 | } | ||
293 | else | ||
294 | { | ||
295 | // Non-physical linksets don't have a physical instantiation so there is no state to | ||
296 | // worry about being updated. | ||
297 | object[] parms2 = { rootPhysActor, null, linksetType }; | ||
298 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctSetLinksetType, parms2)); | ||
299 | } | ||
300 | } | ||
301 | else | ||
302 | { | ||
303 | m_log.WarnFormat("{0} physSetLinksetType: root part does not have a physics actor. rootName={1}, hostID={2}", | ||
304 | LogHeader, rootPart.Name, hostID); | ||
305 | } | ||
306 | } | ||
307 | else | ||
308 | { | ||
309 | m_log.WarnFormat("{0} physSetLinksetType: root part does not exist. RequestingPartName={1}, hostID={2}", | ||
310 | LogHeader, requestingPart.Name, hostID); | ||
311 | } | ||
312 | } | ||
313 | else | ||
314 | { | ||
315 | m_log.WarnFormat("{0} physSetLinsetType: cannot find script object in scene. hostID={1}", LogHeader, hostID); | ||
316 | } | ||
317 | return ret; | ||
318 | } | ||
319 | |||
320 | [ScriptInvocation] | ||
321 | public int physGetLinksetType(UUID hostID, UUID scriptID) | ||
322 | { | ||
323 | int ret = -1; | ||
324 | if (!Enabled) return ret; | ||
325 | |||
326 | PhysicsActor rootPhysActor; | ||
327 | if (GetRootPhysActor(hostID, out rootPhysActor)) | ||
328 | { | ||
329 | object[] parms2 = { rootPhysActor, null }; | ||
330 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctGetLinksetType, parms2)); | ||
331 | } | ||
332 | else | ||
333 | { | ||
334 | m_log.WarnFormat("{0} physGetLinsetType: cannot find script object in scene. hostID={1}", LogHeader, hostID); | ||
335 | } | ||
336 | return ret; | ||
337 | } | ||
338 | |||
339 | [ScriptConstant] | ||
340 | public const int PHYS_LINK_TYPE_FIXED = 1234; | ||
341 | [ScriptConstant] | ||
342 | public const int PHYS_LINK_TYPE_HINGE = 4; | ||
343 | [ScriptConstant] | ||
344 | public const int PHYS_LINK_TYPE_SPRING = 9; | ||
345 | [ScriptConstant] | ||
346 | public const int PHYS_LINK_TYPE_6DOF = 6; | ||
347 | [ScriptConstant] | ||
348 | public const int PHYS_LINK_TYPE_SLIDER = 7; | ||
349 | |||
350 | // physChangeLinkType(integer linkNum, integer typeCode) | ||
351 | [ScriptInvocation] | ||
352 | public int physChangeLinkType(UUID hostID, UUID scriptID, int linkNum, int typeCode) | ||
353 | { | ||
354 | int ret = -1; | ||
355 | if (!Enabled) return ret; | ||
356 | |||
357 | PhysicsActor rootPhysActor; | ||
358 | PhysicsActor childPhysActor; | ||
359 | |||
360 | if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor)) | ||
361 | { | ||
362 | object[] parms2 = { rootPhysActor, childPhysActor, typeCode }; | ||
363 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctChangeLinkType, parms2)); | ||
364 | } | ||
365 | |||
366 | return ret; | ||
367 | } | ||
368 | |||
369 | // physGetLinkType(integer linkNum) | ||
370 | [ScriptInvocation] | ||
371 | public int physGetLinkType(UUID hostID, UUID scriptID, int linkNum) | ||
372 | { | ||
373 | int ret = -1; | ||
374 | if (!Enabled) return ret; | ||
375 | |||
376 | PhysicsActor rootPhysActor; | ||
377 | PhysicsActor childPhysActor; | ||
378 | |||
379 | if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor)) | ||
380 | { | ||
381 | object[] parms2 = { rootPhysActor, childPhysActor }; | ||
382 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctGetLinkType, parms2)); | ||
383 | } | ||
384 | |||
385 | return ret; | ||
386 | } | ||
387 | |||
388 | // physChangeLinkFixed(integer linkNum) | ||
389 | // Change the link between the root and the linkNum into a fixed, static physical connection. | ||
390 | [ScriptInvocation] | ||
391 | public int physChangeLinkFixed(UUID hostID, UUID scriptID, int linkNum) | ||
392 | { | ||
393 | int ret = -1; | ||
394 | if (!Enabled) return ret; | ||
395 | |||
396 | PhysicsActor rootPhysActor; | ||
397 | PhysicsActor childPhysActor; | ||
398 | |||
399 | if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor)) | ||
400 | { | ||
401 | object[] parms2 = { rootPhysActor, childPhysActor , PHYS_LINK_TYPE_FIXED }; | ||
402 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctChangeLinkType, parms2)); | ||
403 | } | ||
404 | |||
405 | return ret; | ||
406 | } | ||
407 | |||
408 | // Code for specifying params. | ||
409 | // The choice if 14400 is arbitrary and only serves to catch parameter code misuse. | ||
410 | public const int PHYS_PARAM_MIN = 14401; | ||
411 | |||
412 | [ScriptConstant] | ||
413 | public const int PHYS_PARAM_FRAMEINA_LOC = 14401; | ||
414 | [ScriptConstant] | ||
415 | public const int PHYS_PARAM_FRAMEINA_ROT = 14402; | ||
416 | [ScriptConstant] | ||
417 | public const int PHYS_PARAM_FRAMEINB_LOC = 14403; | ||
418 | [ScriptConstant] | ||
419 | public const int PHYS_PARAM_FRAMEINB_ROT = 14404; | ||
420 | [ScriptConstant] | ||
421 | public const int PHYS_PARAM_LINEAR_LIMIT_LOW = 14405; | ||
422 | [ScriptConstant] | ||
423 | public const int PHYS_PARAM_LINEAR_LIMIT_HIGH = 14406; | ||
424 | [ScriptConstant] | ||
425 | public const int PHYS_PARAM_ANGULAR_LIMIT_LOW = 14407; | ||
426 | [ScriptConstant] | ||
427 | public const int PHYS_PARAM_ANGULAR_LIMIT_HIGH = 14408; | ||
428 | [ScriptConstant] | ||
429 | public const int PHYS_PARAM_USE_FRAME_OFFSET = 14409; | ||
430 | [ScriptConstant] | ||
431 | public const int PHYS_PARAM_ENABLE_TRANSMOTOR = 14410; | ||
432 | [ScriptConstant] | ||
433 | public const int PHYS_PARAM_TRANSMOTOR_MAXVEL = 14411; | ||
434 | [ScriptConstant] | ||
435 | public const int PHYS_PARAM_TRANSMOTOR_MAXFORCE = 14412; | ||
436 | [ScriptConstant] | ||
437 | public const int PHYS_PARAM_CFM = 14413; | ||
438 | [ScriptConstant] | ||
439 | public const int PHYS_PARAM_ERP = 14414; | ||
440 | [ScriptConstant] | ||
441 | public const int PHYS_PARAM_SOLVER_ITERATIONS = 14415; | ||
442 | [ScriptConstant] | ||
443 | public const int PHYS_PARAM_SPRING_AXIS_ENABLE = 14416; | ||
444 | [ScriptConstant] | ||
445 | public const int PHYS_PARAM_SPRING_DAMPING = 14417; | ||
446 | [ScriptConstant] | ||
447 | public const int PHYS_PARAM_SPRING_STIFFNESS = 14418; | ||
448 | [ScriptConstant] | ||
449 | public const int PHYS_PARAM_LINK_TYPE = 14419; | ||
450 | [ScriptConstant] | ||
451 | public const int PHYS_PARAM_USE_LINEAR_FRAMEA = 14420; | ||
452 | [ScriptConstant] | ||
453 | public const int PHYS_PARAM_SPRING_EQUILIBRIUM_POINT = 14421; | ||
454 | |||
455 | public const int PHYS_PARAM_MAX = 14421; | ||
456 | |||
457 | // Used when specifying a parameter that has settings for the three linear and three angular axis | ||
458 | [ScriptConstant] | ||
459 | public const int PHYS_AXIS_ALL = -1; | ||
460 | [ScriptConstant] | ||
461 | public const int PHYS_AXIS_LINEAR_ALL = -2; | ||
462 | [ScriptConstant] | ||
463 | public const int PHYS_AXIS_ANGULAR_ALL = -3; | ||
464 | [ScriptConstant] | ||
465 | public const int PHYS_AXIS_LINEAR_X = 0; | ||
466 | [ScriptConstant] | ||
467 | public const int PHYS_AXIS_LINEAR_Y = 1; | ||
468 | [ScriptConstant] | ||
469 | public const int PHYS_AXIS_LINEAR_Z = 2; | ||
470 | [ScriptConstant] | ||
471 | public const int PHYS_AXIS_ANGULAR_X = 3; | ||
472 | [ScriptConstant] | ||
473 | public const int PHYS_AXIS_ANGULAR_Y = 4; | ||
474 | [ScriptConstant] | ||
475 | public const int PHYS_AXIS_ANGULAR_Z = 5; | ||
476 | |||
477 | // physChangeLinkParams(integer linkNum, [ PHYS_PARAM_*, value, PHYS_PARAM_*, value, ...]) | ||
478 | [ScriptInvocation] | ||
479 | public int physChangeLinkParams(UUID hostID, UUID scriptID, int linkNum, object[] parms) | ||
480 | { | ||
481 | int ret = -1; | ||
482 | if (!Enabled) return ret; | ||
483 | |||
484 | PhysicsActor rootPhysActor; | ||
485 | PhysicsActor childPhysActor; | ||
486 | |||
487 | if (GetRootAndChildPhysActors(hostID, linkNum, out rootPhysActor, out childPhysActor)) | ||
488 | { | ||
489 | object[] parms2 = AddToBeginningOfArray(rootPhysActor, childPhysActor, parms); | ||
490 | ret = MakeIntError(rootPhysActor.Extension(PhysFunctChangeLinkParams, parms2)); | ||
491 | } | ||
492 | |||
493 | return ret; | ||
494 | } | ||
495 | |||
496 | private bool GetRootPhysActor(UUID hostID, out PhysicsActor rootPhysActor) | ||
497 | { | ||
498 | SceneObjectGroup containingGroup; | ||
499 | SceneObjectPart rootPart; | ||
500 | return GetRootPhysActor(hostID, out containingGroup, out rootPart, out rootPhysActor); | ||
501 | } | ||
502 | |||
503 | private bool GetRootPhysActor(UUID hostID, out SceneObjectGroup containingGroup, out SceneObjectPart rootPart, out PhysicsActor rootPhysActor) | ||
504 | { | ||
505 | bool ret = false; | ||
506 | rootPhysActor = null; | ||
507 | containingGroup = null; | ||
508 | rootPart = null; | ||
509 | |||
510 | SceneObjectPart requestingPart; | ||
511 | |||
512 | requestingPart = BaseScene.GetSceneObjectPart(hostID); | ||
513 | if (requestingPart != null) | ||
514 | { | ||
515 | // The type is is always on the root of a linkset. | ||
516 | containingGroup = requestingPart.ParentGroup; | ||
517 | if (containingGroup != null && !containingGroup.IsDeleted) | ||
518 | { | ||
519 | rootPart = containingGroup.RootPart; | ||
520 | if (rootPart != null) | ||
521 | { | ||
522 | rootPhysActor = rootPart.PhysActor; | ||
523 | if (rootPhysActor != null) | ||
524 | { | ||
525 | ret = true; | ||
526 | } | ||
527 | else | ||
528 | { | ||
529 | m_log.WarnFormat("{0} GetRootAndChildPhysActors: Root part does not have a physics actor. rootName={1}, hostID={2}", | ||
530 | LogHeader, rootPart.Name, hostID); | ||
531 | } | ||
532 | } | ||
533 | else | ||
534 | { | ||
535 | m_log.WarnFormat("{0} GetRootAndChildPhysActors: Root part does not exist. RequestingPartName={1}, hostID={2}", | ||
536 | LogHeader, requestingPart.Name, hostID); | ||
537 | } | ||
538 | } | ||
539 | else | ||
540 | { | ||
541 | m_log.WarnFormat("{0} GetRootAndChildPhysActors: Containing group missing or deleted. hostID={1}", LogHeader, hostID); | ||
542 | } | ||
543 | } | ||
544 | else | ||
545 | { | ||
546 | m_log.WarnFormat("{0} GetRootAndChildPhysActors: cannot find script object in scene. hostID={1}", LogHeader, hostID); | ||
547 | } | ||
548 | |||
549 | return ret; | ||
550 | } | ||
551 | |||
552 | // Find the root and child PhysActors based on the linkNum. | ||
553 | // Return 'true' if both are found and returned. | ||
554 | private bool GetRootAndChildPhysActors(UUID hostID, int linkNum, out PhysicsActor rootPhysActor, out PhysicsActor childPhysActor) | ||
555 | { | ||
556 | bool ret = false; | ||
557 | rootPhysActor = null; | ||
558 | childPhysActor = null; | ||
559 | |||
560 | SceneObjectGroup containingGroup; | ||
561 | SceneObjectPart rootPart; | ||
562 | |||
563 | if (GetRootPhysActor(hostID, out containingGroup, out rootPart, out rootPhysActor)) | ||
564 | { | ||
565 | SceneObjectPart linkPart = containingGroup.GetLinkNumPart(linkNum); | ||
566 | if (linkPart != null) | ||
567 | { | ||
568 | childPhysActor = linkPart.PhysActor; | ||
569 | if (childPhysActor != null) | ||
570 | { | ||
571 | ret = true; | ||
572 | } | ||
573 | else | ||
574 | { | ||
575 | m_log.WarnFormat("{0} GetRootAndChildPhysActors: Link part has no physical actor. rootName={1}, hostID={2}, linknum={3}", | ||
576 | LogHeader, rootPart.Name, hostID, linkNum); | ||
577 | } | ||
578 | } | ||
579 | else | ||
580 | { | ||
581 | m_log.WarnFormat("{0} GetRootAndChildPhysActors: Could not find linknum part. rootName={1}, hostID={2}, linknum={3}", | ||
582 | LogHeader, rootPart.Name, hostID, linkNum); | ||
583 | } | ||
584 | } | ||
585 | else | ||
586 | { | ||
587 | m_log.WarnFormat("{0} GetRootAndChildPhysActors: Root part does not have a physics actor. rootName={1}, hostID={2}", | ||
588 | LogHeader, rootPart.Name, hostID); | ||
589 | } | ||
590 | |||
591 | return ret; | ||
592 | } | ||
593 | |||
594 | // Return an array of objects with the passed object as the first object of a new array | ||
595 | private object[] AddToBeginningOfArray(object firstOne, object secondOne, object[] prevArray) | ||
596 | { | ||
597 | object[] newArray = new object[2 + prevArray.Length]; | ||
598 | newArray[0] = firstOne; | ||
599 | newArray[1] = secondOne; | ||
600 | prevArray.CopyTo(newArray, 2); | ||
601 | return newArray; | ||
602 | } | ||
603 | |||
604 | // Extension() returns an object. Convert that object into the integer error we expect to return. | ||
605 | private int MakeIntError(object extensionRet) | ||
606 | { | ||
607 | int ret = -1; | ||
608 | if (extensionRet != null) | ||
609 | { | ||
610 | try | ||
611 | { | ||
612 | ret = (int)extensionRet; | ||
613 | } | ||
614 | catch | ||
615 | { | ||
616 | ret = -1; | ||
617 | } | ||
618 | } | ||
619 | return ret; | ||
620 | } | ||
621 | } | ||
622 | } | ||
diff --git a/OpenSim/Region/Physics/BulletSPlugin/Properties/AssemblyInfo.cs b/OpenSim/Region/PhysicsModules/BulletS/Properties/AssemblyInfo.cs index 4f90eee..5a33bdf 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/Properties/AssemblyInfo.cs | |||
@@ -1,6 +1,7 @@ | |||
1 | using System.Reflection; | 1 | using System.Reflection; |
2 | using System.Runtime.CompilerServices; | 2 | using System.Runtime.CompilerServices; |
3 | using System.Runtime.InteropServices; | 3 | using System.Runtime.InteropServices; |
4 | using Mono.Addins; | ||
4 | 5 | ||
5 | // General Information about an assembly is controlled through the following | 6 | // General Information about an assembly is controlled through the following |
6 | // set of attributes. Change these attribute values to modify the information | 7 | // set of attributes. Change these attribute values to modify the information |
@@ -31,3 +32,5 @@ using System.Runtime.InteropServices; | |||
31 | // | 32 | // |
32 | [assembly: AssemblyVersion("0.8.2.*")] | 33 | [assembly: AssemblyVersion("0.8.2.*")] |
33 | 34 | ||
35 | [assembly: Addin("OpenSim.Region.PhysicsModule.BulletS", OpenSim.VersionInfo.VersionNumber)] | ||
36 | [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] | ||
diff --git a/OpenSim/Region/Physics/BulletSPlugin/Tests/BasicVehicles.cs b/OpenSim/Region/PhysicsModules/BulletS/Tests/BasicVehicles.cs index 48e74eb..35eba29 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/Tests/BasicVehicles.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/Tests/BasicVehicles.cs | |||
@@ -34,13 +34,13 @@ using NUnit.Framework; | |||
34 | using log4net; | 34 | using log4net; |
35 | 35 | ||
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Region.Physics.BulletSPlugin; | 37 | using OpenSim.Region.PhysicsModule.BulletS; |
38 | using OpenSim.Region.Physics.Manager; | 38 | using OpenSim.Region.PhysicsModules.SharedBase; |
39 | using OpenSim.Tests.Common; | 39 | using OpenSim.Tests.Common; |
40 | 40 | ||
41 | using OpenMetaverse; | 41 | using OpenMetaverse; |
42 | 42 | ||
43 | namespace OpenSim.Region.Physics.BulletSPlugin.Tests | 43 | namespace OpenSim.Region.PhysicsModule.BulletS.Tests |
44 | { | 44 | { |
45 | [TestFixture] | 45 | [TestFixture] |
46 | public class BasicVehicles : OpenSimTestCase | 46 | public class BasicVehicles : OpenSimTestCase |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/Tests/BulletSimTests.cs b/OpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTests.cs index 35cbc1d..0be1f4c 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/Tests/BulletSimTests.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTests.cs | |||
@@ -35,7 +35,7 @@ using log4net; | |||
35 | 35 | ||
36 | using OpenSim.Tests.Common; | 36 | using OpenSim.Tests.Common; |
37 | 37 | ||
38 | namespace OpenSim.Region.Physics.BulletSPlugin.Tests | 38 | namespace OpenSim.Region.PhysicsModule.BulletS.Tests |
39 | { | 39 | { |
40 | [TestFixture] | 40 | [TestFixture] |
41 | public class BulletSimTests : OpenSimTestCase | 41 | public class BulletSimTests : OpenSimTestCase |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/Tests/BulletSimTestsUtil.cs b/OpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTestsUtil.cs index 775bca2..4eeea4d 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/Tests/BulletSimTestsUtil.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTestsUtil.cs | |||
@@ -33,12 +33,13 @@ using System.Text; | |||
33 | using Nini.Config; | 33 | using Nini.Config; |
34 | 34 | ||
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Region.Physics.Manager; | 36 | using OpenSim.Region.PhysicsModules.SharedBase; |
37 | using OpenSim.Region.Physics.Meshing; | 37 | using OpenSim.Region.PhysicsModules.Meshing; |
38 | using OpenSim.Region.Framework.Interfaces; | ||
38 | 39 | ||
39 | using OpenMetaverse; | 40 | using OpenMetaverse; |
40 | 41 | ||
41 | namespace OpenSim.Region.Physics.BulletSPlugin.Tests | 42 | namespace OpenSim.Region.PhysicsModule.BulletS.Tests |
42 | { | 43 | { |
43 | // Utility functions for building up and tearing down the sample physics environments | 44 | // Utility functions for building up and tearing down the sample physics environments |
44 | public static class BulletSimTestsUtil | 45 | public static class BulletSimTestsUtil |
@@ -78,22 +79,30 @@ public static class BulletSimTestsUtil | |||
78 | bulletSimConfig.Set("VehicleLoggingEnabled","True"); | 79 | bulletSimConfig.Set("VehicleLoggingEnabled","True"); |
79 | } | 80 | } |
80 | 81 | ||
81 | PhysicsPluginManager physicsPluginManager; | ||
82 | physicsPluginManager = new PhysicsPluginManager(); | ||
83 | physicsPluginManager.LoadPluginsFromAssemblies("Physics"); | ||
84 | |||
85 | Vector3 regionExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight); | 82 | Vector3 regionExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight); |
86 | 83 | ||
87 | PhysicsScene pScene = physicsPluginManager.GetPhysicsScene( | 84 | RegionInfo info = new RegionInfo(); |
88 | "BulletSim", "Meshmerizer", openSimINI, "BSTestRegion", regionExtent); | 85 | info.RegionName = "BSTestRegion"; |
86 | info.RegionSizeX = info.RegionSizeY = info.RegionSizeZ = Constants.RegionSize; | ||
87 | OpenSim.Region.Framework.Scenes.Scene scene = new OpenSim.Region.Framework.Scenes.Scene(info); | ||
88 | |||
89 | IMesher mesher = new OpenSim.Region.PhysicsModules.Meshing.Meshmerizer(); | ||
90 | INonSharedRegionModule mod = mesher as INonSharedRegionModule; | ||
91 | mod.Initialise(openSimINI); | ||
92 | mod.AddRegion(scene); | ||
93 | mod.RegionLoaded(scene); | ||
89 | 94 | ||
90 | BSScene bsScene = pScene as BSScene; | 95 | BSScene pScene = new BSScene(); |
96 | mod = (pScene as INonSharedRegionModule); | ||
97 | mod.Initialise(openSimINI); | ||
98 | mod.AddRegion(scene); | ||
99 | mod.RegionLoaded(scene); | ||
91 | 100 | ||
92 | // Since the asset requestor is not initialized, any mesh or sculptie will be a cube. | 101 | // Since the asset requestor is not initialized, any mesh or sculptie will be a cube. |
93 | // In the future, add a fake asset fetcher to get meshes and sculpts. | 102 | // In the future, add a fake asset fetcher to get meshes and sculpts. |
94 | // bsScene.RequestAssetMethod = ???; | 103 | // bsScene.RequestAssetMethod = ???; |
95 | 104 | ||
96 | return bsScene; | 105 | return pScene; |
97 | } | 106 | } |
98 | 107 | ||
99 | } | 108 | } |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/Tests/HullCreation.cs b/OpenSim/Region/PhysicsModules/BulletS/Tests/HullCreation.cs index 5a5de11..c0cf19a 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/Tests/HullCreation.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/Tests/HullCreation.cs | |||
@@ -34,13 +34,13 @@ using NUnit.Framework; | |||
34 | using log4net; | 34 | using log4net; |
35 | 35 | ||
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Region.Physics.BulletSPlugin; | 37 | using OpenSim.Region.PhysicsModule.BulletS; |
38 | using OpenSim.Region.Physics.Manager; | 38 | using OpenSim.Region.PhysicsModules.SharedBase; |
39 | using OpenSim.Tests.Common; | 39 | using OpenSim.Tests.Common; |
40 | 40 | ||
41 | using OpenMetaverse; | 41 | using OpenMetaverse; |
42 | 42 | ||
43 | namespace OpenSim.Region.Physics.BulletSPlugin.Tests | 43 | namespace OpenSim.Region.PhysicsModule.BulletS.Tests |
44 | { | 44 | { |
45 | [TestFixture] | 45 | [TestFixture] |
46 | public class HullCreation : OpenSimTestCase | 46 | public class HullCreation : OpenSimTestCase |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/CTri.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/CTri.cs index 4d84c44..7ad689e 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/CTri.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/CTri.cs | |||
@@ -28,7 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | 30 | ||
31 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 31 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
32 | { | 32 | { |
33 | public class Wpoint | 33 | public class Wpoint |
34 | { | 34 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/Concavity.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/Concavity.cs index cc6383a..4140d25 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/Concavity.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/Concavity.cs | |||
@@ -29,7 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Text; | 30 | using System.Text; |
31 | 31 | ||
32 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 32 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
33 | { | 33 | { |
34 | public static class Concavity | 34 | public static class Concavity |
35 | { | 35 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/ConvexBuilder.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/ConvexBuilder.cs index dfaede1..70c3a2b 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/ConvexBuilder.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/ConvexBuilder.cs | |||
@@ -29,7 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Diagnostics; | 30 | using System.Diagnostics; |
31 | 31 | ||
32 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 32 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
33 | { | 33 | { |
34 | public class DecompDesc | 34 | public class DecompDesc |
35 | { | 35 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/ConvexDecomposition.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/ConvexDecomposition.cs index 2e2bb70..5046bce 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/ConvexDecomposition.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/ConvexDecomposition.cs | |||
@@ -29,7 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Diagnostics; | 30 | using System.Diagnostics; |
31 | 31 | ||
32 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 32 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
33 | { | 33 | { |
34 | public delegate void ConvexDecompositionCallback(ConvexResult result); | 34 | public delegate void ConvexDecompositionCallback(ConvexResult result); |
35 | 35 | ||
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/ConvexResult.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/ConvexResult.cs index 87758b5..44e3e50 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/ConvexResult.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/ConvexResult.cs | |||
@@ -28,7 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | 30 | ||
31 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 31 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
32 | { | 32 | { |
33 | public class ConvexResult | 33 | public class ConvexResult |
34 | { | 34 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/HullClasses.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/HullClasses.cs index d81df26..8a0164e 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/HullClasses.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/HullClasses.cs | |||
@@ -28,7 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | 30 | ||
31 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 31 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
32 | { | 32 | { |
33 | public class HullResult | 33 | public class HullResult |
34 | { | 34 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/HullTriangle.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/HullTriangle.cs index 1119a75..d3f0052 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/HullTriangle.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/HullTriangle.cs | |||
@@ -29,7 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Diagnostics; | 30 | using System.Diagnostics; |
31 | 31 | ||
32 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 32 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
33 | { | 33 | { |
34 | public class HullTriangle : int3 | 34 | public class HullTriangle : int3 |
35 | { | 35 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/HullUtils.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/HullUtils.cs index c9ccfe2..3903254 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/HullUtils.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/HullUtils.cs | |||
@@ -29,7 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Diagnostics; | 30 | using System.Diagnostics; |
31 | 31 | ||
32 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 32 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
33 | { | 33 | { |
34 | public static class HullUtils | 34 | public static class HullUtils |
35 | { | 35 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/LICENSE.txt b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/LICENSE.txt index 714ae89..714ae89 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/LICENSE.txt +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/LICENSE.txt | |||
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/Plane.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/Plane.cs index d099676..da9ae0c 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/Plane.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/Plane.cs | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | 29 | ||
30 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 30 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
31 | { | 31 | { |
32 | public class Plane | 32 | public class Plane |
33 | { | 33 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/PlaneTri.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/PlaneTri.cs index 31f0182..42f7a22 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/PlaneTri.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/PlaneTri.cs | |||
@@ -29,7 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Diagnostics; | 30 | using System.Diagnostics; |
31 | 31 | ||
32 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 32 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
33 | { | 33 | { |
34 | public enum PlaneTriResult : int | 34 | public enum PlaneTriResult : int |
35 | { | 35 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/Properties/AssemblyInfo.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/Properties/AssemblyInfo.cs index c5867b2..c5867b2 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/Properties/AssemblyInfo.cs | |||
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/Quaternion.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/Quaternion.cs index 0ba8f17..045f620 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/Quaternion.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/Quaternion.cs | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | 29 | ||
30 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 30 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
31 | { | 31 | { |
32 | public class Quaternion : float4 | 32 | public class Quaternion : float4 |
33 | { | 33 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/README.txt b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/README.txt index fc53ae7..fc53ae7 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/README.txt +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/README.txt | |||
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/SplitPlane.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/SplitPlane.cs index 9f06a9a..9f56bc5 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/SplitPlane.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/SplitPlane.cs | |||
@@ -28,7 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | 30 | ||
31 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 31 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
32 | { | 32 | { |
33 | public class Rect3d | 33 | public class Rect3d |
34 | { | 34 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/VertexLookup.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/VertexLookup.cs index 6f17c9f..bfe11e5 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/VertexLookup.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/VertexLookup.cs | |||
@@ -28,7 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | 30 | ||
31 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 31 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
32 | { | 32 | { |
33 | public class VertexPool | 33 | public class VertexPool |
34 | { | 34 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/float2.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/float2.cs index ce88fc8..e7358c1 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/float2.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/float2.cs | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | 29 | ||
30 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 30 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
31 | { | 31 | { |
32 | public class float2 | 32 | public class float2 |
33 | { | 33 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/float3.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/float3.cs index 4389114..fde9b32 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/float3.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/float3.cs | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | 29 | ||
30 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 30 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
31 | { | 31 | { |
32 | public class float3 : IEquatable<float3> | 32 | public class float3 : IEquatable<float3> |
33 | { | 33 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/float3x3.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/float3x3.cs index 76cf063..c420fde 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/float3x3.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/float3x3.cs | |||
@@ -29,7 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Diagnostics; | 30 | using System.Diagnostics; |
31 | 31 | ||
32 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 32 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
33 | { | 33 | { |
34 | public class float3x3 | 34 | public class float3x3 |
35 | { | 35 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/float4.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/float4.cs index fa60876..b2b6fd3 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/float4.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/float4.cs | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | 29 | ||
30 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 30 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
31 | { | 31 | { |
32 | public class float4 | 32 | public class float4 |
33 | { | 33 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/float4x4.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/float4x4.cs index 7d1592f..087eba7 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/float4x4.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/float4x4.cs | |||
@@ -30,7 +30,7 @@ using System.Collections.Generic; | |||
30 | using System.Linq; | 30 | using System.Linq; |
31 | using System.Text; | 31 | using System.Text; |
32 | 32 | ||
33 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 33 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
34 | { | 34 | { |
35 | public class float4x4 | 35 | public class float4x4 |
36 | { | 36 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/int3.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/int3.cs index 9c5760d..90624eb 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/int3.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/int3.cs | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | 29 | ||
30 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 30 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
31 | { | 31 | { |
32 | public class int3 | 32 | public class int3 |
33 | { | 33 | { |
diff --git a/OpenSim/Region/Physics/ConvexDecompositionDotNet/int4.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/int4.cs index c2b32e5..e9320c0 100644 --- a/OpenSim/Region/Physics/ConvexDecompositionDotNet/int4.cs +++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/int4.cs | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | 29 | ||
30 | namespace OpenSim.Region.Physics.ConvexDecompositionDotNet | 30 | namespace OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet |
31 | { | 31 | { |
32 | public class int4 | 32 | public class int4 |
33 | { | 33 | { |
diff --git a/OpenSim/Region/Physics/Meshing/HelperTypes.cs b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/HelperTypes.cs index 8cd8dcf..34a925d 100644 --- a/OpenSim/Region/Physics/Meshing/HelperTypes.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/HelperTypes.cs | |||
@@ -30,8 +30,8 @@ using System.Collections.Generic; | |||
30 | using System.Diagnostics; | 30 | using System.Diagnostics; |
31 | using System.Globalization; | 31 | using System.Globalization; |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenSim.Region.Physics.Manager; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | using OpenSim.Region.Physics.Meshing; | 34 | using OpenSim.Region.PhysicsModules.Meshing; |
35 | 35 | ||
36 | public class Vertex : IComparable<Vertex> | 36 | public class Vertex : IComparable<Vertex> |
37 | { | 37 | { |
diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Mesh.cs index e6b32e7..8c97f2f 100644 --- a/OpenSim/Region/Physics/Meshing/Mesh.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Mesh.cs | |||
@@ -29,11 +29,11 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.IO; | 30 | using System.IO; |
31 | using System.Runtime.InteropServices; | 31 | using System.Runtime.InteropServices; |
32 | using OpenSim.Region.Physics.Manager; | 32 | using OpenSim.Region.PhysicsModules.SharedBase; |
33 | using PrimMesher; | 33 | using PrimMesher; |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | 35 | ||
36 | namespace OpenSim.Region.Physics.Meshing | 36 | namespace OpenSim.Region.PhysicsModules.Meshing |
37 | { | 37 | { |
38 | public class Mesh : IMesh | 38 | public class Mesh : IMesh |
39 | { | 39 | { |
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs index ef6482a..bae3449 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs | |||
@@ -28,8 +28,12 @@ | |||
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Reflection; | ||
32 | using System.IO; | ||
31 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
32 | using OpenSim.Region.Physics.Manager; | 34 | using OpenSim.Region.Framework.Scenes; |
35 | using OpenSim.Region.Framework.Interfaces; | ||
36 | using OpenSim.Region.PhysicsModules.SharedBase; | ||
33 | using OpenMetaverse; | 37 | using OpenMetaverse; |
34 | using OpenMetaverse.StructuredData; | 38 | using OpenMetaverse.StructuredData; |
35 | using System.Drawing; | 39 | using System.Drawing; |
@@ -38,29 +42,12 @@ using System.IO.Compression; | |||
38 | using PrimMesher; | 42 | using PrimMesher; |
39 | using log4net; | 43 | using log4net; |
40 | using Nini.Config; | 44 | using Nini.Config; |
41 | using System.Reflection; | 45 | using Mono.Addins; |
42 | using System.IO; | ||
43 | 46 | ||
44 | namespace OpenSim.Region.Physics.Meshing | 47 | namespace OpenSim.Region.PhysicsModules.Meshing |
45 | { | 48 | { |
46 | public class MeshmerizerPlugin : IMeshingPlugin | 49 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "Meshmerizer")] |
47 | { | 50 | public class Meshmerizer : IMesher, INonSharedRegionModule |
48 | public MeshmerizerPlugin() | ||
49 | { | ||
50 | } | ||
51 | |||
52 | public string GetName() | ||
53 | { | ||
54 | return "Meshmerizer"; | ||
55 | } | ||
56 | |||
57 | public IMesher GetMesher(IConfigSource config) | ||
58 | { | ||
59 | return new Meshmerizer(config); | ||
60 | } | ||
61 | } | ||
62 | |||
63 | public class Meshmerizer : IMesher | ||
64 | { | 51 | { |
65 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 52 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
66 | private static string LogHeader = "[MESH]"; | 53 | private static string LogHeader = "[MESH]"; |
@@ -72,6 +59,8 @@ namespace OpenSim.Region.Physics.Meshing | |||
72 | #else | 59 | #else |
73 | private const string baseDir = null; //"rawFiles"; | 60 | private const string baseDir = null; //"rawFiles"; |
74 | #endif | 61 | #endif |
62 | private bool m_Enabled = false; | ||
63 | |||
75 | // If 'true', lots of DEBUG logging of asset parsing details | 64 | // If 'true', lots of DEBUG logging of asset parsing details |
76 | private bool debugDetail = false; | 65 | private bool debugDetail = false; |
77 | 66 | ||
@@ -87,30 +76,79 @@ namespace OpenSim.Region.Physics.Meshing | |||
87 | // Mesh cache. Static so it can be shared across instances of this class | 76 | // Mesh cache. Static so it can be shared across instances of this class |
88 | private static Dictionary<ulong, Mesh> m_uniqueMeshes = new Dictionary<ulong, Mesh>(); | 77 | private static Dictionary<ulong, Mesh> m_uniqueMeshes = new Dictionary<ulong, Mesh>(); |
89 | 78 | ||
90 | public Meshmerizer(IConfigSource config) | 79 | #region INonSharedRegionModule |
80 | public string Name | ||
91 | { | 81 | { |
92 | IConfig start_config = config.Configs["Startup"]; | 82 | get { return "Meshmerizer"; } |
93 | IConfig mesh_config = config.Configs["Mesh"]; | 83 | } |
94 | 84 | ||
95 | decodedSculptMapPath = start_config.GetString("DecodedSculptMapPath","j2kDecodeCache"); | 85 | public Type ReplaceableInterface |
96 | cacheSculptMaps = start_config.GetBoolean("CacheSculptMaps", cacheSculptMaps); | 86 | { |
97 | if (mesh_config != null) | 87 | get { return null; } |
98 | { | 88 | } |
99 | useMeshiesPhysicsMesh = mesh_config.GetBoolean("UseMeshiesPhysicsMesh", useMeshiesPhysicsMesh); | ||
100 | debugDetail = mesh_config.GetBoolean("LogMeshDetails", debugDetail); | ||
101 | } | ||
102 | 89 | ||
103 | try | 90 | public void Initialise(IConfigSource source) |
104 | { | 91 | { |
105 | if (!Directory.Exists(decodedSculptMapPath)) | 92 | IConfig config = source.Configs["Startup"]; |
106 | Directory.CreateDirectory(decodedSculptMapPath); | 93 | if (config != null) |
107 | } | ||
108 | catch (Exception e) | ||
109 | { | 94 | { |
110 | m_log.WarnFormat("[SCULPT]: Unable to create {0} directory: ", decodedSculptMapPath, e.Message); | 95 | string mesher = config.GetString("meshing", string.Empty); |
96 | if (mesher == Name) | ||
97 | { | ||
98 | m_Enabled = true; | ||
99 | |||
100 | IConfig mesh_config = source.Configs["Mesh"]; | ||
101 | |||
102 | decodedSculptMapPath = config.GetString("DecodedSculptMapPath", "j2kDecodeCache"); | ||
103 | cacheSculptMaps = config.GetBoolean("CacheSculptMaps", cacheSculptMaps); | ||
104 | if (mesh_config != null) | ||
105 | { | ||
106 | useMeshiesPhysicsMesh = mesh_config.GetBoolean("UseMeshiesPhysicsMesh", useMeshiesPhysicsMesh); | ||
107 | debugDetail = mesh_config.GetBoolean("LogMeshDetails", debugDetail); | ||
108 | } | ||
109 | |||
110 | try | ||
111 | { | ||
112 | if (!Directory.Exists(decodedSculptMapPath)) | ||
113 | Directory.CreateDirectory(decodedSculptMapPath); | ||
114 | } | ||
115 | catch (Exception e) | ||
116 | { | ||
117 | m_log.WarnFormat("[SCULPT]: Unable to create {0} directory: ", decodedSculptMapPath, e.Message); | ||
118 | } | ||
119 | |||
120 | } | ||
111 | } | 121 | } |
112 | } | 122 | } |
113 | 123 | ||
124 | public void Close() | ||
125 | { | ||
126 | } | ||
127 | |||
128 | public void AddRegion(Scene scene) | ||
129 | { | ||
130 | if (!m_Enabled) | ||
131 | return; | ||
132 | |||
133 | scene.RegisterModuleInterface<IMesher>(this); | ||
134 | } | ||
135 | |||
136 | public void RemoveRegion(Scene scene) | ||
137 | { | ||
138 | if (!m_Enabled) | ||
139 | return; | ||
140 | |||
141 | scene.UnregisterModuleInterface<IMesher>(this); | ||
142 | } | ||
143 | |||
144 | public void RegionLoaded(Scene scene) | ||
145 | { | ||
146 | if (!m_Enabled) | ||
147 | return; | ||
148 | } | ||
149 | #endregion | ||
150 | |||
151 | |||
114 | /// <summary> | 152 | /// <summary> |
115 | /// creates a simple box mesh of the specified size. This mesh is of very low vertex count and may | 153 | /// creates a simple box mesh of the specified size. This mesh is of very low vertex count and may |
116 | /// be useful as a backup proxy when level of detail is not needed or when more complex meshes fail | 154 | /// be useful as a backup proxy when level of detail is not needed or when more complex meshes fail |
diff --git a/OpenSim/Region/Physics/Meshing/PrimMesher.cs b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/PrimMesher.cs index 4049ee1..4049ee1 100644 --- a/OpenSim/Region/Physics/Meshing/PrimMesher.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/PrimMesher.cs | |||
diff --git a/OpenSim/Region/Physics/Meshing/SculptMap.cs b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/SculptMap.cs index b3d9cb6..b3d9cb6 100644 --- a/OpenSim/Region/Physics/Meshing/SculptMap.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/SculptMap.cs | |||
diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/SculptMesh.cs index 4a7f3ad..4a7f3ad 100644 --- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/SculptMesh.cs | |||
diff --git a/OpenSim/Region/RegionCombinerModule/Properties/AssemblyInfo.cs b/OpenSim/Region/PhysicsModules/Meshing/Properties/AssemblyInfo.cs index 11b89d2..d6ac8b2 100644 --- a/OpenSim/Region/RegionCombinerModule/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Properties/AssemblyInfo.cs | |||
@@ -6,7 +6,7 @@ using Mono.Addins; | |||
6 | // General Information about an assembly is controlled through the following | 6 | // General Information about an assembly is controlled through the following |
7 | // set of attributes. Change these attribute values to modify the information | 7 | // set of attributes. Change these attribute values to modify the information |
8 | // associated with an assembly. | 8 | // associated with an assembly. |
9 | [assembly: AssemblyTitle("OpenSim.Region.RegionCombinerModule")] | 9 | [assembly: AssemblyTitle("OpenSim.Region.PhysicsModules.Meshing")] |
10 | [assembly: AssemblyDescription("")] | 10 | [assembly: AssemblyDescription("")] |
11 | [assembly: AssemblyConfiguration("")] | 11 | [assembly: AssemblyConfiguration("")] |
12 | [assembly: AssemblyCompany("http://opensimulator.org")] | 12 | [assembly: AssemblyCompany("http://opensimulator.org")] |
@@ -21,7 +21,7 @@ using Mono.Addins; | |||
21 | [assembly: ComVisible(false)] | 21 | [assembly: ComVisible(false)] |
22 | 22 | ||
23 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
24 | [assembly: Guid("73c166d2-c9d8-4ab8-af4e-89c41b4b58a9")] | 24 | [assembly: Guid("4b7e35c2-a9dd-4b10-b778-eb417f4f6884")] |
25 | 25 | ||
26 | // Version information for an assembly consists of the following four values: | 26 | // Version information for an assembly consists of the following four values: |
27 | // | 27 | // |
@@ -32,5 +32,5 @@ using Mono.Addins; | |||
32 | // | 32 | // |
33 | [assembly: AssemblyVersion("0.8.2.*")] | 33 | [assembly: AssemblyVersion("0.8.2.*")] |
34 | 34 | ||
35 | [assembly: Addin("OpenSim.RegionModules.RegionCombinerModule", OpenSim.VersionInfo.VersionNumber)] | 35 | [assembly: Addin("OpenSim.Region.PhysicsModules.Meshing", OpenSim.VersionInfo.VersionNumber)] |
36 | [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] | 36 | [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] |
diff --git a/OpenSim/Region/Physics/Manager/ZeroMesher.cs b/OpenSim/Region/PhysicsModules/Meshing/ZeroMesher.cs index 890951f..09676c6 100644 --- a/OpenSim/Region/Physics/Manager/ZeroMesher.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/ZeroMesher.cs | |||
@@ -26,9 +26,15 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Reflection; | ||
29 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
31 | using OpenSim.Region.Framework.Scenes; | ||
32 | using OpenSim.Region.Framework.Interfaces; | ||
33 | using OpenSim.Region.PhysicsModules.SharedBase; | ||
30 | using OpenMetaverse; | 34 | using OpenMetaverse; |
31 | using Nini.Config; | 35 | using Nini.Config; |
36 | using Mono.Addins; | ||
37 | using log4net; | ||
32 | 38 | ||
33 | /* | 39 | /* |
34 | * This is the zero mesher. | 40 | * This is the zero mesher. |
@@ -41,27 +47,67 @@ using Nini.Config; | |||
41 | * it's always availabe and thus the default in case of configuration errors | 47 | * it's always availabe and thus the default in case of configuration errors |
42 | */ | 48 | */ |
43 | 49 | ||
44 | namespace OpenSim.Region.Physics.Manager | 50 | namespace OpenSim.Region.PhysicsModules.Meshing |
45 | { | 51 | { |
46 | public class ZeroMesherPlugin : IMeshingPlugin | 52 | |
53 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ZeroMesher")] | ||
54 | public class ZeroMesher : IMesher, INonSharedRegionModule | ||
47 | { | 55 | { |
48 | public ZeroMesherPlugin() | 56 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
57 | private bool m_Enabled = false; | ||
58 | |||
59 | #region INonSharedRegionModule | ||
60 | public string Name | ||
49 | { | 61 | { |
62 | get { return "ZeroMesher"; } | ||
50 | } | 63 | } |
51 | 64 | ||
52 | public string GetName() | 65 | public Type ReplaceableInterface |
53 | { | 66 | { |
54 | return "ZeroMesher"; | 67 | get { return null; } |
55 | } | 68 | } |
56 | 69 | ||
57 | public IMesher GetMesher(IConfigSource config) | 70 | public void Initialise(IConfigSource source) |
58 | { | 71 | { |
59 | return new ZeroMesher(); | 72 | // TODO: Move this out of Startup |
73 | IConfig config = source.Configs["Startup"]; | ||
74 | if (config != null) | ||
75 | { | ||
76 | // This is the default Mesher | ||
77 | string mesher = config.GetString("meshing", Name); | ||
78 | if (mesher == Name) | ||
79 | m_Enabled = true; | ||
80 | } | ||
60 | } | 81 | } |
61 | } | ||
62 | 82 | ||
63 | public class ZeroMesher : IMesher | 83 | public void Close() |
64 | { | 84 | { |
85 | } | ||
86 | |||
87 | public void AddRegion(Scene scene) | ||
88 | { | ||
89 | if (!m_Enabled) | ||
90 | return; | ||
91 | |||
92 | scene.RegisterModuleInterface<IMesher>(this); | ||
93 | } | ||
94 | |||
95 | public void RemoveRegion(Scene scene) | ||
96 | { | ||
97 | if (!m_Enabled) | ||
98 | return; | ||
99 | |||
100 | scene.UnregisterModuleInterface<IMesher>(this); | ||
101 | } | ||
102 | |||
103 | public void RegionLoaded(Scene scene) | ||
104 | { | ||
105 | if (!m_Enabled) | ||
106 | return; | ||
107 | } | ||
108 | #endregion | ||
109 | |||
110 | #region IMesher | ||
65 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod) | 111 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod) |
66 | { | 112 | { |
67 | return CreateMesh(primName, primShape, size, lod, false); | 113 | return CreateMesh(primName, primShape, size, lod, false); |
@@ -93,5 +139,7 @@ namespace OpenSim.Region.Physics.Manager | |||
93 | public void ReleaseMesh(IMesh mesh) { } | 139 | public void ReleaseMesh(IMesh mesh) { } |
94 | public void ExpireReleaseMeshs() { } | 140 | public void ExpireReleaseMeshs() { } |
95 | public void ExpireFileCache() { } | 141 | public void ExpireFileCache() { } |
142 | |||
143 | #endregion | ||
96 | } | 144 | } |
97 | } | 145 | } |
diff --git a/OpenSim/Region/Physics/OdePlugin/AssemblyInfo.cs b/OpenSim/Region/PhysicsModules/Ode/AssemblyInfo.cs index 076da78..7869739 100644 --- a/OpenSim/Region/Physics/OdePlugin/AssemblyInfo.cs +++ b/OpenSim/Region/PhysicsModules/Ode/AssemblyInfo.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System.Reflection; | 28 | using System.Reflection; |
29 | using System.Runtime.InteropServices; | 29 | using System.Runtime.InteropServices; |
30 | using Mono.Addins; | ||
30 | 31 | ||
31 | // Information about this assembly is defined by the following | 32 | // Information about this assembly is defined by the following |
32 | // attributes. | 33 | // attributes. |
@@ -56,3 +57,6 @@ using System.Runtime.InteropServices; | |||
56 | // numbers with the '*' character (the default): | 57 | // numbers with the '*' character (the default): |
57 | 58 | ||
58 | [assembly : AssemblyVersion("0.8.2.*")] | 59 | [assembly : AssemblyVersion("0.8.2.*")] |
60 | |||
61 | [assembly: Addin("OpenSim.Region.PhysicsModule.ODE", OpenSim.VersionInfo.VersionNumber)] | ||
62 | [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] | ||
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs index 05eaf2a..b35c299 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs | |||
@@ -31,10 +31,10 @@ using System.Reflection; | |||
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using Ode.NET; | 32 | using Ode.NET; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Region.Physics.Manager; | 34 | using OpenSim.Region.PhysicsModules.SharedBase; |
35 | using log4net; | 35 | using log4net; |
36 | 36 | ||
37 | namespace OpenSim.Region.Physics.OdePlugin | 37 | namespace OpenSim.Region.PhysicsModule.ODE |
38 | { | 38 | { |
39 | /// <summary> | 39 | /// <summary> |
40 | /// Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ourselves. | 40 | /// Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ourselves. |
@@ -511,7 +511,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
511 | } | 511 | } |
512 | else | 512 | else |
513 | { | 513 | { |
514 | m_log.WarnFormat("[ODE CHARACTER]: Got a NaN Size for {0} in {1}", Name, _parent_scene.Name); | 514 | m_log.WarnFormat("[ODE CHARACTER]: Got a NaN Size for {0} in {1}", Name, _parent_scene.PhysicsSceneName); |
515 | } | 515 | } |
516 | } | 516 | } |
517 | 517 | ||
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEDynamics.c_comments b/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.c_comments index 1060aa6..1060aa6 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEDynamics.c_comments +++ b/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.c_comments | |||
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs b/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs index 2342bfa..8f8e2bd 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs | |||
@@ -46,9 +46,9 @@ using log4net; | |||
46 | using OpenMetaverse; | 46 | using OpenMetaverse; |
47 | using Ode.NET; | 47 | using Ode.NET; |
48 | using OpenSim.Framework; | 48 | using OpenSim.Framework; |
49 | using OpenSim.Region.Physics.Manager; | 49 | using OpenSim.Region.PhysicsModules.SharedBase; |
50 | 50 | ||
51 | namespace OpenSim.Region.Physics.OdePlugin | 51 | namespace OpenSim.Region.PhysicsModule.ODE |
52 | { | 52 | { |
53 | public class ODEDynamics | 53 | public class ODEDynamics |
54 | { | 54 | { |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs index 0a99e30..5e48de6 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs | |||
@@ -50,9 +50,9 @@ using log4net; | |||
50 | using OpenMetaverse; | 50 | using OpenMetaverse; |
51 | using Ode.NET; | 51 | using Ode.NET; |
52 | using OpenSim.Framework; | 52 | using OpenSim.Framework; |
53 | using OpenSim.Region.Physics.Manager; | 53 | using OpenSim.Region.PhysicsModules.SharedBase; |
54 | 54 | ||
55 | namespace OpenSim.Region.Physics.OdePlugin | 55 | namespace OpenSim.Region.PhysicsModule.ODE |
56 | { | 56 | { |
57 | /// <summary> | 57 | /// <summary> |
58 | /// Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ourselves. | 58 | /// Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ourselves. |
@@ -3381,7 +3381,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
3381 | { | 3381 | { |
3382 | m_log.WarnFormat( | 3382 | m_log.WarnFormat( |
3383 | "[ODE PRIM]: Could not get mesh/sculpt asset {0} for {1} at {2} in {3}", | 3383 | "[ODE PRIM]: Could not get mesh/sculpt asset {0} for {1} at {2} in {3}", |
3384 | _pbs.SculptTexture, Name, _position, _parent_scene.Name); | 3384 | _pbs.SculptTexture, Name, _position, _parent_scene.PhysicsSceneName); |
3385 | } | 3385 | } |
3386 | } | 3386 | } |
3387 | } | 3387 | } |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs b/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs index fa2ed3e..80f0fcf 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs | |||
@@ -31,11 +31,11 @@ using System.Reflection; | |||
31 | using System.Runtime.InteropServices; | 31 | using System.Runtime.InteropServices; |
32 | using System.Text; | 32 | using System.Text; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Region.Physics.Manager; | 34 | using OpenSim.Region.PhysicsModules.SharedBase; |
35 | using Ode.NET; | 35 | using Ode.NET; |
36 | using log4net; | 36 | using log4net; |
37 | 37 | ||
38 | namespace OpenSim.Region.Physics.OdePlugin | 38 | namespace OpenSim.Region.PhysicsModule.ODE |
39 | { | 39 | { |
40 | /// <summary> | 40 | /// <summary> |
41 | /// Processes raycast requests as ODE is in a state to be able to do them. | 41 | /// Processes raycast requests as ODE is in a state to be able to do them. |
@@ -172,7 +172,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
172 | /// <param name="req"></param> | 172 | /// <param name="req"></param> |
173 | private void RayCast(ODERayCastRequest req) | 173 | private void RayCast(ODERayCastRequest req) |
174 | { | 174 | { |
175 | // limit ray lenght or collisions will take all avaiable stack space | 175 | // NOTE: limit ray lenght or collisions will take all avaiable stack space |
176 | // this value may still be too large, depending on machine configuration | ||
177 | // of maximum stack | ||
176 | float len = req.length; | 178 | float len = req.length; |
177 | if (len > 250f) | 179 | if (len > 250f) |
178 | len = 250f; | 180 | len = 250f; |
@@ -441,4 +443,4 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
441 | public float length; | 443 | public float length; |
442 | public RayCallback callbackMethod; | 444 | public RayCallback callbackMethod; |
443 | } | 445 | } |
444 | } \ No newline at end of file | 446 | } |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePhysicsJoint.cs b/OpenSim/Region/PhysicsModules/Ode/OdePhysicsJoint.cs index b4a3c48..2eb7ba6 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePhysicsJoint.cs +++ b/OpenSim/Region/PhysicsModules/Ode/OdePhysicsJoint.cs | |||
@@ -29,10 +29,10 @@ using System; | |||
29 | using OpenMetaverse; | 29 | using OpenMetaverse; |
30 | using Ode.NET; | 30 | using Ode.NET; |
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Region.Physics.Manager; | 32 | using OpenSim.Region.PhysicsModules.SharedBase; |
33 | using OpenSim.Region.Physics.OdePlugin; | 33 | using OpenSim.Region.PhysicsModule.ODE; |
34 | 34 | ||
35 | namespace OpenSim.Region.Physics.OdePlugin | 35 | namespace OpenSim.Region.PhysicsModule.ODE |
36 | { | 36 | { |
37 | class OdePhysicsJoint : PhysicsJoint | 37 | class OdePhysicsJoint : PhysicsJoint |
38 | { | 38 | { |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs index 812b469..26210d6 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | |||
@@ -25,13 +25,11 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | // Ubit changes for varsize regions | 28 | // changes for varsize regions |
29 | // using a large Heightfield geometry for terrain | 29 | // note that raycasts need to have limited range |
30 | // ODE ode should handle it fine | ||
31 | // EXCEPT raycasts, those need to have limited range | ||
32 | // (even in normal regions) | 30 | // (even in normal regions) |
33 | // or aplication stack will just blowup | 31 | // or aplication thread stack may just blowup |
34 | 32 | // see RayCast(ODERayCastRequest req) | |
35 | 33 | ||
36 | //#define USE_DRAWSTUFF | 34 | //#define USE_DRAWSTUFF |
37 | //#define SPAM | 35 | //#define SPAM |
@@ -46,15 +44,19 @@ using System.Runtime.InteropServices; | |||
46 | using System.Threading; | 44 | using System.Threading; |
47 | using log4net; | 45 | using log4net; |
48 | using Nini.Config; | 46 | using Nini.Config; |
47 | using Mono.Addins; | ||
49 | using Ode.NET; | 48 | using Ode.NET; |
50 | using OpenMetaverse; | 49 | using OpenMetaverse; |
51 | #if USE_DRAWSTUFF | 50 | #if USE_DRAWSTUFF |
52 | using Drawstuff.NET; | 51 | using Drawstuff.NET; |
53 | #endif | 52 | #endif |
54 | using OpenSim.Framework; | 53 | using OpenSim.Framework; |
55 | using OpenSim.Region.Physics.Manager; | 54 | using OpenSim.Region.PhysicsModules.SharedBase; |
55 | using OpenSim.Region.Framework.Scenes; | ||
56 | using OpenSim.Region.Framework.Interfaces; | ||
57 | |||
56 | 58 | ||
57 | namespace OpenSim.Region.Physics.OdePlugin | 59 | namespace OpenSim.Region.PhysicsModule.ODE |
58 | { | 60 | { |
59 | public enum StatusIndicators : int | 61 | public enum StatusIndicators : int |
60 | { | 62 | { |
@@ -109,9 +111,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
109 | Rubber = 6 | 111 | Rubber = 6 |
110 | } | 112 | } |
111 | 113 | ||
112 | public class OdeScene : PhysicsScene | 114 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ODEPhysicsScene")] |
115 | public class OdeScene : PhysicsScene, INonSharedRegionModule | ||
113 | { | 116 | { |
114 | private readonly ILog m_log; | 117 | private readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.ToString()); |
118 | private bool m_Enabled = false; | ||
119 | |||
115 | // private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>(); | 120 | // private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>(); |
116 | 121 | ||
117 | /// <summary> | 122 | /// <summary> |
@@ -298,7 +303,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
298 | private int framecount = 0; | 303 | private int framecount = 0; |
299 | //private int m_returncollisions = 10; | 304 | //private int m_returncollisions = 10; |
300 | 305 | ||
301 | private readonly IntPtr contactgroup; | 306 | private IntPtr contactgroup; |
302 | 307 | ||
303 | // internal IntPtr WaterGeom; | 308 | // internal IntPtr WaterGeom; |
304 | 309 | ||
@@ -530,19 +535,103 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
530 | 535 | ||
531 | private ODERayCastRequestManager m_rayCastManager; | 536 | private ODERayCastRequestManager m_rayCastManager; |
532 | 537 | ||
538 | |||
539 | #region INonSharedRegionModule | ||
540 | public string Name | ||
541 | { | ||
542 | get { return "OpenDynamicsEngine"; } | ||
543 | } | ||
544 | |||
545 | public Type ReplaceableInterface | ||
546 | { | ||
547 | get { return null; } | ||
548 | } | ||
549 | |||
550 | public void Initialise(IConfigSource source) | ||
551 | { | ||
552 | // TODO: Move this out of Startup | ||
553 | IConfig config = source.Configs["Startup"]; | ||
554 | if (config != null) | ||
555 | { | ||
556 | string physics = config.GetString("physics", string.Empty); | ||
557 | if (physics == Name) | ||
558 | { | ||
559 | m_Enabled = true; | ||
560 | m_config = source; | ||
561 | |||
562 | // We do this so that OpenSimulator on Windows loads the correct native ODE library depending on whether | ||
563 | // it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports | ||
564 | // will find it already loaded later on. | ||
565 | // | ||
566 | // This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be | ||
567 | // controlled in Ode.NET.dll.config | ||
568 | if (Util.IsWindows()) | ||
569 | Util.LoadArchSpecificWindowsDll("ode.dll"); | ||
570 | |||
571 | // Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to | ||
572 | // http://opensimulator.org/mantis/view.php?id=2750). | ||
573 | d.InitODE(); | ||
574 | |||
575 | } | ||
576 | } | ||
577 | |||
578 | } | ||
579 | |||
580 | public void Close() | ||
581 | { | ||
582 | } | ||
583 | |||
584 | public void AddRegion(Scene scene) | ||
585 | { | ||
586 | if (!m_Enabled) | ||
587 | return; | ||
588 | |||
589 | EngineType = Name; | ||
590 | PhysicsSceneName = EngineType + "/" + scene.RegionInfo.RegionName; | ||
591 | |||
592 | scene.RegisterModuleInterface<PhysicsScene>(this); | ||
593 | Vector3 extent = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, scene.RegionInfo.RegionSizeZ); | ||
594 | Initialise(extent); | ||
595 | InitialiseFromConfig(m_config); | ||
596 | |||
597 | // This may not be that good since terrain may not be avaiable at this point | ||
598 | base.Initialise(scene.PhysicsRequestAsset, | ||
599 | (scene.Heightmap != null ? scene.Heightmap.GetFloatsSerialised() : new float[(int)(extent.X * extent.Y)]), | ||
600 | (float)scene.RegionInfo.RegionSettings.WaterHeight); | ||
601 | |||
602 | } | ||
603 | |||
604 | public void RemoveRegion(Scene scene) | ||
605 | { | ||
606 | if (!m_Enabled) | ||
607 | return; | ||
608 | } | ||
609 | |||
610 | public void RegionLoaded(Scene scene) | ||
611 | { | ||
612 | if (!m_Enabled) | ||
613 | return; | ||
614 | |||
615 | mesher = scene.RequestModuleInterface<IMesher>(); | ||
616 | if (mesher == null) | ||
617 | m_log.WarnFormat("[ODE SCENE]: No mesher in {0}. Things will not work well.", PhysicsSceneName); | ||
618 | } | ||
619 | #endregion | ||
620 | |||
533 | /// <summary> | 621 | /// <summary> |
534 | /// Initiailizes the scene | 622 | /// Initiailizes the scene |
535 | /// Sets many properties that ODE requires to be stable | 623 | /// Sets many properties that ODE requires to be stable |
536 | /// These settings need to be tweaked 'exactly' right or weird stuff happens. | 624 | /// These settings need to be tweaked 'exactly' right or weird stuff happens. |
537 | /// </summary> | 625 | /// </summary> |
538 | /// <param value="name">Name of the scene. Useful in debug messages.</param> | 626 | private void Initialise(Vector3 regionExtent) |
539 | public OdeScene(string engineType, string name) | ||
540 | { | 627 | { |
541 | m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + name); | 628 | WorldExtents.X = regionExtent.X; |
542 | 629 | m_regionWidth = (uint)regionExtent.X; | |
543 | Name = name; | 630 | WorldExtents.Y = regionExtent.Y; |
544 | EngineType = engineType; | 631 | m_regionHeight = (uint)regionExtent.Y; |
545 | 632 | ||
633 | m_suportCombine = false; | ||
634 | |||
546 | nearCallback = near; | 635 | nearCallback = near; |
547 | triCallback = TriCallback; | 636 | triCallback = TriCallback; |
548 | triArrayCallback = TriArrayCallback; | 637 | triArrayCallback = TriArrayCallback; |
@@ -597,7 +686,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
597 | { | 686 | { |
598 | InitializeExtraStats(); | 687 | InitializeExtraStats(); |
599 | 688 | ||
600 | mesher = meshmerizer; | ||
601 | m_config = config; | 689 | m_config = config; |
602 | // Defaults | 690 | // Defaults |
603 | 691 | ||
@@ -725,11 +813,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
725 | spaceGridMaxX = (int)(WorldExtents.X * spacesPerMeterX); | 813 | spaceGridMaxX = (int)(WorldExtents.X * spacesPerMeterX); |
726 | spaceGridMaxY = (int)(WorldExtents.Y * spacesPerMeterY); | 814 | spaceGridMaxY = (int)(WorldExtents.Y * spacesPerMeterY); |
727 | 815 | ||
728 | // ubit: limit number of spaces | 816 | // note: limit number of spaces |
729 | if (spaceGridMaxX > 24) | 817 | if (spaceGridMaxX > 24) |
730 | { | 818 | { |
731 | spaceGridMaxX = 24; | 819 | spaceGridMaxX = 24; |
732 | spacesPerMeterX = spaceGridMaxX / WorldExtents.X ; | 820 | spacesPerMeterX = spaceGridMaxX / WorldExtents.X; |
733 | } | 821 | } |
734 | if (spaceGridMaxY > 24) | 822 | if (spaceGridMaxY > 24) |
735 | { | 823 | { |
@@ -1862,7 +1950,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1862 | } | 1950 | } |
1863 | catch (AccessViolationException) | 1951 | catch (AccessViolationException) |
1864 | { | 1952 | { |
1865 | m_log.ErrorFormat("[ODE SCENE]: Unable to space collide {0}", Name); | 1953 | m_log.ErrorFormat("[ODE SCENE]: Unable to space collide {0}", PhysicsSceneName); |
1866 | } | 1954 | } |
1867 | 1955 | ||
1868 | //float terrainheight = GetTerrainHeightAtXY(chr.Position.X, chr.Position.Y); | 1956 | //float terrainheight = GetTerrainHeightAtXY(chr.Position.X, chr.Position.Y); |
@@ -3119,7 +3207,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3119 | { | 3207 | { |
3120 | m_log.ErrorFormat( | 3208 | m_log.ErrorFormat( |
3121 | "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2} due to defect found when moving", | 3209 | "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2} due to defect found when moving", |
3122 | actor.Name, actor.LocalID, Name); | 3210 | actor.Name, actor.LocalID, PhysicsSceneName); |
3123 | 3211 | ||
3124 | RemoveCharacter(actor); | 3212 | RemoveCharacter(actor); |
3125 | actor.DestroyOdeStructures(); | 3213 | actor.DestroyOdeStructures(); |
@@ -3236,7 +3324,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3236 | { | 3324 | { |
3237 | m_log.ErrorFormat( | 3325 | m_log.ErrorFormat( |
3238 | "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2} due to defect found when updating position and velocity", | 3326 | "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2} due to defect found when updating position and velocity", |
3239 | actor.Name, actor.LocalID, Name); | 3327 | actor.Name, actor.LocalID, PhysicsSceneName); |
3240 | 3328 | ||
3241 | RemoveCharacter(actor); | 3329 | RemoveCharacter(actor); |
3242 | actor.DestroyOdeStructures(); | 3330 | actor.DestroyOdeStructures(); |
@@ -3835,7 +3923,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3835 | private void SetTerrain(float[] heightMap, Vector3 pOffset) | 3923 | private void SetTerrain(float[] heightMap, Vector3 pOffset) |
3836 | { | 3924 | { |
3837 | int startTime = Util.EnvironmentTickCount(); | 3925 | int startTime = Util.EnvironmentTickCount(); |
3838 | m_log.DebugFormat("[ODE SCENE]: Setting terrain for {0} with offset {1}", Name, pOffset); | 3926 | m_log.DebugFormat("[ODE SCENE]: Setting terrain for {0} with offset {1}", PhysicsSceneName, pOffset); |
3839 | 3927 | ||
3840 | 3928 | ||
3841 | float[] _heightmap; | 3929 | float[] _heightmap; |
@@ -3873,6 +3961,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3873 | uint xt = 0; | 3961 | uint xt = 0; |
3874 | xx = 0; | 3962 | xx = 0; |
3875 | 3963 | ||
3964 | |||
3876 | for (uint x = 0; x < heightmapWidthSamples; x++) | 3965 | for (uint x = 0; x < heightmapWidthSamples; x++) |
3877 | { | 3966 | { |
3878 | if (x > 1 && xx < maxXX) | 3967 | if (x > 1 && xx < maxXX) |
@@ -3951,7 +4040,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3951 | } | 4040 | } |
3952 | 4041 | ||
3953 | m_log.DebugFormat( | 4042 | m_log.DebugFormat( |
3954 | "[ODE SCENE]: Setting terrain for {0} took {1}ms", Name, Util.EnvironmentTickCountSubtract(startTime)); | 4043 | "[ODE SCENE]: Setting terrain for {0} took {1}ms", PhysicsSceneName, Util.EnvironmentTickCountSubtract(startTime)); |
3955 | } | 4044 | } |
3956 | 4045 | ||
3957 | public override void DeleteTerrain() | 4046 | public override void DeleteTerrain() |
diff --git a/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs b/OpenSim/Region/PhysicsModules/Ode/Tests/ODETestClass.cs index 16404c6..6dc22bd 100644 --- a/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs +++ b/OpenSim/Region/PhysicsModules/Ode/Tests/ODETestClass.cs | |||
@@ -30,51 +30,74 @@ using Nini.Config; | |||
30 | using NUnit.Framework; | 30 | using NUnit.Framework; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Region.Physics.Manager; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | using OpenSim.Region.Physics.OdePlugin; | 34 | using OpenSim.Region.PhysicsModule.ODE; |
35 | using OpenSim.Region.Framework.Scenes; | ||
36 | using OpenSim.Region.Framework.Interfaces; | ||
35 | using OpenSim.Tests.Common; | 37 | using OpenSim.Tests.Common; |
36 | using log4net; | 38 | using log4net; |
37 | using System.Reflection; | 39 | using System.Reflection; |
38 | 40 | ||
39 | namespace OpenSim.Region.Physics.OdePlugin.Tests | 41 | namespace OpenSim.Region.PhysicsModule.ODE.Tests |
40 | { | 42 | { |
41 | [TestFixture] | 43 | [TestFixture] |
42 | public class ODETestClass : OpenSimTestCase | 44 | public class ODETestClass : OpenSimTestCase |
43 | { | 45 | { |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 47 | ||
46 | private OpenSim.Region.Physics.OdePlugin.OdePlugin cbt; | 48 | //private OpenSim.Region.PhysicsModule.ODE.OdePlugin cbt; |
47 | private PhysicsScene ps; | 49 | private PhysicsScene pScene; |
48 | private IMeshingPlugin imp; | ||
49 | 50 | ||
50 | [SetUp] | 51 | [SetUp] |
51 | public void Initialize() | 52 | public void Initialize() |
52 | { | 53 | { |
53 | IConfigSource TopConfig = new IniConfigSource(); | 54 | IConfigSource openSimINI = new IniConfigSource(); |
54 | IConfig config = TopConfig.AddConfig("Startup"); | 55 | IConfig startupConfig = openSimINI.AddConfig("Startup"); |
55 | config.Set("DecodedSculptMapPath","j2kDecodeCache"); | 56 | startupConfig.Set("physics", "OpenDynamicsEngine"); |
57 | startupConfig.Set("DecodedSculptMapPath", "j2kDecodeCache"); | ||
58 | |||
59 | Vector3 regionExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight); | ||
60 | |||
61 | //PhysicsScene pScene = physicsPluginManager.GetPhysicsScene( | ||
62 | // "BulletSim", "Meshmerizer", openSimINI, "BSTestRegion", regionExtent); | ||
63 | RegionInfo info = new RegionInfo(); | ||
64 | info.RegionName = "ODETestRegion"; | ||
65 | info.RegionSizeX = info.RegionSizeY = info.RegionSizeZ = Constants.RegionSize; | ||
66 | OpenSim.Region.Framework.Scenes.Scene scene = new OpenSim.Region.Framework.Scenes.Scene(info); | ||
67 | |||
68 | //IMesher mesher = new OpenSim.Region.PhysicsModules.Meshing.Meshmerizer(); | ||
69 | //INonSharedRegionModule mod = mesher as INonSharedRegionModule; | ||
70 | //mod.Initialise(openSimINI); | ||
71 | //mod.AddRegion(scene); | ||
72 | //mod.RegionLoaded(scene); | ||
73 | |||
74 | pScene = new OdeScene(); | ||
75 | Console.WriteLine("HERE " + (pScene == null ? "Null" : "Not null")); | ||
76 | INonSharedRegionModule mod = (pScene as INonSharedRegionModule); | ||
77 | Console.WriteLine("HERE " + (mod == null ? "Null" : "Not null")); | ||
78 | mod.Initialise(openSimINI); | ||
79 | mod.AddRegion(scene); | ||
80 | mod.RegionLoaded(scene); | ||
56 | 81 | ||
57 | // Loading ODEPlugin | 82 | // Loading ODEPlugin |
58 | cbt = new OdePlugin(); | 83 | //cbt = new OdePlugin(); |
59 | // Loading Zero Mesher | ||
60 | imp = new ZeroMesherPlugin(); | ||
61 | // Getting Physics Scene | 84 | // Getting Physics Scene |
62 | ps = cbt.GetScene("test"); | 85 | //ps = cbt.GetScene("test"); |
63 | // Initializing Physics Scene. | 86 | // Initializing Physics Scene. |
64 | ps.Initialise(imp.GetMesher(TopConfig),null); | 87 | //ps.Initialise(imp.GetMesher(TopConfig), null, Vector3.Zero); |
65 | float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize]; | 88 | float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize]; |
66 | for (int i = 0; i < ((int)Constants.RegionSize * (int)Constants.RegionSize); i++) | 89 | for (int i = 0; i < ((int)Constants.RegionSize * (int)Constants.RegionSize); i++) |
67 | { | 90 | { |
68 | _heightmap[i] = 21f; | 91 | _heightmap[i] = 21f; |
69 | } | 92 | } |
70 | ps.SetTerrain(_heightmap); | 93 | pScene.SetTerrain(_heightmap); |
71 | } | 94 | } |
72 | 95 | ||
73 | [TearDown] | 96 | [TearDown] |
74 | public void Terminate() | 97 | public void Terminate() |
75 | { | 98 | { |
76 | ps.DeleteTerrain(); | 99 | pScene.DeleteTerrain(); |
77 | ps.Dispose(); | 100 | pScene.Dispose(); |
78 | 101 | ||
79 | } | 102 | } |
80 | 103 | ||
@@ -85,9 +108,9 @@ namespace OpenSim.Region.Physics.OdePlugin.Tests | |||
85 | Vector3 position = new Vector3(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f), 128f); | 108 | Vector3 position = new Vector3(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f), 128f); |
86 | Vector3 size = new Vector3(0.5f, 0.5f, 0.5f); | 109 | Vector3 size = new Vector3(0.5f, 0.5f, 0.5f); |
87 | Quaternion rot = Quaternion.Identity; | 110 | Quaternion rot = Quaternion.Identity; |
88 | PhysicsActor prim = ps.AddPrimShape("CoolShape", newcube, position, size, rot, true, 0); | 111 | PhysicsActor prim = pScene.AddPrimShape("CoolShape", newcube, position, size, rot, true, 0); |
89 | OdePrim oprim = (OdePrim)prim; | 112 | OdePrim oprim = (OdePrim)prim; |
90 | OdeScene pscene = (OdeScene) ps; | 113 | OdeScene pscene = (OdeScene)pScene; |
91 | 114 | ||
92 | Assert.That(oprim.m_taintadd); | 115 | Assert.That(oprim.m_taintadd); |
93 | 116 | ||
@@ -95,7 +118,7 @@ namespace OpenSim.Region.Physics.OdePlugin.Tests | |||
95 | 118 | ||
96 | for (int i = 0; i < 58; i++) | 119 | for (int i = 0; i < 58; i++) |
97 | { | 120 | { |
98 | ps.Simulate(0.133f); | 121 | pScene.Simulate(0.133f); |
99 | 122 | ||
100 | Assert.That(oprim.prim_geom != (IntPtr)0); | 123 | Assert.That(oprim.prim_geom != (IntPtr)0); |
101 | 124 | ||
@@ -119,9 +142,9 @@ namespace OpenSim.Region.Physics.OdePlugin.Tests | |||
119 | // Make sure we're not somewhere above the ground | 142 | // Make sure we're not somewhere above the ground |
120 | Assert.That(prim.Position.Z < 21.5f); | 143 | Assert.That(prim.Position.Z < 21.5f); |
121 | 144 | ||
122 | ps.RemovePrim(prim); | 145 | pScene.RemovePrim(prim); |
123 | Assert.That(oprim.m_taintremove); | 146 | Assert.That(oprim.m_taintremove); |
124 | ps.Simulate(0.133f); | 147 | pScene.Simulate(0.133f); |
125 | Assert.That(oprim.Body == (IntPtr)0); | 148 | Assert.That(oprim.Body == (IntPtr)0); |
126 | } | 149 | } |
127 | } | 150 | } |
diff --git a/OpenSim/Region/Physics/OdePlugin/drawstuff.cs b/OpenSim/Region/PhysicsModules/Ode/drawstuff.cs index 87ca446..87ca446 100644 --- a/OpenSim/Region/Physics/OdePlugin/drawstuff.cs +++ b/OpenSim/Region/PhysicsModules/Ode/drawstuff.cs | |||
diff --git a/OpenSim/Region/Physics/POSPlugin/AssemblyInfo.cs b/OpenSim/Region/PhysicsModules/POS/AssemblyInfo.cs index fc1ffba..e3a3e35 100644 --- a/OpenSim/Region/Physics/POSPlugin/AssemblyInfo.cs +++ b/OpenSim/Region/PhysicsModules/POS/AssemblyInfo.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System.Reflection; | 28 | using System.Reflection; |
29 | using System.Runtime.InteropServices; | 29 | using System.Runtime.InteropServices; |
30 | using Mono.Addins; | ||
30 | 31 | ||
31 | // Information about this assembly is defined by the following | 32 | // Information about this assembly is defined by the following |
32 | // attributes. | 33 | // attributes. |
@@ -56,3 +57,6 @@ using System.Runtime.InteropServices; | |||
56 | // numbers with the '*' character (the default): | 57 | // numbers with the '*' character (the default): |
57 | 58 | ||
58 | [assembly : AssemblyVersion("0.8.2.*")] | 59 | [assembly : AssemblyVersion("0.8.2.*")] |
60 | |||
61 | [assembly: Addin("OpenSim.Region.PhysicsModule.POS", OpenSim.VersionInfo.VersionNumber)] | ||
62 | [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] | ||
diff --git a/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs b/OpenSim/Region/PhysicsModules/POS/POSCharacter.cs index 40ab984..32469d9 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs +++ b/OpenSim/Region/PhysicsModules/POS/POSCharacter.cs | |||
@@ -30,9 +30,9 @@ using System.Collections.Generic; | |||
30 | using Nini.Config; | 30 | using Nini.Config; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Region.Physics.Manager; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | 34 | ||
35 | namespace OpenSim.Region.Physics.POSPlugin | 35 | namespace OpenSim.Region.PhysicsModule.POS |
36 | { | 36 | { |
37 | public class POSCharacter : PhysicsActor | 37 | public class POSCharacter : PhysicsActor |
38 | { | 38 | { |
diff --git a/OpenSim/Region/Physics/POSPlugin/POSPrim.cs b/OpenSim/Region/PhysicsModules/POS/POSPrim.cs index 782ba82..c190fab 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSPrim.cs +++ b/OpenSim/Region/PhysicsModules/POS/POSPrim.cs | |||
@@ -30,9 +30,9 @@ using System.Collections.Generic; | |||
30 | using Nini.Config; | 30 | using Nini.Config; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Region.Physics.Manager; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | 34 | ||
35 | namespace OpenSim.Region.Physics.POSPlugin | 35 | namespace OpenSim.Region.PhysicsModule.POS |
36 | { | 36 | { |
37 | public class POSPrim : PhysicsActor | 37 | public class POSPrim : PhysicsActor |
38 | { | 38 | { |
diff --git a/OpenSim/Region/Physics/POSPlugin/POSScene.cs b/OpenSim/Region/PhysicsModules/POS/POSScene.cs index 061304a..e6bcbf2 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSScene.cs +++ b/OpenSim/Region/PhysicsModules/POS/POSScene.cs | |||
@@ -29,31 +29,81 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using Nini.Config; | 30 | using Nini.Config; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using Mono.Addins; | ||
32 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
33 | using OpenSim.Region.Physics.Manager; | 34 | using OpenSim.Region.PhysicsModules.SharedBase; |
35 | using OpenSim.Region.Framework.Scenes; | ||
36 | using OpenSim.Region.Framework.Interfaces; | ||
34 | 37 | ||
35 | namespace OpenSim.Region.Physics.POSPlugin | 38 | namespace OpenSim.Region.PhysicsModule.POS |
36 | { | 39 | { |
37 | public class POSScene : PhysicsScene | 40 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "POSPhysicsScene")] |
41 | public class POSScene : PhysicsScene, INonSharedRegionModule | ||
38 | { | 42 | { |
39 | private List<POSCharacter> _characters = new List<POSCharacter>(); | 43 | private List<POSCharacter> _characters = new List<POSCharacter>(); |
40 | private List<POSPrim> _prims = new List<POSPrim>(); | 44 | private List<POSPrim> _prims = new List<POSPrim>(); |
41 | private float[] _heightMap; | 45 | private float[] _heightMap; |
42 | private const float gravity = -9.8f; | 46 | private const float gravity = -9.8f; |
43 | 47 | ||
48 | private bool m_Enabled = false; | ||
44 | //protected internal string sceneIdentifier; | 49 | //protected internal string sceneIdentifier; |
45 | 50 | ||
46 | public POSScene(string engineType, String _sceneIdentifier) | 51 | #region INonSharedRegionModule |
52 | public string Name | ||
47 | { | 53 | { |
48 | EngineType = engineType; | 54 | get { return "POS"; } |
49 | Name = EngineType + "/" + _sceneIdentifier; | ||
50 | //sceneIdentifier = _sceneIdentifier; | ||
51 | } | 55 | } |
52 | 56 | ||
53 | public override void Initialise(IMesher meshmerizer, IConfigSource config) | 57 | public Type ReplaceableInterface |
54 | { | 58 | { |
59 | get { return null; } | ||
55 | } | 60 | } |
56 | 61 | ||
62 | public void Initialise(IConfigSource source) | ||
63 | { | ||
64 | // TODO: Move this out of Startup | ||
65 | IConfig config = source.Configs["Startup"]; | ||
66 | if (config != null) | ||
67 | { | ||
68 | string physics = config.GetString("physics", string.Empty); | ||
69 | if (physics == Name) | ||
70 | m_Enabled = true; | ||
71 | } | ||
72 | |||
73 | } | ||
74 | |||
75 | public void Close() | ||
76 | { | ||
77 | } | ||
78 | |||
79 | public void AddRegion(Scene scene) | ||
80 | { | ||
81 | if (!m_Enabled) | ||
82 | return; | ||
83 | |||
84 | EngineType = Name; | ||
85 | PhysicsSceneName = EngineType + "/" + scene.RegionInfo.RegionName; | ||
86 | |||
87 | scene.RegisterModuleInterface<PhysicsScene>(this); | ||
88 | base.Initialise(scene.PhysicsRequestAsset, | ||
89 | (scene.Heightmap != null ? scene.Heightmap.GetFloatsSerialised() : new float[Constants.RegionSize * Constants.RegionSize]), | ||
90 | (float)scene.RegionInfo.RegionSettings.WaterHeight); | ||
91 | |||
92 | } | ||
93 | |||
94 | public void RemoveRegion(Scene scene) | ||
95 | { | ||
96 | if (!m_Enabled) | ||
97 | return; | ||
98 | } | ||
99 | |||
100 | public void RegionLoaded(Scene scene) | ||
101 | { | ||
102 | if (!m_Enabled) | ||
103 | return; | ||
104 | } | ||
105 | #endregion | ||
106 | |||
57 | public override void Dispose() | 107 | public override void Dispose() |
58 | { | 108 | { |
59 | } | 109 | } |
diff --git a/OpenSim/Region/Physics/Manager/AssemblyInfo.cs b/OpenSim/Region/PhysicsModules/SharedBase/AssemblyInfo.cs index 33f60e4..33f60e4 100644 --- a/OpenSim/Region/Physics/Manager/AssemblyInfo.cs +++ b/OpenSim/Region/PhysicsModules/SharedBase/AssemblyInfo.cs | |||
diff --git a/OpenSim/Region/Physics/Manager/CollisionLocker.cs b/OpenSim/Region/PhysicsModules/SharedBase/CollisionLocker.cs index cace4e4..6e658b5 100644 --- a/OpenSim/Region/Physics/Manager/CollisionLocker.cs +++ b/OpenSim/Region/PhysicsModules/SharedBase/CollisionLocker.cs | |||
@@ -28,7 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | 30 | ||
31 | namespace OpenSim.Region.Physics.Manager | 31 | namespace OpenSim.Region.PhysicsModules.SharedBase |
32 | { | 32 | { |
33 | public class CollisionLocker | 33 | public class CollisionLocker |
34 | { | 34 | { |
diff --git a/OpenSim/Region/Physics/Manager/IMesher.cs b/OpenSim/Region/PhysicsModules/SharedBase/IMesher.cs index e290dc9..88169bb 100644 --- a/OpenSim/Region/Physics/Manager/IMesher.cs +++ b/OpenSim/Region/PhysicsModules/SharedBase/IMesher.cs | |||
@@ -31,7 +31,7 @@ using System.Runtime.InteropServices; | |||
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | 33 | ||
34 | namespace OpenSim.Region.Physics.Manager | 34 | namespace OpenSim.Region.PhysicsModules.SharedBase |
35 | { | 35 | { |
36 | public interface IMesher | 36 | public interface IMesher |
37 | { | 37 | { |
diff --git a/OpenSim/Region/Physics/Manager/IPhysicsParameters.cs b/OpenSim/Region/PhysicsModules/SharedBase/IPhysicsParameters.cs index 31a397c..fb0c9e2 100755 --- a/OpenSim/Region/Physics/Manager/IPhysicsParameters.cs +++ b/OpenSim/Region/PhysicsModules/SharedBase/IPhysicsParameters.cs | |||
@@ -30,7 +30,7 @@ using System.Collections.Generic; | |||
30 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | 32 | ||
33 | namespace OpenSim.Region.Physics.Manager | 33 | namespace OpenSim.Region.PhysicsModules.SharedBase |
34 | { | 34 | { |
35 | public struct PhysParameterEntry | 35 | public struct PhysParameterEntry |
36 | { | 36 | { |
diff --git a/OpenSim/Region/Physics/Manager/NullPhysicsScene.cs b/OpenSim/Region/PhysicsModules/SharedBase/NullPhysicsScene.cs index b52f1f6..432708c 100644 --- a/OpenSim/Region/Physics/Manager/NullPhysicsScene.cs +++ b/OpenSim/Region/PhysicsModules/SharedBase/NullPhysicsScene.cs | |||
@@ -32,7 +32,7 @@ using Nini.Config; | |||
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | 34 | ||
35 | namespace OpenSim.Region.Physics.Manager | 35 | namespace OpenSim.Region.PhysicsModules.SharedBase |
36 | { | 36 | { |
37 | class NullPhysicsScene : PhysicsScene | 37 | class NullPhysicsScene : PhysicsScene |
38 | { | 38 | { |
@@ -40,11 +40,6 @@ namespace OpenSim.Region.Physics.Manager | |||
40 | 40 | ||
41 | private static int m_workIndicator; | 41 | private static int m_workIndicator; |
42 | 42 | ||
43 | public override void Initialise(IMesher meshmerizer, IConfigSource config) | ||
44 | { | ||
45 | // Does nothing right now | ||
46 | } | ||
47 | |||
48 | public override PhysicsActor AddAvatar( | 43 | public override PhysicsActor AddAvatar( |
49 | string avName, Vector3 position, Vector3 velocity, Vector3 size, bool isFlying) | 44 | string avName, Vector3 position, Vector3 velocity, Vector3 size, bool isFlying) |
50 | { | 45 | { |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs index 60f6480..edc41e4 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs | |||
@@ -32,7 +32,7 @@ using System.Reflection; | |||
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | 34 | ||
35 | namespace OpenSim.Region.Physics.Manager | 35 | namespace OpenSim.Region.PhysicsModules.SharedBase |
36 | { | 36 | { |
37 | public delegate void PositionUpdate(Vector3 position); | 37 | public delegate void PositionUpdate(Vector3 position); |
38 | public delegate void VelocityUpdate(Vector3 velocity); | 38 | public delegate void VelocityUpdate(Vector3 velocity); |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsJoint.cs b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsJoint.cs index b685d04..ce2bf05 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsJoint.cs +++ b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsJoint.cs | |||
@@ -30,7 +30,7 @@ using System.Collections.Generic; | |||
30 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | 32 | ||
33 | namespace OpenSim.Region.Physics.Manager | 33 | namespace OpenSim.Region.PhysicsModules.SharedBase |
34 | { | 34 | { |
35 | public enum PhysicsJointType : int | 35 | public enum PhysicsJointType : int |
36 | { | 36 | { |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs index a9b30e1..1c0ad20 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs +++ b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs | |||
@@ -35,7 +35,7 @@ using Nini.Config; | |||
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenMetaverse; | 36 | using OpenMetaverse; |
37 | 37 | ||
38 | namespace OpenSim.Region.Physics.Manager | 38 | namespace OpenSim.Region.PhysicsModules.SharedBase |
39 | { | 39 | { |
40 | public delegate void physicsCrash(); | 40 | public delegate void physicsCrash(); |
41 | 41 | ||
@@ -104,7 +104,7 @@ namespace OpenSim.Region.Physics.Manager | |||
104 | /// Useful in debug messages to distinguish one OdeScene instance from another. | 104 | /// Useful in debug messages to distinguish one OdeScene instance from another. |
105 | /// Usually set to include the region name that the physics engine is acting for. | 105 | /// Usually set to include the region name that the physics engine is acting for. |
106 | /// </summary> | 106 | /// </summary> |
107 | public string Name { get; protected set; } | 107 | public string PhysicsSceneName { get; protected set; } |
108 | 108 | ||
109 | /// <summary> | 109 | /// <summary> |
110 | /// A string identifying the family of this physics engine. Most common values returned | 110 | /// A string identifying the family of this physics engine. Most common values returned |
@@ -123,6 +123,14 @@ namespace OpenSim.Region.Physics.Manager | |||
123 | 123 | ||
124 | public RequestAssetDelegate RequestAssetMethod { get; set; } | 124 | public RequestAssetDelegate RequestAssetMethod { get; set; } |
125 | 125 | ||
126 | protected void Initialise(RequestAssetDelegate m, float[] terrain, float waterHeight) | ||
127 | { | ||
128 | RequestAssetMethod = m; | ||
129 | SetTerrain(terrain); | ||
130 | SetWaterLevel(waterHeight); | ||
131 | |||
132 | } | ||
133 | |||
126 | public virtual void TriggerPhysicsBasedRestart() | 134 | public virtual void TriggerPhysicsBasedRestart() |
127 | { | 135 | { |
128 | physicsCrash handler = OnPhysicsCrash; | 136 | physicsCrash handler = OnPhysicsCrash; |
@@ -132,17 +140,6 @@ namespace OpenSim.Region.Physics.Manager | |||
132 | } | 140 | } |
133 | } | 141 | } |
134 | 142 | ||
135 | // Deprecated. Do not use this for new physics engines. | ||
136 | public abstract void Initialise(IMesher meshmerizer, IConfigSource config); | ||
137 | |||
138 | // For older physics engines that do not implement non-legacy region sizes. | ||
139 | // If the physics engine handles the region extent feature, it overrides this function. | ||
140 | public virtual void Initialise(IMesher meshmerizer, IConfigSource config, Vector3 regionExtent) | ||
141 | { | ||
142 | // If not overridden, call the old initialization entry. | ||
143 | Initialise(meshmerizer, config); | ||
144 | } | ||
145 | |||
146 | /// <summary> | 143 | /// <summary> |
147 | /// Add an avatar | 144 | /// Add an avatar |
148 | /// </summary> | 145 | /// </summary> |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsSensor.cs b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsSensor.cs index f480d71..da9c96c 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsSensor.cs +++ b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsSensor.cs | |||
@@ -29,7 +29,7 @@ using System; | |||
29 | using System.Timers; | 29 | using System.Timers; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | 31 | ||
32 | namespace OpenSim.Region.Physics.Manager | 32 | namespace OpenSim.Region.PhysicsModules.SharedBase |
33 | { | 33 | { |
34 | [Flags] | 34 | [Flags] |
35 | public enum SenseType : uint | 35 | public enum SenseType : uint |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsVector.cs b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsVector.cs index f60a636..76a82fa 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsVector.cs +++ b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsVector.cs | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | 29 | ||
30 | namespace OpenSim.Region.Physics.Manager | 30 | namespace OpenSim.Region.PhysicsModules.SharedBase |
31 | { | 31 | { |
32 | /*public class PhysicsVector | 32 | /*public class PhysicsVector |
33 | { | 33 | { |
diff --git a/OpenSim/Region/Physics/Manager/VehicleConstants.cs b/OpenSim/Region/PhysicsModules/SharedBase/VehicleConstants.cs index 8e24b4c..e850b11 100644 --- a/OpenSim/Region/Physics/Manager/VehicleConstants.cs +++ b/OpenSim/Region/PhysicsModules/SharedBase/VehicleConstants.cs | |||
@@ -28,7 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using OpenMetaverse; | 29 | using OpenMetaverse; |
30 | 30 | ||
31 | namespace OpenSim.Region.Physics.Manager | 31 | namespace OpenSim.Region.PhysicsModules.SharedBase |
32 | { | 32 | { |
33 | public enum Vehicle : int | 33 | public enum Vehicle : int |
34 | { | 34 | { |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 8f4e840..3f523a4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -54,7 +54,7 @@ using OpenSim.Region.Framework.Scenes; | |||
54 | using OpenSim.Region.Framework.Scenes.Serialization; | 54 | using OpenSim.Region.Framework.Scenes.Serialization; |
55 | using OpenSim.Region.Framework.Scenes.Animation; | 55 | using OpenSim.Region.Framework.Scenes.Animation; |
56 | using OpenSim.Region.Framework.Scenes.Scripting; | 56 | using OpenSim.Region.Framework.Scenes.Scripting; |
57 | using OpenSim.Region.Physics.Manager; | 57 | using OpenSim.Region.PhysicsModules.SharedBase; |
58 | using OpenSim.Region.ScriptEngine.Shared; | 58 | using OpenSim.Region.ScriptEngine.Shared; |
59 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; | 59 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; |
60 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | 60 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; |
diff --git a/OpenSim/Region/UserStatistics/Properties/AssemblyInfo.cs b/OpenSim/Region/UserStatistics/Properties/AssemblyInfo.cs deleted file mode 100644 index 9fac53e..0000000 --- a/OpenSim/Region/UserStatistics/Properties/AssemblyInfo.cs +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Region.UserStatistics")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("42b28288-5fdd-478f-8903-8dccbbb2d5f9")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.8.2.*")] | ||
33 | |||