Example #1
0
        void ReadJointPosPhase(ImportedBone b, int index, int count)
        {
            string[] linetoks = GetNonEmptyTokens();
            if (linetoks.Length < 4)
            {
                lineerror = "Unable to read JointPosition Line.";
                return;
            }

            try
            {
                float t        = Convert.ToSingle(linetoks[0], AbstractGmdcImporter.DefaultCulture);
                bool  isscaled = (t == -1);
                t = Math.Max(0, t - 1);
                Vector3f trans = new Vector3f(
                    ToDouble(linetoks[1]),
                    ToDouble(linetoks[2]),
                    ToDouble(linetoks[3])
                    );

                trans = Component.InverseTransformScaled(trans);

                if (curtransblock != null)
                {
                    //Brand this Block as Translation (ignoring all rotations!)
                    if (curtransblock.TransformationType == FrameType.Unknown)
                    {
                        curtransblock.TransformationType = FrameType.Translation;
                    }


                    //only process if the Block Type is Translation
                    if (curtransblock.TransformationType == FrameType.Translation)
                    {
                        if (isscaled && index == 0)
                        {
                            for (int i = 0; i < curtransblock.AxisCount; i++)
                            {
                                curtransblock.AxisSet[i].Locked = true;
                            }
                        }

                        curtransblock.AddFrame((short)t, trans, false);
                    }
                }
            }
            catch
            {
                lineerror = "Unable to Convert to Number (ReadJointPosPhase)";
            }
        }
Example #2
0
        private void llAdd_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
        {
            AnimationFrameBlock ab2 = null;

            if (tv.SelectedNode.Tag is AnimationFrameBlock)
            {
                ab2 = (AnimationFrameBlock)tv.SelectedNode.Tag;
            }
            else
            {
                ab2 = (AnimationFrameBlock)tv.SelectedNode.Parent.Tag;
            }

            if (ab2.AxisCount != 3)
            {
                return;
            }

            ab2.AddFrame((short)(ab2.GetDuration() + 1), 0, 0, 0, false);

            AnimResourceConst arc = (AnimResourceConst)tAnimResourceConst.Tag;

            arc.Refresh();
        }