public MultiSegmentSpring(AnimatTools.Framework.DataObject doParent)
            : base(doParent)
        {
            m_thDataTypes.DataTypes.Clear();

            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Tension", "Tension", "Newtons", "N", 0, 1000));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("SpringTension", "Spring Tension", "Newtons", "N", 0, 1000));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("DampingTension", "Damping Tension", "Newtons", "N", 0, 1000));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("SpringLength", "Spring Length", "Meters", "m", 0, 1));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Vspring", "Spring Velocity", "m/s", "m/s", -3, 3));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Displacement", "Muscle Displacement", "Meters", "m", 0, 1));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("DisplacementRatio", "Muscle Displacement Ratio", "", "", -1, 1));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Enable", "Enable", "", "", 0, 1));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Aspring", "Acceleration", "m/s^2", "m/s^2", -100, 100));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("PotEnergy", "Potential Energy", "J", "J", -10, 10));
            m_thDataTypes.ID = "Tension";

            //Holdover stuff from using the muscle base class
            m_StimTension = new AnimatTools.DataObjects.Gains.MuscleGains.StimulusTension(this);
            m_LengthTension = new AnimatTools.DataObjects.Gains.MuscleGains.LengthTension(this);
            m_LengthTension.ShowLcePercentage = false;

            m_snNaturalLength = new AnimatTools.Framework.ScaledNumber(this, "NaturalLength", 1, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "meters", "m");
            m_snStiffness = new AnimatTools.Framework.ScaledNumber(this, "Stiffness", 50, AnimatTools.Framework.ScaledNumber.enumNumericScale.Kilo, "N/m", "N/m");
            m_snDamping = new AnimatTools.Framework.ScaledNumber(this, "Damping", 1, AnimatTools.Framework.ScaledNumber.enumNumericScale.Kilo, "g/s", "g/s");

            m_thIncomingDataType = new AnimatTools.DataObjects.DataType("Enabled", "Enabled", "", "", 0, 1, ScaledNumber.enumNumericScale.None, ScaledNumber.enumNumericScale.None);
        }
예제 #2
0
        public static float BoundingBoxOffset(float fltMaxDim)
        {
            if(Util.Environment.DistanceUnits == AnimatTools.DataObjects.Physical.Environment.enumDistanceUnits.Centimeters)
                return 0.01f;

            AnimatTools.Framework.ScaledNumber snVal = new AnimatTools.Framework.ScaledNumber(null);
            snVal.ActualValue = fltMaxDim;

            switch(snVal.Scale)
            {
                case AnimatTools.Framework.ScaledNumber.enumNumericScale.Tera:
                case AnimatTools.Framework.ScaledNumber.enumNumericScale.Giga:
                case AnimatTools.Framework.ScaledNumber.enumNumericScale.Kilo:
                    return 1.0f;
                case AnimatTools.Framework.ScaledNumber.enumNumericScale.None:
                    return 0.1f;
                case AnimatTools.Framework.ScaledNumber.enumNumericScale.centi:
                    return 0.01f;
                case AnimatTools.Framework.ScaledNumber.enumNumericScale.milli:
                    return 0.001f;
                case AnimatTools.Framework.ScaledNumber.enumNumericScale.nano:
                case AnimatTools.Framework.ScaledNumber.enumNumericScale.femto:
                case AnimatTools.Framework.ScaledNumber.enumNumericScale.pico:
                    return 0.0001f;
                default:
                    return 0.01f;
            }
        }
예제 #3
0
        public Spring(AnimatTools.Framework.DataObject doParent)
            : base(doParent)
        {
            Color  = System.Drawing.Color.NavajoWhite;

            m_snNaturalLength = new AnimatTools.Framework.ScaledNumber(this, "NaturalLength", "meters", "m");
            m_snStiffness = new AnimatTools.Framework.ScaledNumber(this, "Stiffness", 50, AnimatTools.Framework.ScaledNumber.enumNumericScale.Kilo, "N/m", "N/m");
            m_snDamping = new AnimatTools.Framework.ScaledNumber(this, "Damping", 1, AnimatTools.Framework.ScaledNumber.enumNumericScale.Kilo, "g/s", "g/s");

            if(Util.Environment != null)
                m_snNaturalLength.SetFromValue(1, (int) Util.Environment.DisplayDistanceUnits);

            AnimatTools.DataObjects.Physical.PhysicalStructure doStruct = null;
            if(doParent != null && doParent is AnimatTools.DataObjects.Physical.BodyPart)
            {
                AnimatTools.DataObjects.Physical.BodyPart bpPart = (AnimatTools.DataObjects.Physical.BodyPart) doParent;
                doStruct = bpPart.ParentStructure;
            }

            m_tpBodyPartType = typeof(VortexAnimatTools.DataObjects.Physical.RigidBodies.MuscleAttachment);
            m_thPrimaryAttachment = new AnimatTools.TypeHelpers.LinkedBodyPartList(doStruct, null, m_tpBodyPartType);
            m_thSecondaryAttachment = new AnimatTools.TypeHelpers.LinkedBodyPartList(doStruct, null, m_tpBodyPartType);
            m_snSpringLength = new AnimatTools.Framework.ScaledNumber(this, "SpringLength", 0, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "Meters", "m");

            m_thDataTypes.DataTypes.Clear();
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("SpringLength", "Spring Length", "Meters", "m", -10, 10));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Displacement", "Displacement", "Meters", "m", -10, 10));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Tension", "Tension", "Newtons", "N", -1000, 1000));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Energy", "Energy", "Joules", "J", -10, 10));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Enable", "Enable", "", "", 0, 1));
            m_thDataTypes.ID = "SpringLength";

            m_thIncomingDataType = new AnimatTools.DataObjects.DataType("Enabled", "Enabled", "", "", 0, 1, ScaledNumber.enumNumericScale.None, ScaledNumber.enumNumericScale.None);
        }
        public LinearHillStretchReceptor(AnimatTools.Framework.DataObject doParent)
            : base(doParent)
        {
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Ia", "Ia Discharge Rate" , "Spikes/s", "Spikes/s", 0, 1000));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("II", "II Discharge Rate", "Spikes/s", "Spikes/s", 0, 1000));
            m_thDataTypes.ID = "Ia";

            m_snIaDischargeConstant = new AnimatTools.Framework.ScaledNumber(this, "Ia Discharge Constant", 100, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "Spikes/sm", "Spikes/sm");
            m_snIIDischargeConstant = new AnimatTools.Framework.ScaledNumber(this, "II Discharge Constant", 100, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "Spikes/sm", "Spikes/sm");
        }
        public Cylinder(AnimatTools.Framework.DataObject doParent)
            : base(doParent)
        {
            m_fRadius = 0.5f;
            m_fHeight = 1;

            m_snRadius = new AnimatTools.Framework.ScaledNumber(this, "RadiusScaled", "meters", "m");
            m_snHeight = new AnimatTools.Framework.ScaledNumber(this, "HeightScaled", "meters", "m");

            m_vrSize = new DxCylinderSizeRef(this);
        }
예제 #6
0
        public Box(AnimatTools.Framework.DataObject doParent)
            : base(doParent)
        {
            m_vGraphicsBoxSize = new Vec3d(this);
            m_vGraphicsBoxSize.X = m_vGraphicsBoxSize.Y = m_vGraphicsBoxSize.Z = 1;

            m_snWidth = new AnimatTools.Framework.ScaledNumber(this, "WidthScaled", "meters", "m");
            m_snHeight = new AnimatTools.Framework.ScaledNumber(this, "HeightScaled", "meters", "m");
            m_snLength = new AnimatTools.Framework.ScaledNumber(this, "LengthScaled", "meters", "m");

            m_vrSize = new DxBoxSizeRef(this);
        }
예제 #7
0
        public Cone(AnimatTools.Framework.DataObject doParent)
            : base(doParent)
        {
            m_vrSize = new DxConeSizeRef(this);

            m_snUpperRadius = new AnimatTools.Framework.ScaledNumber(this, "UpperRadiusScaled", "meters", "m");
            m_snLowerRadius = new AnimatTools.Framework.ScaledNumber(this, "LowerRadiusScaled", "meters", "m");
            m_snHeight = new AnimatTools.Framework.ScaledNumber(this, "HeightScaled", "meters", "m");

            m_fLowerRadius = 0.5f;
            m_fUpperRadius = 0;
            m_fHeight = 1;
        }
        public InverseMuscleDynamics(AnimatTools.Framework.DataObject doParent)
            : base(doParent)
        {
            m_tpBodyPartType = typeof(VortexAnimatTools.DataObjects.Physical.RigidBodies.MuscleBase);
            m_thMuscle = new AnimatTools.TypeHelpers.LinkedBodyPartList(null, null, m_tpBodyPartType);
            m_strMuscleLengthData = "";
            m_snConductance = new AnimatTools.Framework.ScaledNumber(this, "Conductance", 100, AnimatTools.Framework.ScaledNumber.enumNumericScale.nano, "Siemens", "S");
            m_snRestPotential = new AnimatTools.Framework.ScaledNumber(this, "RestPotential", -100, AnimatTools.Framework.ScaledNumber.enumNumericScale.milli, "Volts", "V");

            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("A", "A", "Newtons", "N", 0, 1000));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Vm", "Vm", "Volts", "V", -0.100, 0.100));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Current", "Current", "Amps", "A", -100e-9, 100e-9));
            m_thDataTypes.ID = "A";
        }
        public VelocityClamp(AnimatTools.Framework.DataObject doParent)
            : base(doParent)
        {
            m_thPrimaryAttachment = new AnimatTools.TypeHelpers.LinkedBodyPartList(m_doStructure, null, m_tpBodyPartType);
            m_thSecondaryAttachment = new AnimatTools.TypeHelpers.LinkedBodyPartList(m_doStructure, null, m_tpBodyPartType);
            m_tpBodyPartType = typeof(VortexAnimatTools.DataObjects.Physical.RigidBodies.MuscleAttachment);
            m_snVelocity = new AnimatTools.Framework.ScaledNumber(this, "Velocity", 0, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "meters/second", "m/s");
            m_snMaxForce = new AnimatTools.Framework.ScaledNumber(this, "MaxForce", 1, AnimatTools.Framework.ScaledNumber.enumNumericScale.Kilo, "Newton", "N");

            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Force", "Force", "Newtons", "N", 0, 1000));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("PError", "Proportional Error", "Meters", "m", 0, 1000));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("DError", "Derivative Error", "M/s", "m/s", 0, 1));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("IError", "Integrator Error", "m^2", "m^2", 0, 1000));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Position", "Velocity", "m/s", "m/s", 0, 1000));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Velocity", "Acceleration", "m/s^2", "m/s^2", 0, 1000));
            m_thDataTypes.ID = "Force";
        }
        public LinearHillMuscle(AnimatTools.Framework.DataObject doParent)
            : base(doParent)
        {
            m_thDataTypes.DataTypes.Clear();

            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Tension", "Tension", "Newtons", "N", 0, 1000));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Tdot", "Change in Tension", "Newtons per second", "N/s", 0, 1000));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("MuscleLength", "Muscle Length", "Meters", "m", 0, 1));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("SeLength", "Se Length", "Meters", "m", 0, 1));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("SeDisplacement", "Se Displacement", "Meters", "m", 0, 1));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("PeLength", "Pe Length", "Meters", "m", 0, 1));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("A", "A", "Newtons", "N", 0, 1000));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Activation", "Activation", "", "", 0, 1000));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Vmuscle", "Muscle Velocity", "m/s", "m/s", -3, 3));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Vse", "Se Velocity", "m/s", "m/s", -3, 3));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Vpe", "Pe Velocity", "m/s", "m/s", -3, 3));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("AvgVmuscle", "Averaged Muscle Velocity", "m/s", "m/s", -3, 3));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("MembraneVoltage", "Membrane Voltage", "Volts", "V", -100, 100, ScaledNumber.enumNumericScale.milli, ScaledNumber.enumNumericScale.milli));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Displacement", "Muscle Displacement", "Meters", "m", 0, 1));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("DisplacementRatio", "Muscle Displacement Ratio", "", "", -1, 1));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Enable", "Enable", "", "", 0, 1));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Ib", "Ib Discharge Rate", "Spikes/s", "Spikes/s", 0, 1000));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Tl", "Tension-Length Percentage", "%", "%", 0, 1000));
            m_thDataTypes.ID = "Tension";

            m_thIncomingDataType = new AnimatTools.DataObjects.DataType("MembraneVoltage", "Membrane Voltage", "Volts", "V", -100, 100, ScaledNumber.enumNumericScale.milli, ScaledNumber.enumNumericScale.milli);

            m_StimTension = new AnimatTools.DataObjects.Gains.MuscleGains.StimulusTension(this);
            m_LengthTension = new AnimatTools.DataObjects.Gains.MuscleGains.LengthTension(this);
            m_LengthTension.ShowLcePercentage = false;

            m_snMaxTension = new AnimatTools.Framework.ScaledNumber(this, "MaxTension", 100, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "Newtons", "N");
            m_snMuscleLength = new AnimatTools.Framework.ScaledNumber(this, "MuscleLength", 0, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "Meters", "m");
            m_snKse = new AnimatTools.Framework.ScaledNumber(this, "Kse", 10, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "Newtons per meter", "N/m");
            m_snKpe = new AnimatTools.Framework.ScaledNumber(this, "Kpe", 1, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "Newtons per meter", "N/m");
            m_snB = new AnimatTools.Framework.ScaledNumber(this, "B", 1, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "Newton-seconds per meter", "Ns/m");

            m_snPeLengthPercentage = new AnimatTools.Framework.ScaledNumber(this, "PeLengthPercentage", 90, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "%", "%");
            m_snMinPeLengthPercentage = new AnimatTools.Framework.ScaledNumber(this, "MinPeLengthPercentage", 5, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "%", "%");

            m_snIbDischargeConstant = new AnimatTools.Framework.ScaledNumber(this, "Ib Discharge Constant", 100, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "Spikes/sN", "Spikes/sN");
        }
예제 #11
0
        public Hinge(AnimatTools.Framework.DataObject doParent)
            : base(doParent)
        {
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("JointRotation", "Rotation", "Radians", "rad", -3.14, 3.14));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("JointRotationDeg", "Rotation (Deg)", "Degrees", "o", -180, 180));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("JointActualVelocity", "Velocity", "m/s", "m/s", -5, 5));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("JointDesiredVelocity", "Desired Velocity", "m/s", "m/s", -5, 5));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Enable", "Enable", "", "", 0, 1));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("BodyPositionX", "Position X Axis", "Meters", "m", -10, 10));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("BodyPositionY", "Position Y Axis", "Meters", "m", -10, 10));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("BodyPositionZ", "Position Z Axis", "Meters", "m", -10, 10));
            m_thDataTypes.ID = "JointRotation";

            Color  = System.Drawing.Color.Magenta;

            m_snMinAngle = new AnimatTools.Framework.ScaledNumber(this, "MinRotationScaled", Util.RadiansToDegrees(m_fltMinAngle), AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "Degrees", "Deg");
            m_snMaxAngle = new AnimatTools.Framework.ScaledNumber(this, "MaxRotationScaled", Util.RadiansToDegrees(m_fltMaxAngle), AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "Degrees", "Deg");
            m_snMaxTorque = new AnimatTools.Framework.ScaledNumber(this, "MaxTorque", 100, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "Newton-Meters", "Nm");
            m_snMaxVelocity = new AnimatTools.Framework.ScaledNumber(this, "MaxVelocity", 100, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "rad/s", "rad/s");
        }
        public Hinge(AnimatTools.Framework.DataObject doParent)
            : base(doParent)
        {
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("JointRotation", "Rotation", "Radians", "rad", -3.14, 3.14));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("JointActualVelocity", "Velocity", "m/s", "m/s", -5, 5));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("JointDesiredVelocity", "Desired Velocity", "m/s", "m/s", -5, 5));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Enable", "Enable", "", "", 0, 1));
            m_thDataTypes.ID = "JointRotation";

            Color  = System.Drawing.Color.Magenta;

            m_snMinAngle = new AnimatTools.Framework.ScaledNumber(this, "MinRotationScaled", Util.RadiansToDegrees(m_fltMinAngle), AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "Degrees", "Deg");
            m_snMaxAngle = new AnimatTools.Framework.ScaledNumber(this, "MaxRotationScaled", Util.RadiansToDegrees(m_fltMaxAngle), AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "Degrees", "Deg");
            m_snMaxTorque = new AnimatTools.Framework.ScaledNumber(this, "MaxTorque", 100, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "Newton-Meters", "Nm");
            m_snMaxVelocity = new AnimatTools.Framework.ScaledNumber(this, "MaxVelocity", 100, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "rad/s", "rad/s");

            AddCompatibleStimulus(new AnimatTools.DataObjects.ExternalStimuli.MotorVelocity(null));
            AddCompatibleStimulus(new AnimatTools.DataObjects.ExternalStimuli.Enabler(null));
            AddCompatibleStimulus(new VortexAnimatTools.DataObjects.ExternalStimuli.PositionClamp(null));
        }
        public Prismatic(AnimatTools.Framework.DataObject doParent)
            : base(doParent)
        {
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("JointPosition", "Position", "Meters", "m", -10, 10));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("JointActualVelocity", "Velocity", "m/s", "m/s", -5, 5));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("JointDesiredVelocity", "Desired Velocity", "m/s", "m/s", -5, 5));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("Enable", "Enable", "", "", 0, 1));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("BodyPositionX", "Position X Axis", "Meters", "m", -10, 10));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("BodyPositionY", "Position Y Axis", "Meters", "m", -10, 10));
            m_thDataTypes.DataTypes.Add(new AnimatTools.DataObjects.DataType("BodyPositionZ", "Position Z Axis", "Meters", "m", -10, 10));
            m_thDataTypes.ID = "JointPosition";

            Color  = System.Drawing.Color.YellowGreen;

            m_snMinMovement = new AnimatTools.Framework.ScaledNumber(this, "MinMovementScaled", "meters", "m");
            m_snMaxMovement = new AnimatTools.Framework.ScaledNumber(this, "MaxMovementScaled", "meters", "m");
            m_snLength = new AnimatTools.Framework.ScaledNumber(this, "LengthScaled", "meters", "m");
            m_snMaxForce = new AnimatTools.Framework.ScaledNumber(this, "MaxForce", 100, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "Newtons", "N");
            m_snMaxVelocity = new AnimatTools.Framework.ScaledNumber(this, "MaxVelocity", 100, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "m/s", "m/s");

            m_vrConstraint = new DxPrismaticConstraintRef(this);
        }
        protected override void CloneInternal(AnimatTools.Framework.DataObject doOriginal)
        {
            base.CloneInternal (doOriginal);

            Hinge doOrigBody = (Hinge) doOriginal;

            m_fltMinAngle = doOrigBody.m_fltMinAngle;
            m_fltMaxAngle = doOrigBody.m_fltMaxAngle;
            m_snMinAngle = (AnimatTools.Framework.ScaledNumber) m_snMinAngle.Clone(this);
            m_snMaxAngle = (AnimatTools.Framework.ScaledNumber) m_snMaxAngle.Clone(this);
            m_bEnableMotor = doOrigBody.m_bEnableMotor;
            m_bServoMotor = doOrigBody.m_bServoMotor;
            m_fltServoGain = doOrigBody.ServoGain;
            m_snMaxTorque = (AnimatTools.Framework.ScaledNumber) m_snMaxTorque.Clone(this);
            m_snMaxVelocity = (AnimatTools.Framework.ScaledNumber) m_snMaxVelocity.Clone(this);
            m_v3Axis = new Vector3(doOrigBody.m_v3Axis.X, doOrigBody.m_v3Axis.Y, doOrigBody.m_v3Axis.Z);
        }
예제 #15
0
        protected override void CloneInternal(AnimatTools.Framework.DataObject doOriginal, bool bCutData, AnimatTools.Framework.DataObject doRoot)
        {
            base.CloneInternal (doOriginal, bCutData, doRoot);

            Box doOrigBody = (Box) doOriginal;
            m_vGraphicsBoxSize = new Vec3d(this, doOrigBody.m_vGraphicsBoxSize.X, doOrigBody.m_vGraphicsBoxSize.Y, doOrigBody.m_vGraphicsBoxSize.Z);

            m_snHeight = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snHeight.Clone(this, bCutData, doRoot);
            m_snWidth = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snWidth.Clone(this, bCutData, doRoot);
            m_snLength = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snLength.Clone(this, bCutData, doRoot);
        }
        protected override void CloneInternal(AnimatTools.Framework.DataObject doOriginal, bool bCutData, AnimatTools.Framework.DataObject doRoot)
        {
            base.CloneInternal (doOriginal, bCutData, doRoot);

            InverseMuscleDynamics doOrigBody = (InverseMuscleDynamics) doOriginal;

            m_thMuscle = (AnimatTools.TypeHelpers.LinkedBodyPart) doOrigBody.m_thMuscle.Clone(this, bCutData, doRoot);
            m_strMuscleLengthData = doOrigBody.m_strMuscleLengthData;
            m_snConductance = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snConductance.Clone(this, bCutData, doRoot);
            m_snRestPotential = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snRestPotential.Clone(this, bCutData, doRoot);
        }
        private Texture texZ = null; //Texture for the z axis label

        #endregion Fields

        #region Constructors

        public RigidBody_DX(AnimatTools.Framework.DataObject doParent)
            : base(doParent)
        {
            m_vrLocation = new DxLocationRef(this);
            m_vrRotation = new DxRotationRef(this);

            m_snXLocalLocation = new AnimatTools.Framework.ScaledNumber(this, "XLocalLocationScaled", "meters", "m");
            m_snYLocalLocation = new AnimatTools.Framework.ScaledNumber(this, "YLocalLocationScaled", "meters", "m");
            m_snZLocalLocation = new AnimatTools.Framework.ScaledNumber(this, "ZLocalLocationScaled", "meters", "m");

            m_snXWorldLocation = new AnimatTools.Framework.ScaledNumber(this, "XWorldLocationScaled", "meters", "m");
            m_snYWorldLocation = new AnimatTools.Framework.ScaledNumber(this, "YWorldLocationScaled", "meters", "m");
            m_snZWorldLocation = new AnimatTools.Framework.ScaledNumber(this, "ZWorldLocationScaled", "meters", "m");

            m_snXRotation = new AnimatTools.Framework.ScaledNumber(this, "XRotationScaled", "Degrees", "Deg");
            m_snYRotation = new AnimatTools.Framework.ScaledNumber(this, "YRotationScaled", "Degrees", "Deg");
            m_snZRotation = new AnimatTools.Framework.ScaledNumber(this, "ZRotationScaled", "Degrees", "Deg");

            this.m_matTransparentSelectedMaterial = new Material();
            this.m_matTransparentSelectedMaterial.Diffuse = Color.FromArgb(128,Color.FloralWhite);
            this.m_matTransparentSelectedMaterial.Ambient = Color.FromArgb(128,Color.FloralWhite);

            Alpha = 255;
            Color = Color.Red;

            m_d3dRFPointMaterial = new Material();
            m_d3dRFPointMaterial.Ambient = Color.Green;
            m_d3dRFPointMaterial.Diffuse = Color.Green;

            m_d3dSelRFPointMaterial = new Material();
            m_d3dSelRFPointMaterial.Ambient = Color.DarkRed;
            m_d3dSelRFPointMaterial.Diffuse = Color.DarkRed;
        }
        protected void RigidBody_Clone(AnimatTools.Framework.DataObject doOriginal, bool bCutData, AnimatTools.Framework.DataObject doRoot)
        {
            RigidBody_DX doOrigBody = (RigidBody_DX) doOriginal;

            m_d3dDevice = doOrigBody.m_d3dDevice;
            m_v3Rotation = new Microsoft.DirectX.Vector3(doOrigBody.m_v3Rotation.X, doOrigBody.m_v3Rotation.Y, doOrigBody.m_v3Rotation.Z);
            m_v3Direction = new Microsoft.DirectX.Vector3(doOrigBody.m_v3Direction.X, doOrigBody.m_v3Direction.Y, doOrigBody.m_v3Direction.Z);

            m_mtxOrientation = Util_DX.CloneMatrix(doOrigBody.m_mtxOrientation);
            m_mtxTranslation = Util_DX.CloneMatrix(doOrigBody.m_mtxTranslation);

            m_d3dMaterial.Ambient = doOrigBody.m_d3dMaterial.Ambient;
            m_d3dMaterial.Diffuse = doOrigBody.m_d3dMaterial.Diffuse;
            m_d3dTransparentMaterial.Ambient = doOrigBody.m_d3dTransparentMaterial.Ambient;
            m_d3dTransparentMaterial.Diffuse = doOrigBody.m_d3dTransparentMaterial.Diffuse;

            m_snXLocalLocation = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snXLocalLocation.Clone(this, bCutData, doRoot);
            m_snYLocalLocation = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snYLocalLocation.Clone(this, bCutData, doRoot);
            m_snZLocalLocation = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snZLocalLocation.Clone(this, bCutData, doRoot);

            m_snXWorldLocation = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snXWorldLocation.Clone(this, bCutData, doRoot);
            m_snYWorldLocation = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snYWorldLocation.Clone(this, bCutData, doRoot);
            m_snZWorldLocation = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snZWorldLocation.Clone(this, bCutData, doRoot);

            m_snXRotation = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snXRotation.Clone(this, bCutData, doRoot);
            m_snYRotation = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snYRotation.Clone(this, bCutData, doRoot);
            m_snZRotation = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snZRotation.Clone(this, bCutData, doRoot);
        }
        protected override void CloneInternal(AnimatTools.Framework.DataObject doOriginal, bool bCutData, AnimatTools.Framework.DataObject doRoot)
        {
            base.CloneInternal (doOriginal, bCutData, doRoot);

            LinearHillMuscle doOrigBody = (LinearHillMuscle) doOriginal;

            m_aryAttachmentPoints = (VortexAnimatTools.Collections.MuscleAttachments) doOrigBody.m_aryAttachmentPoints.Copy();
            m_bEnabled = doOrigBody.m_bEnabled;
            m_StimTension = (AnimatTools.DataObjects.Gains.MuscleGains.StimulusTension) doOrigBody.m_StimTension.Clone(this, bCutData, doRoot);
            m_LengthTension = (AnimatTools.DataObjects.Gains.MuscleGains.LengthTension) doOrigBody.m_LengthTension.Clone(this, bCutData, doRoot);
            m_snMaxTension = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snMaxTension.Clone(this, bCutData, doRoot);
            m_snMuscleLength = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snMuscleLength.Clone(this, bCutData, doRoot);
            m_snKse = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snKse.Clone(this, bCutData, doRoot);
            m_snKpe = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snKpe.Clone(this, bCutData, doRoot);
            m_snB = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snB.Clone(this, bCutData, doRoot);
            m_snPeLengthPercentage = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snPeLengthPercentage.Clone(this, bCutData, doRoot);
            m_snMinPeLengthPercentage = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snMinPeLengthPercentage.Clone(this, bCutData, doRoot);
            m_snIbDischargeConstant = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snIbDischargeConstant.Clone(this, bCutData, doRoot);
        }
예제 #20
0
        protected override void CloneInternal(AnimatTools.Framework.DataObject doOriginal, bool bCutData, AnimatTools.Framework.DataObject doRoot)
        {
            base.CloneInternal (doOriginal, bCutData, doRoot);

            Cone doOrigBody = (Cone) doOriginal;

            m_fLowerRadius = doOrigBody.m_fLowerRadius;
            m_fUpperRadius = doOrigBody.m_fUpperRadius;
            m_fHeight = doOrigBody.m_fHeight;

            m_snUpperRadius = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snUpperRadius.Clone(this, bCutData, doRoot);
            m_snLowerRadius = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snLowerRadius.Clone(this, bCutData, doRoot);
            m_snHeight = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snHeight.Clone(this, bCutData, doRoot);
        }
        protected override void CloneInternal(AnimatTools.Framework.DataObject doOriginal, bool bCutData, AnimatTools.Framework.DataObject doRoot)
        {
            base.CloneInternal (doOriginal, bCutData, doRoot);

            Prismatic doOrigBody = (Prismatic) doOriginal;

            m_fltMinMovement = doOrigBody.m_fltMinMovement;
            m_fltMaxMovement = doOrigBody.m_fltMaxMovement;
            m_fltLength = doOrigBody.m_fltLength;
            m_snMinMovement = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snMinMovement.Clone(this, bCutData, doRoot);
            m_snMaxMovement = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snMaxMovement.Clone(this, bCutData, doRoot);
            m_snLength = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snLength.Clone(this, bCutData, doRoot);
            m_snMaxForce = (AnimatTools.Framework.ScaledNumber) m_snMaxForce.Clone(this, bCutData, doRoot);
            m_snMaxVelocity = (AnimatTools.Framework.ScaledNumber) m_snMaxVelocity.Clone(this, bCutData, doRoot);
            m_bEnableMotor = doOrigBody.m_bEnableMotor;
            m_bServoMotor = doOrigBody.m_bServoMotor;
            m_fltServoGain = doOrigBody.ServoGain;
        }
        protected override void CloneInternal(AnimatTools.Framework.DataObject doOriginal, bool bCutData, AnimatTools.Framework.DataObject doRoot)
        {
            base.CloneInternal (doOriginal, bCutData, doRoot);

            MultiSegmentSpring doOrigBody = (MultiSegmentSpring) doOriginal;

            m_aryAttachmentPoints = (VortexAnimatTools.Collections.MuscleAttachments) doOrigBody.m_aryAttachmentPoints.Copy();
            m_bEnabled = doOrigBody.m_bEnabled;
            m_StimTension = (AnimatTools.DataObjects.Gains.MuscleGains.StimulusTension) doOrigBody.m_StimTension.Clone(this, bCutData, doRoot);
            m_LengthTension = (AnimatTools.DataObjects.Gains.MuscleGains.LengthTension) doOrigBody.m_LengthTension.Clone(this, bCutData, doRoot);
            m_snMaxTension = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snMaxTension.Clone(this, bCutData, doRoot);
            m_snMuscleLength = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snMuscleLength.Clone(this, bCutData, doRoot);
            m_snNaturalLength = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snNaturalLength.Clone(this, bCutData, doRoot);
            m_snStiffness = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snStiffness.Clone(this, bCutData, doRoot);
            m_snDamping = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snDamping.Clone(this, bCutData, doRoot);
            m_eForceType = doOrigBody.m_eForceType;
        }
예제 #23
0
        protected override void CloneInternal(AnimatTools.Framework.DataObject doOriginal, bool bCutData, AnimatTools.Framework.DataObject doRoot)
        {
            base.CloneInternal (doOriginal, bCutData, doRoot);

            Spring doOrigBody = (Spring) doOriginal;

            m_thPrimaryAttachment = (AnimatTools.TypeHelpers.LinkedBodyPart) doOrigBody.m_thPrimaryAttachment.Clone(this, bCutData, doRoot);
            m_thSecondaryAttachment = (AnimatTools.TypeHelpers.LinkedBodyPart) doOrigBody.m_thSecondaryAttachment.Clone(this, bCutData, doRoot);

            m_snNaturalLength = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snNaturalLength.Clone(this, bCutData, doRoot);
            m_snStiffness = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snStiffness.Clone(this, bCutData, doRoot);
            m_snDamping = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snDamping.Clone(this, bCutData, doRoot);
            m_fRadius = doOrigBody.m_fRadius;
            m_bEnabled = doOrigBody.m_bEnabled;
        }
예제 #24
0
        public override void SwapBodyPartCopy(AnimatTools.DataObjects.Physical.BodyPart doOriginal)
        {
            base.SwapBodyPartCopy(doOriginal);

            if(Util.IsTypeOf(doOriginal.GetType(), typeof(VortexAnimatTools.DataObjects.Physical.RigidBodies.Spring), false))
            {
                VortexAnimatTools.DataObjects.Physical.RigidBodies.Spring msOrig = (VortexAnimatTools.DataObjects.Physical.RigidBodies.Spring) doOriginal;

                m_thPrimaryAttachment = msOrig.m_thPrimaryAttachment;
                m_thSecondaryAttachment = msOrig.m_thSecondaryAttachment;
                m_snNaturalLength = msOrig.m_snNaturalLength;
                m_snStiffness = msOrig.m_snStiffness;
                m_snDamping = msOrig.m_snDamping;
                m_snSpringLength = msOrig.m_snSpringLength;
                m_fRadius = msOrig.m_fRadius;
            }
            else if(Util.IsTypeOf(doOriginal.GetType(), typeof(VortexAnimatTools.DataObjects.Physical.RigidBodies.MuscleBase), false))
            {
                VortexAnimatTools.DataObjects.Physical.RigidBodies.MuscleBase msOrig = (VortexAnimatTools.DataObjects.Physical.RigidBodies.MuscleBase) doOriginal;

                if(msOrig.AttachmentPoints.Count > 0 && m_thPrimaryAttachment != null)
                    m_thPrimaryAttachment.BodyPart = msOrig.AttachmentPoints[0];

                if(msOrig.AttachmentPoints.Count > 1 && m_thSecondaryAttachment != null)
                    m_thSecondaryAttachment.BodyPart = msOrig.AttachmentPoints[1];
            }
        }
        protected override void CloneInternal(AnimatTools.Framework.DataObject doOriginal, bool bCutData, AnimatTools.Framework.DataObject doRoot)
        {
            base.CloneInternal (doOriginal, bCutData, doRoot);

            LinearHillStretchReceptor doOrigBody = (LinearHillStretchReceptor) doOriginal;

            m_bApplyTension = doOrigBody.m_bApplyTension;
            m_snIaDischargeConstant = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snIaDischargeConstant.Clone(this, bCutData, doRoot);
            m_snIIDischargeConstant = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snIIDischargeConstant.Clone(this, bCutData, doRoot);
        }
        protected void SetPositionUnits()
        {
            double dblActualValue = m_snVelocity.ActualValue;
            AnimatTools.Framework.ScaledNumber.enumNumericScale eScale =  m_snVelocity.Scale;

            if(m_doBodyPart != null && m_doBodyPart is AnimatTools.DataObjects.Physical.Joint)
            {
                AnimatTools.DataObjects.Physical.Joint doJoint = (AnimatTools.DataObjects.Physical.Joint) m_doBodyPart;

                if(doJoint.UsesRadians)
                    m_snVelocity = new AnimatTools.Framework.ScaledNumber(this, "Velocity", 0, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "radians/sec", "rad/s");
                else
                    m_snVelocity = new AnimatTools.Framework.ScaledNumber(this, "Velocity", 0, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "meters/sec", "m/s");
            }
            else
                m_snVelocity = new AnimatTools.Framework.ScaledNumber(this, "Velocity", 0, AnimatTools.Framework.ScaledNumber.enumNumericScale.None, "meters/sec", "m/s");

            m_snVelocity.SetFromValue(dblActualValue, eScale);
        }
        protected override void CloneInternal(AnimatTools.Framework.DataObject doOriginal, bool bCutData, AnimatTools.Framework.DataObject doRoot)
        {
            base.CloneInternal (doOriginal, bCutData, doRoot);

            VelocityClamp doOrigBody = (VelocityClamp) doOriginal;

            m_thPrimaryAttachment = (AnimatTools.TypeHelpers.LinkedBodyPart) doOrigBody.m_thPrimaryAttachment.Clone(this, bCutData, doRoot);
            m_thSecondaryAttachment = (AnimatTools.TypeHelpers.LinkedBodyPart) doOrigBody.m_thSecondaryAttachment.Clone(this, bCutData, doRoot);
            m_snVelocity = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snVelocity.Clone(this, bCutData, doRoot);
            m_snMaxForce = (AnimatTools.Framework.ScaledNumber) doOrigBody.m_snMaxForce.Clone(this, bCutData, doRoot);
            m_fltProportionalGain = doOrigBody.m_fltProportionalGain;
            m_fltDerivativeGain = doOrigBody.m_fltDerivativeGain;
            m_fltIntegratorGain = doOrigBody.m_fltIntegratorGain;
            m_fltMaxIntegratorValue = doOrigBody.m_fltMaxIntegratorValue;
        }