diff options
author | UbitUmarov | 2012-02-18 19:31:36 +0000 |
---|---|---|
committer | UbitUmarov | 2012-02-18 19:31:36 +0000 |
commit | 7a1ab03b7534fdd76bb0266216e3a5990b93ee77 (patch) | |
tree | 40e2fa7b5a69b14fc5e09860fc36dfe1ea51fc0f /OpenSim/Region | |
parent | added a EnUsCulture whatever that is.. (diff) | |
download | opensim-SC_OLD-7a1ab03b7534fdd76bb0266216e3a5990b93ee77.zip opensim-SC_OLD-7a1ab03b7534fdd76bb0266216e3a5990b93ee77.tar.gz opensim-SC_OLD-7a1ab03b7534fdd76bb0266216e3a5990b93ee77.tar.bz2 opensim-SC_OLD-7a1ab03b7534fdd76bb0266216e3a5990b93ee77.tar.xz |
missing paramenters init plus some cleaning
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SOGVehicle.cs | 107 |
1 files changed, 16 insertions, 91 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SOGVehicle.cs b/OpenSim/Region/Framework/Scenes/SOGVehicle.cs index ac70d04..5651de3 100644 --- a/OpenSim/Region/Framework/Scenes/SOGVehicle.cs +++ b/OpenSim/Region/Framework/Scenes/SOGVehicle.cs | |||
@@ -38,53 +38,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
38 | { | 38 | { |
39 | public class SOGVehicle | 39 | public class SOGVehicle |
40 | { | 40 | { |
41 | public VehicleData vd; | ||
42 | |||
41 | public Vehicle Type | 43 | public Vehicle Type |
42 | { | 44 | { |
43 | get { return vd.m_type; } | 45 | get { return vd.m_type; } |
44 | } | 46 | } |
45 | 47 | ||
46 | public VehicleData vd; | ||
47 | /* | ||
48 | private Vehicle m_type = Vehicle.TYPE_NONE; // If a 'VEHICLE', and what kind | ||
49 | private VehicleFlag m_flags = (VehicleFlag)0; | ||
50 | |||
51 | // Linear properties | ||
52 | private Vector3 m_linearMotorDirection = Vector3.Zero; // velocity requested by LSL, decayed by time | ||
53 | private Vector3 m_linearFrictionTimescale = new Vector3(1000, 1000, 1000); | ||
54 | private float m_linearMotorDecayTimescale = 120; | ||
55 | private float m_linearMotorTimescale = 1000; | ||
56 | private Vector3 m_linearMotorOffset = Vector3.Zero; | ||
57 | |||
58 | //Angular properties | ||
59 | private Vector3 m_angularMotorDirection = Vector3.Zero; // angular velocity requested by LSL motor | ||
60 | private float m_angularMotorTimescale = 1000; // motor angular velocity ramp up rate | ||
61 | private float m_angularMotorDecayTimescale = 120; // motor angular velocity decay rate | ||
62 | private Vector3 m_angularFrictionTimescale = new Vector3(1000, 1000, 1000); // body angular velocity decay rate | ||
63 | |||
64 | //Deflection properties | ||
65 | private float m_angularDeflectionEfficiency = 0; | ||
66 | private float m_angularDeflectionTimescale = 1000; | ||
67 | private float m_linearDeflectionEfficiency = 0; | ||
68 | private float m_linearDeflectionTimescale = 1000; | ||
69 | |||
70 | //Banking properties | ||
71 | private float m_bankingEfficiency = 0; | ||
72 | private float m_bankingMix = 0; | ||
73 | private float m_bankingTimescale = 0; | ||
74 | |||
75 | //Hover and Buoyancy properties | ||
76 | private float m_VhoverHeight = 0f; | ||
77 | private float m_VhoverEfficiency = 0f; | ||
78 | private float m_VhoverTimescale = 1000f; | ||
79 | private float m_VehicleBuoyancy = 0f; | ||
80 | |||
81 | //Attractor properties | ||
82 | private float m_verticalAttractionEfficiency = 1.0f; // damped | ||
83 | private float m_verticalAttractionTimescale = 1000f; // Timescale > 300 means no vert attractor. | ||
84 | |||
85 | // Axis | ||
86 | public Quaternion m_referenceFrame = Quaternion.Identity; | ||
87 | */ | ||
88 | public SOGVehicle() | 48 | public SOGVehicle() |
89 | { | 49 | { |
90 | vd = new VehicleData(); | 50 | vd = new VehicleData(); |
@@ -274,16 +234,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
274 | { | 234 | { |
275 | vd.m_linearMotorDirection = Vector3.Zero; | 235 | vd.m_linearMotorDirection = Vector3.Zero; |
276 | vd.m_angularMotorDirection = Vector3.Zero; | 236 | vd.m_angularMotorDirection = Vector3.Zero; |
277 | |||
278 | vd.m_linearMotorOffset = Vector3.Zero; | 237 | vd.m_linearMotorOffset = Vector3.Zero; |
279 | |||
280 | vd.m_referenceFrame = Quaternion.Identity; | 238 | vd.m_referenceFrame = Quaternion.Identity; |
281 | 239 | ||
282 | // Set Defaults For Type | 240 | // Set Defaults For Type |
283 | vd.m_type = pType; | 241 | vd.m_type = pType; |
284 | switch (pType) | 242 | switch (pType) |
285 | { | 243 | { |
286 | case Vehicle.TYPE_NONE: // none sense this will never exist | 244 | case Vehicle.TYPE_NONE: |
287 | vd.m_linearFrictionTimescale = new Vector3(1000, 1000, 1000); | 245 | vd.m_linearFrictionTimescale = new Vector3(1000, 1000, 1000); |
288 | vd.m_angularFrictionTimescale = new Vector3(1000, 1000, 1000); | 246 | vd.m_angularFrictionTimescale = new Vector3(1000, 1000, 1000); |
289 | vd.m_linearMotorTimescale = 1000; | 247 | vd.m_linearMotorTimescale = 1000; |
@@ -291,8 +249,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
291 | vd.m_angularMotorTimescale = 1000; | 249 | vd.m_angularMotorTimescale = 1000; |
292 | vd.m_angularMotorDecayTimescale = 1000; | 250 | vd.m_angularMotorDecayTimescale = 1000; |
293 | vd.m_VhoverHeight = 0; | 251 | vd.m_VhoverHeight = 0; |
252 | vd.m_VhoverEfficiency = 1; | ||
294 | vd.m_VhoverTimescale = 1000; | 253 | vd.m_VhoverTimescale = 1000; |
295 | vd.m_VehicleBuoyancy = 0; | 254 | vd.m_VehicleBuoyancy = 0; |
255 | vd.m_linearDeflectionEfficiency = 0; | ||
256 | vd.m_linearDeflectionTimescale = 1000; | ||
257 | vd.m_angularDeflectionEfficiency = 0; | ||
258 | vd.m_angularDeflectionTimescale = 1000; | ||
259 | vd.m_bankingEfficiency = 0; | ||
260 | vd.m_bankingMix = 1; | ||
261 | vd.m_bankingTimescale = 1000; | ||
262 | vd.m_verticalAttractionEfficiency = 0; | ||
263 | vd.m_verticalAttractionTimescale = 1000; | ||
264 | |||
296 | vd.m_flags = (VehicleFlag)0; | 265 | vd.m_flags = (VehicleFlag)0; |
297 | break; | 266 | break; |
298 | 267 | ||
@@ -431,53 +400,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
431 | } | 400 | } |
432 | public void SetVehicle(PhysicsActor ph) | 401 | public void SetVehicle(PhysicsActor ph) |
433 | { | 402 | { |
434 | 403 | if (ph == null) | |
435 | // crap crap crap | ||
436 | if (ph == null) // what ?? | ||
437 | return; | 404 | return; |
438 | ph.SetVehicle(vd); | 405 | ph.SetVehicle(vd); |
439 | /* | ||
440 | ph.VehicleType = (int)m_type; | ||
441 | |||
442 | // Linear properties | ||
443 | ph.VehicleVectorParam((int)Vehicle.LINEAR_MOTOR_DIRECTION, m_linearMotorDirection); | ||
444 | ph.VehicleVectorParam((int)Vehicle.LINEAR_FRICTION_TIMESCALE, m_linearFrictionTimescale); | ||
445 | ph.VehicleFloatParam((int)Vehicle.LINEAR_MOTOR_DECAY_TIMESCALE, m_linearMotorDecayTimescale); | ||
446 | ph.VehicleFloatParam((int)Vehicle.LINEAR_MOTOR_TIMESCALE, m_linearMotorTimescale); | ||
447 | ph.VehicleVectorParam((int)Vehicle.LINEAR_MOTOR_OFFSET, m_linearMotorOffset); | ||
448 | |||
449 | //Angular properties | ||
450 | ph.VehicleVectorParam((int)Vehicle.ANGULAR_MOTOR_DIRECTION, m_angularMotorDirection); | ||
451 | ph.VehicleFloatParam((int)Vehicle.ANGULAR_MOTOR_TIMESCALE, m_angularMotorTimescale); | ||
452 | ph.VehicleFloatParam((int)Vehicle.ANGULAR_MOTOR_DECAY_TIMESCALE, m_angularMotorDecayTimescale); | ||
453 | ph.VehicleVectorParam((int)Vehicle.ANGULAR_FRICTION_TIMESCALE, m_angularFrictionTimescale); | ||
454 | |||
455 | //Deflection properties | ||
456 | ph.VehicleFloatParam((int)Vehicle.ANGULAR_DEFLECTION_EFFICIENCY, m_angularDeflectionEfficiency); | ||
457 | ph.VehicleFloatParam((int)Vehicle.ANGULAR_DEFLECTION_TIMESCALE, m_angularDeflectionTimescale); | ||
458 | ph.VehicleFloatParam((int)Vehicle.LINEAR_DEFLECTION_EFFICIENCY, m_linearDeflectionEfficiency); | ||
459 | ph.VehicleFloatParam((int)Vehicle.LINEAR_DEFLECTION_TIMESCALE, m_linearDeflectionTimescale); | ||
460 | |||
461 | //Banking properties | ||
462 | ph.VehicleFloatParam((int)Vehicle.BANKING_EFFICIENCY, m_bankingEfficiency); | ||
463 | ph.VehicleFloatParam((int)Vehicle.BANKING_MIX, m_bankingMix); | ||
464 | ph.VehicleFloatParam((int)Vehicle.BANKING_TIMESCALE, m_bankingTimescale); | ||
465 | |||
466 | //Hover and Buoyancy properties | ||
467 | ph.VehicleFloatParam((int)Vehicle.HOVER_HEIGHT, m_VhoverHeight); | ||
468 | ph.VehicleFloatParam((int)Vehicle.HOVER_EFFICIENCY, m_VhoverEfficiency); | ||
469 | ph.VehicleFloatParam((int)Vehicle.HOVER_TIMESCALE, m_VhoverTimescale); | ||
470 | ph.VehicleFloatParam((int)Vehicle.BUOYANCY, m_VehicleBuoyancy); | ||
471 | |||
472 | //Attractor properties | ||
473 | ph.VehicleFloatParam((int)Vehicle.VERTICAL_ATTRACTION_EFFICIENCY, m_verticalAttractionEfficiency); | ||
474 | ph.VehicleFloatParam((int)Vehicle.VERTICAL_ATTRACTION_TIMESCALE, m_verticalAttractionTimescale); | ||
475 | |||
476 | ph.VehicleRotationParam((int)Vehicle.REFERENCE_FRAME, m_referenceFrame); | ||
477 | |||
478 | ph.VehicleFlags(~(int)m_flags, true); | ||
479 | ph.VehicleFlags((int)m_flags, false); | ||
480 | */ | ||
481 | } | 406 | } |
482 | 407 | ||
483 | private XmlTextWriter writer; | 408 | private XmlTextWriter writer; |