aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorRobert Adams2013-05-09 22:16:32 -0700
committerRobert Adams2013-05-09 22:16:32 -0700
commitd48c9b433afcfefe63a7294c19831a7f4be0ee61 (patch)
tree2d44a344441e3f951adf382f467ac27854301164 /OpenSim/Region
parentvh: add material physical property definitions to PhysicsActor (diff)
downloadopensim-SC_OLD-d48c9b433afcfefe63a7294c19831a7f4be0ee61.zip
opensim-SC_OLD-d48c9b433afcfefe63a7294c19831a7f4be0ee61.tar.gz
opensim-SC_OLD-d48c9b433afcfefe63a7294c19831a7f4be0ee61.tar.bz2
opensim-SC_OLD-d48c9b433afcfefe63a7294c19831a7f4be0ee61.tar.xz
vh: Update physics parameter get/set to string based from old float
value based.
Diffstat (limited to 'OpenSim/Region')
-rwxr-xr-xOpenSim/Region/OptionalModules/PhysicsParameters/PhysicsParameters.cs19
-rwxr-xr-xOpenSim/Region/Physics/Manager/IPhysicsParameters.cs6
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsScene.cs56
3 files changed, 62 insertions, 19 deletions
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
146 { 146 {
147 foreach (PhysParameterEntry ppe in physScene.GetParameterList()) 147 foreach (PhysParameterEntry ppe in physScene.GetParameterList())
148 { 148 {
149 float val = 0.0f; 149 string val = string.Empty;
150 if (physScene.GetPhysicsParameter(ppe.name, out val)) 150 if (physScene.GetPhysicsParameter(ppe.name, out val))
151 { 151 {
152 WriteOut(" {0}/{1} = {2}", scene.RegionInfo.RegionName, ppe.name, val); 152 WriteOut(" {0}/{1} = {2}", scene.RegionInfo.RegionName, ppe.name, val);
@@ -159,7 +159,7 @@ namespace OpenSim.Region.OptionalModules.PhysicsParameters
159 } 159 }
160 else 160 else
161 { 161 {
162 float val = 0.0f; 162 string val = string.Empty;
163 if (physScene.GetPhysicsParameter(parm, out val)) 163 if (physScene.GetPhysicsParameter(parm, out val))
164 { 164 {
165 WriteOut(" {0}/{1} = {2}", scene.RegionInfo.RegionName, parm, val); 165 WriteOut(" {0}/{1} = {2}", scene.RegionInfo.RegionName, parm, val);
@@ -185,21 +185,12 @@ namespace OpenSim.Region.OptionalModules.PhysicsParameters
185 return; 185 return;
186 } 186 }
187 string parm = "xxx"; 187 string parm = "xxx";
188 float val = 0f; 188 string valparm = String.Empty;
189 uint localID = (uint)PhysParameterEntry.APPLY_TO_NONE; // set default value 189 uint localID = (uint)PhysParameterEntry.APPLY_TO_NONE; // set default value
190 try 190 try
191 { 191 {
192 parm = cmdparms[2]; 192 parm = cmdparms[2];
193 string valparm = cmdparms[3].ToLower(); 193 valparm = cmdparms[3].ToLower();
194 if (valparm == "true")
195 val = PhysParameterEntry.NUMERIC_TRUE;
196 else
197 {
198 if (valparm == "false")
199 val = PhysParameterEntry.NUMERIC_FALSE;
200 else
201 val = float.Parse(valparm, Culture.NumberFormatInfo);
202 }
203 if (cmdparms.Length > 4) 194 if (cmdparms.Length > 4)
204 { 195 {
205 if (cmdparms[4].ToLower() == "all") 196 if (cmdparms[4].ToLower() == "all")
@@ -224,7 +215,7 @@ namespace OpenSim.Region.OptionalModules.PhysicsParameters
224 IPhysicsParameters physScene = scene.PhysicsScene as IPhysicsParameters; 215 IPhysicsParameters physScene = scene.PhysicsScene as IPhysicsParameters;
225 if (physScene != null) 216 if (physScene != null)
226 { 217 {
227 if (!physScene.SetPhysicsParameter(parm, val, localID)) 218 if (!physScene.SetPhysicsParameter(parm, valparm, localID))
228 { 219 {
229 WriteError("Failed set of parameter '{0}' for region '{1}'", parm, scene.RegionInfo.RegionName); 220 WriteError("Failed set of parameter '{0}' for region '{1}'", parm, scene.RegionInfo.RegionName);
230 } 221 }
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
60 60
61 // Set parameter on a specific or all instances. 61 // Set parameter on a specific or all instances.
62 // Return 'false' if not able to set the parameter. 62 // Return 'false' if not able to set the parameter.
63 bool SetPhysicsParameter(string parm, float value, uint localID); 63 bool SetPhysicsParameter(string parm, string value, uint localID);
64 64
65 // Get parameter. 65 // Get parameter.
66 // Return 'false' if not able to get the parameter. 66 // Return 'false' if not able to get the parameter.
67 bool GetPhysicsParameter(string parm, out float value); 67 bool GetPhysicsParameter(string parm, out string value);
68 68
69 // Get parameter from a particular object 69 // Get parameter from a particular object
70 // TODO: 70 // TODO:
71 // bool GetPhysicsParameter(string parm, out float value, uint localID); 71 // bool GetPhysicsParameter(string parm, out string value, uint localID);
72 } 72 }
73} 73}
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
43 public delegate void JointDeactivated(PhysicsJoint joint); 43 public delegate void JointDeactivated(PhysicsJoint joint);
44 public delegate void JointErrorMessage(PhysicsJoint joint, string message); // this refers to an "error message due to a problem", not "amount of joint constraint violation" 44 public delegate void JointErrorMessage(PhysicsJoint joint, string message); // this refers to an "error message due to a problem", not "amount of joint constraint violation"
45 45
46 public enum RayFilterFlags : ushort
47 {
48 // the flags
49 water = 0x01,
50 land = 0x02,
51 agent = 0x04,
52 nonphysical = 0x08,
53 physical = 0x10,
54 phantom = 0x20,
55 volumedtc = 0x40,
56
57 // ray cast colision control (may only work for meshs)
58 ContactsUnImportant = 0x2000,
59 BackFaceCull = 0x4000,
60 ClosestHit = 0x8000,
61
62 // some combinations
63 LSLPhantom = phantom | volumedtc,
64 PrimsNonPhantom = nonphysical | physical,
65 PrimsNonPhantomAgents = nonphysical | physical | agent,
66
67 AllPrims = nonphysical | phantom | volumedtc | physical,
68 AllButLand = agent | nonphysical | physical | phantom | volumedtc,
69
70 ClosestAndBackCull = ClosestHit | BackFaceCull,
71
72 All = 0x3f
73 }
74
46 public delegate void RequestAssetDelegate(UUID assetID, AssetReceivedDelegate callback); 75 public delegate void RequestAssetDelegate(UUID assetID, AssetReceivedDelegate callback);
47 public delegate void AssetReceivedDelegate(AssetBase asset); 76 public delegate void AssetReceivedDelegate(AssetBase asset);
48 77
@@ -62,13 +91,20 @@ namespace OpenSim.Region.Physics.Manager
62// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 91// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
63 92
64 /// <summary> 93 /// <summary>
65 /// Name of this scene. Useful in debug messages to distinguish one OdeScene instance from another. 94 /// A unique identifying string for this instance of the physics engine.
95 /// Useful in debug messages to distinguish one OdeScene instance from another.
96 /// Usually set to include the region name that the physics engine is acting for.
66 /// </summary> 97 /// </summary>
67 public string Name { get; protected set; } 98 public string Name { get; protected set; }
68 99
100 /// <summary>
101 /// A string identifying the family of this physics engine. Most common values returned
102 /// are "OpenDynamicsEngine" and "BulletSim" but others are possible.
103 /// </summary>
104 public string EngineType { get; protected set; }
105
69 // The only thing that should register for this event is the SceneGraph 106 // The only thing that should register for this event is the SceneGraph
70 // Anything else could cause problems. 107 // Anything else could cause problems.
71
72 public event physicsCrash OnPhysicsCrash; 108 public event physicsCrash OnPhysicsCrash;
73 109
74 public static PhysicsScene Null 110 public static PhysicsScene Null
@@ -130,6 +166,12 @@ namespace OpenSim.Region.Physics.Manager
130 public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, 166 public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
131 Vector3 size, Quaternion rotation, bool isPhysical, uint localid); 167 Vector3 size, Quaternion rotation, bool isPhysical, uint localid);
132 168
169 public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
170 Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, byte shapetype, uint localid)
171 {
172 return AddPrimShape(primName, pbs, position, size, rotation, isPhysical, localid);
173 }
174
133 public virtual float TimeDilation 175 public virtual float TimeDilation
134 { 176 {
135 get { return 1.0f; } 177 get { return 1.0f; }
@@ -279,5 +321,15 @@ namespace OpenSim.Region.Physics.Manager
279 { 321 {
280 return new List<ContactResult>(); 322 return new List<ContactResult>();
281 } 323 }
324
325 public virtual object RaycastWorld(Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags filter)
326 {
327 return null;
328 }
329
330 public virtual bool SupportsRaycastWorldFiltered()
331 {
332 return false;
333 }
282 } 334 }
283} 335}