當前位置: 首頁>>代碼示例>>C#>>正文


C# AnimatTools.GetAttribFloat方法代碼示例

本文整理匯總了C#中AnimatTools.GetAttribFloat方法的典型用法代碼示例。如果您正苦於以下問題:C# AnimatTools.GetAttribFloat方法的具體用法?C# AnimatTools.GetAttribFloat怎麽用?C# AnimatTools.GetAttribFloat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AnimatTools的用法示例。


在下文中一共展示了AnimatTools.GetAttribFloat方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: LoadData

        public override void LoadData(ref AnimatTools.DataObjects.Simulation dsSim, ref AnimatTools.DataObjects.Physical.PhysicalStructure doStructure, ref AnimatTools.Interfaces.StdXml oXml)
        {
            base.LoadData (ref dsSim, ref doStructure, ref oXml);

            oXml.IntoElem();

            oXml.IntoChildElement("Constraint");
            m_fltMinAngle = oXml.GetAttribFloat("Low");
            m_fltMaxAngle = oXml.GetAttribFloat("High");
            oXml.OutOfElem(); //out of Constraint

            m_snMinAngle.SetFromValue(Util.RadiansToDegrees(m_fltMinAngle), AnimatTools.Framework.ScaledNumber.enumNumericScale.None);
            m_snMaxAngle.SetFromValue(Util.RadiansToDegrees(m_fltMaxAngle), AnimatTools.Framework.ScaledNumber.enumNumericScale.None);

            m_bEnableMotor = oXml.GetChildBool("EnableMotor");
            m_bServoMotor = oXml.GetChildBool("ServoMotor", m_bServoMotor);
            m_fltServoGain = oXml.GetChildFloat("ServoGain", m_fltServoGain);

            //based on whether this is a servo motor or not the incoming data type will change.
            if(m_bServoMotor)
                m_thIncomingDataType = new AnimatTools.DataObjects.DataType("Position", "Position", "rad", "rad", -3.142, 3.142, ScaledNumber.enumNumericScale.None, ScaledNumber.enumNumericScale.None);
            else
                m_thIncomingDataType = new AnimatTools.DataObjects.DataType("DesiredVelocity", "Desired Velocity", "m/s", "m/s", -5, 5, ScaledNumber.enumNumericScale.None, ScaledNumber.enumNumericScale.None);

            if(oXml.FindChildElement("MaxTorque", false))
                m_snMaxTorque.LoadData(ref oXml, "MaxTorque");

            if(oXml.FindChildElement("MaxVelocity", false))
                m_snMaxTorque.LoadData(ref oXml, "MaxVelocity");

            //			if(oXml.FindChildElement("RotationAxis", false))
            //			{
            //				Vec3d vTmp = Util.LoadVec3d(ref oXml, "RotationAxis", this);
            //				m_v3Axis = new Vector3((float)vTmp.X, (float)vTmp.Y, (float)vTmp.Z);
            //			}

            m_v3Axis = new Vector3(0,0,1);
            oXml.OutOfElem(); //out of body
        }
開發者ID:NeuroRoboticTech,項目名稱:AnimatLabVersion1,代碼行數:39,代碼來源:Hinge_New.cs

示例2: LoadData

        public override void LoadData(ref AnimatTools.DataObjects.Simulation dsSim, ref AnimatTools.DataObjects.Physical.PhysicalStructure doStructure, ref AnimatTools.Interfaces.StdXml oXml)
        {
            base.LoadData (ref dsSim, ref doStructure, ref oXml);

            oXml.IntoElem();

            if(oXml.FindChildElement("Constraint", false))
            {
                oXml.IntoChildElement("Constraint");
                m_fltMinMovement = oXml.GetAttribFloat("Low");
                m_fltMaxMovement = oXml.GetAttribFloat("High");
                oXml.OutOfElem(); //out of Constraint
            }

            m_fltLength = oXml.GetChildFloat("Length", m_fltLength);
            m_bEnableMotor = oXml.GetChildBool("EnableMotor", false);
            m_bServoMotor = oXml.GetChildBool("ServoMotor", m_bServoMotor);
            m_fltServoGain = oXml.GetChildFloat("ServoGain", m_fltServoGain);

            if(oXml.FindChildElement("MaxForce", false))
                m_snMaxForce.LoadData(ref oXml, "MaxForce");

            if(oXml.FindChildElement("MaxVelocity", false))
                m_snMaxVelocity.LoadData(ref oXml, "MaxVelocity");

            oXml.OutOfElem(); //out of body
        }
開發者ID:NeuroRoboticTech,項目名稱:AnimatLabVersion1,代碼行數:27,代碼來源:Prismatic.cs


注:本文中的AnimatTools.GetAttribFloat方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。