From d48c9b433afcfefe63a7294c19831a7f4be0ee61 Mon Sep 17 00:00:00 2001
From: Robert Adams
Date: Thu, 9 May 2013 22:16:32 -0700
Subject: vh: Update physics parameter get/set to string based from old float
value based.
---
.../PhysicsParameters/PhysicsParameters.cs | 19 ++------
.../Region/Physics/Manager/IPhysicsParameters.cs | 6 +--
OpenSim/Region/Physics/Manager/PhysicsScene.cs | 56 +++++++++++++++++++++-
3 files changed, 62 insertions(+), 19 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/OptionalModules/PhysicsParameters/PhysicsParameters.cs b/OpenSim/Region/OptionalModules/PhysicsParameters/PhysicsParameters.cs
index 40f7fbc..3083a33 100755
--- a/OpenSim/Region/OptionalModules/PhysicsParameters/PhysicsParameters.cs
+++ b/OpenSim/Region/OptionalModules/PhysicsParameters/PhysicsParameters.cs
@@ -146,7 +146,7 @@ namespace OpenSim.Region.OptionalModules.PhysicsParameters
{
foreach (PhysParameterEntry ppe in physScene.GetParameterList())
{
- float val = 0.0f;
+ string val = string.Empty;
if (physScene.GetPhysicsParameter(ppe.name, out val))
{
WriteOut(" {0}/{1} = {2}", scene.RegionInfo.RegionName, ppe.name, val);
@@ -159,7 +159,7 @@ namespace OpenSim.Region.OptionalModules.PhysicsParameters
}
else
{
- float val = 0.0f;
+ string val = string.Empty;
if (physScene.GetPhysicsParameter(parm, out val))
{
WriteOut(" {0}/{1} = {2}", scene.RegionInfo.RegionName, parm, val);
@@ -185,21 +185,12 @@ namespace OpenSim.Region.OptionalModules.PhysicsParameters
return;
}
string parm = "xxx";
- float val = 0f;
+ string valparm = String.Empty;
uint localID = (uint)PhysParameterEntry.APPLY_TO_NONE; // set default value
try
{
parm = cmdparms[2];
- string valparm = cmdparms[3].ToLower();
- if (valparm == "true")
- val = PhysParameterEntry.NUMERIC_TRUE;
- else
- {
- if (valparm == "false")
- val = PhysParameterEntry.NUMERIC_FALSE;
- else
- val = float.Parse(valparm, Culture.NumberFormatInfo);
- }
+ valparm = cmdparms[3].ToLower();
if (cmdparms.Length > 4)
{
if (cmdparms[4].ToLower() == "all")
@@ -224,7 +215,7 @@ namespace OpenSim.Region.OptionalModules.PhysicsParameters
IPhysicsParameters physScene = scene.PhysicsScene as IPhysicsParameters;
if (physScene != null)
{
- if (!physScene.SetPhysicsParameter(parm, val, localID))
+ if (!physScene.SetPhysicsParameter(parm, valparm, localID))
{
WriteError("Failed set of parameter '{0}' for region '{1}'", parm, scene.RegionInfo.RegionName);
}
diff --git a/OpenSim/Region/Physics/Manager/IPhysicsParameters.cs b/OpenSim/Region/Physics/Manager/IPhysicsParameters.cs
index b8676ba..31a397c 100755
--- a/OpenSim/Region/Physics/Manager/IPhysicsParameters.cs
+++ b/OpenSim/Region/Physics/Manager/IPhysicsParameters.cs
@@ -60,14 +60,14 @@ namespace OpenSim.Region.Physics.Manager
// Set parameter on a specific or all instances.
// Return 'false' if not able to set the parameter.
- bool SetPhysicsParameter(string parm, float value, uint localID);
+ bool SetPhysicsParameter(string parm, string value, uint localID);
// Get parameter.
// Return 'false' if not able to get the parameter.
- bool GetPhysicsParameter(string parm, out float value);
+ bool GetPhysicsParameter(string parm, out string value);
// Get parameter from a particular object
// TODO:
- // bool GetPhysicsParameter(string parm, out float value, uint localID);
+ // bool GetPhysicsParameter(string parm, out string value, uint localID);
}
}
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
index 488900e..290b72e 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
@@ -43,6 +43,35 @@ namespace OpenSim.Region.Physics.Manager
public delegate void JointDeactivated(PhysicsJoint joint);
public delegate void JointErrorMessage(PhysicsJoint joint, string message); // this refers to an "error message due to a problem", not "amount of joint constraint violation"
+ public enum RayFilterFlags : ushort
+ {
+ // the flags
+ water = 0x01,
+ land = 0x02,
+ agent = 0x04,
+ nonphysical = 0x08,
+ physical = 0x10,
+ phantom = 0x20,
+ volumedtc = 0x40,
+
+ // ray cast colision control (may only work for meshs)
+ ContactsUnImportant = 0x2000,
+ BackFaceCull = 0x4000,
+ ClosestHit = 0x8000,
+
+ // some combinations
+ LSLPhantom = phantom | volumedtc,
+ PrimsNonPhantom = nonphysical | physical,
+ PrimsNonPhantomAgents = nonphysical | physical | agent,
+
+ AllPrims = nonphysical | phantom | volumedtc | physical,
+ AllButLand = agent | nonphysical | physical | phantom | volumedtc,
+
+ ClosestAndBackCull = ClosestHit | BackFaceCull,
+
+ All = 0x3f
+ }
+
public delegate void RequestAssetDelegate(UUID assetID, AssetReceivedDelegate callback);
public delegate void AssetReceivedDelegate(AssetBase asset);
@@ -62,13 +91,20 @@ namespace OpenSim.Region.Physics.Manager
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
///
- /// Name of this scene. Useful in debug messages to distinguish one OdeScene instance from another.
+ /// A unique identifying string for this instance of the physics engine.
+ /// Useful in debug messages to distinguish one OdeScene instance from another.
+ /// Usually set to include the region name that the physics engine is acting for.
///
public string Name { get; protected set; }
+ ///
+ /// A string identifying the family of this physics engine. Most common values returned
+ /// are "OpenDynamicsEngine" and "BulletSim" but others are possible.
+ ///
+ public string EngineType { get; protected set; }
+
// The only thing that should register for this event is the SceneGraph
// Anything else could cause problems.
-
public event physicsCrash OnPhysicsCrash;
public static PhysicsScene Null
@@ -130,6 +166,12 @@ namespace OpenSim.Region.Physics.Manager
public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
Vector3 size, Quaternion rotation, bool isPhysical, uint localid);
+ public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
+ Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, byte shapetype, uint localid)
+ {
+ return AddPrimShape(primName, pbs, position, size, rotation, isPhysical, localid);
+ }
+
public virtual float TimeDilation
{
get { return 1.0f; }
@@ -279,5 +321,15 @@ namespace OpenSim.Region.Physics.Manager
{
return new List();
}
+
+ public virtual object RaycastWorld(Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags filter)
+ {
+ return null;
+ }
+
+ public virtual bool SupportsRaycastWorldFiltered()
+ {
+ return false;
+ }
}
}
--
cgit v1.1