diff options
Diffstat (limited to 'OpenSim/Region/Physics/Manager')
4 files changed, 62 insertions, 32 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index d4af271..482b478 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -27,8 +27,8 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using Axiom.Math; | ||
31 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
31 | using OpenMetaverse; | ||
32 | 32 | ||
33 | namespace OpenSim.Region.Physics.Manager | 33 | namespace OpenSim.Region.Physics.Manager |
34 | { | 34 | { |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs index 3d9207f..db41251 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs | |||
@@ -115,43 +115,73 @@ namespace OpenSim.Region.Physics.Manager | |||
115 | // that the LoadFrom context be avoided. This can be done by installing assemblies in the | 115 | // that the LoadFrom context be avoided. This can be done by installing assemblies in the |
116 | // Global Assembly Cache or in the ApplicationBase directory and using Assembly. | 116 | // Global Assembly Cache or in the ApplicationBase directory and using Assembly. |
117 | // Load when explicitly loading assemblies. | 117 | // Load when explicitly loading assemblies. |
118 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); | 118 | Assembly pluginAssembly = null; |
119 | Type[] types = null; | ||
119 | 120 | ||
120 | foreach (Type pluginType in pluginAssembly.GetTypes()) | 121 | try |
121 | { | 122 | { |
122 | if (pluginType.IsPublic) | 123 | pluginAssembly = Assembly.LoadFrom(FileName); |
123 | { | 124 | } |
124 | if (!pluginType.IsAbstract) | 125 | catch (Exception ex) |
125 | { | 126 | { |
126 | Type physTypeInterface = pluginType.GetInterface("IPhysicsPlugin", true); | 127 | m_log.Error("Failed to load plugin from " + FileName, ex); |
127 | 128 | } | |
128 | if (physTypeInterface != null) | ||
129 | { | ||
130 | IPhysicsPlugin plug = | ||
131 | (IPhysicsPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | ||
132 | plug.Init(); | ||
133 | if (!_PhysPlugins.ContainsKey(plug.GetName())) | ||
134 | { | ||
135 | _PhysPlugins.Add(plug.GetName(), plug); | ||
136 | m_log.Info("[PHYSICS]: Added physics engine: " + plug.GetName()); | ||
137 | } | ||
138 | } | ||
139 | 129 | ||
140 | Type meshTypeInterface = pluginType.GetInterface("IMeshingPlugin", true); | 130 | if (pluginAssembly != null) |
131 | { | ||
132 | try | ||
133 | { | ||
134 | types = pluginAssembly.GetTypes(); | ||
135 | } | ||
136 | catch (ReflectionTypeLoadException ex) | ||
137 | { | ||
138 | m_log.Error("[PHYSICS]: Failed to enumerate types in plugin from " + FileName + ": " + | ||
139 | ex.LoaderExceptions[0].Message, ex); | ||
140 | } | ||
141 | catch (Exception ex) | ||
142 | { | ||
143 | m_log.Error("[PHYSICS]: Failed to enumerate types in plugin from " + FileName, ex); | ||
144 | } | ||
141 | 145 | ||
142 | if (meshTypeInterface != null) | 146 | if (types != null) |
147 | { | ||
148 | foreach (Type pluginType in types) | ||
149 | { | ||
150 | if (pluginType.IsPublic) | ||
143 | { | 151 | { |
144 | IMeshingPlugin plug = | 152 | if (!pluginType.IsAbstract) |
145 | (IMeshingPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | ||
146 | if (!_MeshPlugins.ContainsKey(plug.GetName())) | ||
147 | { | 153 | { |
148 | _MeshPlugins.Add(plug.GetName(), plug); | 154 | Type physTypeInterface = pluginType.GetInterface("IPhysicsPlugin", true); |
149 | m_log.Info("[PHYSICS]: Added meshing engine: " + plug.GetName()); | 155 | |
156 | if (physTypeInterface != null) | ||
157 | { | ||
158 | IPhysicsPlugin plug = | ||
159 | (IPhysicsPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | ||
160 | plug.Init(); | ||
161 | if (!_PhysPlugins.ContainsKey(plug.GetName())) | ||
162 | { | ||
163 | _PhysPlugins.Add(plug.GetName(), plug); | ||
164 | m_log.Info("[PHYSICS]: Added physics engine: " + plug.GetName()); | ||
165 | } | ||
166 | } | ||
167 | |||
168 | Type meshTypeInterface = pluginType.GetInterface("IMeshingPlugin", true); | ||
169 | |||
170 | if (meshTypeInterface != null) | ||
171 | { | ||
172 | IMeshingPlugin plug = | ||
173 | (IMeshingPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | ||
174 | if (!_MeshPlugins.ContainsKey(plug.GetName())) | ||
175 | { | ||
176 | _MeshPlugins.Add(plug.GetName(), plug); | ||
177 | m_log.Info("[PHYSICS]: Added meshing engine: " + plug.GetName()); | ||
178 | } | ||
179 | } | ||
180 | |||
181 | physTypeInterface = null; | ||
182 | meshTypeInterface = null; | ||
150 | } | 183 | } |
151 | } | 184 | } |
152 | |||
153 | physTypeInterface = null; | ||
154 | meshTypeInterface = null; | ||
155 | } | 185 | } |
156 | } | 186 | } |
157 | } | 187 | } |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index f9d990b..3575a51 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs | |||
@@ -27,10 +27,10 @@ | |||
27 | 27 | ||
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.Reflection; | 29 | using System.Reflection; |
30 | using Axiom.Math; | ||
31 | using log4net; | 30 | using log4net; |
32 | using Nini.Config; | 31 | using Nini.Config; |
33 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenMetaverse; | ||
34 | 34 | ||
35 | namespace OpenSim.Region.Physics.Manager | 35 | namespace OpenSim.Region.Physics.Manager |
36 | { | 36 | { |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsVector.cs b/OpenSim/Region/Physics/Manager/PhysicsVector.cs index adf4715..bbd6464 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsVector.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsVector.cs | |||
@@ -60,7 +60,7 @@ namespace OpenSim.Region.Physics.Manager | |||
60 | } | 60 | } |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// These routines are the easiest way to store XYZ values in an LLVector3 without requiring 3 calls. | 63 | /// These routines are the easiest way to store XYZ values in an Vector3 without requiring 3 calls. |
64 | /// </summary> | 64 | /// </summary> |
65 | /// <returns></returns> | 65 | /// <returns></returns> |
66 | public byte[] GetBytes() | 66 | public byte[] GetBytes() |