internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "axis1Angle")
            {
                Axis1Angle = parser.ParseDoubleValue();
            }
            else if (id == "axis1Torque")
            {
                Axis1Torque = parser.ParseDoubleValue();
            }
            else if (id == "axis2Angle")
            {
                Axis2Angle = parser.ParseDoubleValue();
            }
            else if (id == "axis2Torque")
            {
                Axis2Torque = parser.ParseDoubleValue();
            }
            else if (id == "axis3Angle")
            {
                Axis3Angle = parser.ParseDoubleValue();
            }
            else if (id == "axis3Torque")
            {
                Axis3Torque = parser.ParseDoubleValue();
            }
            else if (id == "body1")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Body1 = node as IX3DRigidBodyNode;
                    if (Body1 == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "body2")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Body2 = node as IX3DRigidBodyNode;
                    if (Body2 == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "enabledAxes")
            {
                EnabledAxes = parser.ParseIntValue();
            }
            else if (id == "forceOutput")
            {
                if (wasForceOutput)
                {
                    ForceOutput.AddRange(parser.ParseSFStringOrMFStringValue());
                }
                else
                {
                    ForceOutput = parser.ParseSFStringOrMFStringValue();
                }
                wasForceOutput = true;
            }
            else if (id == "motor1Axis")
            {
                Motor1Axis = parser.ParseSFVec3fValue();
            }
            else if (id == "motor2Axis")
            {
                Motor2Axis = parser.ParseSFVec3fValue();
            }
            else if (id == "motor3Axis")
            {
                Motor3Axis = parser.ParseSFVec3fValue();
            }
            else if (id == "stop1Bounce")
            {
                Stop1Bounce = parser.ParseDoubleValue();
            }
            else if (id == "stop1ErrorCorrection")
            {
                Stop1ErrorCorrection = parser.ParseDoubleValue();
            }
            else if (id == "stop2Bounce")
            {
                Stop2Bounce = parser.ParseDoubleValue();
            }
            else if (id == "stop2ErrorCorrection")
            {
                Stop2ErrorCorrection = parser.ParseDoubleValue();
            }
            else if (id == "stop3Bounce")
            {
                Stop3Bounce = parser.ParseDoubleValue();
            }
            else if (id == "stop3ErrorCorrection")
            {
                Stop3ErrorCorrection = parser.ParseDoubleValue();
            }
            else if (id == "autoCalc")
            {
                AutoCalc = parser.ParseBoolValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "anchorPoint")
            {
                AnchorPoint = parser.ParseSFVec3fValue();
            }
            else if (id == "axis1")
            {
                Axis1 = parser.ParseSFVec3fValue();
            }
            else if (id == "axis2")
            {
                Axis2 = parser.ParseSFVec3fValue();
            }
            else if (id == "body1")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Body1 = node as IX3DRigidBodyNode;
                    if (Body1 == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "body2")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Body2 = node as IX3DRigidBodyNode;
                    if (Body2 == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "forceOutput" || id == "mustOutput")
            {
                if (wasForceOutput)
                {
                    ForceOutput.AddRange(parser.ParseSFStringOrMFStringValue());
                }
                else
                {
                    ForceOutput = parser.ParseSFStringOrMFStringValue();
                }
                wasForceOutput = true;
            }
            else if (id == "stop1Bounce" || id == "stopBounce1")
            {
                Stop1Bounce = parser.ParseDoubleValue();
            }
            else if (id == "stop1ErrorCorrection" || id == "stopErrorCorrection1")
            {
                Stop1ErrorCorrection = parser.ParseDoubleValue();
            }
            else if (id == "stop2Bounce" || id == "stopBounce2")
            {
                Stop2Bounce = parser.ParseDoubleValue();
            }
            else if (id == "stop2ErrorCorrection" || id == "stopErrorCorrection2")
            {
                Stop2ErrorCorrection = parser.ParseDoubleValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
예제 #3
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "anchorPoint")
            {
                AnchorPoint = parser.ParseSFVec3fValue();
            }
            else if (id == "axis1")
            {
                Axis1 = parser.ParseSFVec3fValue();
            }
            else if (id == "axis2")
            {
                Axis2 = parser.ParseSFVec3fValue();
            }
            else if (id == "body1")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Body1 = node as IX3DRigidBodyNode;
                    if (Body1 == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "body2")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Body2 = node as IX3DRigidBodyNode;
                    if (Body2 == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "desiredAngularVelocity1")
            {
                DesiredAngularVelocity1 = parser.ParseDoubleValue();
            }
            else if (id == "desiredAngularVelocity2")
            {
                DesiredAngularVelocity2 = parser.ParseDoubleValue();
            }
            else if (id == "forceOutput" || id == "mustOutput")
            {
                if (wasForceOutput)
                {
                    ForceOutput.AddRange(parser.ParseSFStringOrMFStringValue());
                }
                else
                {
                    ForceOutput = parser.ParseSFStringOrMFStringValue();
                }
                wasForceOutput = true;
            }
            else if (id == "maxAngle1")
            {
                MaxAngle1 = parser.ParseDoubleValue();
            }
            else if (id == "maxTorque1")
            {
                MaxTorque1 = parser.ParseDoubleValue();
            }
            else if (id == "maxTorque2")
            {
                MaxTorque2 = parser.ParseDoubleValue();
            }
            else if (id == "minAngle1")
            {
                MinAngle1 = parser.ParseDoubleValue();
            }
            else if (id == "stopBounce1")
            {
                StopBounce1 = parser.ParseDoubleValue();
            }
            else if (id == "stopConstantForceMix1")
            {
                StopConstantForceMix1 = parser.ParseDoubleValue();
            }
            else if (id == "stopErrorCorrection1")
            {
                StopErrorCorrection1 = parser.ParseDoubleValue();
            }
            else if (id == "suspensionErrorCorrection")
            {
                SuspensionErrorCorrection = parser.ParseDoubleValue();
            }
            else if (id == "suspensionForce")
            {
                SuspensionForce = parser.ParseDoubleValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }