diff options
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/OdePlugin.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 716161a..6ee2714 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
46 | /// </summary> | 46 | /// </summary> |
47 | public class OdePlugin : IPhysicsPlugin | 47 | public class OdePlugin : IPhysicsPlugin |
48 | { | 48 | { |
49 | //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 49 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
50 | 50 | ||
51 | private OdeScene m_scene; | 51 | private OdeScene m_scene; |
52 | 52 | ||
@@ -59,13 +59,33 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
59 | { | 59 | { |
60 | if (m_scene == null) | 60 | if (m_scene == null) |
61 | { | 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 | { | ||
70 | string nativeLibraryPath; | ||
71 | |||
72 | if (Util.Is64BitProcess()) | ||
73 | nativeLibraryPath = "lib64/ode.dll"; | ||
74 | else | ||
75 | nativeLibraryPath = "lib32/ode.dll"; | ||
76 | |||
77 | m_log.DebugFormat("[ODE PLUGIN]: Loading native Windows ODE library at {0}", nativeLibraryPath); | ||
78 | Util.LoadLibrary(nativeLibraryPath); | ||
79 | } | ||
80 | |||
62 | // Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to | 81 | // Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to |
63 | // http://opensimulator.org/mantis/view.php?id=2750). | 82 | // http://opensimulator.org/mantis/view.php?id=2750). |
64 | d.InitODE(); | 83 | d.InitODE(); |
65 | 84 | ||
66 | m_scene = new OdeScene(sceneIdentifier); | 85 | m_scene = new OdeScene(sceneIdentifier); |
67 | } | 86 | } |
68 | return (m_scene); | 87 | |
88 | return m_scene; | ||
69 | } | 89 | } |
70 | 90 | ||
71 | public string GetName() | 91 | public string GetName() |