Ejemplo 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);
        }
Ejemplo n.º 2
0
        public void RemoveRegion(Scene scene)
        {
            if (!m_Enabled || m_scene == null)
                return;

            m_scene.Dispose();
            m_scene = null;
        }
Ejemplo n.º 3
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;
        }
Ejemplo n.º 4
0
        public OdeCharacter(uint localID, String avName, ODEScene parent_scene, Vector3 pos, Vector3 pSize, float pfeetOffset, float density, float walk_divisor, float rundivisor)
        {
            m_uuid = UUID.Random();
            m_localID = localID;

            timeStep = parent_scene.ODE_STEPSIZE;
            invtimeStep = 1 / timeStep;

            if (pos.IsFinite())
            {
                if (pos.Z > 99999f)
                {
                    pos.Z = parent_scene.GetTerrainHeightAtXY(127, 127) + 5;
                }
                if (pos.Z < -100f) // shouldn't this be 0 ?
                {
                    pos.Z = parent_scene.GetTerrainHeightAtXY(127, 127) + 5;
                }
                _position = pos;
            }
            else
            {
                _position = new Vector3(((float)_parent_scene.WorldExtents.X * 0.5f), ((float)_parent_scene.WorldExtents.Y * 0.5f), parent_scene.GetTerrainHeightAtXY(128f, 128f) + 10f);
                m_log.Warn("[PHYSICS]: Got NaN Position on Character Create");
            }

            _parent_scene = parent_scene;


            m_size.X = pSize.X;
            m_size.Y = pSize.Y;
            m_size.Z = pSize.Z;

            if(m_size.X <0.01f)
                m_size.X = 0.01f;
            if(m_size.Y <0.01f)
                m_size.Y = 0.01f;
            if(m_size.Z <0.01f)
                m_size.Z = 0.01f;

            m_feetOffset = pfeetOffset;
            m_orientation = Quaternion.Identity;
            m_orientation2D = Quaternion.Identity;
            m_density = density;

            // force lower density for testing
            m_density = 3.0f;

            mu = parent_scene.AvatarFriction;

            walkDivisor = walk_divisor;
            runDivisor = rundivisor;

            m_mass = m_density * m_size.X * m_size.Y * m_size.Z; ; // sure we have a default           

            PID_D = basePID_D * m_mass * invtimeStep;
            PID_P = basePID_P * m_mass * invtimeStep;

            m_isPhysical = false; // current status: no ODE information exists

            Name = avName;

            AddChange(changes.Add, null);
        }
Ejemplo n.º 5
0
 public ODESitAvatar(ODEScene pScene, ODERayCastRequestManager raymanager)
 {
     m_scene = pScene;
     m_raymanager = raymanager;
 }
Ejemplo n.º 6
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;
 }
Ejemplo 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)
            {
                forceSimplePrimMeshing = pConfig.GetBoolean("force_simple_prim_meshing", forceSimplePrimMeshing);
                meshSculptedPrim = pConfig.GetBoolean("mesh_sculpted_prim", meshSculptedPrim);
                meshSculptLOD = pConfig.GetFloat("mesh_lod", meshSculptLOD);
                MeshSculptphysicalLOD = pConfig.GetFloat("mesh_physical_lod", MeshSculptphysicalLOD);
            }
            m_running = true;
            m_thread = new Thread(DoWork);
            m_thread.Name = "OdeMeshWorker";
            m_thread.Start();
        }