Advertisement
asciicat

Face3D decompiled AS3

Aug 25th, 2012
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.company.assembleegameclient.engine3d
  2. {
  3.     import flash.display.GraphicsSolidFill;
  4.     import flash.display.BitmapData;
  5.     import __AS3__.vec.Vector;
  6.     import flash.display.GraphicsBitmapFill;
  7.     import flash.display.GraphicsPath;
  8.     import flash.geom.Vector3D;
  9.     import flash.display.GraphicsPathCommand;
  10.     import flash.geom.Utils3D;
  11.     import com.company.util._-G6;
  12.     import flash.display.IGraphicsData;
  13.     import com.company.assembleegameclient.map._-7Y;
  14.     import com.company.util._-dL;
  15.     import com.company.assembleegameclient.util.TextureRedrawer;
  16.     import __AS3__.vec.*;
  17.  
  18.     public class Face3D
  19.     {
  20.  
  21.         private static const _-RX:GraphicsSolidFill = new GraphicsSolidFill(0, 1);
  22.  
  23.         public var _-mo:BitmapData;
  24.         public var _-xa:Vector.<Number>;
  25.         public var _-Bb:Vector.<Number>;
  26.         public var vout_:Vector.<Number>;
  27.         public var _-RJ:Boolean;
  28.         public var _-dC:Number = 1;
  29.         public var _-03l:Boolean = false;
  30.         private var _-U1:Boolean = true;
  31.         private var _-ku:TextureMatrix = null;
  32.         public var bitmapFill_:GraphicsBitmapFill;
  33.         private var path_:GraphicsPath;
  34.  
  35.         public function Face3D(_arg1:BitmapData, _arg2:Vector.<Number>, _arg3:Vector.<Number>, _arg4:Boolean=false, _arg5:Boolean=false)
  36.         {
  37.             var _local7:Vector3D;
  38.             this.vout_ = new Vector.<Number>();
  39.             this.bitmapFill_ = new GraphicsBitmapFill(null, null, false, false);
  40.             this.path_ = new GraphicsPath(new Vector.<int>(), null);
  41.             super();
  42.             this._-mo = _arg1;
  43.             this._-xa = _arg2;
  44.             this._-Bb = _arg3;
  45.             this._-RJ = _arg4;
  46.             if (_arg5)
  47.             {
  48.                 _local7 = new Vector3D();
  49.                 _-aF._-Zs(_arg2, _local7);
  50.                 this._-dC = _-OC._-0-Z(_local7, 0.75);
  51.             };
  52.             this.path_.commands.push(GraphicsPathCommand.MOVE_TO);
  53.             var _local6:int = 3;
  54.             while (_local6 < this._-xa.length)
  55.             {
  56.                 this.path_.commands.push(GraphicsPathCommand.LINE_TO);
  57.                 _local6 = (_local6 + 3);
  58.             };
  59.             this.path_.data = this.vout_;
  60.         }
  61.  
  62.         public function dispose():void
  63.         {
  64.             this._-mo = null;
  65.             this._-xa = null;
  66.             this._-Bb = null;
  67.             this.vout_ = null;
  68.             this._-ku = null;
  69.             this.bitmapFill_ = null;
  70.             this.path_.commands = null;
  71.             this.path_.data = null;
  72.             this.path_ = null;
  73.         }
  74.  
  75.         public function _-0H2(_arg1:BitmapData):void
  76.         {
  77.             if (this._-mo == _arg1)
  78.             {
  79.                 return;
  80.             };
  81.             this._-mo = _arg1;
  82.             this._-U1 = true;
  83.         }
  84.  
  85.         public function _-Y2(_arg1:Vector.<Number>):void
  86.         {
  87.             this._-Bb = _arg1;
  88.             this._-U1 = true;
  89.         }
  90.  
  91.         public function _-eN():Number
  92.         {
  93.             var _local1:Number = -(Number.MAX_VALUE);
  94.             var _local2:int = this.vout_.length;
  95.             var _local3:int;
  96.             while (_local3 < _local2)
  97.             {
  98.                 if (this.vout_[(_local3 + 1)] > _local1)
  99.                 {
  100.                     _local1 = this.vout_[(_local3 + 1)];
  101.                 };
  102.                 _local3 = (_local3 + 2);
  103.             };
  104.             return (_local1);
  105.         }
  106.  
  107.         public function draw(_arg1:Vector.<IGraphicsData>, _arg2:_-7Y):Boolean
  108.         {
  109.             var _local10:Vector.<Number>;
  110.             var _local11:Number;
  111.             var _local12:Number;
  112.             var _local13:Number;
  113.             var _local14:Number;
  114.             var _local15:int;
  115.             Utils3D.projectVectors(_arg2.wToS_, this._-xa, this.vout_, this._-Bb);
  116.             if (this._-RJ)
  117.             {
  118.                 _local10 = this.vout_;
  119.                 _local11 = (_local10[2] - _local10[0]);
  120.                 _local12 = (_local10[3] - _local10[1]);
  121.                 _local13 = (_local10[4] - _local10[0]);
  122.                 _local14 = (_local10[5] - _local10[1]);
  123.                 if (((_local11 * _local14) - (_local12 * _local13)) > 0)
  124.                 {
  125.                     return (false);
  126.                 };
  127.             };
  128.             var _local3:Number = (_arg2._-xI.x - 10);
  129.             var _local4:Number = (_arg2._-xI.y - 10);
  130.             var _local5:Number = (_arg2._-xI.right + 10);
  131.             var _local6:Number = (_arg2._-xI.bottom + 10);
  132.             var _local7:Boolean = true;
  133.             var _local8:int = this.vout_.length;
  134.             var _local9:int;
  135.             while (_local9 < _local8)
  136.             {
  137.                 _local15 = (_local9 + 1);
  138.                 if ((((((((this.vout_[_local9] >= _local3)) && ((this.vout_[_local9] <= _local5)))) && ((this.vout_[_local15] >= _local4)))) && ((this.vout_[_local15] <= _local6))))
  139.                 {
  140.                     _local7 = false;
  141.                     break;
  142.                 };
  143.                 _local9 = (_local9 + 2);
  144.             };
  145.             if (_local7)
  146.             {
  147.                 return (false);
  148.             };
  149.             if (this._-03l)
  150.             {
  151.                 _arg1.push(_-RX);
  152.                 _arg1.push(this.path_);
  153.                 _arg1.push(_-G6.END_FILL);
  154.                 return (true);
  155.             };
  156.             if (this._-U1)
  157.             {
  158.                 this._-US();
  159.             };
  160.             this._-ku.calculateTextureMatrix(this.vout_);
  161.             this.bitmapFill_.bitmapData = this._-ku.texture_;
  162.             this.bitmapFill_.matrix = this._-ku.tToS_;
  163.             _arg1.push(this.bitmapFill_);
  164.             _arg1.push(this.path_);
  165.             _arg1.push(_-G6.END_FILL);
  166.             return (true);
  167.         }
  168.  
  169.         public function contains(_arg1:Number, _arg2:Number):Boolean
  170.         {
  171.             if (_-dL._-qL(this.vout_[0], this.vout_[1], this.vout_[2], this.vout_[3], this.vout_[4], this.vout_[5], _arg1, _arg2))
  172.             {
  173.                 return (true);
  174.             };
  175.             if ((((this.vout_.length == 8)) && (_-dL._-qL(this.vout_[0], this.vout_[1], this.vout_[4], this.vout_[5], this.vout_[6], this.vout_[7], _arg1, _arg2))))
  176.             {
  177.                 return (true);
  178.             };
  179.             return (false);
  180.         }
  181.  
  182.         private function _-US():void
  183.         {
  184.             var _local1:BitmapData = TextureRedrawer._-Qk(this._-mo, this._-dC);
  185.             if (this._-ku == null)
  186.             {
  187.                 this._-ku = new TextureMatrix(_local1, this._-Bb);
  188.             }
  189.             else
  190.             {
  191.                 this._-ku.texture_ = _local1;
  192.                 this._-ku._-xD(this._-Bb);
  193.             };
  194.             this._-U1 = false;
  195.         }
  196.  
  197.  
  198.     }
  199. }//package com.company.assembleegameclient.engine3d
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement