예제 #1
0
        public virtual new CCActionInterval reverse()
        {
            CCPointArray cCPointArray        = this.m_pPoints.copy();
            CCPoint      controlPointAtIndex = cCPointArray.getControlPointAtIndex(0);

            for (int i = 1; i < cCPointArray.count(); i++)
            {
                CCPoint cCPoint = cCPointArray.getControlPointAtIndex(i);
                cCPointArray.replaceControlPoint(cCPoint.Sub(controlPointAtIndex), i);
                controlPointAtIndex = cCPoint;
            }
            CCPointArray cCPointArray1 = cCPointArray.reverse();

            controlPointAtIndex = cCPointArray1.getControlPointAtIndex(cCPointArray1.count() - 1);
            cCPointArray1.removeControlPointAtIndex(cCPointArray1.count() - 1);
            controlPointAtIndex = controlPointAtIndex.Neg();
            cCPointArray1.insertControlPoint(controlPointAtIndex, 0);
            for (int j = 1; j < cCPointArray1.count(); j++)
            {
                CCPoint controlPointAtIndex1 = cCPointArray1.getControlPointAtIndex(j);
                CCPoint cCPoint1             = controlPointAtIndex1.Neg().Add(controlPointAtIndex);
                cCPointArray1.replaceControlPoint(cCPoint1, j);
                controlPointAtIndex = cCPoint1;
            }
            return(CCCardinalSplineBy.create(this.m_fDuration, cCPointArray1, this.m_fTension));
        }
예제 #2
0
        public static new CCCardinalSplineBy create(float duration, CCPointArray points, float tension)
        {
            CCCardinalSplineBy cCCardinalSplineBy = new CCCardinalSplineBy();

            cCCardinalSplineBy.initWithDuration(duration, points, tension);
            return(cCCardinalSplineBy);
        }
예제 #3
0
        public static CCCatmullRomBy create(float dt, CCPointArray points)
        {
            CCCatmullRomBy cCCatmullRomBy = new CCCatmullRomBy();

            cCCatmullRomBy.initWithDuration(dt, points);
            return(cCCatmullRomBy);
        }
예제 #4
0
        /** creates an action with a Cardinal Spline array of points and tension */
        public static CCCardinalSplineTo create(float duration, CCPointArray points, float tension)
        {
            CCCardinalSplineTo ret = new CCCardinalSplineTo();

            ret.initWithDuration(duration, points, tension);
            return(ret);
        }
예제 #5
0
 public virtual bool initWithDuration(float dt, CCPointArray points)
 {
     if (base.initWithDuration(dt, points, 0.5f))
     {
         return(true);
     }
     return(false);
 }
예제 #6
0
        /** initializes the action with a duration and an array of points */
        public virtual bool initWithDuration(float dt, CCPointArray points)
        {
            if (base.initWithDuration(dt, points, 0.5f))
            {
                return true;
            }

            return false;
        }
예제 #7
0
 public virtual bool initWithDuration(float duration, CCPointArray points, float tension)
 {
     if (points == null || points.count() == 0)
     {
         return(false);
     }
     if (!base.initWithDuration(duration))
     {
         return(false);
     }
     this.setPoints(points);
     this.m_fTension = tension;
     return(true);
 }
예제 #8
0
        /** initializes the action with a duration and an array of points */
        public virtual bool initWithDuration(float duration, CCPointArray points, float tension)
        {
            if (points == null || points.count() == 0)
            {
                return (false);
            }
            if (base.initWithDuration(duration))
            {
                setPoints(points);
                m_fTension = tension;

                return true;
            }

            return false;
        }
예제 #9
0
        public virtual CCActionInterval reverse()
        {
            CCPointArray copyConfig = (CCPointArray)m_pPoints.copy();

            //
            // convert "absolutes" to "diffs"
            //
            CCPoint p = copyConfig.getControlPointAtIndex(0);

            for (int i = 1; i < copyConfig.count(); ++i)
            {
                CCPoint current = copyConfig.getControlPointAtIndex(i);
                CCPoint diff    = current - p;
                copyConfig.replaceControlPoint(diff, i);

                p = current;
            }


            // convert to "diffs" to "reverse absolute"

            CCPointArray pReverse = copyConfig.reverse();

            // 1st element (which should be 0,0) should be here too

            p = pReverse.getControlPointAtIndex(pReverse.count() - 1);
            pReverse.removeControlPointAtIndex(pReverse.count() - 1);

            p = -p;
            pReverse.insertControlPoint(p, 0);

            for (int i = 1; i < pReverse.count(); ++i)
            {
                CCPoint current = pReverse.getControlPointAtIndex(i);
                current = -current;
                CCPoint abs = current + p;
                pReverse.replaceControlPoint(abs, i);

                p = abs;
            }

            return(CCCardinalSplineBy.create(Duration, pReverse, m_fTension));
        }
예제 #10
0
 /** creates an action with a Cardinal Spline array of points and tension */
 public static CCCardinalSplineTo create(float duration, CCPointArray points, float tension)
 {
     CCCardinalSplineTo ret = new CCCardinalSplineTo();
     ret.initWithDuration(duration, points, tension);
     return ret;
 }
예제 #11
0
 /** creates an action with a Cardinal Spline array of points and tension
 @deprecated: This interface will be deprecated sooner or later.
 */
 public static new CCCardinalSplineTo actionWithDuration(float duration, CCPointArray points, float tension)
 {
     return CCCardinalSplineTo.create(duration, points, tension);
 }
예제 #12
0
 public CCPointArray copy()
 {
     CCPointArray copy = new CCPointArray(m_pControlPoints);
     return (copy);
 }
예제 #13
0
 /** creates an action with a Cardinal Spline array of points and tension
  * @deprecated: This interface will be deprecated sooner or later.
  */
 public static new CCCardinalSplineTo actionWithDuration(float duration, CCPointArray points, float tension)
 {
     return(CCCardinalSplineTo.create(duration, points, tension));
 }
예제 #14
0
 public virtual void setPoints(CCPointArray points)
 {
     m_pPoints = points;
 }
예제 #15
0
        public virtual CCActionInterval reverse()
        {
            CCPointArray pReverse = m_pPoints.reverse();

            return(CCCardinalSplineTo.create(m_fDuration, pReverse, m_fTension));
        }
예제 #16
0
        public virtual new CCActionInterval reverse()
        {
            CCPointArray cCPointArray = this.m_pPoints.reverse();

            return(CCCardinalSplineTo.create(this.m_fDuration, cCPointArray, this.m_fTension));
        }
예제 #17
0
 public static CCCatmullRomBy actionWithDuration(float dt, CCPointArray points)
 {
     return(CCCatmullRomBy.create(dt, points));
 }
예제 #18
0
 /** creates an action with a Cardinal Spline array of points and tension */
 public static CCCatmullRomBy create(float dt, CCPointArray points)
 {
     CCCatmullRomBy by = new CCCatmullRomBy();
     by.initWithDuration(dt, points);
     return (by);
 }
예제 #19
0
 /** creates an action with a Cardinal Spline array of points and tension 
 */
 public static CCCatmullRomBy actionWithDuration(float dt, CCPointArray points)
 {
     return CCCatmullRomBy.create(dt, points);
 }
예제 #20
0
 public virtual void setPoints(CCPointArray points)
 {
     m_pPoints = points;
 }
예제 #21
0
        public CCPointArray copy()
        {
            CCPointArray copy = new CCPointArray(m_pControlPoints);

            return(copy);
        }