and now.. seems to work.. but does it really work?

avinationmerge
UbitUmarov 2015-09-08 21:41:52 +01:00
parent 6dc4c8321d
commit 254008cd1f
3 changed files with 68 additions and 54 deletions

View File

@ -95,11 +95,14 @@ namespace OpenSim.Region.PhysicsModule.UbitMeshing
IConfig start_config = config.Configs["Startup"]; IConfig start_config = config.Configs["Startup"];
IConfig mesh_config = config.Configs["Mesh"]; IConfig mesh_config = config.Configs["Mesh"];
string mesher = start_config.GetString("meshing", string.Empty);
if (mesher == Name)
{
float fcache = 48.0f; float fcache = 48.0f;
// float fcache = 0.02f; // float fcache = 0.02f;
if(mesh_config != null) if (mesh_config != null)
{ {
useMeshiesPhysicsMesh = mesh_config.GetBoolean("UseMeshiesPhysicsMesh", useMeshiesPhysicsMesh); useMeshiesPhysicsMesh = mesh_config.GetBoolean("UseMeshiesPhysicsMesh", useMeshiesPhysicsMesh);
if (useMeshiesPhysicsMesh) if (useMeshiesPhysicsMesh)
@ -114,10 +117,11 @@ namespace OpenSim.Region.PhysicsModule.UbitMeshing
doMeshFileCache = false; doMeshFileCache = false;
doCacheExpire = false; doCacheExpire = false;
} }
m_Enabled = true;
} }
CacheExpire = TimeSpan.FromHours(fcache); CacheExpire = TimeSpan.FromHours(fcache);
}
} }
public void Close() public void Close()
{ {

View File

@ -408,8 +408,13 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
mesher = scene.RequestModuleInterface<IMesher>(); mesher = scene.RequestModuleInterface<IMesher>();
if (mesher == null) if (mesher == null)
m_log.WarnFormat("{0} No mesher. Things will not work well.", LogHeader); {
m_log.WarnFormat("{0} No mesher. module disabled", LogHeader);
m_Enabled = false;
return;
}
region_loaded();
scene.PhysicsEnabled = true; scene.PhysicsEnabled = true;
} }
#endregion #endregion
@ -422,7 +427,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
private void Initialization(Vector3 regionExtent) private void Initialization(Vector3 regionExtent)
{ {
// checkThread(); // checkThread();
OdeLock = new Object(); OdeLock = new Object();
SimulationLock = new Object(); SimulationLock = new Object();
@ -485,8 +490,8 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
d.GeomSetCategoryBits(StaticSpace, (uint)(CollisionCategories.Space | d.GeomSetCategoryBits(StaticSpace, (uint)(CollisionCategories.Space |
CollisionCategories.Geom | CollisionCategories.Geom |
// CollisionCategories.Land | // CollisionCategories.Land |
// CollisionCategories.Water | // CollisionCategories.Water |
CollisionCategories.Phantom | CollisionCategories.Phantom |
CollisionCategories.VolumeDtc CollisionCategories.VolumeDtc
)); ));
@ -507,8 +512,11 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
m_regionHeight = (uint)regionExtent.Y; m_regionHeight = (uint)regionExtent.Y;
m_suportCombine = false; m_suportCombine = false;
// checkThread(); // checkThread();
}
private void region_loaded()
{
string ode_config = d.GetConfiguration(); string ode_config = d.GetConfiguration();
if (ode_config != null && ode_config != "") if (ode_config != null && ode_config != "")
{ {
@ -537,7 +545,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
metersInSpace = physicsconfig.GetFloat("meters_in_small_space", metersInSpace); metersInSpace = physicsconfig.GetFloat("meters_in_small_space", metersInSpace);
// contactsurfacelayer = physicsconfig.GetFloat("world_contact_surface_layer", contactsurfacelayer); // contactsurfacelayer = physicsconfig.GetFloat("world_contact_surface_layer", contactsurfacelayer);
ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", ODE_STEPSIZE); ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", ODE_STEPSIZE);
@ -579,7 +587,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
m_meshWorker = new ODEMeshWorker(this, m_log, mesher, physicsconfig); m_meshWorker = new ODEMeshWorker(this, m_log, mesher, physicsconfig);
HalfOdeStep = ODE_STEPSIZE * 0.5f; HalfOdeStep = ODE_STEPSIZE * 0.5f;
odetimestepMS = (int)(1000.0f * ODE_STEPSIZE +0.5f); odetimestepMS = (int)(1000.0f * ODE_STEPSIZE + 0.5f);
ContactgeomsArray = Marshal.AllocHGlobal(contactsPerCollision * d.ContactGeom.unmanagedSizeOf); ContactgeomsArray = Marshal.AllocHGlobal(contactsPerCollision * d.ContactGeom.unmanagedSizeOf);
GlobalContactsArray = Marshal.AllocHGlobal(maxContactsbeforedeath * d.Contact.unmanagedSizeOf); GlobalContactsArray = Marshal.AllocHGlobal(maxContactsbeforedeath * d.Contact.unmanagedSizeOf);
@ -631,13 +639,13 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
if (spaceGridMaxX > 24) if (spaceGridMaxX > 24)
{ {
spaceGridMaxX = 24; spaceGridMaxX = 24;
spacesPerMeterX = spaceGridMaxX / WorldExtents.X ; spacesPerMeterX = spaceGridMaxX / WorldExtents.X;
} }
if (spaceGridMaxY > 24) if (spaceGridMaxY > 24)
{ {
spaceGridMaxY = 24; spaceGridMaxY = 24;
spacesPerMeterY = spaceGridMaxY / WorldExtents.Y ; spacesPerMeterY = spaceGridMaxY / WorldExtents.Y;
} }
staticPrimspace = new IntPtr[spaceGridMaxX, spaceGridMaxY]; staticPrimspace = new IntPtr[spaceGridMaxX, spaceGridMaxY];

View File

@ -1609,6 +1609,8 @@
<Reference name="System.Core"/> <Reference name="System.Core"/>
<Reference name="System.Data"/> <Reference name="System.Data"/>
<Reference name="System.Xml"/> <Reference name="System.Xml"/>
<Reference name="OpenSim.Framework"/>
<Reference name="Mono.Addins" path="../../../../bin/"/>
<Files> <Files>
<Match pattern="*.cs" recurse="true"> <Match pattern="*.cs" recurse="true">