Пример #1
0
    /// <summary>
    /// Used for writing the data of a LinearJoint_Base.
    /// </summary>
    /// <param name="joint"></param>
    /// <param name="writer"></param>
    private static void WriteLinearJoint(LinearJoint_Base joint, XmlWriter writer)
    {
        writer.WriteStartElement("LinearJoint");

        joint.EnforceOrder();

        WriteBXDVector3(joint.basePoint, writer, "BasePoint");
        WriteBXDVector3(joint.axis, writer, "Axis");

        if (joint.hasLowerLimit)
        {
            writer.WriteElementString("LinearLowLimit", joint.linearLimitLow.ToString("F4"));
        }

        if (joint.hasUpperLimit)
        {
            writer.WriteElementString("LinearUpperLimit", joint.linearLimitHigh.ToString("F4"));
        }

        writer.WriteElementString("CurrentLinearPosition", joint.currentLinearPosition.ToString("F4"));

        writer.WriteEndElement();
    }
Пример #2
0
    /// <summary>
    /// Used for writing the data of a LinearJoint_Base.
    /// </summary>
    /// <param name="joint"></param>
    /// <param name="writer"></param>
    private static void WriteLinearJoint(LinearJoint_Base joint, XmlWriter writer)
    {
        writer.WriteStartElement("LinearJoint");

        joint.EnforceOrder();

        WriteBXDVector3(joint.basePoint, writer, "BasePoint");
        WriteBXDVector3(joint.axis, writer, "Axis");

        if (joint.hasLowerLimit)
        {
            writer.WriteElementString("LinearLowLimit", joint.linearLimitLow.ToString("F4"));
        }

        if (joint.hasUpperLimit)
        {
            writer.WriteElementString("LinearUpperLimit", joint.linearLimitHigh.ToString("F4"));
        }

        // writer.WriteElementString("CurrentLinearPosition", joint.currentLinearPosition.ToString("F4"));
        writer.WriteElementString("CurrentLinearPosition", joint.currentLinearPosition.ToString("F4"));// writes the lowest point of the joint to the file as the positon so the joint starts at the bottom, hopefully prevents any weird issues with the joint limits being messed up do to being relative to the start of the joint

        writer.WriteEndElement();
    }