Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company.assembleegameclient.engine3d
- {
- import flash.display.GraphicsSolidFill;
- import flash.display.BitmapData;
- import __AS3__.vec.Vector;
- import flash.display.GraphicsBitmapFill;
- import flash.display.GraphicsPath;
- import flash.geom.Vector3D;
- import flash.display.GraphicsPathCommand;
- import flash.geom.Utils3D;
- import com.company.util._-G6;
- import flash.display.IGraphicsData;
- import com.company.assembleegameclient.map._-7Y;
- import com.company.util._-dL;
- import com.company.assembleegameclient.util.TextureRedrawer;
- import __AS3__.vec.*;
- public class Face3D
- {
- private static const _-RX:GraphicsSolidFill = new GraphicsSolidFill(0, 1);
- public var _-mo:BitmapData;
- public var _-xa:Vector.<Number>;
- public var _-Bb:Vector.<Number>;
- public var vout_:Vector.<Number>;
- public var _-RJ:Boolean;
- public var _-dC:Number = 1;
- public var _-03l:Boolean = false;
- private var _-U1:Boolean = true;
- private var _-ku:TextureMatrix = null;
- public var bitmapFill_:GraphicsBitmapFill;
- private var path_:GraphicsPath;
- public function Face3D(_arg1:BitmapData, _arg2:Vector.<Number>, _arg3:Vector.<Number>, _arg4:Boolean=false, _arg5:Boolean=false)
- {
- var _local7:Vector3D;
- this.vout_ = new Vector.<Number>();
- this.bitmapFill_ = new GraphicsBitmapFill(null, null, false, false);
- this.path_ = new GraphicsPath(new Vector.<int>(), null);
- super();
- this._-mo = _arg1;
- this._-xa = _arg2;
- this._-Bb = _arg3;
- this._-RJ = _arg4;
- if (_arg5)
- {
- _local7 = new Vector3D();
- _-aF._-Zs(_arg2, _local7);
- this._-dC = _-OC._-0-Z(_local7, 0.75);
- };
- this.path_.commands.push(GraphicsPathCommand.MOVE_TO);
- var _local6:int = 3;
- while (_local6 < this._-xa.length)
- {
- this.path_.commands.push(GraphicsPathCommand.LINE_TO);
- _local6 = (_local6 + 3);
- };
- this.path_.data = this.vout_;
- }
- public function dispose():void
- {
- this._-mo = null;
- this._-xa = null;
- this._-Bb = null;
- this.vout_ = null;
- this._-ku = null;
- this.bitmapFill_ = null;
- this.path_.commands = null;
- this.path_.data = null;
- this.path_ = null;
- }
- public function _-0H2(_arg1:BitmapData):void
- {
- if (this._-mo == _arg1)
- {
- return;
- };
- this._-mo = _arg1;
- this._-U1 = true;
- }
- public function _-Y2(_arg1:Vector.<Number>):void
- {
- this._-Bb = _arg1;
- this._-U1 = true;
- }
- public function _-eN():Number
- {
- var _local1:Number = -(Number.MAX_VALUE);
- var _local2:int = this.vout_.length;
- var _local3:int;
- while (_local3 < _local2)
- {
- if (this.vout_[(_local3 + 1)] > _local1)
- {
- _local1 = this.vout_[(_local3 + 1)];
- };
- _local3 = (_local3 + 2);
- };
- return (_local1);
- }
- public function draw(_arg1:Vector.<IGraphicsData>, _arg2:_-7Y):Boolean
- {
- var _local10:Vector.<Number>;
- var _local11:Number;
- var _local12:Number;
- var _local13:Number;
- var _local14:Number;
- var _local15:int;
- Utils3D.projectVectors(_arg2.wToS_, this._-xa, this.vout_, this._-Bb);
- if (this._-RJ)
- {
- _local10 = this.vout_;
- _local11 = (_local10[2] - _local10[0]);
- _local12 = (_local10[3] - _local10[1]);
- _local13 = (_local10[4] - _local10[0]);
- _local14 = (_local10[5] - _local10[1]);
- if (((_local11 * _local14) - (_local12 * _local13)) > 0)
- {
- return (false);
- };
- };
- var _local3:Number = (_arg2._-xI.x - 10);
- var _local4:Number = (_arg2._-xI.y - 10);
- var _local5:Number = (_arg2._-xI.right + 10);
- var _local6:Number = (_arg2._-xI.bottom + 10);
- var _local7:Boolean = true;
- var _local8:int = this.vout_.length;
- var _local9:int;
- while (_local9 < _local8)
- {
- _local15 = (_local9 + 1);
- if ((((((((this.vout_[_local9] >= _local3)) && ((this.vout_[_local9] <= _local5)))) && ((this.vout_[_local15] >= _local4)))) && ((this.vout_[_local15] <= _local6))))
- {
- _local7 = false;
- break;
- };
- _local9 = (_local9 + 2);
- };
- if (_local7)
- {
- return (false);
- };
- if (this._-03l)
- {
- _arg1.push(_-RX);
- _arg1.push(this.path_);
- _arg1.push(_-G6.END_FILL);
- return (true);
- };
- if (this._-U1)
- {
- this._-US();
- };
- this._-ku.calculateTextureMatrix(this.vout_);
- this.bitmapFill_.bitmapData = this._-ku.texture_;
- this.bitmapFill_.matrix = this._-ku.tToS_;
- _arg1.push(this.bitmapFill_);
- _arg1.push(this.path_);
- _arg1.push(_-G6.END_FILL);
- return (true);
- }
- public function contains(_arg1:Number, _arg2:Number):Boolean
- {
- if (_-dL._-qL(this.vout_[0], this.vout_[1], this.vout_[2], this.vout_[3], this.vout_[4], this.vout_[5], _arg1, _arg2))
- {
- return (true);
- };
- 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))))
- {
- return (true);
- };
- return (false);
- }
- private function _-US():void
- {
- var _local1:BitmapData = TextureRedrawer._-Qk(this._-mo, this._-dC);
- if (this._-ku == null)
- {
- this._-ku = new TextureMatrix(_local1, this._-Bb);
- }
- else
- {
- this._-ku.texture_ = _local1;
- this._-ku._-xD(this._-Bb);
- };
- this._-U1 = false;
- }
- }
- }//package com.company.assembleegameclient.engine3d
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement