30 using NUnit.Framework;
32 using OpenSim.Framework;
33 using OpenSim.Region.PhysicsModules.SharedBase;
34 using OpenSim.Region.PhysicsModule.ODE;
35 using OpenSim.Region.Framework.Scenes;
36 using OpenSim.Region.Framework.Interfaces;
37 using OpenSim.Tests.Common;
39 using System.Reflection;
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
56 IConfigSource openSimINI =
new IniConfigSource();
57 IConfig startupConfig = openSimINI.AddConfig(
"Startup");
58 startupConfig.Set(
"physics",
"OpenDynamicsEngine");
59 startupConfig.Set(
"DecodedSculptMapPath",
"j2kDecodeCache");
66 info.RegionName =
"ODETestRegion";
67 info.RegionSizeX = info.RegionSizeY = info.RegionSizeZ = Constants.RegionSize;
78 Console.WriteLine(
"HERE " + (odemodule == null ?
"Null" :
"Not null"));
79 odemodule.Initialise(openSimINI);
80 odemodule.AddRegion(scene);
81 odemodule.RegionLoaded(scene);
94 pScene = scene.PhysicsScene;
95 pScene.SetTerrain(_heightmap);
101 pScene.DeleteTerrain();
111 Vector3 size =
new Vector3(0.5f, 0.5f, 0.5f);
112 Quaternion rot = Quaternion.Identity;
113 PhysicsActor prim = pScene.AddPrimShape(
"CoolShape", newcube, position, size, rot,
true, 0);
117 Assert.That(oprim.m_taintadd);
121 for (
int i = 0; i < 58; i++)
123 pScene.Simulate(0.133f);
125 Assert.That(oprim.prim_geom != (IntPtr)0);
127 Assert.That(oprim.m_targetSpace != (IntPtr)0);
130 m_log.Info(
"TargetSpace: " + oprim.m_targetSpace +
" - SceneMainSpace: " + pscene.space);
132 Assert.That(!oprim.m_taintadd);
133 m_log.Info(
"Prim Position (" + oprim.LocalID +
"): " + prim.Position);
140 Assert.That(oprim.Body != (IntPtr)0);
145 Assert.That(prim.Position.Z < 21.5f);
147 pScene.RemovePrim(prim);
148 Assert.That(oprim.m_taintremove);
149 pScene.Simulate(0.133f);
150 Assert.That(oprim.Body == (IntPtr)0);
OpenSim.Framework.RegionInfo RegionInfo
void CreateAndDropPhysicalCube()
Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ours...
Interactive OpenSim region server