本文整理汇总了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);
}
示例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);
}
示例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);
}