Exemplo n.º 1
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 void LoadGainTypes(ComboBox cboCombo, AnimatTools.DataObjects.Gain gnSelGain)
        {
            cboCombo.Items.Clear();
            foreach(AnimatTools.DataObjects.Gain gnGain in Util.Application.GainTypes)
            {
                if(gnGain.SelectableGain)
                {
                    if(Util.IsTypeOf(gnGain.GetType(), gnSelGain.GetType(), false))
                        cboCombo.Items.Add(gnSelGain);
                    else
                        cboCombo.Items.Add(gnGain);
                }
            }

            cboCombo.SelectedItem = gnSelGain;
        }
Exemplo n.º 3
0
        public override void AfterClone(AnimatTools.Framework.DataObject doParent, bool bCutData, AnimatTools.Framework.DataObject doOriginal, AnimatTools.Framework.DataObject doClone)
        {
            base.AfterClone (doParent, bCutData, doOriginal, doClone);

            if(Util.IsTypeOf(doClone.GetType(), typeof(AnimatTools.DataObjects.Physical.BodyPart), false))
            {
                //This is the new cloned root object, not the original root object
                AnimatTools.DataObjects.Physical.BodyPart doPart = (AnimatTools.DataObjects.Physical.BodyPart) doClone;

                if(m_thPrimaryAttachment != null && m_thPrimaryAttachment.BodyPart != null)
                {
                    AnimatTools.DataObjects.Physical.BodyPart doBase = doPart.FindBodyPartByCloneID(m_thPrimaryAttachment.BodyPart.ID);
                    if(doBase != null)
                        m_thPrimaryAttachment.BodyPart = (MuscleAttachment) doBase;
                }

                if(m_thSecondaryAttachment != null && m_thSecondaryAttachment.BodyPart != null)
                {
                    AnimatTools.DataObjects.Physical.BodyPart doBase = doPart.FindBodyPartByCloneID(m_thSecondaryAttachment.BodyPart.ID);
                    if(doBase != null)
                        m_thSecondaryAttachment.BodyPart = (MuscleAttachment) doBase;
                }
            }
        }