src/renderable/renderable.js
function (target) {
            var a = this.getBounds();
            var ax, ay;

            if (target instanceof me.Renderable) {
                var b = target.getBounds();
                ax = b.centerX - a.centerX;
                ay = b.centerY - a.centerY;
            } else { // vector object
                ax = target.x - a.centerX;
                ay = target.y - a.centerY;
            }

            return Math.atan2(ay, ax);
        }
function (target) {
            var a = this.getBounds();
            var ax, ay;

            if (target instanceof me.Renderable) {
                var b = target.getBounds();
                ax = b.centerX - a.centerX;
                ay = b.centerY - a.centerY;
            } else { // vector object
                ax = target.x - a.centerX;
                ay = target.y - a.centerY;
            }

            return Math.atan2(ay, ax);
        }
function ( target ) { var a = this . getBounds ( ) ; var ax , ay ; if ( target instanceof me . Renderable ) { var b = target . getBounds ( ) ; ax = b . centerX - a . centerX ; ay = b . centerY - a . centerY ; } else { // vector object ax = target . x - a . centerX ; ay = target . y - a . centerY ; } return Math . atan2 ( ay , ax ) ; }
return the angle to the specified target
@name angleTo
@memberOf me.Renderable
@function
@param {me.Renderable|me.Vector2d|me.Vector3d} target
@return {Number} angle in radians
return the angle to the specified target