diff options
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SOGVehicle.cs | 85 |
1 files changed, 84 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SOGVehicle.cs b/OpenSim/Region/Framework/Scenes/SOGVehicle.cs index 470f403..d06224c 100644 --- a/OpenSim/Region/Framework/Scenes/SOGVehicle.cs +++ b/OpenSim/Region/Framework/Scenes/SOGVehicle.cs | |||
@@ -29,7 +29,10 @@ using System; | |||
29 | using OpenMetaverse; | 29 | using OpenMetaverse; |
30 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
31 | using OpenSim.Region.Physics.Manager; | 31 | using OpenSim.Region.Physics.Manager; |
32 | 32 | using System.Xml; | |
33 | using OpenSim.Framework.Serialization; | ||
34 | using OpenSim.Framework.Serialization.External; | ||
35 | using OpenSim.Region.Framework.Scenes.Serialization; | ||
33 | 36 | ||
34 | namespace OpenSim.Region.Framework.Scenes | 37 | namespace OpenSim.Region.Framework.Scenes |
35 | { | 38 | { |
@@ -476,5 +479,85 @@ namespace OpenSim.Region.Framework.Scenes | |||
476 | ph.VehicleFlags((int)m_flags, false); | 479 | ph.VehicleFlags((int)m_flags, false); |
477 | */ | 480 | */ |
478 | } | 481 | } |
482 | |||
483 | private XmlTextWriter writer; | ||
484 | |||
485 | private void XWint(string name, int i) | ||
486 | { | ||
487 | writer.WriteElementString(name, i.ToString()); | ||
488 | } | ||
489 | private void XWfloat(string name, float f) | ||
490 | { | ||
491 | writer.WriteElementString(name, f.ToString()); | ||
492 | } | ||
493 | |||
494 | private void XWVector(string name, Vector3 vec) | ||
495 | { | ||
496 | writer.WriteStartElement(name); | ||
497 | writer.WriteElementString("X", vec.X.ToString(Utils.EnUsCulture)); | ||
498 | writer.WriteElementString("Y", vec.Y.ToString(Utils.EnUsCulture)); | ||
499 | writer.WriteElementString("Z", vec.Z.ToString(Utils.EnUsCulture)); | ||
500 | writer.WriteEndElement(); | ||
501 | } | ||
502 | |||
503 | |||
504 | |||
505 | private void XWQuat(string name, Quaternion quat) | ||
506 | { | ||
507 | writer.WriteStartElement(name); | ||
508 | writer.WriteElementString("X", quat.X.ToString(Utils.EnUsCulture)); | ||
509 | writer.WriteElementString("Y", quat.Y.ToString(Utils.EnUsCulture)); | ||
510 | writer.WriteElementString("Z", quat.Z.ToString(Utils.EnUsCulture)); | ||
511 | writer.WriteElementString("W", quat.W.ToString(Utils.EnUsCulture)); | ||
512 | writer.WriteEndElement(); | ||
513 | } | ||
514 | |||
515 | public void ToXml2(XmlTextWriter twriter) | ||
516 | { | ||
517 | writer = twriter; | ||
518 | writer.WriteStartElement("SceneObjectVehicle"); | ||
519 | |||
520 | XWint("V_Type", (int)vd.m_type); | ||
521 | XWint("V_Flags", (int)vd.m_flags); | ||
522 | |||
523 | // Linear properties | ||
524 | XWVector("LM_DIRECTION", vd.m_linearMotorDirection); | ||
525 | XWVector("LM_FRICTION_TIMESCALE", vd.m_linearFrictionTimescale); | ||
526 | XWfloat("LM_DECAY_TIMESCALE", vd.m_linearMotorDecayTimescale); | ||
527 | XWfloat("LM_TIMESCALE", vd.m_linearMotorTimescale); | ||
528 | XWVector("LM_OFFSET", vd.m_linearMotorOffset); | ||
529 | |||
530 | //Angular properties | ||
531 | XWVector("AM_DIRECTION", vd.m_angularMotorDirection); | ||
532 | XWfloat("AM_TIMESCALE", vd.m_angularMotorTimescale); | ||
533 | XWfloat("AM_DECAY_TIMESCALE", vd.m_angularMotorDecayTimescale); | ||
534 | XWVector("AM_FRICTION_TIMESCALE", vd.m_angularFrictionTimescale); | ||
535 | |||
536 | //Deflection properties | ||
537 | XWfloat("AD_EFFICIENCY", vd.m_angularDeflectionEfficiency); | ||
538 | XWfloat("AD_TIMESCALE", vd.m_angularDeflectionTimescale); | ||
539 | XWfloat("LD_EFFICIENCY", vd.m_linearDeflectionEfficiency); | ||
540 | XWfloat("LD_TIMESCALE", vd.m_linearDeflectionTimescale); | ||
541 | |||
542 | //Banking properties | ||
543 | XWfloat("B_EFFICIENCY", vd.m_bankingEfficiency); | ||
544 | XWfloat("B_MIX", vd.m_bankingMix); | ||
545 | XWfloat("B_TIMESCALE", vd.m_bankingTimescale); | ||
546 | |||
547 | //Hover and Buoyancy properties | ||
548 | XWfloat("H_HEIGHT", vd.m_VhoverHeight); | ||
549 | XWfloat("H_EFFICIENCY", vd.m_VhoverEfficiency); | ||
550 | XWfloat("H_TIMESCALE", vd.m_VhoverTimescale); | ||
551 | XWfloat("VBUOYANCY", vd.m_VehicleBuoyancy); | ||
552 | |||
553 | //Attractor properties | ||
554 | XWfloat("VA_EFFICIENCY", vd.m_verticalAttractionEfficiency); | ||
555 | XWfloat("VA_TIMESCALE", vd.m_verticalAttractionTimescale); | ||
556 | |||
557 | XWQuat("REF_FRAME", vd.m_referenceFrame); | ||
558 | |||
559 | writer.WriteEndElement(); | ||
560 | writer = null; | ||
561 | } | ||
479 | } | 562 | } |
480 | } \ No newline at end of file | 563 | } \ No newline at end of file |