diff options
author | Robert Adams | 2013-05-09 22:16:32 -0700 |
---|---|---|
committer | Robert Adams | 2013-05-09 22:16:32 -0700 |
commit | d48c9b433afcfefe63a7294c19831a7f4be0ee61 (patch) | |
tree | 2d44a344441e3f951adf382f467ac27854301164 /OpenSim/Region/OptionalModules/PhysicsParameters | |
parent | vh: add material physical property definitions to PhysicsActor (diff) | |
download | opensim-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/OptionalModules/PhysicsParameters')
-rwxr-xr-x | OpenSim/Region/OptionalModules/PhysicsParameters/PhysicsParameters.cs | 19 |
1 files changed, 5 insertions, 14 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 | } |