Esempio n. 1
0
        public void AddRegion(Scene scene)
        {
            if (!m_Enabled)
            {
                return;
            }

            if (Util.IsWindows())
            {
                Util.LoadArchSpecificWindowsDll("ode.dll");
            }

            // Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to
            // http://opensimulator.org/mantis/view.php?id=2750).
            d.InitODE();

            string ode_config = d.GetConfiguration();

            if (ode_config != null && ode_config != "")
            {
                m_log.InfoFormat("[ubODE] ode library configuration: {0}", ode_config);
                // ubODE still not avaiable
                if (ode_config.Contains("ODE_OPENSIM"))
                {
                    OSOdeLib = true;
                }
            }

            m_scene = new ODEScene(scene, m_config, Name, OSOdeLib);
        }
Esempio n. 2
0
 public ODEDynamics(OdePrim rootp)
 {
     rootPrim      = rootp;
     _pParentScene = rootPrim._parent_scene;
     m_timestep    = _pParentScene.ODE_STEPSIZE;
     m_invtimestep = 1.0f / m_timestep;
     m_gravmod     = rootPrim.GravModifier;
 }
Esempio n. 3
0
        public void RemoveRegion(Scene scene)
        {
            if (!m_Enabled || m_scene == null)
            {
                return;
            }

            m_scene.Dispose();
            m_scene = null;
        }
Esempio n. 4
0
 public ODERayCastRequestManager(ODEScene pScene)
 {
     m_scene      = pScene;
     nearCallback = near;
     ray          = SafeNativeMethods.CreateRay(IntPtr.Zero, 1.0f);
     SafeNativeMethods.GeomSetCategoryBits(ray, 0);
     Box = SafeNativeMethods.CreateBox(IntPtr.Zero, 1.0f, 1.0f, 1.0f);
     SafeNativeMethods.GeomSetCategoryBits(Box, 0);
     Sphere = SafeNativeMethods.CreateSphere(IntPtr.Zero, 1.0f);
     SafeNativeMethods.GeomSetCategoryBits(Sphere, 0);
     Plane = SafeNativeMethods.CreatePlane(IntPtr.Zero, 0f, 0f, 1f, 1f);
     SafeNativeMethods.GeomSetCategoryBits(Sphere, 0);
 }
Esempio n. 5
0
        public void AddRegion(Scene scene)
        {
            if (!m_Enabled)
            {
                return;
            }

            if (m_scenes.ContainsKey(scene)) // ???
            {
                return;
            }
            ODEScene newodescene = new ODEScene(scene, m_config, Name, Version, OSOdeLib);

            m_scenes[scene] = newodescene;
        }
Esempio n. 6
0
        public ODEMeshWorker(ODEScene pScene, ILog pLog, IMesher pMesher, IConfig pConfig)
        {
            m_scene  = pScene;
            m_log    = pLog;
            m_mesher = pMesher;

            if (pConfig != null)
            {
                meshSculptedPrim      = pConfig.GetBoolean("mesh_sculpted_prim", meshSculptedPrim);
                meshSculptLOD         = pConfig.GetFloat("mesh_lod", meshSculptLOD);
                MinSizeToMeshmerize   = pConfig.GetFloat("mesh_min_size", MinSizeToMeshmerize);
                MeshSculptphysicalLOD = pConfig.GetFloat("mesh_physical_lod", MeshSculptphysicalLOD);
            }
            m_running     = true;
            m_thread      = new Thread(DoWork);
            m_thread.Name = "OdeMeshWorker";
            m_thread.Start();
        }
Esempio n. 7
0
        public ODEMeshWorker(ODEScene pScene, ILog pLog, IMesher pMesher, IConfig pConfig)
        {
            m_scene  = pScene;
            m_log    = pLog;
            m_mesher = pMesher;

            if (pConfig != null)
            {
                meshSculptedPrim      = pConfig.GetBoolean("mesh_sculpted_prim", meshSculptedPrim);
                meshSculptLOD         = pConfig.GetFloat("mesh_lod", meshSculptLOD);
                MinSizeToMeshmerize   = pConfig.GetFloat("mesh_min_size", MinSizeToMeshmerize);
                MeshSculptphysicalLOD = pConfig.GetFloat("mesh_physical_lod", MeshSculptphysicalLOD);
            }
            m_running = true;
            Util.FireAndForget(DoCacheExpire, null, "OdeCacheExpire", false);
            lock (m_threadLock)
            {
                if (workQueue == null)
                {
                    workQueue = new ObjectJobEngine(DoWork, "OdeMeshWorker");
                }
            }
        }
Esempio n. 8
0
 /// <summary>
 /// Dereference the creator scene so that it can be garbage collected if needed.
 /// </summary>
 internal void Dispose()
 {
     m_scene = null;
     if (ray != IntPtr.Zero)
     {
         SafeNativeMethods.GeomDestroy(ray);
         ray = IntPtr.Zero;
     }
     if (Box != IntPtr.Zero)
     {
         SafeNativeMethods.GeomDestroy(Box);
         Box = IntPtr.Zero;
     }
     if (Sphere != IntPtr.Zero)
     {
         SafeNativeMethods.GeomDestroy(Sphere);
         Sphere = IntPtr.Zero;
     }
     if (Plane != IntPtr.Zero)
     {
         SafeNativeMethods.GeomDestroy(Plane);
         Plane = IntPtr.Zero;
     }
 }
Esempio n. 9
0
 public ODESitAvatar(ODEScene pScene, ODERayCastRequestManager raymanager)
 {
     m_scene      = pScene;
     m_raymanager = raymanager;
 }