rename Ubit physics modules

avinationmerge
UbitUmarov 2015-09-12 21:38:26 +01:00
parent 064aade4c1
commit e9a56d5e19
18 changed files with 73 additions and 72 deletions

View File

@ -37,8 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* changes by opensim team;
* changes by Aurora team http://www.aurora-sim.org/
* Revision/fixs by Ubit Umarov
* changes by Ubit Umarov
*/
using System;
@ -115,7 +114,7 @@ namespace OdeAPI
HashSpaceClass,
QuadTreeSpaceClass,
LastSpaceClass = QuadTreeSpaceClass,
UbitTerrainClass,
ubtTerrainClass,
FirstUserClass,
LastUserClass = FirstUserClass + MaxUserClasses - 1,
NumClasses,
@ -208,7 +207,7 @@ namespace OdeAPI
public delegate dReal HeightfieldGetHeight(IntPtr p_user_data, int x, int z);
[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)]
public delegate void NearCallback(IntPtr data, IntPtr geom1, IntPtr geom2);
@ -735,12 +734,12 @@ namespace OdeAPI
return CreateiHeightfield(space, data, bPlaceable);
}
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateUbitTerrain"), SuppressUnmanagedCodeSecurity]
public static extern IntPtr CreateiUbitTerrain(IntPtr space, IntPtr data, int bPlaceable);
public static IntPtr CreateUbitTerrain(IntPtr space, IntPtr data, int bPlaceable)
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateubTerrain"), SuppressUnmanagedCodeSecurity]
public static extern IntPtr CreateiubTerrain(IntPtr space, IntPtr data, int bPlaceable);
public static IntPtr CreateubTerrain(IntPtr space, IntPtr data, int bPlaceable)
{
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]
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 offset, dReal thickness, int bWrap);
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataBuild"), SuppressUnmanagedCodeSecurity]
public static extern void GeomUbitTerrainDataBuild(IntPtr d, IntPtr pHeightData, int bCopyHeightData,
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainDataBuild"), SuppressUnmanagedCodeSecurity]
public static extern void GeomubTerrainDataBuild(IntPtr d, IntPtr pHeightData, int bCopyHeightData,
dReal sampleSize, int widthSamples, int depthSamples,
dReal thickness, int bWrap);
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataCreate"), SuppressUnmanagedCodeSecurity]
public static extern IntPtr GeomUbitTerrainDataCreate();
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainDataCreate"), SuppressUnmanagedCodeSecurity]
public static extern IntPtr GeomubTerrainDataCreate();
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataDestroy"), SuppressUnmanagedCodeSecurity]
public static extern void GeomUbitTerrainDataDestroy(IntPtr d);
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainDataDestroy"), SuppressUnmanagedCodeSecurity]
public static extern void GeomubTerrainDataDestroy(IntPtr d);
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataSetBounds"), SuppressUnmanagedCodeSecurity]
public static extern void GeomUbitTerrainDataSetBounds(IntPtr d, dReal minHeight, dReal maxHeight);
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainDataSetBounds"), SuppressUnmanagedCodeSecurity]
public static extern void GeomubTerrainDataSetBounds(IntPtr d, dReal minHeight, dReal maxHeight);
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainGetHeightfieldData"), SuppressUnmanagedCodeSecurity]
public static extern IntPtr GeomUbitTerrainGetHeightfieldData(IntPtr g);
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainGetHeightfieldData"), SuppressUnmanagedCodeSecurity]
public static extern IntPtr GeomubTerrainGetHeightfieldData(IntPtr g);
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainSetHeightfieldData"), SuppressUnmanagedCodeSecurity]
public static extern void GeomUbitTerrainSetHeightfieldData(IntPtr g, IntPtr d);
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainSetHeightfieldData"), SuppressUnmanagedCodeSecurity]
public static extern void GeomubTerrainSetHeightfieldData(IntPtr g, IntPtr d);
[DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsEnabled"), SuppressUnmanagedCodeSecurity]

View File

@ -37,7 +37,7 @@ using OpenSim.Framework;
using OpenSim.Region.PhysicsModules.SharedBase;
using log4net;
namespace OpenSim.Region.PhysicsModule.UbitOde
namespace OpenSim.Region.PhysicsModule.ubOde
{
/// <summary>
/// Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ourselves.

View File

@ -50,7 +50,7 @@ using OdeAPI;
using OpenSim.Framework;
using OpenSim.Region.PhysicsModules.SharedBase;
namespace OpenSim.Region.PhysicsModule.UbitOde
namespace OpenSim.Region.PhysicsModule.ubOde
{
public class ODEDynamics
{
@ -688,7 +688,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
private const float halfpi = 0.5f * (float)Math.PI;
private const float twopi = 2.0f * pi;
public static Vector3 ubitRot2Euler(Quaternion rot)
public static Vector3 ubRot2Euler(Quaternion rot)
{
// returns roll in X
// pitch in Y

View File

@ -16,7 +16,7 @@ using log4net;
using Nini.Config;
using OpenMetaverse;
namespace OpenSim.Region.PhysicsModule.UbitOde
namespace OpenSim.Region.PhysicsModule.ubOde
{
public enum MeshState : byte
{

View File

@ -8,23 +8,23 @@ using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Interfaces;
namespace OpenSim.Region.PhysicsModule.UbitOde
namespace OpenSim.Region.PhysicsModule.ubOde
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "UBITODEPhysicsScene")]
class UbitOdeModule : INonSharedRegionModule
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ubODEPhysicsScene")]
class ubOdeModule : INonSharedRegionModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private bool m_Enabled = false;
private IConfigSource m_config;
private ODEScene m_scene;
private bool OdeUbitLib;
private bool ubOdeLib;
#region INonSharedRegionModule
public string Name
{
get { return "UbitODE"; }
get { return "ubODE"; }
}
public Type ReplaceableInterface
@ -65,15 +65,15 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
string ode_config = d.GetConfiguration();
if (ode_config != null && ode_config != "")
{
m_log.InfoFormat("[UbitODE] ode library configuration: {0}", ode_config);
if (ode_config.Contains("ODE_Ubit"))
m_log.InfoFormat("[ubODE] ode library configuration: {0}", ode_config);
// ubODE still not avaiable
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)

View File

@ -25,11 +25,6 @@
* 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
* ODEVehicleSettings.cs. It and ODEPrim.cs are re-organised:
@ -57,7 +52,7 @@ using OdeAPI;
using OpenSim.Framework;
using OpenSim.Region.PhysicsModules.SharedBase;
namespace OpenSim.Region.PhysicsModule.UbitOde
namespace OpenSim.Region.PhysicsModule.ubOde
{
public class OdePrim : PhysicsActor
{

View File

@ -36,7 +36,7 @@ using OdeAPI;
using log4net;
using OpenMetaverse;
namespace OpenSim.Region.PhysicsModule.UbitOde
namespace OpenSim.Region.PhysicsModule.ubOde
{
/// <summary>
/// Processes raycast requests as ODE is in a state to be able to do them.

View File

@ -45,7 +45,7 @@ using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.PhysicsModules.SharedBase;
using OpenMetaverse;
namespace OpenSim.Region.PhysicsModule.UbitOde
namespace OpenSim.Region.PhysicsModule.ubOde
{
// colision flags of things others can colide 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);
public bool m_odeUbitLib = false;
public bool m_ubOdeLib = false;
public bool m_suportCombine = false; // mega suport not tested
public Scene m_frameWorkScene = null;
@ -213,7 +213,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
// private int m_meshExpireCntr;
private float avDensity = 3f;
private float avDensity = 80f;
private float avMovementDivisorWalk = 1.3f;
private float avMovementDivisorRun = 0.8f;
private float minimumGroundFlightOffset = 3f;
@ -327,7 +327,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
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();
@ -335,7 +335,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
PhysicsSceneName = EngineType + "/" + pscene.RegionInfo.RegionName;
m_config = psourceconfig;
m_odeUbitLib = podeUbitLib;
m_ubOdeLib = pubOdeLib;
m_frameWorkScene = pscene;
m_frameWorkScene.RegisterModuleInterface<PhysicsScene>(this);
@ -354,7 +354,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
mesher = m_frameWorkScene.RequestModuleInterface<IMesher>();
if (mesher == null)
{
m_log.WarnFormat("[UbitODE] No mesher. module disabled");
m_log.WarnFormat("[ubOde] No mesher. module disabled");
return;
}
@ -492,6 +492,8 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", minimumGroundFlightOffset);
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 regsize = regsizeX;
if (m_odeUbitLib)
if (m_ubOdeLib)
{
if (x < regsizeX - 1)
{
@ -2071,7 +2073,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
int ystep = regsizeX;
bool firstTri = false;
if (m_odeUbitLib)
if (m_ubOdeLib)
{
if (x < regsizeX - 1)
{
@ -2183,8 +2185,8 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
public void SetTerrain(float[] heightMap, Vector3 pOffset)
{
if (m_odeUbitLib)
UbitSetTerrain(heightMap, pOffset);
if (m_ubOdeLib)
ubSetTerrain(heightMap, pOffset);
else
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
// 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;
float thickness = hfmin;
@ -2398,12 +2400,12 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
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,
thickness, wrap);
// d.GeomUbitTerrainDataSetBounds(HeightmapData, hfmin - 1, hfmax + 1);
GroundGeom = d.CreateUbitTerrain(GroundSpace, HeightmapData, 1);
// d.GeomubTerrainDataSetBounds(HeightmapData, hfmin - 1, hfmax + 1);
GroundGeom = d.CreateubTerrain(GroundSpace, HeightmapData, 1);
if (GroundGeom != IntPtr.Zero)
{
d.GeomSetCategoryBits(GroundGeom, (uint)(CollisionCategories.Land));
@ -2446,13 +2448,18 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
public override void Dispose()
{
if (m_meshWorker != null)
m_meshWorker.Stop();
if (m_rayCastManager == null) // if this is null we already did dispose
return;
lock (OdeLock)
{
m_rayCastManager.Dispose();
m_rayCastManager = null;
if (m_meshWorker != null)
m_meshWorker.Stop();
if (m_rayCastManager != null)
{
m_rayCastManager.Dispose();
m_rayCastManager = null;
}
lock (_prims)
{
@ -2476,7 +2483,7 @@ namespace OpenSim.Region.PhysicsModule.UbitOde
foreach (OdeCharacter ch in chtorem)
ch.DoAChange(changes.Remove, null);
foreach (IntPtr GroundGeom in RegionTerrain.Values)
{
if (GroundGeom != IntPtr.Zero)

View File

@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// Ubit 2012
// Ubit Umarov 2012
using System;
using System.Collections.Generic;
using System.Reflection;
@ -36,7 +36,7 @@ using OdeAPI;
using log4net;
using OpenMetaverse;
namespace OpenSim.Region.PhysicsModule.UbitOde
namespace OpenSim.Region.PhysicsModule.ubOde
{
/// <summary>
/// </summary>

View File

@ -31,7 +31,7 @@ using System.Diagnostics;
using System.Globalization;
using OpenMetaverse;
using OpenSim.Region.PhysicsModules.SharedBase;
using OpenSim.Region.PhysicsModule.UbitMeshing;
using OpenSim.Region.PhysicsModule.ubODEMeshing;
public class Vertex : IComparable<Vertex>
{

View File

@ -35,7 +35,7 @@ using OpenMetaverse;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
namespace OpenSim.Region.PhysicsModule.UbitMeshing
namespace OpenSim.Region.PhysicsModule.ubODEMeshing
{
public class MeshBuildingData
{

View File

@ -49,9 +49,9 @@ using System.Runtime.Serialization.Formatters.Binary;
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
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -82,7 +82,7 @@ namespace OpenSim.Region.PhysicsModule.UbitMeshing
#region INonSharedRegionModule
public string Name
{
get { return "UbitMeshmerizer"; }
get { return "ubODEMeshmerizer"; }
}
public Type ReplaceableInterface

View File

@ -359,7 +359,7 @@
</Files>
</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">
<Options>
<OutputPath>../../../../bin/</OutputPath>
@ -392,7 +392,7 @@
</Files>
</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">
<Options>
<OutputPath>../../../../bin/</OutputPath>