Exemple #1
0
 public void Dispose()
 {
     if (parent != null)
     {
         parent = null;
     }
 }
Exemple #2
0
        /// <summary>
        /// Create a new Instance.
        /// </summary>
        /// <param name="parent">The parent Block</param>
        /// <remarks>
        /// Instances are only valid in the context of a <see cref="AnimationAxisTransformBlock"/>!
        /// </remarks>
        internal AnimationAxisTransform(AnimationAxisTransformBlock parent, int index)
        {
            SetIndex(index);
            SetParent(parent);

            Reset();
        }
Exemple #3
0
 public void AddFrame(short tc, float x, float y, float z, bool linear)
 {
     for (int i = 0; i < AxisCount; i++)
     {
         AnimationAxisTransformBlock b = AxisSet[i];
         b.Add(tc, GetAxisValue(i, b.FromCompressedFloat(x), b.FromCompressedFloat(y), b.FromCompressedFloat(z)), 0, 0, linear);
     }
 }
Exemple #4
0
 public short FromCompressedFloat(float val)
 {
     if (parent != null)
     {
         return(parent.FromCompressedFloat(val));
     }
     return(AnimationAxisTransformBlock.FromCompressedFloat(val, AnimationAxisTransformBlock.SCALE));
 }
Exemple #5
0
 public float GetCompressedFloat(short val)
 {
     if (parent != null)
     {
         return(parent.GetCompressedFloat(val));
     }
     return(AnimationAxisTransformBlock.GetCompressedFloat(val, AnimationAxisTransformBlock.SCALE));
 }
Exemple #6
0
 /// <summary>
 /// Unserializes a BinaryStream into the Attributes of this Instance
 /// </summary>
 /// <param name="reader">The Stream that contains the FileData</param>
 internal void UnserializePart3Data(System.IO.BinaryReader reader)
 {
     ab3 = new AnimationAxisTransformBlock[GetPart3Count()];
     for (int i = 0; i < ab3.Length; i++)
     {
         ab3[i] = new AnimationAxisTransformBlock(this);
         ab3[i].UnserializeData(reader);
     }
 }
Exemple #7
0
 public void CreateBaseAxisSet(AnimationTokenType t)
 {
     ab3 = new AnimationAxisTransformBlock[3];
     for (int i = 0; i < AxisCount; i++)
     {
         ab3[i]      = new AnimationAxisTransformBlock(this);
         ab3[i].Type = t;
     }
 }
Exemple #8
0
        public AnimationAxisTransformBlock CloneBase()
        {
            AnimationAxisTransformBlock ab = new AnimationAxisTransformBlock(null);

            ab.datai = (uint[])this.datai.Clone();
            foreach (AnimationAxisTransform aat in items)
            {
                ab.Add(aat.CloneBase());
            }

            ab.type = this.type;

            return(ab);
        }
Exemple #9
0
        public AnimationFrame AddFrame(short tc, short x, short y, short z, bool linear)
        {
            AnimationFrame af = new AnimationFrame(tc, TransformationType);

            //af.Blocks = new AnimationAxisTransform[AxisCount];
            for (int i = 0; i < AxisCount; i++)
            {
                AnimationAxisTransformBlock b   = AxisSet[i];
                AnimationAxisTransform      aat = b.Add(tc, GetAxisValue(i, x, y, z), 0, 0, linear);

                if (i < 4)
                {
                    af.Blocks[i] = aat;
                }
            }

            return(af);
        }
Exemple #10
0
        public AnimationFrame[] GetFrames(bool exludelocked)
        {
            ArrayList tclist = new ArrayList();
            Hashtable ht     = new Hashtable();
            ArrayList list   = new ArrayList();


            //get a List of all TimeCodes
            for (int i = 0; i < MaxAxisFrameCount; i++)
            {
                foreach (AnimationAxisTransformBlock ab in ab3)
                {
                    IntArrayList tcs = ab.GetTimeCodes(true, true);

                    if (ab.Locked && exludelocked && ab.Count <= 1)
                    {
                        tcs.Clear();
                    }
                    foreach (int rtc in tcs)
                    {
                        short tc = (short)rtc;
                        if (!tclist.Contains((short)tc))
                        {
                            tclist.Add(tc);
                            ht[tc] = new AnimationFrame(tc, this.TransformationType);
                        }
                    }
                }
            }

            tclist.Sort();
            for (int part = 0; part < ab3.Length; part++)
            {
                AnimationAxisTransformBlock ab = ab3[part];
                if (ab.Locked && exludelocked && ab.Count <= 1)
                {
                    continue;
                }

                for (int i = 0; i < ab.Count; i++)
                {
                    //if ((ab[i].Event && !events) || (!ab[i].Event && events)) continue;

                    short          tc = ab.GetTimeCode(i);
                    AnimationFrame af = (AnimationFrame)ht[tc];
                    if (af != null)
                    {
                        if (part == 0)
                        {
                            af.XBlock = ab[i];
                        }
                        else if (part == 1)
                        {
                            af.YBlock = ab[i];
                        }
                        else if (part == 2)
                        {
                            af.ZBlock = ab[i];
                        }
                    }
                }
            }

            //build ordered List
            foreach (short tc in tclist)
            {
                list.Add(ht[tc]);
            }


            AnimationFrame[] afs = new AnimationFrame[list.Count];
            list.CopyTo(afs);
            return(afs);
        }
Exemple #11
0
 internal void SetParent(AnimationAxisTransformBlock parent)
 {
     this.parent = parent;
 }
Exemple #12
0
 public AnimationAxisTransform(AnimationAxisTransformBlock parent) : this(parent, -1)
 {
 }