当前位置: 首页>>代码示例>>C#>>正文


C# AnimatTools.SetAttrib方法代码示例

本文整理汇总了C#中AnimatTools.SetAttrib方法的典型用法代码示例。如果您正苦于以下问题:C# AnimatTools.SetAttrib方法的具体用法?C# AnimatTools.SetAttrib怎么用?C# AnimatTools.SetAttrib使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AnimatTools的用法示例。


在下文中一共展示了AnimatTools.SetAttrib方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SaveData

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

            oXml.IntoElem();

            RigidBodies.RigidBody_DX rbParent = (RigidBodies.RigidBody_DX)this.Parent;
            Vector3 v3Rot = Util_DX.DecomposeXYZRotationMatrix(this.CombinedTransformationMatrix);;
            float x = Geometry.DegreeToRadian(180);

            if(!oXml.FindChildElement("Constraint", false))
                oXml.AddChildElement("Constraint");
            oXml.IntoElem();
            oXml.SetAttrib("Low",this.m_fltMinAngle);
            oXml.SetAttrib("High", this.m_fltMaxAngle);
            oXml.OutOfElem();

            oXml.AddChildElement("EnableMotor",this.m_bEnableMotor);
            oXml.AddChildElement("ServoMotor",this.m_bServoMotor);
            oXml.AddChildElement("ServoGain",this.m_fltServoGain);

            m_snMaxTorque.SaveData(ref oXml, "MaxTorque");
            m_snMaxVelocity.SaveData(ref oXml, "MaxVelocity");

            //			if(v3Rot.Y >= 180)
            //				m_v3Axis.TransformCoordinate(/*Matrix.RotationX(Geometry.DegreeToRadian(180))*  Matrix.RotationY(Geometry.DegreeToRadian(180)) * Matrix.RotationZ(Geometry.DegreeToRadian(180)) **/ Matrix.RotationX(v3Rot.X)* Matrix.RotationY(v3Rot.Y) * Matrix.RotationZ(v3Rot.Z));
            //			else
                //m_v3Axis.TransformCoordinate(Matrix.RotationX(Geometry.DegreeToRadian(180)) * Matrix.RotationY(Geometry.DegreeToRadian(180)) * Matrix.RotationZ(Geometry.DegreeToRadian(180)) * Matrix.RotationX(v3Rot.X)* Matrix.RotationY(v3Rot.Y) * Matrix.RotationZ(v3Rot.Z));
            Matrix m = this.CombinedTransformationMatrix;
            m.M41 = 0;
            m.M42 = 0;
            m.M43 = 0;
            //Quaternion q = Quaternion.RotationYawPitchRoll(v3Rot.Y, v3Rot.X, v3Rot.Z);
            //m_v3Axis.TransformCoordinate(Matrix.RotationQuaternion(q));
            m_v3Axis.TransformCoordinate(m);

            //Vec3d vRotationAxis = new Vec3d(null,1, 0, 0);
            Vec3d vRotationAxis = new Vec3d(null,m_v3Axis.X, m_v3Axis.Y, m_v3Axis.Z);
            Util.SaveVector(ref oXml, "RotationAxis", vRotationAxis);

            oXml.OutOfElem();
            m_v3Axis = new Vector3(0,0,1);
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:43,代码来源:Hinge_New.cs

示例2: SaveData

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

            oXml.IntoElem();

            if(!oXml.FindChildElement("Constraint", false))
                oXml.AddChildElement("Constraint");
            oXml.IntoElem();
            oXml.SetAttrib("Low",this.m_fltMinMovement);
            oXml.SetAttrib("High", this.m_fltMaxMovement);
            oXml.OutOfElem();

            oXml.AddChildElement("Length", m_fltLength);
            oXml.AddChildElement("EnableMotor",this.m_bEnableMotor);
            oXml.AddChildElement("ServoMotor",this.m_bServoMotor);
            oXml.AddChildElement("ServoGain",this.m_fltServoGain);
            m_snMaxForce.SaveData(ref oXml, "MaxForce");
            m_snMaxVelocity.SaveData(ref oXml, "MaxVelocity");

            RigidBodies.RigidBody_DX rbParent = (RigidBodies.RigidBody_DX)this.Parent;
            Vector3 v3Rot = Util_DX.DecomposeXYZRotationMatrix(this.CombinedTransformationMatrix);;
            float x = Geometry.DegreeToRadian(180);
            m_v3Axis.TransformCoordinate(Matrix.RotationX(Geometry.DegreeToRadian(180)) * Matrix.RotationY(Geometry.DegreeToRadian(180)) * Matrix.RotationZ(Geometry.DegreeToRadian(180)) * Matrix.RotationX(v3Rot.X)* Matrix.RotationY(v3Rot.Y) * Matrix.RotationZ(v3Rot.Z));
            Vec3d vRotationAxis = new Vec3d(null,m_v3Axis.X, m_v3Axis.Y, m_v3Axis.Z);
            Util.SaveVector(ref oXml, "RotationAxis", vRotationAxis);
            m_v3Axis = new Vector3(0,0,1);

            oXml.OutOfElem();
        }
开发者ID:NeuroRoboticTech,项目名称:AnimatLabVersion1,代码行数:30,代码来源:Prismatic.cs


注:本文中的AnimatTools.SetAttrib方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。