Exemple #1
0
        public Curve3 Clone()
        {
            var n     = new Curve3();
            var nKeys = new List <Key3>();

            foreach (var k in keys)
            {
                nKeys.Add(k.Clone());
            }
            n.keys = nKeys;
            return(n);
        }
Exemple #2
0
 public void SetCurve(Curve3 curve)
 {
     if (curve.Count > Count)
     {
         Clear();
         foreach (var key in curve)
         {
             Add(key.Clone());
         }
     }
     else
     {
         int i = 0;
         foreach (var key in curve.keys)
         {
             keys[i++].SetKey(key);
         }
     }
 }
Exemple #3
0
 public bool IsMirror(Curve3 c)
 {
     if (c == null)
     {
         return(false);
     }
     if (Count != c.Count)
     {
         return(false);
     }
     for (int i = 0; i < Count; i++)
     {
         if (!keys[i].vector.IsMirrorX(c.keys[i].vector) ||
             !keys[i].inTangent.IsMirrorX(c.keys[i].inTangent) ||
             !keys[i].outTangent.IsMirrorX(c.keys[i].outTangent) ||
             keys[i].inMode != c.keys[i].inMode ||
             keys[i].outMode != c.keys[i].outMode)
         {
             return(false);
         }
     }
     return(true);
 }
Exemple #4
0
 static Curve3()
 {
     t0v0_t1v0 = new Curve3(Vector3.zero, Vector3.forward,
                            Vector3.forward * 0.3333f,
                            Vector3.forward * 0.6667f);
 }