aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorUbitUmarov2012-02-18 17:42:14 +0000
committerUbitUmarov2012-02-18 17:42:14 +0000
commit3aee642190add7045f78e522ae7b2221b3566f1e (patch)
treea390b28dce297bde43aa216332d217b2b28ea03a /OpenSim/Region/Framework
parent vehicle parameters do cross (i hope) on regions in same instance ( others ne... (diff)
downloadopensim-SC_OLD-3aee642190add7045f78e522ae7b2221b3566f1e.zip
opensim-SC_OLD-3aee642190add7045f78e522ae7b2221b3566f1e.tar.gz
opensim-SC_OLD-3aee642190add7045f78e522ae7b2221b3566f1e.tar.bz2
opensim-SC_OLD-3aee642190add7045f78e522ae7b2221b3566f1e.tar.xz
changed how vehicle data is stored and passed to physics. use unsafe in serializer, tried to control m_dupeInProgress
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/SOGVehicle.cs336
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs2
2 files changed, 175 insertions, 163 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SOGVehicle.cs b/OpenSim/Region/Framework/Scenes/SOGVehicle.cs
index b7c93e5..470f403 100644
--- a/OpenSim/Region/Framework/Scenes/SOGVehicle.cs
+++ b/OpenSim/Region/Framework/Scenes/SOGVehicle.cs
@@ -37,9 +37,11 @@ namespace OpenSim.Region.Framework.Scenes
37 { 37 {
38 public Vehicle Type 38 public Vehicle Type
39 { 39 {
40 get { return m_type; } 40 get { return vd.m_type; }
41 } 41 }
42 42
43 public VehicleData vd;
44/*
43 private Vehicle m_type = Vehicle.TYPE_NONE; // If a 'VEHICLE', and what kind 45 private Vehicle m_type = Vehicle.TYPE_NONE; // If a 'VEHICLE', and what kind
44 private VehicleFlag m_flags = (VehicleFlag)0; 46 private VehicleFlag m_flags = (VehicleFlag)0;
45 47
@@ -78,7 +80,13 @@ namespace OpenSim.Region.Framework.Scenes
78 private float m_verticalAttractionTimescale = 1000f; // Timescale > 300 means no vert attractor. 80 private float m_verticalAttractionTimescale = 1000f; // Timescale > 300 means no vert attractor.
79 81
80 // Axis 82 // Axis
81 public Quaternion m_referenceFrame = Quaternion.Identity; 83 public Quaternion m_referenceFrame = Quaternion.Identity;
84*/
85 public SOGVehicle()
86 {
87 vd = new VehicleData();
88 ProcessTypeChange(Vehicle.TYPE_NONE); // is needed?
89 }
82 90
83 public void ProcessFloatVehicleParam(Vehicle pParam, float pValue) 91 public void ProcessFloatVehicleParam(Vehicle pParam, float pValue)
84 { 92 {
@@ -89,109 +97,109 @@ namespace OpenSim.Region.Framework.Scenes
89 case Vehicle.ANGULAR_DEFLECTION_EFFICIENCY: 97 case Vehicle.ANGULAR_DEFLECTION_EFFICIENCY:
90 if (pValue < 0f) pValue = 0f; 98 if (pValue < 0f) pValue = 0f;
91 if (pValue > 1f) pValue = 1f; 99 if (pValue > 1f) pValue = 1f;
92 m_angularDeflectionEfficiency = pValue; 100 vd.m_angularDeflectionEfficiency = pValue;
93 break; 101 break;
94 case Vehicle.ANGULAR_DEFLECTION_TIMESCALE: 102 case Vehicle.ANGULAR_DEFLECTION_TIMESCALE:
95 if (pValue < timestep) pValue = timestep; 103 if (pValue < timestep) pValue = timestep;
96 m_angularDeflectionTimescale = pValue; 104 vd.m_angularDeflectionTimescale = pValue;
97 break; 105 break;
98 case Vehicle.ANGULAR_MOTOR_DECAY_TIMESCALE: 106 case Vehicle.ANGULAR_MOTOR_DECAY_TIMESCALE:
99 if (pValue < timestep) pValue = timestep; 107 if (pValue < timestep) pValue = timestep;
100 else if (pValue > 120) pValue = 120; 108 else if (pValue > 120) pValue = 120;
101 m_angularMotorDecayTimescale = pValue; 109 vd.m_angularMotorDecayTimescale = pValue;
102 break; 110 break;
103 case Vehicle.ANGULAR_MOTOR_TIMESCALE: 111 case Vehicle.ANGULAR_MOTOR_TIMESCALE:
104 if (pValue < timestep) pValue = timestep; 112 if (pValue < timestep) pValue = timestep;
105 m_angularMotorTimescale = pValue; 113 vd.m_angularMotorTimescale = pValue;
106 break; 114 break;
107 case Vehicle.BANKING_EFFICIENCY: 115 case Vehicle.BANKING_EFFICIENCY:
108 if (pValue < -1f) pValue = -1f; 116 if (pValue < -1f) pValue = -1f;
109 if (pValue > 1f) pValue = 1f; 117 if (pValue > 1f) pValue = 1f;
110 m_bankingEfficiency = pValue; 118 vd.m_bankingEfficiency = pValue;
111 break; 119 break;
112 case Vehicle.BANKING_MIX: 120 case Vehicle.BANKING_MIX:
113 if (pValue < 0f) pValue = 0f; 121 if (pValue < 0f) pValue = 0f;
114 if (pValue > 1f) pValue = 1f; 122 if (pValue > 1f) pValue = 1f;
115 m_bankingMix = pValue; 123 vd.m_bankingMix = pValue;
116 break; 124 break;
117 case Vehicle.BANKING_TIMESCALE: 125 case Vehicle.BANKING_TIMESCALE:
118 if (pValue < timestep) pValue = timestep; 126 if (pValue < timestep) pValue = timestep;
119 m_bankingTimescale = pValue; 127 vd.m_bankingTimescale = pValue;
120 break; 128 break;
121 case Vehicle.BUOYANCY: 129 case Vehicle.BUOYANCY:
122 if (pValue < -1f) pValue = -1f; 130 if (pValue < -1f) pValue = -1f;
123 if (pValue > 1f) pValue = 1f; 131 if (pValue > 1f) pValue = 1f;
124 m_VehicleBuoyancy = pValue; 132 vd.m_VehicleBuoyancy = pValue;
125 break; 133 break;
126 case Vehicle.HOVER_EFFICIENCY: 134 case Vehicle.HOVER_EFFICIENCY:
127 if (pValue < 0f) pValue = 0f; 135 if (pValue < 0f) pValue = 0f;
128 if (pValue > 1f) pValue = 1f; 136 if (pValue > 1f) pValue = 1f;
129 m_VhoverEfficiency = pValue; 137 vd.m_VhoverEfficiency = pValue;
130 break; 138 break;
131 case Vehicle.HOVER_HEIGHT: 139 case Vehicle.HOVER_HEIGHT:
132 m_VhoverHeight = pValue; 140 vd.m_VhoverHeight = pValue;
133 break; 141 break;
134 case Vehicle.HOVER_TIMESCALE: 142 case Vehicle.HOVER_TIMESCALE:
135 if (pValue < timestep) pValue = timestep; 143 if (pValue < timestep) pValue = timestep;
136 m_VhoverTimescale = pValue; 144 vd.m_VhoverTimescale = pValue;
137 break; 145 break;
138 case Vehicle.LINEAR_DEFLECTION_EFFICIENCY: 146 case Vehicle.LINEAR_DEFLECTION_EFFICIENCY:
139 if (pValue < 0f) pValue = 0f; 147 if (pValue < 0f) pValue = 0f;
140 if (pValue > 1f) pValue = 1f; 148 if (pValue > 1f) pValue = 1f;
141 m_linearDeflectionEfficiency = pValue; 149 vd.m_linearDeflectionEfficiency = pValue;
142 break; 150 break;
143 case Vehicle.LINEAR_DEFLECTION_TIMESCALE: 151 case Vehicle.LINEAR_DEFLECTION_TIMESCALE:
144 if (pValue < timestep) pValue = timestep; 152 if (pValue < timestep) pValue = timestep;
145 m_linearDeflectionTimescale = pValue; 153 vd.m_linearDeflectionTimescale = pValue;
146 break; 154 break;
147 case Vehicle.LINEAR_MOTOR_DECAY_TIMESCALE: 155 case Vehicle.LINEAR_MOTOR_DECAY_TIMESCALE:
148 // if (pValue < timestep) pValue = timestep; 156 // if (pValue < timestep) pValue = timestep;
149 // try to make impulses to work a bit better 157 // try to make impulses to work a bit better
150 if (pValue < timestep) pValue = timestep; 158 if (pValue < timestep) pValue = timestep;
151 else if (pValue > 120) pValue = 120; 159 else if (pValue > 120) pValue = 120;
152 m_linearMotorDecayTimescale = pValue; 160 vd.m_linearMotorDecayTimescale = pValue;
153 break; 161 break;
154 case Vehicle.LINEAR_MOTOR_TIMESCALE: 162 case Vehicle.LINEAR_MOTOR_TIMESCALE:
155 if (pValue < timestep) pValue = timestep; 163 if (pValue < timestep) pValue = timestep;
156 m_linearMotorTimescale = pValue; 164 vd.m_linearMotorTimescale = pValue;
157 break; 165 break;
158 case Vehicle.VERTICAL_ATTRACTION_EFFICIENCY: 166 case Vehicle.VERTICAL_ATTRACTION_EFFICIENCY:
159 if (pValue < 0f) pValue = 0f; 167 if (pValue < 0f) pValue = 0f;
160 if (pValue > 1f) pValue = 1f; 168 if (pValue > 1f) pValue = 1f;
161 m_verticalAttractionEfficiency = pValue; 169 vd.m_verticalAttractionEfficiency = pValue;
162 break; 170 break;
163 case Vehicle.VERTICAL_ATTRACTION_TIMESCALE: 171 case Vehicle.VERTICAL_ATTRACTION_TIMESCALE:
164 if (pValue < timestep) pValue = timestep; 172 if (pValue < timestep) pValue = timestep;
165 m_verticalAttractionTimescale = pValue; 173 vd.m_verticalAttractionTimescale = pValue;
166 break; 174 break;
167 175
168 // These are vector properties but the engine lets you use a single float value to 176 // These are vector properties but the engine lets you use a single float value to
169 // set all of the components to the same value 177 // set all of the components to the same value
170 case Vehicle.ANGULAR_FRICTION_TIMESCALE: 178 case Vehicle.ANGULAR_FRICTION_TIMESCALE:
171 if (pValue < timestep) pValue = timestep; 179 if (pValue < timestep) pValue = timestep;
172 m_angularFrictionTimescale = new Vector3(pValue, pValue, pValue); 180 vd.m_angularFrictionTimescale = new Vector3(pValue, pValue, pValue);
173 break; 181 break;
174 case Vehicle.ANGULAR_MOTOR_DIRECTION: 182 case Vehicle.ANGULAR_MOTOR_DIRECTION:
175 m_angularMotorDirection = new Vector3(pValue, pValue, pValue); 183 vd.m_angularMotorDirection = new Vector3(pValue, pValue, pValue);
176 len = m_angularMotorDirection.Length(); 184 len = vd.m_angularMotorDirection.Length();
177 if (len > 12.566f) 185 if (len > 12.566f)
178 m_angularMotorDirection *= (12.566f / len); 186 vd.m_angularMotorDirection *= (12.566f / len);
179 break; 187 break;
180 case Vehicle.LINEAR_FRICTION_TIMESCALE: 188 case Vehicle.LINEAR_FRICTION_TIMESCALE:
181 if (pValue < timestep) pValue = timestep; 189 if (pValue < timestep) pValue = timestep;
182 m_linearFrictionTimescale = new Vector3(pValue, pValue, pValue); 190 vd.m_linearFrictionTimescale = new Vector3(pValue, pValue, pValue);
183 break; 191 break;
184 case Vehicle.LINEAR_MOTOR_DIRECTION: 192 case Vehicle.LINEAR_MOTOR_DIRECTION:
185 m_linearMotorDirection = new Vector3(pValue, pValue, pValue); 193 vd.m_linearMotorDirection = new Vector3(pValue, pValue, pValue);
186 len = m_linearMotorDirection.Length(); 194 len = vd.m_linearMotorDirection.Length();
187 if (len > 30.0f) 195 if (len > 30.0f)
188 m_linearMotorDirection *= (30.0f / len); 196 vd.m_linearMotorDirection *= (30.0f / len);
189 break; 197 break;
190 case Vehicle.LINEAR_MOTOR_OFFSET: 198 case Vehicle.LINEAR_MOTOR_OFFSET:
191 m_linearMotorOffset = new Vector3(pValue, pValue, pValue); 199 vd.m_linearMotorOffset = new Vector3(pValue, pValue, pValue);
192 len = m_linearMotorOffset.Length(); 200 len = vd.m_linearMotorOffset.Length();
193 if (len > 100.0f) 201 if (len > 100.0f)
194 m_linearMotorOffset *= (100.0f / len); 202 vd.m_linearMotorOffset *= (100.0f / len);
195 break; 203 break;
196 } 204 }
197 }//end ProcessFloatVehicleParam 205 }//end ProcessFloatVehicleParam
@@ -207,32 +215,32 @@ namespace OpenSim.Region.Framework.Scenes
207 if (pValue.Y < timestep) pValue.Y = timestep; 215 if (pValue.Y < timestep) pValue.Y = timestep;
208 if (pValue.Z < timestep) pValue.Z = timestep; 216 if (pValue.Z < timestep) pValue.Z = timestep;
209 217
210 m_angularFrictionTimescale = new Vector3(pValue.X, pValue.Y, pValue.Z); 218 vd.m_angularFrictionTimescale = new Vector3(pValue.X, pValue.Y, pValue.Z);
211 break; 219 break;
212 case Vehicle.ANGULAR_MOTOR_DIRECTION: 220 case Vehicle.ANGULAR_MOTOR_DIRECTION:
213 m_angularMotorDirection = new Vector3(pValue.X, pValue.Y, pValue.Z); 221 vd.m_angularMotorDirection = new Vector3(pValue.X, pValue.Y, pValue.Z);
214 // Limit requested angular speed to 2 rps= 4 pi rads/sec 222 // Limit requested angular speed to 2 rps= 4 pi rads/sec
215 len = m_angularMotorDirection.Length(); 223 len = vd.m_angularMotorDirection.Length();
216 if (len > 12.566f) 224 if (len > 12.566f)
217 m_angularMotorDirection *= (12.566f / len); 225 vd.m_angularMotorDirection *= (12.566f / len);
218 break; 226 break;
219 case Vehicle.LINEAR_FRICTION_TIMESCALE: 227 case Vehicle.LINEAR_FRICTION_TIMESCALE:
220 if (pValue.X < timestep) pValue.X = timestep; 228 if (pValue.X < timestep) pValue.X = timestep;
221 if (pValue.Y < timestep) pValue.Y = timestep; 229 if (pValue.Y < timestep) pValue.Y = timestep;
222 if (pValue.Z < timestep) pValue.Z = timestep; 230 if (pValue.Z < timestep) pValue.Z = timestep;
223 m_linearFrictionTimescale = new Vector3(pValue.X, pValue.Y, pValue.Z); 231 vd.m_linearFrictionTimescale = new Vector3(pValue.X, pValue.Y, pValue.Z);
224 break; 232 break;
225 case Vehicle.LINEAR_MOTOR_DIRECTION: 233 case Vehicle.LINEAR_MOTOR_DIRECTION:
226 m_linearMotorDirection = new Vector3(pValue.X, pValue.Y, pValue.Z); 234 vd.m_linearMotorDirection = new Vector3(pValue.X, pValue.Y, pValue.Z);
227 len = m_linearMotorDirection.Length(); 235 len = vd.m_linearMotorDirection.Length();
228 if (len > 30.0f) 236 if (len > 30.0f)
229 m_linearMotorDirection *= (30.0f / len); 237 vd.m_linearMotorDirection *= (30.0f / len);
230 break; 238 break;
231 case Vehicle.LINEAR_MOTOR_OFFSET: 239 case Vehicle.LINEAR_MOTOR_OFFSET:
232 m_linearMotorOffset = new Vector3(pValue.X, pValue.Y, pValue.Z); 240 vd.m_linearMotorOffset = new Vector3(pValue.X, pValue.Y, pValue.Z);
233 len = m_linearMotorOffset.Length(); 241 len = vd.m_linearMotorOffset.Length();
234 if (len > 100.0f) 242 if (len > 100.0f)
235 m_linearMotorOffset *= (100.0f / len); 243 vd.m_linearMotorOffset *= (100.0f / len);
236 break; 244 break;
237 } 245 }
238 }//end ProcessVectorVehicleParam 246 }//end ProcessVectorVehicleParam
@@ -242,7 +250,7 @@ namespace OpenSim.Region.Framework.Scenes
242 switch (pParam) 250 switch (pParam)
243 { 251 {
244 case Vehicle.REFERENCE_FRAME: 252 case Vehicle.REFERENCE_FRAME:
245 m_referenceFrame = Quaternion.Inverse(pValue); 253 vd.m_referenceFrame = Quaternion.Inverse(pValue);
246 break; 254 break;
247 } 255 }
248 }//end ProcessRotationVehicleParam 256 }//end ProcessRotationVehicleParam
@@ -251,169 +259,169 @@ namespace OpenSim.Region.Framework.Scenes
251 { 259 {
252 if (remove) 260 if (remove)
253 { 261 {
254 m_flags &= ~((VehicleFlag)pParam); 262 vd.m_flags &= ~((VehicleFlag)pParam);
255 } 263 }
256 else 264 else
257 { 265 {
258 m_flags |= (VehicleFlag)pParam; 266 vd.m_flags |= (VehicleFlag)pParam;
259 } 267 }
260 }//end ProcessVehicleFlags 268 }//end ProcessVehicleFlags
261 269
262 public void ProcessTypeChange(Vehicle pType) 270 public void ProcessTypeChange(Vehicle pType)
263 { 271 {
264 m_linearMotorDirection = Vector3.Zero; 272 vd.m_linearMotorDirection = Vector3.Zero;
265 m_angularMotorDirection = Vector3.Zero; 273 vd.m_angularMotorDirection = Vector3.Zero;
266 274
267 m_linearMotorOffset = Vector3.Zero; 275 vd.m_linearMotorOffset = Vector3.Zero;
268 276
269 m_referenceFrame = Quaternion.Identity; 277 vd.m_referenceFrame = Quaternion.Identity;
270 278
271 // Set Defaults For Type 279 // Set Defaults For Type
272 m_type = pType; 280 vd.m_type = pType;
273 switch (pType) 281 switch (pType)
274 { 282 {
275 case Vehicle.TYPE_NONE: // none sense this will never exist 283 case Vehicle.TYPE_NONE: // none sense this will never exist
276 m_linearFrictionTimescale = new Vector3(1000, 1000, 1000); 284 vd.m_linearFrictionTimescale = new Vector3(1000, 1000, 1000);
277 m_angularFrictionTimescale = new Vector3(1000, 1000, 1000); 285 vd.m_angularFrictionTimescale = new Vector3(1000, 1000, 1000);
278 m_linearMotorTimescale = 1000; 286 vd.m_linearMotorTimescale = 1000;
279 m_linearMotorDecayTimescale = 120; 287 vd.m_linearMotorDecayTimescale = 120;
280 m_angularMotorTimescale = 1000; 288 vd.m_angularMotorTimescale = 1000;
281 m_angularMotorDecayTimescale = 1000; 289 vd.m_angularMotorDecayTimescale = 1000;
282 m_VhoverHeight = 0; 290 vd.m_VhoverHeight = 0;
283 m_VhoverTimescale = 1000; 291 vd.m_VhoverTimescale = 1000;
284 m_VehicleBuoyancy = 0; 292 vd.m_VehicleBuoyancy = 0;
285 m_flags = (VehicleFlag)0; 293 vd.m_flags = (VehicleFlag)0;
286 break; 294 break;
287 295
288 case Vehicle.TYPE_SLED: 296 case Vehicle.TYPE_SLED:
289 m_linearFrictionTimescale = new Vector3(30, 1, 1000); 297 vd.m_linearFrictionTimescale = new Vector3(30, 1, 1000);
290 m_angularFrictionTimescale = new Vector3(1000, 1000, 1000); 298 vd.m_angularFrictionTimescale = new Vector3(1000, 1000, 1000);
291 m_linearMotorTimescale = 1000; 299 vd.m_linearMotorTimescale = 1000;
292 m_linearMotorDecayTimescale = 120; 300 vd.m_linearMotorDecayTimescale = 120;
293 m_angularMotorTimescale = 1000; 301 vd.m_angularMotorTimescale = 1000;
294 m_angularMotorDecayTimescale = 120; 302 vd.m_angularMotorDecayTimescale = 120;
295 m_VhoverHeight = 0; 303 vd.m_VhoverHeight = 0;
296 m_VhoverEfficiency = 1; 304 vd.m_VhoverEfficiency = 1;
297 m_VhoverTimescale = 10; 305 vd.m_VhoverTimescale = 10;
298 m_VehicleBuoyancy = 0; 306 vd.m_VehicleBuoyancy = 0;
299 m_linearDeflectionEfficiency = 1; 307 vd.m_linearDeflectionEfficiency = 1;
300 m_linearDeflectionTimescale = 1; 308 vd.m_linearDeflectionTimescale = 1;
301 m_angularDeflectionEfficiency = 0; 309 vd.m_angularDeflectionEfficiency = 0;
302 m_angularDeflectionTimescale = 1000; 310 vd.m_angularDeflectionTimescale = 1000;
303 m_bankingEfficiency = 0; 311 vd.m_bankingEfficiency = 0;
304 m_bankingMix = 1; 312 vd.m_bankingMix = 1;
305 m_bankingTimescale = 10; 313 vd.m_bankingTimescale = 10;
306 m_flags &= 314 vd.m_flags &=
307 ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | 315 ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY |
308 VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY); 316 VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY);
309 m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_ROLL_ONLY | VehicleFlag.LIMIT_MOTOR_UP); 317 vd.m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_ROLL_ONLY | VehicleFlag.LIMIT_MOTOR_UP);
310 break; 318 break;
311 case Vehicle.TYPE_CAR: 319 case Vehicle.TYPE_CAR:
312 m_linearFrictionTimescale = new Vector3(100, 2, 1000); 320 vd.m_linearFrictionTimescale = new Vector3(100, 2, 1000);
313 m_angularFrictionTimescale = new Vector3(1000, 1000, 1000); 321 vd.m_angularFrictionTimescale = new Vector3(1000, 1000, 1000);
314 m_linearMotorTimescale = 1; 322 vd.m_linearMotorTimescale = 1;
315 m_linearMotorDecayTimescale = 60; 323 vd.m_linearMotorDecayTimescale = 60;
316 m_angularMotorTimescale = 1; 324 vd.m_angularMotorTimescale = 1;
317 m_angularMotorDecayTimescale = 0.8f; 325 vd.m_angularMotorDecayTimescale = 0.8f;
318 m_VhoverHeight = 0; 326 vd.m_VhoverHeight = 0;
319 m_VhoverEfficiency = 0; 327 vd.m_VhoverEfficiency = 0;
320 m_VhoverTimescale = 1000; 328 vd.m_VhoverTimescale = 1000;
321 m_VehicleBuoyancy = 0; 329 vd.m_VehicleBuoyancy = 0;
322 m_linearDeflectionEfficiency = 1; 330 vd.m_linearDeflectionEfficiency = 1;
323 m_linearDeflectionTimescale = 2; 331 vd.m_linearDeflectionTimescale = 2;
324 m_angularDeflectionEfficiency = 0; 332 vd.m_angularDeflectionEfficiency = 0;
325 m_angularDeflectionTimescale = 10; 333 vd.m_angularDeflectionTimescale = 10;
326 m_verticalAttractionEfficiency = 1f; 334 vd.m_verticalAttractionEfficiency = 1f;
327 m_verticalAttractionTimescale = 10f; 335 vd.m_verticalAttractionTimescale = 10f;
328 m_bankingEfficiency = -0.2f; 336 vd.m_bankingEfficiency = -0.2f;
329 m_bankingMix = 1; 337 vd.m_bankingMix = 1;
330 m_bankingTimescale = 1; 338 vd.m_bankingTimescale = 1;
331 m_flags &= ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT); 339 vd.m_flags &= ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT);
332 m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_ROLL_ONLY | 340 vd.m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_ROLL_ONLY |
333 VehicleFlag.LIMIT_MOTOR_UP | VehicleFlag.HOVER_UP_ONLY); 341 VehicleFlag.LIMIT_MOTOR_UP | VehicleFlag.HOVER_UP_ONLY);
334 break; 342 break;
335 case Vehicle.TYPE_BOAT: 343 case Vehicle.TYPE_BOAT:
336 m_linearFrictionTimescale = new Vector3(10, 3, 2); 344 vd.m_linearFrictionTimescale = new Vector3(10, 3, 2);
337 m_angularFrictionTimescale = new Vector3(10, 10, 10); 345 vd.m_angularFrictionTimescale = new Vector3(10, 10, 10);
338 m_linearMotorTimescale = 5; 346 vd.m_linearMotorTimescale = 5;
339 m_linearMotorDecayTimescale = 60; 347 vd.m_linearMotorDecayTimescale = 60;
340 m_angularMotorTimescale = 4; 348 vd.m_angularMotorTimescale = 4;
341 m_angularMotorDecayTimescale = 4; 349 vd.m_angularMotorDecayTimescale = 4;
342 m_VhoverHeight = 0; 350 vd.m_VhoverHeight = 0;
343 m_VhoverEfficiency = 0.5f; 351 vd.m_VhoverEfficiency = 0.5f;
344 m_VhoverTimescale = 2; 352 vd.m_VhoverTimescale = 2;
345 m_VehicleBuoyancy = 1; 353 vd.m_VehicleBuoyancy = 1;
346 m_linearDeflectionEfficiency = 0.5f; 354 vd.m_linearDeflectionEfficiency = 0.5f;
347 m_linearDeflectionTimescale = 3; 355 vd.m_linearDeflectionTimescale = 3;
348 m_angularDeflectionEfficiency = 0.5f; 356 vd.m_angularDeflectionEfficiency = 0.5f;
349 m_angularDeflectionTimescale = 5; 357 vd.m_angularDeflectionTimescale = 5;
350 m_verticalAttractionEfficiency = 0.5f; 358 vd.m_verticalAttractionEfficiency = 0.5f;
351 m_verticalAttractionTimescale = 5f; 359 vd.m_verticalAttractionTimescale = 5f;
352 m_bankingEfficiency = -0.3f; 360 vd.m_bankingEfficiency = -0.3f;
353 m_bankingMix = 0.8f; 361 vd.m_bankingMix = 0.8f;
354 m_bankingTimescale = 1; 362 vd.m_bankingTimescale = 1;
355 m_flags &= ~(VehicleFlag.HOVER_TERRAIN_ONLY | 363 vd.m_flags &= ~(VehicleFlag.HOVER_TERRAIN_ONLY |
356 VehicleFlag.HOVER_GLOBAL_HEIGHT | 364 VehicleFlag.HOVER_GLOBAL_HEIGHT |
357 VehicleFlag.HOVER_UP_ONLY | 365 VehicleFlag.HOVER_UP_ONLY |
358 VehicleFlag.LIMIT_ROLL_ONLY); 366 VehicleFlag.LIMIT_ROLL_ONLY);
359 m_flags |= (VehicleFlag.NO_DEFLECTION_UP | 367 vd.m_flags |= (VehicleFlag.NO_DEFLECTION_UP |
360 VehicleFlag.LIMIT_MOTOR_UP | 368 VehicleFlag.LIMIT_MOTOR_UP |
361 VehicleFlag.HOVER_WATER_ONLY); 369 VehicleFlag.HOVER_WATER_ONLY);
362 break; 370 break;
363 case Vehicle.TYPE_AIRPLANE: 371 case Vehicle.TYPE_AIRPLANE:
364 m_linearFrictionTimescale = new Vector3(200, 10, 5); 372 vd.m_linearFrictionTimescale = new Vector3(200, 10, 5);
365 m_angularFrictionTimescale = new Vector3(20, 20, 20); 373 vd.m_angularFrictionTimescale = new Vector3(20, 20, 20);
366 m_linearMotorTimescale = 2; 374 vd.m_linearMotorTimescale = 2;
367 m_linearMotorDecayTimescale = 60; 375 vd.m_linearMotorDecayTimescale = 60;
368 m_angularMotorTimescale = 4; 376 vd.m_angularMotorTimescale = 4;
369 m_angularMotorDecayTimescale = 8; 377 vd.m_angularMotorDecayTimescale = 8;
370 m_VhoverHeight = 0; 378 vd.m_VhoverHeight = 0;
371 m_VhoverEfficiency = 0.5f; 379 vd.m_VhoverEfficiency = 0.5f;
372 m_VhoverTimescale = 1000; 380 vd.m_VhoverTimescale = 1000;
373 m_VehicleBuoyancy = 0; 381 vd.m_VehicleBuoyancy = 0;
374 m_linearDeflectionEfficiency = 0.5f; 382 vd.m_linearDeflectionEfficiency = 0.5f;
375 m_linearDeflectionTimescale = 0.5f; 383 vd.m_linearDeflectionTimescale = 0.5f;
376 m_angularDeflectionEfficiency = 1; 384 vd.m_angularDeflectionEfficiency = 1;
377 m_angularDeflectionTimescale = 2; 385 vd.m_angularDeflectionTimescale = 2;
378 m_verticalAttractionEfficiency = 0.9f; 386 vd.m_verticalAttractionEfficiency = 0.9f;
379 m_verticalAttractionTimescale = 2f; 387 vd.m_verticalAttractionTimescale = 2f;
380 m_bankingEfficiency = 1; 388 vd.m_bankingEfficiency = 1;
381 m_bankingMix = 0.7f; 389 vd.m_bankingMix = 0.7f;
382 m_bankingTimescale = 2; 390 vd.m_bankingTimescale = 2;
383 m_flags &= ~(VehicleFlag.HOVER_WATER_ONLY | 391 vd.m_flags &= ~(VehicleFlag.HOVER_WATER_ONLY |
384 VehicleFlag.HOVER_TERRAIN_ONLY | 392 VehicleFlag.HOVER_TERRAIN_ONLY |
385 VehicleFlag.HOVER_GLOBAL_HEIGHT | 393 VehicleFlag.HOVER_GLOBAL_HEIGHT |
386 VehicleFlag.HOVER_UP_ONLY | 394 VehicleFlag.HOVER_UP_ONLY |
387 VehicleFlag.NO_DEFLECTION_UP | 395 VehicleFlag.NO_DEFLECTION_UP |
388 VehicleFlag.LIMIT_MOTOR_UP); 396 VehicleFlag.LIMIT_MOTOR_UP);
389 m_flags |= (VehicleFlag.LIMIT_ROLL_ONLY); 397 vd.m_flags |= (VehicleFlag.LIMIT_ROLL_ONLY);
390 break; 398 break;
391 case Vehicle.TYPE_BALLOON: 399 case Vehicle.TYPE_BALLOON:
392 m_linearFrictionTimescale = new Vector3(5, 5, 5); 400 vd.m_linearFrictionTimescale = new Vector3(5, 5, 5);
393 m_angularFrictionTimescale = new Vector3(10, 10, 10); 401 vd.m_angularFrictionTimescale = new Vector3(10, 10, 10);
394 m_linearMotorTimescale = 5; 402 vd.m_linearMotorTimescale = 5;
395 m_linearMotorDecayTimescale = 60; 403 vd.m_linearMotorDecayTimescale = 60;
396 m_angularMotorTimescale = 6; 404 vd.m_angularMotorTimescale = 6;
397 m_angularMotorDecayTimescale = 10; 405 vd.m_angularMotorDecayTimescale = 10;
398 m_VhoverHeight = 5; 406 vd.m_VhoverHeight = 5;
399 m_VhoverEfficiency = 0.8f; 407 vd.m_VhoverEfficiency = 0.8f;
400 m_VhoverTimescale = 10; 408 vd.m_VhoverTimescale = 10;
401 m_VehicleBuoyancy = 1; 409 vd.m_VehicleBuoyancy = 1;
402 m_linearDeflectionEfficiency = 0; 410 vd.m_linearDeflectionEfficiency = 0;
403 m_linearDeflectionTimescale = 5; 411 vd.m_linearDeflectionTimescale = 5;
404 m_angularDeflectionEfficiency = 0; 412 vd.m_angularDeflectionEfficiency = 0;
405 m_angularDeflectionTimescale = 5; 413 vd.m_angularDeflectionTimescale = 5;
406 m_verticalAttractionEfficiency = 0f; 414 vd.m_verticalAttractionEfficiency = 0f;
407 m_verticalAttractionTimescale = 1000f; 415 vd.m_verticalAttractionTimescale = 1000f;
408 m_bankingEfficiency = 0; 416 vd.m_bankingEfficiency = 0;
409 m_bankingMix = 0.7f; 417 vd.m_bankingMix = 0.7f;
410 m_bankingTimescale = 5; 418 vd.m_bankingTimescale = 5;
411 m_flags &= ~(VehicleFlag.HOVER_WATER_ONLY | 419 vd.m_flags &= ~(VehicleFlag.HOVER_WATER_ONLY |
412 VehicleFlag.HOVER_TERRAIN_ONLY | 420 VehicleFlag.HOVER_TERRAIN_ONLY |
413 VehicleFlag.HOVER_UP_ONLY | 421 VehicleFlag.HOVER_UP_ONLY |
414 VehicleFlag.NO_DEFLECTION_UP | 422 VehicleFlag.NO_DEFLECTION_UP |
415 VehicleFlag.LIMIT_MOTOR_UP); 423 VehicleFlag.LIMIT_MOTOR_UP);
416 m_flags |= (VehicleFlag.LIMIT_ROLL_ONLY | 424 vd.m_flags |= (VehicleFlag.LIMIT_ROLL_ONLY |
417 VehicleFlag.HOVER_GLOBAL_HEIGHT); 425 VehicleFlag.HOVER_GLOBAL_HEIGHT);
418 break; 426 break;
419 } 427 }
@@ -424,7 +432,8 @@ namespace OpenSim.Region.Framework.Scenes
424 // crap crap crap 432 // crap crap crap
425 if (ph == null) // what ?? 433 if (ph == null) // what ??
426 return; 434 return;
427 435 ph.SetVehicle(vd);
436/*
428 ph.VehicleType = (int)m_type; 437 ph.VehicleType = (int)m_type;
429 438
430 // Linear properties 439 // Linear properties
@@ -465,6 +474,7 @@ namespace OpenSim.Region.Framework.Scenes
465 474
466 ph.VehicleFlags(~(int)m_flags, true); 475 ph.VehicleFlags(~(int)m_flags, true);
467 ph.VehicleFlags((int)m_flags, false); 476 ph.VehicleFlags((int)m_flags, false);
477 */
468 } 478 }
469 } 479 }
470} \ No newline at end of file 480} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 324fdb8..1cce4c0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1965,6 +1965,7 @@ namespace OpenSim.Region.Framework.Scenes
1965 /// <returns></returns> 1965 /// <returns></returns>
1966 public SceneObjectGroup Copy(bool userExposed) 1966 public SceneObjectGroup Copy(bool userExposed)
1967 { 1967 {
1968 m_dupeInProgress = true;
1968 SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone(); 1969 SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
1969 dupe.m_isBackedUp = false; 1970 dupe.m_isBackedUp = false;
1970 dupe.m_parts = new MapAndArray<OpenMetaverse.UUID, SceneObjectPart>(); 1971 dupe.m_parts = new MapAndArray<OpenMetaverse.UUID, SceneObjectPart>();
@@ -2048,6 +2049,7 @@ namespace OpenSim.Region.Framework.Scenes
2048 ScheduleGroupForFullUpdate(); 2049 ScheduleGroupForFullUpdate();
2049 } 2050 }
2050 2051
2052 m_dupeInProgress = false;
2051 return dupe; 2053 return dupe;
2052 } 2054 }
2053 2055