rename Ubit physics modules
parent
064aade4c1
commit
e9a56d5e19
|
@ -37,8 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* changes by opensim team;
|
* changes by opensim team;
|
||||||
* changes by Aurora team http://www.aurora-sim.org/
|
* changes by Aurora team http://www.aurora-sim.org/
|
||||||
|
* changes by Ubit Umarov
|
||||||
* Revision/fixs by Ubit Umarov
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@ -115,7 +114,7 @@ namespace OdeAPI
|
||||||
HashSpaceClass,
|
HashSpaceClass,
|
||||||
QuadTreeSpaceClass,
|
QuadTreeSpaceClass,
|
||||||
LastSpaceClass = QuadTreeSpaceClass,
|
LastSpaceClass = QuadTreeSpaceClass,
|
||||||
UbitTerrainClass,
|
ubtTerrainClass,
|
||||||
FirstUserClass,
|
FirstUserClass,
|
||||||
LastUserClass = FirstUserClass + MaxUserClasses - 1,
|
LastUserClass = FirstUserClass + MaxUserClasses - 1,
|
||||||
NumClasses,
|
NumClasses,
|
||||||
|
@ -208,7 +207,7 @@ namespace OdeAPI
|
||||||
public delegate dReal HeightfieldGetHeight(IntPtr p_user_data, int x, int z);
|
public delegate dReal HeightfieldGetHeight(IntPtr p_user_data, int x, int z);
|
||||||
|
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate dReal UbitTerrainGetHeight(IntPtr p_user_data, int x, int z);
|
public delegate dReal ubTerrainGetHeight(IntPtr p_user_data, int x, int z);
|
||||||
|
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate void NearCallback(IntPtr data, IntPtr geom1, IntPtr geom2);
|
public delegate void NearCallback(IntPtr data, IntPtr geom1, IntPtr geom2);
|
||||||
|
@ -735,12 +734,12 @@ namespace OdeAPI
|
||||||
return CreateiHeightfield(space, data, bPlaceable);
|
return CreateiHeightfield(space, data, bPlaceable);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateUbitTerrain"), SuppressUnmanagedCodeSecurity]
|
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateubTerrain"), SuppressUnmanagedCodeSecurity]
|
||||||
public static extern IntPtr CreateiUbitTerrain(IntPtr space, IntPtr data, int bPlaceable);
|
public static extern IntPtr CreateiubTerrain(IntPtr space, IntPtr data, int bPlaceable);
|
||||||
public static IntPtr CreateUbitTerrain(IntPtr space, IntPtr data, int bPlaceable)
|
public static IntPtr CreateubTerrain(IntPtr space, IntPtr data, int bPlaceable)
|
||||||
{
|
{
|
||||||
NTotalGeoms++;
|
NTotalGeoms++;
|
||||||
return CreateiUbitTerrain(space, data, bPlaceable);
|
return CreateiubTerrain(space, data, bPlaceable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1022,29 +1021,29 @@ namespace OdeAPI
|
||||||
|
|
||||||
|
|
||||||
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataBuild"), SuppressUnmanagedCodeSecurity]
|
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataBuild"), SuppressUnmanagedCodeSecurity]
|
||||||
public static extern void GeomUbitTerrainDataBuild(IntPtr d, float[] pHeightData, int bCopyHeightData,
|
public static extern void GeomubTerrainDataBuild(IntPtr d, float[] pHeightData, int bCopyHeightData,
|
||||||
dReal sampleSize, int widthSamples, int depthSamples,
|
dReal sampleSize, int widthSamples, int depthSamples,
|
||||||
dReal offset, dReal thickness, int bWrap);
|
dReal offset, dReal thickness, int bWrap);
|
||||||
|
|
||||||
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataBuild"), SuppressUnmanagedCodeSecurity]
|
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainDataBuild"), SuppressUnmanagedCodeSecurity]
|
||||||
public static extern void GeomUbitTerrainDataBuild(IntPtr d, IntPtr pHeightData, int bCopyHeightData,
|
public static extern void GeomubTerrainDataBuild(IntPtr d, IntPtr pHeightData, int bCopyHeightData,
|
||||||
dReal sampleSize, int widthSamples, int depthSamples,
|
dReal sampleSize, int widthSamples, int depthSamples,
|
||||||
dReal thickness, int bWrap);
|
dReal thickness, int bWrap);
|
||||||
|
|
||||||
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataCreate"), SuppressUnmanagedCodeSecurity]
|
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainDataCreate"), SuppressUnmanagedCodeSecurity]
|
||||||
public static extern IntPtr GeomUbitTerrainDataCreate();
|
public static extern IntPtr GeomubTerrainDataCreate();
|
||||||
|
|
||||||
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataDestroy"), SuppressUnmanagedCodeSecurity]
|
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainDataDestroy"), SuppressUnmanagedCodeSecurity]
|
||||||
public static extern void GeomUbitTerrainDataDestroy(IntPtr d);
|
public static extern void GeomubTerrainDataDestroy(IntPtr d);
|
||||||
|
|
||||||
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataSetBounds"), SuppressUnmanagedCodeSecurity]
|
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainDataSetBounds"), SuppressUnmanagedCodeSecurity]
|
||||||
public static extern void GeomUbitTerrainDataSetBounds(IntPtr d, dReal minHeight, dReal maxHeight);
|
public static extern void GeomubTerrainDataSetBounds(IntPtr d, dReal minHeight, dReal maxHeight);
|
||||||
|
|
||||||
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainGetHeightfieldData"), SuppressUnmanagedCodeSecurity]
|
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainGetHeightfieldData"), SuppressUnmanagedCodeSecurity]
|
||||||
public static extern IntPtr GeomUbitTerrainGetHeightfieldData(IntPtr g);
|
public static extern IntPtr GeomubTerrainGetHeightfieldData(IntPtr g);
|
||||||
|
|
||||||
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainSetHeightfieldData"), SuppressUnmanagedCodeSecurity]
|
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainSetHeightfieldData"), SuppressUnmanagedCodeSecurity]
|
||||||
public static extern void GeomUbitTerrainSetHeightfieldData(IntPtr g, IntPtr d);
|
public static extern void GeomubTerrainSetHeightfieldData(IntPtr g, IntPtr d);
|
||||||
|
|
||||||
|
|
||||||
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsEnabled"), SuppressUnmanagedCodeSecurity]
|
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsEnabled"), SuppressUnmanagedCodeSecurity]
|
|
@ -37,7 +37,7 @@ using OpenSim.Framework;
|
||||||
using OpenSim.Region.PhysicsModules.SharedBase;
|
using OpenSim.Region.PhysicsModules.SharedBase;
|
||||||
using log4net;
|
using log4net;
|
||||||
|
|
||||||
namespace OpenSim.Region.PhysicsModule.UbitOde
|
namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ourselves.
|
/// Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ourselves.
|
|
@ -50,7 +50,7 @@ using OdeAPI;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Region.PhysicsModules.SharedBase;
|
using OpenSim.Region.PhysicsModules.SharedBase;
|
||||||
|
|
||||||
namespace OpenSim.Region.PhysicsModule.UbitOde
|
namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
{
|
{
|
||||||
public class ODEDynamics
|
public class ODEDynamics
|
||||||
{
|
{
|
||||||
|
@ -688,7 +688,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
|
||||||
private const float halfpi = 0.5f * (float)Math.PI;
|
private const float halfpi = 0.5f * (float)Math.PI;
|
||||||
private const float twopi = 2.0f * pi;
|
private const float twopi = 2.0f * pi;
|
||||||
|
|
||||||
public static Vector3 ubitRot2Euler(Quaternion rot)
|
public static Vector3 ubRot2Euler(Quaternion rot)
|
||||||
{
|
{
|
||||||
// returns roll in X
|
// returns roll in X
|
||||||
// pitch in Y
|
// pitch in Y
|
|
@ -16,7 +16,7 @@ using log4net;
|
||||||
using Nini.Config;
|
using Nini.Config;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
|
||||||
namespace OpenSim.Region.PhysicsModule.UbitOde
|
namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
{
|
{
|
||||||
public enum MeshState : byte
|
public enum MeshState : byte
|
||||||
{
|
{
|
|
@ -8,23 +8,23 @@ using OpenSim.Framework;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
using OpenSim.Region.Framework.Interfaces;
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
|
|
||||||
namespace OpenSim.Region.PhysicsModule.UbitOde
|
namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
{
|
{
|
||||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "UBITODEPhysicsScene")]
|
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ubODEPhysicsScene")]
|
||||||
class UbitOdeModule : INonSharedRegionModule
|
class ubOdeModule : INonSharedRegionModule
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private bool m_Enabled = false;
|
private bool m_Enabled = false;
|
||||||
private IConfigSource m_config;
|
private IConfigSource m_config;
|
||||||
private ODEScene m_scene;
|
private ODEScene m_scene;
|
||||||
private bool OdeUbitLib;
|
private bool ubOdeLib;
|
||||||
|
|
||||||
#region INonSharedRegionModule
|
#region INonSharedRegionModule
|
||||||
|
|
||||||
public string Name
|
public string Name
|
||||||
{
|
{
|
||||||
get { return "UbitODE"; }
|
get { return "ubODE"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public Type ReplaceableInterface
|
public Type ReplaceableInterface
|
||||||
|
@ -65,15 +65,15 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
|
||||||
string ode_config = d.GetConfiguration();
|
string ode_config = d.GetConfiguration();
|
||||||
if (ode_config != null && ode_config != "")
|
if (ode_config != null && ode_config != "")
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[UbitODE] ode library configuration: {0}", ode_config);
|
m_log.InfoFormat("[ubODE] ode library configuration: {0}", ode_config);
|
||||||
|
// ubODE still not avaiable
|
||||||
if (ode_config.Contains("ODE_Ubit"))
|
if (ode_config.Contains("ubODE"))
|
||||||
{
|
{
|
||||||
OdeUbitLib = true;
|
ubOdeLib = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_scene = new ODEScene(scene, m_config, Name, OdeUbitLib);
|
m_scene = new ODEScene(scene, m_config, Name, ubOdeLib);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveRegion(Scene scene)
|
public void RemoveRegion(Scene scene)
|
|
@ -25,11 +25,6 @@
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Revision 2011/12/13 by Ubit Umarov
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Revised August 26 2009 by Kitto Flora. ODEDynamics.cs replaces
|
* Revised August 26 2009 by Kitto Flora. ODEDynamics.cs replaces
|
||||||
* ODEVehicleSettings.cs. It and ODEPrim.cs are re-organised:
|
* ODEVehicleSettings.cs. It and ODEPrim.cs are re-organised:
|
||||||
|
@ -57,7 +52,7 @@ using OdeAPI;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Region.PhysicsModules.SharedBase;
|
using OpenSim.Region.PhysicsModules.SharedBase;
|
||||||
|
|
||||||
namespace OpenSim.Region.PhysicsModule.UbitOde
|
namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
{
|
{
|
||||||
public class OdePrim : PhysicsActor
|
public class OdePrim : PhysicsActor
|
||||||
{
|
{
|
|
@ -36,7 +36,7 @@ using OdeAPI;
|
||||||
using log4net;
|
using log4net;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
|
||||||
namespace OpenSim.Region.PhysicsModule.UbitOde
|
namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Processes raycast requests as ODE is in a state to be able to do them.
|
/// Processes raycast requests as ODE is in a state to be able to do them.
|
|
@ -45,7 +45,7 @@ using OpenSim.Region.Framework.Interfaces;
|
||||||
using OpenSim.Region.PhysicsModules.SharedBase;
|
using OpenSim.Region.PhysicsModules.SharedBase;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
|
||||||
namespace OpenSim.Region.PhysicsModule.UbitOde
|
namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
{
|
{
|
||||||
// colision flags of things others can colide with
|
// colision flags of things others can colide with
|
||||||
// rays, sensors, probes removed since can't be colided with
|
// rays, sensors, probes removed since can't be colided with
|
||||||
|
@ -169,7 +169,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
public bool m_odeUbitLib = false;
|
public bool m_ubOdeLib = false;
|
||||||
public bool m_suportCombine = false; // mega suport not tested
|
public bool m_suportCombine = false; // mega suport not tested
|
||||||
public Scene m_frameWorkScene = null;
|
public Scene m_frameWorkScene = null;
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
|
||||||
|
|
||||||
// private int m_meshExpireCntr;
|
// private int m_meshExpireCntr;
|
||||||
|
|
||||||
private float avDensity = 3f;
|
private float avDensity = 80f;
|
||||||
private float avMovementDivisorWalk = 1.3f;
|
private float avMovementDivisorWalk = 1.3f;
|
||||||
private float avMovementDivisorRun = 0.8f;
|
private float avMovementDivisorRun = 0.8f;
|
||||||
private float minimumGroundFlightOffset = 3f;
|
private float minimumGroundFlightOffset = 3f;
|
||||||
|
@ -327,7 +327,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
|
||||||
|
|
||||||
IConfig physicsconfig = null;
|
IConfig physicsconfig = null;
|
||||||
|
|
||||||
public ODEScene(Scene pscene, IConfigSource psourceconfig, string pname, bool podeUbitLib)
|
public ODEScene(Scene pscene, IConfigSource psourceconfig, string pname, bool pubOdeLib)
|
||||||
{
|
{
|
||||||
OdeLock = new Object();
|
OdeLock = new Object();
|
||||||
|
|
||||||
|
@ -335,7 +335,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
|
||||||
PhysicsSceneName = EngineType + "/" + pscene.RegionInfo.RegionName;
|
PhysicsSceneName = EngineType + "/" + pscene.RegionInfo.RegionName;
|
||||||
|
|
||||||
m_config = psourceconfig;
|
m_config = psourceconfig;
|
||||||
m_odeUbitLib = podeUbitLib;
|
m_ubOdeLib = pubOdeLib;
|
||||||
m_frameWorkScene = pscene;
|
m_frameWorkScene = pscene;
|
||||||
|
|
||||||
m_frameWorkScene.RegisterModuleInterface<PhysicsScene>(this);
|
m_frameWorkScene.RegisterModuleInterface<PhysicsScene>(this);
|
||||||
|
@ -354,7 +354,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
|
||||||
mesher = m_frameWorkScene.RequestModuleInterface<IMesher>();
|
mesher = m_frameWorkScene.RequestModuleInterface<IMesher>();
|
||||||
if (mesher == null)
|
if (mesher == null)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[UbitODE] No mesher. module disabled");
|
m_log.WarnFormat("[ubOde] No mesher. module disabled");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -492,6 +492,8 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
|
||||||
|
|
||||||
minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", minimumGroundFlightOffset);
|
minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", minimumGroundFlightOffset);
|
||||||
maximumMassObject = physicsconfig.GetFloat("maximum_mass_object", maximumMassObject);
|
maximumMassObject = physicsconfig.GetFloat("maximum_mass_object", maximumMassObject);
|
||||||
|
|
||||||
|
avDensity *= 3f / 80f; // scale other engines density option to this
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1927,7 +1929,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
|
||||||
int regsizeY = (int)m_regionHeight + 3; // map size see setterrain number of samples
|
int regsizeY = (int)m_regionHeight + 3; // map size see setterrain number of samples
|
||||||
int regsize = regsizeX;
|
int regsize = regsizeX;
|
||||||
|
|
||||||
if (m_odeUbitLib)
|
if (m_ubOdeLib)
|
||||||
{
|
{
|
||||||
if (x < regsizeX - 1)
|
if (x < regsizeX - 1)
|
||||||
{
|
{
|
||||||
|
@ -2071,7 +2073,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
|
||||||
int ystep = regsizeX;
|
int ystep = regsizeX;
|
||||||
bool firstTri = false;
|
bool firstTri = false;
|
||||||
|
|
||||||
if (m_odeUbitLib)
|
if (m_ubOdeLib)
|
||||||
{
|
{
|
||||||
if (x < regsizeX - 1)
|
if (x < regsizeX - 1)
|
||||||
{
|
{
|
||||||
|
@ -2183,8 +2185,8 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
|
||||||
|
|
||||||
public void SetTerrain(float[] heightMap, Vector3 pOffset)
|
public void SetTerrain(float[] heightMap, Vector3 pOffset)
|
||||||
{
|
{
|
||||||
if (m_odeUbitLib)
|
if (m_ubOdeLib)
|
||||||
UbitSetTerrain(heightMap, pOffset);
|
ubSetTerrain(heightMap, pOffset);
|
||||||
else
|
else
|
||||||
OriSetTerrain(heightMap, pOffset);
|
OriSetTerrain(heightMap, pOffset);
|
||||||
}
|
}
|
||||||
|
@ -2315,7 +2317,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UbitSetTerrain(float[] heightMap, Vector3 pOffset)
|
public void ubSetTerrain(float[] heightMap, Vector3 pOffset)
|
||||||
{
|
{
|
||||||
// assumes 1m size grid and constante size square regions
|
// assumes 1m size grid and constante size square regions
|
||||||
// needs to know about sims around in future
|
// needs to know about sims around in future
|
||||||
|
@ -2389,7 +2391,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
IntPtr HeightmapData = d.GeomUbitTerrainDataCreate();
|
IntPtr HeightmapData = d.GeomubTerrainDataCreate();
|
||||||
|
|
||||||
const int wrap = 0;
|
const int wrap = 0;
|
||||||
float thickness = hfmin;
|
float thickness = hfmin;
|
||||||
|
@ -2398,12 +2400,12 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
|
||||||
|
|
||||||
GCHandle _heightmaphandler = GCHandle.Alloc(_heightmap, GCHandleType.Pinned);
|
GCHandle _heightmaphandler = GCHandle.Alloc(_heightmap, GCHandleType.Pinned);
|
||||||
|
|
||||||
d.GeomUbitTerrainDataBuild(HeightmapData, _heightmaphandler.AddrOfPinnedObject(), 0, 1.0f,
|
d.GeomubTerrainDataBuild(HeightmapData, _heightmaphandler.AddrOfPinnedObject(), 0, 1.0f,
|
||||||
(int)heightmapWidthSamples, (int)heightmapHeightSamples,
|
(int)heightmapWidthSamples, (int)heightmapHeightSamples,
|
||||||
thickness, wrap);
|
thickness, wrap);
|
||||||
|
|
||||||
// d.GeomUbitTerrainDataSetBounds(HeightmapData, hfmin - 1, hfmax + 1);
|
// d.GeomubTerrainDataSetBounds(HeightmapData, hfmin - 1, hfmax + 1);
|
||||||
GroundGeom = d.CreateUbitTerrain(GroundSpace, HeightmapData, 1);
|
GroundGeom = d.CreateubTerrain(GroundSpace, HeightmapData, 1);
|
||||||
if (GroundGeom != IntPtr.Zero)
|
if (GroundGeom != IntPtr.Zero)
|
||||||
{
|
{
|
||||||
d.GeomSetCategoryBits(GroundGeom, (uint)(CollisionCategories.Land));
|
d.GeomSetCategoryBits(GroundGeom, (uint)(CollisionCategories.Land));
|
||||||
|
@ -2446,13 +2448,18 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
|
||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
if (m_meshWorker != null)
|
if (m_rayCastManager == null) // if this is null we already did dispose
|
||||||
m_meshWorker.Stop();
|
return;
|
||||||
|
|
||||||
lock (OdeLock)
|
lock (OdeLock)
|
||||||
{
|
{
|
||||||
m_rayCastManager.Dispose();
|
if (m_meshWorker != null)
|
||||||
m_rayCastManager = null;
|
m_meshWorker.Stop();
|
||||||
|
|
||||||
|
if (m_rayCastManager != null)
|
||||||
|
{
|
||||||
|
m_rayCastManager.Dispose();
|
||||||
|
m_rayCastManager = null;
|
||||||
|
}
|
||||||
|
|
||||||
lock (_prims)
|
lock (_prims)
|
||||||
{
|
{
|
|
@ -24,7 +24,7 @@
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
// Ubit 2012
|
// Ubit Umarov 2012
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
@ -36,7 +36,7 @@ using OdeAPI;
|
||||||
using log4net;
|
using log4net;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
|
||||||
namespace OpenSim.Region.PhysicsModule.UbitOde
|
namespace OpenSim.Region.PhysicsModule.ubOde
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// </summary>
|
/// </summary>
|
|
@ -31,7 +31,7 @@ using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenSim.Region.PhysicsModules.SharedBase;
|
using OpenSim.Region.PhysicsModules.SharedBase;
|
||||||
using OpenSim.Region.PhysicsModule.UbitMeshing;
|
using OpenSim.Region.PhysicsModule.ubODEMeshing;
|
||||||
|
|
||||||
public class Vertex : IComparable<Vertex>
|
public class Vertex : IComparable<Vertex>
|
||||||
{
|
{
|
|
@ -35,7 +35,7 @@ using OpenMetaverse;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
using System.Runtime.Serialization.Formatters.Binary;
|
using System.Runtime.Serialization.Formatters.Binary;
|
||||||
|
|
||||||
namespace OpenSim.Region.PhysicsModule.UbitMeshing
|
namespace OpenSim.Region.PhysicsModule.ubODEMeshing
|
||||||
{
|
{
|
||||||
public class MeshBuildingData
|
public class MeshBuildingData
|
||||||
{
|
{
|
|
@ -49,9 +49,9 @@ using System.Runtime.Serialization.Formatters.Binary;
|
||||||
|
|
||||||
using Mono.Addins;
|
using Mono.Addins;
|
||||||
|
|
||||||
namespace OpenSim.Region.PhysicsModule.UbitMeshing
|
namespace OpenSim.Region.PhysicsModule.ubODEMeshing
|
||||||
{
|
{
|
||||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "UbitMeshmerizer")]
|
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ubODEMeshmerizer")]
|
||||||
public class UbitMeshmerizer : IMesher, INonSharedRegionModule
|
public class UbitMeshmerizer : IMesher, INonSharedRegionModule
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
@ -82,7 +82,7 @@ namespace OpenSim.Region.PhysicsModule.UbitMeshing
|
||||||
#region INonSharedRegionModule
|
#region INonSharedRegionModule
|
||||||
public string Name
|
public string Name
|
||||||
{
|
{
|
||||||
get { return "UbitMeshmerizer"; }
|
get { return "ubODEMeshmerizer"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public Type ReplaceableInterface
|
public Type ReplaceableInterface
|
|
@ -359,7 +359,7 @@
|
||||||
</Files>
|
</Files>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
||||||
<Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModule.UbitOde" path="OpenSim/Region/PhysicsModules/UbitOde" type="Library">
|
<Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModule.ubOde" path="OpenSim/Region/PhysicsModules/ubOde" type="Library">
|
||||||
<Configuration name="Debug">
|
<Configuration name="Debug">
|
||||||
<Options>
|
<Options>
|
||||||
<OutputPath>../../../../bin/</OutputPath>
|
<OutputPath>../../../../bin/</OutputPath>
|
||||||
|
@ -392,7 +392,7 @@
|
||||||
</Files>
|
</Files>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
||||||
<Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModule.UbitMeshing" path="OpenSim/Region/PhysicsModules/UbitMeshing" type="Library">
|
<Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModule.ubOdeMeshing" path="OpenSim/Region/PhysicsModules/ubOdeMeshing" type="Library">
|
||||||
<Configuration name="Debug">
|
<Configuration name="Debug">
|
||||||
<Options>
|
<Options>
|
||||||
<OutputPath>../../../../bin/</OutputPath>
|
<OutputPath>../../../../bin/</OutputPath>
|
||||||
|
|
Loading…
Reference in New Issue