123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- using System;
- using System.IO;
- using System.Collections.Generic;
- using System.Text;
- using Nini.Config;
- using OpenSim.Framework;
- using OpenSim.Region.Physics.Manager;
- using OpenSim.Region.Physics.Meshing;
- using OpenMetaverse;
- namespace OpenSim.Region.Physics.BulletSPlugin.Tests
- {
- public static class BulletSimTestsUtil
- {
-
-
-
- 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");
- IConfig bulletSimConfig = openSimINI.AddConfig("BulletSim");
-
-
-
- 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 (Directory.Exists("physlogs"))
- {
- bulletSimConfig.Set("PhysicsLoggingDir","./physlogs");
- bulletSimConfig.Set("PhysicsLoggingEnabled","True");
- bulletSimConfig.Set("PhysicsLoggingDoFlush","True");
- bulletSimConfig.Set("VehicleLoggingEnabled","True");
- }
- PhysicsPluginManager physicsPluginManager;
- physicsPluginManager = new PhysicsPluginManager();
- physicsPluginManager.LoadPluginsFromAssemblies("Physics");
- Vector3 regionExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight);
-
- PhysicsScene pScene = physicsPluginManager.GetPhysicsScene(
- "BulletSim", "Meshmerizer", openSimINI, "BSTestRegion", regionExtent);
- BSScene bsScene = pScene as BSScene;
-
-
-
- return bsScene;
- }
- }
- }
|