home *** CD-ROM | disk | FTP | other *** search
- class TargetMovieClipAngleCalculator
- {
- var mc;
- var mcTarget;
- function TargetMovieClipAngleCalculator(mc, mcTarget)
- {
- this.mc = mc;
- this.mcTarget = mcTarget;
- }
- function getTargetAngleRAD()
- {
- var _loc2_ = new Vector2D(new Point2D(this.mc._x,this.mc._y),new Point2D(this.mcTarget._x,this.mcTarget._y));
- return Math.atan2(_loc2_.getY(),_loc2_.getX());
- }
- function getTargetAngleDEG()
- {
- return this.getTargetAngleRAD() * 180 / 3.141592653589793;
- }
- function getTargetDistance()
- {
- var _loc2_ = new Vector2D(new Point2D(this.mc._x,this.mc._y),new Point2D(this.mcTarget._x,this.mcTarget._y));
- return _loc2_.getNorme();
- }
- }
-