private void translateRelative(SpriterAbstractObject
                                @object, SpriterAbstractObject parent)
 {
     @object.setAngle(@object.getAngle() * this.flippedX * this.flippedY + parent.getAngle()
                      );
     @object.setScaleX(@object.getScaleX() * parent.getScaleX());
     @object.setScaleY(@object.getScaleY() * parent.getScaleY());
     SpriterCalculator.translateRelative(parent, @object);
 }
 private void interpolateAbstractObject(SpriterAbstractObject
                                        target, SpriterAbstractObject obj1, SpriterAbstractObject
                                        obj2, float startTime, float endTime)
 {
     if (obj2 == null)
     {
         return;
     }
     target.setX(this.interpolate(obj1.getX(), obj2.getX(), startTime, endTime, this.frame
                                  ));
     target.setY(this.interpolate(obj1.getY(), obj2.getY(), startTime, endTime, this.frame
                                  ));
     target.setScaleX(this.interpolate(obj1.getScaleX(), obj2.getScaleX(), startTime,
                                       endTime, this.frame));
     target.setScaleY(this.interpolate(obj1.getScaleY(), obj2.getScaleY(), startTime,
                                       endTime, this.frame));
     target.setAngle(this.interpolateAngle(obj1.getAngle(), obj2.getAngle(), startTime
                                           , endTime, this.frame));
 }
        protected override void resolve(float x, float y, int chainLength, SpriterAbstractObject effector, SpriterAbstractPlayer player)
        {
            base.updateRecursively(player, effector);
            float xx = effector.getX() + (float)System.Math.Cos(SpriterCalculator.DegreeToRadian(effector
                                                                                                 .getAngle())) * Com.Brashmonkey.Spriter.draw.AbstractDrawer.BONE_LENGTH * effector
                       .getScaleX();
            float yy = effector.getY() + (float)System.Math.Sin(SpriterCalculator.DegreeToRadian(effector
                                                                                                 .getAngle())) * Com.Brashmonkey.Spriter.draw.AbstractDrawer.BONE_LENGTH * effector
                       .getScaleX();

            effector.setAngle(Com.Brashmonkey.Spriter.SpriterCalculator.angleBetween(effector
                                                                                     .getX(), effector.getY(), x, y));
            if (player.getFlipX() == -1)
            {
                effector.setAngle(effector.getAngle() + 180f);
            }
            SpriterBone parent = null;

            if (effector.hasParent())
            {
                parent = player.getRuntimeBones()[effector.getParentId()];
            }
            //effector.copyValuesTo(temp);
            //SpriterCalculator.reTranslateRelative(parent, temp);
            //if(effector instanceof SpriterBone)	temp.copyValuesTo(player.lastFrame.getBones()[effector.getId()]);
            //else temp.copyValuesTo(player.lastFrame.getObjects()[effector.getId()]);
            for (int i = 0; i < chainLength && parent != null; i++)
            {
                if (Com.Brashmonkey.Spriter.SpriterCalculator.distanceBetween(xx, yy, x, y) <= this
                    .tolerance)
                {
                    SpriterBone p = null;
                    if (parent.hasParent())
                    {
                        p = player.getRuntimeBones()[parent.getParentId()];
                    }
                    int j = 0;
                    while (p != null && j < chainLength)
                    {
                        base.updateRecursively(player, p);
                        if (p.hasParent())
                        {
                            p = player.getRuntimeBones()[p.getParentId()];
                        }
                        else
                        {
                            p = null;
                        }
                        j++;
                    }
                    return;
                }
                parent.setAngle(parent.getAngle() + Com.Brashmonkey.Spriter.SpriterCalculator.angleDifference
                                    (Com.Brashmonkey.Spriter.SpriterCalculator.angleBetween(parent.getX(), parent.getY
                                                                                                (), x, y), Com.Brashmonkey.Spriter.SpriterCalculator.angleBetween(parent.getX(),
                                                                                                                                                                  parent.getY(), xx, yy)));
                base.updateRecursively(player, parent);
                if (parent.hasParent())
                {
                    parent = player.getRuntimeBones()[parent.getParent().getId()];
                }
                else
                {
                    parent = null;
                }
                xx = effector.getX() + (float)System.Math.Cos(SpriterCalculator.DegreeToRadian(effector.getAngle
                                                                                                   ())) * Com.Brashmonkey.Spriter.draw.AbstractDrawer.BONE_LENGTH * effector.getScaleX
                         ();
                yy = effector.getY() + (float)System.Math.Sin(SpriterCalculator.DegreeToRadian(effector.getAngle
                                                                                                   ())) * Com.Brashmonkey.Spriter.draw.AbstractDrawer.BONE_LENGTH * effector.getScaleX
                         ();
            }
        }