more on compile..
parent
e8d5f23fc4
commit
ecc1969857
|
@ -671,18 +671,8 @@ namespace OpenSim.Region.PhysicsModule.ODE
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public void Initialise(IMesher meshmerizer, IConfigSource config, Vector3 regionExtent)
|
// Initialize from configs
|
||||||
{
|
private void InitialiseFromConfig(IConfigSource config)
|
||||||
WorldExtents.X = regionExtent.X;
|
|
||||||
m_regionWidth = (uint)regionExtent.X;
|
|
||||||
WorldExtents.Y = regionExtent.Y;
|
|
||||||
m_regionHeight = (uint)regionExtent.Y;
|
|
||||||
m_suportCombine = false;
|
|
||||||
Initialise(meshmerizer, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize the mesh plugin
|
|
||||||
public void Initialise(IMesher meshmerizer, IConfigSource config)
|
|
||||||
{
|
{
|
||||||
InitializeExtraStats();
|
InitializeExtraStats();
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
);
|
);
|
||||||
// we do land collisions not ode | CollisionCategories.Land);
|
// we do land collisions not ode | CollisionCategories.Land);
|
||||||
public IntPtr Body = IntPtr.Zero;
|
public IntPtr Body = IntPtr.Zero;
|
||||||
private OdeScene _parent_scene;
|
private ODEScene _parent_scene;
|
||||||
private IntPtr capsule = IntPtr.Zero;
|
private IntPtr capsule = IntPtr.Zero;
|
||||||
public IntPtr collider = IntPtr.Zero;
|
public IntPtr collider = IntPtr.Zero;
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
|
|
||||||
float mu;
|
float mu;
|
||||||
|
|
||||||
public OdeCharacter(uint localID, String avName, OdeScene parent_scene, Vector3 pos, Vector3 pSize, float pfeetOffset, float density, float walk_divisor, float rundivisor)
|
public OdeCharacter(uint localID, String avName, ODEScene parent_scene, Vector3 pos, Vector3 pSize, float pfeetOffset, float density, float walk_divisor, float rundivisor)
|
||||||
{
|
{
|
||||||
m_uuid = UUID.Random();
|
m_uuid = UUID.Random();
|
||||||
m_localID = localID;
|
m_localID = localID;
|
||||||
|
|
|
@ -60,7 +60,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
}
|
}
|
||||||
|
|
||||||
private OdePrim rootPrim;
|
private OdePrim rootPrim;
|
||||||
private OdeScene _pParentScene;
|
private ODEScene _pParentScene;
|
||||||
|
|
||||||
// Vehicle properties
|
// Vehicle properties
|
||||||
// WARNING this are working copies for internel use
|
// WARNING this are working copies for internel use
|
||||||
|
|
|
@ -71,7 +71,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
{
|
{
|
||||||
|
|
||||||
private ILog m_log;
|
private ILog m_log;
|
||||||
private OdeScene m_scene;
|
private ODEScene m_scene;
|
||||||
private IMesher m_mesher;
|
private IMesher m_mesher;
|
||||||
|
|
||||||
public bool meshSculptedPrim = true;
|
public bool meshSculptedPrim = true;
|
||||||
|
@ -85,7 +85,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
|
|
||||||
private Thread m_thread;
|
private Thread m_thread;
|
||||||
|
|
||||||
public ODEMeshWorker(OdeScene pScene, ILog pLog, IMesher pMesher, IConfig pConfig)
|
public ODEMeshWorker(ODEScene pScene, ILog pLog, IMesher pMesher, IConfig pConfig)
|
||||||
{
|
{
|
||||||
m_scene = pScene;
|
m_scene = pScene;
|
||||||
m_log = pLog;
|
m_log = pLog;
|
||||||
|
|
|
@ -148,7 +148,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
private UUID? m_assetID;
|
private UUID? m_assetID;
|
||||||
private MeshState m_meshState;
|
private MeshState m_meshState;
|
||||||
|
|
||||||
public OdeScene _parent_scene;
|
public ODEScene _parent_scene;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The physics space which contains prim geometry
|
/// The physics space which contains prim geometry
|
||||||
|
@ -1069,7 +1069,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size,
|
public OdePrim(String primName, ODEScene parent_scene, Vector3 pos, Vector3 size,
|
||||||
Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical,bool pisPhantom,byte _shapeType,uint plocalID)
|
Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical,bool pisPhantom,byte _shapeType,uint plocalID)
|
||||||
{
|
{
|
||||||
Name = primName;
|
Name = primName;
|
||||||
|
|
|
@ -53,7 +53,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Scene that created this object.
|
/// Scene that created this object.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private OdeScene m_scene;
|
private ODEScene m_scene;
|
||||||
|
|
||||||
IntPtr ray; // the ray. we only need one for our lifetime
|
IntPtr ray; // the ray. we only need one for our lifetime
|
||||||
IntPtr Sphere;
|
IntPtr Sphere;
|
||||||
|
@ -73,7 +73,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
private RayFilterFlags CurrentRayFilter;
|
private RayFilterFlags CurrentRayFilter;
|
||||||
private int CurrentMaxCount;
|
private int CurrentMaxCount;
|
||||||
|
|
||||||
public ODERayCastRequestManager(OdeScene pScene)
|
public ODERayCastRequestManager(ODEScene pScene)
|
||||||
{
|
{
|
||||||
m_scene = pScene;
|
m_scene = pScene;
|
||||||
nearCallback = near;
|
nearCallback = near;
|
||||||
|
|
|
@ -42,10 +42,10 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ODESitAvatar
|
public class ODESitAvatar
|
||||||
{
|
{
|
||||||
private OdeScene m_scene;
|
private ODEScene m_scene;
|
||||||
private ODERayCastRequestManager m_raymanager;
|
private ODERayCastRequestManager m_raymanager;
|
||||||
|
|
||||||
public ODESitAvatar(OdeScene pScene, ODERayCastRequestManager raymanager)
|
public ODESitAvatar(ODEScene pScene, ODERayCastRequestManager raymanager)
|
||||||
{
|
{
|
||||||
m_scene = pScene;
|
m_scene = pScene;
|
||||||
m_raymanager = raymanager;
|
m_raymanager = raymanager;
|
||||||
|
|
|
@ -37,8 +37,10 @@ using System.IO;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using log4net;
|
using log4net;
|
||||||
using Nini.Config;
|
using Nini.Config;
|
||||||
|
using Mono.Addins;
|
||||||
using OdeAPI;
|
using OdeAPI;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
|
using OpenSim.Region.Framework.Scenes;
|
||||||
using OpenSim.Region.Framework.Interfaces;
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
using OpenSim.Region.PhysicsModules.SharedBase;
|
using OpenSim.Region.PhysicsModules.SharedBase;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
@ -164,10 +166,12 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "UBITODEPhysicsScene")]
|
||||||
public class OdeScene : PhysicsScene, INonSharedRegionModule
|
public class ODEScene : PhysicsScene, INonSharedRegionModule
|
||||||
{
|
{
|
||||||
private readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + sceneIdentifier);
|
private readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.ToString());
|
||||||
|
private bool m_Enabled = false;
|
||||||
|
|
||||||
// private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>();
|
// private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>();
|
||||||
|
|
||||||
public bool OdeUbitLib = false;
|
public bool OdeUbitLib = false;
|
||||||
|
@ -300,7 +304,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
|
|
||||||
public IMesher mesher;
|
public IMesher mesher;
|
||||||
|
|
||||||
private IConfigSource m_config;
|
public IConfigSource m_config;
|
||||||
|
|
||||||
public bool physics_logging = false;
|
public bool physics_logging = false;
|
||||||
public int physics_logging_interval = 0;
|
public int physics_logging_interval = 0;
|
||||||
|
@ -346,7 +350,20 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
if (physics == Name)
|
if (physics == Name)
|
||||||
{
|
{
|
||||||
m_Enabled = true;
|
m_Enabled = true;
|
||||||
m_Config = source;
|
m_config = source;
|
||||||
|
|
||||||
|
// We do this so that OpenSimulator on Windows loads the correct native ODE library depending on whether
|
||||||
|
// it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports
|
||||||
|
// will find it already loaded later on.
|
||||||
|
//
|
||||||
|
// This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be
|
||||||
|
// controlled in Ode.NET.dll.config
|
||||||
|
if (Util.IsWindows())
|
||||||
|
Util.LoadArchSpecificWindowsDll("ode.dll");
|
||||||
|
|
||||||
|
// Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to
|
||||||
|
// http://opensimulator.org/mantis/view.php?id=2750).
|
||||||
|
d.InitODE();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,13 +379,13 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
return;
|
return;
|
||||||
|
|
||||||
EngineType = Name;
|
EngineType = Name;
|
||||||
RegionName = scene.RegionInfo.RegionName;
|
EngineType = Name;
|
||||||
PhysicsSceneName = EngineType + "/" + RegionName;
|
PhysicsSceneName = EngineType + "/" + scene.RegionInfo.RegionName;
|
||||||
|
|
||||||
scene.RegisterModuleInterface<PhysicsScene>(this);
|
scene.RegisterModuleInterface<PhysicsScene>(this);
|
||||||
Vector3 extent = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, scene.RegionInfo.RegionSizeZ);
|
Vector3 extent = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, scene.RegionInfo.RegionSizeZ);
|
||||||
RawInitialization();
|
|
||||||
Initialise(m_Config, extent);
|
Initialization(extent);
|
||||||
|
|
||||||
base.Initialise(scene.PhysicsRequestAsset,
|
base.Initialise(scene.PhysicsRequestAsset,
|
||||||
(scene.Heightmap != null ? scene.Heightmap.GetFloatsSerialised() : new float[scene.RegionInfo.RegionSizeX * scene.RegionInfo.RegionSizeY]),
|
(scene.Heightmap != null ? scene.Heightmap.GetFloatsSerialised() : new float[scene.RegionInfo.RegionSizeX * scene.RegionInfo.RegionSizeY]),
|
||||||
|
@ -400,7 +417,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
/// Sets many properties that ODE requires to be stable
|
/// Sets many properties that ODE requires to be stable
|
||||||
/// These settings need to be tweaked 'exactly' right or weird stuff happens.
|
/// These settings need to be tweaked 'exactly' right or weird stuff happens.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void RawInitialization()
|
private void Initialization(Vector3 regionExtent)
|
||||||
{
|
{
|
||||||
|
|
||||||
// checkThread();
|
// checkThread();
|
||||||
|
@ -481,10 +498,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
|
|
||||||
d.WorldSetAutoDisableFlag(world, false);
|
d.WorldSetAutoDisableFlag(world, false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void Initialise(IConfigSource config, Vector3 regionExtent)
|
|
||||||
{
|
|
||||||
WorldExtents.X = regionExtent.X;
|
WorldExtents.X = regionExtent.X;
|
||||||
m_regionWidth = (uint)regionExtent.X;
|
m_regionWidth = (uint)regionExtent.X;
|
||||||
WorldExtents.Y = regionExtent.Y;
|
WorldExtents.Y = regionExtent.Y;
|
||||||
|
@ -492,7 +506,6 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
|
|
||||||
m_suportCombine = false;
|
m_suportCombine = false;
|
||||||
// checkThread();
|
// checkThread();
|
||||||
m_config = config;
|
|
||||||
|
|
||||||
string ode_config = d.GetConfiguration();
|
string ode_config = d.GetConfiguration();
|
||||||
if (ode_config != null && ode_config != "")
|
if (ode_config != null && ode_config != "")
|
||||||
|
@ -2216,9 +2229,9 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
|
||||||
{
|
{
|
||||||
if (m_worldOffset != Vector3.Zero && m_parentScene != null)
|
if (m_worldOffset != Vector3.Zero && m_parentScene != null)
|
||||||
{
|
{
|
||||||
if (m_parentScene is OdeScene)
|
if (m_parentScene is ODEScene)
|
||||||
{
|
{
|
||||||
((OdeScene)m_parentScene).SetTerrain(heightMap, m_worldOffset);
|
((ODEScene)m_parentScene).SetTerrain(heightMap, m_worldOffset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -382,6 +382,7 @@
|
||||||
<Reference name="OpenSim.Region.Framework"/>
|
<Reference name="OpenSim.Region.Framework"/>
|
||||||
<Reference name="OpenSim.Region.PhysicsModules.SharedBase"/>
|
<Reference name="OpenSim.Region.PhysicsModules.SharedBase"/>
|
||||||
<Reference name="OpenSim.Region.PhysicsModules.ConvexDecompositionDotNet"/>
|
<Reference name="OpenSim.Region.PhysicsModules.ConvexDecompositionDotNet"/>
|
||||||
|
<Reference name="Mono.Addins" path="../../../../bin/"/>
|
||||||
<Reference name="log4net" path="../../../../bin/"/>
|
<Reference name="log4net" path="../../../../bin/"/>
|
||||||
|
|
||||||
<Files>
|
<Files>
|
||||||
|
|
Loading…
Reference in New Issue