当前位置: 首页>>代码示例>>C#>>正文


C# PhysicsScene.SetTerrain方法代码示例

本文整理汇总了C#中PhysicsScene.SetTerrain方法的典型用法代码示例。如果您正苦于以下问题:C# PhysicsScene.SetTerrain方法的具体用法?C# PhysicsScene.SetTerrain怎么用?C# PhysicsScene.SetTerrain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhysicsScene的用法示例。


在下文中一共展示了PhysicsScene.SetTerrain方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialize

 public void Initialize()
 {
     // Loading ODEPlugin
     cbt = new OdePlugin();
     // Loading Zero Mesher
     imp = new ZeroMesherPlugin();
     // Getting Physics Scene
     ps = cbt.GetScene("test");
     // Initializing Physics Scene.
     ps.Initialise(imp.GetMesher(),null);
     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;
     }
     ps.SetTerrain(_heightmap);
 }
开发者ID:Ideia-Boa,项目名称:diva-distribution,代码行数:17,代码来源:ODETestClass.cs

示例2: Initialize

        public void Initialize()
        {
            IConfigSource TopConfig = new IniConfigSource();
            IConfig config = TopConfig.AddConfig("Startup");
            config.Set("DecodedSculptMapPath","j2kDecodeCache");

            // Loading ODEPlugin
            cbt = new OdePlugin();
            // Loading Zero Mesher
            imp = new ZeroMesherPlugin();
            // Getting Physics Scene
            ps = cbt.GetScene("test");
            // Initializing Physics Scene.
            ps.Initialise(imp.GetMesher(TopConfig),null);
            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;
            }
            ps.SetTerrain(_heightmap);
        }
开发者ID:4U2NV,项目名称:opensim,代码行数:21,代码来源:ODETestClass.cs

示例3: Initialize

        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.PhysicsModules.Meshing.Meshmerizer();
            //INonSharedRegionModule mod = mesher as INonSharedRegionModule;
            //mod.Initialise(openSimINI);
            //mod.AddRegion(scene);
            //mod.RegionLoaded(scene);

            pScene = new OdeScene();
            Console.WriteLine("HERE " + (pScene == null ? "Null" : "Not null"));
            INonSharedRegionModule mod = (pScene as INonSharedRegionModule);
            Console.WriteLine("HERE " + (mod == null ? "Null" : "Not null"));
            mod.Initialise(openSimINI);
            mod.AddRegion(scene);
            mod.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.SetTerrain(_heightmap);
        }
开发者ID:Gitlab11,项目名称:opensim,代码行数:43,代码来源:ODETestClass.cs


注:本文中的PhysicsScene.SetTerrain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。