public void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
        {
            _scene = scene;

            // Default to ground turbulence
            for (int y = 0; y < 16; y++)
            {
                for (int x = 0; x < 16; x++)
                {
                    m_options[y * 16 + x] = WindConstants.WindSpeedTurbulence;
                }
            }

            if (windConfig != null)
            {
                // Uses strength value if avg_strength not specified
                m_avgWindStrength = windConfig.GetFloat("strength", 5.0F);
                m_avgWindStrength = windConfig.GetFloat("avg_strength", 5.0F);

                m_avgWindDirection  = windConfig.GetFloat("avg_direction", 0.0F);
                m_varWindStrength   = windConfig.GetFloat("var_strength", 5.0F);
                m_varWindDirection  = windConfig.GetFloat("var_direction", 30.0F);
                m_rateChangeAloft   = windConfig.GetFloat("rate_change_aloft", 1.0f);
                m_rateChangeFlutter = windConfig.GetFloat("rate_change_flutter", 64.0f);

                LogSettings();
            }
        }
Exemple #2
0
 public void RemoveRegion(OpenSim.Region.Framework.Scenes.Scene scene)
 {
     if (scene.RequestModuleInterface <IGroupsServicesConnector>() == this)
     {
         scene.UnregisterModuleInterface <IGroupsServicesConnector>(this);
     }
 }
 public void RegionLoaded(OpenSim.Region.Framework.Scenes.Scene scene)
 {
     GroupsConnector = Aurora.DataManager.DataManager.RequestPlugin <IGroupsServiceConnector>();
     if (GroupsConnector == null)
     {
         m_log.Warn("[AURORA-GROUPS-CONNECTOR]: GroupsConnector is null");
         m_connectorEnabled = false;
     }
 }
Exemple #4
0
 public void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
 {
     if (windConfig != null)
     {
         if (windConfig.Contains("strength"))
         {
             m_strength = windConfig.GetFloat("strength", 1.0F);
         }
     }
 }
 public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene)
 {
     if (m_connectorEnabled)
     {
         if (m_accountService == null)
         {
             m_accountService = scene.UserAccountService;
         }
         scene.RegisterModuleInterface <IGroupsServicesConnector>(this);
     }
 }
        public void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
        {
            if (windConfig != null)
            {
                // Uses strength value if avg_strength not specified
                m_avgStrength = windConfig.GetFloat("strength", 5.0F);
                m_avgStrength = windConfig.GetFloat("avg_strength", 5.0F);

                m_avgDirection = windConfig.GetFloat("avg_direction", 0.0F);
                m_varStrength  = windConfig.GetFloat("var_strength", 5.0F);
                m_varDirection = windConfig.GetFloat("var_direction", 30.0F);
                m_rateChange   = windConfig.GetFloat("rate_change", 1.0F);

                LogSettings();
            }
        }
Exemple #7
0
        public void Initialize()
        {
            IConfigSource openSimINI    = new IniConfigSource();
            IConfig       startupConfig = openSimINI.AddConfig("Startup");

            startupConfig.Set("physics", "OpenDynamicsEngine");
            startupConfig.Set("DecodedSculptMapPath", "j2kDecodeCache");

            Vector3 regionExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight);

            //PhysicsScene pScene = physicsPluginManager.GetPhysicsScene(
            //                "BulletSim", "Meshmerizer", openSimINI, "BSTestRegion", regionExtent);
            RegionInfo info = new RegionInfo();

            info.RegionName  = "ODETestRegion";
            info.RegionSizeX = info.RegionSizeY = info.RegionSizeZ = Constants.RegionSize;
            OpenSim.Region.Framework.Scenes.Scene scene = new OpenSim.Region.Framework.Scenes.Scene(info);

            //IMesher mesher = new OpenSim.Region.PhysicsModule.Meshing.Meshmerizer();
            //INonSharedRegionModule mod = mesher as INonSharedRegionModule;
            //mod.Initialise(openSimINI);
            //mod.AddRegion(scene);
            //mod.RegionLoaded(scene);

            //            pScene = new OdeScene();
            odemodule = new OpenSim.Region.PhysicsModule.ODE.OdeModule();
            Console.WriteLine("HERE " + (odemodule == null ? "Null" : "Not null"));
            odemodule.Initialise(openSimINI);
            odemodule.AddRegion(scene);
            odemodule.RegionLoaded(scene);

            // Loading ODEPlugin
            //cbt = new OdePlugin();
            // Getting Physics Scene
            //ps = cbt.GetScene("test");
            // Initializing Physics Scene.
            //ps.Initialise(imp.GetMesher(TopConfig), null, Vector3.Zero);
            float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize];
            for (int i = 0; i < ((int)Constants.RegionSize * (int)Constants.RegionSize); i++)
            {
                _heightmap[i] = 21f;
            }
            pScene = scene.PhysicsScene;
            pScene.SetTerrain(_heightmap);
        }
 public void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
 {
     if (windConfig != null)
     {
         if (windConfig.Contains("strength"))
         {
             m_strength = windConfig.GetFloat("strength", 1.0f);
         }
         if (windConfig.Contains("damping"))
         {
             m_damping_rate = windConfig.GetFloat("damping", 0);
             if (m_damping_rate > 1.0f)
             {
                 m_damping_rate = 1.0f;
             }
         }
         if (windConfig.Contains("force"))
         {
             m_init_force = windConfig.GetInt("force", 0);
             if (m_init_force < 0 || m_init_force > 2)
             {
                 m_init_force = 0;
             }
         }
         //
         if (windConfig.Contains("region"))
         {
             m_region_size = windConfig.GetInt("region", 256);
             m_region_size = (((int)Math.Abs(m_region_size) + 255) / 256) * 256;
             if (m_region_size == 0)
             {
                 m_region_size = 256;
             }
         }
         if (scene != null)
         {
             m_region_size = (int)scene.RegionInfo.RegionSizeX;
         }
     }
 }
Exemple #9
0
 public void RegionLoaded(OpenSim.Region.Framework.Scenes.Scene scene)
 {
     // TODO: May want to consider listenning for Agent Connections so we can pre-cache group info
     // scene.EventManager.OnNewClient += OnNewClient;
 }
 public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene)
 {
     scene.EventManager.OnNewClient += OnNewClient;
     m_scene = scene;
 }
Exemple #11
0
        public void WindConfig(OpenSim.Region.Framework.Scenes.Scene scene, Nini.Config.IConfig windConfig)
        {
            _scene = scene;

            // Default to ground turbulence
            for (int y = 0; y < 16; y++)
            {
                for (int x = 0; x < 16; x++)
                {
                    m_options[y * 16 + x] = WindConstants.WindSpeedTurbulence;
                }
            }
            
            if (windConfig != null)
            {
                // Uses strength value if avg_strength not specified
                m_avgWindStrength = windConfig.GetFloat("strength", 5.0F);
                m_avgWindStrength = windConfig.GetFloat("avg_strength", 5.0F);

                m_avgWindDirection = windConfig.GetFloat("avg_direction", 0.0F);
                m_varWindStrength  = windConfig.GetFloat("var_strength", 5.0F);
                m_varWindDirection = windConfig.GetFloat("var_direction", 30.0F);
                m_rateChangeAloft   = windConfig.GetFloat("rate_change_aloft", 1.0f);
                m_rateChangeFlutter = windConfig.GetFloat("rate_change_flutter", 64.0f);

                LogSettings();
            }
        }
        // 'engineName' is the Bullet engine to use. Either null (for unmanaged), "BulletUnmanaged" or "BulletXNA"
        // 'params' is a set of keyValue pairs to set in the engine's configuration file (override defaults)
        //      May be 'null' if there are no overrides.
        public static BSScene CreateBasicPhysicsEngine(Dictionary <string, string> paramOverrides)
        {
            IConfigSource openSimINI    = new IniConfigSource();
            IConfig       startupConfig = openSimINI.AddConfig("Startup");

            startupConfig.Set("physics", "BulletSim");
            startupConfig.Set("meshing", "Meshmerizer");
            startupConfig.Set("cacheSculptMaps", "false"); // meshmerizer shouldn't save maps

            IConfig bulletSimConfig = openSimINI.AddConfig("BulletSim");

            // If the caller cares, specify the bullet engine otherwise it will default to "BulletUnmanaged".
            // bulletSimConfig.Set("BulletEngine", "BulletUnmanaged");
            // bulletSimConfig.Set("BulletEngine", "BulletXNA");
            bulletSimConfig.Set("MeshSculptedPrim", "false");
            bulletSimConfig.Set("ForceSimplePrimMeshing", "true");
            if (paramOverrides != null)
            {
                foreach (KeyValuePair <string, string> kvp in paramOverrides)
                {
                    bulletSimConfig.Set(kvp.Key, kvp.Value);
                }
            }

            // If a special directory exists, put detailed logging therein.
            // This allows local testing/debugging without having to worry that the build engine will output logs.
            if (Directory.Exists("physlogs"))
            {
                bulletSimConfig.Set("PhysicsLoggingDir", "./physlogs");
                bulletSimConfig.Set("PhysicsLoggingEnabled", "True");
                bulletSimConfig.Set("PhysicsLoggingDoFlush", "True");
                bulletSimConfig.Set("VehicleLoggingEnabled", "True");
            }

            Vector3 regionExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight);

            RegionInfo info = new RegionInfo();

            info.RegionName  = "BSTestRegion";
            info.RegionSizeX = info.RegionSizeY = info.RegionSizeZ = Constants.RegionSize;
            OpenSim.Region.Framework.Scenes.Scene scene = new OpenSim.Region.Framework.Scenes.Scene(info);

            IMesher mesher             = new OpenSim.Region.PhysicsModule.Meshing.Meshmerizer();
            INonSharedRegionModule mod = mesher as INonSharedRegionModule;

            mod.Initialise(openSimINI);
            mod.AddRegion(scene);
            mod.RegionLoaded(scene);

            BSScene pScene = new BSScene();

            mod = (pScene as INonSharedRegionModule);
            mod.Initialise(openSimINI);
            mod.AddRegion(scene);
            mod.RegionLoaded(scene);

            // Since the asset requestor is not initialized, any mesh or sculptie will be a cube.
            // In the future, add a fake asset fetcher to get meshes and sculpts.
            // bsScene.RequestAssetMethod = ???;

            return(pScene);
        }
 public void RegionLoaded(OpenSim.Region.Framework.Scenes.Scene scene)
 {
 }
 public void RemoveRegion(OpenSim.Region.Framework.Scenes.Scene scene)
 {
 }
 public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene)
 {
     scene.EventManager.OnNewClient += OnNewClient;
     m_scene = scene;
 }
    // 'engineName' is the Bullet engine to use. Either null (for unmanaged), "BulletUnmanaged" or "BulletXNA"
    // 'params' is a set of keyValue pairs to set in the engine's configuration file (override defaults)
    //      May be 'null' if there are no overrides.
    public static BSScene CreateBasicPhysicsEngine(Dictionary<string,string> paramOverrides)
    {
        IConfigSource openSimINI = new IniConfigSource();
        IConfig startupConfig = openSimINI.AddConfig("Startup");
        startupConfig.Set("physics", "BulletSim");
        startupConfig.Set("meshing", "Meshmerizer");
        startupConfig.Set("cacheSculptMaps", "false");  // meshmerizer shouldn't save maps

        IConfig bulletSimConfig = openSimINI.AddConfig("BulletSim");
        // If the caller cares, specify the bullet engine otherwise it will default to "BulletUnmanaged".
        // bulletSimConfig.Set("BulletEngine", "BulletUnmanaged");
        // bulletSimConfig.Set("BulletEngine", "BulletXNA");
        bulletSimConfig.Set("MeshSculptedPrim", "false");
        bulletSimConfig.Set("ForceSimplePrimMeshing", "true");
        if (paramOverrides != null)
        {
            foreach (KeyValuePair<string, string> kvp in paramOverrides)
            {
                bulletSimConfig.Set(kvp.Key, kvp.Value);
            }
        }

        // If a special directory exists, put detailed logging therein.
        // This allows local testing/debugging without having to worry that the build engine will output logs.
        if (Directory.Exists("physlogs"))
        {
            bulletSimConfig.Set("PhysicsLoggingDir","./physlogs");
            bulletSimConfig.Set("PhysicsLoggingEnabled","True");
            bulletSimConfig.Set("PhysicsLoggingDoFlush","True");
            bulletSimConfig.Set("VehicleLoggingEnabled","True");
        }

        Vector3 regionExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight);
       
        RegionInfo info = new RegionInfo();
        info.RegionName = "BSTestRegion";
        info.RegionSizeX = info.RegionSizeY = info.RegionSizeZ = Constants.RegionSize;
        OpenSim.Region.Framework.Scenes.Scene scene = new OpenSim.Region.Framework.Scenes.Scene(info);

        IMesher mesher = new OpenSim.Region.PhysicsModules.Meshing.Meshmerizer();
        INonSharedRegionModule mod = mesher as INonSharedRegionModule;
        mod.Initialise(openSimINI);
        mod.AddRegion(scene);
        mod.RegionLoaded(scene);

        BSScene pScene = new BSScene();
        mod = (pScene as INonSharedRegionModule);
        mod.Initialise(openSimINI);
        mod.AddRegion(scene);
        mod.RegionLoaded(scene);

        // Since the asset requestor is not initialized, any mesh or sculptie will be a cube.
        // In the future, add a fake asset fetcher to get meshes and sculpts.
        // bsScene.RequestAssetMethod = ???;

        return pScene;
    }