Beispiel #1
0
        // ===========================================================
        // Constants
        // ===========================================================

        // ===========================================================
        // Fields
        // ===========================================================

        // ===========================================================
        // Constructors
        // ===========================================================

        // ===========================================================
        // Getter & Setter
        // ===========================================================

        // ===========================================================
        // Methods for/from SuperClass/Interfaces
        // ===========================================================

        /**
         * Not tested for now!
         */
        // @Deprecated
        /// <summary>
        /// Deprecated and untested
        /// </summary>
        /// <param name="IShape"></param>
        public void setVelocityRespectingRotation(/* final */ IShape pShape, /* final */ float pVelocityX, /* final */ float pVelocityY)
        {
            /* final */
            float rotation = pShape.GetRotation();
            /* final */
            float rotationRad = MathUtils.DegToRad(rotation);

            /* final */
            float sin = FloatMath.Sin(rotationRad);
            /* final */
            float cos = FloatMath.Cos(rotationRad);

            /* final */
            float velocityX = sin * -pVelocityY + cos * pVelocityX;
            /* final */
            float velocityY = cos * pVelocityY + sin * pVelocityX;

            pShape.SetVelocity(velocityX, velocityY);
        }
Beispiel #2
0
        /**
         * Not tested for now!
         */
        //@Deprecated
        /// <summary>
        /// Decprecated and untested
        /// </summary>
        /// <param name="IShape"></param>
        public void accelerateRespectingRotation(/* final */ IShape pShape, /* final */ float pAccelerationX, /* final */ float pAccelerationY)
        {
            /* final */
            float rotation = pShape.GetRotation();
            /* final */
            float rotationRad = MathUtils.DegToRad(rotation);

            /* final */
            float sin = FloatMath.Sin(rotationRad);
            /* final */
            float cos = FloatMath.Cos(rotationRad);

            /* final */
            float accelerationX = sin * -pAccelerationY + cos * pAccelerationX;
            /* final */
            float accelerationY = cos * pAccelerationY + sin * pAccelerationX;

            pShape.SetAcceleration(accelerationX, accelerationY);
        }
Beispiel #3
0
 protected override void OnSetValues(IShape pShape, float pPercentageDone, float pScaleA, float pScaleB)
 {
     pShape.SetScale(pScaleA, pScaleB);
 }
Beispiel #4
0
        // ===========================================================
        // Getter & Setter
        // ===========================================================

        // ===========================================================
        // Methods for/from SuperClass/Interfaces
        // ===========================================================

        protected override void OnSetInitialValues(IShape pShape, float pScaleA, float pScaleB)
        {
            pShape.SetScale(pScaleA, pScaleB);
        }
Beispiel #5
0
 public void SetChaseShape(/* final */ IShape pChaseShape)
 {
     this.mChaseShape = pChaseShape;
 }