Section 1
//BaitContent (com.baitcontent.BaitContent)
package com.baitcontent {
import flash.display.*;
public class BaitContent extends MovieClip {
public var isNormal:Boolean;// = false
public static const ONFINISH:String = "onGameFinished";
public static const LOADCONTENT:String = "onContentToLoad";
public static const ONNEXTCHAPTER:String = "onNextChapter";
public static const PAUSED:String = "onGamePaused";
public function BaitContent(){
isNormal = false;
super();
}
public function destroy(){
}
public function setVolume(_arg1:Number){
}
public function resume(){
}
public function start(){
}
public function rewind(){
}
public function pause(){
}
}
}//package com.baitcontent
Section 2
//GameOver (com.baitcontent.GameOver)
package com.baitcontent {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class GameOver extends MovieClip {
public var panel:MovieClip;
private var glitch:GlitchEffect;
public var playNormal:RewindButton;
public var playHard:RewindButton;
public var infoText:MovieClip;
public var pic:MovieClip;
public var isNormal:Boolean;// = true
public var destoyed:Boolean;// = false
public var replayText:TextField;
public var skipGameButton:RewindButton;
public function GameOver(){
isNormal = true;
destoyed = false;
super();
pic = panel.pic;
infoText = panel.infoText;
playHard = panel.playHard;
replayText = panel.txt;
playHard.bt.txt.text = "HARD";
playNormal = panel.playNormal;
skipGameButton = panel.skipGameButton;
addEventListener(Event.ADDED_TO_STAGE, addedToStage, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, removeFromStage, false, 0, true);
glitch = new GlitchEffect(panel, "Lines");
}
public function destroy():void{
if (!destoyed){
destoyed = true;
glitch.stopGlitching();
glitch.kill();
playHard.removeEventListener(RewindButton.ONPRESSED, playAgainHard);
playNormal.removeEventListener(RewindButton.ONPRESSED, playAgain);
skipGameButton.removeEventListener(RewindButton.ONPRESSED, skipGame);
};
}
public function init(_arg1:Boolean, _arg2:Boolean=false):void{
glitch.startGlitching();
if (_arg1){
pic.gotoAndStop(1);
infoText.gotoAndStop(1);
replayText.text = "PLAY AGAIN?";
if (_arg2){
skipGameButton.setFrame(3);
} else {
skipGameButton.setFrame(1);
};
} else {
pic.gotoAndStop(2);
infoText.gotoAndStop(2);
replayText.text = "TRY AGAIN?";
if (_arg2){
skipGameButton.setFrame(3);
} else {
skipGameButton.setFrame(2);
};
};
}
protected function addedToStage(_arg1:Event):void{
playHard.addEventListener(RewindButton.ONPRESSED, playAgainHard, false, 0, true);
playNormal.addEventListener(RewindButton.ONPRESSED, playAgain, false, 0, true);
skipGameButton.addEventListener(RewindButton.ONPRESSED, skipGame, false, 0, true);
}
public function skipGame(_arg1:Event):void{
playHard.removeEventListener(RewindButton.ONPRESSED, playAgainHard);
playNormal.removeEventListener(RewindButton.ONPRESSED, playAgain);
skipGameButton.removeEventListener(RewindButton.ONPRESSED, skipGame);
dispatchEvent(new Event("skipGame"));
}
protected function removeFromStage(_arg1:Event):void{
if (!destoyed){
glitch.stopGlitching();
};
}
public function playAgainHard(_arg1:Event):void{
isNormal = false;
playHard.removeEventListener(RewindButton.ONPRESSED, playAgainHard);
playNormal.removeEventListener(RewindButton.ONPRESSED, playAgain);
skipGameButton.removeEventListener(RewindButton.ONPRESSED, skipGame);
dispatchEvent(new Event("playAgain"));
}
public function playAgain(_arg1:Event):void{
isNormal = true;
playHard.removeEventListener(RewindButton.ONPRESSED, playAgainHard);
playNormal.removeEventListener(RewindButton.ONPRESSED, playAgain);
skipGameButton.removeEventListener(RewindButton.ONPRESSED, skipGame);
dispatchEvent(new Event("playAgain"));
}
}
}//package com.baitcontent
Section 3
//GlitchEffect (com.baitcontent.GlitchEffect)
package com.baitcontent {
import flash.events.*;
import com.tweener.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import com.blocmedia.utils.*;
import flash.text.*;
public class GlitchEffect extends Shape {
private var isDisplaceing:Boolean;// = true
private var target:DisplayObject;
private var glow:GlowFilter;
private var isDead:Boolean;// = false
private var count:Number;// = 0
public var yMod:Number;// = 0
private var map:DisplacementMapFilter;
private var glitchMap:BitmapData;
public var xMod:Number;// = 0
private var filter:Bitmap;
public function GlitchEffect(_arg1:DisplayObject, _arg2:String){
var _local3:Class;
var _local4:*;
count = 0;
isDisplaceing = true;
xMod = 0;
yMod = 0;
isDead = false;
super();
target = _arg1;
_local3 = (getDefinitionByName(_arg2) as Class);
glitchMap = new _local3(0, 0);
_local4 = new BlurFilter(4, 4, 1);
glitchMap.applyFilter(glitchMap, glitchMap.rect, new Point(0, 0), _local4);
map = new DisplacementMapFilter(glitchMap, new Point(0, 0), 2, 2, xMod, yMod, "wrap", 0, 0);
glow = new GlowFilter(4324863);
glow.blurX = 15;
glow.blurY = 15;
glow.strength = 1;
}
private function onGlitchComplete(){
isDisplaceing = false;
}
public function stopGlitching(){
if (!isDead){
removeEventListener(Event.ENTER_FRAME, update);
if (target){
if (target.filters){
target.filters = [];
};
};
};
}
private function update(_arg1:Event){
var _local2:*;
target.alpha = (target.alpha + (((0.5 + (Math.random() * 0.5)) - target.alpha) / 5));
if ((isDisplaceing = true)){
count++;
_local2 = Math2.convert(Math.sin((count / 5)), -1, 1, 0, 8);
map.scaleX = xMod;
map.scaleY = yMod;
target.filters = [map];
if (count == 100){
sendShock(50);
count = 0;
};
};
}
public function startGlitching(){
addEventListener(Event.ENTER_FRAME, update, false, 0, true);
}
public function kill(){
isDead = true;
removeEventListener(Event.ENTER_FRAME, update);
target.filters = [];
glitchMap.dispose();
map = null;
glow = null;
filter = null;
target = null;
}
function goBack(){
Tweener.tween(this, "xMod", 0, 0.2, "easeOutSine");
Tweener.tween(this, "yMod", 0, 0.2, "easeOutSine", 0, {onFinish:onGlitchComplete});
}
public function sendShock(_arg1:Number){
isDisplaceing = true;
Tweener.tween(this, "xMod", Math2.random(-(_arg1), _arg1), 0.15, "easeOutSine");
Tweener.tween(this, "yMod", Math2.random(-(_arg1), _arg1), 0.15, "easeOutSine", 0, {onFinish:goBack});
}
}
}//package com.baitcontent
Section 4
//RewindButton (com.baitcontent.RewindButton)
package com.baitcontent {
import flash.events.*;
import flash.media.*;
import com.tweener.*;
import flash.display.*;
import com.blocmedia.media.*;
public dynamic class RewindButton extends MovieClipPlus {
private var isOver:Boolean;
public var inner:MovieClip;
public var hit:Sprite;
public static const ONPRESSED:String = "onButtonPressed";
public function RewindButton():void{
stop();
if (hit == null){
hit = this;
};
hit.buttonMode = true;
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, onRemovedToStage, false, 0, true);
hit.addEventListener(MouseEvent.MOUSE_OVER, onOverCache, false, 0, true);
hit.addEventListener(MouseEvent.MOUSE_OUT, onOutCache, false, 0, true);
}
private function onOverCache(_arg1:Event){
isOver = true;
}
public function setFrame(_arg1:int){
inner.inner.gotoAndStop(_arg1);
}
private function onDown(_arg1:Event){
}
public function set text(_arg1:String){
inner.inner.txt.text = _arg1;
}
private function onOver(_arg1:Event){
var _local2:Sound;
_local2 = new RollFx();
_local2.play();
isOver = true;
playAt(1);
}
override public function set enabled(_arg1:Boolean):void{
if (_arg1 != enabled){
super.enabled = _arg1;
hit.buttonMode = _arg1;
if (_arg1){
if (stage != null){
hit.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
hit.addEventListener(MouseEvent.MOUSE_OUT, onOut, false, 0, true);
hit.addEventListener(MouseEvent.MOUSE_DOWN, onDown, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, onUp, false, 0, true);
hit.addEventListener(MouseEvent.MOUSE_UP, onUp, false, 0, true);
};
Tweener.tween(this, "alpha", 1, 0.5, "easeOutSine");
if (isOver){
playAt(1);
};
} else {
playAt(-1);
if (stage != null){
hit.removeEventListener(MouseEvent.MOUSE_OVER, onOver);
hit.removeEventListener(MouseEvent.MOUSE_OUT, onOut);
hit.removeEventListener(MouseEvent.MOUSE_DOWN, onDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, onUp);
hit.removeEventListener(MouseEvent.MOUSE_UP, onUp);
};
Tweener.tween(this, "alpha", 0.5, 0.5, "easeOutSine");
};
};
}
private function onRemovedToStage(_arg1:Event){
hit.removeEventListener(MouseEvent.MOUSE_OVER, onOver);
hit.removeEventListener(MouseEvent.MOUSE_OUT, onOut);
hit.removeEventListener(MouseEvent.MOUSE_DOWN, onDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, onUpOutSide);
hit.removeEventListener(MouseEvent.MOUSE_UP, onUp);
}
private function onAddedToStage(_arg1:Event){
if (enabled){
hit.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
hit.addEventListener(MouseEvent.MOUSE_OUT, onOut, false, 0, true);
hit.addEventListener(MouseEvent.MOUSE_DOWN, onDown, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, onUpOutSide, false, 0, true);
hit.addEventListener(MouseEvent.MOUSE_UP, onUp, false, 0, true);
};
}
private function onUpOutSide(_arg1:Event){
}
private function onOutCache(_arg1:Event){
isOver = false;
}
private function onUp(_arg1:Event){
var _local2:Sound;
if (isOver){
_local2 = new CloseFx();
_local2.play();
playAt(-1);
dispatchEvent(new Event(ONPRESSED));
};
}
private function onOut(_arg1:Event){
isOver = false;
playAt(-1);
}
}
}//package com.baitcontent
Section 5
//Base (com.baitgames.towerdefense.papervisionmodels.Base)
package com.baitgames.towerdefense.papervisionmodels {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.geom.*;
public class Base extends TriangleMesh3D {
private var ve:Array;
private var fa:Array;
public function Base(_arg1:MaterialObject3D, _arg2:Object=null){
super(_arg1, new Array(), new Array(), null, _arg2);
ve = this.geometry.vertices;
fa = this.geometry.faces;
v(2, 0, -2);
v(2, 1, -2);
v(-2, 1, -2);
v(-2, 0, -2);
v(-2, 0, 2);
v(2, 0, 2);
v(2, 1, 2);
v(-2, 1, 2);
f(0, 1, 2, 0.710711, 0.404713, 0.710472, 0.502227, 0.320753, 0.502474, 0, -1, 0);
f(0, 2, 3, 0.710711, 0.404713, 0.320753, 0.502474, 0.320807, 0.404691, 0, -1, 0);
f(5, 0, 4, 0.710803, 0.0149, 0.710711, 0.404713, 0.320944, 0.0149, 0, 0, -1);
f(4, 0, 3, 0.320944, 0.0149, 0.710711, 0.404713, 0.320807, 0.404691, 0, 0, -1);
f(1, 0, 6, 0.710472, 0.502227, 0.807951, 0.502151, 0.710692, 0.892576, 1, 0, 0);
f(6, 0, 5, 0.710692, 0.892576, 0.807951, 0.502151, 0.80795, 0.89201, 1, 0, 0);
f(6, 7, 2, 0.710692, 0.892576, 0.320795, 0.89247, 0.320753, 0.502474, 0, 0, 1);
f(2, 1, 6, 0.320753, 0.502474, 0.710472, 0.502227, 0.710692, 0.892576, 0, 0, 1);
f(6, 5, 4, 0.710692, 0.892576, 0.710829, 0.9902, 0.320971, 0.9902, 0, 1, 0);
f(6, 4, 7, 0.710692, 0.892576, 0.320971, 0.9902, 0.320795, 0.89247, 0, 1, 0);
f(2, 7, 4, 0.320753, 0.502474, 0.320795, 0.89247, 0.223378, 0.892381, -1, 0, 0);
f(2, 4, 3, 0.320753, 0.502474, 0.223378, 0.892381, 0.223378, 0.502523, -1, 0, 0);
this.x = 0;
this.y = 0;
this.z = 0;
this.rotationX = 0;
this.rotationY = 0;
this.rotationZ = 0;
this.scaleX = 1;
this.scaleY = 1;
this.scaleZ = 1;
this.geometry.ready = true;
}
public function f(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:Number):void{
var _local13:Triangle3D;
_local13 = new Triangle3D(this, [ve[_arg1], ve[_arg2], ve[_arg3]], null, [new NumberUV(_arg4, _arg5), new NumberUV(_arg6, _arg7), new NumberUV(_arg8, _arg9)]);
_local13.faceNormal = new Number3D(_arg10, _arg11, _arg12);
fa.push(_local13);
}
public function f2(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Triangle3D;
_local4 = new Triangle3D(this, [ve[_arg1], ve[_arg2], ve[_arg3]], null, []);
fa.push(_local4);
}
public function v(_arg1:Number, _arg2:Number, _arg3:Number):void{
ve.push(new Vertex3D(_arg1, _arg2, _arg3));
}
}
}//package com.baitgames.towerdefense.papervisionmodels
Section 6
//Laser (com.baitgames.towerdefense.papervisionmodels.Laser)
package com.baitgames.towerdefense.papervisionmodels {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.geom.*;
public class Laser extends TriangleMesh3D {
private var ve:Array;
private var fa:Array;
public function Laser(_arg1:MaterialObject3D, _arg2:Object=null){
super(_arg1, new Array(), new Array(), null, _arg2);
ve = this.geometry.vertices;
fa = this.geometry.faces;
v(0.238259, 1.673571, -1.500002);
v(-0.23826, 1.674045, -1.048746);
v(-0.23826, 1.673571, -1.500002);
v(0.238259, 1.67395, -1.048768);
v(0.238259, 1.67395, 1.072819);
v(-0.23826, 1.673571, 1.500002);
v(-0.23826, 1.674045, 1.072797);
v(0.238259, 1.673571, 1.500002);
v(0.238259, 2.186769, 1.500002);
v(0.238259, 2.186769, 0.629066);
v(-0.23826, 2.186769, 1.500002);
v(-0.23826, 2.186769, -1.500002);
v(-0.23826, 2.186769, -0.605014);
v(-0.23826, 2.186769, 0.629066);
v(0.238259, 2.186769, -1.500002);
v(0.238259, 2.186769, -0.605015);
v(-0.707109, 2.192158, 0.012025);
v(0, 2.381626, 0.012025);
v(-0.353555, 2.192158, -0.600348);
v(0.353555, 2.192158, -0.600348);
v(0.707109, 2.192158, 0.012026);
v(0.353554, 2.192158, 0.624399);
v(-0.353555, 2.192158, 0.624398);
v(-0.612374, 1.67452, -1.048636);
v(-1.224749, 1.67452, 0.012025);
v(0.612375, 1.67452, -1.048636);
v(1.224749, 1.67452, 0.012026);
v(0.612374, 1.67452, 1.072687);
v(-0.612375, 1.67452, 1.072687);
v(-0.707109, 0.967413, -1.212721);
v(-1.414218, 0.967413, 0.012025);
v(0.707109, 0.967413, -1.212721);
v(1.414218, 0.967413, 0.012026);
v(0.707109, 0.967413, 1.236772);
v(-0.707109, 0.967413, 1.236772);
f(0, 1, 2, 0.50637, 0.094685, 0.58308, 0.022152, 0.583189, 0.094552, 0, -0.00105, 0.999999);
f(0, 3, 1, 0.50637, 0.094685, 0.50637, 0.022152, 0.58308, 0.022152, 0.000199, -0.00084, 1);
f(4, 5, 6, 0.770783, 0.376031, 0.847711, 0.30713, 0.847494, 0.376031, 0.000199, 0.001109, 0.999999);
f(4, 7, 5, 0.770783, 0.376031, 0.77095, 0.30719, 0.847711, 0.30713, 0, 0.000887, 1);
f(8, 4, 9, 0.771071, 0.224558, 0.702236, 0.307095, 0.630804, 0.224556, -1, 0, 0);
f(8, 7, 4, 0.771071, 0.224558, 0.77095, 0.30719, 0.702236, 0.307095, -1, 0, 0);
f(5, 8, 10, 0.847711, 0.30713, 0.771071, 0.224558, 0.847791, 0.224514, 0, -1, 0);
f(5, 7, 8, 0.847711, 0.30713, 0.77095, 0.30719, 0.771071, 0.224558, 0, -1, 0);
f(11, 1, 12, 0.583116, 0.177272, 0.655906, 0.094493, 0.727338, 0.177032, 1, 0, 0);
f(11, 2, 1, 0.583116, 0.177272, 0.583189, 0.094552, 0.655906, 0.094493, 1, 0, 0);
f(13, 8, 9, 0.847795, 0.084372, 0.771071, 0.224558, 0.771085, 0.084372, 0, 0, -1);
f(13, 10, 8, 0.847795, 0.084372, 0.847791, 0.224514, 0.771071, 0.224558, 0, 0, -1);
f(11, 0, 2, 0.583116, 0.177272, 0.50637, 0.094685, 0.583189, 0.094552, 0, 1, 0);
f(14, 0, 11, 0.506333, 0.177355, 0.50637, 0.094685, 0.583116, 0.177272, 0, 1, 0);
f(15, 3, 14, 0.362151, 0.177461, 0.433584, 0.094923, 0.506333, 0.177355, -1, 0, 0);
f(3, 0, 14, 0.433584, 0.094923, 0.50637, 0.094685, 0.506333, 0.177355, -1, 0, 0);
f(13, 6, 10, 0.987999, 0.224425, 0.916567, 0.306963, 0.847791, 0.224514, 1, 0, 0);
f(6, 5, 10, 0.916567, 0.306963, 0.847711, 0.30713, 0.847791, 0.224514, 1, 0, 0);
f(11, 15, 14, 0.583116, 0.177272, 0.506344, 0.321452, 0.506333, 0.177355, 0, 0, -1);
f(11, 12, 15, 0.583116, 0.177272, 0.583054, 0.321452, 0.506344, 0.321452, 0, 0, -1);
f(16, 17, 18, 0.768783, 0.589284, 0.818021, 0.68175, 0.867515, 0.589432, 0.255975, 0.147787, -0.95532);
f(17, 19, 18, 0.252537, 0.994041, 0.309505, 0.895423, 0.195678, 0.895421, 0, 0.295575, -0.955319);
f(17, 20, 19, 0.60814, 0.970397, 0.657378, 0.884821, 0.558646, 0.884968, -0.255975, 0.147787, -0.95532);
f(21, 20, 17, 0.82749, 0.884658, 0.729303, 0.884493, 0.778254, 0.969608, -0.255975, -0.147788, -0.95532);
f(22, 21, 17, 0.195925, 0.109374, 0.309759, 0.109381, 0.252885, 0.010914, 0, -0.295575, -0.95532);
f(22, 17, 16, 0.598671, 0.589122, 0.647907, 0.680961, 0.696858, 0.588956, 0.255975, -0.147787, -0.95532);
f(23, 16, 18, 0.903783, 0.526844, 0.768783, 0.589284, 0.867515, 0.589432, 0.654653, 0.377965, -0.654654);
f(23, 24, 16, 0.903783, 0.526844, 0.732812, 0.526661, 0.768783, 0.589284, 0.654652, 0.377965, -0.654655);
f(19, 20, 25, 0.558646, 0.884968, 0.657378, 0.884821, 0.522378, 0.822381, -0.654653, 0.377964, -0.654654);
f(20, 26, 25, 0.657378, 0.884821, 0.693349, 0.822198, 0.522378, 0.822381, -0.654652, 0.377964, -0.654655);
f(20, 21, 26, 0.729303, 0.884493, 0.82749, 0.884658, 0.693349, 0.822198, -0.654652, -0.377965, -0.654655);
f(21, 27, 26, 0.82749, 0.884658, 0.863643, 0.82233, 0.693349, 0.822198, -0.654652, -0.377965, -0.654655);
f(24, 22, 16, 0.732812, 0.526661, 0.598671, 0.589122, 0.696858, 0.588956, 0.654652, -0.377964, -0.654655);
f(24, 28, 22, 0.732812, 0.526661, 0.562518, 0.526794, 0.598671, 0.589122, 0.654652, -0.377964, -0.654655);
f(24, 29, 30, 0.732812, 0.526661, 0.930231, 0.412968, 0.733113, 0.412895, 0.84361, 0.487059, -0.226045);
f(24, 23, 29, 0.732812, 0.526661, 0.903783, 0.526844, 0.930231, 0.412968, 0.843609, 0.48706, -0.226046);
f(25, 26, 31, 0.522378, 0.822381, 0.693349, 0.822198, 0.49593, 0.708504, -0.84361, 0.487059, -0.226044);
f(26, 32, 31, 0.693349, 0.822198, 0.693048, 0.708431, 0.49593, 0.708504, -0.84361, 0.487059, -0.226045);
f(33, 26, 27, 0.890166, 0.708358, 0.693349, 0.822198, 0.863643, 0.82233, -0.843609, -0.48706, -0.226046);
f(33, 32, 26, 0.890166, 0.708358, 0.693048, 0.708431, 0.693349, 0.822198, -0.84361, -0.487059, -0.226045);
f(30, 34, 24, 0.733113, 0.412895, 0.535995, 0.412822, 0.732812, 0.526661, 0.84361, -0.487059, -0.226045);
f(34, 28, 24, 0.535995, 0.412822, 0.562518, 0.526794, 0.732812, 0.526661, 0.84361, -0.487059, -0.226044);
f(34, 6, 28, 0.139261, 0.306509, 0.214474, 0.192749, 0.154249, 0.192673, -1E-6, -0.974117, -0.226045);
f(34, 4, 6, 0.139261, 0.306509, 0.291184, 0.192749, 0.214474, 0.192749, 0, -0.974117, -0.226045);
f(34, 27, 4, 0.139261, 0.306509, 0.351409, 0.192673, 0.291184, 0.192749, 1E-6, -0.974117, -0.226046);
f(34, 33, 27, 0.139261, 0.306509, 0.366246, 0.306507, 0.351409, 0.192673, 0, -0.974117, -0.226045);
f(23, 1, 29, 0.154028, 0.812081, 0.214253, 0.812005, 0.139187, 0.698562, -1E-6, 0.974117, -0.226045);
f(1, 3, 29, 0.214253, 0.812005, 0.290963, 0.812005, 0.139187, 0.698562, 0, 0.974117, -0.226045);
f(3, 25, 29, 0.290963, 0.812005, 0.351188, 0.812081, 0.139187, 0.698562, 1E-6, 0.974117, -0.226046);
f(25, 31, 29, 0.351188, 0.812081, 0.366136, 0.698484, 0.139187, 0.698562, 0, 0.974117, -0.226045);
f(28, 6, 22, 0.154249, 0.192673, 0.214474, 0.192749, 0.195925, 0.109374, -0.000609, -0.756078, -0.654481);
f(6, 13, 22, 0.214474, 0.192749, 0.214474, 0.11021, 0.195925, 0.109374, 2.7E-5, -0.756149, -0.6544);
f(13, 9, 22, 0.214474, 0.11021, 0.291184, 0.110211, 0.195925, 0.109374, 0, -0.755859, -0.654734);
f(9, 21, 22, 0.291184, 0.110211, 0.309759, 0.109381, 0.195925, 0.109374, 1E-6, -0.755918, -0.654666);
f(4, 21, 9, 0.291184, 0.192749, 0.309759, 0.109381, 0.291184, 0.110211, -2.5E-5, -0.756193, -0.654349);
f(4, 27, 21, 0.291184, 0.192749, 0.351409, 0.192673, 0.309759, 0.109381, 0.000731, -0.756109, -0.654445);
f(18, 1, 23, 0.195678, 0.895421, 0.214253, 0.812005, 0.154028, 0.812081, -0.000609, 0.756079, -0.65448);
f(18, 12, 1, 0.195678, 0.895421, 0.214253, 0.894543, 0.214253, 0.812005, 1.4E-5, 0.756148, -0.654401);
f(18, 15, 12, 0.195678, 0.895421, 0.290963, 0.894543, 0.214253, 0.894543, 2E-6, 0.756012, -0.654558);
f(18, 19, 15, 0.195678, 0.895421, 0.309505, 0.895423, 0.290963, 0.894543, 0, 0.755929, -0.654653);
f(15, 19, 3, 0.290963, 0.894543, 0.309505, 0.895423, 0.290963, 0.812005, -2.5E-5, 0.756193, -0.654349);
f(19, 25, 3, 0.309505, 0.895423, 0.351188, 0.812081, 0.290963, 0.812005, 0.00073, 0.756109, -0.654445);
f(34, 30, 32, 0.139261, 0.306509, 0.026171, 0.502613, 0.479053, 0.502613, 0, 0, 1);
f(32, 30, 29, 0.479053, 0.502613, 0.026171, 0.502613, 0.139187, 0.698562, 0, 0, 1);
f(34, 32, 33, 0.139261, 0.306509, 0.479053, 0.502613, 0.366246, 0.306507, 0, 0, 1);
f(32, 29, 31, 0.479053, 0.502613, 0.139187, 0.698562, 0.366136, 0.698484, 0, 0, 1);
this.x = 0;
this.y = 0;
this.z = 0;
this.rotationX = 0;
this.rotationY = 0;
this.rotationZ = 0;
this.scaleX = 1;
this.scaleY = 1;
this.scaleZ = 1;
this.geometry.ready = true;
}
public function f(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:Number):void{
var _local13:Triangle3D;
_local13 = new Triangle3D(this, [ve[_arg1], ve[_arg2], ve[_arg3]], null, [new NumberUV(_arg4, _arg5), new NumberUV(_arg6, _arg7), new NumberUV(_arg8, _arg9)]);
_local13.faceNormal = new Number3D(_arg10, _arg11, _arg12);
fa.push(_local13);
}
public function f2(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Triangle3D;
_local4 = new Triangle3D(this, [ve[_arg1], ve[_arg2], ve[_arg3]], null, []);
fa.push(_local4);
}
public function v(_arg1:Number, _arg2:Number, _arg3:Number):void{
ve.push(new Vertex3D(_arg1, _arg2, _arg3));
}
}
}//package com.baitgames.towerdefense.papervisionmodels
Section 7
//MissileModel (com.baitgames.towerdefense.papervisionmodels.MissileModel)
package com.baitgames.towerdefense.papervisionmodels {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.geom.*;
public class MissileModel extends TriangleMesh3D {
private var ve:Array;
private var fa:Array;
public function MissileModel(_arg1:MaterialObject3D, _arg2:Object=null){
super(_arg1, new Array(), new Array(), null, _arg2);
ve = this.geometry.vertices;
fa = this.geometry.faces;
v(1.901677, 1.252457, 0);
v(-1.098322, 0.750006, -0.866025);
v(-1.098322, 2.250005, 0);
v(-1.098322, 0.750005, 0.866025);
v(-1.098322, 1.019784, 0.432823);
v(-1.901677, 1.270419, 0);
v(-1.098322, 1.019784, -0.432824);
v(-1.098322, 1.769455, 0);
f(0, 1, 2, 0.782192, 0.992982, 0.475243, 0.621399, 0.680654, 0.502785, -0.164007, 0.854299, -0.49323);
f(0, 3, 1, 0.064051, 0.502875, 0.47523, 0.384301, 0.475243, 0.621399, -0.165183, 1E-6, 0.986263);
f(3, 0, 2, 0.47523, 0.384301, 0.780757, 0.011279, 0.680654, 0.502785, -0.164007, -0.854299, -0.493229);
f(4, 5, 6, 0.474054, 0.952915, 0.263195, 0.839456, 0.474054, 0.725948, 0.297827, 0, 0.95462);
f(7, 6, 5, 0.052791, 0.970578, 0.052791, 0.774019, 0.263195, 0.839456, 0.296618, 0.827051, -0.477499);
f(5, 4, 7, 0.263195, 0.839456, 0.197025, 0.628568, 0.393585, 0.628568, 0.296617, -0.827051, -0.477498);
f(1, 6, 2, 0.475243, 0.621399, 0.512138, 0.56215, 0.680654, 0.502785, 1, 0, 0);
f(2, 6, 7, 0.680654, 0.502785, 0.512138, 0.56215, 0.614737, 0.502915, 1, 0, 0);
f(1, 3, 6, 0.475243, 0.621399, 0.47523, 0.384301, 0.512138, 0.56215, 1, 0, 0);
f(6, 3, 4, 0.512138, 0.56215, 0.47523, 0.384301, 0.512138, 0.44368, 1, 0, 0);
f(3, 2, 4, 0.47523, 0.384301, 0.680654, 0.502785, 0.512138, 0.44368, 1, 0, 0);
f(4, 2, 7, 0.512138, 0.44368, 0.680654, 0.502785, 0.614737, 0.502915, 1, 0, 0);
this.x = 0;
this.y = 0;
this.z = 0;
this.rotationX = 0;
this.rotationY = 0;
this.rotationZ = 0;
this.scaleX = 1;
this.scaleY = 1;
this.scaleZ = 1;
this.geometry.ready = true;
}
public function f(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:Number):void{
var _local13:Triangle3D;
_local13 = new Triangle3D(this, [ve[_arg1], ve[_arg2], ve[_arg3]], null, [new NumberUV(_arg4, _arg5), new NumberUV(_arg6, _arg7), new NumberUV(_arg8, _arg9)]);
_local13.faceNormal = new Number3D(_arg10, _arg11, _arg12);
fa.push(_local13);
}
public function f2(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Triangle3D;
_local4 = new Triangle3D(this, [ve[_arg1], ve[_arg2], ve[_arg3]], null, []);
fa.push(_local4);
}
public function v(_arg1:Number, _arg2:Number, _arg3:Number):void{
ve.push(new Vertex3D(_arg1, _arg2, _arg3));
}
}
}//package com.baitgames.towerdefense.papervisionmodels
Section 8
//MissileRack (com.baitgames.towerdefense.papervisionmodels.MissileRack)
package com.baitgames.towerdefense.papervisionmodels {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.geom.*;
public class MissileRack extends TriangleMesh3D {
private var ve:Array;
private var fa:Array;
public function MissileRack(_arg1:MaterialObject3D, _arg2:Object=null){
super(_arg1, new Array(), new Array(), null, _arg2);
ve = this.geometry.vertices;
fa = this.geometry.faces;
v(-0.115, 3.065211, -1.163588);
v(-0.115, 1.469594, 1.163588);
v(-0.115, 3.065211, 1.163588);
v(-0.115, 1.469594, -1.163588);
v(0.115, 3.065211, 1.163588);
v(0.115, 3.065211, -1.163588);
v(0.115, 1.469594, -1.163588);
v(0.115, 1.469594, 1.163588);
v(-1.163588, 1.469594, -1.163588);
v(-1.163588, 1.469594, 1.163588);
v(1.163588, 0.700828, -1.163588);
v(-1.163588, 0.700828, 1.163588);
v(-1.163588, 0.700828, -1.163588);
v(1.163588, 0.700828, 1.163588);
v(1.163588, 1.469594, 1.163588);
v(1.163588, 1.469594, -1.163588);
f(0, 1, 2, 0.433335, 0.720689, 0.676147, 0.554181, 0.676147, 0.720642, 1, 0, 0);
f(0, 3, 1, 0.433335, 0.720689, 0.433325, 0.554245, 0.676147, 0.554181, 1, 0, 0);
f(0, 4, 5, 0.409037, 0.744533, 0.16629, 0.720657, 0.409204, 0.720656, 0, 0, -1);
f(0, 2, 4, 0.409037, 0.744533, 0.166257, 0.744533, 0.16629, 0.720657, 0, 0, -1);
f(4, 6, 5, 0.16629, 0.720657, 0.409235, 0.554214, 0.409204, 0.720656, -1, 0, 0);
f(4, 7, 6, 0.16629, 0.720657, 0.166319, 0.554207, 0.409235, 0.554214, -1, 0, 0);
f(8, 9, 3, 0.505978, 0.371554, 0.748732, 0.37159, 0.506025, 0.480993, 0, 0, -1);
f(9, 1, 3, 0.748732, 0.37159, 0.748805, 0.480993, 0.506025, 0.480993, 0, 0, -1);
f(10, 11, 12, 0.263221, 0.291234, 0.506069, 0.048548, 0.506003, 0.291301, 0, 0, 1);
f(10, 13, 11, 0.263221, 0.291234, 0.26329, 0.048548, 0.506069, 0.048548, 0, 0, 1);
f(8, 11, 9, 0.505978, 0.371554, 0.748696, 0.29136, 0.748732, 0.37159, 1, 0, 0);
f(8, 12, 11, 0.505978, 0.371554, 0.506003, 0.291301, 0.748696, 0.29136, 1, 0, 0);
f(11, 1, 9, 0.748696, 0.29136, 0.858089, 0.371544, 0.748732, 0.37159, 0, -1, 0);
f(1, 4, 2, 0.142262, 0.554263, 0.16629, 0.720657, 0.142262, 0.720724, 0, -1, 0);
f(1, 7, 4, 0.142262, 0.554263, 0.166319, 0.554207, 0.16629, 0.720657, 0, -1, 0);
f(11, 7, 1, 0.748696, 0.29136, 0.882084, 0.371544, 0.858089, 0.371544, 0, -1, 0);
f(11, 14, 7, 0.748696, 0.29136, 0.991476, 0.371544, 0.882084, 0.371544, 0, -1, 0);
f(11, 13, 14, 0.748696, 0.29136, 0.991476, 0.291344, 0.991476, 0.371544, 0, -1, 0);
f(6, 14, 15, 0.263082, 0.480834, 0.020375, 0.371408, 0.263168, 0.371428, 0, 0, -1);
f(6, 7, 14, 0.263082, 0.480834, 0.020302, 0.480834, 0.020375, 0.371408, 0, 0, -1);
f(8, 3, 12, 0.505978, 0.371554, 0.396618, 0.371451, 0.506003, 0.291301, 0, 1, 0);
f(0, 5, 3, 0.433335, 0.720689, 0.409204, 0.720656, 0.433325, 0.554245, 0, 1, 0);
f(5, 6, 3, 0.409204, 0.720656, 0.409235, 0.554214, 0.433325, 0.554245, 0, 1, 0);
f(3, 6, 12, 0.396618, 0.371451, 0.372624, 0.371451, 0.506003, 0.291301, 0, 1, 0);
f(6, 10, 12, 0.372624, 0.371451, 0.263221, 0.291234, 0.506003, 0.291301, 0, 1, 0);
f(6, 15, 10, 0.372624, 0.371451, 0.263168, 0.371428, 0.263221, 0.291234, 0, 1, 0);
f(14, 10, 15, 0.020375, 0.371408, 0.263221, 0.291234, 0.263168, 0.371428, -1, 0, 0);
f(14, 13, 10, 0.020375, 0.371408, 0.020411, 0.29119, 0.263221, 0.291234, -1, 0, 0);
this.x = 0;
this.y = 0;
this.z = 0;
this.rotationX = 0;
this.rotationY = 0;
this.rotationZ = 0;
this.scaleX = 1;
this.scaleY = 1;
this.scaleZ = 1;
this.geometry.ready = true;
}
public function f(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:Number):void{
var _local13:Triangle3D;
_local13 = new Triangle3D(this, [ve[_arg1], ve[_arg2], ve[_arg3]], null, [new NumberUV(_arg4, _arg5), new NumberUV(_arg6, _arg7), new NumberUV(_arg8, _arg9)]);
_local13.faceNormal = new Number3D(_arg10, _arg11, _arg12);
fa.push(_local13);
}
public function f2(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Triangle3D;
_local4 = new Triangle3D(this, [ve[_arg1], ve[_arg2], ve[_arg3]], null, []);
fa.push(_local4);
}
public function v(_arg1:Number, _arg2:Number, _arg3:Number):void{
ve.push(new Vertex3D(_arg1, _arg2, _arg3));
}
}
}//package com.baitgames.towerdefense.papervisionmodels
Section 9
//Pulse (com.baitgames.towerdefense.papervisionmodels.Pulse)
package com.baitgames.towerdefense.papervisionmodels {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.geom.*;
public class Pulse extends TriangleMesh3D {
private var ve:Array;
private var fa:Array;
public function Pulse(_arg1:MaterialObject3D, _arg2:Object=null){
super(_arg1, new Array(), new Array(), null, _arg2);
ve = this.geometry.vertices;
fa = this.geometry.faces;
v(-1.560095, 1.303938, -0.645662);
v(-2, 1, 0);
v(-1.688726, 1.304211, 0.000808);
v(-1.847759, 1, -0.765367);
v(-1.413141, 1.022111, -1.419608);
v(-0.770761, 0.029889, -1.848833);
v(-1.413141, 0.029889, -1.419608);
v(-0.770761, 1.022111, -1.848833);
v(0.000508, 1.303938, -1.688424);
v(0.646994, 1.304211, -1.559871);
v(0, 1, -2);
v(0.765367, 1, -1.847759);
v(1.195031, 1.304568, -1.193683);
v(1.414214, 1, -1.414213);
v(1.561218, 1.304955, -0.645646);
v(1.847759, 1, -0.765367);
v(1.689806, 1.305312, 0.000808);
v(2, 1, 0);
v(1.561219, 1.305585, 0.647263);
v(1.847759, 1, 0.765367);
v(1.195032, 1.305733, 1.195301);
v(1.414214, 1, 1.414214);
v(0.765367, 1, 1.847759);
v(0.646994, 1.305733, 1.561488);
v(0, 1, 2);
v(0.000539, 1.305585, 1.690075);
v(-0.765367, 1, 1.847759);
v(-0.645915, 1.305312, 1.561486);
v(-1.414214, 1, 1.414213);
v(-1.193952, 1.304955, 1.195299);
v(-1.560138, 1.304568, 0.647262);
v(-1.847759, 1, 0.765367);
v(-1.193924, 1.32979, -1.193656);
v(-0.645899, 1.32979, -1.559835);
v(0, 0, -2);
v(0.765367, 0, -1.847759);
v(1.414214, 0, -1.414213);
v(-1.847759, 0, -0.765367);
v(1.847759, 0, -0.765367);
v(-2, 0, 0);
v(2, 0, 0);
v(-1.847759, 0, 0.765367);
v(1.847759, 0, 0.765367);
v(-1.414214, 0, 1.414213);
v(1.414214, 0, 1.414214);
v(-0.765367, 0, 1.847759);
v(0.765367, 0, 1.847759);
v(0, 0, 2);
f(0, 1, 2, 0.316018, 0.591205, 0.254513, 0.543147, 0.254438, 0.5913, 0.692075, 0.138004, -0.70851);
f(0, 3, 1, 0.316018, 0.591205, 0.316065, 0.543147, 0.254513, 0.543147, 0.691752, 0.137598, -0.708905);
f(4, 5, 6, 0.377975, 0.542752, 0.438811, 0.46517, 0.377975, 0.46517, 0.555571, 0.831469, 0);
f(4, 7, 5, 0.377975, 0.542752, 0.438811, 0.542752, 0.438811, 0.46517, 0.555571, 0.831469, 0);
f(8, 9, 10, 0.500704, 0.591313, 0.562349, 0.5913, 0.500721, 0.543147, -0.137261, 0.691784, -0.708939);
f(9, 11, 10, 0.562349, 0.5913, 0.562274, 0.543147, 0.500721, 0.543147, -0.137669, 0.692109, -0.708542);
f(9, 12, 11, 0.562349, 0.5913, 0.623914, 0.591424, 0.562274, 0.543147, -0.391912, 0.587226, -0.708216);
f(12, 13, 11, 0.623914, 0.591424, 0.623826, 0.543147, 0.562274, 0.543147, -0.392482, 0.58739, -0.707765);
f(14, 13, 12, 0.685466, 0.591558, 0.623826, 0.543147, 0.623914, 0.591424, -0.587483, 0.393043, -0.707376);
f(14, 15, 13, 0.685466, 0.591558, 0.685378, 0.543147, 0.623826, 0.543147, -0.588122, 0.392971, -0.706885);
f(16, 15, 14, 0.747005, 0.591681, 0.685378, 0.543147, 0.685466, 0.591558, -0.694048, 0.138445, -0.706491);
f(16, 17, 15, 0.747005, 0.591681, 0.74693, 0.543147, 0.685378, 0.543147, -0.694566, 0.138158, -0.706038);
f(18, 17, 16, 0.808532, 0.591776, 0.74693, 0.543147, 0.747005, 0.591681, -0.694953, -0.137936, -0.705701);
f(18, 19, 17, 0.808532, 0.591776, 0.808482, 0.543147, 0.74693, 0.543147, -0.695235, -0.138291, -0.705353);
f(20, 19, 18, 0.870052, 0.591827, 0.808482, 0.543147, 0.808532, 0.591776, -0.58967, -0.393814, -0.705124);
f(20, 21, 19, 0.870052, 0.591827, 0.870034, 0.543147, 0.808482, 0.543147, -0.589737, -0.394049, -0.704936);
f(22, 20, 23, 0.931587, 0.543147, 0.870052, 0.591827, 0.931569, 0.591827, -0.394097, -0.589809, -0.704849);
f(22, 21, 20, 0.931587, 0.543147, 0.870034, 0.543147, 0.870052, 0.591827, -0.394097, -0.589809, -0.70485);
f(24, 23, 25, 0.993139, 0.543147, 0.931569, 0.591827, 0.993089, 0.591776, -0.138179, -0.69549, -0.705124);
f(24, 22, 23, 0.993139, 0.543147, 0.931587, 0.543147, 0.931569, 0.591827, -0.138372, -0.695643, -0.704935);
f(26, 24, 27, 0.069856, 0.543147, 0.0083, 0.543023, 0.069777, 0.591558, 0.138229, -0.694925, -0.705671);
f(24, 25, 27, 0.0083, 0.543023, 0.008245, 0.591529, 0.069777, 0.591558, 0.138584, -0.695206, -0.705324);
f(28, 26, 29, 0.131408, 0.543147, 0.069856, 0.543147, 0.13132, 0.591558, 0.393211, -0.588481, -0.706452);
f(26, 27, 29, 0.069856, 0.543147, 0.069777, 0.591558, 0.13132, 0.591558, 0.393779, -0.588643, -0.706001);
f(30, 28, 29, 0.192872, 0.591424, 0.131408, 0.543147, 0.13132, 0.591558, 0.588387, -0.392648, -0.706844);
f(30, 31, 28, 0.192872, 0.591424, 0.192961, 0.543147, 0.131408, 0.543147, 0.587749, -0.392721, -0.707334);
f(2, 31, 30, 0.254438, 0.5913, 0.192961, 0.543147, 0.192872, 0.591424, 0.692986, -0.137453, -0.707727);
f(2, 1, 31, 0.254438, 0.5913, 0.254513, 0.543147, 0.192961, 0.543147, 0.692467, -0.13774, -0.708179);
f(32, 7, 4, 0.377599, 0.590956, 0.438811, 0.542752, 0.377975, 0.542752, 0.391583, 0.586045, -0.709375);
f(32, 33, 7, 0.377599, 0.590956, 0.439187, 0.590956, 0.438811, 0.542752, 0.391583, 0.586045, -0.709375);
f(8, 33, 9, 0.500704, 0.59448, 0.563849, 0.607162, 0.437422, 0.607159, -0.019676, 0.101063, -0.994685);
f(33, 12, 9, 0.563849, 0.607162, 0.38383, 0.642967, 0.437422, 0.607159, -0.01977, 0.030563, -0.999337);
f(33, 32, 12, 0.563849, 0.607162, 0.617438, 0.64297, 0.38383, 0.642967, -0.010556, -0.015798, -0.999819);
f(32, 0, 12, 0.617438, 0.64297, 0.653245, 0.696556, 0.38383, 0.642967, -0.010542, -0.054148, -0.998477);
f(0, 14, 12, 0.653245, 0.696556, 0.348022, 0.696557, 0.38383, 0.642967, 0.000326, 0.000488, -1);
f(0, 16, 14, 0.653245, 0.696556, 0.335448, 0.759772, 0.348022, 0.696557, 0.000326, 0.000487, -1);
f(0, 2, 16, 0.653245, 0.696556, 0.665823, 0.759772, 0.335448, 0.759772, 0.000326, 0.000487, -1);
f(2, 30, 16, 0.665823, 0.759772, 0.653249, 0.822986, 0.335448, 0.759772, 0.000326, 0.000487, -1);
f(30, 18, 16, 0.653249, 0.822986, 0.348022, 0.822987, 0.335448, 0.759772, 0.000326, 0.000487, -1);
f(30, 29, 18, 0.653249, 0.822986, 0.617441, 0.876577, 0.348022, 0.822987, 0.000326, 0.000488, -1);
f(29, 20, 18, 0.617441, 0.876577, 0.38383, 0.876577, 0.348022, 0.822987, 0.000326, 0.000488, -1);
f(29, 27, 20, 0.617441, 0.876577, 0.563851, 0.912385, 0.38383, 0.876577, 0.000326, 0.000488, -1);
f(27, 23, 20, 0.563851, 0.912385, 0.437422, 0.912386, 0.38383, 0.876577, 0.000326, 0.000487, -1);
f(27, 25, 23, 0.563851, 0.912385, 0.500636, 0.92496, 0.437422, 0.912386, 0.000326, 0.000486, -1);
f(4, 0, 32, 0.377975, 0.542752, 0.316018, 0.591205, 0.377599, 0.590956, 0.605389, 0.37131, -0.704012);
f(3, 0, 4, 0.316065, 0.543147, 0.316018, 0.591205, 0.377975, 0.542752, 0.596466, 0.372204, -0.71112);
f(34, 35, 5, 0.500636, 0.468381, 0.425537, 0.453625, 0.575749, 0.45373, 0.019429, -0.097676, 0.995029);
f(35, 6, 5, 0.425537, 0.453625, 0.638566, 0.411757, 0.575749, 0.45373, 0.019425, 0.029072, 0.999389);
f(35, 36, 6, 0.425537, 0.453625, 0.362088, 0.41123, 0.638566, 0.411757, 0.0106, -0.015864, 0.999818);
f(36, 37, 6, 0.362088, 0.41123, 0.681065, 0.347781, 0.638566, 0.411757, 0.010456, 0.052565, 0.998563);
f(36, 38, 37, 0.362088, 0.41123, 0.319693, 0.347781, 0.681065, 0.347781, 0, 0, 1);
f(38, 39, 37, 0.319693, 0.347781, 0.695952, 0.272938, 0.681065, 0.347781, 0, 0, 1);
f(38, 40, 39, 0.319693, 0.347781, 0.304806, 0.272938, 0.695952, 0.272938, 0, 0, 1);
f(40, 41, 39, 0.304806, 0.272938, 0.681065, 0.198095, 0.695952, 0.272938, 0, 0, 1);
f(40, 42, 41, 0.304806, 0.272938, 0.319693, 0.198095, 0.681065, 0.198095, 0, 0, 1);
f(42, 43, 41, 0.319693, 0.198095, 0.63867, 0.134647, 0.681065, 0.198095, 0, 0, 1);
f(42, 44, 43, 0.319693, 0.198095, 0.362088, 0.134647, 0.63867, 0.134647, 0, 0, 1);
f(44, 45, 43, 0.362088, 0.134647, 0.575222, 0.092252, 0.63867, 0.134647, 0, 0, 1);
f(44, 46, 45, 0.362088, 0.134647, 0.425537, 0.092252, 0.575222, 0.092252, 0, 0, 1);
f(46, 47, 45, 0.425537, 0.092252, 0.500379, 0.077365, 0.575222, 0.092252, 0, 0, 1);
f(33, 10, 7, 0.439187, 0.590956, 0.500721, 0.543147, 0.438811, 0.542752, 0.117021, 0.699742, -0.704746);
f(33, 8, 10, 0.439187, 0.590956, 0.500704, 0.591313, 0.500721, 0.543147, 0.109593, 0.693981, -0.711604);
f(7, 34, 5, 0.438811, 0.542752, 0.500636, 0.465214, 0.438811, 0.46517, 0.19246, 0.981305, 0);
f(7, 10, 34, 0.438811, 0.542752, 0.500721, 0.543147, 0.500636, 0.465214, 0.19246, 0.981305, 0);
f(10, 35, 34, 0.500721, 0.543147, 0.562274, 0.46517, 0.500636, 0.465214, -0.19509, 0.980785, 0);
f(10, 11, 35, 0.500721, 0.543147, 0.562274, 0.543147, 0.562274, 0.46517, -0.19509, 0.980785, 0);
f(11, 36, 35, 0.562274, 0.543147, 0.623826, 0.46517, 0.562274, 0.46517, -0.555571, 0.831469, 0);
f(11, 13, 36, 0.562274, 0.543147, 0.623826, 0.543147, 0.623826, 0.46517, -0.555571, 0.831469, 0);
f(15, 36, 13, 0.685378, 0.543147, 0.623826, 0.46517, 0.623826, 0.543147, -0.83147, 0.55557, 0);
f(15, 38, 36, 0.685378, 0.543147, 0.685378, 0.46517, 0.623826, 0.46517, -0.83147, 0.55557, 0);
f(17, 38, 15, 0.74693, 0.543147, 0.685378, 0.46517, 0.685378, 0.543147, -0.980785, 0.19509, 0);
f(17, 40, 38, 0.74693, 0.543147, 0.74693, 0.46517, 0.685378, 0.46517, -0.980785, 0.19509, 0);
f(19, 40, 17, 0.808482, 0.543147, 0.74693, 0.46517, 0.74693, 0.543147, -0.980785, -0.19509, 0);
f(19, 42, 40, 0.808482, 0.543147, 0.808482, 0.46517, 0.74693, 0.46517, -0.980785, -0.19509, 0);
f(21, 42, 19, 0.870034, 0.543147, 0.808482, 0.46517, 0.808482, 0.543147, -0.83147, -0.55557, 0);
f(21, 44, 42, 0.870034, 0.543147, 0.870034, 0.46517, 0.808482, 0.46517, -0.83147, -0.55557, 0);
f(46, 21, 22, 0.931587, 0.46517, 0.870034, 0.543147, 0.931587, 0.543147, -0.55557, -0.83147, 0);
f(46, 44, 21, 0.931587, 0.46517, 0.870034, 0.46517, 0.870034, 0.543147, -0.55557, -0.83147, 0);
f(47, 22, 24, 0.993139, 0.46517, 0.931587, 0.543147, 0.993139, 0.543147, -0.19509, -0.980785, 0);
f(47, 46, 22, 0.993139, 0.46517, 0.931587, 0.46517, 0.931587, 0.543147, -0.19509, -0.980785, 0);
f(45, 24, 26, 0.069856, 0.46517, 0.0083, 0.543023, 0.069856, 0.543147, 0.19509, -0.980785, 0);
f(45, 47, 24, 0.069856, 0.46517, 0.008304, 0.46517, 0.0083, 0.543023, 0.19509, -0.980785, 0);
f(43, 26, 28, 0.131408, 0.46517, 0.069856, 0.543147, 0.131408, 0.543147, 0.555571, -0.831469, 0);
f(43, 45, 26, 0.131408, 0.46517, 0.069856, 0.46517, 0.069856, 0.543147, 0.555571, -0.831469, 0);
f(31, 43, 28, 0.192961, 0.543147, 0.131408, 0.46517, 0.131408, 0.543147, 0.83147, -0.55557, 0);
f(31, 41, 43, 0.192961, 0.543147, 0.192961, 0.46517, 0.131408, 0.46517, 0.83147, -0.55557, 0);
f(1, 41, 31, 0.254513, 0.543147, 0.192961, 0.46517, 0.192961, 0.543147, 0.980785, -0.19509, 0);
f(1, 39, 41, 0.254513, 0.543147, 0.254513, 0.46517, 0.192961, 0.46517, 0.980785, -0.19509, 0);
f(3, 39, 1, 0.316065, 0.543147, 0.254513, 0.46517, 0.254513, 0.543147, 0.980785, 0.19509, 0);
f(3, 37, 39, 0.316065, 0.543147, 0.316065, 0.46517, 0.254513, 0.46517, 0.980785, 0.19509, 0);
f(4, 6, 3, 0.377975, 0.542752, 0.377975, 0.46517, 0.316065, 0.543147, 0.832956, 0.55334, 0);
f(6, 37, 3, 0.377975, 0.46517, 0.316065, 0.46517, 0.316065, 0.543147, 0.832956, 0.55334, 0);
this.x = 0;
this.y = 0;
this.z = 0;
this.rotationX = 0;
this.rotationY = 0;
this.rotationZ = 0;
this.scaleX = 1;
this.scaleY = 1;
this.scaleZ = 1;
this.geometry.ready = true;
}
public function f(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:Number):void{
var _local13:Triangle3D;
_local13 = new Triangle3D(this, [ve[_arg1], ve[_arg2], ve[_arg3]], null, [new NumberUV(_arg4, _arg5), new NumberUV(_arg6, _arg7), new NumberUV(_arg8, _arg9)]);
_local13.faceNormal = new Number3D(_arg10, _arg11, _arg12);
fa.push(_local13);
}
public function f2(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Triangle3D;
_local4 = new Triangle3D(this, [ve[_arg1], ve[_arg2], ve[_arg3]], null, []);
fa.push(_local4);
}
public function v(_arg1:Number, _arg2:Number, _arg3:Number):void{
ve.push(new Vertex3D(_arg1, _arg2, _arg3));
}
}
}//package com.baitgames.towerdefense.papervisionmodels
Section 10
//Turret (com.baitgames.towerdefense.papervisionmodels.Turret)
package com.baitgames.towerdefense.papervisionmodels {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.geom.*;
public class Turret extends TriangleMesh3D {
private var ve:Array;
private var fa:Array;
public function Turret(_arg1:MaterialObject3D, _arg2:Object=null){
super(_arg1, new Array(), new Array(), null, _arg2);
ve = this.geometry.vertices;
fa = this.geometry.faces;
v(-1, 1.01845, -1);
v(-1.414214, 0.01845, 0);
v(-1.414214, 1.01845, 0);
v(-1, 0.01845, -1);
v(1.414214, 1.01845, 0);
v(1, 0.01845, -1);
v(1, 1.01845, -1);
v(1.414214, 0.01845, 0);
v(1, 1.01845, 1);
v(1, 0.01845, 1);
v(0, 0.01845, 1.414213);
v(0, 1.01845, 1.414213);
v(-1, 0.01845, 1);
v(-1, 1.01845, 1);
v(0, 1.01845, -1.414214);
v(0, 0.270144, -1.414214);
v(0.246563, 0.270144, -1.312084);
v(0, 0.01845, -1.414214);
v(0.246563, 0.789747, -1.312084);
v(0, 0.789747, -1.414214);
v(-0.270554, 0.789747, -1.302147);
v(-0.270554, 0.270144, -1.302147);
v(-0.270554, 0.789747, -2.145677);
v(-0.270554, 0.270144, -2.145677);
v(0.246563, 0.270144, -2.145677);
v(0.246563, 0.789747, -2.145677);
f(0, 1, 2, 0.376781, 0.568505, 0.2526, 0.444166, 0.2526, 0.568338, 0.923879, 0.382684, 0);
f(0, 3, 1, 0.376781, 0.568505, 0.376779, 0.444306, 0.2526, 0.444166, 0.923879, 0.382684, 0);
f(4, 5, 6, 0.749217, 0.568593, 0.625106, 0.444387, 0.625099, 0.568562, -0.923879, 0.382684, 0);
f(4, 7, 5, 0.749217, 0.568593, 0.749217, 0.444421, 0.625106, 0.444387, -0.923879, 0.382684, 0);
f(8, 7, 4, 0.873394, 0.568545, 0.749217, 0.444421, 0.749217, 0.568593, -0.923879, -0.382684, 0);
f(8, 9, 7, 0.873394, 0.568545, 0.873393, 0.444385, 0.749217, 0.444421, -0.923879, -0.382684, 0);
f(10, 8, 11, 0.997568, 0.444349, 0.873394, 0.568545, 0.997568, 0.568521, -0.382683, -0.92388, 0);
f(10, 9, 8, 0.997568, 0.444349, 0.873393, 0.444385, 0.873394, 0.568545, -0.382683, -0.92388, 0);
f(12, 11, 13, 0.128509, 0.44419, 0.004415, 0.568384, 0.128509, 0.568361, 0.382683, -0.92388, 0);
f(12, 10, 11, 0.128509, 0.44419, 0.004415, 0.444213, 0.004415, 0.568384, 0.382683, -0.92388, 0);
f(2, 12, 13, 0.2526, 0.568338, 0.128509, 0.44419, 0.128509, 0.568361, 0.923879, -0.382684, 0);
f(2, 1, 12, 0.2526, 0.568338, 0.2526, 0.444166, 0.128509, 0.44419, 0.923879, -0.382684, 0);
f(0, 6, 14, 0.376954, 0.62027, 0.625296, 0.62027, 0.500997, 0.568619, 0, 0, -1);
f(0, 2, 6, 0.376954, 0.62027, 0.32552, 0.744441, 0.625296, 0.62027, 0, 0, -1);
f(2, 4, 6, 0.32552, 0.744441, 0.67673, 0.744441, 0.625296, 0.62027, 0, 0, -1);
f(2, 13, 4, 0.32552, 0.744441, 0.376954, 0.868613, 0.67673, 0.744441, 0, 0, -1);
f(13, 8, 4, 0.376954, 0.868613, 0.625297, 0.868613, 0.67673, 0.744441, 0, 0, -1);
f(13, 11, 8, 0.376954, 0.868613, 0.501125, 0.920046, 0.625297, 0.868613, 0, 0, -1);
f(15, 16, 17, 0.500954, 0.475628, 0.531571, 0.475628, 0.50094, 0.444561, -0.382684, 0.923879, 0);
f(16, 5, 17, 0.531571, 0.475628, 0.625106, 0.444387, 0.50094, 0.444561, -0.382684, 0.923879, -1E-6);
f(18, 5, 16, 0.53157, 0.540148, 0.625106, 0.444387, 0.531571, 0.475628, -0.382684, 0.92388, 0);
f(14, 18, 19, 0.500997, 0.568619, 0.53157, 0.540148, 0.500954, 0.540148, -0.382684, 0.923879, 0);
f(14, 6, 18, 0.500997, 0.568619, 0.625099, 0.568562, 0.53157, 0.540148, -0.382684, 0.923879, 1E-6);
f(18, 6, 5, 0.53157, 0.540148, 0.625099, 0.568562, 0.625106, 0.444387, -0.382684, 0.923879, 0);
f(0, 20, 21, 0.376781, 0.568505, 0.467359, 0.540148, 0.467359, 0.475628, 0.382684, 0.923879, 0);
f(0, 19, 20, 0.376781, 0.568505, 0.500954, 0.540148, 0.467359, 0.540148, 0.382683, 0.92388, -4E-6);
f(0, 14, 19, 0.376781, 0.568505, 0.500997, 0.568619, 0.500954, 0.540148, 0.382684, 0.923879, 0);
f(0, 21, 3, 0.376781, 0.568505, 0.467359, 0.475628, 0.376779, 0.444306, 0.382684, 0.923879, 0);
f(21, 17, 3, 0.467359, 0.475628, 0.50094, 0.444561, 0.376779, 0.444306, 0.382684, 0.923879, 1E-6);
f(21, 15, 17, 0.467359, 0.475628, 0.500954, 0.475628, 0.50094, 0.444561, 0.382683, 0.92388, 0);
f(17, 5, 3, 0.50094, 0.444561, 0.376755, 0.393313, 0.625098, 0.393313, 0, 0, 1);
f(5, 1, 3, 0.376755, 0.393313, 0.676531, 0.269141, 0.625098, 0.393313, 0, 0, 1);
f(5, 7, 1, 0.376755, 0.393313, 0.325321, 0.269141, 0.676531, 0.269141, 0, 0, 1);
f(7, 12, 1, 0.325321, 0.269141, 0.625098, 0.14497, 0.676531, 0.269141, 0, 0, 1);
f(7, 9, 12, 0.325321, 0.269141, 0.376755, 0.14497, 0.625098, 0.14497, 0, 0, 1);
f(9, 10, 12, 0.376755, 0.14497, 0.500926, 0.093536, 0.625098, 0.14497, 0, 0, 1);
f(22, 21, 20, 0.818985, 0.768045, 0.71419, 0.703489, 0.71419, 0.768009, 1, 0, 0);
f(22, 23, 21, 0.818985, 0.768045, 0.818944, 0.703551, 0.71419, 0.703489, 1, 0, 0);
f(18, 24, 25, 0.986676, 0.768057, 0.883163, 0.70356, 0.883199, 0.768055, -1, 0, 0);
f(18, 16, 24, 0.986676, 0.768057, 0.986676, 0.703537, 0.883163, 0.70356, -1, 0, 0);
f(24, 15, 23, 0.883163, 0.70356, 0.852531, 0.612765, 0.818944, 0.703551, 0, 0, 1);
f(24, 16, 15, 0.883163, 0.70356, 0.883147, 0.600083, 0.852531, 0.612765, 0, 0, 1);
f(23, 15, 21, 0.818944, 0.703551, 0.852531, 0.612765, 0.818936, 0.598849, 0, 0, 1);
f(22, 24, 23, 0.818985, 0.768045, 0.883163, 0.70356, 0.818944, 0.703551, 0, 1, 0);
f(22, 25, 24, 0.818985, 0.768045, 0.883199, 0.768055, 0.883163, 0.70356, 0, 1, 0);
f(22, 20, 19, 0.818985, 0.768045, 0.819016, 0.872787, 0.852612, 0.858872, 0, 0, -1);
f(22, 19, 25, 0.818985, 0.768045, 0.852612, 0.858872, 0.883199, 0.768055, 0, 0, -1);
f(19, 18, 25, 0.852612, 0.858872, 0.883228, 0.871553, 0.883199, 0.768055, 0, 0, -1);
this.x = 0;
this.y = 0;
this.z = 0;
this.rotationX = 0;
this.rotationY = 0;
this.rotationZ = 0;
this.scaleX = 1;
this.scaleY = 1;
this.scaleZ = 1;
this.geometry.ready = true;
}
public function f(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:Number):void{
var _local13:Triangle3D;
_local13 = new Triangle3D(this, [ve[_arg1], ve[_arg2], ve[_arg3]], null, [new NumberUV(_arg4, _arg5), new NumberUV(_arg6, _arg7), new NumberUV(_arg8, _arg9)]);
_local13.faceNormal = new Number3D(_arg10, _arg11, _arg12);
fa.push(_local13);
}
public function f2(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Triangle3D;
_local4 = new Triangle3D(this, [ve[_arg1], ve[_arg2], ve[_arg3]], null, []);
fa.push(_local4);
}
public function v(_arg1:Number, _arg2:Number, _arg3:Number):void{
ve.push(new Vertex3D(_arg1, _arg2, _arg3));
}
}
}//package com.baitgames.towerdefense.papervisionmodels
Section 11
//AStar (com.baitgames.towerdefense.AStar)
package com.baitgames.towerdefense {
import de.polygonal.ds.*;
public class AStar {
public static function getSquares(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Array2, _arg7:Boolean=false):Array{
var _local8:Array2;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:Array;
var _local17:Array;
var _local18:AStarNode;
var _local19:AStarNode;
var _local20:AStarNode;
var _local21:int;
var _local22:Array;
var _local23:int;
var _local24:Array;
var _local25:int;
var _local26:int;
var _local27:int;
_local8 = new Array2(_arg6.width, _arg6.height);
_local9 = _local8.width;
_local10 = _local8.height;
_local11 = 0;
while (_local11 < _local9) {
_local21 = 0;
while (_local21 < _local10) {
_local8.set(_local11, _local21, new AStarNode(_local11, _local21));
_local21++;
};
_local11++;
};
_local12 = (_arg1 / _arg5);
_local13 = (_arg2 / _arg5);
_local14 = (_arg3 / _arg5);
_local15 = (_arg4 / _arg5);
_local16 = [_local8.get(_local12, _local13)];
_local17 = new Array();
if (_arg7){
_local22 = [new AStarDirection(-1, -1, 1.4), new AStarDirection(0, -1, 1), new AStarDirection(1, -1, 1.4), new AStarDirection(-1, 0, 1), new AStarDirection(1, 0, 1), new AStarDirection(-1, 1, 1.4), new AStarDirection(0, 1, 1), new AStarDirection(1, 1, 1.4)];
} else {
_local22 = [new AStarDirection(0, -1, 1), new AStarDirection(-1, 0, 1), new AStarDirection(1, 0, 1), new AStarDirection(0, 1, 1)];
};
_local19 = _local8.get(_local14, _local15);
while (_local16.length > 0) {
_local18 = _local16[0];
_local23 = _local16.length;
_local11 = 1;
while (_local11 < _local23) {
if (_local16[_local11].score < _local18.score){
_local18 = _local16[_local11];
};
_local11++;
};
if (_local18 == _local19){
_local24 = [_local18];
while (_local18.parent != null) {
_local18 = _local18.parent;
_local24.unshift(_local18);
};
return (_local24);
} else {
_local16.splice(_local16.indexOf(_local18), 1);
_local17.push(_local18);
_local25 = _local22.length;
_local11 = 0;
while (_local11 < _local25) {
_local20 = _local8.get((_local18.x + _local22[_local11].x), (_local18.y + _local22[_local11].y));
if (_local16.indexOf(_local20) == -1){
if (_local17.indexOf(_local20) == -1){
if (_arg6.get(_local20.x, _local20.y)){
_local16.push(_local20);
_local20.parent = _local18;
_local26 = (_local14 - _local20.x);
_local27 = (_local15 - _local20.y);
_local20.score = ((_local20.parent.score + _local22[_local11].cost) + Math.sqrt(((_local26 * _local26) + (_local27 * _local27))));
};
};
};
_local11++;
};
};
};
return ([]);
}
}
}//package com.baitgames.towerdefense
Section 12
//AStarDirection (com.baitgames.towerdefense.AStarDirection)
package com.baitgames.towerdefense {
public class AStarDirection {
public var x:int;
public var y:int;
public var cost:Number;
public function AStarDirection(_arg1:int, _arg2:int, _arg3:Number){
x = _arg1;
y = _arg2;
cost = _arg3;
}
}
}//package com.baitgames.towerdefense
Section 13
//AStarNode (com.baitgames.towerdefense.AStarNode)
package com.baitgames.towerdefense {
public class AStarNode {
public var score:Number;
public var parent:AStarNode;
public var x:int;
public var y:int;
public function AStarNode(_arg1:int, _arg2:int){
x = _arg1;
y = _arg2;
score = 0;
}
}
}//package com.baitgames.towerdefense
Section 14
//Blast (com.baitgames.towerdefense.Blast)
package com.baitgames.towerdefense {
import flash.events.*;
import flash.display.*;
public class Blast extends EventDispatcher {
public var maxSpeed:Number;// = 1
public var step:Number;// = 0
public var stepIncrement:Number;// = 0
public var angle:Number;// = 0
public var scale:Number;// = 1
protected var target:Enemy;
protected var game:Game;
public var length:Number;// = 1
public var x:Number;// = 0
public var y:Number;// = 0
public var z:Number;// = 0
protected var age:Number;// = 0
public function Blast(_arg1:Game, _arg2:Enemy, _arg3:Number=1, _arg4:Number=14){
step = 0;
x = 0;
y = 0;
z = 0;
angle = 0;
maxSpeed = 1;
age = 0;
scale = 1;
stepIncrement = 0;
length = 1;
super();
this.game = _arg1;
this.target = _arg2;
this.scale = _arg3;
this.length = _arg4;
stepIncrement = (1 / _arg4);
x = _arg2.x;
y = _arg2.y;
_arg1.addEventListener("gameLoop", update);
_arg1.addEventListener("gameover", gameOver);
}
public function remove():void{
game.removeEventListener("gameLoop", update);
game.removeEventListener("gameover", gameOver);
}
protected function update(_arg1:Event):void{
age++;
step = (step + stepIncrement);
if (step >= 1){
game.removeBlast(this);
};
}
private function gameOver(_arg1:Event):void{
game.removeBlast(this);
}
}
}//package com.baitgames.towerdefense
Section 15
//Blast25D (com.baitgames.towerdefense.Blast25D)
package com.baitgames.towerdefense {
import flash.events.*;
import org.papervision3d.view.*;
import org.papervision3d.objects.*;
import flash.display.*;
import flash.utils.*;
import org.papervision3d.events.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import org.papervision3d.render.*;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
public class Blast25D extends EventDispatcher {
protected var bitmapSize:int;// = 32
protected var stepFrames:int;// = 24
protected var instanceFramesList:Array;
var material:BitmapMaterial;
protected var game25D:Game25D;
protected var blast:Blast;
public var geometry;
public static var isAdam:Boolean = true;
protected static var framesList:Array = [];
public function Blast25D(_arg1:Game25D, _arg2:Blast, _arg3:Class, _arg4:int=180){
var _local5:MovieClip;
var _local6:int;
var _local7:Class;
var _local8:BitmapData;
stepFrames = 24;
instanceFramesList = [];
bitmapSize = 32;
super();
game25D = _arg1;
blast = _arg2;
if (isAdam){
isAdam = false;
_local5 = new (_arg3);
_local6 = 2;
while (_local6 <= 24) {
_local7 = (getDefinitionByName(("blast" + _local6)) as Class);
_local8 = new _local7(0, 0);
framesList[(_local6 - 2)] = _local8;
_local6++;
};
};
material = new BitmapMaterial(framesList[0]);
material.doubleSided = true;
geometry = new Plane(material, 100, 100, 4, 4);
geometry.scaleX = (geometry.scaleY = (geometry.scaleZ = blast.scale));
geometry.lookAt(game25D.camera);
game25D.addEventListener("render", render);
instanceFramesList = framesList;
if (blast.scale < 1){
};
}
public function remove():void{
game25D.removeEventListener("render", render);
}
private function render(_arg1:Event):void{
var _local2:int;
geometry.x = blast.x;
geometry.z = -(blast.y);
geometry.y = 0;
geometry.lookAt(game25D.camera);
geometry.moveForward(10);
_local2 = Math.floor((blast.step * stepFrames));
material.bitmap = framesList[_local2];
}
public function init(_arg1:Game25D, _arg2:Blast){
game25D = _arg1;
blast = _arg2;
geometry.scaleX = (geometry.scaleY = (geometry.scaleZ = blast.scale));
geometry.lookAt(game25D.camera);
game25D.addEventListener("render", render);
}
}
}//package com.baitgames.towerdefense
Section 16
//Bullet (com.baitgames.towerdefense.Bullet)
package com.baitgames.towerdefense {
import flash.events.*;
import flash.display.*;
public class Bullet extends EventDispatcher {
public var power:Number;
protected var tower:Tower;
public var speed:Number;// = 0
public var angle:Number;// = 0
protected var dx:Number;// = 0
protected var evil:Boolean;
protected var dy:Number;// = 0
public var scale:Number;// = 1
public var bulletType:Class;
protected var game:Game;
public var x:Number;// = 0
public var y:Number;// = 0
public var z:Number;// = 0
public function Bullet(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean, _arg8:Tower, _arg9:Enemy=null){
dx = 0;
dy = 0;
angle = 0;
x = 0;
y = 0;
z = 0;
speed = 0;
scale = 1;
bulletType = Bullet;
super();
game = _arg1;
x = _arg2;
y = _arg3;
speed = _arg4;
angle = _arg5;
evil = _arg7;
power = _arg6;
tower = _arg8;
dx = (Math.sin(angle) * speed);
dy = (Math.cos(angle) * speed);
init();
game.addEventListener("gameLoop", gameLoop, false, 0, true);
game.addEventListener("gameover", gameOver);
}
protected function init():void{
x = (x + (dx * 5));
y = (y + (dy * 5));
}
public function killMe(){
game.removeEventListener("gameLoop", gameLoop);
game.removeEventListener("gameover", gameOver);
}
private function gameOver(_arg1:Event):void{
game.removeBullet(this);
}
protected function gameLoop(_arg1:Event):void{
x = (x + dx);
y = (y + dy);
if ((((((((x < game.leftBound)) || ((x > game.rightBound)))) || ((y < game.topBound)))) || ((y > game.bottomBound)))){
game.removeBullet(this);
} else {
game.testEnemyCollision(this);
};
}
}
}//package com.baitgames.towerdefense
Section 17
//Bullet25D (com.baitgames.towerdefense.Bullet25D)
package com.baitgames.towerdefense {
import flash.events.*;
import org.papervision3d.view.*;
import org.papervision3d.objects.*;
import flash.display.*;
import org.papervision3d.events.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import org.papervision3d.render.*;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
public class Bullet25D extends EventDispatcher {
var bullet:Bullet;
protected var stepFrames:Number;// = 2
protected var clips:Array;
public var frames:MovieClip;
var material:BitmapMaterial;
protected var game:Game25D;
public var geometry:DisplayObject3D;
public static var isAdam:Boolean = true;
public static var bitmap:BitmapData;
public function Bullet25D(_arg1:Game25D, _arg2:Bullet){
stepFrames = 2;
clips = [];
super();
game = _arg1;
bullet = _arg2;
createGeometry();
game.addEventListener("render", render);
}
public function remove():void{
game.removeEventListener("render", render);
}
public function init(_arg1:Game25D, _arg2:Bullet){
game = _arg1;
bullet = _arg2;
game.addEventListener("render", render);
}
protected function render(_arg1:Event):void{
geometry.lookAt(game.camera);
geometry.x = bullet.x;
geometry.z = -(bullet.y);
}
protected function createGeometry():void{
if (Bullet25D.isAdam){
Bullet25D.isAdam = false;
bitmap = new BulletSprite(0, 0);
};
material = new BitmapMaterial(bitmap);
material.doubleSided = true;
geometry = new Plane(material, 25, 25, 1, 1);
geometry.lookAt(game.camera);
}
}
}//package com.baitgames.towerdefense
Section 18
//Bullet2D (com.baitgames.towerdefense.Bullet2D)
package com.baitgames.towerdefense {
import flash.display.*;
public dynamic class Bullet2D extends MovieClip {
}
}//package com.baitgames.towerdefense
Section 19
//Enemy (com.baitgames.towerdefense.Enemy)
package com.baitgames.towerdefense {
import flash.events.*;
import flash.display.*;
import com.blocmedia.utils.*;
public class Enemy extends EventDispatcher {
protected var collisionCorner:int;// = -1
protected var squareNum:int;// = 0
protected var chasing:Boolean;// = true
private var directionPriority:Array;
public var maker:Maker;
protected var speed:Number;// = 5
protected var touching:Boolean;// = false
public var myName:String;
protected var collisionTileX:int;// = 0
protected var health:Number;// = 100
protected var collisionTileY:int;// = 0
protected var collisionX:int;// = 0
protected var collisionY:int;// = 0
public var gridSize:Number;// = 34
public var x:Number;// = 0
public var y:Number;// = 0
protected var goalGridX:int;// = 11
protected var goalGridY:int;// = 4
protected var rightHanded:Boolean;// = true
protected var dir:int;// = 2
private var recalculate:Boolean;// = true
protected var dx:Number;// = 0
protected var dy:Number;// = 0
protected var nextDir:int;// = 2
protected var goalX:Number;
protected var goalY:Number;
public var halfGridSize:Number;// = 17
protected var tGridX:Number;// = 0
protected var tGridY:Number;// = 0
private var moves:Array;
var smart:Boolean;
public var step:Number;// = 0
public var cost:Number;
protected var lookingForWall:Boolean;// = true
protected var gridX:int;// = 0
protected var gridY:int;// = 0
public var alive:Boolean;// = true
protected var stride:Number;// = 0.015
public var angle:Number;// = 0
private var gridAge:int;// = -1
public var typeNum:int;// = 0
protected var game:Game;
protected var squares:Array;
protected var age:Number;// = 0
public static var statsTable:Array = [{name:"spinner 500", health:100, speed:5, smartOdds:0.5, cost:1}, {name:"spider 200", health:40, speed:5, smartOdds:0.3, cost:0.5}, {name:"globe 800", health:1000, speed:0.8, smartOdds:1, cost:2}, {name:"pyramid 150", health:200, speed:1, smartOdds:0.85, cost:0.5}, {name:"speeder 400", health:40, speed:10, smartOdds:0.5, cost:1}];
public function Enemy(_arg1:Game, _arg2:int, _arg3:Boolean, _arg4:Maker){
var _local5:Number;
speed = 5;
step = 0;
stride = 0.015;
dx = 0;
dy = 0;
dir = 2;
rightHanded = true;
chasing = true;
nextDir = 2;
x = 0;
y = 0;
gridX = 0;
gridY = 0;
tGridX = 0;
tGridY = 0;
goalGridX = 11;
goalGridY = 4;
squareNum = 0;
angle = 0;
lookingForWall = true;
health = 100;
age = 0;
gridSize = 34;
halfGridSize = 17;
alive = true;
touching = false;
collisionTileX = 0;
collisionTileY = 0;
collisionCorner = -1;
collisionX = 0;
collisionY = 0;
typeNum = 0;
moves = new Array();
gridAge = -1;
recalculate = true;
super();
this.game = _arg1;
this.typeNum = _arg2;
this.maker = _arg4;
_local5 = 1;
if (_arg3){
_local5 = 0.5;
};
health = (statsTable[_arg2].health * _local5);
speed = statsTable[_arg2].speed;
cost = statsTable[_arg2].cost;
gridSize = _arg1.gridSize;
halfGridSize = _arg1.halfGridSize;
x = halfGridSize;
gridY = Math.floor((_arg1.gridHeight / 2));
y = ((gridY * gridSize) + halfGridSize);
dumb = false;
chasing = true;
smart = Math2.randomBool(statsTable[_arg2].smartOdds);
goalGridX = (_arg1.gridWidth - 1);
goalGridY = Math.floor((_arg1.gridHeight / 2));
goalX = ((goalGridX * gridSize) + halfGridSize);
goalY = ((goalGridY * gridSize) + halfGridSize);
angle = 0;
dx = (Math.sin(angle) * speed);
dy = (Math.cos(angle) * speed);
walkForward();
_arg1.addEventListener("gameLoop", gameLoop, false, 0, true);
}
public function hurtMe(_arg1:Number, _arg2:Number, _arg3:Number):void{
health = (health - _arg1);
if (health <= 0){
game.killEnemy(this);
};
}
private function reachGoal(){
alive = false;
game.enemyReachGoal(this);
}
private function followPath():void{
var _local1:Number;
var _local2:AStarNode;
if (squares == null){
squares = AStar.getSquares(x, y, goalX, goalY, gridSize, game.maze.tileMap, false);
};
tGridX = squares[squareNum].x;
tGridY = squares[squareNum].y;
dx = (((tGridX * gridSize) + halfGridSize) - x);
dy = (((tGridY * gridSize) + halfGridSize) - y);
_local1 = Math.sqrt(((dx * dx) + (dy * dy)));
angle = Math.atan2(dx, dy);
if (_local1 < speed){
if ((((tGridX == goalGridX)) && ((tGridY == goalGridY)))){
reachGoal();
} else {
if (gridAge < game.gridAge){
gridAge = game.gridAge;
squares = AStar.getSquares(x, y, goalX, goalY, gridSize, game.maze.tileMap, false);
squareNum = 1;
} else {
squareNum++;
};
_local2 = squares[squareNum];
tGridX = _local2.x;
tGridY = _local2.y;
};
};
dx = (Math.sin(angle) * speed);
dy = (Math.cos(angle) * speed);
walkForward();
}
public function killMe():void{
alive = false;
game.removeEventListener("gameLoop", gameLoop);
maker.killEnemy(this);
}
private function gameLoop(_arg1:Event):void{
age++;
if (smart){
followPath();
} else {
followWalls();
};
game.updateGrid(((x - 17) / 40), ((y - 17) / 40), ((x + 17) / 40), ((y - 17) / 40), ((x + 17) / 40), ((y + 17) / 40), ((x - 17) / 40), ((y + 17) / 40));
}
private function walkForward():void{
var _local1:HitData;
collisionCorner = -1;
x = (x + dx);
_local1 = game.checkGrid2((x + 16), (y + 16));
if (_local1.hit){
x = (_local1.left - 17);
collisionCorner = 0;
collisionX = (x + 16);
collisionY = (y + 16);
} else {
_local1 = game.checkGrid2((x - 16), (y + 16));
if (_local1.hit){
x = (_local1.right + 16);
collisionCorner = 1;
collisionX = (x - 16);
collisionY = (y + 16);
} else {
_local1 = game.checkGrid2((x + 16), (y - 16));
if (_local1.hit){
x = (_local1.left - 17);
collisionCorner = 2;
collisionX = (x + 16);
collisionY = (y - 16);
} else {
_local1 = game.checkGrid2((x - 16), (y - 16));
if (_local1.hit){
x = (_local1.right + 16);
collisionCorner = 3;
collisionX = (x - 16);
collisionY = (y - 16);
};
};
};
};
y = (y + dy);
_local1 = game.checkGrid2((x + 16), (y + 16));
if (_local1.hit){
y = (_local1.top - 17);
collisionCorner = 0;
collisionX = (x + 16);
collisionY = (y + 16);
} else {
_local1 = game.checkGrid2((x - 16), (y + 16));
if (_local1.hit){
y = (_local1.top - 17);
collisionCorner = 1;
collisionX = (x - 16);
collisionY = (y + 16);
} else {
_local1 = game.checkGrid2((x + 16), (y - 16));
if (_local1.hit){
y = (_local1.bottom + 16);
collisionCorner = 2;
collisionX = (x + 16);
collisionY = (y - 16);
} else {
_local1 = game.checkGrid2((x - 16), (y - 16));
if (_local1.hit){
y = (_local1.bottom + 16);
collisionCorner = 3;
collisionX = (x - 16);
collisionY = (y - 16);
};
};
};
};
step = (step + (stride * speed));
if (step >= 1){
step = (step - 1);
};
}
private function followWalls():void{
var _local1:Boolean;
var _local2:int;
var _local3:int;
var _local4:*;
var _local5:GridMove;
var _local6:Number;
if (chasing){
_local1 = false;
if (collisionCorner != -1){
_local1 = true;
_local2 = (collisionX / gridSize);
_local3 = (collisionY / gridSize);
};
if (_local1){
rightHanded = Math2.randomBool();
chasing = false;
_local4 = getDirection(_local2, _local3, rightHanded);
_local5 = getNextSquare(_local2, _local3, _local4, rightHanded);
tGridX = _local5.x;
tGridY = _local5.y;
dir = _local5.dir;
};
};
if (!chasing){
dx = (((tGridX * gridSize) + halfGridSize) - x);
dy = (((tGridY * gridSize) + halfGridSize) - y);
_local6 = Math.sqrt(((dx * dx) + (dy * dy)));
angle = Math.atan2(dx, dy);
if (_local6 < speed){
if ((((tGridX == goalGridX)) && ((tGridY == goalGridY)))){
reachGoal();
} else {
_local5 = getNextSquare(tGridX, tGridY, dir, rightHanded);
tGridX = _local5.x;
tGridY = _local5.y;
dir = _local5.dir;
};
};
dx = (Math.sin(angle) * speed);
dy = (Math.cos(angle) * speed);
};
walkForward();
}
private function getDirection(_arg1:Number, _arg2:Number, _arg3:Boolean):int{
var _local4:int;
_local4 = 0;
if (game.checkGridSquare(_arg1, (_arg2 - 1))){
_local4 = (_arg3) ? 3 : 1;
} else {
if (game.checkGridSquare((_arg1 + 1), _arg2)){
_local4 = (_arg3) ? 0 : 2;
} else {
if (game.checkGridSquare(_arg1, (_arg2 + 1))){
_local4 = (_arg3) ? 1 : 3;
} else {
if (game.checkGridSquare((_arg1 - 1), _arg2)){
_local4 = (_arg3) ? 2 : 0;
} else {
_local4 = -1;
};
};
};
};
return (_local4);
}
private function getNextSquare(_arg1:int, _arg2:int, _arg3:int, _arg4:Boolean):GridMove{
var _local5:Array;
var _local6:int;
var _local7:int;
if (!directionPriority){
directionPriority = [];
if (_arg4){
directionPriority[0] = [1, 0, 3, 2];
directionPriority[1] = [2, 1, 0, 3];
directionPriority[2] = [3, 2, 1, 0];
directionPriority[3] = [0, 3, 2, 1];
} else {
directionPriority[0] = [3, 0, 1, 2];
directionPriority[1] = [0, 1, 2, 3];
directionPriority[2] = [1, 2, 3, 0];
directionPriority[3] = [2, 3, 0, 1];
};
moves[0] = new GridMove(0, -1);
moves[1] = new GridMove(1, 0);
moves[2] = new GridMove(0, 1);
moves[3] = new GridMove(-1, 0);
};
_local5 = directionPriority[_arg3];
_local6 = 0;
while (_local6 < 4) {
_local7 = _local5[_local6];
if (!game.checkGridSquare((_arg1 + moves[_local7].x), (_arg2 + moves[_local7].y))){
_arg3 = _local7;
break;
};
_local6++;
};
return (new GridMove((_arg1 + moves[_arg3].x), (_arg2 + moves[_arg3].y), _arg3));
}
}
}//package com.baitgames.towerdefense
Section 20
//Enemy25D (com.baitgames.towerdefense.Enemy25D)
package com.baitgames.towerdefense {
import flash.events.*;
import org.papervision3d.view.*;
import org.papervision3d.objects.*;
import flash.display.*;
import flash.utils.*;
import org.papervision3d.events.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import org.papervision3d.render.*;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
public class Enemy25D extends EventDispatcher {
protected var typeNum:int;// = 1
private var enemy:Enemy;
protected var spinFrame:int;// = 0
private var stepFrames:Number;// = 2
public var plane:Plane;
private var clips:Array;
public var frames:MovieClip;
var material:BitmapMaterial;
private var game:Game25D;
public var angleArrow:MovieClip;
protected var types:Array;
public static var framesList:Array = [];
public static var E1frames:Array = [];
public static var E2frames:Array = [];
public static var E3frames:Array = [];
public static var E4frames:Array = [];
public static var E5frames:Array = [];
public static var spawnedTypes:Array = [];
public function Enemy25D(_arg1:Game25D, _arg2:Enemy){
var _local3:Number;
var _local4:Class;
var _local5:BitmapData;
var _local6:BitmapMaterial;
stepFrames = 2;
clips = [];
spinFrame = 0;
types = [15, 30, 15, 30, 20];
typeNum = 1;
super();
game = _arg1;
enemy = _arg2;
typeNum = (enemy.typeNum + 1);
if (!spawnedTypes[(typeNum - 1)]){
spawnedTypes[(typeNum - 1)] = true;
_local3 = 1;
while (_local3 <= types[(typeNum - 1)]) {
_local4 = (getDefinitionByName(((("E" + typeNum) + "f") + _local3)) as Class);
_local5 = new _local4(0, 0);
_local6 = new BitmapMaterial(_local5);
_local6.doubleSided = true;
Enemy25D[((("E" + typeNum) + "frame") + _local3)] = _local6;
Enemy25D[(("E" + typeNum) + "frames")][(_local3 - 1)] = Enemy25D[((("E" + typeNum) + "frame") + _local3)];
_local3++;
};
};
material = Enemy25D[(("E" + typeNum) + "frames")][0];
plane = new Plane(material, 50, 50);
plane.lookAt(game.camera);
game.addEventListener("render", render, false, 0, true);
}
public function remove():void{
game.removeEventListener("render", render);
}
public function init(_arg1:Game25D, _arg2:Enemy){
var _local3:Number;
var _local4:Class;
var _local5:BitmapData;
var _local6:BitmapMaterial;
game = _arg1;
enemy = _arg2;
spinFrame = 0;
typeNum = (enemy.typeNum + 1);
if (!spawnedTypes[(typeNum - 1)]){
spawnedTypes[(typeNum - 1)] = true;
_local3 = 1;
while (_local3 <= types[(typeNum - 1)]) {
_local4 = (getDefinitionByName(((("E" + typeNum) + "f") + _local3)) as Class);
_local5 = new _local4(0, 0);
_local6 = new BitmapMaterial(_local5);
_local6.doubleSided = true;
Enemy25D[((("E" + typeNum) + "frame") + _local3)] = _local6;
Enemy25D[(("E" + typeNum) + "frames")][(_local3 - 1)] = Enemy25D[((("E" + typeNum) + "frame") + _local3)];
_local3++;
};
};
material = Enemy25D[(("E" + typeNum) + "frames")][0];
plane.lookAt(game.camera);
game.addEventListener("render", render, false, 0, true);
}
private function render(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
plane.x = enemy.x;
plane.z = -(enemy.y);
plane.lookAt(game.camera);
_local2 = Math.floor((enemy.step * stepFrames));
_local3 = Tools.direction4(Math.round(Tools.flashRotation(enemy.angle)));
_local4 = (((_local3 * 2) + _local2) + 1);
plane.material = Enemy25D[(("E" + typeNum) + "frames")][spinFrame];
spinFrame = (spinFrame + 2);
spinFrame = (spinFrame % Enemy25D[(("E" + typeNum) + "frames")].length);
}
}
}//package com.baitgames.towerdefense
Section 21
//Enemy2D (com.baitgames.towerdefense.Enemy2D)
package com.baitgames.towerdefense {
import flash.display.*;
public dynamic class Enemy2D extends MovieClip {
}
}//package com.baitgames.towerdefense
Section 22
//Game (com.baitgames.towerdefense.Game)
package com.baitgames.towerdefense {
import flash.events.*;
import de.polygonal.ds.*;
import flash.display.*;
public class Game extends EventDispatcher {
private var stage:Stage;
public var gridHeight:int;// = 12
public var lives:Number;// = 10
public var bottomBound:Number;
public var gridWidth:int;// = 15
public var enemies:Array;
public var topBound:Number;
public var cash:Number;// = 40
public var sparks:Array;
protected var startY:Number;
protected var startX:Number;
private var maker:Maker;
private var badTimer:Number;// = 400
public var skill:Number;// = 5
private var levels:Array;
public var gridSize:Number;// = 40
protected var goalGridX:int;// = 19
public var blasts:Array;
public var level:int;// = 0
protected var goalGridY:int;// = 8
public var towers:Array;
private var techLevel:int;// = 0
protected var startGridX:int;// = 0
protected var startGridY:int;// = 4
private var controller:TowerDefense;
protected var goalX:Number;
protected var goalY:Number;
public var bullets:Array;
public var players:Array;
public var leftBound:Number;
public var halfGridSize:Number;// = 20
public var maze:Maze;
public var rightBound:Number;
public var gridAge:int;// = 0
private var waveInterval:Number;// = 600
public var enemyGrid:Array2;
public function Game(_arg1:Stage, _arg2:TowerDefense){
skill = 5;
level = 0;
lives = 10;
cash = 40;
badTimer = 400;
waveInterval = 600;
gridWidth = 15;
gridHeight = 12;
gridSize = 40;
halfGridSize = 20;
goalGridX = 19;
goalGridY = 8;
startGridX = 0;
startGridY = 4;
techLevel = 0;
gridAge = 0;
levels = [{list:[3, 3, 3], delay:80, waveInterval:400}, {list:[1, 1, 1], delay:50, waveInterval:400}, {list:[3, 3, 3, 3, 3, 3], delay:40, waveInterval:700}, {list:[1, 1, 1, 1, 1, 1], delay:40, waveInterval:400}, {list:[3, 1, 3, 1, 3], delay:30, waveInterval:400}, {list:[3, 1, 3, 1, 3, 1, 1, 1], delay:25, waveInterval:600}, {list:[0, 0, 0, 0, 0], delay:25, waveInterval:500}, {list:[3, 1, 0, 3, 1, 0, 3, 1, 0], delay:15, waveInterval:600}, {list:[4, 4, 4, 4, 4], delay:15, waveInterval:250}, {list:[4, 0, 4, 0, 4, 0, 4], delay:15, waveInterval:600}, {list:[2, 2, 2], delay:90, waveInterval:1000}, {list:[1, 0, 4, 1, 0, 4, 1, 0, 4, 1, 0, 4], delay:25, waveInterval:600}, {list:[2, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], delay:35, waveInterval:800}, {list:[2, 3, 1, 0, 4, 3, 1, 0, 4], delay:15, waveInterval:600}, {list:[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], delay:10, waveInterval:600}, {list:[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], delay:10, waveInterval:600}, {list:[4, 4, 4, 4, 4, 4, 4, undefined, 4, 4], delay:10, waveInterval:600}, {list:[2, 3, 1, 0, 4, 3, 1, 0, 4], delay:15, waveInterval:600}, {list:[2, 4, 0, 4, 0, 4, 0, 4, 4, 0, 4, 0, 4, 0, 4], delay:10, waveInterval:600}, {list:[2, 2, 2, 2, 2, 2, 2, 2, 2, 2], delay:40, waveInterval:1600}];
super();
halfGridSize = (gridSize / 2);
stage = _arg1;
controller = _arg2;
startGridX = 0;
startGridY = Math.floor((gridHeight / 2));
goalGridX = (gridWidth - 1);
goalGridY = Math.floor((gridHeight / 2));
goalX = ((goalGridX * gridSize) + halfGridSize);
goalY = ((goalGridY * gridSize) + halfGridSize);
startX = ((startGridX * gridSize) + halfGridSize);
startY = ((startGridY * gridSize) + halfGridSize);
leftBound = 0;
rightBound = (gridWidth * gridSize);
topBound = 0;
bottomBound = (gridHeight * gridSize);
controller.addEventListener("gameLoop", gameLoop);
players = [];
enemies = [];
towers = [];
sparks = [];
blasts = [];
bullets = [];
maze = new Maze(gridWidth, gridHeight, gridSize, halfGridSize);
badTimer = (waveInterval - 200);
controller.addMaze(maze);
}
public function addBullet(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Boolean, _arg7:Class, _arg8:Tower, _arg9:Enemy=null):Bullet{
var _local10:Bullet;
_local10 = new _arg7(this, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg8, _arg9);
controller.addBullet(_local10);
return (_local10);
}
private function createWave():void{
if (level < levels.length){
maker = new Maker(this, 0, 0, levels[level].list, levels[level].delay, (level == (levels.length - 1)));
waveInterval = levels[level].waveInterval;
controller.showWave(level);
level++;
dispatchEvent(new Event("newWave"));
//unresolved jump
};
}
public function gelpodShoot():void{
dispatchEvent(new Event("gelpodShoot"));
}
public function checkGridSquare(_arg1:int, _arg2:int):Boolean{
return (!(maze.tileMap.get(_arg1, _arg2)));
}
private function timedEvents():void{
badTimer++;
if (badTimer > waveInterval){
badTimer = 0;
createWave();
};
}
private function lose():void{
var _local1:int;
var _local2:int;
maker.kill();
dispatchEvent(new Event("gameover"));
dispatchEvent(new Event("lose"));
_local1 = enemies.length;
_local2 = 0;
while (_local2 < _local1) {
enemies[_local2].killMe();
controller.removeEnemy(enemies[_local2]);
_local2++;
};
enemies = [];
controller.removeEventListener("gameLoop", gameLoop);
controller.lose();
}
public function addEnemy(_arg1:int, _arg2:Maker):Enemy{
var _local3:Enemy;
_local3 = new Enemy(this, _arg1, controller.isNormal, _arg2);
enemies.push(_local3);
controller.addEnemy(_local3);
return (_local3);
}
public function removeEnemy(_arg1:Enemy):void{
Tools.removeFromArray(enemies, _arg1);
_arg1.killMe();
controller.removeEnemy(_arg1);
}
public function checkGrid(_arg1:Number, _arg2:Number):Boolean{
return (maze.tileMap.get(Math.floor((_arg1 / gridSize)), Math.floor((_arg2 / gridSize))));
}
public function enemyReachGoal(_arg1:Enemy):void{
lives--;
if (lives == 2){
dispatchEvent(new Event("tolleranceLow"));
};
removeEnemy(_arg1);
dispatchEvent(new Event("escaped"));
if (lives == 0){
lose();
};
}
public function launchRocket():void{
dispatchEvent(new Event("launchRocket"));
}
public function playAgain():void{
controller.addEventListener("gameLoop", gameLoop);
maze.reset();
players = [];
enemies = [];
towers = [];
sparks = [];
blasts = [];
bullets = [];
level = 0;
lives = 10;
cash = 40;
waveInterval = 600;
badTimer = (waveInterval - 200);
}
public function checkGrid2(_arg1:Number, _arg2:Number):HitData{
var _local3:int;
var _local4:int;
var _local5:Boolean;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local3 = Math.floor((_arg1 / gridSize));
_local4 = Math.floor((_arg2 / gridSize));
_local5 = !(maze.tileMap.get(_local3, _local4));
_local6 = (_local3 * gridSize);
_local7 = (_local6 + gridSize);
_local8 = (_local4 * gridSize);
_local9 = (_local8 + gridSize);
return (new HitData(_local5, _local6, _local7, _local8, _local9));
}
public function startLaser():void{
dispatchEvent(new Event("startLaser"));
dispatchEvent(new Event("tracking"));
}
public function pulse(_arg1:Number, _arg2:Number):void{
controller.pulse(_arg1, _arg2);
}
public function removeBullet(_arg1:Bullet):void{
_arg1.killMe();
controller.removeBullet(_arg1);
}
public function updateGrid(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):void{
enemyGrid.set(_arg1, _arg2, true);
enemyGrid.set(_arg3, _arg4, true);
enemyGrid.set(_arg5, _arg6, true);
enemyGrid.set(_arg7, _arg8, true);
}
private function gameLoop(_arg1:Event):void{
var _local2:int;
enemyGrid = new Array2(15, 12);
dispatchEvent(new Event("gameLoop"));
timedEvents();
_local2 = Math.min(Math.floor((cash / 5)), 4);
if (_local2 > techLevel){
dispatchEvent(new Event(("level" + _local2)));
};
techLevel = _local2;
}
public function removeSpark(_arg1:Spark):void{
_arg1.remove();
controller.removeSpark(_arg1);
}
public function addSpark(_arg1:Enemy){
var _local2:Spark;
_local2 = new Spark(this, _arg1);
controller.addSpark(_local2);
return (_local2);
}
private function testCollision(_arg1:Bullet, _arg2:Array){
var _local3:int;
var _local4:int;
var _local5:Enemy;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local3 = _arg2.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = _arg2[_local4];
_local6 = (_arg1.x - _local5.x);
_local7 = (_arg1.y - _local5.y);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
if (_local8 < 20){
addBlast(_local5, 0.5, 10);
_local5.hurtMe(_arg1.power, _arg1.angle, _arg1.speed);
removeBullet(_arg1);
if ((_arg1 is Missile)){
dispatchEvent(new Event("rocketImpact"));
} else {
dispatchEvent(new Event("hurtEnemy"));
};
break;
};
_local4++;
};
}
public function hurtEnemy():void{
dispatchEvent(new Event("hurtEnemy"));
}
public function killEnemy(_arg1:Enemy):void{
cash = (cash + (_arg1.cost * 1));
addBlast(_arg1, 1);
removeEnemy(_arg1);
dispatchEvent(new Event("explode"));
}
public function testEnemyCollision(_arg1:Bullet){
testCollision(_arg1, enemies);
}
public function addStructure(_arg1:Number, _arg2:Number, _arg3):void{
var _local4:int;
var _local5:int;
if (cash >= _arg3.costs[0]){
_local4 = _arg1;
_local5 = _arg2;
if (!(((_local4 == 0)) && ((_local5 == 6)))){
if (!enemyGrid.get(_local4, _local5)){
maze.tileMap.set(_local4, _local5, false);
if (AStar.getSquares(startX, startY, goalX, goalY, gridSize, maze.tileMap, false).length > 0){
cash = (cash - _arg3.costs[0]);
addTower(_local4, _local5, _arg3);
} else {
maze.tileMap.set(_local4, _local5, true);
dispatchEvent(new Event("denied"));
};
} else {
dispatchEvent(new Event("denied"));
};
} else {
dispatchEvent(new Event("denied"));
};
} else {
dispatchEvent(new Event("denied"));
dispatchEvent(new Event("insufficient"));
};
}
public function removeBlast(_arg1:Blast):void{
_arg1.remove();
controller.removeBlast(_arg1);
}
public function addBlast(_arg1:Enemy, _arg2:Number=1, _arg3:Number=14){
var _local4:Blast;
_local4 = new Blast(this, _arg1, _arg2, _arg3);
controller.addBlast(_local4);
return (_local4);
}
public function win():void{
var _local1:int;
var _local2:int;
maker.kill();
dispatchEvent(new Event("gameover"));
dispatchEvent(new Event("win"));
_local1 = enemies.length;
_local2 = 0;
while (_local2 < _local1) {
enemies[_local2].killMe();
controller.removeEnemy(enemies[_local2]);
_local2++;
};
enemies = [];
controller.removeEventListener("gameLoop", gameLoop);
controller.win();
}
public function addTower(_arg1:int, _arg2:int, _arg3):void{
var _local4:Tower;
_local4 = new _arg3(this, ((_arg1 * gridSize) + halfGridSize), ((_arg2 * gridSize) + halfGridSize));
controller.addTower(_local4);
gridAge++;
}
public function removeTower(_arg1:Tower):void{
Tools.removeFromArray(towers, _arg1);
_arg1.killMe();
controller.removeTower(_arg1);
}
public function destroy():void{
var _local1:int;
var _local2:int;
if (maker){
maker.kill();
maker = null;
};
dispatchEvent(new Event("gameover"));
dispatchEvent(new Event("destroy"));
_local1 = enemies.length;
_local2 = 0;
while (_local2 < _local1) {
enemies[_local2].killMe();
controller.removeEnemy(enemies[_local2]);
_local2++;
};
enemies = [];
controller.removeEventListener("gameLoop", gameLoop);
}
}
}//package com.baitgames.towerdefense
Section 23
//Game25D (com.baitgames.towerdefense.Game25D)
package com.baitgames.towerdefense {
import flash.events.*;
import org.papervision3d.view.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.objects.*;
import flash.display.*;
import flash.utils.*;
import com.blocmedia.utils.*;
import org.papervision3d.events.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import org.papervision3d.render.*;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
public class Game25D extends MovieClip {
var worldScene:Scene3D;
private var actors:Array;
protected var targetRotationY:Number;// = 0
var camera:FreeCamera3D;
public var classDictionary:Dictionary;
var viewport1stPerson:Viewport3D;
var engine:BasicRenderEngine;
var viewport:Viewport3D;
private var lookup:Dictionary;
var controller:TowerDefense;
var camera1stPerson:FreeCamera3D;
var floorViewport:Viewport3D;
var maze:Maze25D;
var floorScene:Scene3D;
var worldCube:DisplayObject3D;
var game:Game;
private static var spareBullets:Dictionary = new Dictionary();
private static var spareEnemies:Array = [];
private static var spareTowers:Dictionary = new Dictionary();
private static var spareBlasts:Array = [];
private static var spareSparks:Array = [];
public function Game25D(_arg1:TowerDefense){
targetRotationY = 0;
super();
controller = _arg1;
spareBullets[Bullet] = [];
spareBullets[Missile] = [];
spareBullets[LaserBeam] = [];
spareTowers[Tower] = [];
spareTowers[PulseTower] = [];
spareTowers[RocketTower] = [];
spareTowers[LaserTower] = [];
actors = new Array();
lookup = new Dictionary(true);
classDictionary = new Dictionary(true);
classDictionary[Tower] = Tower3D;
classDictionary[RocketTower] = RocketTower3D;
classDictionary[LaserTower] = LaserTower3D;
classDictionary[PulseTower] = PulseTower3D;
classDictionary[Bullet] = Bullet25D;
classDictionary[Missile] = Missile3D;
classDictionary[LaserBeam] = LaserBeam25D;
controller.addEventListener("render", render);
createCamera();
floorViewport = new Viewport3D(0, 0, true, true);
addChild(floorViewport);
viewport = new Viewport3D(0, 0, true, false);
viewport.mouseChildren = false;
viewport.mouseEnabled = false;
addChild(viewport);
createWorld();
}
public function addMaze(_arg1:Maze){
maze = new Maze25D(this, _arg1, controller);
}
public function destroy():void{
spareSparks = null;
spareBlasts = null;
spareEnemies = null;
maze.destroy();
maze = null;
controller.removeEventListener("render", render);
controller = null;
spareBullets = null;
spareTowers = null;
actors = null;
lookup = null;
classDictionary = null;
camera = null;
floorViewport.destroy();
removeChild(floorViewport);
floorViewport = null;
viewport.destroy();
removeChild(viewport);
viewport = null;
engine.destroy();
worldScene = null;
floorScene = null;
game = null;
}
public function addPulseRing(_arg1:Number, _arg2:Number):void{
maze.addPulseRing(_arg1, _arg2);
dispatchEvent(new Event("pulse"));
}
public function addBullet(_arg1:Bullet):void{
var _local2:Bullet25D;
var _local3:Class;
if (spareBullets[_arg1.bulletType].length > 0){
_local2 = spareBullets[_arg1.bulletType].pop();
_local2.init(this, _arg1);
} else {
_local3 = classDictionary[_arg1.bulletType];
_local2 = new _local3(this, _arg1);
};
worldScene.addChild(_local2.geometry);
lookup[_arg1] = _local2;
actors.push(_local2);
}
public function userAddStructure(_arg1:int, _arg2:int):void{
controller.addStructure(_arg1, _arg2);
}
private function createCamera():void{
camera = new FreeCamera3D();
camera.zoom = 50;
camera.focus = 30;
camera.y = 200;
camera.rotationX = -27;
}
public function removeEnemy(_arg1:Enemy):void{
lookup[_arg1].remove();
Tools.removeFromArray(actors, lookup[_arg1]);
worldScene.removeChild(lookup[_arg1].plane);
spareEnemies.push(lookup[_arg1]);
lookup[_arg1] = null;
}
public function addEnemy(_arg1:Enemy):void{
var _local2:int;
var _local3:Enemy25D;
_local2 = spareEnemies.length;
if (spareEnemies.length > 0){
_local3 = spareEnemies.pop();
_local3.init(this, _arg1);
} else {
_local3 = new Enemy25D(this, _arg1);
};
worldScene.addChild(_local3.plane);
lookup[_arg1] = _local3;
actors.push(_local3);
dispatchEvent(new Event("wave"));
}
public function render(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
dispatchEvent(new Event("render"));
camera.z = -600;
camera.zoom = 30;
_local2 = Math.min(mouseX, 550);
targetRotationY = Math2.convert(_local2, 100, 455, -39, 39);
camera.rotationY = (camera.rotationY + ((targetRotationY - camera.rotationY) / 2));
camera.x = Math2.convert(camera.rotationY, -45, 45, 500, 100);
_local3 = Math.min(mouseY, 350);
camera.rotationX = Math2.convert(_local3, 0, 350, -22, -42);
engine.renderScene(floorScene, camera, floorViewport);
engine.renderScene(worldScene, camera, viewport);
}
public function removeBullet(_arg1:Bullet):void{
if (((((_arg1) && (lookup))) && (actors))){
if (lookup[_arg1]){
lookup[_arg1].remove();
Tools.removeFromArray(actors, lookup[_arg1]);
worldScene.removeChild(lookup[_arg1].geometry);
if (spareBullets){
spareBullets[_arg1.bulletType].push(lookup[_arg1]);
};
};
lookup[_arg1] = null;
};
}
public function removeSpark(_arg1:Spark):void{
lookup[_arg1].remove();
Tools.removeFromArray(actors, lookup[_arg1]);
worldScene.removeChild(lookup[_arg1].geometry);
spareSparks.push(lookup[_arg1]);
lookup[_arg1] = null;
}
public function addSpark(_arg1:Spark):void{
var _local2:Spark25D;
if (spareSparks.length > 0){
_local2 = spareSparks.pop();
_local2.init(this, _arg1);
} else {
_local2 = new Spark25D(this, _arg1, SparkFrames);
};
worldScene.addChild(_local2.geometry);
lookup[_arg1] = _local2;
actors.push(_local2);
}
public function removeBlast(_arg1:Blast):void{
lookup[_arg1].remove();
Tools.removeFromArray(actors, lookup[_arg1]);
worldScene.removeChild(lookup[_arg1].geometry);
spareBlasts.push(lookup[_arg1]);
lookup[_arg1] = null;
}
public function addBlast(_arg1:Blast):void{
var _local2:Blast25D;
if (spareBlasts.length > 0){
_local2 = spareBlasts.pop();
_local2.init(this, _arg1);
} else {
_local2 = new Blast25D(this, _arg1, SparkFrames);
};
worldScene.addChild(_local2.geometry);
lookup[_arg1] = _local2;
actors.push(_local2);
}
public function removeTower(_arg1:Tower):void{
lookup[_arg1].remove();
Tools.removeFromArray(actors, lookup[_arg1]);
worldScene.removeChild(lookup[_arg1].turret);
worldScene.removeChild(lookup[_arg1].base);
spareTowers[_arg1.towerType].push(lookup[_arg1]);
lookup[_arg1] = null;
}
public function addTower(_arg1:Tower):void{
var _local2:Tower3D;
var _local3:Class;
if (spareTowers[_arg1.towerType].length > 0){
_local2 = spareTowers[_arg1.towerType].pop();
_local2.init(this, _arg1);
} else {
_local3 = classDictionary[_arg1.towerType];
_local2 = new _local3(this, _arg1);
};
worldScene.addChild(_local2.turret);
worldScene.addChild(_local2.base);
lookup[_arg1] = _local2;
actors.push(_local2);
dispatchEvent(new Event("addTower"));
}
private function createWorld():void{
worldScene = new Scene3D();
floorScene = new Scene3D();
engine = new BasicRenderEngine();
}
}
}//package com.baitgames.towerdefense
Section 24
//Game2D (com.baitgames.towerdefense.Game2D)
package com.baitgames.towerdefense {
import flash.display.*;
public dynamic class Game2D extends MovieClip {
public var world:MovieClip;
}
}//package com.baitgames.towerdefense
Section 25
//GridMove (com.baitgames.towerdefense.GridMove)
package com.baitgames.towerdefense {
public class GridMove {
public var x:int;
public var y:int;
public var dir:int;
public function GridMove(_arg1:int, _arg2:int, _arg3:int=0){
this.x = _arg1;
this.y = _arg2;
this.dir = _arg3;
}
}
}//package com.baitgames.towerdefense
Section 26
//HitData (com.baitgames.towerdefense.HitData)
package com.baitgames.towerdefense {
public class HitData {
public var left:Number;
public var bottom:Number;
public var hit:Boolean;
public var top:Number;
public var right:Number;
public function HitData(_arg1:Boolean, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
this.hit = _arg1;
this.left = _arg2;
this.right = _arg3;
this.top = _arg4;
this.bottom = _arg5;
}
}
}//package com.baitgames.towerdefense
Section 27
//LaserBeam (com.baitgames.towerdefense.LaserBeam)
package com.baitgames.towerdefense {
import flash.events.*;
import flash.display.*;
public class LaserBeam extends Bullet {
public var target:Enemy;
protected var side:Number;// = 0
protected var turnSpeed:Number;// = 0.1
public var beamLength:Number;// = 0
protected var counter:int;// = 0
protected var mounted:Boolean;// = true
public function LaserBeam(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean, _arg8:Tower, _arg9:Enemy){
counter = 0;
turnSpeed = 0.1;
mounted = true;
side = 0;
beamLength = 0;
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
bulletType = LaserBeam;
target = _arg9;
speed = 0;
scale = 0.1;
}
override protected function init():void{
}
override protected function gameLoop(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
counter++;
_local2 = (Math.sin(tower.angle) * 15);
_local3 = (Math.cos(tower.angle) * 15);
x = (tower.x + _local2);
y = (tower.y + _local3);
dx = (target.x - x);
dy = (target.y - y);
angle = Math.atan2(dx, dy);
beamLength = Math.sqrt(((dx * dx) + (dy * dy)));
if (counter < 6){
scale = (scale + 0.2);
} else {
if (!target.alive){
scale = (scale - 0.2);
if (scale < 0){
game.removeBullet(this);
};
};
};
}
}
}//package com.baitgames.towerdefense
Section 28
//LaserBeam25D (com.baitgames.towerdefense.LaserBeam25D)
package com.baitgames.towerdefense {
import flash.events.*;
import org.papervision3d.view.*;
import org.papervision3d.objects.*;
import flash.display.*;
import org.papervision3d.events.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import org.papervision3d.render.*;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
public class LaserBeam25D extends Bullet25D {
protected var laserPlane;
protected var added;// = 0
public static var isAdam:Boolean = true;
public static var bitmap:BitmapData;
public function LaserBeam25D(_arg1:Game25D, _arg2:Bullet){
added = 0;
super(_arg1, _arg2);
}
override protected function render(_arg1:Event):void{
added++;
if (added > 2){
added = true;
geometry.addChild(laserPlane);
};
geometry.scaleY = bullet.scale;
geometry.rotationY = Tools.flashRotation((bullet.angle - (Math.PI / 2)));
geometry.rotationX = 90;
geometry.x = bullet.x;
geometry.z = -(bullet.y);
geometry.y = 20;
geometry.scaleX = (bullet.beamLength / 1000);
}
override protected function createGeometry():void{
if (LaserBeam25D.isAdam){
LaserBeam25D.isAdam = false;
bitmap = new BeamTexture(0, 0);
};
material = new BitmapMaterial(bitmap);
material.doubleSided = true;
geometry = new DisplayObject3D();
laserPlane = new Plane(material, 1000, 12, 4, 1);
laserPlane.x = 500;
geometry.x = bullet.x;
geometry.z = -(bullet.y);
geometry.y = 20;
geometry.rotationY = Tools.flashRotation((bullet.angle - (Math.PI / 2)));
geometry.rotationX = 90;
}
}
}//package com.baitgames.towerdefense
Section 29
//LaserTower (com.baitgames.towerdefense.LaserTower)
package com.baitgames.towerdefense {
import flash.events.*;
import flash.display.*;
import com.blocmedia.utils.*;
public class LaserTower extends Tower {
protected var pauseCounter:int;// = 0
public var endBeam:Boolean;
protected var beam:LaserBeam;
protected var hasTarget:Boolean;// = false
public static var speeds:Array = [7, 8, 20, 25];
public static var ranges:Array = [300, 100, 200, 400];
public static var rates:Array = [30, 30, 20, 10];
public static var costs:Array = [15, 15, 20, 25];
public static var powers:Array = [0.75, 25, 30, 40];
public function LaserTower(_arg1:Game, _arg2:Number, _arg3:Number){
hasTarget = false;
pauseCounter = 0;
super(_arg1, _arg2, _arg3);
towerType = LaserTower;
ammoType = LaserBeam;
attackRange = ranges[0];
shootInterval = rates[0];
}
override protected function defend():void{
var _local1:TargetData;
var _local2:Enemy;
var _local3:Number;
var _local4:*;
var _local5:*;
shootTimer++;
if (hasTarget){
if (target.alive){
pauseCounter = 0;
dx = (target.x - x);
dy = (target.y - y);
angle = Math.atan2(dx, dy);
target.hurtMe(powers[0], angle, 1);
} else {
endBeam = true;
pauseCounter++;
if (pauseCounter > 5){
hasTarget = false;
};
};
} else {
_local1 = getClosestEnemy();
if (_local1.found){
target = _local1.target;
_local2 = _local1.target;
dx = (_local2.x - x);
dy = (_local2.y - y);
_local3 = Math.sqrt(((dx * dx) + (dy * dy)));
_local4 = Math.atan2(dx, dy);
_local5 = Math2.smallestAngle(angle, _local4);
angle = (angle + (_local5 * 0.25));
if (_local3 < attackRange){
if (shootTimer >= rates[level]){
hasTarget = true;
target = _local2;
beam = game.addBullet(x, y, speeds[level], angle, powers[level], false, ammoType, this, _local2);
game.addSpark(_local2);
shootTimer = 0;
endBeam = false;
game.startLaser();
};
};
};
};
}
}
}//package com.baitgames.towerdefense
Section 30
//LaserTower3D (com.baitgames.towerdefense.LaserTower3D)
package com.baitgames.towerdefense {
import flash.events.*;
import org.papervision3d.view.*;
import org.papervision3d.objects.*;
import flash.display.*;
import org.papervision3d.events.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import com.baitgames.towerdefense.papervisionmodels.*;
import org.papervision3d.render.*;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
public class LaserTower3D extends Tower3D {
private static var baseMaterial:BitmapMaterial;
private static var material:BitmapMaterial;
public function LaserTower3D(_arg1:Game25D, _arg2:Tower){
super(_arg1, _arg2);
}
override protected function createGeometry():void{
var _local1:BitmapMaterial;
if (!material){
material = new BitmapMaterial(new LaserTowerTexture(0, 0));
material.doubleSided = true;
};
turret = new Laser(material);
if (!_local1){
_local1 = new BitmapMaterial(new LaserBase(0, 0));
};
base = new Base(_local1);
}
}
}//package com.baitgames.towerdefense
Section 31
//Maker (com.baitgames.towerdefense.Maker)
package com.baitgames.towerdefense {
import flash.events.*;
import flash.display.*;
public class Maker extends EventDispatcher {
protected var interval:int;
protected var spawnList:Array;
protected var spawnNum:int;// = 0
protected var gridX:Number;// = 0
protected var gridY:Number;// = 0
protected var myName:String;
protected var numSpawn:int;
protected var game:Game;
public var gridSize:Number;// = 34
public var enemyList:Array;
public var isFinal:Boolean;// = false
public var x:Number;// = 0
public var y:Number;// = 0
public var halfGridSize:Number;// = 17
protected var age:int;// = 0
public function Maker(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:int, _arg6:Boolean){
x = 0;
y = 0;
gridX = 0;
gridY = 0;
age = 0;
gridSize = 34;
halfGridSize = 17;
spawnNum = 0;
isFinal = false;
enemyList = [];
super();
this.game = _arg1;
this.x = _arg2;
this.y = _arg3;
this.spawnList = _arg4;
this.isFinal = _arg6;
this.numSpawn = _arg4.length;
this.interval = _arg5;
gridSize = _arg1.gridSize;
halfGridSize = _arg1.halfGridSize;
_arg1.addEventListener("gameLoop", gameLoop);
}
public function killEnemy(_arg1:Enemy):void{
Tools.removeFromArray(enemyList, _arg1);
if ((((enemyList.length == 0)) && ((spawnNum >= numSpawn)))){
if (isFinal){
game.win();
};
};
}
public function kill():void{
game.removeEventListener("gameLoop", gameLoop);
}
protected function gameLoop(_arg1:Event):void{
age++;
if ((age % interval) == 0){
enemyList.push(game.addEnemy(spawnList[spawnNum], this));
spawnNum++;
if (spawnNum >= numSpawn){
kill();
};
};
}
}
}//package com.baitgames.towerdefense
Section 32
//Maze (com.baitgames.towerdefense.Maze)
package com.baitgames.towerdefense {
import de.polygonal.ds.*;
import com.blocmedia.utils.*;
public class Maze {
public var width:int;// = 20
public var gridSize:Number;// = 34
public var halfGridSize:Number;// = 17
var tileMap:Array2;
public var height:int;// = 20
public function Maze(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number){
width = 20;
height = 20;
gridSize = 34;
halfGridSize = 17;
super();
gridSize = _arg3;
halfGridSize = _arg4;
width = _arg1;
height = _arg2;
reset();
}
public function destroy():void{
tileMap = null;
}
public function reset():void{
var _local1:int;
var _local2:int;
var _local3:Boolean;
tileMap = new Array2(width, height);
_local1 = 0;
while (_local1 < width) {
_local2 = 0;
while (_local2 < height) {
if ((((((((_local1 == 0)) || ((_local1 == (width - 1))))) || ((_local2 == 0)))) || ((_local2 == (height - 1))))){
tileMap.set(_local1, _local2, false);
} else {
_local3 = Math2.randomBool(0.05);
_local3 = true;
tileMap.set(_local1, _local2, _local3);
};
if ((((_local1 == 0)) && ((_local2 == Math.floor((height / 2)))))){
tileMap.set(_local1, _local2, true);
};
if ((((_local1 == (width - 1))) && ((_local2 == Math.floor((height / 2)))))){
tileMap.set(_local1, _local2, true);
};
_local2++;
};
_local1++;
};
}
}
}//package com.baitgames.towerdefense
Section 33
//Maze25D (com.baitgames.towerdefense.Maze25D)
package com.baitgames.towerdefense {
import flash.events.*;
import org.papervision3d.view.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.objects.*;
import flash.display.*;
import org.papervision3d.events.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import org.papervision3d.render.*;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
public class Maze25D extends EventDispatcher {
private var spareRings:Array;
var updateFloor:Boolean;// = false
var maze:Maze;
protected var rings:Array;
var controller:TowerDefense;
private var planes:Array;
public var gridSize:Number;// = 34
private var bigCube:Cube;
var material:MovieMaterial;
private var game:Game25D;
protected var ringWidth:Number;// = 200
public var halfGridSize:Number;// = 17
var floorClip:MovieClip;
public function Maze25D(_arg1:Game25D, _arg2:Maze, _arg3:TowerDefense){
gridSize = 34;
halfGridSize = 17;
updateFloor = false;
ringWidth = 200;
rings = [];
spareRings = [];
planes = [];
super();
game = _arg1;
maze = _arg2;
controller = _arg3;
gridSize = maze.gridSize;
halfGridSize = maze.halfGridSize;
addFloor();
addWalls();
addSkyBox();
game.addEventListener("render", render);
}
private function clickSquare(_arg1:MouseEvent):void{
if (maze.tileMap.get(_arg1.target.gridX, _arg1.target.gridY)){
game.userAddStructure(_arg1.target.gridX, _arg1.target.gridY);
};
}
public function addPulseRing(_arg1:Number, _arg2:Number):void{
var _local3:Ring25D;
_local3 = new Ring25D(game, this);
_local3.width = (ringWidth * (100 / 40));
_local3.height = (ringWidth * (100 / 40));
_local3.x = ((_arg1 * (100 / 40)) - ((ringWidth * (100 / 40)) / 2));
_local3.y = ((_arg2 * (100 / 40)) - ((ringWidth * (100 / 40)) / 2));
floorClip.addChild(_local3);
rings.push(_local3);
material.drawBitmap();
}
public function destroy():void{
var _local1:int;
var _local2:int;
_local1 = planes.length;
_local2 = 0;
while (_local2 < _local1) {
game.worldScene.removeChild(planes[_local2]);
_local2++;
};
planes = null;
game.floorScene.removeChild(bigCube);
game.floorScene.removeChild(plane);
floorClip = null;
material = null;
rings = null;
spareRings = null;
game.removeEventListener("render", render);
game = null;
maze = null;
controller = null;
}
public function removePulseRing(_arg1:Ring25D){
Tools.removeFromArray(rings, _arg1);
}
protected function render(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:int;
_local2 = rings.length;
_local3 = 0;
_local4 = 0;
while (_local4 < _local2) {
if (rings[_local4].age > 5){
_local3++;
};
_local4++;
};
if (_local3 > 0){
material.drawBitmap();
updateFloor = true;
} else {
if (updateFloor){
material.drawBitmap();
updateFloor = false;
};
};
}
private function addWalls():void{
var _local1:*;
var _local2:Number;
var _local3:Number;
var _local4:Boolean;
var _local5:Boolean;
var _local6:Boolean;
var _local7:*;
_local1 = new BitmapMaterial(new wallTile(0, 0));
_local1.doubleSided = true;
_local2 = 0;
while (_local2 < maze.tileMap.width) {
_local3 = 0;
for (;_local3 < maze.tileMap.height;_local3++) {
if (!maze.tileMap.get(_local2, _local3)){
_local7 = new Plane(_local1, gridSize, gridSize);
_local7.x = ((_local2 * gridSize) + halfGridSize);
_local7.z = (((-(_local3) * gridSize) + halfGridSize) - gridSize);
_local7.y = (gridSize / 4);
_local7.rotationX = -90;
game.worldScene.addChild(_local7);
planes.push(_local7);
_local4 = false;
if (((maze.tileMap.get(_local2, (_local3 + 1))) || ((_local3 == (maze.tileMap.height - 1))))){
_local4 = true;
};
_local5 = (maze.tileMap.get((_local2 - 1), _local3)) ? true : false;
_local6 = (maze.tileMap.get((_local2 + 1), _local3)) ? true : false;
if (_local4){
_local7 = new Plane(_local1, gridSize, halfGridSize);
_local7.x = ((_local2 * gridSize) + halfGridSize);
_local7.z = ((-(_local3) * gridSize) - gridSize);
game.worldScene.addChild(_local7);
planes.push(_local7);
//unresolved jump
};
if (_local5){
_local7 = new Plane(_local1, gridSize, halfGridSize);
_local7.x = (((_local2 * gridSize) - halfGridSize) + halfGridSize);
_local7.z = (((-(_local3) * gridSize) + halfGridSize) - gridSize);
_local7.rotationY = -90;
game.worldScene.addChild(_local7);
planes.push(_local7);
//unresolved jump
};
if (_local6){
_local7 = new Plane(_local1, gridSize, halfGridSize);
_local7.x = (((_local2 * gridSize) + halfGridSize) + halfGridSize);
_local7.z = (((-(_local3) * gridSize) + halfGridSize) - gridSize);
_local7.rotationY = -90;
game.worldScene.addChild(_local7);
planes.push(_local7);
continue;
};
};
};
_local2++;
};
}
private function rollOut(_arg1:MouseEvent):void{
_arg1.target.alpha = 1;
}
private function addFloor():void{
var _local1:Number;
var _local2:Number;
var _local3:GridSquare;
floorClip = new MovieClip();
_local1 = 0;
while (_local1 < maze.tileMap.width) {
_local2 = 0;
while (_local2 < maze.tileMap.height) {
_local3 = new GridSquare();
_local3.addEventListener(MouseEvent.MOUSE_DOWN, clickSquare);
_local3.width = 100;
_local3.height = 100;
_local3.gridX = _local1;
_local3.gridY = _local2;
_local3.x = (100 * _local1);
_local3.y = (100 * _local2);
floorClip.addChild(_local3);
_local2++;
};
_local1++;
};
floorClip.mouseEnabled = false;
material = new MovieMaterial(floorClip, true);
material.interactive = true;
material.doubleSided = true;
plane = new Plane(material, (maze.tileMap.width * gridSize), (maze.tileMap.height * gridSize), Math.floor((maze.tileMap.width / 1)), Math.floor((maze.tileMap.height / 1)));
plane.x = ((maze.tileMap.width * 0.5) * gridSize);
plane.z = -(((maze.tileMap.height * 0.5) * gridSize));
plane.y = -((gridSize / 4));
plane.rotationX = -90;
game.floorScene.addChild(plane);
}
protected function addSkyBox():void{
var _local1:*;
var _local2:MaterialsList;
_local1 = new BitmapMaterial(new SkyBox(0, 0), true);
_local1.doubleSided = true;
_local2 = new MaterialsList();
_local2.addMaterial(_local1, "all");
bigCube = new Cube(_local2, 2000, 2000, 2000, 4, 4, 4, 1);
game.floorScene.addChild(bigCube);
}
private function rollOver(_arg1:MouseEvent):void{
_arg1.target.alpha = 0.5;
}
}
}//package com.baitgames.towerdefense
Section 34
//Missile (com.baitgames.towerdefense.Missile)
package com.baitgames.towerdefense {
import flash.events.*;
import flash.display.*;
import com.blocmedia.utils.*;
public class Missile extends Bullet {
public var target:Enemy;
protected var side:Number;// = 0
protected var turnSpeed:Number;// = 0.1
protected var counter:int;// = 0
protected var mounted:Boolean;// = true
public function Missile(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean, _arg8:Tower, _arg9:Enemy=null){
counter = 0;
turnSpeed = 0.1;
mounted = true;
side = 0;
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
bulletType = Missile;
side = speed;
speed = 0;
scale = 0.1;
z = 15;
}
override protected function init():void{
x = (x + (dx * 2));
y = (y + (dy * 2));
}
protected function getClosestEnemy():Object{
var _local1:int;
var _local2:Number;
var _local3:Enemy;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Enemy;
var _local8:Boolean;
var _local9:int;
_local1 = game.enemies.length;
if (_local1 > 0){
_local2 = 9999999999999;
_local8 = false;
_local9 = 0;
while (_local9 < _local1) {
_local3 = game.enemies[_local9];
_local4 = (_local3.x - this.x);
_local5 = (_local3.y - this.y);
_local6 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
if (_local6 < _local2){
_local2 = _local6;
_local7 = _local3;
_local8 = true;
};
_local9++;
};
return (new TargetData(_local8, _local7, _local2));
//unresolved jump
};
return (new TargetData(false));
}
override protected function gameLoop(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:TargetData;
var _local5:Enemy;
var _local6:*;
var _local7:*;
if (scale < 1){
scale = (scale + 0.1);
};
if (mounted){
_local2 = (Math.sin((tower.angle + ((Math.PI * 0.5) * side))) * 8);
_local3 = (Math.cos((tower.angle + ((Math.PI * 0.5) * side))) * 8);
x = (tower.x + _local2);
y = (tower.y + _local3);
angle = tower.angle;
} else {
if (z > 0){
z--;
};
counter++;
if (counter < 10){
_local2 = (Math.sin((angle + ((Math.PI * 0.5) * side))) * 5);
_local3 = (Math.cos((angle + ((Math.PI * 0.5) * side))) * 5);
x = (x + _local2);
y = (y + _local3);
};
if (counter > 5){
if (speed < 9){
speed = (speed + 3);
};
};
_local4 = getClosestEnemy();
if (_local4.found){
_local5 = _local4.target;
dx = (_local5.x - x);
dy = (_local5.y - y);
_local6 = Math.atan2(dx, dy);
_local7 = Math2.smallestAngle(angle, _local6);
angle = (angle + Math2.limit(_local7, turnSpeed));
};
dx = (Math.sin(angle) * speed);
dy = (Math.cos(angle) * speed);
x = (x + dx);
y = (y + dy);
game.testEnemyCollision(this);
if ((((((((x < game.leftBound)) || ((x > game.rightBound)))) || ((y < game.topBound)))) || ((y > game.bottomBound)))){
game.removeBullet(this);
};
};
}
public function launch():void{
mounted = false;
}
}
}//package com.baitgames.towerdefense
Section 35
//Missile3D (com.baitgames.towerdefense.Missile3D)
package com.baitgames.towerdefense {
import flash.events.*;
import org.papervision3d.view.*;
import org.papervision3d.objects.*;
import flash.display.*;
import org.papervision3d.events.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import com.baitgames.towerdefense.papervisionmodels.*;
import org.papervision3d.render.*;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
public class Missile3D extends Bullet25D {
public static var isAdam:Boolean = true;
public static var bitmap:BitmapData;
public function Missile3D(_arg1:Game25D, _arg2:Bullet){
super(_arg1, _arg2);
}
override protected function render(_arg1:Event):void{
geometry.x = bullet.x;
geometry.z = -(bullet.y);
geometry.y = bullet.z;
geometry.scaleX = (10 * bullet.scale);
geometry.scaleY = (10 * bullet.scale);
geometry.scaleZ = (10 * bullet.scale);
geometry.rotationY = Tools.flashRotation((bullet.angle - (Math.PI / 2)));
}
override protected function createGeometry():void{
material = new BitmapMaterial(new MissileTexture(0, 0));
material.doubleSided = true;
geometry = new MissileModel(material);
geometry.scaleX = (10 * bullet.scale);
geometry.scaleY = (10 * bullet.scale);
geometry.scaleZ = (10 * bullet.scale);
geometry.y = 15;
}
}
}//package com.baitgames.towerdefense
Section 36
//PulseTower (com.baitgames.towerdefense.PulseTower)
package com.baitgames.towerdefense {
import flash.events.*;
import flash.display.*;
public class PulseTower extends Tower {
protected var targets:Array;
public var z:Number;// = 0
public static var speeds:Array = [7, 8, 20, 25];
public static var ranges:Array = [50, 100, 200, 400];
public static var rates:Array = [105, 30, 20, 10];
public static var costs:Array = [10, 150, 20, 25];
public static var powers:Array = [40, 25, 30, 40];
public function PulseTower(_arg1:Game, _arg2:Number, _arg3:Number){
targets = [];
z = 0;
super(_arg1, _arg2, _arg3);
towerType = PulseTower;
}
protected function pulse():void{
var _local1:int;
var _local2:int;
_local1 = targets.length;
_local2 = 0;
while (_local2 < _local1) {
game.addBlast(targets[_local2], 0.5, 10);
targets[_local2].hurtMe(powers[0], 0, 1);
_local2++;
};
game.pulse(x, y);
}
override protected function defend():void{
shootTimer++;
if (shootTimer < 1){
if (z > 0){
z = (z - 0.5);
} else {
z = 0;
};
} else {
z = Math.min((shootTimer / 100), 0.5);
};
angle = (angle + z);
if (shootTimer > rates[0]){
checkPulse();
};
}
protected function checkPulse():void{
var _local1:Number;
var _local2:Enemy;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Boolean;
var _local7:int;
var _local8:int;
_local1 = ranges[0];
_local6 = false;
targets = [];
_local7 = game.enemies.length;
_local8 = 0;
while (_local8 < _local7) {
_local2 = game.enemies[_local8];
_local3 = (_local2.x - this.x);
_local4 = (_local2.y - this.y);
_local5 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
if (_local5 < ranges[1]){
targets.push(_local2);
if (_local5 < _local1){
_local6 = true;
};
};
_local8++;
};
if (_local6){
pulse();
shootTimer = 0;
};
}
}
}//package com.baitgames.towerdefense
Section 37
//PulseTower3D (com.baitgames.towerdefense.PulseTower3D)
package com.baitgames.towerdefense {
import flash.events.*;
import org.papervision3d.view.*;
import org.papervision3d.objects.*;
import flash.display.*;
import org.papervision3d.events.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import com.baitgames.towerdefense.papervisionmodels.*;
import org.papervision3d.render.*;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
public class PulseTower3D extends Tower3D {
private static var baseMaterial:BitmapMaterial;
private static var material:BitmapMaterial;
public function PulseTower3D(_arg1:Game25D, _arg2:Tower){
super(_arg1, _arg2);
}
override protected function createGeometry():void{
var _local1:BitmapMaterial;
if (!material){
material = new BitmapMaterial(new PulseTowerTexture(0, 0));
material.doubleSided = true;
};
turret = new Pulse(material);
if (!_local1){
_local1 = new BitmapMaterial(new PulseBase(0, 0));
};
base = new Base(_local1);
}
override protected function render(_arg1:Event):void{
turret.x = tower.x;
turret.z = -(tower.y);
turret.y = (tower.z * 30);
turret.rotationY = Tools.flashRotation(tower.angle);
base.x = tower.x;
base.z = -(tower.y);
base.y = -10;
}
}
}//package com.baitgames.towerdefense
Section 38
//Ring25D (com.baitgames.towerdefense.Ring25D)
package com.baitgames.towerdefense {
import flash.events.*;
import flash.display.*;
public class Ring25D extends Sprite {
protected var game25D:Game25D;
protected var maze25D:Maze25D;
public var age:int;// = 0
public static var isAdam:Boolean = true;
public static var bmp:BitmapData;
public function Ring25D(_arg1:Game25D, _arg2:Maze25D){
age = 0;
super();
game25D = _arg1;
maze25D = _arg2;
if (isAdam){
isAdam = false;
bmp = new Ring(0, 0);
};
addChild(new Bitmap(bmp));
game25D.addEventListener("render", render);
}
private function render(_arg1:Event):void{
age++;
if (age > 5){
alpha = (alpha - 0.35);
if (alpha <= 0){
remove();
};
};
}
public function remove():void{
maze25D.removePulseRing(this);
parent.removeChild(this);
game25D.removeEventListener("render", render);
}
}
}//package com.baitgames.towerdefense
Section 39
//RocketTower (com.baitgames.towerdefense.RocketTower)
package com.baitgames.towerdefense {
import flash.events.*;
import flash.display.*;
import com.blocmedia.utils.*;
public class RocketTower extends Tower {
protected var loaded:Boolean;// = true
protected var missile1;
protected var missile2;
public static var speeds:Array = [7, 8, 20, 25];
public static var ranges:Array = [1000, 100, 200, 400];
public static var rates:Array = [150, 30, 20, 10];
public static var costs:Array = [20, 15, 20, 25];
public static var powers:Array = [55, 25, 30, 40];
public function RocketTower(_arg1:Game, _arg2:Number, _arg3:Number){
loaded = true;
super(_arg1, _arg2, _arg3);
towerType = RocketTower;
ammoType = Missile;
attackRange = ranges[0];
loadAmmo();
}
override protected function defend():void{
var _local1:Object;
var _local2:Enemy;
var _local3:Number;
var _local4:*;
var _local5:*;
shootTimer++;
_local1 = getClosestEnemy();
if (_local1.found){
_local2 = _local1.target;
dx = (_local2.x - x);
dy = (_local2.y - y);
_local3 = Math.sqrt(((dx * dx) + (dy * dy)));
_local4 = Math.atan2(dx, dy);
_local5 = Math2.smallestAngle(angle, _local4);
angle = (angle + (_local5 * 0.25));
if (_local3 < attackRange){
if (shootTimer >= rates[level]){
shootTimer = 0;
missile1.launch();
missile2.launch();
game.launchRocket();
loadAmmo();
};
};
};
}
protected function loadAmmo():void{
loaded = true;
missile1 = game.addBullet(x, y, 1, angle, powers[level], false, ammoType, this);
missile2 = game.addBullet(x, y, -1, angle, powers[level], false, ammoType, this);
}
}
}//package com.baitgames.towerdefense
Section 40
//RocketTower3D (com.baitgames.towerdefense.RocketTower3D)
package com.baitgames.towerdefense {
import flash.events.*;
import org.papervision3d.view.*;
import org.papervision3d.objects.*;
import flash.display.*;
import org.papervision3d.events.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import com.baitgames.towerdefense.papervisionmodels.*;
import org.papervision3d.render.*;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
public class RocketTower3D extends Tower3D {
private static var baseMaterial:BitmapMaterial;
private static var material:BitmapMaterial;
public function RocketTower3D(_arg1:Game25D, _arg2:Tower){
super(_arg1, _arg2);
}
override protected function createGeometry():void{
var _local1:BitmapMaterial;
if (!material){
material = new BitmapMaterial(new RocketTowerTexture(0, 0));
material.doubleSided = true;
};
turret = new MissileRack(material);
if (!_local1){
_local1 = new BitmapMaterial(new MissileBase(0, 0));
};
base = new Base(_local1);
}
}
}//package com.baitgames.towerdefense
Section 41
//SoundBox (com.baitgames.towerdefense.SoundBox)
package com.baitgames.towerdefense {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.utils.*;
public class SoundBox {
protected var userVolume:Number;// = 0
protected var delayedSounds:Dictionary;
protected var cachedSounds:Object;
public var volumes:Dictionary;
protected var makoActive:Boolean;// = false
protected var echoTimer:Timer;
protected var echoNum:int;// = 0
protected var makoSound:SoundChannel;
public var soundChannels:Dictionary;
public function SoundBox(_arg1:Game25D, _arg2:TowerDefense, _arg3:Game, _arg4:UserInterface){
soundChannels = new Dictionary();
volumes = new Dictionary();
userVolume = 0;
delayedSounds = new Dictionary();
makoActive = false;
echoNum = 0;
cachedSounds = {};
super();
play("MusicSound", true, 0.3);
_arg1.addEventListener("addTower", playSound, false, 0, true);
_arg1.addEventListener("wave", playSound, false, 0, true);
_arg1.addEventListener("pulse", playSound, false, 0, true);
_arg3.addEventListener("launchRocket", playSound, false, 0, true);
_arg3.addEventListener("explode", playSound, false, 0, true);
_arg3.addEventListener("escaped", playSound, false, 0, true);
_arg3.addEventListener("startLaser", playSound, false, 0, true);
_arg3.addEventListener("tolleranceLow", delayedMako, false, 0, true);
_arg3.addEventListener("newWave", playMakoSound, false, 0, true);
_arg3.addEventListener("level1", delayedMako, false, 0, true);
_arg3.addEventListener("level2", delayedMako, false, 0, true);
_arg3.addEventListener("level3", delayedMako, false, 0, true);
_arg3.addEventListener("level4", delayedMako, false, 0, true);
_arg3.addEventListener("insufficient", playMakoSound, false, 0, true);
_arg3.addEventListener("denied", playSound, false, 0, true);
_arg3.addEventListener("win", playMakoSound, false, 0, true);
_arg3.addEventListener("lose", playMakoSound, false, 0, true);
_arg3.addEventListener("gelpodShoot", playQuietSound, false, 0, true);
_arg3.addEventListener("hurtEnemy", playQuietSound, false, 0, true);
_arg3.addEventListener("rocketImpact", playQuietSound, false, 0, true);
_arg4.addEventListener("buttonClick", playSound, false, 0, true);
_arg4.addEventListener("insufficient", playMakoSound, false, 0, true);
_arg4.addEventListener("denied", playSound, false, 0, true);
_arg3.addEventListener("destroy", destroy);
}
protected function delayedHandler(_arg1:TimerEvent):void{
var _local2:String;
_local2 = delayedSounds[_arg1.target];
play(_local2);
delayedSounds[_arg1.target] = null;
}
protected function destroy(_arg1:Event):void{
var _local2:*;
if (makoSound){
makoSound.removeEventListener(Event.SOUND_COMPLETE, makoSoundComplete);
makoSound = null;
};
for (_local2 in soundChannels) {
if (soundChannels[_local2]){
soundChannels[_local2].removeEventListener(Event.SOUND_COMPLETE, completeHandler);
soundChannels[_local2].stop();
soundChannels[_local2] = null;
};
};
soundChannels = null;
volumes = null;
for (_local2 in delayedSounds) {
if (delayedSounds[_local2]){
delayedSounds[_local2].removeEventListener(TimerEvent.TIMER, delayedHandler);
delayedSounds[_local2].stop();
delayedSounds[_local2] = null;
};
};
delayedSounds = null;
cachedSounds = null;
}
protected function delayedSound(_arg1:String, _arg2:int=1000):void{
var _local3:Timer;
_local3 = new Timer(_arg2, 1);
_local3.addEventListener(TimerEvent.TIMER, delayedHandler);
_local3.start();
delayedSounds[_local3] = _arg1;
}
protected function makoSoundComplete(_arg1:Event):void{
makoActive = false;
}
protected function completeHandler(_arg1:Event):void{
_arg1.target.removeEventListener(Event.SOUND_COMPLETE, completeHandler);
_arg1.target.stop();
volumes[_arg1.target] = null;
soundChannels[_arg1.target] = null;
}
protected function playQuietSound(_arg1:Event):void{
play(_arg1.type, false, 0.3);
}
public function setVolume(_arg1:Number):void{
var _local2:*;
var _local3:SoundTransform;
userVolume = _arg1;
for (_local2 in soundChannels) {
if (soundChannels[_local2]){
_local3 = soundChannels[_local2].soundTransform;
_local3.volume = (_arg1 * volumes[_local2]);
soundChannels[_local2].soundTransform = _local3;
};
};
}
protected function playMakoSound(_arg1:Event):void{
if (makoSound){
makoSound.removeEventListener(Event.SOUND_COMPLETE, makoSoundComplete);
makoSound.stop();
};
makoSound = play(_arg1.type);
makoActive = true;
makoSound.addEventListener(Event.SOUND_COMPLETE, makoSoundComplete);
}
public function mute(_arg1:Event=null):void{
var _local2:*;
var _local3:SoundTransform;
for (_local2 in soundChannels) {
_local3 = soundChannels[_local2].soundTransform;
_local3.volume = 0;
soundChannels[_local2].soundTransform = _local3;
};
}
protected function play(_arg1:String="", _arg2:Boolean=false, _arg3:Number=1):SoundChannel{
var _local4:SoundTransform;
var _local5:SoundChannel;
var _local6:Sound;
if (getDefinitionByName(_arg1)){
if (!cachedSounds[_arg1]){
_local6 = new ((getDefinitionByName(_arg1) as Class));
cachedSounds[_arg1] = _local6;
} else {
_local6 = cachedSounds[_arg1];
};
_local4 = new SoundTransform();
_local4.volume = (userVolume * _arg3);
_local5 = _local6.play(0, (_arg2) ? 9999999 : 1, _local4);
soundChannels[_local5] = _local5;
volumes[_local5] = _arg3;
_local5.addEventListener(Event.SOUND_COMPLETE, completeHandler, false, 0, true);
return (_local5);
};
return (null);
}
public function unmute(_arg1:Event=null):void{
var _local2:*;
var _local3:SoundTransform;
for (_local2 in soundChannels) {
_local3 = soundChannels[_local2].soundTransform;
_local3.volume = (userVolume * volumes[_local2]);
soundChannels[_local2].soundTransform = _local3;
};
}
protected function delayedMako(_arg1:Event):void{
delayedSound(_arg1.type, 500);
}
protected function playSound(_arg1:Event):void{
play(_arg1.type);
}
}
}//package com.baitgames.towerdefense
Section 42
//Spark (com.baitgames.towerdefense.Spark)
package com.baitgames.towerdefense {
import flash.events.*;
import flash.display.*;
public class Spark extends EventDispatcher {
public var maxSpeed:Number;// = 1
public var step:Number;// = 0
public var angle:Number;// = 0
public var scale:Number;
protected var target:Enemy;
protected var game:Game;
public var x:Number;// = 0
public var y:Number;// = 0
public var z:Number;// = 0
protected var age:Number;// = 0
public function Spark(_arg1:Game, _arg2:Enemy){
step = 0;
x = 0;
y = 0;
z = 0;
angle = 0;
maxSpeed = 1;
age = 0;
super();
game = _arg1;
target = _arg2;
scale = 0.1;
x = target.x;
y = target.y;
game.addEventListener("gameLoop", update);
game.addEventListener("gameover", gameOver);
}
public function remove():void{
game.removeEventListener("gameLoop", update);
game.removeEventListener("gameover", gameOver);
}
protected function update(_arg1:Event):void{
age++;
if (age < 6){
scale = (scale + 0.2);
} else {
if (!target.alive){
scale = (scale - 0.2);
if (scale < 0){
game.removeSpark(this);
};
};
};
step = (step + 0.3);
if (step >= 1){
step = (step - 1);
};
x = target.x;
y = target.y;
}
private function gameOver(_arg1:Event):void{
game.removeSpark(this);
}
}
}//package com.baitgames.towerdefense
Section 43
//Spark25D (com.baitgames.towerdefense.Spark25D)
package com.baitgames.towerdefense {
import flash.events.*;
import org.papervision3d.view.*;
import org.papervision3d.objects.*;
import flash.display.*;
import org.papervision3d.events.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import org.papervision3d.render.*;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
public class Spark25D extends EventDispatcher {
protected var bitmapSize:int;// = 32
protected var stepFrames:int;// = 3
protected var spark:Spark;
var material:BitmapMaterial;
protected var game25D:Game25D;
public var geometry;
public static var isAdam:Boolean = true;
protected static var framesList:Array = [];
public function Spark25D(_arg1:Game25D, _arg2:Spark, _arg3:Class, _arg4:int=180){
var _local5:Array;
var _local6:Number;
var _local7:BitmapData;
stepFrames = 3;
bitmapSize = 32;
super();
game25D = _arg1;
spark = _arg2;
if (isAdam){
isAdam = false;
_local5 = [Spark2, Spark3, Spark4];
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = new _local5[_local6](0, 0);
framesList[_local6] = _local7;
_local6++;
};
};
material = new BitmapMaterial(framesList[0]);
material.doubleSided = true;
geometry = new Plane(material, 50, 50, 4, 4);
geometry.lookAt(game25D.camera);
game25D.addEventListener("render", render);
}
public function remove():void{
game25D.removeEventListener("render", render);
}
private function render(_arg1:Event):void{
var _local2:int;
geometry.scaleX = spark.scale;
geometry.scaleY = spark.scale;
geometry.scaleZ = spark.scale;
geometry.x = spark.x;
geometry.z = -(spark.y);
geometry.y = 20;
geometry.lookAt(game25D.camera);
geometry.moveForward(10);
geometry.roll((spark.step * 100));
_local2 = Math.floor((spark.step * stepFrames));
material.bitmap = framesList[_local2];
}
public function init(_arg1:Game25D, _arg2:Spark){
game25D = _arg1;
spark = _arg2;
geometry.lookAt(game25D.camera);
game25D.addEventListener("render", render);
}
}
}//package com.baitgames.towerdefense
Section 44
//TargetData (com.baitgames.towerdefense.TargetData)
package com.baitgames.towerdefense {
public class TargetData {
public var target:Enemy;
public var distance:Number;
public var found:Boolean;
public function TargetData(_arg1:Boolean, _arg2:Enemy=null, _arg3:Number=0){
this.found = _arg1;
this.target = _arg2;
this.distance = _arg3;
}
}
}//package com.baitgames.towerdefense
Section 45
//Tools (com.baitgames.towerdefense.Tools)
package com.baitgames.towerdefense {
public class Tools {
public static function removeFromArray(_arg1:Array, _arg2):void{
var _local3:int;
var _local4:int;
var _local5:Boolean;
var _local6:int;
_local3 = _arg1.length;
_local6 = 0;
while (_local6 < _local3) {
if (_arg1[_local6] == _arg2){
_local4 = _local6;
_local5 = true;
break;
};
_local6++;
};
if (_local5){
_arg1.splice(_local4, 1);
};
}
public static function direction4(_arg1:Number):int{
var _local2:int;
if ((((_arg1 >= -45)) && ((_arg1 <= 45)))){
_local2 = 0;
} else {
if ((((_arg1 > 45)) && ((_arg1 < 135)))){
_local2 = 1;
} else {
if ((((_arg1 >= 135)) || ((_arg1 <= -135)))){
_local2 = 2;
} else {
_local2 = 3;
};
};
};
return (_local2);
}
public static function flashRotation(_arg1:Number):Number{
var _local2:Number;
_local2 = (-(_arg1) * (180 / Math.PI));
if (_local2 > 180){
_local2 = (_local2 - 360);
} else {
if (_local2 < -180){
_local2 = (_local2 + 360);
};
};
return (_local2);
}
}
}//package com.baitgames.towerdefense
Section 46
//Tower (com.baitgames.towerdefense.Tower)
package com.baitgames.towerdefense {
import flash.events.*;
import flash.display.*;
import com.blocmedia.utils.*;
public class Tower extends EventDispatcher {
public var y:Number;// = 0
public var level:int;// = 0
public var shootInterval:int;// = 10
public var target:Enemy;
protected var dx:Number;// = 0
protected var dy:Number;// = 0
protected var ammoType:Class;
public var halfGridSize:Number;// = 17
protected var gridX:int;// = 0
protected var gridY:int;// = 0
protected var attackRange:Number;
public var angle:Number;// = 0
public var towerType:Class;
protected var shootTimer:int;// = 0
public var gridSize:Number;// = 34
protected var game:Game;
public var x:Number;// = 0
protected var age:int;// = 0
public static var speeds:Array = [6.7, 8, 20, 25];
public static var ranges:Array = [250, 100, 200, 400];
public static var rates:Array = [205, 30, 20, 10];
public static var costs:Array = [5, 15, 20, 25];
public static var powers:Array = [80, 5, 5, 5];
public function Tower(_arg1:Game, _arg2:Number, _arg3:Number){
level = 0;
dx = 0;
dy = 0;
x = 0;
y = 0;
shootInterval = 10;
shootTimer = 0;
gridX = 0;
gridY = 0;
angle = 0;
age = 0;
gridSize = 34;
halfGridSize = 17;
towerType = Tower;
ammoType = Bullet;
super();
game = _arg1;
gridSize = game.gridSize;
halfGridSize = game.halfGridSize;
x = _arg2;
y = _arg3;
attackRange = towerType.ranges[0];
angle = Math2.random(-(Math.PI), Math.PI);
game.addEventListener("gameLoop", gameLoop, false, 0, true);
game.addEventListener("gameover", gameOver);
}
public function killMe():void{
alive = false;
game.removeEventListener("gameLoop", gameLoop);
game.removeEventListener("gameover", gameOver);
}
protected function getClosestEnemy():Object{
var _local1:int;
var _local2:Number;
var _local3:Enemy;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Enemy;
var _local8:Boolean;
var _local9:int;
_local1 = game.enemies.length;
if (_local1 > 0){
_local2 = 9999999999999;
_local8 = false;
_local9 = 0;
while (_local9 < _local1) {
_local3 = game.enemies[_local9];
_local4 = (_local3.x - this.x);
_local5 = (_local3.y - this.y);
_local6 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
if (_local6 < _local2){
_local2 = _local6;
_local7 = _local3;
_local8 = true;
};
_local9++;
};
return (new TargetData(_local8, _local7, _local2));
//unresolved jump
};
return (new TargetData(false));
}
protected function gameLoop(_arg1:Event):void{
age++;
defend();
}
protected function defend():void{
var _local1:TargetData;
var _local2:Enemy;
var _local3:Number;
var _local4:*;
var _local5:*;
shootTimer++;
_local1 = getClosestEnemy();
if (_local1.found){
_local2 = _local1.target;
dx = (_local2.x - x);
dy = (_local2.y - y);
_local3 = Math.sqrt(((dx * dx) + (dy * dy)));
_local4 = Math.atan2(dx, dy);
_local5 = Math2.smallestAngle(angle, _local4);
angle = (angle + (_local5 * 0.25));
if (_local3 < attackRange){
if ((((shootTimer >= rates[level])) && ((Math.abs(_local5) < (Math.PI / 30))))){
game.addBullet(x, y, speeds[level], angle, powers[level], false, ammoType, this, _local2);
shootTimer = 0;
game.gelpodShoot();
};
};
};
}
private function gameOver(_arg1:Event):void{
game.removeTower(this);
}
}
}//package com.baitgames.towerdefense
Section 47
//Tower2D (com.baitgames.towerdefense.Tower2D)
package com.baitgames.towerdefense {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class Tower2D extends MovieClip {
public function Tower2D(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package com.baitgames.towerdefense
Section 48
//Tower3D (com.baitgames.towerdefense.Tower3D)
package com.baitgames.towerdefense {
import flash.events.*;
import org.papervision3d.view.*;
import org.papervision3d.objects.*;
import flash.display.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.events.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import com.baitgames.towerdefense.papervisionmodels.*;
import org.papervision3d.render.*;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
public class Tower3D extends EventDispatcher {
var tower:Tower;
public var base:Base;
var plane;
var turret:TriangleMesh3D;
private var game:Game25D;
private static var baseMaterial:BitmapMaterial;
private static var material:BitmapMaterial;
public function Tower3D(_arg1:Game25D, _arg2:Tower){
game = _arg1;
tower = _arg2;
createGeometry();
turret.scaleX = 10;
turret.scaleY = 10;
turret.scaleZ = 10;
base.scaleX = 10;
base.scaleY = 10;
base.scaleZ = 10;
plane = turret;
game.addEventListener("render", render);
}
public function remove():void{
game.removeEventListener("render", render);
}
protected function createGeometry():void{
var _local1:BitmapMaterial;
if (!material){
material = new BitmapMaterial(new TurretTexture(0, 0));
material.doubleSided = true;
};
turret = new Turret(material);
if (!_local1){
_local1 = new BitmapMaterial(new TowerBaseTexture(0, 0));
};
base = new Base(_local1);
}
public function init(_arg1:Game25D, _arg2:Tower){
game = _arg1;
tower = _arg2;
game.addEventListener("render", render);
}
protected function render(_arg1:Event):void{
turret.x = tower.x;
turret.z = -(tower.y);
turret.y = 0;
turret.rotationY = Tools.flashRotation(tower.angle);
base.x = tower.x;
base.z = -(tower.y);
base.y = -10;
}
}
}//package com.baitgames.towerdefense
Section 49
//TowerDefense (com.baitgames.towerdefense.TowerDefense)
package com.baitgames.towerdefense {
import flash.events.*;
import gs.*;
import flash.display.*;
import fl.motion.easing.*;
import com.blocmedia.utils.*;
import com.baitcontent.*;
public class TowerDefense extends BaitContent {
private var added:Boolean;// = false
private var isPaused:Boolean;// = false
public var soundBox:SoundBox;
public var tdgo:TowerDefenseGameOver;
private var views:Array;
private var view:Game2D;
public var userInterface:UserInterface;
private var view25D:Game25D;
public var userVolume:Number;// = 0
private var game:Game;
private var age:int;// = 0
public function TowerDefense(){
userVolume = 0;
age = 0;
added = false;
isPaused = false;
super();
addEventListener(Event.ADDED_TO_STAGE, addedToStage, false, 0, true);
}
public function addBullet(_arg1:Bullet):void{
var _local2:Number;
_local2 = 0;
while (_local2 < views.length) {
views[_local2].addBullet(_arg1);
_local2++;
};
}
public function init(){
var _local1:Boolean;
stage.quality = StageQuality.LOW;
added = true;
views = [];
_local1 = true;
if (_local1){
add25DView();
} else {
add2DView();
};
game = new Game(stage, this);
userInterface = new UserInterface(this, game);
addChild(userInterface);
stage.addEventListener(Event.ENTER_FRAME, handleEnterFrame);
if (root.parent.parent == null){
addChild(new FPS());
};
soundBox = new SoundBox(view25D, this, game, userInterface);
}
private function add2DView():void{
view = new Game2D(this);
addChild(view);
views.push(view);
}
override public function setVolume(_arg1:Number){
userVolume = _arg1;
if (soundBox){
soundBox.setVolume(userVolume);
};
}
private function add25DView():void{
view25D = new Game25D(this);
addChild(view25D);
views.push(view25D);
}
public function skipGame(_arg1:Event):void{
dispatchEvent(new Event(BaitContent.ONFINISH));
}
private function addedToStage(_arg1:Event):void{
if (root.parent.parent == null){
init();
userVolume = 1;
soundBox.setVolume(userVolume);
};
}
public function lose():void{
stage.removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
userInterface.gameOver();
stage.quality = StageQuality.HIGH;
if (!tdgo){
tdgo = new TowerDefenseGameOver();
tdgo.addEventListener("skipGame", skipGame);
tdgo.addEventListener("playAgain", playAgain);
};
tdgo.init(false);
addChild(tdgo);
TweenMax.from(tdgo, 2, {alpha:0});
}
override public function resume(){
isPaused = false;
}
public function win():void{
stage.removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
userInterface.gameOver();
stage.quality = StageQuality.HIGH;
if (!tdgo){
tdgo = new TowerDefenseGameOver();
tdgo.addEventListener("skipGame", skipGame);
tdgo.addEventListener("playAgain", playAgain);
};
tdgo.init(true);
addChild(tdgo);
TweenMax.from(tdgo, 2, {alpha:0});
}
public function getTowerType(){
return (Tower);
}
public function removeEnemy(_arg1:Enemy):void{
var _local2:Number;
_local2 = 0;
while (_local2 < views.length) {
views[_local2].removeEnemy(_arg1);
_local2++;
};
}
override public function start(){
init();
soundBox.setVolume(userVolume);
}
public function addEnemy(_arg1:Enemy):void{
view25D.addEnemy(_arg1);
}
public function pulse(_arg1:Number, _arg2:Number):void{
var _local3:Number;
_local3 = 0;
while (_local3 < views.length) {
views[_local3].addPulseRing(_arg1, _arg2);
_local3++;
};
}
public function showWave(_arg1):void{
}
public function playAgain(_arg1:Event):void{
isNormal = tdgo.isNormal;
removeChild(tdgo);
stage.quality = StageQuality.LOW;
stage.addEventListener(Event.ENTER_FRAME, handleEnterFrame);
userInterface.playAgain();
game.playAgain();
}
public function removeBullet(_arg1:Bullet):void{
var _local2:Number;
_local2 = 0;
while (_local2 < views.length) {
views[_local2].removeBullet(_arg1);
_local2++;
};
}
public function addMaze(_arg1:Maze):void{
var _local2:Number;
_local2 = 0;
while (_local2 < views.length) {
views[_local2].addMaze(_arg1);
_local2++;
};
}
public function denied():void{
dispatchEvent(new Event("denied"));
}
public function removeSpark(_arg1:Spark):void{
var _local2:Number;
_local2 = 0;
while (_local2 < views.length) {
views[_local2].removeSpark(_arg1);
_local2++;
};
}
override public function rewind(){
}
private function handleEnterFrame(_arg1:Event):void{
age++;
if (!isPaused){
dispatchEvent(new Event("gameLoop"));
if ((age % 2) == 0){
} else {
dispatchEvent(new Event("render"));
};
};
}
public function addSpark(_arg1:Spark):void{
var _local2:Number;
_local2 = 0;
while (_local2 < views.length) {
views[_local2].addSpark(_arg1);
_local2++;
};
}
public function addStructure(_arg1:Number, _arg2:Number):void{
game.addStructure(_arg1, _arg2, userInterface.towerType);
}
public function removeBlast(_arg1:Blast):void{
var _local2:Number;
_local2 = 0;
while (_local2 < views.length) {
views[_local2].removeBlast(_arg1);
_local2++;
};
}
public function addBlast(_arg1:Blast):void{
var _local2:Number;
_local2 = 0;
while (_local2 < views.length) {
views[_local2].addBlast(_arg1);
_local2++;
};
}
public function removeTower(_arg1:Tower):void{
var _local2:Number;
_local2 = 0;
while (_local2 < views.length) {
views[_local2].removeTower(_arg1);
_local2++;
};
}
public function addTower(_arg1:Tower):void{
var _local2:Number;
_local2 = 0;
while (_local2 < views.length) {
views[_local2].addTower(_arg1);
_local2++;
};
}
override public function destroy(){
if (game){
game.destroy();
};
if (view25D){
view25D.destroy();
removeChild(view25D);
removeChild(userInterface);
views = null;
};
if (tdgo){
if (this.contains(tdgo)){
removeChild(tdgo);
};
};
if (added){
stage.removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
};
}
override public function pause(){
isPaused = true;
}
}
}//package com.baitgames.towerdefense
Section 50
//UserInterface (com.baitgames.towerdefense.UserInterface)
package com.baitgames.towerdefense {
import flash.events.*;
import gs.*;
import flash.display.*;
import fl.motion.easing.*;
import flash.text.*;
public class UserInterface extends MovieClip {
public var towerType;
public var pulseButton:WeaponButton;
public var level_txt:TextField;
public var lives_txt:TextField;
public var cash_txt:TextField;
public var levels:MovieClip;
public var buttons:Array;
public var towerButton:WeaponButton;
protected var controller:TowerDefense;
public var laserButton:WeaponButton;
private var game:Game;
public var missileButton:WeaponButton;
public function UserInterface(_arg1:TowerDefense, _arg2:Game){
var _local3:int;
towerType = Tower;
buttons = [];
super();
controller = _arg1;
game = _arg2;
towerType = RocketTower;
towerButton.towerType = Tower;
pulseButton.towerType = PulseTower;
laserButton.towerType = LaserTower;
missileButton.towerType = RocketTower;
buttons = [towerButton, pulseButton, laserButton, missileButton];
addEventListener(Event.ADDED_TO_STAGE, addedToStage, false, 0, true);
game.addEventListener("newWave", completeLevel);
game.addEventListener("restart", restart);
_local3 = 1;
while (_local3 <= 20) {
levels.getChildByName(("level" + _local3)).alpha = 0;
_local3++;
};
levels.mouseEnabled = false;
levels.mouseChildren = false;
}
public function restart(_arg1:Event):void{
var _local2:int;
_local2 = 1;
while (_local2 <= 20) {
TweenMax.to(levels.getChildByName(("level" + _local2)), 2, {alpha:0, ease:Elastic.easeOut, easeParams:[1, 0.1]});
_local2++;
};
}
private function addedToStage(_arg1:Event):void{
var _local2:int;
var _local3:int;
controller.addEventListener("render", render);
_local2 = buttons.length;
_local3 = 0;
while (_local3 < _local2) {
buttons[_local3].addEventListener("selected", selectedHandler, false, 0, true);
buttons[_local3].addEventListener("denied", deniedHandler, false, 0, true);
buttons[_local3].buttonGroup = buttons;
_local3++;
};
}
private function deniedHandler(_arg1:Event){
dispatchEvent(new Event("denied"));
dispatchEvent(new Event("insufficient"));
}
public function selectedHandler(_arg1:Event):void{
dispatchEvent(new Event("buttonClick"));
towerType = _arg1.target.towerType;
}
private function render(_arg1:Event):void{
var _local2:int;
var _local3:int;
_local2 = buttons.length;
_local3 = 0;
while (_local3 < _local2) {
buttons[_local3].isAvailable = (game.cash >= buttons[_local3].towerType.costs[0]);
if (buttons[_local3].isAvailable){
buttons[_local3].alpha = 1;
} else {
buttons[_local3].alpha = 0.5;
};
_local3++;
};
level_txt.text = String(game.skill);
lives_txt.text = String(game.lives);
cash_txt.text = String(game.cash);
}
public function playAgain():void{
var _local1:int;
var _local2:int;
_local1 = buttons.length;
_local2 = 0;
while (_local2 < _local1) {
buttons[_local2].enable();
_local2++;
};
_local2 = 1;
while (_local2 <= 20) {
levels.getChildByName(("level" + _local2)).alpha = 0;
_local2++;
};
}
public function completeLevel(_arg1:Event):void{
TweenMax.to(levels.getChildByName(("level" + _arg1.target.level)), 2, {alpha:1, ease:Elastic.easeOut, easeParams:[1, 0.1]});
}
public function gameOver():void{
var _local1:int;
var _local2:int;
_local1 = buttons.length;
_local2 = 0;
while (_local2 < _local1) {
buttons[_local2].disable();
_local2++;
};
}
}
}//package com.baitgames.towerdefense
Section 51
//WeaponButton (com.baitgames.towerdefense.WeaponButton)
package com.baitgames.towerdefense {
import flash.events.*;
import gs.*;
import flash.display.*;
import flash.text.*;
public class WeaponButton extends MovieClip {
public var towerType;
protected var myTween;
public var level_txt:TextField;
public var lives_txt:TextField;
public var cash_txt:TextField;
public var buttonHighlight:MovieClip;
protected var _buttonGroup:Array;
protected var controller:TowerDefense;
public var isAvailable:Boolean;// = false
private var game:Game;
public function WeaponButton(){
towerType = Tower;
isAvailable = false;
_buttonGroup = [];
super();
addEventListener(Event.ADDED_TO_STAGE, addedToStage, false, 0, true);
}
private function addedToStage(_arg1:Event):void{
addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OVER, rollOverHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, rollOutHandler, false, 0, true);
buttonHighlight.alpha = 0;
}
public function rollOverHandler(_arg1:MouseEvent=null):void{
if (isAvailable){
TweenMax.to(this, 0.5, {colorMatrixFilter:{brightness:1.8, contrast:1.8}});
};
}
protected function selectedHandler(_arg1:Event):void{
buttonHighlight.alpha = 0;
}
public function get buttonGroup():Array{
return (this._buttonGroup);
}
public function mouseDownHandler(_arg1:MouseEvent):void{
if (isAvailable){
buttonHighlight.alpha = 1;
dispatchEvent(new Event("selected"));
} else {
dispatchEvent(new Event("denied"));
};
}
public function enable():void{
addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OVER, rollOverHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, rollOutHandler, false, 0, true);
}
public function rollOutHandler(_arg1:MouseEvent=null):void{
TweenMax.to(this, 0.5, {colorMatrixFilter:{brightness:1, contrast:1}});
}
public function set buttonGroup(_arg1:Array):void{
var _local2:int;
var _local3:int;
this._buttonGroup = _arg1;
_local2 = this._buttonGroup.length;
_local3 = 0;
while (_local3 < _local2) {
if (this._buttonGroup[_local3] != this){
this._buttonGroup[_local3].addEventListener("selected", selectedHandler);
};
_local3++;
};
}
public function disable():void{
buttonHighlight.alpha = 0;
removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
removeEventListener(MouseEvent.ROLL_OVER, rollOverHandler);
removeEventListener(MouseEvent.ROLL_OUT, rollOutHandler);
TweenMax.to(this, 0.5, {colorMatrixFilter:{brightness:1, contrast:1}});
}
}
}//package com.baitgames.towerdefense
Section 52
//DebugDispatcher (com.blitzagency.xray.logger.events.DebugDispatcher)
package com.blitzagency.xray.logger.events {
import flash.events.*;
public class DebugDispatcher extends EventDispatcher {
public static var TRACE:String = "trace";
public function sendEvent(_arg1:String, _arg2:Object):void{
dispatchEvent(new DebugEvent(DebugDispatcher.TRACE, false, false, _arg2));
}
}
}//package com.blitzagency.xray.logger.events
Section 53
//DebugEvent (com.blitzagency.xray.logger.events.DebugEvent)
package com.blitzagency.xray.logger.events {
import flash.events.*;
public class DebugEvent extends Event {
public var obj:Object;
public function DebugEvent(_arg1:String, _arg2:Boolean, _arg3:Boolean, _arg4:Object):void{
obj = new Object();
super(_arg1, _arg2, _arg3);
obj = _arg4;
}
}
}//package com.blitzagency.xray.logger.events
Section 54
//ObjectTools (com.blitzagency.xray.logger.util.ObjectTools)
package com.blitzagency.xray.logger.util {
import com.blitzagency.xray.logger.*;
import flash.utils.*;
public class ObjectTools {
private static var log:XrayLog = new XrayLog();
public function resolveBaseType(_arg1:Object):String{
return ("");
}
public static function getImmediateClassPath(_arg1:Object):String{
var _local2:String;
var _local3:String;
_local2 = getQualifiedClassName(_arg1);
_local3 = getQualifiedSuperclassName(_arg1);
_local2 = ((_local2.indexOf("::") > -1)) ? _local2.split("::").join(".") : _local2;
if (_local3 == null){
return (_local2);
};
_local3 = ((_local3.indexOf("::") > -1)) ? _local3.split("::").join(".") : _local3;
return (((_local3 + ".") + _local2));
}
public static function getFullClassPath(_arg1:Object):String{
var _local2:XML;
var _local3:Array;
var _local4:String;
var _local5:XML;
var _local6:String;
_local2 = describeType(_arg1);
_local3 = [];
_local4 = getQualifiedClassName(_arg1);
_local4 = ((_local4.indexOf("::") > -1)) ? _local4.split("::").join(".") : _local4;
_local3.push(_local4);
for each (_local5 in _local2.extendsClass) {
_local6 = ((_local5.@type.toString().indexOf("::") > -1)) ? _local5.@type.toString().split("::")[1] : _local5.@type.toString();
_local3.push(_local6);
};
return (_local3.join("."));
}
}
}//package com.blitzagency.xray.logger.util
Section 55
//PropertyTools (com.blitzagency.xray.logger.util.PropertyTools)
package com.blitzagency.xray.logger.util {
import flash.utils.*;
public class PropertyTools {
private static function getVariables():void{
}
public static function getProperties(_arg1:Object):Array{
var ary:Array;
var xmlDoc:XML;
var item:XML;
var name:String;
var type:String;
var value:Object;
var obj = _arg1;
ary = [];
try {
xmlDoc = describeType(obj);
for each (item in xmlDoc.variable) {
name = item.@name.toString();
type = item.@type.toString();
value = ((obj[name])!=null) ? obj[name] : "";
ary.push({name:name, type:type, value:value});
};
} catch(e:Error) {
};
return (ary);
}
private static function getMethods():void{
}
}
}//package com.blitzagency.xray.logger.util
Section 56
//Debug (com.blitzagency.xray.logger.Debug)
package com.blitzagency.xray.logger {
import flash.events.*;
import flash.utils.*;
import com.blitzagency.xray.logger.events.*;
import flash.net.*;
public class Debug {
private static var connected:Boolean = false;
private static var xrayLC:LocalConnection;
private static var ed:DebugDispatcher = new DebugDispatcher();
public static function traceObject(_arg1:Object, _arg2:Number=254, _arg3:Number=0, _arg4:String="", _arg5:Number=0):void{
var recurseDepth:Number;
var indent:Number;
var prop:String;
var lead:String;
var i:Number;
var obj:String;
var o = _arg1;
var pRecurseDepth = _arg2;
var pIndent = _arg3;
var pPackage = _arg4;
var pLevel = _arg5;
try {
recurseDepth = pRecurseDepth;
indent = pIndent;
for (prop in o) {
lead = "";
i = 0;
while (i < indent) {
lead = (lead + " ");
i = (i + 1);
};
obj = o[prop].toString();
if ((o[prop] is Array)){
obj = "[Array]";
};
if (obj == "[object Object]"){
obj = "[Object]";
};
Debug.trace((((lead + prop) + ": ") + obj), pPackage, pLevel);
if (recurseDepth > 0){
Debug.traceObject(o[prop], (recurseDepth - 1), (indent + 1), pPackage, pLevel);
};
};
} catch(e:Error) {
};
}
public static function trace(_arg1:Object, _arg2:String="", _arg3:Number=0):void{
var msg:String;
var pMsg = _arg1;
var pPackage = _arg2;
var pLevel = _arg3;
ed.sendEvent(DebugDispatcher.TRACE, {message:pMsg, classPackage:pPackage});
if (!connected){
makeConnection();
};
if (connected){
try {
msg = ((String(pMsg).length >= 39995)) ? (String(pMsg).substr(0, 39995) + "...") : String(pMsg);
xrayLC.send("_xray_view_conn", "setTrace", msg, pLevel, pPackage);
} catch(e:LogError) {
LogError("No Xray Interface running");
};
};
}
private static function makeConnection():void{
var err:LogError;
xrayLC = new LocalConnection();
xrayLC.addEventListener("status", statusHandler);
xrayLC.allowDomain("*");
try {
xrayLC.connect(("_xray_standAlone_debug" + getTimer()));
connected = true;
} catch(e:Error) {
err = new LogError("log");
setTimeout(makeConnection, 1000);
};
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
ed.addEventListener(_arg1, _arg2);
}
private static function initialize():Boolean{
ed = new DebugDispatcher();
return (true);
}
private static function statusHandler(_arg1:StatusEvent):void{
if ((((((_arg1.code == null)) && ((_arg1.level == "error")))) && (connected))){
connected = false;
} else {
if ((((_arg1.level == "status")) && ((_arg1.code == null)))){
connected = true;
};
};
}
}
}//package com.blitzagency.xray.logger
class LogError extends Error {
private function LogError(_arg1:String){
super(_arg1);
}
}
Section 57
//Log (com.blitzagency.xray.logger.Log)
package com.blitzagency.xray.logger {
import com.blitzagency.xray.logger.util.*;
public class Log {
private var level:Number;
private var caller:String;// = ""
private var classPackage:String;
private var dump:Object;
private var message:String;
public function Log(_arg1:String, _arg2:Object, _arg3:Number, ... _args){
var err:LogError;
var nullArray:Array;
var str:String;
var p_message = _arg1;
var p_dump = _arg2;
var p_level = _arg3;
var rest = _args;
caller = "";
super();
try {
nullArray.push("bogus");
} catch(e:Error) {
err = new LogError("log");
} finally {
if (err.hasOwnProperty("getStackTrace")){
str = err.getStackTrace();
setCaller(resolveCaller(str));
} else {
setCaller("");
};
setMessage(p_message);
setDump(p_dump);
setLevel(p_level);
setClassPackage(p_dump);
};
}
public function setLevel(_arg1:Number):void{
level = _arg1;
}
public function getCaller():String{
return (caller);
}
public function setMessage(_arg1:String):void{
message = _arg1;
}
public function getLevel():Number{
return (level);
}
public function getDump():Object{
return (dump);
}
public function setCaller(_arg1:String):void{
caller = _arg1;
}
public function setClassPackage(_arg1:Object):void{
classPackage = ObjectTools.getImmediateClassPath(_arg1);
}
public function getMessage():String{
return (message);
}
public function getClassPackage():String{
return (classPackage);
}
public function setDump(_arg1:Object):void{
dump = _arg1;
}
private function resolveCaller(_arg1:String):String{
var ary:Array;
var str = _arg1;
ary = [];
try {
str = str.split("\n").join("");
ary = str.split("\tat ");
str = ary[3];
} catch(e:Error) {
} finally {
str = "";
};
return (str);
}
}
}//package com.blitzagency.xray.logger
class LogError extends Error {
private function LogError(_arg1:String){
super(_arg1);
}
}
Section 58
//Logger (com.blitzagency.xray.logger.Logger)
package com.blitzagency.xray.logger {
public interface Logger {
function setLevel(_arg1:Number=0):void;
function debug(_arg1:Log):void;
function fatal(_arg1:Log):void;
function warn(_arg1:Log):void;
function error(_arg1:Log):void;
function log(_arg1:String, _arg2:String, _arg3:String, _arg4:Number, _arg5:Object=null):void;
function info(_arg1:Log):void;
}
}//package com.blitzagency.xray.logger
Section 59
//XrayLog (com.blitzagency.xray.logger.XrayLog)
package com.blitzagency.xray.logger {
public class XrayLog {
private var logger:XrayLogger;
public function XrayLog(){
logger = XrayLogger.getInstance();
}
public function debug(_arg1:String, ... _args):void{
var _local3:Number;
if (_args.length == 0){
logger.debug(new Log(_arg1, null, XrayLogger.DEBUG));
};
_local3 = 0;
while (_local3 < _args.length) {
if (_local3 > 0){
_arg1 = "";
};
logger.debug(new Log(_arg1, _args[_local3], XrayLogger.DEBUG));
_local3++;
};
}
public function fatal(_arg1:String, ... _args):void{
var _local3:Number;
if (_args.length == 0){
logger.fatal(new Log(_arg1, null, XrayLogger.FATAL));
};
_local3 = 0;
while (_local3 < _args.length) {
if (_local3 > 0){
_arg1 = "";
};
logger.fatal(new Log(_arg1, _args[_local3], XrayLogger.FATAL));
_local3++;
};
}
public function info(_arg1:String, ... _args):void{
var _local3:Number;
if (_args.length == 0){
logger.info(new Log(_arg1, null, XrayLogger.INFO));
};
_local3 = 0;
while (_local3 < _args.length) {
if (_local3 > 0){
_arg1 = "";
};
logger.info(new Log(_arg1, _args[_local3], XrayLogger.INFO));
_local3++;
};
}
public function warn(_arg1:String, ... _args):void{
var _local3:Number;
if (_args.length == 0){
logger.warn(new Log(_arg1, null, XrayLogger.WARN));
};
_local3 = 0;
while (_local3 < _args.length) {
if (_local3 > 0){
_arg1 = "";
};
logger.warn(new Log(_arg1, _args[_local3], XrayLogger.WARN));
_local3++;
};
}
public function error(_arg1:String, ... _args):void{
var _local3:Number;
if (_args.length == 0){
logger.error(new Log(_arg1, null, XrayLogger.ERROR));
};
_local3 = 0;
while (_local3 < _args.length) {
if (_local3 > 0){
_arg1 = "";
};
logger.error(new Log(_arg1, _args[_local3], XrayLogger.ERROR));
_local3++;
};
}
}
}//package com.blitzagency.xray.logger
Section 60
//XrayLogger (com.blitzagency.xray.logger.XrayLogger)
package com.blitzagency.xray.logger {
import flash.events.*;
import flash.utils.*;
import com.blitzagency.xray.logger.util.*;
public class XrayLogger extends EventDispatcher implements Logger {
private var displayObjectRecursionDepth:Number;// = 3
private var level:Number;// = 0
private var indentation:Number;// = 0
private var objectRecursionDepth:Number;// = 254
private var filters:Array;
public static var FATAL:Number = 4;
public static var WARN:Number = 2;
public static var ERROR:Number = 3;
public static var INFO:Number = 1;
public static var DEBUG:Number = 0;
private static var _instance:XrayLogger = null;
public static var NONE:Number = 5;
public function XrayLogger(){
level = 0;
displayObjectRecursionDepth = 3;
objectRecursionDepth = 254;
indentation = 0;
filters = [];
super();
}
public function checkFilters():Boolean{
var _local1:uint;
if (filters.length == 0){
return (true);
};
_local1 = 0;
while (_local1 < filters.length) {
_local1++;
};
return (true);
}
public function debug(_arg1:Log):void{
if (_arg1.getLevel() == level){
log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 0, _arg1.getDump());
};
}
public function setIndentation(_arg1:Number=0):void{
indentation = _arg1;
}
public function error(_arg1:Log):void{
if (_arg1.getLevel() >= level){
log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 3, _arg1.getDump());
};
}
public function setLevel(_arg1:Number=0):void{
level = _arg1;
}
public function fatal(_arg1:Log):void{
if (_arg1.getLevel() >= level){
log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 4, _arg1.getDump());
};
}
public function warn(_arg1:Log):void{
if (_arg1.getLevel() >= level){
log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 2, _arg1.getDump());
};
}
public function setObjectRecursionDepth(_arg1:Number):void{
objectRecursionDepth = _arg1;
}
public function setDisplayClipRecursionDepth(_arg1:Number):void{
displayObjectRecursionDepth = _arg1;
}
public function info(_arg1:Log):void{
if (_arg1.getLevel() >= level){
log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 1, _arg1.getDump());
};
}
public function log(_arg1:String, _arg2:String, _arg3:String, _arg4:Number, _arg5:Object=null):void{
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:Object;
_local6 = (("(" + getTimer()) + ") ");
if (_arg3.length > 0){
_local6 = (_local6 + (_arg2 + "\n"));
};
_local6 = (_local6 + _arg1);
if (_arg1.length > 0){
Debug.trace(_local6, _arg3, _arg4);
};
if (_arg5 == null){
return;
};
_local7 = typeof(_arg5);
if ((((((((((_local7 == "string")) || ((_local7 == "number")))) || ((_local7 == "boolean")))) || ((_local7 == "undefined")))) || ((_local7 == "null")))){
Debug.trace(_arg5, _arg3, _arg4);
} else {
if (_local7 == "xml"){
Debug.trace(_arg5.toString(), _arg3, _arg4);
} else {
_local8 = ObjectTools.getImmediateClassPath(_arg5);
if ((((_local8 == "Object")) || ((_local8 == "Object.Array")))){
Debug.traceObject(_arg5, objectRecursionDepth, indentation, _arg3, _arg4);
} else {
_local9 = PropertyTools.getProperties(_arg5);
Debug.traceObject(_local9, displayObjectRecursionDepth, indentation, _arg3, _arg4);
};
};
};
}
public function setFilters(_arg1:Array):void{
filters = _arg1;
}
public static function getInstance():XrayLogger{
if (_instance == null){
_instance = new (XrayLogger);
};
return (_instance);
}
public static function resolveLevelAsName(_arg1:Number):String{
switch (_arg1){
case 0:
return ("debug");
case 1:
return ("info");
case 2:
return ("warn");
case 3:
return ("error");
case 4:
return ("fatal");
default:
return ("debug");
};
}
}
}//package com.blitzagency.xray.logger
Section 61
//MovieClipPlus (com.blocmedia.media.MovieClipPlus)
package com.blocmedia.media {
import flash.events.*;
import flash.display.*;
public dynamic class MovieClipPlus extends MovieClip {
private var oldLabel:String;
public var speed:Number;// = 1
private var _currentFrame:Number;// = 1
private var _lableListen:Boolean;
public var looping:Boolean;// = false
public static const ONLABEL:String = "onHitLabel";
public function MovieClipPlus():void{
speed = 1;
looping = false;
_currentFrame = 1;
super();
stop();
}
override public function stop():void{
super.stop();
removeEventListener(Event.ENTER_FRAME, update);
}
private function checkLabels(_arg1:Event):void{
if (oldLabel != currentLabel){
oldLabel = currentLabel;
dispatchEvent(new Event((ONLABEL + currentLabel)));
};
}
public function get listenForLabels():Boolean{
return (_lableListen);
}
public function set listenForLabels(_arg1:Boolean):void{
if ((_lableListen = _arg1)){
addEventListener(Event.ENTER_FRAME, checkLabels, false, 0, true);
} else {
removeEventListener(Event.ENTER_FRAME, checkLabels);
};
}
public function playAt(_arg1:Number=1):void{
speed = _arg1;
_currentFrame = currentFrame;
addEventListener(Event.ENTER_FRAME, update, false, 0, true);
}
private function update(_arg1:Event):void{
_currentFrame = (_currentFrame + speed);
_currentFrame = (looping) ? ((_currentFrame + totalFrames) % totalFrames) : Math.max(1, Math.min(totalFrames, _currentFrame));
gotoAndStop(Math.round(_currentFrame));
}
}
}//package com.blocmedia.media
Section 62
//FPS (com.blocmedia.utils.FPS)
package com.blocmedia.utils {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.text.*;
import flash.system.*;
public class FPS extends Sprite {
private var fpsList:Array;
private var memTxt:TextField;
private var oldTime:Number;// = 0
private var newTime:Number;// = 0
private var fpsTxt:TextField;
public function FPS(){
oldTime = 0;
newTime = 0;
fpsList = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
super();
fpsTxt = new TextField();
memTxt = new TextField();
addChild(fpsTxt);
addChild(memTxt);
memTxt.y = 20;
addEventListener(Event.ENTER_FRAME, update, false, 0, true);
graphics.beginFill(0xFFFFFF, 0.8);
graphics.drawRect(0, 0, 125, 40);
graphics.endFill();
fpsTxt.defaultTextFormat = new TextFormat("Arial");
memTxt.defaultTextFormat = new TextFormat("Arial");
}
private function update(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
oldTime = newTime;
newTime = getTimer();
_local2 = (1000 / (newTime - oldTime));
fpsList.unshift(_local2);
fpsList.pop();
_local3 = 0;
_local4 = 0;
while (_local4 < fpsList.length) {
_local3 = (_local3 + fpsList[_local4]);
_local4++;
};
_local5 = Math.round((_local3 / 20));
fpsTxt.text = String(("FPS: " + _local5));
memTxt.text = String(("MEM: " + Math2.round((System.totalMemory / 0x100000), 3)));
}
}
}//package com.blocmedia.utils
Section 63
//Math2 (com.blocmedia.utils.Math2)
package com.blocmedia.utils {
public class Math2 {
public static function closerThan(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
var _local6:Number;
var _local7:Number;
_local6 = (_arg1 - _arg3);
_local7 = (_arg2 - _arg4);
return ((((_local6 * _local6) + (_local7 * _local7)) < (_arg5 * _arg5)));
}
public static function random(_arg1:Number=0, _arg2:Number=1):Number{
return (((Math.random() * (_arg2 - _arg1)) + _arg1));
}
public static function ceil(_arg1:Number, _arg2:int=0):Number{
var _local3:int;
_local3 = Math.pow(10, _arg2);
return ((Math.ceil((_arg1 * _local3)) / _local3));
}
public static function convertLimit(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
return (Math.max(_arg4, Math.min(_arg5, (((_arg5 - _arg4) * ((_arg1 - _arg2) / (_arg3 - _arg2))) + _arg4))));
}
public static function limit(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = Math.min(Math.abs(_arg1), _arg2);
_local3 = (_local3 * Math2.sign(_arg1));
return (_local3);
}
public static function hyp2(_arg1:Number, _arg2:Number):Number{
return (Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))));
}
public static function floor(_arg1:Number, _arg2:int=0):Number{
var _local3:int;
_local3 = Math.pow(10, _arg2);
return ((Math.floor((_arg1 * _local3)) / _local3));
}
public static function randomBool(_arg1:Number=0.5):Boolean{
return ((Math.random() < _arg1));
}
public static function round(_arg1:Number, _arg2:int=0):Number{
var _local3:int;
_local3 = Math.pow(10, _arg2);
return ((Math.round((_arg1 * _local3)) / _local3));
}
public static function convert(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
return ((((_arg5 - _arg4) * ((_arg1 - _arg2) / (_arg3 - _arg2))) + _arg4));
}
public static function smallestAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_arg1 = (_arg1 % (Math.PI * 2));
_local3 = (_arg2 - _arg1);
_local4 = ((_arg2 + (Math.PI * 2)) - _arg1);
_local5 = ((_arg2 - (Math.PI * 2)) - _arg1);
_local6 = Math.abs(_local3);
_local7 = Math.abs(_local4);
_local8 = Math.abs(_local5);
_local9 = _local3;
if ((((_local7 < _local6)) && ((_local7 < _local8)))){
_local9 = _local4;
} else {
if ((((_local8 < _local6)) && ((_local8 < _local7)))){
_local9 = _local5;
};
};
return (_local9);
}
public static function limitRadians(_arg1:Number):Number{
if (_arg1 > Math.PI){
_arg1 = (_arg1 - (Math.PI * 2));
} else {
if (_arg1 < -(Math.PI)){
_arg1 = (_arg1 + (Math.PI * 2));
};
};
return (_arg1);
}
public static function randomPlusMinus(_arg1:Number=0.5):int{
return (((Math.random())>_arg1) ? -1 : 1);
}
public static function randomInt(_arg1:Number=0, _arg2:Number=1):int{
return (Math.round(((Math.random() * (_arg2 - _arg1)) + _arg1)));
}
public static function sign(_arg1:Number):Number{
if (_arg1 >= 0){
return (1);
};
return (-1);
}
public static function hyp(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Number;
_local5 = (_arg1 - _arg3);
_local6 = (_arg2 - _arg4);
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
}
}//package com.blocmedia.utils
Section 64
//Back (com.tweener.easing.Back)
package com.tweener.easing {
public class Back {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
if (!_arg5){
_arg5 = 1.70158;
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
}
}//package com.tweener.easing
Section 65
//Bounce (com.tweener.easing.Bounce)
package com.tweener.easing {
public class Bounce {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - Bounce.easeOut((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((Bounce.easeIn((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((Bounce.easeOut(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
}
}//package com.tweener.easing
Section 66
//Circ (com.tweener.easing.Circ)
package com.tweener.easing {
public class Circ {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
}
}//package com.tweener.easing
Section 67
//Cubic (com.tweener.easing.Cubic)
package com.tweener.easing {
public class Cubic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package com.tweener.easing
Section 68
//Elastic (com.tweener.easing.Elastic)
package com.tweener.easing {
public class Elastic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local5 = (_local6 / 4);
_local6 = (_arg4 * 0.3);
_local7 = _arg3;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
_local5 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local7)));
return (((((_local7 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local5) * (2 * Math.PI)) / _local6))) + _arg3) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local5 = (_local6 / 4);
_local6 = (_arg4 * 0.3);
_local7 = _arg3;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
_local5 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local7)));
--_arg1;
return ((-(((_local7 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local5) * (2 * Math.PI)) / _local6)))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local5 = (_local6 / 4);
_local6 = (_arg4 * 0.3);
_local7 = _arg3;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
_local5 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local7)));
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_local7 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local5) * (2 * Math.PI)) / _local6)))) + _arg2));
};
--_arg1;
return ((((((_local7 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local5) * (2 * Math.PI)) / _local6))) * 0.5) + _arg3) + _arg2));
}
}
}//package com.tweener.easing
Section 69
//Expo (com.tweener.easing.Expo)
package com.tweener.easing {
public class Expo {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : ((_arg3 * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==0) ? _arg2 : ((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2));
};
--_arg1;
return ((((_arg3 / 2) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
}
}//package com.tweener.easing
Section 70
//Linear (com.tweener.easing.Linear)
package com.tweener.easing {
public class Linear {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package com.tweener.easing
Section 71
//Quad (com.tweener.easing.Quad)
package com.tweener.easing {
public class Quad {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package com.tweener.easing
Section 72
//Quart (com.tweener.easing.Quart)
package com.tweener.easing {
public class Quart {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
}
}//package com.tweener.easing
Section 73
//Quint (com.tweener.easing.Quint)
package com.tweener.easing {
public class Quint {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package com.tweener.easing
Section 74
//Sine (com.tweener.easing.Sine)
package com.tweener.easing {
public class Sine {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
}
}//package com.tweener.easing
Section 75
//Shortcuts (com.tweener.Shortcuts)
package com.tweener {
import com.tweener.easing.*;
public class Shortcuts {
public static const easeInOutQuad:Function = Quad.easeInOut;
public static const easeInOutBounce:Function = Bounce.easeInOut;
public static const easeOutBack:Function = Back.easeOut;
public static const easeOutExpo:Function = Expo.easeOut;
public static const easeInQuad:Function = Quad.easeIn;
public static const easeInBounce:Function = Bounce.easeIn;
public static const easeOutQuart:Function = Quart.easeOut;
public static const easeInOutLinear:Function = Linear.easeInOut;
public static const easeOutBounce:Function = Bounce.easeOut;
public static const easeInElastic:Function = Elastic.easeIn;
public static const easeOutCubic:Function = Cubic.easeOut;
public static const easeOutQuint:Function = Quint.easeOut;
public static const easeOutSine:Function = Sine.easeOut;
public static const easeInOutBack:Function = Back.easeInOut;
public static const easeOutElastic:Function = Elastic.easeOut;
public static const easeOutCirc:Function = Circ.easeOut;
public static const easeInLinear:Function = Linear.easeIn;
public static const easeInBack:Function = Back.easeIn;
public static const easeInOutExpo:Function = Expo.easeInOut;
public static const easeInOutElastic:Function = Elastic.easeInOut;
public static const easeInExpo:Function = Expo.easeIn;
public static const easeInOutSine:Function = Sine.easeInOut;
public static const easeInQuart:Function = Quart.easeIn;
public static const easeInOutCirc:Function = Circ.easeInOut;
public static const easeOutLinear:Function = Linear.easeOut;
public static const easeInCubic:Function = Cubic.easeIn;
public static const easeInQuint:Function = Quint.easeIn;
public static const easeInSine:Function = Sine.easeIn;
public static const easeInOutQuart:Function = Quart.easeInOut;
public static const easeOutQuad:Function = Quad.easeOut;
public static const easeInOutCubic:Function = Cubic.easeInOut;
public static const easeInCirc:Function = Circ.easeIn;
public static const easeInOutQuint:Function = Quint.easeInOut;
}
}//package com.tweener
Section 76
//Tween (com.tweener.Tween)
package com.tweener {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var tt:Number;
private var dl:Number;
private var finishEarly:Number;
private var twn:Function;
private var earlyFinish:Timer;
private var st:Number;
private var d:Number;
private var e:Number;
private var isTweening:Boolean;// = false
private var f:Function;
private var pauseTimer:Timer;
private var tgt;
private var ct:Number;
private var s:Number;
private var p:String;
public static const ONSTART:String = "onTweenStart";
public static const tweens:Dictionary = new Dictionary(true);
public static const ONFINISH:String = "onTweenFinish";
private static const fc:Shape = new Shape();
public static const ONUPDATE:String = "onTweenUpdate";
public function Tween(_arg1, _arg2:String, _arg3:Number=0, _arg4:Number=1, _arg5:String="easeInSine", _arg6:Number=0, _arg7:Object=null):void{
isTweening = false;
super();
if (tweens[_arg1] == null){
tweens[_arg1] = new Dictionary();
};
tweens[_arg1][_arg2] = this;
tgt = _arg1;
p = _arg2;
twn = Shortcuts[_arg5];
ct = 0;
tt = (_arg4 * 1000);
e = _arg3;
dl = _arg6;
if (_arg7 != null){
finishEarly = ((_arg7.finishEarly) || (null));
f = ((_arg7.onFinish) || (null));
};
}
public function stop():void{
var _local1:*;
isTweening = false;
if (pauseTimer){
pauseTimer.removeEventListener(TimerEvent.TIMER, onPauseOver);
pauseTimer.stop();
pauseTimer = null;
};
if (earlyFinish){
earlyFinish.removeEventListener(TimerEvent.TIMER, onEarlyFinish);
earlyFinish.stop();
earlyFinish = null;
};
fc.removeEventListener(Event.ENTER_FRAME, doTween);
for (_local1 in tweens[tgt]) {
break;
};
if (_local1 == undefined){
delete tweens[tgt];
};
dispatchEvent(new Event(ONFINISH));
}
private function doTween(_arg1:Event):void{
ct = (getTimer() - st);
if (ct < tt){
dispatchEvent(new Event(ONUPDATE));
tgt[p] = twn(ct, s, d, tt);
} else {
fastForward();
};
}
public function play():void{
if (tweens[tgt] == null){
tweens[tgt] = new Dictionary();
};
tweens[tgt][p] = this;
if (dl > 0){
pauseTimer = new Timer((dl * 1000), 1);
pauseTimer.addEventListener(TimerEvent.TIMER, onPauseOver, false, 0, true);
pauseTimer.start();
} else {
initTween();
};
}
private function initTween():void{
if (finishEarly){
earlyFinish = new Timer((finishEarly * 1000), 1);
earlyFinish.addEventListener(TimerEvent.TIMER, onEarlyFinish, false, 0, true);
earlyFinish.start();
};
isTweening = true;
st = getTimer();
s = tgt[p];
d = (e - s);
tgt[p] = s;
fc.addEventListener(Event.ENTER_FRAME, doTween, false, 0, true);
}
public function fastForward():void{
tgt[p] = e;
if (f != null){
f();
};
stop();
}
private function onPauseOver(_arg1:TimerEvent):void{
pauseTimer.removeEventListener(TimerEvent.TIMER, onPauseOver);
pauseTimer = null;
dispatchEvent(new Event(ONSTART));
initTween();
}
private function onEarlyFinish(_arg1:TimerEvent):void{
earlyFinish.removeEventListener(TimerEvent.TIMER, onEarlyFinish);
earlyFinish = null;
if (f != null){
f();
};
stop();
}
}
}//package com.tweener
Section 77
//Tweener (com.tweener.Tweener)
package com.tweener {
public class Tweener {
public static function stopTween(_arg1, _arg2:String):void{
var target = _arg1;
var prop = _arg2;
try {
Tween.tweens[target][prop].stop();
} catch(e) {
};
}
public static function tween(_arg1, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Number=0, _arg7:Object=null):Tween{
var _local8:Tween;
_local8 = new Tween(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
_local8.play();
return (_local8);
}
}
}//package com.tweener
Section 78
//Array2 (de.polygonal.ds.Array2)
package de.polygonal.ds {
public class Array2 implements Collection {
private var _a:Array;
private var _h:int;
private var _w:int;
public function Array2(_arg1:int, _arg2:int){
_a = new Array(((_w = _arg1) * (_h = _arg2)));
fill(null);
}
public function fill(_arg1):void{
var _local2:int;
var _local3:int;
_local2 = (_w * _h);
_local3 = 0;
while (_local3 < _local2) {
_a[_local3] = _arg1;
_local3++;
};
}
public function get width():int{
return (_w);
}
public function get size():int{
return ((_w * _h));
}
public function getCol(_arg1:int):Array{
var _local2:Array;
var _local3:int;
_local2 = [];
_local3 = 0;
while (_local3 < _h) {
_local2[_local3] = _a[int(((_local3 * _w) + _arg1))];
_local3++;
};
return (_local2);
}
public function shiftDown():void{
var _local1:int;
if (_h == 1){
return;
};
_local1 = ((_h - 1) * _w);
_a = _a.slice(_local1, (_local1 + _w)).concat(_a);
_a.splice((_h * _w), _w);
}
public function set width(_arg1:int):void{
resize(_arg1, _h);
}
public function appendCol(_arg1:Array):void{
var _local2:int;
_arg1.length = _h;
_local2 = 0;
while (_local2 < _h) {
_a.splice((((_local2 * _w) + _w) + _local2), 0, _arg1[_local2]);
_local2++;
};
_w++;
}
public function set height(_arg1:int):void{
resize(_w, _arg1);
}
public function clear():void{
_a = new Array(size);
}
public function get(_arg1:int, _arg2:int){
return (_a[int(((_arg2 * _w) + _arg1))]);
}
public function prependCol(_arg1:Array):void{
var _local2:int;
_arg1.length = _h;
_local2 = 0;
while (_local2 < _h) {
_a.splice(((_local2 * _w) + _local2), 0, _arg1[_local2]);
_local2++;
};
_w++;
}
public function isEmpty():Boolean{
return (false);
}
public function toArray():Array{
var _local1:Array;
var _local2:int;
_local1 = _a.concat();
_local2 = size;
if (_local1.length > _local2){
_local1.length = _local2;
};
return (_local1);
}
public function contains(_arg1):Boolean{
var _local2:int;
var _local3:int;
_local2 = size;
_local3 = 0;
while (_local3 < _local2) {
if (_a[_local3] === _arg1){
return (true);
};
_local3++;
};
return (false);
}
public function appendRow(_arg1:Array):void{
_arg1.length = _w;
_a = _a.concat(_arg1);
_h++;
}
public function dump():String{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:int;
var _local5:int;
_local1 = "Array2\n{";
_local4 = 0;
while (_local4 < _h) {
_local1 = (_local1 + ("\n" + "\t"));
_local2 = (_local4 * _w);
_local5 = 0;
while (_local5 < _w) {
_local3 = _a[int((_local2 + _local5))];
_local1 = (_local1 + (("[" + ((_local3)!=undefined) ? _local3 : "?") + "]"));
_local5++;
};
_local4++;
};
_local1 = (_local1 + "\n}");
return (_local1);
}
public function getRow(_arg1:int):Array{
var _local2:int;
_local2 = (_arg1 * _w);
return (_a.slice(_local2, (_local2 + _w)));
}
public function get height():int{
return (_h);
}
public function getIterator():Iterator{
return (new Array2Iterator(this));
}
public function prependRow(_arg1:Array):void{
_arg1.length = _w;
_a = _arg1.concat(_a);
_h++;
}
public function shiftLeft():void{
var _local1:int;
var _local2:int;
var _local3:int;
if (_w == 1){
return;
};
_local1 = (_w - 1);
_local3 = 0;
while (_local3 < _h) {
_local2 = ((_local3 * _w) + _local1);
_a.splice(_local2, 0, _a.splice((_local2 - _local1), 1));
_local3++;
};
}
public function set(_arg1:int, _arg2:int, _arg3):void{
_a[int(((_arg2 * _w) + _arg1))] = _arg3;
}
public function resize(_arg1:int, _arg2:int):void{
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
if (_arg1 <= 0){
_arg1 = 1;
};
if (_arg2 <= 0){
_arg2 = 1;
};
_local3 = _a.concat();
_a.length = 0;
_a.length = (_arg1 * _arg2);
_local4 = ((_arg1 < _w)) ? _arg1 : _w;
_local5 = ((_arg2 < _h)) ? _arg2 : _h;
_local7 = 0;
while (_local7 < _local5) {
_local8 = (_local7 * _arg1);
_local9 = (_local7 * _w);
_local6 = 0;
while (_local6 < _local4) {
_a[int((_local8 + _local6))] = _local3[int((_local9 + _local6))];
_local6++;
};
_local7++;
};
_w = _arg1;
_h = _arg2;
}
public function transpose():void{
var _local1:Array;
var _local2:int;
var _local3:int;
_local1 = _a.concat();
_local2 = 0;
while (_local2 < _h) {
_local3 = 0;
while (_local3 < _w) {
_a[int(((_local3 * _w) + _local2))] = _local1[int(((_local2 * _w) + _local3))];
_local3++;
};
_local2++;
};
}
public function shiftRight():void{
var _local1:int;
var _local2:int;
var _local3:int;
if (_w == 1){
return;
};
_local1 = (_w - 1);
_local3 = 0;
while (_local3 < _h) {
_local2 = ((_local3 * _w) + _local1);
_a.splice((_local2 - _local1), 0, _a.splice(_local2, 1));
_local3++;
};
}
public function toString():String{
return ((((("[Array2, width=" + width) + ", height=") + height) + "]"));
}
public function shiftUp():void{
if (_h == 1){
return;
};
_a = _a.concat(_a.slice(0, _w));
_a.splice(0, _w);
}
}
}//package de.polygonal.ds
class Array2Iterator implements Iterator {
private var _a2:Array2;
private var _xCursor:int;
private var _yCursor:int;
private function Array2Iterator(_arg1:Array2){
_a2 = _arg1;
_xCursor = (_yCursor = 0);
}
public function start():void{
_xCursor = (_yCursor = 0);
}
public function hasNext():Boolean{
return ((((_yCursor * _a2.width) + _xCursor) < _a2.size));
}
public function get data(){
return (_a2.get(_xCursor, _yCursor));
}
public function set data(_arg1):void{
_a2.set(_xCursor, _yCursor, _arg1);
}
public function next(){
var _local1:*;
_local1 = data;
if (++_xCursor == _a2.width){
_yCursor++;
_xCursor = 0;
};
return (_local1);
}
}
Section 79
//Collection (de.polygonal.ds.Collection)
package de.polygonal.ds {
public interface Collection {
function isEmpty():Boolean;
function getIterator():Iterator;
function get size():int;
function clear():void;
function toArray():Array;
function contains(_arg1):Boolean;
}
}//package de.polygonal.ds
Section 80
//Iterator (de.polygonal.ds.Iterator)
package de.polygonal.ds {
public interface Iterator {
function start():void;
function next();
function set data(_arg1):void;
function get data();
function hasNext():Boolean;
}
}//package de.polygonal.ds
Section 81
//Elastic (fl.motion.easing.Elastic)
package fl.motion.easing {
public class Elastic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) + _arg3) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) * 0.5) + _arg3) + _arg2));
}
}
}//package fl.motion.easing
Section 82
//TweenFilterLite (gs.TweenFilterLite)
package gs {
import flash.display.*;
import flash.filters.*;
public class TweenFilterLite extends TweenLite {
private var _endMatrix:Array;
private var _hf:Boolean;// = false
private var _matrix:Array;
private var _cmf:ColorMatrixFilter;
private var _clrsa:Array;
private var _filters:Array;
public static var defaultEase:Function = TweenLite.defaultEase;
private static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
private static var _lumB:Number = 0.072169;
public static var version:Number = 7.06;
public static var delayedCall:Function = TweenLite.delayedCall;
public static var killTweensOf:Function = TweenLite.killTweensOf;
private static var _lumG:Number = 0.71516;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _lumR:Number = 0.212671;
public function TweenFilterLite(_arg1:Object, _arg2:Number, _arg3:Object){
_hf = false;
_filters = [];
super(_arg1, _arg2, _arg3);
if ((((TweenLite.version < 6.1)) || (isNaN(TweenLite.version)))){
};
if (_arg3.type != undefined){
};
}
override public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:uint;
var _local4:Object;
var _local5:Object;
var _local6:Object;
_clrsa = [];
_filters = [];
_matrix = _idMatrix.slice();
_arg2 = (_arg2 + " blurFilter glowFilter colorMatrixFilter dropShadowFilter bevelFilter ");
if ((this.target is DisplayObject)){
if (this.vars.blurFilter != undefined){
_local4 = this.vars.blurFilter;
addFilter("blur", _local4, BlurFilter, ["blurX", "blurY", "quality"], new BlurFilter(0, 0, ((_local4.quality) || (2))));
};
if (this.vars.glowFilter != undefined){
_local4 = this.vars.glowFilter;
addFilter("glow", _local4, GlowFilter, ["alpha", "blurX", "blurY", "color", "quality", "strength", "inner", "knockout"], new GlowFilter(0xFFFFFF, 0, 0, 0, ((_local4.strength) || (1)), ((_local4.quality) || (2)), _local4.inner, _local4.knockout));
};
if (this.vars.colorMatrixFilter != undefined){
_local4 = this.vars.colorMatrixFilter;
_local5 = addFilter("colorMatrix", _local4, ColorMatrixFilter, [], new ColorMatrixFilter(_matrix));
_cmf = _local5.filter;
_matrix = ColorMatrixFilter(_cmf).matrix;
if (((!((_local4.matrix == undefined))) && ((_local4.matrix is Array)))){
_endMatrix = _local4.matrix;
} else {
if (_local4.relative == true){
_endMatrix = _matrix.slice();
} else {
_endMatrix = _idMatrix.slice();
};
_endMatrix = setBrightness(_endMatrix, _local4.brightness);
_endMatrix = setContrast(_endMatrix, _local4.contrast);
_endMatrix = setHue(_endMatrix, _local4.hue);
_endMatrix = setSaturation(_endMatrix, _local4.saturation);
_endMatrix = setThreshold(_endMatrix, _local4.threshold);
if (!isNaN(_local4.colorize)){
_endMatrix = colorize(_endMatrix, _local4.colorize, _local4.amount);
} else {
if (!isNaN(_local4.color)){
_endMatrix = colorize(_endMatrix, _local4.color, _local4.amount);
};
};
};
_local3 = 0;
while (_local3 < _endMatrix.length) {
if (((!((_matrix[_local3] == _endMatrix[_local3]))) && (!((_matrix[_local3] == undefined))))){
this.tweens[("tfl_mtx" + _local3)] = {o:_matrix, p:_local3.toString(), s:_matrix[_local3], c:(_endMatrix[_local3] - _matrix[_local3])};
};
_local3++;
};
};
if (this.vars.dropShadowFilter != undefined){
_local4 = this.vars.dropShadowFilter;
addFilter("dropShadow", _local4, DropShadowFilter, ["alpha", "angle", "blurX", "blurY", "color", "distance", "quality", "strength", "inner", "knockout", "hideObject"], new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_local4.quality) || (2)), _local4.inner, _local4.knockout, _local4.hideObject));
};
if (this.vars.bevelFilter != undefined){
_local4 = this.vars.bevelFilter;
addFilter("bevel", _local4, BevelFilter, ["angle", "blurX", "blurY", "distance", "highlightAlpha", "highlightColor", "quality", "shadowAlpha", "shadowColor", "strength"], new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_local4.quality) || (2))));
};
if (this.vars.runBackwards == true){
_local3 = 0;
while (_local3 < _clrsa.length) {
_local6 = _clrsa[_local3];
_clrsa[_local3].sr = (_local6.sr + _local6.cr);
_local6.cr = (_local6.cr * -1);
_local6.sg = (_local6.sg + _local6.cg);
_local6.cg = (_local6.cg * -1);
_local6.sb = (_local6.sb + _local6.cb);
_local6.cb = (_local6.cb * -1);
_local6.f[_local6.p] = (((_local6.sr << 16) | (_local6.sg << 8)) | _local6.sb);
_local3++;
};
};
super.initTweenVals(true, _arg2);
} else {
super.initTweenVals(_arg1, _arg2);
};
}
override public function render(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local6:String;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:int;
var _local11:Array;
_local2 = ((_arg1 - this.startTime) / 1000);
if (_local2 > this.duration){
_local2 = this.duration;
};
_local3 = this.vars.ease(_local2, 0, 1, this.duration);
for (_local6 in this.tweens) {
_local4 = this.tweens[_local6];
_local4.o[_local4.p] = (_local4.s + (_local3 * _local4.c));
};
if (_hf){
_local5 = 0;
while (_local5 < _clrsa.length) {
_local4 = _clrsa[_local5];
_local7 = (_local4.sr + (_local3 * _local4.cr));
_local8 = (_local4.sg + (_local3 * _local4.cg));
_local9 = (_local4.sb + (_local3 * _local4.cb));
_local4.f[_local4.p] = (((_local7 << 16) | (_local8 << 8)) | _local9);
_local5++;
};
if (_cmf != null){
ColorMatrixFilter(_cmf).matrix = _matrix;
};
_local11 = this.target.filters;
_local5 = 0;
while (_local5 < _filters.length) {
_local10 = (_local11.length - 1);
while (_local10 > -1) {
if ((_local11[_local10] is _filters[_local5].type)){
_local11.splice(_local10, 1, _filters[_local5].filter);
break;
};
_local10--;
};
_local5++;
};
this.target.filters = _local11;
};
if (_hst){
_local5 = 0;
while (_local5 < _subTweens.length) {
_subTweens[_local5].proxy(_subTweens[_local5]);
_local5++;
};
};
if (this.vars.onUpdate != null){
this.vars.onUpdate.apply(this.vars.onUpdateScope, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
super.complete(true);
};
}
private function addFilter(_arg1:String, _arg2:Object, _arg3:Class, _arg4:Array, _arg5:BitmapFilter):Object{
var _local6:Object;
var _local7:Array;
var _local8:int;
var _local9:String;
var _local10:Number;
var _local11:Object;
var _local12:Object;
_local6 = {type:_arg3};
_local7 = this.target.filters;
_local8 = 0;
while (_local8 < _local7.length) {
if ((_local7[_local8] is _arg3)){
_local6.filter = _local7[_local8];
break;
};
_local8++;
};
if (_local6.filter == undefined){
_local6.filter = _arg5;
_local7.push(_local6.filter);
this.target.filters = _local7;
};
_local8 = 0;
while (_local8 < _arg4.length) {
_local9 = _arg4[_local8];
if (_arg2[_local9] != undefined){
if ((((((_local9 == "color")) || ((_local9 == "highlightColor")))) || ((_local9 == "shadowColor")))){
_local11 = HEXtoRGB(_local6.filter[_local9]);
_local12 = HEXtoRGB(_arg2[_local9]);
_clrsa.push({f:_local6.filter, p:_local9, sr:_local11.rb, cr:(_local12.rb - _local11.rb), sg:_local11.gb, cg:(_local12.gb - _local11.gb), sb:_local11.bb, cb:(_local12.bb - _local11.bb)});
} else {
if ((((((((_local9 == "quality")) || ((_local9 == "inner")))) || ((_local9 == "knockout")))) || ((_local9 == "hideObject")))){
_local6.filter[_local9] = _arg2[_local9];
} else {
if (typeof(_arg2[_local9]) == "number"){
_local10 = (_arg2[_local9] - _local6.filter[_local9]);
} else {
_local10 = Number(_arg2[_local9]);
};
this.tweens[(("tfl_" + _arg1) + _local8)] = {o:_local6.filter, p:_local9, s:_local6.filter[_local9], c:_local10};
};
};
};
_local8++;
};
_filters.push(_local6);
_hf = true;
return (_local6);
}
public function HEXtoRGB(_arg1:Number):Object{
return ({rb:(_arg1 >> 16), gb:((_arg1 >> 8) & 0xFF), bb:(_arg1 & 0xFF)});
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
var _local3:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
_local3 = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=100):Array{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
_local4 = (((_arg2 >> 16) & 0xFF) / 0xFF);
_local5 = (((_arg2 >> 8) & 0xFF) / 0xFF);
_local6 = ((_arg2 & 0xFF) / 0xFF);
_local7 = (1 - _arg3);
_local8 = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_local3 = (1 - _arg2);
_local4 = (_local3 * _lumR);
_local5 = (_local3 * _lumG);
_local6 = (_local3 * _lumB);
_local7 = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
_local3 = [];
_local4 = 0;
_local5 = 0;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7++;
};
_local4 = (_local4 + 5);
_local6++;
};
return (_local3);
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenFilterLite{
_arg3.runBackwards = true;
return (new TweenFilterLite(_arg1, _arg2, _arg3));
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
var _local3:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_local3 = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
var _local3:Number;
var _local4:Number;
var _local5:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
_local3 = Math.cos(_arg2);
_local4 = Math.sin(_arg2);
_local5 = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenFilterLite{
return (new TweenFilterLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 83
//TweenLite (gs.TweenLite)
package gs {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class TweenLite {
public var delay:Number;
protected var _initted:Boolean;
protected var _subTweens:Array;
public var startTime:uint;
public var target:Object;
public var duration:Number;
protected var _hst:Boolean;
protected var _active:Boolean;
public var vars:Object;
public var tweens:Object;
public var initTime:uint;
private static var _timer:Timer = new Timer(2000);
private static var _classInitted:Boolean;
public static var defaultEase:Function = TweenLite.easeOut;
public static var version:Number = 6.1;
private static var _sprite:Sprite = new Sprite();
protected static var _all:Dictionary = new Dictionary();
public static var killDelayedCallsTo:Function = killTweensOf;
protected static var _curTime:uint;
private static var _listening:Boolean;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
if (_arg1 == null){
return;
};
if (((((!((_arg3.overwrite == false))) && (!((_arg1 == null))))) || ((_all[_arg1] == undefined)))){
delete _all[_arg1];
_all[_arg1] = new Dictionary();
};
_all[_arg1][this] = this;
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.target = _arg1;
if (!(this.vars.ease is Function)){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
};
this.tweens = {};
_subTweens = [];
_hst = (_initted = false);
_active = (((_arg2 == 0)) && ((this.delay == 0)));
if (!_classInitted){
_curTime = getTimer();
_sprite.addEventListener(Event.ENTER_FRAME, executeAll);
_classInitted = true;
};
this.initTime = _curTime;
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (_active))){
initTweenVals();
this.startTime = _curTime;
if (_active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
};
if (((!(_listening)) && (!(_active)))){
_timer.addEventListener("timer", killGarbage);
_timer.start();
_listening = true;
};
}
protected function addSubTween(_arg1:Function, _arg2:Object, _arg3:Object, _arg4:Object=null):void{
var _local5:String;
_subTweens.push({proxy:_arg1, target:_arg2, info:_arg4});
for (_local5 in _arg3) {
if (_arg2.hasOwnProperty(_local5)){
if (typeof(_arg3[_local5]) == "number"){
this.tweens[((("st" + _subTweens.length) + "_") + _local5)] = {o:_arg2, p:_local5, s:_arg2[_local5], c:(_arg3[_local5] - _arg2[_local5])};
} else {
this.tweens[((("st" + _subTweens.length) + "_") + _local5)] = {o:_arg2, p:_local5, s:_arg2[_local5], c:Number(_arg3[_local5])};
};
};
};
_hst = true;
}
public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:Boolean;
var _local4:String;
var _local5:Array;
var _local6:int;
var _local7:ColorTransform;
var _local8:ColorTransform;
var _local9:Object;
_local3 = (this.target is DisplayObject);
if ((this.target is Array)){
_local5 = ((this.vars.endArray) || ([]));
_local6 = 0;
while (_local6 < _local5.length) {
if (((!((this.target[_local6] == _local5[_local6]))) && (!((this.target[_local6] == undefined))))){
this.tweens[_local6.toString()] = {o:this.target, p:_local6.toString(), s:this.target[_local6], c:(_local5[_local6] - this.target[_local6])};
};
_local6++;
};
} else {
for (_local4 in this.vars) {
if ((((((((((((((((((((((((((((((((((_local4 == "ease")) || ((_local4 == "delay")))) || ((_local4 == "overwrite")))) || ((_local4 == "onComplete")))) || ((_local4 == "onCompleteParams")))) || ((_local4 == "onCompleteScope")))) || ((_local4 == "runBackwards")))) || ((_local4 == "onUpdate")))) || ((_local4 == "onUpdateParams")))) || ((_local4 == "onUpdateScope")))) || ((_local4 == "autoAlpha")))) || ((_local4 == "onStart")))) || ((_local4 == "onStartParams")))) || ((_local4 == "onStartScope")))) || ((_local4 == "renderOnStart")))) || ((_local4 == "easeParams")))) || (((_arg1) && (!((_arg2.indexOf(((" " + _local4) + " ")) == -1))))))){
} else {
if ((((_local4 == "tint")) && (_local3))){
_local7 = this.target.transform.colorTransform;
_local8 = new ColorTransform();
if (this.vars.alpha != undefined){
_local8.alphaMultiplier = this.vars.alpha;
delete this.vars.alpha;
delete this.tweens.alpha;
} else {
_local8.alphaMultiplier = this.target.alpha;
};
if (((!((this.vars[_local4] == null))) && (!((this.vars[_local4] == ""))))){
_local8.color = this.vars[_local4];
};
addSubTween(tintProxy, {progress:0}, {progress:1}, {target:this.target, color:_local7, endColor:_local8});
} else {
if ((((_local4 == "frame")) && (_local3))){
addSubTween(frameProxy, {frame:this.target.currentFrame}, {frame:this.vars[_local4]}, {target:this.target});
} else {
if ((((_local4 == "volume")) && (((_local3) || ((this.target is SoundChannel)))))){
addSubTween(volumeProxy, this.target.soundTransform, {volume:this.vars[_local4]}, {target:this.target});
} else {
if (this.target.hasOwnProperty(_local4)){
if (typeof(this.vars[_local4]) == "number"){
this.tweens[_local4] = {o:this.target, p:_local4, s:this.target[_local4], c:(this.vars[_local4] - this.target[_local4])};
} else {
this.tweens[_local4] = {o:this.target, p:_local4, s:this.target[_local4], c:Number(this.vars[_local4])};
};
};
};
};
};
};
};
};
if (this.vars.runBackwards == true){
for (_local4 in this.tweens) {
_local9 = this.tweens[_local4];
this.tweens[_local4].s = (_local9.s + _local9.c);
_local9.c = (_local9.c * -1);
};
};
if (typeof(this.vars.autoAlpha) == "number"){
this.target.visible = !((((this.vars.runBackwards == true)) && ((this.target.alpha == 0))));
};
_initted = true;
}
public function get active():Boolean{
if (_active){
return (true);
};
if (((_curTime - this.initTime) / 1000) > this.delay){
_active = true;
this.startTime = (this.initTime + (this.delay * 1000));
if (!_initted){
initTweenVals();
} else {
if (typeof(this.vars.autoAlpha) == "number"){
this.target.visible = true;
};
};
if (this.vars.onStart != null){
this.vars.onStart.apply(this.vars.onStartScope, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
return (true);
//unresolved jump
};
return (false);
}
public function render(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
var _local4:Object;
var _local5:String;
var _local6:uint;
_local2 = ((_arg1 - this.startTime) / 1000);
if (_local2 > this.duration){
_local2 = this.duration;
};
_local3 = this.vars.ease(_local2, 0, 1, this.duration);
for (_local5 in this.tweens) {
_local4 = this.tweens[_local5];
_local4.o[_local4.p] = (_local4.s + (_local3 * _local4.c));
};
if (_hst){
_local6 = 0;
while (_local6 < _subTweens.length) {
_subTweens[_local6].proxy(_subTweens[_local6]);
_local6++;
};
};
if (this.vars.onUpdate != null){
this.vars.onUpdate.apply(this.vars.onUpdateScope, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function complete(_arg1:Boolean=false):void{
if (!_arg1){
if (!_initted){
initTweenVals();
};
render((this.startTime + (this.duration * 1000)));
return;
};
if ((((typeof(this.vars.autoAlpha) == "number")) && ((this.target.alpha == 0)))){
this.target.visible = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(this.vars.onCompleteScope, this.vars.onCompleteParams);
};
removeTween(this);
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function frameProxy(_arg1:Object):void{
_arg1.info.target.gotoAndStop(Math.round(_arg1.target.frame));
}
public static function removeTween(_arg1:TweenLite=null):void{
if (((!((_arg1 == null))) && (!((_all[_arg1.target] == undefined))))){
delete _all[_arg1.target][_arg1];
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Object;
var _local4:*;
if (((!((_arg1 == null))) && (!((_all[_arg1] == undefined))))){
if (_arg2){
_local3 = _all[_arg1];
for (_local4 in _local3) {
_local3[_local4].complete(false);
};
};
delete _all[_arg1];
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, onCompleteScope:_arg4, overwrite:false}));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function executeAll(_arg1:Event=null):void{
var _local2:Dictionary;
var _local3:uint;
var _local4:Object;
var _local5:Object;
_local2 = _all;
_local3 = (_curTime = getTimer());
if (_listening){
for (_local4 in _local2) {
for (_local5 in _local2[_local4]) {
if (((!((_local2[_local4][_local5] == undefined))) && (_local2[_local4][_local5].active))){
_local2[_local4][_local5].render(_local3);
if (_local2[_local4] == undefined){
break;
};
};
};
};
};
}
public static function volumeProxy(_arg1:Object):void{
_arg1.info.target.soundTransform = _arg1.target;
}
public static function killGarbage(_arg1:TimerEvent):void{
var _local2:uint;
var _local3:Boolean;
var _local4:Object;
var _local5:Object;
var _local6:Object;
_local2 = 0;
for (_local4 in _all) {
_local3 = false;
for (_local5 in _all[_local4]) {
_local3 = true;
break;
};
if (!_local3){
delete _all[_local4];
} else {
_local2++;
};
};
if (_local2 == 0){
_timer.removeEventListener("timer", killGarbage);
_timer.stop();
_listening = false;
};
}
public static function tintProxy(_arg1:Object):void{
var _local2:Number;
var _local3:Number;
_local2 = _arg1.target.progress;
_local3 = (1 - _local2);
_arg1.info.target.transform.colorTransform = new ColorTransform(((_arg1.info.color.redMultiplier * _local3) + (_arg1.info.endColor.redMultiplier * _local2)), ((_arg1.info.color.greenMultiplier * _local3) + (_arg1.info.endColor.greenMultiplier * _local2)), ((_arg1.info.color.blueMultiplier * _local3) + (_arg1.info.endColor.blueMultiplier * _local2)), ((_arg1.info.color.alphaMultiplier * _local3) + (_arg1.info.endColor.alphaMultiplier * _local2)), ((_arg1.info.color.redOffset * _local3) + (_arg1.info.endColor.redOffset * _local2)), ((_arg1.info.color.greenOffset * _local3) + (_arg1.info.endColor.greenOffset * _local2)), ((_arg1.info.color.blueOffset * _local3) + (_arg1.info.endColor.blueOffset * _local2)), ((_arg1.info.color.alphaOffset * _local3) + (_arg1.info.endColor.alphaOffset * _local2)));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 84
//TweenMax (gs.TweenMax)
package gs {
import flash.utils.*;
public class TweenMax extends TweenFilterLite {
private var _pauseTime:Number;
public static var delayedCall:Function = TweenLite.delayedCall;
public static var killDelayedCallsTo:Function = TweenLite.killDelayedCallsTo;
public static var defaultEase:Function = TweenLite.defaultEase;
public static var removeTween:Function = TweenLite.removeTween;
public static var version:Number = 0.9;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public function TweenMax(_arg1:Object, _arg2:Number, _arg3:Object){
super(_arg1, _arg2, _arg3);
_pauseTime = -1;
if ((((TweenFilterLite.version < 7.06)) || (isNaN(TweenFilterLite.version)))){
};
}
override public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:String;
var _local4:int;
var _local5:Object;
var _local6:Object;
var _local7:Array;
_arg2 = (_arg2 + " hexColors bezier bezierThrough ");
if (((!((this.vars.bezier == undefined))) && ((this.vars.bezier is Array)))){
_local6 = {};
_local7 = this.vars.bezier;
_local4 = 0;
while (_local4 < _local7.length) {
for (_local3 in _local7[_local4]) {
if (_local6[_local3] == undefined){
_local6[_local3] = [this.target[_local3]];
};
if (typeof(_local7[_local4][_local3]) == "number"){
_local6[_local3].push(_local7[_local4][_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(_local7[_local4][_local3])));
};
};
_local4++;
};
for (_local3 in _local6) {
if (typeof(this.vars[_local3]) == "number"){
_local6[_local3].push(this.vars[_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(this.vars[_local3])));
};
delete this.vars[_local3];
};
addSubTween(bezierProxy, {t:0}, {t:1}, {props:parseBeziers(_local6, false), target:this.target});
};
if (((!((this.vars.bezierThrough == undefined))) && ((this.vars.bezierThrough is Array)))){
_local6 = {};
_local7 = this.vars.bezierThrough;
_local4 = 0;
while (_local4 < _local7.length) {
for (_local3 in _local7[_local4]) {
if (_local6[_local3] == undefined){
_local6[_local3] = [this.target[_local3]];
};
if (typeof(_local7[_local4][_local3]) == "number"){
_local6[_local3].push(_local7[_local4][_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(_local7[_local4][_local3])));
};
};
_local4++;
};
for (_local3 in _local6) {
if (typeof(this.vars[_local3]) == "number"){
_local6[_local3].push(this.vars[_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(this.vars[_local3])));
};
delete this.vars[_local3];
};
addSubTween(bezierProxy, {t:0}, {t:1}, {props:parseBeziers(_local6, true), target:this.target});
};
if (((!((this.vars.hexColors == undefined))) && ((typeof(this.vars.hexColors) == "object")))){
for (_local3 in this.vars.hexColors) {
addSubTween(hexColorsProxy, {r:(this.target[_local3] >> 16), g:((this.target[_local3] >> 8) & 0xFF), b:(this.target[_local3] & 0xFF)}, {r:(this.vars.hexColors[_local3] >> 16), g:((this.vars.hexColors[_local3] >> 8) & 0xFF), b:(this.vars.hexColors[_local3] & 0xFF)}, {prop:_local3, target:this.target});
};
};
super.initTweenVals(true, _arg2);
}
override public function get active():Boolean{
if (_active){
return (true);
};
if (_pauseTime != -1){
return (false);
};
if (((_curTime - this.initTime) / 1000) > this.delay){
_active = true;
this.startTime = (this.initTime + (this.delay * 1000));
if (this.vars.runBackwards != true){
initTweenVals();
} else {
if (typeof(this.vars.autoAlpha) == "number"){
this.target.visible = true;
};
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
return (true);
//unresolved jump
};
return (false);
}
public function set progress(_arg1:Number):void{
var _local2:uint;
var _local3:Number;
var _local4:Boolean;
_local2 = _curTime;
_local3 = (_local2 - ((this.duration * _arg1) * 1000));
this.initTime = (_local3 - (this.delay * 1000));
_local4 = this.active;
this.startTime = _local3;
render(_local2);
}
public function set paused(_arg1:Boolean):void{
if (_arg1){
this.pause();
} else {
this.resume();
};
}
public function resume():void{
var _local1:Number;
if (_pauseTime != -1){
_local1 = (_curTime - _pauseTime);
this.initTime = (this.initTime + _local1);
if (!isNaN(this.startTime)){
this.startTime = (this.startTime + _local1);
};
_pauseTime = -1;
if (((_curTime - this.initTime) / 1000) > this.delay){
_active = true;
};
};
}
public function get paused():Boolean{
if (_pauseTime != -1){
return (true);
};
return (false);
}
public function get progress():Number{
return ((((((_curTime - this.startTime) / 1000) / this.duration)) || (0)));
}
public function pause():void{
if (_pauseTime == -1){
_pauseTime = _curTime;
_active = false;
};
}
public static function sequence(_arg1:Object, _arg2:Array):Array{
var _local3:Boolean;
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:uint;
_local3 = true;
if (_arg2[0].overwrite == false){
_local3 = false;
};
_local4 = [];
_local5 = 0;
_local8 = 0;
while (_local8 < _arg2.length) {
_local7 = ((_arg2[_local8].time) || (0));
delete _arg2[_local8].time;
_local6 = ((_arg2[_local8].delay) || (0));
_arg2[_local8].delay = (_local5 + _local6);
_arg2[_local8].overwrite = _local3;
_local4.push(new TweenMax(_arg1, _local7, _arg2[_local8]));
_local5 = (_local5 + (_local7 + _local6));
_local3 = false;
_local8++;
};
return (_local4);
}
public static function hexColorsProxy(_arg1:Object):void{
_arg1.info.target[_arg1.info.prop] = (((_arg1.target.r << 16) | (_arg1.target.g << 8)) | _arg1.target.b);
}
public static function parseBeziers(_arg1:Object, _arg2:Boolean=false):Object{
var _local3:int;
var _local4:Array;
var _local5:Object;
var _local6:String;
var _local7:Object;
_local7 = {};
if (_arg2){
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 2){
_local5.push({s:_local4[0], cp:(_local4[1] - ((_local4[2] - _local4[0]) / 4)), e:_local4[1]});
_local3 = 1;
while (_local3 < (_local4.length - 1)) {
_local5.push({s:_local4[_local3], cp:(_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)].cp)), e:_local4[(_local3 + 1)]});
_local3++;
};
} else {
_local5.push({s:_local4[0], cp:((_local4[0] + _local4[1]) / 2), e:_local4[1]});
};
};
} else {
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 3){
_local5.push({s:_local4[0], cp:_local4[1], e:((_local4[1] + _local4[2]) / 2)});
_local3 = 2;
while (_local3 < (_local4.length - 2)) {
_local5.push({s:_local5[(_local3 - 2)].e, cp:_local4[_local3], e:((_local4[_local3] + _local4[(_local3 + 1)]) / 2)});
_local3++;
};
_local5.push({s:_local5[(_local5.length - 1)].e, cp:_local4[(_local4.length - 2)], e:_local4[(_local4.length - 1)]});
} else {
if (_local4.length == 3){
_local5.push({s:_local4[0], cp:_local4[1], e:_local4[2]});
} else {
if (_local4.length == 2){
_local5.push({s:_local4[0], cp:((_local4[0] + _local4[1]) / 2), e:_local4[1]});
};
};
};
};
};
return (_local7);
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
_arg3.runBackwards = true;
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function bezierProxy(_arg1:Object):void{
var _local2:Number;
var _local3:Object;
var _local4:Object;
var _local5:int;
var _local6:String;
var _local7:Object;
var _local8:Number;
var _local9:uint;
_local2 = _arg1.target.t;
_local3 = _arg1.info.props;
_local4 = _arg1.info.target;
for (_local6 in _local3) {
_local9 = _local3[_local6].length;
if (_local2 < 0){
_local5 = 0;
} else {
if (_local2 >= 1){
_local5 = (_local9 - 1);
} else {
_local5 = int((_local9 * _local2));
};
};
_local8 = ((_local2 - (_local5 * (1 / _local9))) * _local9);
_local7 = _local3[_local6][_local5];
_local4[_local6] = (_local7.s + (_local8 * (((2 * (1 - _local8)) * (_local7.cp - _local7.s)) + (_local8 * (_local7.e - _local7.s)))));
};
}
public static function getAllTweens():Array{
var _local1:Dictionary;
var _local2:Array;
var _local3:Object;
var _local4:Object;
_local1 = _all;
_local2 = [];
for (_local3 in _local1) {
for (_local4 in _local1[_local3]) {
if (_local1[_local3][_local4] != undefined){
_local2.push(_local1[_local3][_local4]);
};
};
};
return (_local2);
}
public static function getTweensOf(_arg1:Object):Array{
var _local2:Dictionary;
var _local3:Array;
var _local4:Object;
_local2 = _all[_arg1];
_local3 = [];
if (_local2 != null){
for (_local4 in _local2) {
if (_local2[_local4].tweens != undefined){
_local3.push(_local2[_local4]);
};
};
};
return (_local3);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:Array;
var _local3:Number;
_local2 = getTweensOf(_arg1);
_local3 = 0;
while (_local3 < _local2.length) {
if (_local2[_local3].active){
return (true);
};
_local3++;
};
return (false);
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
return (new TweenMax(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 85
//FreeCamera3D (org.papervision3d.cameras.FreeCamera3D)
package org.papervision3d.cameras {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.math.*;
public class FreeCamera3D extends CameraObject3D {
public static const TYPE:String = "FREECAMERA3D";
public function FreeCamera3D(_arg1:Number=2, _arg2:Number=100, _arg3:Object=null){
super(_arg1, _arg2, _arg3);
}
override public function transformView(_arg1:Matrix3D=null):void{
if (this._transformDirty){
updateTransform();
};
super.transformView();
}
}
}//package org.papervision3d.cameras
Section 86
//CoordinateTools (org.papervision3d.core.components.as3.utils.CoordinateTools)
package org.papervision3d.core.components.as3.utils {
import flash.display.*;
import flash.geom.*;
public class CoordinateTools {
public static function random(_arg1:Number):Number{
return (Math.floor((Math.random() * _arg1)));
}
public static function localToLocal(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Point=null):Point{
var _local4:Point;
_local4 = (_arg3) ? _arg3 : new Point();
_local4 = _arg1.localToGlobal(_local4);
_local4 = _arg2.globalToLocal(_local4);
return (_local4);
}
}
}//package org.papervision3d.core.components.as3.utils
Section 87
//DefaultLineCuller (org.papervision3d.core.culling.DefaultLineCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
public class DefaultLineCuller implements ILineCuller {
public function testLine(_arg1:Line3D):Boolean{
return (((_arg1.v0.vertex3DInstance.visible) && (_arg1.v1.vertex3DInstance.visible)));
}
}
}//package org.papervision3d.core.culling
Section 88
//DefaultParticleCuller (org.papervision3d.core.culling.DefaultParticleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
public class DefaultParticleCuller implements IParticleCuller {
public function testParticle(_arg1:Particle):Boolean{
if (_arg1.material.invisible == false){
if (_arg1.vertex3D.vertex3DInstance.visible == true){
return (true);
};
};
return (false);
}
}
}//package org.papervision3d.core.culling
Section 89
//DefaultTriangleCuller (org.papervision3d.core.culling.DefaultTriangleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.geom.renderables.*;
public class DefaultTriangleCuller implements ITriangleCuller {
protected static var y2:Number;
protected static var y1:Number;
protected static var y0:Number;
protected static var x0:Number;
protected static var x1:Number;
protected static var x2:Number;
public function testFace(_arg1:Triangle3D, _arg2:Vertex3DInstance, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance):Boolean{
var _local5:MaterialObject3D;
if (((((_arg2.visible) && (_arg3.visible))) && (_arg4.visible))){
_local5 = (_arg1.material) ? _arg1.material : _arg1.instance.material;
if (_local5.invisible){
return (false);
};
x0 = _arg2.x;
y0 = _arg2.y;
x1 = _arg3.x;
y1 = _arg3.y;
x2 = _arg4.x;
y2 = _arg4.y;
if (_local5.oneSide){
if (_local5.opposite){
if ((((x2 - x0) * (y1 - y0)) - ((y2 - y0) * (x1 - x0))) > 0){
return (false);
};
} else {
if ((((x2 - x0) * (y1 - y0)) - ((y2 - y0) * (x1 - x0))) < 0){
return (false);
};
};
};
return (true);
};
return (false);
}
}
}//package org.papervision3d.core.culling
Section 90
//FrustumTestMethod (org.papervision3d.core.culling.FrustumTestMethod)
package org.papervision3d.core.culling {
public class FrustumTestMethod {
public static const BOUNDING_SPHERE:int = 0;
public static const BOUNDING_BOX:int = 1;
}
}//package org.papervision3d.core.culling
Section 91
//ILineCuller (org.papervision3d.core.culling.ILineCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
public interface ILineCuller {
function testLine(_arg1:Line3D):Boolean;
}
}//package org.papervision3d.core.culling
Section 92
//IObjectCuller (org.papervision3d.core.culling.IObjectCuller)
package org.papervision3d.core.culling {
import org.papervision3d.objects.*;
public interface IObjectCuller {
function testObject(_arg1:DisplayObject3D):int;
}
}//package org.papervision3d.core.culling
Section 93
//IParticleCuller (org.papervision3d.core.culling.IParticleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
public interface IParticleCuller {
function testParticle(_arg1:Particle):Boolean;
}
}//package org.papervision3d.core.culling
Section 94
//ITriangleCuller (org.papervision3d.core.culling.ITriangleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
public interface ITriangleCuller {
function testFace(_arg1:Triangle3D, _arg2:Vertex3DInstance, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance):Boolean;
}
}//package org.papervision3d.core.culling
Section 95
//RectangleLineCuller (org.papervision3d.core.culling.RectangleLineCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
import flash.geom.*;
import org.papervision3d.core.math.util.*;
public class RectangleLineCuller implements ILineCuller {
private var rectIntersection:Rectangle;
private var lineBoundsRect:Rectangle;
private var cullingRectangle:Rectangle;
public function RectangleLineCuller(_arg1:Rectangle=null):void{
if (_arg1){
this.cullingRectangle = _arg1;
};
lineBoundsRect = new Rectangle();
rectIntersection = new Rectangle();
}
public function testLine(_arg1:Line3D):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
if (((!(_arg1.v0.vertex3DInstance.visible)) || (!(_arg1.v1.vertex3DInstance.visible)))){
return (false);
};
_local2 = _arg1.v0.vertex3DInstance.x;
_local3 = _arg1.v0.vertex3DInstance.y;
_local4 = _arg1.v1.vertex3DInstance.x;
_local5 = _arg1.v1.vertex3DInstance.y;
lineBoundsRect.width = Math.abs((_local4 - _local2));
lineBoundsRect.height = Math.abs((_local5 - _local3));
if (_local2 < _local4){
lineBoundsRect.x = _local2;
} else {
lineBoundsRect.x = _local4;
};
if (_local3 < _local5){
lineBoundsRect.y = _local3;
} else {
lineBoundsRect.y = _local5;
};
if (cullingRectangle.containsRect(lineBoundsRect)){
return (true);
};
if (!FastRectangleTools.intersects(lineBoundsRect, cullingRectangle)){
return (false);
};
rectIntersection = FastRectangleTools.intersection(lineBoundsRect, cullingRectangle);
_local6 = ((_local5 - _local3) / (_local4 - _local2));
_local7 = (_local3 - (_local6 * _local2));
_local8 = ((cullingRectangle.top - _local7) / _local6);
if ((((_local8 > rectIntersection.left)) && ((_local8 < rectIntersection.right)))){
return (true);
};
_local8 = ((cullingRectangle.bottom - _local7) / _local6);
if ((((_local8 > rectIntersection.left)) && ((_local8 < rectIntersection.right)))){
return (true);
};
_local9 = ((_local6 * cullingRectangle.left) + _local7);
if ((((_local9 > rectIntersection.top)) && ((_local9 < rectIntersection.bottom)))){
return (true);
};
_local9 = ((_local6 * cullingRectangle.right) + _local7);
if ((((_local9 > rectIntersection.top)) && ((_local9 < rectIntersection.bottom)))){
return (true);
};
return (false);
}
}
}//package org.papervision3d.core.culling
Section 96
//RectangleParticleCuller (org.papervision3d.core.culling.RectangleParticleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
import flash.geom.*;
import org.papervision3d.core.math.util.*;
public class RectangleParticleCuller implements IParticleCuller {
public var cullingRectangle:Rectangle;
private static var vInstance:Vertex3DInstance;
private static var testPoint:Point;
public function RectangleParticleCuller(_arg1:Rectangle=null){
this.cullingRectangle = _arg1;
testPoint = new Point();
}
public function testParticle(_arg1:Particle):Boolean{
vInstance = _arg1.vertex3D.vertex3DInstance;
if (_arg1.material.invisible == false){
if (vInstance.visible){
if (FastRectangleTools.intersects(_arg1.renderRect, cullingRectangle)){
return (true);
};
};
};
return (false);
}
}
}//package org.papervision3d.core.culling
Section 97
//RectangleTriangleCuller (org.papervision3d.core.culling.RectangleTriangleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
import flash.geom.*;
import org.papervision3d.core.math.util.*;
public class RectangleTriangleCuller extends DefaultTriangleCuller implements ITriangleCuller {
public var cullingRectangle:Rectangle;
private static const DEFAULT_RECT_X:Number = -((DEFAULT_RECT_W / 2));
private static const DEFAULT_RECT_W:Number = 640;
private static const DEFAULT_RECT_H:Number = 480;
private static const DEFAULT_RECT_Y:Number = -((DEFAULT_RECT_H / 2));
private static var hitRect:Rectangle = new Rectangle();
public function RectangleTriangleCuller(_arg1:Rectangle=null):void{
cullingRectangle = new Rectangle(DEFAULT_RECT_X, DEFAULT_RECT_Y, DEFAULT_RECT_W, DEFAULT_RECT_H);
super();
if (_arg1){
this.cullingRectangle = _arg1;
};
}
override public function testFace(_arg1:Triangle3D, _arg2:Vertex3DInstance, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance):Boolean{
if (super.testFace(_arg1, _arg2, _arg3, _arg4)){
hitRect.x = Math.min(_arg4.x, Math.min(_arg3.x, _arg2.x));
hitRect.width = (Math.max(_arg4.x, Math.max(_arg3.x, _arg2.x)) + Math.abs(hitRect.x));
hitRect.y = Math.min(_arg4.y, Math.min(_arg3.y, _arg2.y));
hitRect.height = (Math.max(_arg4.y, Math.max(_arg3.y, _arg2.y)) + Math.abs(hitRect.y));
return (FastRectangleTools.intersects(cullingRectangle, hitRect));
};
return (false);
}
}
}//package org.papervision3d.core.culling
Section 98
//ViewportObjectFilter (org.papervision3d.core.culling.ViewportObjectFilter)
package org.papervision3d.core.culling {
import org.papervision3d.objects.*;
import flash.utils.*;
public class ViewportObjectFilter implements IObjectCuller {
protected var _mode:int;
protected var objects:Dictionary;
public function ViewportObjectFilter(_arg1:int):void{
this.mode = _arg1;
init();
}
public function addObject(_arg1:DisplayObject3D):void{
objects[_arg1] = _arg1;
}
public function removeObject(_arg1:DisplayObject3D):void{
delete objects[_arg1];
}
public function set mode(_arg1:int):void{
_mode = _arg1;
}
public function get mode():int{
return (_mode);
}
private function init():void{
objects = new Dictionary(true);
}
public function testObject(_arg1:DisplayObject3D):int{
if (objects[_arg1]){
if (_mode == ViewportObjectFilterMode.INCLUSIVE){
return (1);
};
if (_mode == ViewportObjectFilterMode.EXCLUSIVE){
return (0);
};
} else {
if (_mode == ViewportObjectFilterMode.INCLUSIVE){
return (0);
};
if (_mode == ViewportObjectFilterMode.EXCLUSIVE){
return (1);
};
};
return (0);
}
public function destroy():void{
objects = null;
}
}
}//package org.papervision3d.core.culling
Section 99
//ViewportObjectFilterMode (org.papervision3d.core.culling.ViewportObjectFilterMode)
package org.papervision3d.core.culling {
public class ViewportObjectFilterMode {
public static const INCLUSIVE:int = 0;
public static const EXCLUSIVE:int = 1;
}
}//package org.papervision3d.core.culling
Section 100
//UserData (org.papervision3d.core.data.UserData)
package org.papervision3d.core.data {
public class UserData {
public var data;
public function UserData(_arg1=null){
this.data = _arg1;
}
}
}//package org.papervision3d.core.data
Section 101
//AbstractRenderable (org.papervision3d.core.geom.renderables.AbstractRenderable)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.render.command.*;
import org.papervision3d.core.data.*;
public class AbstractRenderable implements IRenderable {
public var _userData:UserData;
public function get userData():UserData{
return (_userData);
}
public function set userData(_arg1:UserData):void{
_userData = _arg1;
}
public function getRenderListItem():IRenderListItem{
return (null);
}
}
}//package org.papervision3d.core.geom.renderables
Section 102
//IRenderable (org.papervision3d.core.geom.renderables.IRenderable)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.render.command.*;
public interface IRenderable {
function getRenderListItem():IRenderListItem;
}
}//package org.papervision3d.core.geom.renderables
Section 103
//Line3D (org.papervision3d.core.geom.renderables.Line3D)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.render.command.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.materials.special.*;
public class Line3D extends AbstractRenderable implements IRenderable {
public var size:Number;
public var v1:Vertex3D;
public var cV:Vertex3D;
public var instance:Lines3D;
public var renderCommand:RenderLine;
public var material:LineMaterial;
public var v0:Vertex3D;
public function Line3D(_arg1:Lines3D, _arg2:LineMaterial, _arg3:Number, _arg4:Vertex3D, _arg5:Vertex3D, _arg6:Vertex3D=null){
this.size = _arg3;
this.material = _arg2;
this.v0 = _arg4;
this.v1 = _arg5;
this.cV = _arg5;
this.instance = _arg1;
this.renderCommand = new RenderLine(this);
}
public function addControlVertex(_arg1:Number, _arg2:Number, _arg3:Number):void{
cV = new Vertex3D(_arg1, _arg2, _arg3);
if (instance.geometry.vertices.indexOf(cV) == -1){
instance.geometry.vertices.push(cV);
};
}
override public function getRenderListItem():IRenderListItem{
return (this.renderCommand);
}
}
}//package org.papervision3d.core.geom.renderables
Section 104
//Particle (org.papervision3d.core.geom.renderables.Particle)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.render.command.*;
import flash.geom.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.materials.special.*;
public class Particle extends AbstractRenderable implements IRenderable {
public var size:Number;
public var renderScale:Number;
public var renderCommand:RenderParticle;
public var renderRect:Rectangle;
public var instance:Particles;
public var material:ParticleMaterial;
public var vertex3D:Vertex3D;
public function Particle(_arg1:ParticleMaterial, _arg2:Number=1, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0){
this.material = _arg1;
this.size = _arg2;
this.renderCommand = new RenderParticle(this);
this.renderRect = new Rectangle();
vertex3D = new Vertex3D(_arg3, _arg4, _arg5);
}
public function get y():Number{
return (vertex3D.y);
}
public function updateRenderRect():void{
material.updateRenderRect(this);
}
override public function getRenderListItem():IRenderListItem{
return (renderCommand);
}
public function set z(_arg1:Number):void{
vertex3D.z = _arg1;
}
public function set x(_arg1:Number):void{
vertex3D.x = _arg1;
}
public function set y(_arg1:Number):void{
vertex3D.y = _arg1;
}
public function get x():Number{
return (vertex3D.x);
}
public function get z():Number{
return (vertex3D.z);
}
}
}//package org.papervision3d.core.geom.renderables
Section 105
//Triangle3D (org.papervision3d.core.geom.renderables.Triangle3D)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.command.*;
import org.papervision3d.core.math.*;
import org.papervision3d.objects.*;
public class Triangle3D extends AbstractRenderable implements IRenderable {
public var vertices:Array;
public var v1:Vertex3D;
public var face3DInstance:Triangle3DInstance;
public var _uvArray:Array;
public var id:Number;
public var material:MaterialObject3D;
public var faceNormal:Number3D;
public var instance:DisplayObject3D;
public var screenZ:Number;
public var uv0:NumberUV;
public var uv1:NumberUV;
public var _materialName:String;
public var visible:Boolean;
public var renderCommand:RenderTriangle;
public var uv2:NumberUV;
public var v0:Vertex3D;
public var v2:Vertex3D;
private static var _totalFaces:Number = 0;
public function Triangle3D(_arg1:DisplayObject3D, _arg2:Array, _arg3:MaterialObject3D=null, _arg4:Array=null){
this.instance = _arg1;
this.renderCommand = new RenderTriangle(this);
face3DInstance = new Triangle3DInstance(this, _arg1);
faceNormal = new Number3D();
if (((_arg2) && ((_arg2.length == 3)))){
this.vertices = _arg2;
v0 = _arg2[0];
v1 = _arg2[1];
v2 = _arg2[2];
createNormal();
} else {
_arg2 = new Array();
v0 = (_arg2[0] = new Vertex3D());
v1 = (_arg2[1] = new Vertex3D());
v2 = (_arg2[2] = new Vertex3D());
};
this.material = _arg3;
this.uv = _arg4;
this.id = _totalFaces++;
}
override public function getRenderListItem():IRenderListItem{
return (renderCommand);
}
public function set uv(_arg1:Array):void{
if (((_arg1) && ((_arg1.length == 3)))){
uv0 = NumberUV(_arg1[0]);
uv1 = NumberUV(_arg1[1]);
uv2 = NumberUV(_arg1[2]);
};
_uvArray = _arg1;
}
public function createNormal():void{
var _local1:Number3D;
var _local2:Number3D;
var _local3:Number3D;
_local1 = v0.getPosition();
_local2 = v1.getPosition();
_local3 = v2.getPosition();
_local2.minusEq(_local1);
_local3.minusEq(_local1);
faceNormal = Number3D.cross(_local2, _local3, faceNormal);
faceNormal.normalize();
}
public function get uv():Array{
return (_uvArray);
}
public function updateVertices():void{
v0 = vertices[0];
v1 = vertices[1];
v2 = vertices[2];
}
}
}//package org.papervision3d.core.geom.renderables
Section 106
//Triangle3DInstance (org.papervision3d.core.geom.renderables.Triangle3DInstance)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.math.*;
import org.papervision3d.objects.*;
import flash.display.*;
public class Triangle3DInstance {
public var container:Sprite;
public var faceNormal:Number3D;
public var screenZ:Number;
public var visible:Boolean;// = false
public var instance:DisplayObject3D;
public function Triangle3DInstance(_arg1:Triangle3D, _arg2:DisplayObject3D){
visible = false;
super();
this.instance = _arg2;
faceNormal = new Number3D();
}
}
}//package org.papervision3d.core.geom.renderables
Section 107
//Vertex3D (org.papervision3d.core.geom.renderables.Vertex3D)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.render.command.*;
import org.papervision3d.core.math.*;
import flash.utils.*;
public class Vertex3D extends AbstractRenderable implements IRenderable {
public var vertex3DInstance:Vertex3DInstance;
public var extra:Object;
public var normal:Number3D;
protected var position:Number3D;
public var connectedFaces:Dictionary;
public var x:Number;
public var y:Number;
public var z:Number;
public function Vertex3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
position = new Number3D();
super();
this.x = (position.x = _arg1);
this.y = (position.y = _arg2);
this.z = (position.z = _arg3);
this.vertex3DInstance = new Vertex3DInstance();
this.normal = new Number3D();
this.connectedFaces = new Dictionary();
}
override public function getRenderListItem():IRenderListItem{
return (null);
}
public function toNumber3D():Number3D{
return (new Number3D(x, y, z));
}
public function clone():Vertex3D{
var _local1:Vertex3D;
_local1 = new Vertex3D(x, y, z);
_local1.extra = extra;
_local1.vertex3DInstance = vertex3DInstance.clone();
_local1.normal = normal.clone();
return (_local1);
}
public function getPosition():Number3D{
position.x = x;
position.y = y;
position.z = z;
return (position);
}
public function calculateNormal():void{
var _local1:Triangle3D;
var _local2:Number;
_local2 = 0;
normal.reset();
for each (_local1 in connectedFaces) {
if (_local1.faceNormal){
_local2++;
normal.plusEq(_local1.faceNormal);
};
};
normal.x = (normal.x / _local2);
normal.y = (normal.y / _local2);
normal.z = (normal.z / _local2);
normal.normalize();
}
}
}//package org.papervision3d.core.geom.renderables
Section 108
//Vertex3DInstance (org.papervision3d.core.geom.renderables.Vertex3DInstance)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.math.*;
public class Vertex3DInstance {
public var visible:Boolean;
public var normal:Number3D;
public var extra:Object;
public var x:Number;
public var y:Number;
public var z:Number;
public function Vertex3DInstance(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.visible = false;
this.normal = new Number3D();
}
public function clone():Vertex3DInstance{
var _local1:Vertex3DInstance;
_local1 = new Vertex3DInstance(x, y, z);
_local1.visible = visible;
_local1.extra = extra;
return (_local1);
}
public static function cross(_arg1:Vertex3DInstance, _arg2:Vertex3DInstance):Number{
return (((_arg1.x * _arg2.y) - (_arg2.x * _arg1.y)));
}
public static function dot(_arg1:Vertex3DInstance, _arg2:Vertex3DInstance):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function subTo(_arg1:Vertex3DInstance, _arg2:Vertex3DInstance, _arg3:Vertex3DInstance):void{
_arg3.x = (_arg2.x - _arg1.x);
_arg3.y = (_arg2.y - _arg1.y);
}
public static function sub(_arg1:Vertex3DInstance, _arg2:Vertex3DInstance):Vertex3DInstance{
return (new Vertex3DInstance((_arg2.x - _arg1.x), (_arg2.y - _arg1.y)));
}
}
}//package org.papervision3d.core.geom.renderables
Section 109
//Lines3D (org.papervision3d.core.geom.Lines3D)
package org.papervision3d.core.geom {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.objects.*;
import org.papervision3d.materials.special.*;
import org.papervision3d.*;
import org.papervision3d.core.render.draw.*;
public class Lines3D extends Vertices3D {
public var lines:Array;
private var _material:ILineDrawer;
public function Lines3D(_arg1:LineMaterial, _arg2:String=null){
super(null, _arg2);
this.material = _arg1;
init();
}
override public function project(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{
var _local3:Line3D;
var _local4:Number;
super.project(_arg1, _arg2);
for each (_local3 in lines) {
if (_arg2.viewPort.lineCuller.testLine(_local3)){
_local3.renderCommand.renderer = _local3.material;
_local4 = (_local4 + (_local3.renderCommand.screenDepth = ((_local3.v0.vertex3DInstance.z + _local3.v1.vertex3DInstance.z) / 2)));
_arg2.renderer.addToRenderList(_local3.renderCommand);
};
};
return ((_local4 / (lines.length + 1)));
}
private function init():void{
this.lines = new Array();
}
public function addLine(_arg1:Line3D):void{
lines.push(_arg1);
_arg1.instance = this;
if (geometry.vertices.indexOf(_arg1.v0) == -1){
geometry.vertices.push(_arg1.v0);
};
if (geometry.vertices.indexOf(_arg1.v1) == -1){
geometry.vertices.push(_arg1.v1);
};
if (_arg1.cV){
if (geometry.vertices.indexOf(_arg1.cV) == -1){
geometry.vertices.push(_arg1.cV);
};
};
}
public function addNewSegmentedLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):void{
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Line3D;
var _local13:Vertex3D;
var _local14:Vertex3D;
var _local15:Number;
_local9 = ((_arg6 - _arg3) / _arg2);
_local10 = ((_arg7 - _arg4) / _arg2);
_local11 = ((_arg8 - _arg5) / _arg2);
_local13 = new Vertex3D(_arg3, _arg4, _arg5);
_local15 = 0;
while (_local15 <= _arg2) {
_local14 = new Vertex3D((_arg3 + (_local9 * _local15)), (_arg4 + (_local10 * _local15)), (_arg5 + (_local11 * _local15)));
_local12 = new Line3D(this, (material as LineMaterial), _arg1, _local13, _local14);
addLine(_local12);
_local13 = _local14;
_local15++;
};
}
public function removeAllLines():void{
}
public function removeLine(_arg1:Line3D):void{
var _local2:int;
_local2 = lines.indexOf(_arg1);
if (_local2 > -1){
lines.splice(_local2, 1);
} else {
if (Papervision3D.VERBOSE){
};
};
}
public function addNewLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Line3D{
var _local8:Line3D;
_local8 = new Line3D(this, (material as LineMaterial), _arg1, new Vertex3D(_arg2, _arg3, _arg4), new Vertex3D(_arg5, _arg6, _arg7));
addLine(_local8);
return (_local8);
}
}
}//package org.papervision3d.core.geom
Section 110
//Particles (org.papervision3d.core.geom.Particles)
package org.papervision3d.core.geom {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.objects.*;
public class Particles extends Vertices3D {
public var particles:Array;
private var vertices:Array;
public function Particles(_arg1:String="VertexParticles"){
this.vertices = new Array();
this.particles = new Array();
super(vertices, _arg1);
}
override public function project(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{
var _local3:Particle;
var _local4:Number;
super.project(_arg1, _arg2);
_local4 = (_arg2.camera.focus * _arg2.camera.zoom);
for each (_local3 in particles) {
_local3.renderScale = (_local4 / (_arg2.camera.focus + _local3.vertex3D.vertex3DInstance.z));
_local3.updateRenderRect();
if (_arg2.viewPort.particleCuller.testParticle(_local3)){
_local3.renderCommand.screenDepth = _local3.vertex3D.vertex3DInstance.z;
_arg2.renderer.addToRenderList(_local3.renderCommand);
} else {
_arg2.renderStatistics.culledParticles++;
};
};
return (1);
}
public function removeParticle(_arg1:Particle):void{
_arg1.instance = null;
particles.splice(particles.indexOf(_arg1, 0), 1);
vertices.splice(vertices.indexOf(_arg1.vertex3D, 0), 1);
}
public function addParticle(_arg1:Particle):void{
_arg1.instance = this;
particles.push(_arg1);
vertices.push(_arg1.vertex3D);
}
public function removeAllParticles():void{
particles = new Array();
vertices = new Array();
geometry.vertices = vertices;
}
}
}//package org.papervision3d.core.geom
Section 111
//TriangleMesh3D (org.papervision3d.core.geom.TriangleMesh3D)
package org.papervision3d.core.geom {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.command.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.culling.*;
import flash.utils.*;
import org.papervision3d.core.render.draw.*;
public class TriangleMesh3D extends Vertices3D {
public function TriangleMesh3D(_arg1:MaterialObject3D, _arg2:Array, _arg3:Array, _arg4:String=null, _arg5:Object=null){
super(_arg2, _arg4, _arg5);
this.geometry.faces = ((_arg3) || (new Array()));
this.material = ((_arg1) || (MaterialObject3D.DEFAULT));
}
override public function project(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{
var _local3:Array;
var _local4:Number;
var _local5:Number;
var _local6:ITriangleCuller;
var _local7:Vertex3DInstance;
var _local8:Vertex3DInstance;
var _local9:Vertex3DInstance;
var _local10:Triangle3DInstance;
var _local11:Triangle3D;
var _local12:MaterialObject3D;
var _local13:RenderTriangle;
super.project(_arg1, _arg2);
if (!this.culled){
_local3 = this.geometry.faces;
_local4 = 0;
_local5 = 0;
_local6 = _arg2.triangleCuller;
for each (_local11 in _local3) {
_local12 = (_local11.material) ? _local11.material : material;
_local10 = _local11.face3DInstance;
_local7 = _local11.v0.vertex3DInstance;
_local8 = _local11.v1.vertex3DInstance;
_local9 = _local11.v2.vertex3DInstance;
if ((_local10.visible = _local6.testFace(_local11, _local7, _local8, _local9))){
_local4 = (_local4 + (_local10.screenZ = (((_local7.z + _local8.z) + _local9.z) / 3)));
_local13 = _local11.renderCommand;
_local5++;
_local13.renderer = (_local12 as ITriangleDrawer);
_local13.screenDepth = _local10.screenZ;
_arg2.renderer.addToRenderList(_local13);
} else {
_arg2.renderStatistics.culledTriangles++;
};
};
return ((this.screenZ = (_local4 / _local5)));
//unresolved jump
};
return (0);
}
override public function set material(_arg1:MaterialObject3D):void{
var _local2:Triangle3D;
super.material = _arg1;
for each (_local2 in geometry.faces) {
_local2.material = _arg1;
};
}
public function mergeVertices():void{
var _local1:Dictionary;
var _local2:Array;
var _local3:Vertex3D;
var _local4:Triangle3D;
var _local5:Vertex3D;
_local1 = new Dictionary();
_local2 = new Array();
for each (_local3 in this.geometry.vertices) {
for each (_local5 in _local1) {
if ((((((_local3.x == _local5.x)) && ((_local3.y == _local5.y)))) && ((_local3.z == _local5.z)))){
_local1[_local3] = _local5;
break;
};
};
if (!_local1[_local3]){
_local1[_local3] = _local3;
_local2.push(_local3);
};
};
this.geometry.vertices = _local2;
for each (_local4 in geometry.faces) {
_local4.v0 = _local1[_local4.v0];
_local4.v1 = _local1[_local4.v1];
_local4.v2 = _local1[_local4.v2];
};
}
public function quarterFaces():void{
var _local1:Array;
var _local2:Array;
var _local3:Array;
var _local4:Triangle3D;
var _local5:int;
var _local6:Vertex3D;
var _local7:Vertex3D;
var _local8:Vertex3D;
var _local9:Vertex3D;
var _local10:Vertex3D;
var _local11:Vertex3D;
var _local12:NumberUV;
var _local13:NumberUV;
var _local14:NumberUV;
var _local15:NumberUV;
var _local16:NumberUV;
var _local17:NumberUV;
var _local18:Triangle3D;
var _local19:Triangle3D;
var _local20:Triangle3D;
var _local21:Triangle3D;
_local1 = new Array();
_local2 = new Array();
_local3 = this.geometry.faces;
_local5 = _local3.length;
while ((_local4 = _local3[--_local5])) {
_local6 = _local4.v0;
_local7 = _local4.v1;
_local8 = _local4.v2;
_local9 = new Vertex3D(((_local6.x + _local7.x) / 2), ((_local6.y + _local7.y) / 2), ((_local6.z + _local7.z) / 2));
_local10 = new Vertex3D(((_local7.x + _local8.x) / 2), ((_local7.y + _local8.y) / 2), ((_local7.z + _local8.z) / 2));
_local11 = new Vertex3D(((_local8.x + _local6.x) / 2), ((_local8.y + _local6.y) / 2), ((_local8.z + _local6.z) / 2));
this.geometry.vertices.push(_local9, _local10, _local11);
_local12 = _local4.uv[0];
_local13 = _local4.uv[1];
_local14 = _local4.uv[2];
_local15 = new NumberUV(((_local12.u + _local13.u) / 2), ((_local12.v + _local13.v) / 2));
_local16 = new NumberUV(((_local13.u + _local14.u) / 2), ((_local13.v + _local14.v) / 2));
_local17 = new NumberUV(((_local14.u + _local12.u) / 2), ((_local14.v + _local12.v) / 2));
_local18 = new Triangle3D(this, [_local6, _local9, _local11], _local4.material, [_local12, _local15, _local17]);
_local19 = new Triangle3D(this, [_local9, _local7, _local10], _local4.material, [_local15, _local13, _local16]);
_local20 = new Triangle3D(this, [_local11, _local10, _local8], _local4.material, [_local17, _local16, _local14]);
_local21 = new Triangle3D(this, [_local9, _local10, _local11], _local4.material, [_local15, _local16, _local17]);
_local2.push(_local18, _local19, _local20, _local21);
};
this.geometry.faces = _local2;
this.mergeVertices();
this.geometry.ready = true;
}
override public function clone():DisplayObject3D{
var _local1:DisplayObject3D;
var _local2:TriangleMesh3D;
_local1 = super.clone();
_local2 = new TriangleMesh3D(this.material, [], [], _local1.name);
if (this.materials){
_local2.materials = this.materials.clone();
};
if (_local1.geometry){
_local2.geometry = _local1.geometry.clone(_local2);
};
_local2.copyTransform(this.transform);
return (_local2);
}
public function projectTexture(_arg1:String="x", _arg2:String="y"):void{
var _local3:Array;
var _local4:Object;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:MaterialObject3D;
var _local10:String;
var _local11:Triangle3D;
var _local12:Array;
var _local13:Vertex3D;
var _local14:Vertex3D;
var _local15:Vertex3D;
var _local16:NumberUV;
var _local17:NumberUV;
var _local18:NumberUV;
_local3 = this.geometry.faces;
_local4 = this.boundingBox();
_local5 = _local4.min[_arg1];
_local6 = _local4.size[_arg1];
_local7 = _local4.min[_arg2];
_local8 = _local4.size[_arg2];
_local9 = this.material;
for (_local10 in _local3) {
_local11 = _local3[Number(_local10)];
_local12 = _local11.vertices;
_local13 = _local12[0];
_local14 = _local12[1];
_local15 = _local12[2];
_local16 = new NumberUV(((_local13[_arg1] - _local5) / _local6), ((_local13[_arg2] - _local7) / _local8));
_local17 = new NumberUV(((_local14[_arg1] - _local5) / _local6), ((_local14[_arg2] - _local7) / _local8));
_local18 = new NumberUV(((_local15[_arg1] - _local5) / _local6), ((_local15[_arg2] - _local7) / _local8));
_local11.uv = [_local16, _local17, _local18];
};
}
}
}//package org.papervision3d.core.geom
Section 112
//Vertices3D (org.papervision3d.core.geom.Vertices3D)
package org.papervision3d.core.geom {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.objects.*;
import flash.geom.*;
import org.papervision3d.core.culling.*;
public class Vertices3D extends DisplayObject3D {
public function Vertices3D(_arg1:Array, _arg2:String=null, _arg3:Object=null){
super(_arg2, new GeometryObject3D(), _arg3);
this.geometry.vertices = ((_arg1) || (new Array()));
}
public function projectFrustum(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{
var _local3:Matrix3D;
var _local4:Rectangle;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Vertex3D;
var _local27:Vertex3DInstance;
var _local28:Array;
var _local29:int;
_local3 = this.view;
_local4 = _arg2.camera.viewport;
_local5 = _local3.n11;
_local6 = _local3.n12;
_local7 = _local3.n13;
_local8 = _local3.n21;
_local9 = _local3.n22;
_local10 = _local3.n23;
_local11 = _local3.n31;
_local12 = _local3.n32;
_local13 = _local3.n33;
_local14 = _local3.n41;
_local15 = _local3.n42;
_local16 = _local3.n43;
_local24 = (_local4.width / 2);
_local25 = (_local4.height / 2);
_local28 = this.geometry.vertices;
_local29 = _local28.length;
while ((_local26 = _local28[--_local29])) {
_local17 = _local26.x;
_local18 = _local26.y;
_local19 = _local26.z;
_local22 = ((((_local17 * _local11) + (_local18 * _local12)) + (_local19 * _local13)) + _local3.n34);
_local23 = ((((_local17 * _local14) + (_local18 * _local15)) + (_local19 * _local16)) + _local3.n44);
_local27 = _local26.vertex3DInstance;
_local22 = (_local22 / _local23);
if ((_local27.visible = (((_local22 > 0)) && ((_local22 < 1))))){
_local20 = (((((_local17 * _local5) + (_local18 * _local6)) + (_local19 * _local7)) + _local3.n14) / _local23);
_local21 = (((((_local17 * _local8) + (_local18 * _local9)) + (_local19 * _local10)) + _local3.n24) / _local23);
_local27.x = (_local20 * _local24);
_local27.y = (_local21 * _local25);
_local27.z = (_local22 * _local23);
};
};
return (0);
}
override public function project(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{
var _local3:Matrix3D;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Vertex3D;
var _local20:Vertex3DInstance;
var _local21:Number;
var _local22:Array;
var _local23:int;
var _local24:Number;
var _local25:Number;
super.project(_arg1, _arg2);
if (this.culled){
return (0);
};
if ((_arg2.camera is IObjectCuller)){
return (projectFrustum(_arg1, _arg2));
};
_local3 = this.view;
_local4 = _local3.n11;
_local5 = _local3.n12;
_local6 = _local3.n13;
_local7 = _local3.n21;
_local8 = _local3.n22;
_local9 = _local3.n23;
_local10 = _local3.n31;
_local11 = _local3.n32;
_local12 = _local3.n33;
_local22 = this.geometry.vertices;
_local23 = _local22.length;
_local24 = _arg2.camera.focus;
_local25 = (_local24 * _arg2.camera.zoom);
while ((_local19 = _local22[--_local23])) {
_local13 = _local19.x;
_local14 = _local19.y;
_local15 = _local19.z;
_local18 = ((((_local13 * _local10) + (_local14 * _local11)) + (_local15 * _local12)) + _local3.n34);
_local20 = _local19.vertex3DInstance;
if ((_local20.visible = (_local18 > 0))){
_local16 = ((((_local13 * _local4) + (_local14 * _local5)) + (_local15 * _local6)) + _local3.n14);
_local17 = ((((_local13 * _local7) + (_local14 * _local8)) + (_local15 * _local9)) + _local3.n24);
_local21 = (_local25 / (_local24 + _local18));
_local20.x = (_local16 * _local21);
_local20.y = (_local17 * _local21);
_local20.z = _local18;
};
};
return (0);
}
override public function clone():DisplayObject3D{
var _local1:DisplayObject3D;
var _local2:Vertices3D;
_local1 = super.clone();
_local2 = new Vertices3D(null, _local1.name);
_local2.material = _local1.material;
if (_local1.materials){
_local2.materials = _local1.materials.clone();
};
if (this.geometry){
_local2.geometry = this.geometry.clone(_local2);
};
_local2.copyTransform(this.transform);
return (_local2);
}
public function transformVertices(_arg1:Matrix3D):void{
geometry.transformVertices(_arg1);
}
public function boundingBox():Object{
var _local1:Array;
var _local2:Object;
var _local3:Vertex3D;
_local1 = this.geometry.vertices;
_local2 = new Object();
_local2.min = new Number3D(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
_local2.max = new Number3D(-(Number.MAX_VALUE), -(Number.MAX_VALUE), -(Number.MAX_VALUE));
_local2.size = new Number3D();
for each (_local3 in _local1) {
_local2.min.x = Math.min(_local3.x, _local2.min.x);
_local2.min.y = Math.min(_local3.y, _local2.min.y);
_local2.min.z = Math.min(_local3.z, _local2.min.z);
_local2.max.x = Math.max(_local3.x, _local2.max.x);
_local2.max.y = Math.max(_local3.y, _local2.max.y);
_local2.max.z = Math.max(_local3.z, _local2.max.z);
};
_local2.size.x = (_local2.max.x - _local2.min.x);
_local2.size.y = (_local2.max.y - _local2.min.y);
_local2.size.z = (_local2.max.z - _local2.min.z);
return (_local2);
}
}
}//package org.papervision3d.core.geom
Section 113
//TriangleMaterial (org.papervision3d.core.material.TriangleMaterial)
package org.papervision3d.core.material {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.render.draw.*;
public class TriangleMaterial extends MaterialObject3D implements ITriangleDrawer {
override public function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void{
}
}
}//package org.papervision3d.core.material
Section 114
//FastRectangleTools (org.papervision3d.core.math.util.FastRectangleTools)
package org.papervision3d.core.math.util {
import flash.geom.*;
public class FastRectangleTools {
public static function intersection(_arg1:Rectangle, _arg2:Rectangle, _arg3:Rectangle=null):Rectangle{
if (!_arg3){
_arg3 = new Rectangle();
};
if (!intersects(_arg1, _arg2)){
_arg3.x = (_arg3.y = (_arg3.width = (_arg3.height = 0)));
return (_arg3);
};
_arg3.left = ((_arg1.left)>_arg2.left) ? _arg1.left : _arg2.left;
_arg3.right = ((_arg1.right)<_arg2.right) ? _arg1.right : _arg2.right;
_arg3.top = ((_arg1.top)>_arg2.top) ? _arg1.top : _arg2.top;
_arg3.bottom = ((_arg1.bottom)<_arg2.bottom) ? _arg1.bottom : _arg2.bottom;
return (_arg3);
}
public static function intersects(_arg1:Rectangle, _arg2:Rectangle):Boolean{
if (!(((_arg1.right < _arg2.left)) || ((_arg1.left > _arg2.right)))){
if (!(((_arg1.bottom < _arg2.top)) || ((_arg1.top > _arg2.bottom)))){
return (true);
};
};
return (false);
}
}
}//package org.papervision3d.core.math.util
Section 115
//AxisAlignedBoundingBox (org.papervision3d.core.math.AxisAlignedBoundingBox)
package org.papervision3d.core.math {
import org.papervision3d.core.geom.renderables.*;
public class AxisAlignedBoundingBox {
public var minX:Number;
public var minY:Number;
public var minZ:Number;
public var maxX:Number;
public var maxY:Number;
protected var _vertices:Array;
public var maxZ:Number;
public function AxisAlignedBoundingBox(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){
this.minX = _arg1;
this.minY = _arg2;
this.minZ = _arg3;
this.maxX = _arg4;
this.maxY = _arg5;
this.maxZ = _arg6;
createBoxVertices();
}
protected function createBoxVertices():void{
_vertices = new Array();
_vertices.push(new Vertex3D(minX, minY, minZ));
_vertices.push(new Vertex3D(minX, minY, maxZ));
_vertices.push(new Vertex3D(minX, maxY, minZ));
_vertices.push(new Vertex3D(minX, maxY, maxZ));
_vertices.push(new Vertex3D(maxX, minY, minZ));
_vertices.push(new Vertex3D(maxX, minY, maxZ));
_vertices.push(new Vertex3D(maxX, maxY, minZ));
_vertices.push(new Vertex3D(maxX, maxY, maxZ));
}
public function getBoxVertices():Array{
return (_vertices);
}
public static function createFromVertices(_arg1:Array):AxisAlignedBoundingBox{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Vertex3D;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = 0;
for each (_local8 in _arg1) {
_local2 = ((_local8.x)<_local2) ? _local8.x : _local2;
_local4 = ((_local8.y)<_local4) ? _local8.y : _local4;
_local6 = ((_local8.z)<_local6) ? _local8.z : _local6;
_local3 = ((_local8.x)>_local3) ? _local8.x : _local3;
_local5 = ((_local8.y)>_local5) ? _local8.y : _local5;
_local7 = ((_local8.z)>_local7) ? _local8.z : _local7;
};
return (new AxisAlignedBoundingBox(_local2, _local4, _local6, _local3, _local5, _local7));
}
}
}//package org.papervision3d.core.math
Section 116
//BoundingSphere (org.papervision3d.core.math.BoundingSphere)
package org.papervision3d.core.math {
import org.papervision3d.core.geom.renderables.*;
public class BoundingSphere {
public var maxDistance:Number;
public var radius:Number;
public function BoundingSphere(_arg1:Number){
this.maxDistance = _arg1;
this.radius = Math.sqrt(_arg1);
}
public static function getFromVertices(_arg1:Array):BoundingSphere{
var _local2:Number;
var _local3:Number;
var _local4:Vertex3D;
_local2 = 0;
for each (_local4 in _arg1) {
_local3 = (((_local4.x * _local4.x) + (_local4.y * _local4.y)) + (_local4.z * _local4.z));
_local2 = ((_local3)>_local2) ? _local3 : _local2;
};
return (new BoundingSphere(_local2));
}
}
}//package org.papervision3d.core.math
Section 117
//Matrix3D (org.papervision3d.core.math.Matrix3D)
package org.papervision3d.core.math {
public class Matrix3D {
public var n31:Number;
public var n32:Number;
public var n11:Number;
public var n13:Number;
public var n14:Number;
public var n33:Number;
public var n12:Number;
public var n42:Number;
public var n21:Number;
public var n22:Number;
public var n23:Number;
public var n24:Number;
public var n34:Number;
public var n41:Number;
public var n43:Number;
public var n44:Number;
private static var _cos:Function = Math.cos;
private static var _sin:Function = Math.sin;
private static var temp:Matrix3D = Matrix3D.IDENTITY;
private static var n3Di:Number3D = Number3D.ZERO;
private static var n3Dj:Number3D = Number3D.ZERO;
private static var n3Dk:Number3D = Number3D.ZERO;
private static var toDEGREES:Number = 57.2957795130823;
private static var toRADIANS:Number = 0.0174532925199433;
public function Matrix3D(_arg1:Array=null){
reset(_arg1);
}
public function calculateMultiply3x3(_arg1:Matrix3D, _arg2:Matrix3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local3 = _arg1.n11;
_local4 = _arg2.n11;
_local5 = _arg1.n21;
_local6 = _arg2.n21;
_local7 = _arg1.n31;
_local8 = _arg2.n31;
_local9 = _arg1.n12;
_local10 = _arg2.n12;
_local11 = _arg1.n22;
_local12 = _arg2.n22;
_local13 = _arg1.n32;
_local14 = _arg2.n32;
_local15 = _arg1.n13;
_local16 = _arg2.n13;
_local17 = _arg1.n23;
_local18 = _arg2.n23;
_local19 = _arg1.n33;
_local20 = _arg2.n33;
this.n11 = (((_local3 * _local4) + (_local9 * _local6)) + (_local15 * _local8));
this.n12 = (((_local3 * _local10) + (_local9 * _local12)) + (_local15 * _local14));
this.n13 = (((_local3 * _local16) + (_local9 * _local18)) + (_local15 * _local20));
this.n21 = (((_local5 * _local4) + (_local11 * _local6)) + (_local17 * _local8));
this.n22 = (((_local5 * _local10) + (_local11 * _local12)) + (_local17 * _local14));
this.n23 = (((_local5 * _local16) + (_local11 * _local18)) + (_local17 * _local20));
this.n31 = (((_local7 * _local4) + (_local13 * _local6)) + (_local19 * _local8));
this.n32 = (((_local7 * _local10) + (_local13 * _local12)) + (_local19 * _local14));
this.n33 = (((_local7 * _local16) + (_local13 * _local18)) + (_local19 * _local20));
}
public function calculateMultiply4x4(_arg1:Matrix3D, _arg2:Matrix3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
_local3 = _arg1.n11;
_local4 = _arg2.n11;
_local5 = _arg1.n21;
_local6 = _arg2.n21;
_local7 = _arg1.n31;
_local8 = _arg2.n31;
_local9 = _arg1.n41;
_local10 = _arg2.n41;
_local11 = _arg1.n12;
_local12 = _arg2.n12;
_local13 = _arg1.n22;
_local14 = _arg2.n22;
_local15 = _arg1.n32;
_local16 = _arg2.n32;
_local17 = _arg1.n42;
_local18 = _arg2.n42;
_local19 = _arg1.n13;
_local20 = _arg2.n13;
_local21 = _arg1.n23;
_local22 = _arg2.n23;
_local23 = _arg1.n33;
_local24 = _arg2.n33;
_local25 = _arg1.n43;
_local26 = _arg2.n43;
_local27 = _arg1.n14;
_local28 = _arg2.n14;
_local29 = _arg1.n24;
_local30 = _arg2.n24;
_local31 = _arg1.n34;
_local32 = _arg2.n34;
_local33 = _arg1.n44;
_local34 = _arg2.n44;
this.n11 = (((_local3 * _local4) + (_local11 * _local6)) + (_local19 * _local8));
this.n12 = (((_local3 * _local12) + (_local11 * _local14)) + (_local19 * _local16));
this.n13 = (((_local3 * _local20) + (_local11 * _local22)) + (_local19 * _local24));
this.n14 = ((((_local3 * _local28) + (_local11 * _local30)) + (_local19 * _local32)) + _local27);
this.n21 = (((_local5 * _local4) + (_local13 * _local6)) + (_local21 * _local8));
this.n22 = (((_local5 * _local12) + (_local13 * _local14)) + (_local21 * _local16));
this.n23 = (((_local5 * _local20) + (_local13 * _local22)) + (_local21 * _local24));
this.n24 = ((((_local5 * _local28) + (_local13 * _local30)) + (_local21 * _local32)) + _local29);
this.n31 = (((_local7 * _local4) + (_local15 * _local6)) + (_local23 * _local8));
this.n32 = (((_local7 * _local12) + (_local15 * _local14)) + (_local23 * _local16));
this.n33 = (((_local7 * _local20) + (_local15 * _local22)) + (_local23 * _local24));
this.n34 = ((((_local7 * _local28) + (_local15 * _local30)) + (_local23 * _local32)) + _local31);
this.n41 = (((_local9 * _local4) + (_local17 * _local6)) + (_local25 * _local8));
this.n42 = (((_local9 * _local12) + (_local17 * _local14)) + (_local25 * _local16));
this.n43 = (((_local9 * _local20) + (_local17 * _local22)) + (_local25 * _local24));
this.n44 = ((((_local9 * _local28) + (_local17 * _local30)) + (_local25 * _local32)) + _local33);
}
public function get det():Number{
return ((((((this.n11 * this.n22) - (this.n21 * this.n12)) * this.n33) - (((this.n11 * this.n32) - (this.n31 * this.n12)) * this.n23)) + (((this.n21 * this.n32) - (this.n31 * this.n22)) * this.n13)));
}
public function copy(_arg1:Matrix3D):Matrix3D{
this.n11 = _arg1.n11;
this.n12 = _arg1.n12;
this.n13 = _arg1.n13;
this.n14 = _arg1.n14;
this.n21 = _arg1.n21;
this.n22 = _arg1.n22;
this.n23 = _arg1.n23;
this.n24 = _arg1.n24;
this.n31 = _arg1.n31;
this.n32 = _arg1.n32;
this.n33 = _arg1.n33;
this.n34 = _arg1.n34;
return (this);
}
public function copy3x3(_arg1:Matrix3D):Matrix3D{
this.n11 = _arg1.n11;
this.n12 = _arg1.n12;
this.n13 = _arg1.n13;
this.n21 = _arg1.n21;
this.n22 = _arg1.n22;
this.n23 = _arg1.n23;
this.n31 = _arg1.n31;
this.n32 = _arg1.n32;
this.n33 = _arg1.n33;
return (this);
}
public function calculateAdd(_arg1:Matrix3D, _arg2:Matrix3D):void{
this.n11 = (_arg1.n11 + _arg2.n11);
this.n12 = (_arg1.n12 + _arg2.n12);
this.n13 = (_arg1.n13 + _arg2.n13);
this.n14 = (_arg1.n14 + _arg2.n14);
this.n21 = (_arg1.n21 + _arg2.n21);
this.n22 = (_arg1.n22 + _arg2.n22);
this.n23 = (_arg1.n23 + _arg2.n23);
this.n24 = (_arg1.n24 + _arg2.n24);
this.n31 = (_arg1.n31 + _arg2.n31);
this.n32 = (_arg1.n32 + _arg2.n32);
this.n33 = (_arg1.n33 + _arg2.n33);
this.n34 = (_arg1.n34 + _arg2.n34);
}
public function calculateMultiply(_arg1:Matrix3D, _arg2:Matrix3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
_local3 = _arg1.n11;
_local4 = _arg2.n11;
_local5 = _arg1.n21;
_local6 = _arg2.n21;
_local7 = _arg1.n31;
_local8 = _arg2.n31;
_local9 = _arg1.n12;
_local10 = _arg2.n12;
_local11 = _arg1.n22;
_local12 = _arg2.n22;
_local13 = _arg1.n32;
_local14 = _arg2.n32;
_local15 = _arg1.n13;
_local16 = _arg2.n13;
_local17 = _arg1.n23;
_local18 = _arg2.n23;
_local19 = _arg1.n33;
_local20 = _arg2.n33;
_local21 = _arg1.n14;
_local22 = _arg2.n14;
_local23 = _arg1.n24;
_local24 = _arg2.n24;
_local25 = _arg1.n34;
_local26 = _arg2.n34;
this.n11 = (((_local3 * _local4) + (_local9 * _local6)) + (_local15 * _local8));
this.n12 = (((_local3 * _local10) + (_local9 * _local12)) + (_local15 * _local14));
this.n13 = (((_local3 * _local16) + (_local9 * _local18)) + (_local15 * _local20));
this.n14 = ((((_local3 * _local22) + (_local9 * _local24)) + (_local15 * _local26)) + _local21);
this.n21 = (((_local5 * _local4) + (_local11 * _local6)) + (_local17 * _local8));
this.n22 = (((_local5 * _local10) + (_local11 * _local12)) + (_local17 * _local14));
this.n23 = (((_local5 * _local16) + (_local11 * _local18)) + (_local17 * _local20));
this.n24 = ((((_local5 * _local22) + (_local11 * _local24)) + (_local17 * _local26)) + _local23);
this.n31 = (((_local7 * _local4) + (_local13 * _local6)) + (_local19 * _local8));
this.n32 = (((_local7 * _local10) + (_local13 * _local12)) + (_local19 * _local14));
this.n33 = (((_local7 * _local16) + (_local13 * _local18)) + (_local19 * _local20));
this.n34 = ((((_local7 * _local22) + (_local13 * _local24)) + (_local19 * _local26)) + _local25);
}
public function invert():void{
temp.copy(this);
calculateInverse(temp);
}
public function calculateInverse(_arg1:Matrix3D):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local2 = _arg1.det;
if (Math.abs(_local2) > 0.001){
_local2 = (1 / _local2);
_local3 = _arg1.n11;
_local4 = _arg1.n21;
_local5 = _arg1.n31;
_local6 = _arg1.n12;
_local7 = _arg1.n22;
_local8 = _arg1.n32;
_local9 = _arg1.n13;
_local10 = _arg1.n23;
_local11 = _arg1.n33;
_local12 = _arg1.n14;
_local13 = _arg1.n24;
_local14 = _arg1.n34;
this.n11 = (_local2 * ((_local7 * _local11) - (_local8 * _local10)));
this.n12 = (-(_local2) * ((_local6 * _local11) - (_local8 * _local9)));
this.n13 = (_local2 * ((_local6 * _local10) - (_local7 * _local9)));
this.n14 = (-(_local2) * (((_local6 * ((_local10 * _local14) - (_local11 * _local13))) - (_local7 * ((_local9 * _local14) - (_local11 * _local12)))) + (_local8 * ((_local9 * _local13) - (_local10 * _local12)))));
this.n21 = (-(_local2) * ((_local4 * _local11) - (_local5 * _local10)));
this.n22 = (_local2 * ((_local3 * _local11) - (_local5 * _local9)));
this.n23 = (-(_local2) * ((_local3 * _local10) - (_local4 * _local9)));
this.n24 = (_local2 * (((_local3 * ((_local10 * _local14) - (_local11 * _local13))) - (_local4 * ((_local9 * _local14) - (_local11 * _local12)))) + (_local5 * ((_local9 * _local13) - (_local10 * _local12)))));
this.n31 = (_local2 * ((_local4 * _local8) - (_local5 * _local7)));
this.n32 = (-(_local2) * ((_local3 * _local8) - (_local5 * _local6)));
this.n33 = (_local2 * ((_local3 * _local7) - (_local4 * _local6)));
this.n34 = (-(_local2) * (((_local3 * ((_local7 * _local14) - (_local8 * _local13))) - (_local4 * ((_local6 * _local14) - (_local8 * _local12)))) + (_local5 * ((_local6 * _local13) - (_local7 * _local12)))));
};
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + ((((((((int((n11 * 1000)) / 1000) + "\t\t") + (int((n12 * 1000)) / 1000)) + "\t\t") + (int((n13 * 1000)) / 1000)) + "\t\t") + (int((n14 * 1000)) / 1000)) + "\n"));
_local1 = (_local1 + ((((((((int((n21 * 1000)) / 1000) + "\t\t") + (int((n22 * 1000)) / 1000)) + "\t\t") + (int((n23 * 1000)) / 1000)) + "\t\t") + (int((n24 * 1000)) / 1000)) + "\n"));
_local1 = (_local1 + ((((((((int((n31 * 1000)) / 1000) + "\t\t") + (int((n32 * 1000)) / 1000)) + "\t\t") + (int((n33 * 1000)) / 1000)) + "\t\t") + (int((n34 * 1000)) / 1000)) + "\n"));
_local1 = (_local1 + ((((((((int((n41 * 1000)) / 1000) + "\t\t") + (int((n42 * 1000)) / 1000)) + "\t\t") + (int((n43 * 1000)) / 1000)) + "\t\t") + (int((n44 * 1000)) / 1000)) + "\n"));
return (_local1);
}
public function reset(_arg1:Array=null):void{
if (((!(_arg1)) || ((_arg1.length < 12)))){
n11 = (n22 = (n33 = (n44 = 1)));
n12 = (n13 = (n14 = (n21 = (n23 = (n24 = (n31 = (n32 = (n34 = (n41 = (n42 = (n43 = 0)))))))))));
} else {
n11 = _arg1[0];
n12 = _arg1[1];
n13 = _arg1[2];
n14 = _arg1[3];
n21 = _arg1[4];
n22 = _arg1[5];
n23 = _arg1[6];
n24 = _arg1[7];
n31 = _arg1[8];
n32 = _arg1[9];
n33 = _arg1[10];
n34 = _arg1[11];
if (_arg1.length == 16){
n41 = _arg1[12];
n42 = _arg1[13];
n43 = _arg1[14];
n44 = _arg1[15];
} else {
n41 = (n42 = (n43 = 0));
n44 = 1;
};
};
}
public static function rotationMatrixWithReference(_arg1:Number3D, _arg2:Number, _arg3:Number3D):Matrix3D{
var _local4:Matrix3D;
_local4 = Matrix3D.translationMatrix(_arg3.x, -(_arg3.y), _arg3.z);
Matrix3D.translationMatrix(_arg3.x, -(_arg3.y), _arg3.z).calculateMultiply(_local4, Matrix3D.rotationMatrix(_arg1.x, _arg1.y, _arg1.z, _arg2));
_local4.calculateMultiply(_local4, Matrix3D.translationMatrix(-(_arg3.x), _arg3.y, -(_arg3.z)));
return (_local4);
}
public static function multiplyVector(_arg1:Matrix3D, _arg2:Number3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = _arg2.x;
_local4 = _arg2.y;
_local5 = _arg2.z;
_arg2.x = ((((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13)) + _arg1.n14);
_arg2.y = ((((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23)) + _arg1.n24);
_arg2.z = ((((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33)) + _arg1.n34);
}
public static function multiplyVector4x4(_arg1:Matrix3D, _arg2:Number3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = _arg2.x;
_local4 = _arg2.y;
_local5 = _arg2.z;
_local6 = (1 / ((((_local3 * _arg1.n41) + (_local4 * _arg1.n42)) + (_local5 * _arg1.n43)) + _arg1.n44));
_arg2.x = ((((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13)) + _arg1.n14);
_arg2.y = ((((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23)) + _arg1.n24);
_arg2.z = ((((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33)) + _arg1.n34);
_arg2.x = (_arg2.x * _local6);
_arg2.y = (_arg2.y * _local6);
_arg2.z = (_arg2.z * _local6);
}
public static function multiply3x3(_arg1:Matrix3D, _arg2:Matrix3D):Matrix3D{
var _local3:Matrix3D;
_local3 = new (Matrix3D);
_local3.calculateMultiply3x3(_arg1, _arg2);
return (_local3);
}
public static function normalizeQuaternion(_arg1:Object):Object{
var _local2:Number;
_local2 = magnitudeQuaternion(_arg1);
_arg1.x = (_arg1.x / _local2);
_arg1.y = (_arg1.y / _local2);
_arg1.z = (_arg1.z / _local2);
_arg1.w = (_arg1.w / _local2);
return (_arg1);
}
public static function multiplyVector3x3(_arg1:Matrix3D, _arg2:Number3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = _arg2.x;
_local4 = _arg2.y;
_local5 = _arg2.z;
_arg2.x = (((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13));
_arg2.y = (((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23));
_arg2.z = (((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33));
}
public static function axis2quaternion(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Object{
var _local5:Number;
var _local6:Number;
var _local7:Object;
_local5 = Math.sin((_arg4 / 2));
_local6 = Math.cos((_arg4 / 2));
_local7 = new Object();
_local7.x = (_arg1 * _local5);
_local7.y = (_arg2 * _local5);
_local7.z = (_arg3 * _local5);
_local7.w = _local6;
return (normalizeQuaternion(_local7));
}
public static function translationMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
var _local4:Matrix3D;
_local4 = IDENTITY;
_local4.n14 = _arg1;
_local4.n24 = _arg2;
_local4.n34 = _arg3;
return (_local4);
}
public static function magnitudeQuaternion(_arg1:Object):Number{
return (Math.sqrt(((((_arg1.w * _arg1.w) + (_arg1.x * _arg1.x)) + (_arg1.y * _arg1.y)) + (_arg1.z * _arg1.z))));
}
public static function rotationX(_arg1:Number):Matrix3D{
var _local2:Matrix3D;
var _local3:Number;
var _local4:Number;
_local2 = IDENTITY;
_local3 = Math.cos(_arg1);
_local4 = Math.sin(_arg1);
_local2.n22 = _local3;
_local2.n23 = -(_local4);
_local2.n32 = _local4;
_local2.n33 = _local3;
return (_local2);
}
public static function rotationY(_arg1:Number):Matrix3D{
var _local2:Matrix3D;
var _local3:Number;
var _local4:Number;
_local2 = IDENTITY;
_local3 = Math.cos(_arg1);
_local4 = Math.sin(_arg1);
_local2.n11 = _local3;
_local2.n13 = -(_local4);
_local2.n31 = _local4;
_local2.n33 = _local3;
return (_local2);
}
public static function rotationZ(_arg1:Number):Matrix3D{
var _local2:Matrix3D;
var _local3:Number;
var _local4:Number;
_local2 = IDENTITY;
_local3 = Math.cos(_arg1);
_local4 = Math.sin(_arg1);
_local2.n11 = _local3;
_local2.n12 = -(_local4);
_local2.n21 = _local4;
_local2.n22 = _local3;
return (_local2);
}
public static function clone(_arg1:Matrix3D):Matrix3D{
return (new Matrix3D([_arg1.n11, _arg1.n12, _arg1.n13, _arg1.n14, _arg1.n21, _arg1.n22, _arg1.n23, _arg1.n24, _arg1.n31, _arg1.n32, _arg1.n33, _arg1.n34]));
}
public static function rotationMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Matrix3D=null):Matrix3D{
var _local6:Matrix3D;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
if (!_arg5){
_local6 = IDENTITY;
} else {
_local6 = _arg5;
};
_local7 = Math.cos(_arg4);
_local8 = Math.sin(_arg4);
_local9 = (1 - _local7);
_local10 = ((_arg1 * _arg2) * _local9);
_local11 = ((_arg2 * _arg3) * _local9);
_local12 = ((_arg1 * _arg3) * _local9);
_local13 = (_local8 * _arg3);
_local14 = (_local8 * _arg2);
_local15 = (_local8 * _arg1);
_local6.n11 = (_local7 + ((_arg1 * _arg1) * _local9));
_local6.n12 = (-(_local13) + _local10);
_local6.n13 = (_local14 + _local12);
_local6.n21 = (_local13 + _local10);
_local6.n22 = (_local7 + ((_arg2 * _arg2) * _local9));
_local6.n23 = (-(_local15) + _local11);
_local6.n31 = (-(_local14) + _local12);
_local6.n32 = (_local15 + _local11);
_local6.n33 = (_local7 + ((_arg3 * _arg3) * _local9));
return (_local6);
}
public static function add(_arg1:Matrix3D, _arg2:Matrix3D):Matrix3D{
var _local3:Matrix3D;
_local3 = new (Matrix3D);
_local3.calculateAdd(_arg1, _arg2);
return (_local3);
}
public static function multiply(_arg1:Matrix3D, _arg2:Matrix3D):Matrix3D{
var _local3:Matrix3D;
_local3 = new (Matrix3D);
_local3.calculateMultiply(_arg1, _arg2);
return (_local3);
}
public static function euler2quaternion(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Quaternion=null):Quaternion{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Quaternion;
_local5 = Math.sin((_arg1 * 0.5));
_local6 = Math.cos((_arg1 * 0.5));
_local7 = Math.sin((_arg2 * 0.5));
_local8 = Math.cos((_arg2 * 0.5));
_local9 = Math.sin((_arg3 * 0.5));
_local10 = Math.cos((_arg3 * 0.5));
_local11 = (_local6 * _local8);
_local12 = (_local5 * _local7);
if (!_arg4){
_local13 = new Quaternion();
} else {
_local13 = _arg4;
};
_local13.x = ((_local9 * _local11) - (_local10 * _local12));
_local13.y = (((_local10 * _local5) * _local8) + ((_local9 * _local6) * _local7));
_local13.z = (((_local10 * _local6) * _local7) - ((_local9 * _local5) * _local8));
_local13.w = ((_local10 * _local11) + (_local9 * _local12));
return (_local13);
}
public static function quaternion2matrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Matrix3D=null):Matrix3D{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Matrix3D;
_local6 = (_arg1 * _arg1);
_local7 = (_arg1 * _arg2);
_local8 = (_arg1 * _arg3);
_local9 = (_arg1 * _arg4);
_local10 = (_arg2 * _arg2);
_local11 = (_arg2 * _arg3);
_local12 = (_arg2 * _arg4);
_local13 = (_arg3 * _arg3);
_local14 = (_arg3 * _arg4);
if (!_arg5){
_local15 = IDENTITY;
} else {
_local15 = _arg5;
};
_local15.n11 = (1 - (2 * (_local10 + _local13)));
_local15.n12 = (2 * (_local7 - _local14));
_local15.n13 = (2 * (_local8 + _local12));
_local15.n21 = (2 * (_local7 + _local14));
_local15.n22 = (1 - (2 * (_local6 + _local13)));
_local15.n23 = (2 * (_local11 - _local9));
_local15.n31 = (2 * (_local8 - _local12));
_local15.n32 = (2 * (_local11 + _local9));
_local15.n33 = (1 - (2 * (_local6 + _local10)));
return (_local15);
}
public static function inverse(_arg1:Matrix3D):Matrix3D{
var _local2:Matrix3D;
_local2 = new (Matrix3D);
_local2.calculateInverse(_arg1);
return (_local2);
}
public static function euler2matrix(_arg1:Number3D):Matrix3D{
var _local2:Matrix3D;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
temp.reset();
_local2 = temp;
_local2 = temp;
_local3 = (_arg1.x * toRADIANS);
_local4 = (_arg1.y * toRADIANS);
_local5 = (_arg1.z * toRADIANS);
_local6 = Math.cos(_local3);
_local7 = Math.sin(_local3);
_local8 = Math.cos(_local4);
_local9 = Math.sin(_local4);
_local10 = Math.cos(_local5);
_local11 = Math.sin(_local5);
_local12 = (_local6 * _local9);
_local13 = (_local7 * _local9);
_local2.n11 = (_local8 * _local10);
_local2.n12 = (-(_local8) * _local11);
_local2.n13 = _local9;
_local2.n21 = ((_local13 * _local10) + (_local6 * _local11));
_local2.n22 = ((-(_local13) * _local11) + (_local6 * _local10));
_local2.n23 = (-(_local7) * _local8);
_local2.n31 = ((-(_local12) * _local10) + (_local7 * _local11));
_local2.n32 = ((_local12 * _local11) + (_local7 * _local10));
_local2.n33 = (_local6 * _local8);
return (_local2);
}
public static function scaleMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
var _local4:Matrix3D;
_local4 = IDENTITY;
_local4.n11 = _arg1;
_local4.n22 = _arg2;
_local4.n33 = _arg3;
return (_local4);
}
public static function rotateAxis(_arg1:Matrix3D, _arg2:Number3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = _arg2.x;
_local4 = _arg2.y;
_local5 = _arg2.z;
_arg2.x = (((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13));
_arg2.y = (((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23));
_arg2.z = (((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33));
_arg2.normalize();
}
public static function matrix2euler(_arg1:Matrix3D, _arg2:Number3D=null):Number3D{
var _local3:Matrix3D;
var _local4:Matrix3D;
var _local5:Matrix3D;
var _local6:Number;
if (!_arg2){
_arg2 = Number3D.ZERO;
};
n3Di.reset(_arg1.n11, _arg1.n21, _arg1.n31);
n3Dj.reset(_arg1.n12, _arg1.n22, _arg1.n32);
n3Dk.reset(_arg1.n13, _arg1.n23, _arg1.n33);
n3Di.normalize();
n3Dj.normalize();
n3Dk.normalize();
temp.reset([n3Di.x, n3Dj.x, n3Dk.x, 0, n3Di.y, n3Dj.y, n3Dk.y, 0, n3Di.z, n3Dj.z, n3Dk.z, 0]);
_local3 = temp;
_arg2.x = Math.atan2(_local3.n23, _local3.n33);
_local4 = Matrix3D.rotationX(-(_arg2.x));
_local5 = Matrix3D.multiply(_local4, _local3);
_local6 = Math.sqrt(((_local5.n11 * _local5.n11) + (_local5.n21 * _local5.n21)));
_arg2.y = Math.atan2(-(_local5.n31), _local6);
_arg2.z = Math.atan2(-(_local5.n12), _local5.n11);
if (_arg2.x == Math.PI){
if (_arg2.y > 0){
_arg2.y = (_arg2.y - Math.PI);
} else {
_arg2.y = (_arg2.y + Math.PI);
};
_arg2.x = 0;
_arg2.z = (_arg2.z + Math.PI);
};
_arg2.x = (_arg2.x * toDEGREES);
_arg2.y = (_arg2.y * toDEGREES);
_arg2.z = (_arg2.z * toDEGREES);
return (_arg2);
}
public static function multiplyQuaternion(_arg1:Object, _arg2:Object):Object{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Object;
_local3 = _arg1.x;
_local4 = _arg1.y;
_local5 = _arg1.z;
_local6 = _arg1.w;
_local7 = _arg2.x;
_local8 = _arg2.y;
_local9 = _arg2.z;
_local10 = _arg2.w;
_local11 = new Object();
_local11.x = ((((_local6 * _local7) + (_local3 * _local10)) + (_local4 * _local9)) - (_local5 * _local8));
_local11.y = ((((_local6 * _local8) + (_local4 * _local10)) + (_local5 * _local7)) - (_local3 * _local9));
_local11.z = ((((_local6 * _local9) + (_local5 * _local10)) + (_local3 * _local8)) - (_local4 * _local7));
_local11.w = ((((_local6 * _local10) - (_local3 * _local7)) - (_local4 * _local8)) - (_local5 * _local9));
return (_local11);
}
public static function get IDENTITY():Matrix3D{
return (new Matrix3D([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]));
}
}
}//package org.papervision3d.core.math
Section 118
//Number2D (org.papervision3d.core.math.Number2D)
package org.papervision3d.core.math {
import org.papervision3d.*;
public class Number2D {
public var x:Number;
public var y:Number;
public static const DEGTORAD:Number = 0.0174532925199433;
public static const RADTODEG:Number = 57.2957795130823;
public function Number2D(_arg1:Number=0, _arg2:Number=0){
this.x = _arg1;
this.y = _arg2;
}
public function divideEq(_arg1:Number):void{
x = (x / _arg1);
y = (y / _arg1);
}
public function copyTo(_arg1:Number2D):void{
_arg1.x = this.x;
_arg1.y = this.y;
}
public function get moduloSquared():Number{
return (((this.x * this.x) + (this.y * this.y)));
}
public function angle():Number{
if (Papervision3D.useDEGREES){
return ((RADTODEG * Math.atan2(y, x)));
};
return (Math.atan2(y, x));
}
public function reset(_arg1:Number=0, _arg2:Number=0):void{
this.x = _arg1;
this.y = _arg2;
}
public function isModuloGreaterThan(_arg1:Number):Boolean{
return ((moduloSquared > (_arg1 * _arg1)));
}
public function clone():Number2D{
return (new Number2D(this.x, this.y));
}
public function reverse():void{
this.x = -(this.x);
this.y = -(this.y);
}
public function plusEq(_arg1:Number2D):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
public function rotate(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number2D;
if (Papervision3D.useDEGREES){
_arg1 = (_arg1 * DEGTORAD);
};
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
_local4 = clone();
this.x = ((_local4.x * _local2) - (_local4.y * _local3));
this.y = ((_local4.x * _local3) + (_local4.y * _local2));
}
public function toString():String{
var _local1:Number;
var _local2:Number;
_local1 = (Math.round((this.x * 1000)) / 1000);
_local2 = (Math.round((this.y * 1000)) / 1000);
return ((((("[" + _local1) + ", ") + _local2) + "]"));
}
public function isModuloEqualTo(_arg1:Number):Boolean{
return ((moduloSquared == (_arg1 * _arg1)));
}
public function multiplyEq(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
}
public function normalise():void{
var _local1:Number;
_local1 = this.modulo;
this.x = (this.x / _local1);
this.y = (this.y / _local1);
}
public function get modulo():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function isModuloLessThan(_arg1:Number):Boolean{
return ((moduloSquared < (_arg1 * _arg1)));
}
public function minusEq(_arg1:Number2D):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
public function copyFrom(_arg1:Number2D):void{
this.x = _arg1.x;
this.y = _arg1.y;
}
public static function multiplyScalar(_arg1:Number2D, _arg2:Number):Number2D{
return (new Number2D((_arg1.x * _arg2), (_arg1.y * _arg2)));
}
public static function add(_arg1:Number2D, _arg2:Number2D):Number2D{
return (new Number2D((_arg1.x = (_arg1.x + _arg2.x)), (_arg1.y + _arg2.y)));
}
public static function dot(_arg1:Number2D, _arg2:Number2D):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function subtract(_arg1:Number2D, _arg2:Number2D):Number2D{
return (new Number2D((_arg1.x - _arg2.x), (_arg1.y - _arg2.y)));
}
}
}//package org.papervision3d.core.math
Section 119
//Number3D (org.papervision3d.core.math.Number3D)
package org.papervision3d.core.math {
import org.papervision3d.*;
public class Number3D {
public var z:Number;
public var x:Number;
public var y:Number;
public static var toDEGREES:Number = 57.2957795130823;
private static var temp:Number3D = Number3D.ZERO;
public static var toRADIANS:Number = 0.0174532925199433;
public function Number3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function normalize():void{
var _local1:Number;
_local1 = this.modulo;
if (((!((_local1 == 0))) && (!((_local1 == 1))))){
this.x = (this.x / _local1);
this.y = (this.y / _local1);
this.z = (this.z / _local1);
};
}
public function copyTo(_arg1:Number3D):void{
_arg1.x = x;
_arg1.y = y;
_arg1.z = z;
}
public function get moduloSquared():Number{
return ((((this.x * this.x) + (this.y * this.y)) + (this.z * this.z)));
}
public function reset(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):void{
x = _arg1;
y = _arg2;
z = _arg3;
}
public function isModuloGreaterThan(_arg1:Number):Boolean{
return ((moduloSquared > (_arg1 * _arg1)));
}
public function rotateX(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (Papervision3D.useDEGREES){
_arg1 = (_arg1 * toRADIANS);
};
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
temp.copyFrom(this);
this.y = ((temp.y * _local2) - (temp.z * _local3));
this.z = ((temp.y * _local3) + (temp.z * _local2));
}
public function rotateY(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (Papervision3D.useDEGREES){
_arg1 = (_arg1 * toRADIANS);
};
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
temp.copyFrom(this);
this.x = ((temp.x * _local2) + (temp.z * _local3));
this.z = ((temp.x * -(_local3)) + (temp.z * _local2));
}
public function rotateZ(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (Papervision3D.useDEGREES){
_arg1 = (_arg1 * toRADIANS);
};
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
temp.copyFrom(this);
this.x = ((temp.x * _local2) - (temp.y * _local3));
this.y = ((temp.x * _local3) + (temp.y * _local2));
}
public function clone():Number3D{
return (new Number3D(this.x, this.y, this.z));
}
public function plusEq(_arg1:Number3D):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
}
public function toString():String{
return (((((("x:" + (Math.round((x * 100)) / 100)) + " y:") + (Math.round((y * 100)) / 100)) + " z:") + (Math.round((z * 100)) / 100)));
}
public function isModuloEqualTo(_arg1:Number):Boolean{
return ((moduloSquared == (_arg1 * _arg1)));
}
public function multiplyEq(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
}
public function get modulo():Number{
return (Math.sqrt((((this.x * this.x) + (this.y * this.y)) + (this.z * this.z))));
}
public function isModuloLessThan(_arg1:Number):Boolean{
return ((moduloSquared < (_arg1 * _arg1)));
}
public function minusEq(_arg1:Number3D):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
z = (z - _arg1.z);
}
public function copyFrom(_arg1:Number3D):void{
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
}
public static function sub(_arg1:Number3D, _arg2:Number3D):Number3D{
return (new Number3D((_arg1.x - _arg2.x), (_arg1.y - _arg2.y), (_arg1.z - _arg2.z)));
}
public static function add(_arg1:Number3D, _arg2:Number3D):Number3D{
return (new Number3D((_arg1.x + _arg2.x), (_arg1.y + _arg2.y), (_arg1.z + _arg2.z)));
}
public static function cross(_arg1:Number3D, _arg2:Number3D, _arg3:Number3D=null):Number3D{
if (!_arg3){
_arg3 = ZERO;
};
_arg3.reset(((_arg2.y * _arg1.z) - (_arg2.z * _arg1.y)), ((_arg2.z * _arg1.x) - (_arg2.x * _arg1.z)), ((_arg2.x * _arg1.y) - (_arg2.y * _arg1.x)));
return (_arg3);
}
public static function dot(_arg1:Number3D, _arg2:Number3D):Number{
return ((((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)) + (_arg2.z * _arg1.z)));
}
public static function get ZERO():Number3D{
return (new Number3D(0, 0, 0));
}
}
}//package org.papervision3d.core.math
Section 120
//NumberUV (org.papervision3d.core.math.NumberUV)
package org.papervision3d.core.math {
public class NumberUV {
public var u:Number;
public var v:Number;
public function NumberUV(_arg1:Number=0, _arg2:Number=0){
this.u = _arg1;
this.v = _arg2;
}
public function toString():String{
return (((("u:" + u) + " v:") + v));
}
public function clone():NumberUV{
return (new NumberUV(this.u, this.v));
}
public static function get ZERO():NumberUV{
return (new NumberUV(0, 0));
}
}
}//package org.papervision3d.core.math
Section 121
//Quaternion (org.papervision3d.core.math.Quaternion)
package org.papervision3d.core.math {
public class Quaternion {
private var _matrix:Matrix3D;
public var w:Number;
public var x:Number;
public var y:Number;
public var z:Number;
public static const EPSILON:Number = 1E-6;
public static const DEGTORAD:Number = 0.0174532925199433;
public static const RADTODEG:Number = 57.2957795130823;
public function Quaternion(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=1):void{
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.w = _arg4;
_matrix = Matrix3D.IDENTITY;
}
public function normalize():void{
var _local1:Number;
var _local2:Number;
_local1 = this.modulo;
if (Math.abs(_local1) < EPSILON){
x = (y = (z = 0));
w = 1;
} else {
_local2 = (1 / _local1);
x = (x * _local2);
y = (y * _local2);
z = (z * _local2);
w = (w * _local2);
};
}
public function get modulo():Number{
return (Math.sqrt(((((x * x) + (y * y)) + (z * z)) + (w * w))));
}
public function toMatrix():Matrix3D{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local1 = (x * x);
_local2 = (x * y);
_local3 = (x * z);
_local4 = (x * w);
_local5 = (y * y);
_local6 = (y * z);
_local7 = (y * w);
_local8 = (z * z);
_local9 = (z * w);
_matrix.n11 = (1 - (2 * (_local5 + _local8)));
_matrix.n12 = (2 * (_local2 - _local9));
_matrix.n13 = (2 * (_local3 + _local7));
_matrix.n21 = (2 * (_local2 + _local9));
_matrix.n22 = (1 - (2 * (_local1 + _local8)));
_matrix.n23 = (2 * (_local6 - _local4));
_matrix.n31 = (2 * (_local3 - _local7));
_matrix.n32 = (2 * (_local6 + _local4));
_matrix.n33 = (1 - (2 * (_local1 + _local5)));
return (_matrix);
}
public function mult(_arg1:Quaternion):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = this.w;
_local3 = this.x;
_local4 = this.y;
_local5 = this.z;
x = ((((_local2 * _arg1.x) + (_local3 * _arg1.w)) + (_local4 * _arg1.z)) - (_local5 * _arg1.y));
y = ((((_local2 * _arg1.y) - (_local3 * _arg1.z)) + (_local4 * _arg1.w)) + (_local5 * _arg1.x));
z = ((((_local2 * _arg1.z) + (_local3 * _arg1.y)) - (_local4 * _arg1.x)) + (_local5 * _arg1.w));
w = ((((_local2 * _arg1.w) - (_local3 * _arg1.x)) - (_local4 * _arg1.y)) - (_local5 * _arg1.z));
}
public static function sub(_arg1:Quaternion, _arg2:Quaternion):Quaternion{
return (new Quaternion((_arg1.x - _arg2.x), (_arg1.y - _arg2.y), (_arg1.z - _arg2.z), (_arg1.w - _arg2.w)));
}
public static function add(_arg1:Quaternion, _arg2:Quaternion):Quaternion{
return (new Quaternion((_arg1.x + _arg2.x), (_arg1.y + _arg2.y), (_arg1.z + _arg2.z), (_arg1.w + _arg2.w)));
}
public static function createFromEuler(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=false):Quaternion{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Quaternion;
if (_arg4){
_arg1 = (_arg1 * DEGTORAD);
_arg2 = (_arg2 * DEGTORAD);
_arg3 = (_arg3 * DEGTORAD);
};
_local5 = Math.sin((_arg1 * 0.5));
_local6 = Math.cos((_arg1 * 0.5));
_local7 = Math.sin((_arg2 * 0.5));
_local8 = Math.cos((_arg2 * 0.5));
_local9 = Math.sin((_arg3 * 0.5));
_local10 = Math.cos((_arg3 * 0.5));
_local11 = (_local6 * _local8);
_local12 = (_local5 * _local7);
_local13 = new (Quaternion);
_local13.x = ((_local9 * _local11) - (_local10 * _local12));
_local13.y = (((_local10 * _local5) * _local8) + ((_local9 * _local6) * _local7));
_local13.z = (((_local10 * _local6) * _local7) - ((_local9 * _local5) * _local8));
_local13.w = ((_local10 * _local11) + (_local9 * _local12));
return (_local13);
}
public static function createFromMatrix(_arg1:Matrix3D):Quaternion{
var _local2:Quaternion;
var _local3:Number;
var _local4:Array;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Number;
var _local9:Array;
var _local10:Array;
_local2 = new (Quaternion);
_local4 = new Array(4);
_local8 = ((_arg1.n11 + _arg1.n22) + _arg1.n33);
if (_local8 > 0){
_local3 = Math.sqrt((_local8 + 1));
_local2.w = (_local3 / 2);
_local3 = (0.5 / _local3);
_local2.x = ((_arg1.n32 - _arg1.n23) * _local3);
_local2.y = ((_arg1.n13 - _arg1.n31) * _local3);
_local2.z = ((_arg1.n21 - _arg1.n12) * _local3);
} else {
_local9 = [1, 2, 0];
_local10 = [[_arg1.n11, _arg1.n12, _arg1.n13, _arg1.n14], [_arg1.n21, _arg1.n22, _arg1.n23, _arg1.n24], [_arg1.n31, _arg1.n32, _arg1.n33, _arg1.n34]];
_local5 = 0;
if (_local10[1][1] > _local10[0][0]){
_local5 = 1;
};
if (_local10[2][2] > _local10[_local5][_local5]){
_local5 = 2;
};
_local6 = _local9[_local5];
_local7 = _local9[_local6];
_local3 = Math.sqrt(((_local10[_local5][_local5] - (_local10[_local6][_local6] + _local10[_local7][_local7])) + 1));
_local4[_local5] = (_local3 * 0.5);
if (_local3 != 0){
_local3 = (0.5 / _local3);
};
_local4[3] = ((_local10[_local7][_local6] - _local10[_local6][_local7]) * _local3);
_local4[_local6] = ((_local10[_local6][_local5] + _local10[_local5][_local6]) * _local3);
_local4[_local7] = ((_local10[_local7][_local5] + _local10[_local5][_local7]) * _local3);
_local2.x = _local4[0];
_local2.y = _local4[1];
_local2.z = _local4[2];
_local2.w = _local4[3];
};
return (_local2);
}
public static function dot(_arg1:Quaternion, _arg2:Quaternion):Number{
return (((((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)) + (_arg1.z * _arg2.z)) + (_arg1.w * _arg2.w)));
}
public static function multiply(_arg1:Quaternion, _arg2:Quaternion):Quaternion{
var _local3:Quaternion;
_local3 = new (Quaternion);
_local3.x = ((((_arg1.w * _arg2.x) + (_arg1.x * _arg2.w)) + (_arg1.y * _arg2.z)) - (_arg1.z * _arg2.y));
_local3.y = ((((_arg1.w * _arg2.y) - (_arg1.x * _arg2.z)) + (_arg1.y * _arg2.w)) + (_arg1.z * _arg2.x));
_local3.z = ((((_arg1.w * _arg2.z) + (_arg1.x * _arg2.y)) - (_arg1.y * _arg2.x)) + (_arg1.z * _arg2.w));
_local3.w = ((((_arg1.w * _arg2.w) - (_arg1.x * _arg2.x)) - (_arg1.y * _arg2.y)) - (_arg1.z * _arg2.z));
return (_local3);
}
public static function createFromAxisAngle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Quaternion{
var _local5:Number;
var _local6:Number;
var _local7:Quaternion;
_local5 = Math.sin((_arg4 / 2));
_local6 = Math.cos((_arg4 / 2));
_local7 = new (Quaternion);
_local7.x = (_arg1 * _local5);
_local7.y = (_arg2 * _local5);
_local7.z = (_arg3 * _local5);
_local7.w = _local6;
_local7.normalize();
return (_local7);
}
public static function slerp(_arg1:Quaternion, _arg2:Quaternion, _arg3:Number):Quaternion{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = ((((_arg1.w * _arg2.w) + (_arg1.x * _arg2.x)) + (_arg1.y * _arg2.y)) + (_arg1.z * _arg2.z));
if (_local4 < 0){
_arg1.x = (_arg1.x * -1);
_arg1.y = (_arg1.y * -1);
_arg1.z = (_arg1.z * -1);
_arg1.w = (_arg1.w * -1);
_local4 = (_local4 * -1);
};
if ((_local4 + 1) > EPSILON){
if ((1 - _local4) >= EPSILON){
_local7 = Math.acos(_local4);
_local8 = (1 / Math.sin(_local7));
_local5 = (Math.sin((_local7 * (1 - _arg3))) * _local8);
_local6 = (Math.sin((_local7 * _arg3)) * _local8);
} else {
_local5 = (1 - _arg3);
_local6 = _arg3;
};
} else {
_arg2.y = -(_arg1.y);
_arg2.x = _arg1.x;
_arg2.w = -(_arg1.w);
_arg2.z = _arg1.z;
_local5 = Math.sin((Math.PI * (0.5 - _arg3)));
_local6 = Math.sin((Math.PI * _arg3));
};
return (new Quaternion(((_local5 * _arg1.x) + (_local6 * _arg2.x)), ((_local5 * _arg1.y) + (_local6 * _arg2.y)), ((_local5 * _arg1.z) + (_local6 * _arg2.z)), ((_local5 * _arg1.w) + (_local6 * _arg2.w))));
}
public static function createFromOrthoMatrix(_arg1:Matrix3D):Quaternion{
var _local2:Quaternion;
_local2 = new (Quaternion);
_local2.w = (Math.sqrt(Math.max(0, (((1 + _arg1.n11) + _arg1.n22) + _arg1.n33))) / 2);
_local2.x = (Math.sqrt(Math.max(0, (((1 + _arg1.n11) - _arg1.n22) - _arg1.n33))) / 2);
_local2.y = (Math.sqrt(Math.max(0, (((1 - _arg1.n11) + _arg1.n22) - _arg1.n33))) / 2);
_local2.z = (Math.sqrt(Math.max(0, (((1 - _arg1.n11) - _arg1.n22) + _arg1.n33))) / 2);
_local2.x = (((_arg1.n32 - _arg1.n23) < 0)) ? ((_local2.x < 0)) ? _local2.x : -(_local2.x) : ((_local2.x < 0)) ? -(_local2.x) : _local2.x;
_local2.y = (((_arg1.n13 - _arg1.n31) < 0)) ? ((_local2.y < 0)) ? _local2.y : -(_local2.y) : ((_local2.y < 0)) ? -(_local2.y) : _local2.y;
_local2.z = (((_arg1.n21 - _arg1.n12) < 0)) ? ((_local2.z < 0)) ? _local2.z : -(_local2.z) : ((_local2.z < 0)) ? -(_local2.z) : _local2.z;
return (_local2);
}
public static function conjugate(_arg1:Quaternion):Quaternion{
var _local2:Quaternion;
_local2 = new (Quaternion);
_local2.x = -(_arg1.x);
_local2.y = -(_arg1.y);
_local2.z = -(_arg1.z);
_local2.w = _arg1.w;
return (_local2);
}
public static function slerpOld(_arg1:Quaternion, _arg2:Quaternion, _arg3:Number):Quaternion{
var _local4:Quaternion;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local4 = new (Quaternion);
_local5 = ((((_arg1.w * _arg2.w) + (_arg1.x * _arg2.x)) + (_arg1.y * _arg2.y)) + (_arg1.z * _arg2.z));
if (Math.abs(_local5) >= 1){
_local4.w = _arg1.w;
_local4.x = _arg1.x;
_local4.y = _arg1.y;
_local4.z = _arg1.z;
return (_local4);
};
_local6 = Math.acos(_local5);
_local7 = Math.sqrt((1 - (_local5 * _local5)));
if (Math.abs(_local7) < 0.001){
_local4.w = ((_arg1.w * 0.5) + (_arg2.w * 0.5));
_local4.x = ((_arg1.x * 0.5) + (_arg2.x * 0.5));
_local4.y = ((_arg1.y * 0.5) + (_arg2.y * 0.5));
_local4.z = ((_arg1.z * 0.5) + (_arg2.z * 0.5));
return (_local4);
};
_local8 = (Math.sin(((1 - _arg3) * _local6)) / _local7);
_local9 = (Math.sin((_arg3 * _local6)) / _local7);
_local4.w = ((_arg1.w * _local8) + (_arg2.w * _local9));
_local4.x = ((_arg1.x * _local8) + (_arg2.x * _local9));
_local4.y = ((_arg1.y * _local8) + (_arg2.y * _local9));
_local4.z = ((_arg1.z * _local8) + (_arg2.z * _local9));
return (_local4);
}
}
}//package org.papervision3d.core.math
Section 122
//pv3dview (org.papervision3d.core.ns.pv3dview)
package org.papervision3d.core.ns {
public namespace pv3dview;
}//package org.papervision3d.core.ns
Section 123
//CameraObject3D (org.papervision3d.core.proto.CameraObject3D)
package org.papervision3d.core.proto {
import org.papervision3d.core.math.*;
import org.papervision3d.objects.*;
import flash.geom.*;
public class CameraObject3D extends DisplayObject3D {
public var eye:Matrix3D;
public var sort:Boolean;
public var viewport:Rectangle;
public var zoom:Number;
public var focus:Number;
public static const TYPE:String = "ABSTRACT";
public static var DEFAULT_POS:Number3D = new Number3D(0, 0, -1000);
private static var _flipY:Matrix3D = Matrix3D.scaleMatrix(1, -1, 1);
public function CameraObject3D(_arg1:Number=3, _arg2:Number=500, _arg3:Object=null){
this.x = (_arg3) ? ((_arg3.x) || (DEFAULT_POS.x)) : DEFAULT_POS.x;
this.y = (_arg3) ? ((_arg3.y) || (DEFAULT_POS.y)) : DEFAULT_POS.y;
this.z = (_arg3) ? ((_arg3.z) || (DEFAULT_POS.z)) : DEFAULT_POS.z;
this.zoom = _arg1;
this.focus = _arg2;
this.eye = Matrix3D.IDENTITY;
this.sort = (_arg3) ? !((_arg3.sort == false)) : true;
}
public function transformView(_arg1:Matrix3D=null):void{
eye.calculateMultiply(((_arg1) || (this.transform)), _flipY);
eye.invert();
}
public function pan(_arg1:Number):void{
super.yaw(_arg1);
}
public function tilt(_arg1:Number):void{
super.pitch(_arg1);
}
}
}//package org.papervision3d.core.proto
Section 124
//DisplayObjectContainer3D (org.papervision3d.core.proto.DisplayObjectContainer3D)
package org.papervision3d.core.proto {
import flash.events.*;
import org.papervision3d.objects.*;
import flash.utils.*;
public class DisplayObjectContainer3D extends EventDispatcher {
protected var _childrenByName:Object;
private var _childrenTotal:int;
public var root:DisplayObjectContainer3D;
protected var _children:Dictionary;
public function DisplayObjectContainer3D():void{
this._children = new Dictionary(false);
this._childrenByName = new Dictionary(true);
this._childrenTotal = 0;
}
public function addChild(_arg1:DisplayObject3D, _arg2:String=null):DisplayObject3D{
_arg2 = ((((_arg2) || (_arg1.name))) || (String(_arg1.id)));
this._children[_arg1] = _arg2;
this._childrenByName[_arg2] = _arg1;
this._childrenTotal++;
_arg1.parent = this;
_arg1.root = this.root;
return (_arg1);
}
private function findChildByName(_arg1:String, _arg2:DisplayObject3D=null):DisplayObject3D{
var _local3:DisplayObject3D;
var _local4:DisplayObject3D;
_arg2 = ((_arg2) || (DisplayObject3D(this)));
if (!_arg2){
return (null);
};
if (_arg2.name == _arg1){
return (_arg2);
};
for each (_local3 in _arg2.children) {
_local4 = findChildByName(_arg1, _local3);
if (_local4){
return (_local4);
};
};
return (null);
}
public function getChildByName(_arg1:String, _arg2:Boolean=false):DisplayObject3D{
if (_arg2){
return (findChildByName(_arg1));
};
return (this._childrenByName[_arg1]);
}
public function get numChildren():int{
return (this._childrenTotal);
}
public function removeChildByName(_arg1:String):DisplayObject3D{
return (removeChild(getChildByName(_arg1)));
}
override public function toString():String{
return (childrenList());
}
public function addChildren(_arg1:DisplayObject3D):DisplayObjectContainer3D{
var _local2:DisplayObject3D;
for each (_local2 in _arg1.children) {
_arg1.removeChild(_local2);
this.addChild(_local2);
};
return (this);
}
public function removeChild(_arg1:DisplayObject3D):DisplayObject3D{
if (_arg1){
delete this._childrenByName[this._children[_arg1]];
delete this._children[_arg1];
_arg1.parent = null;
_arg1.root = null;
return (_arg1);
};
return (null);
}
public function childrenList():String{
var _local1:String;
var _local2:String;
_local1 = "";
for (_local2 in this._children) {
_local1 = (_local1 + (_local2 + "\n"));
};
return (_local1);
}
public function get children():Object{
return (this._childrenByName);
}
}
}//package org.papervision3d.core.proto
Section 125
//GeometryObject3D (org.papervision3d.core.proto.GeometryObject3D)
package org.papervision3d.core.proto {
import flash.events.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.objects.*;
import flash.utils.*;
public class GeometryObject3D extends EventDispatcher {
protected var _boundingSphereDirty:Boolean;// = true
public var dirty:Boolean;
protected var _aabbDirty:Boolean;// = true
public var _ready:Boolean;// = false
protected var _boundingSphere:BoundingSphere;
public var faces:Array;
private var _numInstances:uint;// = 0
public var vertices:Array;
protected var _aabb:AxisAlignedBoundingBox;
public function GeometryObject3D(_arg1:Object=null):void{
_boundingSphereDirty = true;
_aabbDirty = true;
_numInstances = 0;
_ready = false;
super();
dirty = true;
}
public function transformVertices(_arg1:Matrix3D):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:int;
var _local15:Vertex3D;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
_local2 = _arg1.n11;
_local3 = _arg1.n12;
_local4 = _arg1.n13;
_local5 = _arg1.n21;
_local6 = _arg1.n22;
_local7 = _arg1.n23;
_local8 = _arg1.n31;
_local9 = _arg1.n32;
_local10 = _arg1.n33;
_local11 = _arg1.n14;
_local12 = _arg1.n24;
_local13 = _arg1.n34;
_local14 = vertices.length;
while ((_local15 = vertices[--_local14])) {
_local16 = _local15.x;
_local17 = _local15.y;
_local18 = _local15.z;
_local19 = ((((_local16 * _local2) + (_local17 * _local3)) + (_local18 * _local4)) + _local11);
_local20 = ((((_local16 * _local5) + (_local17 * _local6)) + (_local18 * _local7)) + _local12);
_local21 = ((((_local16 * _local8) + (_local17 * _local9)) + (_local18 * _local10)) + _local13);
_local15.x = _local19;
_local15.y = _local20;
_local15.z = _local21;
};
}
private function createVertexNormals():void{
var _local1:Dictionary;
var _local2:Triangle3D;
var _local3:Vertex3D;
_local1 = new Dictionary(true);
for each (_local2 in faces) {
_local2.v0.connectedFaces[_local2] = _local2;
_local2.v1.connectedFaces[_local2] = _local2;
_local2.v2.connectedFaces[_local2] = _local2;
_local1[_local2.v0] = _local2.v0;
_local1[_local2.v1] = _local2.v1;
_local1[_local2.v2] = _local2.v2;
};
for each (_local3 in _local1) {
_local3.calculateNormal();
};
}
public function transformUV(_arg1:MaterialObject3D):void{
var _local2:String;
if (_arg1.bitmap){
for (_local2 in this.faces) {
faces[_local2].transformUV(_arg1);
};
};
}
public function clone(_arg1:DisplayObject3D=null):GeometryObject3D{
var _local2:Dictionary;
var _local3:GeometryObject3D;
var _local4:int;
var _local5:Vertex3D;
var _local6:Triangle3D;
var _local7:Vertex3D;
var _local8:Vertex3D;
var _local9:Vertex3D;
_local2 = new Dictionary();
_local3 = new GeometryObject3D();
_local3.vertices = new Array();
_local3.faces = new Array();
_local4 = 0;
while (_local4 < this.vertices.length) {
_local5 = this.vertices[_local4];
_local2[_local5] = _local5.clone();
_local3.vertices.push(_local2[_local5]);
_local4++;
};
_local4 = 0;
while (_local4 < this.faces.length) {
_local6 = this.faces[_local4];
_local7 = _local2[_local6.v0];
_local8 = _local2[_local6.v1];
_local9 = _local2[_local6.v2];
_local3.faces.push(new Triangle3D(_arg1, [_local7, _local8, _local9], _local6.material, _local6.uv));
_local4++;
};
return (_local3);
}
public function set ready(_arg1:Boolean):void{
if (_arg1){
createVertexNormals();
this.dirty = false;
};
_ready = _arg1;
}
public function get ready():Boolean{
return (_ready);
}
public function get aabb():AxisAlignedBoundingBox{
if (_aabbDirty){
_aabb = AxisAlignedBoundingBox.createFromVertices(vertices);
_aabbDirty = false;
};
return (_aabb);
}
public function get boundingSphere():BoundingSphere{
if (_boundingSphereDirty){
_boundingSphere = BoundingSphere.getFromVertices(vertices);
_boundingSphereDirty = false;
};
return (_boundingSphere);
}
}
}//package org.papervision3d.core.proto
Section 126
//MaterialObject3D (org.papervision3d.core.proto.MaterialObject3D)
package org.papervision3d.core.proto {
import flash.events.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.render.material.*;
import org.papervision3d.objects.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import org.papervision3d.core.render.draw.*;
import org.papervision3d.materials.*;
public class MaterialObject3D extends EventDispatcher implements ITriangleDrawer {
public var maxV:Number;
public var name:String;
public var heightOffset:Number;// = 0
public var fillAlpha:Number;// = 0
public var fillColor:Number;
public var id:Number;
protected var objects:Dictionary;
public var invisible:Boolean;// = false
public var smooth:Boolean;// = false
public var bitmap:BitmapData;
public var lineColor:Number;
public var lineAlpha:Number;// = 0
public var oneSide:Boolean;// = true
public var lineThickness:Number;// = 1
public var interactive:Boolean;// = false
public var opposite:Boolean;// = false
public var maxU:Number;
public var tiled:Boolean;// = false
public var widthOffset:Number;// = 0
public static var DEFAULT_COLOR:int = 0;
public static var DEBUG_COLOR:int = 0xFF00FF;
private static var _totalMaterialObjects:Number = 0;
public function MaterialObject3D(){
smooth = false;
tiled = false;
lineColor = DEFAULT_COLOR;
lineAlpha = 0;
lineThickness = 1;
fillColor = DEFAULT_COLOR;
fillAlpha = 0;
oneSide = true;
invisible = false;
opposite = false;
widthOffset = 0;
heightOffset = 0;
interactive = false;
super();
this.id = _totalMaterialObjects++;
MaterialManager.registerMaterial(this);
objects = new Dictionary(true);
}
public function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void{
}
public function get doubleSided():Boolean{
return (!(this.oneSide));
}
public function unregisterObject(_arg1:DisplayObject3D):void{
if (((objects) && (!((objects[_arg1] == null))))){
delete objects[_arg1];
};
}
public function set doubleSided(_arg1:Boolean):void{
this.oneSide = !(_arg1);
}
public function registerObject(_arg1:DisplayObject3D):void{
objects[_arg1] = _arg1;
}
public function updateBitmap():void{
}
override public function toString():String{
return (((((("[MaterialObject3D] bitmap:" + this.bitmap) + " lineColor:") + this.lineColor) + " fillColor:") + fillColor));
}
public function copy(_arg1:MaterialObject3D):void{
this.bitmap = _arg1.bitmap;
this.smooth = _arg1.smooth;
this.lineColor = _arg1.lineColor;
this.lineAlpha = _arg1.lineAlpha;
this.fillColor = _arg1.fillColor;
this.fillAlpha = _arg1.fillAlpha;
this.oneSide = _arg1.oneSide;
this.opposite = _arg1.opposite;
this.invisible = _arg1.invisible;
this.name = _arg1.name;
this.maxU = _arg1.maxU;
this.maxV = _arg1.maxV;
}
public function destroy():void{
objects = null;
bitmap = null;
MaterialManager.unRegisterMaterial(this);
}
public function clone():MaterialObject3D{
var _local1:MaterialObject3D;
_local1 = new MaterialObject3D();
_local1.copy(this);
return (_local1);
}
public static function get DEFAULT():MaterialObject3D{
var _local1:MaterialObject3D;
_local1 = new WireframeMaterial();
_local1.lineColor = (0xFFFFFF * Math.random());
_local1.lineAlpha = 1;
_local1.fillColor = DEFAULT_COLOR;
_local1.fillAlpha = 1;
_local1.doubleSided = false;
return (_local1);
}
public static function get DEBUG():MaterialObject3D{
var _local1:MaterialObject3D;
_local1 = new (MaterialObject3D);
_local1.lineColor = (0xFFFFFF * Math.random());
_local1.lineAlpha = 1;
_local1.fillColor = DEBUG_COLOR;
_local1.fillAlpha = 0.37;
_local1.doubleSided = true;
return (_local1);
}
}
}//package org.papervision3d.core.proto
Section 127
//SceneObject3D (org.papervision3d.core.proto.SceneObject3D)
package org.papervision3d.core.proto {
import org.papervision3d.materials.utils.*;
import org.papervision3d.objects.*;
import org.papervision3d.*;
public class SceneObject3D extends DisplayObjectContainer3D {
public var objects:Array;
public var materials:MaterialsList;
public function SceneObject3D(){
this.objects = new Array();
this.materials = new MaterialsList();
Papervision3D.log((((((Papervision3D.NAME + " ") + Papervision3D.VERSION) + " (") + Papervision3D.DATE) + ")\n"));
this.root = this;
}
override public function removeChild(_arg1:DisplayObject3D):DisplayObject3D{
var _local2:int;
super.removeChild(_arg1);
_local2 = 0;
while (_local2 < this.objects.length) {
if (this.objects[_local2] === _arg1){
this.objects.splice(_local2, 1);
return (_arg1);
};
_local2++;
};
return (_arg1);
}
override public function addChild(_arg1:DisplayObject3D, _arg2:String=null):DisplayObject3D{
var _local3:DisplayObject3D;
_local3 = super.addChild(_arg1, (_arg2) ? _arg2 : _arg1.name);
_arg1.scene = this;
this.objects.push(_local3);
return (_local3);
}
}
}//package org.papervision3d.core.proto
Section 128
//AbstractRenderListItem (org.papervision3d.core.render.command.AbstractRenderListItem)
package org.papervision3d.core.render.command {
import org.papervision3d.core.render.data.*;
public class AbstractRenderListItem implements IRenderListItem {
public var screenDepth:Number;
public function render(_arg1:RenderSessionData):void{
}
}
}//package org.papervision3d.core.render.command
Section 129
//IRenderListItem (org.papervision3d.core.render.command.IRenderListItem)
package org.papervision3d.core.render.command {
import org.papervision3d.core.render.data.*;
public interface IRenderListItem {
function render(_arg1:RenderSessionData):void;
}
}//package org.papervision3d.core.render.command
Section 130
//RenderableListItem (org.papervision3d.core.render.command.RenderableListItem)
package org.papervision3d.core.render.command {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.geom.*;
public class RenderableListItem extends AbstractRenderListItem {
public var renderableInstance:IRenderable;
public var renderable:Class;
public function hitTestPoint2D(_arg1:Point, _arg2:RenderHitData):RenderHitData{
return (_arg2);
}
}
}//package org.papervision3d.core.render.command
Section 131
//RenderLine (org.papervision3d.core.render.command.RenderLine)
package org.papervision3d.core.render.command {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.renderables.*;
import flash.geom.*;
import org.papervision3d.materials.special.*;
public class RenderLine extends RenderableListItem implements IRenderListItem {
public var renderer:LineMaterial;
private var l1:Number2D;
private var l2:Number2D;
public var line:Line3D;
private var v:Number2D;
private var cp3d:Number3D;
private var p:Number2D;
private static var mouseVector:Number3D = Number3D.ZERO;
private static var lineVector:Number3D = Number3D.ZERO;
public function RenderLine(_arg1:Line3D){
this.renderable = Line3D;
this.renderableInstance = _arg1;
this.line = _arg1;
p = new Number2D();
l1 = new Number2D();
l2 = new Number2D();
v = new Number2D();
cp3d = new Number3D();
}
override public function hitTestPoint2D(_arg1:Point, _arg2:RenderHitData):RenderHitData{
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (renderer.interactive){
_local3 = line.size;
p.reset(_arg1.x, _arg1.y);
l1.reset(line.v0.vertex3DInstance.x, line.v0.vertex3DInstance.y);
l2.reset(line.v1.vertex3DInstance.x, line.v1.vertex3DInstance.y);
v.copyFrom(l2);
v.minusEq(l1);
_local4 = ((((p.x - l1.x) * (l2.x - l1.x)) + ((p.y - l1.y) * (l2.y - l1.y))) / ((v.x * v.x) + (v.y * v.y)));
if ((((_local4 > 0)) && ((_local4 < 1)))){
v.multiplyEq(_local4);
v.plusEq(l1);
v.minusEq(p);
_local5 = ((v.x * v.x) + (v.y * v.y));
if (_local5 < (_local3 * _local3)){
_arg2.displayObject3D = line.instance;
_arg2.material = renderer;
_arg2.renderable = line;
_arg2.hasHit = true;
cp3d.reset((line.v1.x - line.v0.x), (line.v1.y - line.v0.y), (line.v1.x - line.v0.x));
cp3d.x = (cp3d.x * _local4);
cp3d.y = (cp3d.y * _local4);
cp3d.z = (cp3d.z * _local4);
cp3d.x = (cp3d.x + line.v0.x);
cp3d.y = (cp3d.y + line.v0.y);
cp3d.z = (cp3d.z + line.v0.z);
_arg2.x = cp3d.x;
_arg2.y = cp3d.y;
_arg2.z = cp3d.z;
_arg2.u = 0;
_arg2.v = 0;
return (_arg2);
};
};
};
return (_arg2);
}
override public function render(_arg1:RenderSessionData):void{
renderer.drawLine(line, _arg1.container.graphics, _arg1);
}
}
}//package org.papervision3d.core.render.command
Section 132
//RenderParticle (org.papervision3d.core.render.command.RenderParticle)
package org.papervision3d.core.render.command {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.geom.*;
import org.papervision3d.materials.special.*;
public class RenderParticle extends RenderableListItem implements IRenderListItem {
public var particle:Particle;
public var renderMat:ParticleMaterial;
public function RenderParticle(_arg1:Particle){
this.particle = _arg1;
}
override public function hitTestPoint2D(_arg1:Point, _arg2:RenderHitData):RenderHitData{
renderMat = particle.material;
if (renderMat.interactive){
if (particle.renderRect.contains(_arg1.x, _arg1.y)){
_arg2.displayObject3D = particle.instance;
_arg2.material = renderMat;
_arg2.renderable = particle;
_arg2.hasHit = true;
_arg2.x = particle.x;
_arg2.y = particle.y;
_arg2.z = particle.z;
_arg2.u = 0;
_arg2.v = 0;
return (_arg2);
};
};
return (_arg2);
}
override public function render(_arg1:RenderSessionData):void{
particle.material.drawParticle(particle, _arg1.container.graphics, _arg1);
}
}
}//package org.papervision3d.core.render.command
Section 133
//RenderTriangle (org.papervision3d.core.render.command.RenderTriangle)
package org.papervision3d.core.render.command {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.render.draw.*;
import org.papervision3d.materials.*;
public class RenderTriangle extends RenderableListItem implements IRenderListItem {
public var renderer:ITriangleDrawer;
public var triangle:Triangle3D;
private var position:Number3D;
public var renderMat:MaterialObject3D;
public var container:Sprite;
protected static var resPA:Vertex3DInstance = new Vertex3DInstance();
protected static var resBA:Vertex3DInstance = new Vertex3DInstance();
protected static var vPoint:Vertex3DInstance = new Vertex3DInstance();
protected static var resRA:Vertex3DInstance = new Vertex3DInstance();
public function RenderTriangle(_arg1:Triangle3D):void{
position = new Number3D();
super();
this.triangle = _arg1;
renderableInstance = _arg1;
renderable = Triangle3D;
}
override public function hitTestPoint2D(_arg1:Point, _arg2:RenderHitData):RenderHitData{
var _local3:Vertex3DInstance;
var _local4:Vertex3DInstance;
var _local5:Vertex3DInstance;
var _local6:Vertex3DInstance;
renderMat = triangle.material;
if (!renderMat){
renderMat = triangle.instance.material;
};
if (renderMat.interactive){
_local3 = RenderTriangle.vPoint;
_local3.x = _arg1.x;
_local3.y = _arg1.y;
_local4 = triangle.v0.vertex3DInstance;
_local5 = triangle.v1.vertex3DInstance;
_local6 = triangle.v2.vertex3DInstance;
if (sameSide(_local3, _local4, _local5, _local6)){
if (sameSide(_local3, _local5, _local4, _local6)){
if (sameSide(_local3, _local6, _local4, _local5)){
return (deepHitTest(triangle, _local3, _arg2));
};
};
};
};
return (_arg2);
}
public function sameSide(_arg1:Vertex3DInstance, _arg2:Vertex3DInstance, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance):Boolean{
Vertex3DInstance.subTo(_arg4, _arg3, resBA);
Vertex3DInstance.subTo(_arg1, _arg3, resPA);
Vertex3DInstance.subTo(_arg2, _arg3, resRA);
return (((Vertex3DInstance.cross(resBA, resPA) * Vertex3DInstance.cross(resBA, resRA)) > 0));
}
private function deepHitTest(_arg1:Triangle3D, _arg2:Vertex3DInstance, _arg3:RenderHitData):RenderHitData{
var _local4:Vertex3DInstance;
var _local5:Vertex3DInstance;
var _local6:Vertex3DInstance;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Array;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:BitmapData;
var _local40:Number;
var _local41:Number;
_local4 = _arg1.v0.vertex3DInstance;
_local5 = _arg1.v1.vertex3DInstance;
_local6 = _arg1.v2.vertex3DInstance;
_local7 = (_local6.x - _local4.x);
_local8 = (_local6.y - _local4.y);
_local9 = (_local5.x - _local4.x);
_local10 = (_local5.y - _local4.y);
_local11 = (_arg2.x - _local4.x);
_local12 = (_arg2.y - _local4.y);
_local13 = ((_local7 * _local7) + (_local8 * _local8));
_local14 = ((_local7 * _local9) + (_local8 * _local10));
_local15 = ((_local7 * _local11) + (_local8 * _local12));
_local16 = ((_local9 * _local9) + (_local10 * _local10));
_local17 = ((_local9 * _local11) + (_local10 * _local12));
_local18 = (1 / ((_local13 * _local16) - (_local14 * _local14)));
_local19 = (((_local16 * _local15) - (_local14 * _local17)) * _local18);
_local20 = (((_local13 * _local17) - (_local14 * _local15)) * _local18);
_local21 = (_arg1.v2.x - _arg1.v0.x);
_local22 = (_arg1.v2.y - _arg1.v0.y);
_local23 = (_arg1.v2.z - _arg1.v0.z);
_local24 = (_arg1.v1.x - _arg1.v0.x);
_local25 = (_arg1.v1.y - _arg1.v0.y);
_local26 = (_arg1.v1.z - _arg1.v0.z);
_local27 = ((_arg1.v0.x + (_local21 * _local19)) + (_local24 * _local20));
_local28 = ((_arg1.v0.y + (_local22 * _local19)) + (_local25 * _local20));
_local29 = ((_arg1.v0.z + (_local23 * _local19)) + (_local26 * _local20));
_local30 = _arg1.uv;
_local31 = _local30[0].u;
_local32 = _local30[1].u;
_local33 = _local30[2].u;
_local34 = _local30[0].v;
_local35 = _local30[1].v;
_local36 = _local30[2].v;
_local37 = ((((_local32 - _local31) * _local20) + ((_local33 - _local31) * _local19)) + _local31);
_local38 = ((((_local35 - _local34) * _local20) + ((_local36 - _local34) * _local19)) + _local34);
if (triangle.material){
renderMat = _arg1.material;
} else {
renderMat = _arg1.instance.material;
};
_local39 = renderMat.bitmap;
_local40 = 1;
_local41 = 1;
if (_local39){
_local40 = (BitmapMaterial.AUTO_MIP_MAPPING) ? renderMat.widthOffset : _local39.width;
_local41 = (BitmapMaterial.AUTO_MIP_MAPPING) ? renderMat.heightOffset : _local39.height;
};
_arg3.displayObject3D = _arg1.instance;
_arg3.material = renderMat;
_arg3.renderable = _arg1;
_arg3.hasHit = true;
position.x = _local27;
position.y = _local28;
position.z = _local29;
Matrix3D.multiplyVector(_arg1.instance.world, position);
_arg3.x = position.x;
_arg3.y = position.y;
_arg3.z = position.z;
_arg3.u = (_local37 * _local40);
_arg3.v = (_local41 - (_local38 * _local41));
return (_arg3);
}
override public function render(_arg1:RenderSessionData):void{
renderer.drawTriangle(triangle, _arg1.container.graphics, _arg1);
}
}
}//package org.papervision3d.core.render.command
Section 134
//RenderHitData (org.papervision3d.core.render.data.RenderHitData)
package org.papervision3d.core.render.data {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.objects.*;
public class RenderHitData {
public var y:Number;
public var endTime:int;// = 0
public var displayObject3D:DisplayObject3D;
public var startTime:int;// = 0
public var hasHit:Boolean;// = false
public var material:MaterialObject3D;
public var renderable:IRenderable;
public var u:Number;
public var v:Number;
public var x:Number;
public var z:Number;
public function RenderHitData():void{
startTime = 0;
endTime = 0;
hasHit = false;
super();
}
public function clear():void{
startTime = 0;
endTime = 0;
hasHit = false;
displayObject3D = null;
material = null;
renderable = null;
u = 0;
v = 0;
x = 0;
y = 0;
z = 0;
}
public function clone():RenderHitData{
var _local1:RenderHitData;
_local1 = new RenderHitData();
_local1.startTime = startTime;
_local1.endTime = endTime;
_local1.hasHit = hasHit;
_local1.displayObject3D = displayObject3D;
_local1.material = material;
_local1.renderable = renderable;
_local1.u = u;
_local1.v = v;
_local1.x = x;
_local1.y = y;
_local1.z = z;
return (_local1);
}
public function toString():String{
return (((displayObject3D + " ") + renderable));
}
}
}//package org.papervision3d.core.render.data
Section 135
//RenderSessionData (org.papervision3d.core.render.data.RenderSessionData)
package org.papervision3d.core.render.data {
import org.papervision3d.core.proto.*;
import org.papervision3d.view.*;
import flash.display.*;
import org.papervision3d.core.culling.*;
import org.papervision3d.core.render.*;
public class RenderSessionData {
public var renderer:IRenderEngine;
public var particleCuller:IParticleCuller;
public var viewPort:Viewport3D;
public var triangleCuller:ITriangleCuller;
public var container:Sprite;
public var scene:SceneObject3D;
public var camera:CameraObject3D;
public var renderStatistics:RenderStatistics;
public var sorted:Boolean;
public function RenderSessionData():void{
this.renderStatistics = new RenderStatistics();
}
public function clone():RenderSessionData{
var _local1:RenderSessionData;
_local1 = new RenderSessionData();
_local1.triangleCuller = triangleCuller;
_local1.particleCuller = particleCuller;
_local1.viewPort = viewPort;
_local1.container = container;
_local1.scene = scene;
_local1.camera = camera;
_local1.renderer = renderer;
_local1.renderStatistics = renderStatistics.clone();
return (_local1);
}
public function destroy():void{
triangleCuller = null;
particleCuller = null;
viewPort = null;
container = null;
scene = null;
camera = null;
renderer = null;
renderStatistics = null;
}
}
}//package org.papervision3d.core.render.data
Section 136
//RenderStatistics (org.papervision3d.core.render.data.RenderStatistics)
package org.papervision3d.core.render.data {
public class RenderStatistics {
public var renderTime:int;// = 0
public var culledObjects:int;// = 0
public var shadedTriangles:int;// = 0
public var culledParticles:int;// = 0
public var culledTriangles:int;// = 0
public var triangles:int;// = 0
public var particles:int;// = 0
public var rendered:int;// = 0
public var projectionTime:int;// = 0
public var filteredObjects:int;// = 0
public var lines:int;// = 0
public function RenderStatistics(){
projectionTime = 0;
renderTime = 0;
rendered = 0;
triangles = 0;
culledTriangles = 0;
particles = 0;
culledParticles = 0;
lines = 0;
shadedTriangles = 0;
filteredObjects = 0;
culledObjects = 0;
super();
}
public function clone():RenderStatistics{
var _local1:RenderStatistics;
_local1 = new RenderStatistics();
_local1.projectionTime = projectionTime;
_local1.renderTime = renderTime;
_local1.rendered = rendered;
_local1.particles = particles;
_local1.triangles = triangles;
_local1.culledTriangles = culledTriangles;
_local1.lines = lines;
_local1.shadedTriangles = shadedTriangles;
_local1.filteredObjects = filteredObjects;
_local1.culledObjects = culledObjects;
return (_local1);
}
public function clear():void{
projectionTime = 0;
renderTime = 0;
rendered = 0;
particles = 0;
triangles = 0;
culledTriangles = 0;
culledParticles = 0;
lines = 0;
shadedTriangles = 0;
filteredObjects = 0;
culledObjects = 0;
}
public function toString():String{
return (new String((((((((((((((((((("ProjectionTime:" + projectionTime) + " RenderTime:") + renderTime) + " Particles:") + particles) + " CulledParticles :") + culledParticles) + " Triangles:") + triangles) + " ShadedTriangles :") + shadedTriangles) + " CulledTriangles:") + culledTriangles) + " FilteredObjects:") + filteredObjects) + " CulledObjects:") + culledObjects) + "")));
}
}
}//package org.papervision3d.core.render.data
Section 137
//ILineDrawer (org.papervision3d.core.render.draw.ILineDrawer)
package org.papervision3d.core.render.draw {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
public interface ILineDrawer {
function drawLine(_arg1:Line3D, _arg2:Graphics, _arg3:RenderSessionData):void;
}
}//package org.papervision3d.core.render.draw
Section 138
//IParticleDrawer (org.papervision3d.core.render.draw.IParticleDrawer)
package org.papervision3d.core.render.draw {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
public interface IParticleDrawer {
function updateRenderRect(_arg1:Particle):void;
function drawParticle(_arg1:Particle, _arg2:Graphics, _arg3:RenderSessionData):void;
}
}//package org.papervision3d.core.render.draw
Section 139
//ITriangleDrawer (org.papervision3d.core.render.draw.ITriangleDrawer)
package org.papervision3d.core.render.draw {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
public interface ITriangleDrawer {
function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void;
}
}//package org.papervision3d.core.render.draw
Section 140
//BasicRenderFilter (org.papervision3d.core.render.filter.BasicRenderFilter)
package org.papervision3d.core.render.filter {
public class BasicRenderFilter implements IRenderFilter {
public function filter(_arg1:Array):int{
return (0);
}
}
}//package org.papervision3d.core.render.filter
Section 141
//IRenderFilter (org.papervision3d.core.render.filter.IRenderFilter)
package org.papervision3d.core.render.filter {
public interface IRenderFilter {
function filter(_arg1:Array):int;
}
}//package org.papervision3d.core.render.filter
Section 142
//IUpdateAfterMaterial (org.papervision3d.core.render.material.IUpdateAfterMaterial)
package org.papervision3d.core.render.material {
import org.papervision3d.core.render.data.*;
public interface IUpdateAfterMaterial {
function updateAfterRender(_arg1:RenderSessionData):void;
}
}//package org.papervision3d.core.render.material
Section 143
//IUpdateBeforeMaterial (org.papervision3d.core.render.material.IUpdateBeforeMaterial)
package org.papervision3d.core.render.material {
import org.papervision3d.core.render.data.*;
public interface IUpdateBeforeMaterial {
function updateBeforeRender(_arg1:RenderSessionData):void;
}
}//package org.papervision3d.core.render.material
Section 144
//MaterialManager (org.papervision3d.core.render.material.MaterialManager)
package org.papervision3d.core.render.material {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import flash.utils.*;
public class MaterialManager {
private var materials:Dictionary;
private static var instance:MaterialManager;
public function MaterialManager():void{
if (instance){
throw (new Error("Only 1 instance of materialmanager allowed"));
};
init();
}
private function init():void{
materials = new Dictionary(true);
}
private function _unRegisterMaterial(_arg1:MaterialObject3D):void{
delete materials[_arg1];
}
public function updateMaterialsAfterRender(_arg1:RenderSessionData):void{
var _local2:IUpdateAfterMaterial;
var _local3:MaterialObject3D;
for each (_local3 in materials) {
if ((_local3 is IUpdateAfterMaterial)){
_local2 = (_local3 as IUpdateAfterMaterial);
_local2.updateAfterRender(_arg1);
};
};
}
private function _registerMaterial(_arg1:MaterialObject3D):void{
materials[_arg1] = _arg1;
}
public function updateMaterialsBeforeRender(_arg1:RenderSessionData):void{
var _local2:IUpdateBeforeMaterial;
var _local3:MaterialObject3D;
for each (_local3 in materials) {
if ((_local3 is IUpdateBeforeMaterial)){
_local2 = (_local3 as IUpdateBeforeMaterial);
_local2.updateBeforeRender(_arg1);
};
};
}
public static function getInstance():MaterialManager{
if (!instance){
instance = new (MaterialManager);
};
return (instance);
}
public static function unRegisterMaterial(_arg1:MaterialObject3D):void{
getInstance()._unRegisterMaterial(_arg1);
}
public static function registerMaterial(_arg1:MaterialObject3D):void{
getInstance()._registerMaterial(_arg1);
}
}
}//package org.papervision3d.core.render.material
Section 145
//BasicProjectionPipeline (org.papervision3d.core.render.project.BasicProjectionPipeline)
package org.papervision3d.core.render.project {
import org.papervision3d.core.render.data.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.culling.*;
public class BasicProjectionPipeline extends ProjectionPipeline {
public function BasicProjectionPipeline(){
init();
}
protected function init():void{
}
protected function projectObject(_arg1:DisplayObject3D, _arg2:RenderSessionData):void{
_arg1.project(_arg2.camera, _arg2);
}
override public function project(_arg1:RenderSessionData):void{
var _local2:Array;
var _local3:DisplayObject3D;
var _local4:Number;
_arg1.camera.transformView();
_local2 = _arg1.scene.objects;
_local4 = _local2.length;
if ((_arg1.camera is IObjectCuller)){
for each (_local3 in _local2) {
if (_local3.visible){
if (_arg1.viewPort.viewportObjectFilter){
if (_arg1.viewPort.viewportObjectFilter.testObject(_local3)){
_local3.view.calculateMultiply4x4(_arg1.camera.eye, _local3.transform);
projectObject(_local3, _arg1);
} else {
_arg1.renderStatistics.filteredObjects++;
};
} else {
_local3.view.calculateMultiply4x4(_arg1.camera.eye, _local3.transform);
projectObject(_local3, _arg1);
};
};
};
} else {
for each (_local3 in _local2) {
if (_local3.visible){
if (_arg1.viewPort.viewportObjectFilter){
if (_arg1.viewPort.viewportObjectFilter.testObject(_local3)){
_local3.view.calculateMultiply(_arg1.camera.eye, _local3.transform);
projectObject(_local3, _arg1);
} else {
_arg1.renderStatistics.filteredObjects++;
};
} else {
_local3.view.calculateMultiply(_arg1.camera.eye, _local3.transform);
projectObject(_local3, _arg1);
};
};
};
};
}
}
}//package org.papervision3d.core.render.project
Section 146
//ProjectionPipeline (org.papervision3d.core.render.project.ProjectionPipeline)
package org.papervision3d.core.render.project {
import org.papervision3d.core.render.data.*;
public class ProjectionPipeline {
public function project(_arg1:RenderSessionData):void{
}
}
}//package org.papervision3d.core.render.project
Section 147
//BasicRenderSorter (org.papervision3d.core.render.sort.BasicRenderSorter)
package org.papervision3d.core.render.sort {
public class BasicRenderSorter implements IRenderSorter {
public function sort(_arg1:Array):void{
_arg1.sortOn("screenDepth", Array.NUMERIC);
}
}
}//package org.papervision3d.core.render.sort
Section 148
//IRenderSorter (org.papervision3d.core.render.sort.IRenderSorter)
package org.papervision3d.core.render.sort {
public interface IRenderSorter {
function sort(_arg1:Array):void;
}
}//package org.papervision3d.core.render.sort
Section 149
//AbstractRenderEngine (org.papervision3d.core.render.AbstractRenderEngine)
package org.papervision3d.core.render {
import flash.events.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.view.*;
import org.papervision3d.core.render.command.*;
public class AbstractRenderEngine extends EventDispatcher implements IRenderEngine {
public function AbstractRenderEngine(_arg1:IEventDispatcher=null){
super(_arg1);
}
public function removeFromRenderList(_arg1:IRenderListItem):int{
return (0);
}
public function addToRenderList(_arg1:IRenderListItem):int{
return (0);
}
public function renderScene(_arg1:SceneObject3D, _arg2:CameraObject3D, _arg3:Viewport3D, _arg4:Boolean=true):RenderStatistics{
return (null);
}
}
}//package org.papervision3d.core.render
Section 150
//IRenderEngine (org.papervision3d.core.render.IRenderEngine)
package org.papervision3d.core.render {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.view.*;
import org.papervision3d.core.render.command.*;
public interface IRenderEngine {
function addToRenderList(_arg1:IRenderListItem):int;
function removeFromRenderList(_arg1:IRenderListItem):int;
function renderScene(_arg1:SceneObject3D, _arg2:CameraObject3D, _arg3:Viewport3D, _arg4:Boolean=true):RenderStatistics;
}
}//package org.papervision3d.core.render
Section 151
//IVirtualMouseEvent (org.papervision3d.core.utils.virtualmouse.IVirtualMouseEvent)
package org.papervision3d.core.utils.virtualmouse {
public interface IVirtualMouseEvent {
}
}//package org.papervision3d.core.utils.virtualmouse
Section 152
//VirtualMouse (org.papervision3d.core.utils.virtualmouse.VirtualMouse)
package org.papervision3d.core.utils.virtualmouse {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import com.blitzagency.xray.logger.*;
import flash.utils.*;
import org.papervision3d.core.components.as3.utils.*;
public class VirtualMouse extends EventDispatcher {
private var _container:Sprite;
private var lastDownTarget:DisplayObject;
private var target:InteractiveObject;
private var updateMouseDown:Boolean;// = false
private var eventEvent:Class;
private var _lastEvent:Event;
private var mouseEventEvent:Class;
private var location:Point;
private var delta:int;// = 0
private var disabledEvents:Object;
private var log:XrayLog;
private var ignoredInstances:Dictionary;
private var isLocked:Boolean;// = false
private var lastWithinStage:Boolean;// = true
private var lastLocation:Point;
private var isDoubleClickEvent:Boolean;// = false
private var lastMouseDown:Boolean;// = false
private var altKey:Boolean;// = false
private var _useNativeEvents:Boolean;// = false
private var ctrlKey:Boolean;// = false
private var shiftKey:Boolean;// = false
private var _stage:Stage;
public static const UPDATE:String = "update";
private static var _mouseIsDown:Boolean = false;
public function VirtualMouse(_arg1:Stage=null, _arg2:Sprite=null, _arg3:Number=0, _arg4:Number=0){
altKey = false;
ctrlKey = false;
shiftKey = false;
delta = 0;
isLocked = false;
isDoubleClickEvent = false;
disabledEvents = new Object();
ignoredInstances = new Dictionary(true);
lastMouseDown = false;
updateMouseDown = false;
lastWithinStage = true;
_useNativeEvents = false;
eventEvent = VirtualMouseEvent;
mouseEventEvent = VirtualMouseMouseEvent;
log = new XrayLog();
super();
this.stage = _arg1;
this.container = _arg2;
location = new Point(_arg3, _arg4);
lastLocation = location.clone();
addEventListener(UPDATE, handleUpdate);
update();
}
public function get mouseIsDown():Boolean{
return (_mouseIsDown);
}
public function get stage():Stage{
return (_stage);
}
public function exitContainer():void{
var _local1:Point;
_local1 = target.globalToLocal(location);
if (!disabledEvents[MouseEvent.MOUSE_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
container.dispatchEvent(new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
dispatchEvent(new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
};
if (!disabledEvents[MouseEvent.ROLL_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
container.dispatchEvent(new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
dispatchEvent(new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
};
if (target != container){
if (!disabledEvents[MouseEvent.MOUSE_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
target.dispatchEvent(new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
dispatchEvent(new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
};
if (!disabledEvents[MouseEvent.ROLL_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
target.dispatchEvent(new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
dispatchEvent(new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
};
};
target = _stage;
}
public function release():void{
updateMouseDown = true;
_mouseIsDown = false;
if (!isLocked){
update();
};
}
public function click():void{
press();
release();
}
public function get container():Sprite{
return (_container);
}
public function set container(_arg1:Sprite):void{
_container = _arg1;
}
public function get y():Number{
return (location.y);
}
public function set x(_arg1:Number):void{
location.x = _arg1;
if (!isLocked){
update();
};
}
public function disableEvent(_arg1:String):void{
disabledEvents[_arg1] = true;
}
public function get lastEvent():Event{
return (_lastEvent);
}
private function handleUpdate(_arg1:Event):void{
var _local2:Point;
var _local3:Array;
var _local4:InteractiveObject;
var _local5:DisplayObject;
var _local6:int;
var _local7:Point;
var _local8:Point;
var _local9:Boolean;
if (!container){
return;
};
_local2 = CoordinateTools.localToLocal(container, stage, location);
_local3 = container.getObjectsUnderPoint(location);
_local6 = _local3.length;
while (_local6--) {
_local5 = _local3[_local6];
while (_local5) {
if (ignoredInstances[_local5]){
_local4 = null;
break;
};
if (((_local4) && ((_local5 is SimpleButton)))){
_local4 = null;
} else {
if (((_local4) && (!(DisplayObjectContainer(_local5).mouseChildren)))){
_local4 = null;
};
};
if (((((!(_local4)) && ((_local5 is InteractiveObject)))) && (InteractiveObject(_local5).mouseEnabled))){
_local4 = InteractiveObject(_local5);
};
_local5 = _local5.parent;
};
if (_local4){
break;
};
};
if (!_local4){
_local4 = _stage;
};
_local7 = target.globalToLocal(location);
_local8 = _local4.globalToLocal(location);
if (((!((lastLocation.x == location.x))) || (!((lastLocation.y == location.y))))){
_local9 = false;
if (stage){
_local9 = (((((((location.x >= 0)) && ((location.y >= 0)))) && ((location.x <= stage.stageWidth)))) && ((location.y <= stage.stageHeight)));
};
if (((((!(_local9)) && (lastWithinStage))) && (!(disabledEvents[Event.MOUSE_LEAVE])))){
_lastEvent = new eventEvent(Event.MOUSE_LEAVE, false, false);
stage.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (((_local9) && (!(disabledEvents[MouseEvent.MOUSE_MOVE])))){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_MOVE, true, false, _local8.x, _local8.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local4.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastWithinStage = _local9;
};
if (_local4 != target){
if (!disabledEvents[MouseEvent.MOUSE_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local7.x, _local7.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
target.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (!disabledEvents[MouseEvent.ROLL_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local7.x, _local7.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
target.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (!disabledEvents[MouseEvent.MOUSE_OVER]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OVER, true, false, _local8.x, _local8.y, target, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local4.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (!disabledEvents[MouseEvent.ROLL_OVER]){
_lastEvent = new mouseEventEvent(MouseEvent.ROLL_OVER, false, false, _local8.x, _local8.y, target, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local4.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
};
if (updateMouseDown){
if (_mouseIsDown){
if (!disabledEvents[MouseEvent.MOUSE_DOWN]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_DOWN, true, false, _local8.x, _local8.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local4.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastDownTarget = _local4;
updateMouseDown = false;
} else {
if (!disabledEvents[MouseEvent.MOUSE_UP]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_UP, true, false, _local8.x, _local8.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local4.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (((!(disabledEvents[MouseEvent.CLICK])) && ((_local4 == lastDownTarget)))){
_lastEvent = new mouseEventEvent(MouseEvent.CLICK, true, false, _local8.x, _local8.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local4.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastDownTarget = null;
updateMouseDown = false;
};
};
if (((((isDoubleClickEvent) && (!(disabledEvents[MouseEvent.DOUBLE_CLICK])))) && (_local4.doubleClickEnabled))){
_lastEvent = new mouseEventEvent(MouseEvent.DOUBLE_CLICK, true, false, _local8.x, _local8.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local4.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastLocation = location.clone();
lastMouseDown = _mouseIsDown;
target = _local4;
}
public function getLocation():Point{
return (location.clone());
}
public function get x():Number{
return (location.x);
}
public function lock():void{
isLocked = true;
}
public function get useNativeEvents():Boolean{
return (_useNativeEvents);
}
public function setLocation(_arg1, _arg2=null):void{
var _local3:Point;
if ((_arg1 is Point)){
_local3 = (_arg1 as Point);
location.x = _local3.x;
location.y = _local3.y;
} else {
location.x = Number(_arg1);
location.y = Number(_arg2);
};
if (!isLocked){
update();
};
}
private function keyHandler(_arg1:KeyboardEvent):void{
altKey = _arg1.altKey;
ctrlKey = _arg1.ctrlKey;
shiftKey = _arg1.shiftKey;
}
public function unignore(_arg1:DisplayObject):void{
if ((_arg1 in ignoredInstances)){
delete ignoredInstances[_arg1];
};
}
public function doubleClick():void{
if (isLocked){
release();
} else {
click();
press();
isDoubleClickEvent = true;
release();
isDoubleClickEvent = false;
};
}
public function update():void{
dispatchEvent(new Event(UPDATE, false, false));
}
public function ignore(_arg1:DisplayObject):void{
ignoredInstances[_arg1] = true;
}
public function unlock():void{
isLocked = false;
update();
}
public function enableEvent(_arg1:String):void{
if ((_arg1 in disabledEvents)){
delete disabledEvents[_arg1];
};
}
public function press():void{
updateMouseDown = true;
_mouseIsDown = true;
if (!isLocked){
update();
};
}
public function set useNativeEvents(_arg1:Boolean):void{
if (_arg1 == _useNativeEvents){
return;
};
_useNativeEvents = _arg1;
if (_useNativeEvents){
eventEvent = VirtualMouseEvent;
mouseEventEvent = VirtualMouseMouseEvent;
} else {
eventEvent = Event;
mouseEventEvent = MouseEvent;
};
}
public function set y(_arg1:Number):void{
location.y = _arg1;
if (!isLocked){
update();
};
}
public function set stage(_arg1:Stage):void{
var _local2:Boolean;
if (_stage){
_local2 = true;
_stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
_stage.removeEventListener(KeyboardEvent.KEY_UP, keyHandler);
} else {
_local2 = false;
};
_stage = _arg1;
if (_stage){
_stage.addEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
_stage.addEventListener(KeyboardEvent.KEY_UP, keyHandler);
target = _stage;
if (!_local2){
update();
};
};
}
}
}//package org.papervision3d.core.utils.virtualmouse
Section 153
//VirtualMouseEvent (org.papervision3d.core.utils.virtualmouse.VirtualMouseEvent)
package org.papervision3d.core.utils.virtualmouse {
import flash.events.*;
public class VirtualMouseEvent extends Event implements IVirtualMouseEvent {
public function VirtualMouseEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package org.papervision3d.core.utils.virtualmouse
Section 154
//VirtualMouseMouseEvent (org.papervision3d.core.utils.virtualmouse.VirtualMouseMouseEvent)
package org.papervision3d.core.utils.virtualmouse {
import flash.events.*;
import flash.display.*;
public class VirtualMouseMouseEvent extends MouseEvent implements IVirtualMouseEvent {
public function VirtualMouseMouseEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Number=NaN, _arg5:Number=NaN, _arg6:InteractiveObject=null, _arg7:Boolean=false, _arg8:Boolean=false, _arg9:Boolean=false, _arg10:Boolean=false, _arg11:int=0){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11);
}
}
}//package org.papervision3d.core.utils.virtualmouse
Section 155
//InteractiveSceneManager (org.papervision3d.core.utils.InteractiveSceneManager)
package org.papervision3d.core.utils {
import flash.events.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.view.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.objects.*;
import flash.display.*;
import flash.geom.*;
import com.blitzagency.xray.logger.*;
import org.papervision3d.core.utils.virtualmouse.*;
import org.papervision3d.events.*;
import org.papervision3d.materials.*;
public class InteractiveSceneManager extends EventDispatcher {
public var container:Sprite;
public var currentDisplayObject3D:DisplayObject3D;
public var viewport:Viewport3D;
protected var log:XrayLog;
public var currentMaterial:MaterialObject3D;
public var debug:Boolean;// = false
public var mouse3D:Mouse3D;
public var enableOverOut:Boolean;// = true
public var virtualMouse:VirtualMouse;
public var renderHitData:RenderHitData;
public var currentMouseDO3D:DisplayObject3D;// = null
public static var MOUSE_IS_DOWN:Boolean = false;
public function InteractiveSceneManager(_arg1:Viewport3D){
virtualMouse = new VirtualMouse();
mouse3D = new Mouse3D();
enableOverOut = true;
currentMouseDO3D = null;
debug = false;
log = new XrayLog();
super();
this.viewport = _arg1;
this.container = _arg1.containerSprite;
init();
}
protected function initVirtualMouse():void{
virtualMouse.stage = container.stage;
virtualMouse.container = container;
}
public function init():void{
if (container){
if (container.stage){
initVirtualMouse();
initListeners();
} else {
container.addEventListener(Event.ADDED_TO_STAGE, handleAddedToStage);
};
};
}
public function initListeners():void{
var _local1:Boolean;
if (viewport.interactive){
container.addEventListener(MouseEvent.MOUSE_DOWN, handleMousePress);
container.addEventListener(MouseEvent.MOUSE_UP, handleMouseRelease);
container.addEventListener(MouseEvent.CLICK, handleMouseClick);
container.stage.addEventListener(MouseEvent.MOUSE_MOVE, handleMouseMove);
_local1 = true;
if (_local1){
container.stage.addEventListener(Event.ENTER_FRAME, handleEnterFrame);
};
};
}
public function updateRenderHitData():void{
resolveRenderHitData();
currentDisplayObject3D = renderHitData.displayObject3D;
currentMaterial = renderHitData.material;
manageOverOut();
}
protected function handleMouseClick(_arg1:MouseEvent):void{
if ((_arg1 is IVirtualMouseEvent)){
return;
};
if (((renderHitData) && (renderHitData.hasHit))){
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_CLICK, currentDisplayObject3D);
};
}
protected function handleMouseOut(_arg1:DisplayObject3D):void{
var _local2:MovieMaterial;
if (_arg1){
_local2 = (_arg1.material as MovieMaterial);
if (_local2){
virtualMouse.exitContainer();
};
};
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_OUT, _arg1);
}
protected function manageOverOut():void{
if (!enableOverOut){
return;
};
if (((renderHitData) && (renderHitData.hasHit))){
if (((!(currentMouseDO3D)) && (currentDisplayObject3D))){
handleMouseOver(currentDisplayObject3D);
currentMouseDO3D = currentDisplayObject3D;
} else {
if (((currentMouseDO3D) && (!((currentMouseDO3D == currentDisplayObject3D))))){
handleMouseOut(currentMouseDO3D);
handleMouseOver(currentDisplayObject3D);
currentMouseDO3D = currentDisplayObject3D;
};
};
} else {
if (currentMouseDO3D != null){
handleMouseOut(currentMouseDO3D);
currentMouseDO3D = null;
};
};
}
protected function handleEnterFrame(_arg1:Event):void{
var _local2:MovieMaterial;
if ((_arg1 is IVirtualMouseEvent)){
return;
};
if (((virtualMouse) && (renderHitData))){
_local2 = (currentMaterial as MovieMaterial);
if (_local2){
virtualMouse.container = (_local2.movie as Sprite);
};
if (virtualMouse.container){
virtualMouse.setLocation(renderHitData.u, renderHitData.v);
};
if (((((Mouse3D.enabled) && (renderHitData))) && (!((renderHitData.renderable == null))))){
mouse3D.updatePosition(renderHitData);
};
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_MOVE, currentDisplayObject3D);
} else {
if (((renderHitData) && (renderHitData.hasHit))){
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_MOVE, currentDisplayObject3D);
};
};
}
protected function dispatchObjectEvent(_arg1:String, _arg2:DisplayObject3D):void{
var _local3:Number;
var _local4:Number;
if (debug){
log.debug(_arg1, _arg2.name);
};
if (((renderHitData) && (renderHitData.hasHit))){
_local3 = (renderHitData.u) ? renderHitData.u : 0;
_local4 = (renderHitData.v) ? renderHitData.v : 0;
dispatchEvent(new InteractiveScene3DEvent(_arg1, _arg2, container, (renderHitData.renderable as Triangle3D), _local3, _local4));
_arg2.dispatchEvent(new InteractiveScene3DEvent(_arg1, _arg2, container, (renderHitData.renderable as Triangle3D), _local3, _local4));
} else {
dispatchEvent(new InteractiveScene3DEvent(_arg1, _arg2, container));
if (_arg2){
_arg2.dispatchEvent(new InteractiveScene3DEvent(_arg1, _arg2, container));
};
};
}
protected function handleMouseMove(_arg1:MouseEvent):void{
var _local2:MovieMaterial;
updateRenderHitData();
if ((_arg1 is IVirtualMouseEvent)){
return;
};
if (((virtualMouse) && (renderHitData))){
_local2 = (currentMaterial as MovieMaterial);
if (_local2){
virtualMouse.container = (_local2.movie as Sprite);
};
if (virtualMouse.container){
virtualMouse.setLocation(renderHitData.u, renderHitData.v);
};
if (((((Mouse3D.enabled) && (renderHitData))) && (renderHitData.hasHit))){
mouse3D.updatePosition(renderHitData);
};
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_MOVE, currentDisplayObject3D);
} else {
if (((renderHitData) && (renderHitData.hasHit))){
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_MOVE, currentDisplayObject3D);
};
};
}
protected function handleMouseOver(_arg1:DisplayObject3D):void{
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_OVER, _arg1);
}
protected function resolveRenderHitData():void{
var _local1:Point;
_local1 = new Point();
_local1.x = container.mouseX;
_local1.y = container.mouseY;
renderHitData = (viewport.hitTestPoint2D(_local1) as RenderHitData);
}
protected function handleMousePress(_arg1:MouseEvent):void{
if ((_arg1 is IVirtualMouseEvent)){
return;
};
MOUSE_IS_DOWN = true;
if (virtualMouse){
virtualMouse.press();
};
if (((((Mouse3D.enabled) && (renderHitData))) && (!((renderHitData.renderable == null))))){
mouse3D.updatePosition(renderHitData);
};
if (((renderHitData) && (renderHitData.hasHit))){
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_PRESS, currentDisplayObject3D);
};
}
protected function handleMouseRelease(_arg1:MouseEvent):void{
if ((_arg1 is IVirtualMouseEvent)){
return;
};
MOUSE_IS_DOWN = false;
if (virtualMouse){
virtualMouse.release();
};
if (((((Mouse3D.enabled) && (renderHitData))) && (!((renderHitData.renderable == null))))){
mouse3D.updatePosition(renderHitData);
};
if (((renderHitData) && (renderHitData.hasHit))){
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_RELEASE, currentDisplayObject3D);
};
}
protected function handleAddedToStage(_arg1:Event):void{
initVirtualMouse();
initListeners();
}
public function destroy():void{
viewport = null;
renderHitData = null;
currentDisplayObject3D = null;
currentMaterial = null;
currentMouseDO3D = null;
container.removeEventListener(MouseEvent.MOUSE_DOWN, handleMousePress);
container.removeEventListener(MouseEvent.MOUSE_UP, handleMouseRelease);
container.removeEventListener(MouseEvent.CLICK, handleMouseClick);
if (container.stage){
container.stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleMouseMove);
};
container = null;
}
}
}//package org.papervision3d.core.utils
Section 156
//Mouse3D (org.papervision3d.core.utils.Mouse3D)
package org.papervision3d.core.utils {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.objects.*;
public class Mouse3D extends DisplayObject3D {
private var position:Number3D;
private var target:Number3D;
public static var enabled:Boolean = false;
private static var UP:Number3D = new Number3D(0, 1, 0);
public function Mouse3D(_arg1:Object=null):void{
position = new Number3D(0, 0, 0);
target = new Number3D();
super();
}
public function updatePosition(_arg1:RenderHitData):void{
var _local2:Triangle3D;
var _local3:Number3D;
var _local4:Matrix3D;
var _local5:Number3D;
var _local6:Number3D;
var _local7:Matrix3D;
_local2 = (_arg1.renderable as Triangle3D);
target.x = _local2.faceNormal.x;
target.y = _local2.faceNormal.y;
target.z = _local2.faceNormal.z;
_local3 = Number3D.sub(target, position);
_local3.normalize();
if (_local3.modulo > 0.1){
_local5 = Number3D.cross(_local3, UP);
_local5.normalize();
_local6 = Number3D.cross(_local3, _local5);
_local6.normalize();
_local7 = this.transform;
_local7.n11 = _local5.x;
_local7.n21 = _local5.y;
_local7.n31 = _local5.z;
_local7.n12 = -(_local6.x);
_local7.n22 = -(_local6.y);
_local7.n32 = -(_local6.z);
_local7.n13 = _local3.x;
_local7.n23 = _local3.y;
_local7.n33 = _local3.z;
};
_local4 = Matrix3D.IDENTITY;
this.transform = Matrix3D.multiply(_local2.instance.world, _local7);
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
}
}
}//package org.papervision3d.core.utils
Section 157
//StopWatch (org.papervision3d.core.utils.StopWatch)
package org.papervision3d.core.utils {
import flash.events.*;
import flash.utils.*;
public class StopWatch extends EventDispatcher {
private var startTime:int;
private var elapsedTime:int;
private var stopTime:int;
private var isRunning:Boolean;
public function stop():int{
if (isRunning){
stopTime = getTimer();
elapsedTime = (stopTime - startTime);
isRunning = false;
return (elapsedTime);
};
return (0);
}
public function start():void{
if (!isRunning){
startTime = getTimer();
isRunning = true;
};
}
public function reset():void{
isRunning = false;
}
}
}//package org.papervision3d.core.utils
Section 158
//IViewport3D (org.papervision3d.core.view.IViewport3D)
package org.papervision3d.core.view {
import org.papervision3d.core.render.data.*;
public interface IViewport3D {
function updateAfterRender(_arg1:RenderSessionData):void;
function updateBeforeRender(_arg1:RenderSessionData):void;
}
}//package org.papervision3d.core.view
Section 159
//InteractiveScene3DEvent (org.papervision3d.events.InteractiveScene3DEvent)
package org.papervision3d.events {
import flash.events.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.objects.*;
import flash.display.*;
public class InteractiveScene3DEvent extends Event {
public var sprite:Sprite;// = null
public var displayObject3D:DisplayObject3D;// = null
public var face3d:Triangle3D;// = null
public var renderHitData:RenderHitData;
public var x:Number;// = 0
public var y:Number;// = 0
public static const OBJECT_ADDED:String = "objectAdded";
public static const OBJECT_PRESS:String = "mousePress";
public static const OBJECT_RELEASE:String = "mouseRelease";
public static const OBJECT_CLICK:String = "mouseClick";
public static const OBJECT_RELEASE_OUTSIDE:String = "mouseReleaseOutside";
public static const OBJECT_OUT:String = "mouseOut";
public static const OBJECT_MOVE:String = "mouseMove";
public static const OBJECT_OVER:String = "mouseOver";
public function InteractiveScene3DEvent(_arg1:String, _arg2:DisplayObject3D=null, _arg3:Sprite=null, _arg4:Triangle3D=null, _arg5:Number=0, _arg6:Number=0, _arg7:RenderHitData=null, _arg8:Boolean=false, _arg9:Boolean=false){
displayObject3D = null;
sprite = null;
face3d = null;
x = 0;
y = 0;
super(_arg1, _arg8, _arg9);
this.displayObject3D = _arg2;
this.sprite = _arg3;
this.face3d = _arg4;
this.x = _arg5;
this.y = _arg6;
this.renderHitData = _arg7;
}
override public function toString():String{
return (((((((("Type : " + type) + ", DO3D : ") + displayObject3D) + " Sprite : ") + sprite) + " Face : ") + face3d));
}
}
}//package org.papervision3d.events
Section 160
//RendererEvent (org.papervision3d.events.RendererEvent)
package org.papervision3d.events {
import flash.events.*;
import org.papervision3d.core.render.data.*;
public class RendererEvent extends Event {
public var renderSessionData:RenderSessionData;
public static const PROJECTION_DONE:String = "projectionDone";
public static const RENDER_DONE:String = "renderDone";
public function RendererEvent(_arg1:String, _arg2:RenderSessionData){
super(_arg1);
this.renderSessionData = _arg2;
}
public function clear():void{
renderSessionData = null;
}
override public function clone():Event{
return (new RendererEvent(type, renderSessionData));
}
}
}//package org.papervision3d.events
Section 161
//LineMaterial (org.papervision3d.materials.special.LineMaterial)
package org.papervision3d.materials.special {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import org.papervision3d.core.render.draw.*;
public class LineMaterial extends MaterialObject3D implements ILineDrawer {
public function LineMaterial(_arg1:Number=0xFF0000, _arg2:Number=1){
this.lineColor = _arg1;
this.lineAlpha = _arg2;
}
public function drawLine(_arg1:Line3D, _arg2:Graphics, _arg3:RenderSessionData):void{
_arg2.lineStyle(_arg1.size, lineColor, lineAlpha);
_arg2.moveTo(_arg1.v0.vertex3DInstance.x, _arg1.v0.vertex3DInstance.y);
if (_arg1.cV){
_arg2.curveTo(_arg1.cV.vertex3DInstance.x, _arg1.cV.vertex3DInstance.y, _arg1.v1.vertex3DInstance.x, _arg1.v1.vertex3DInstance.y);
} else {
_arg2.lineTo(_arg1.v1.vertex3DInstance.x, _arg1.v1.vertex3DInstance.y);
};
_arg2.moveTo(0, 0);
_arg2.lineStyle();
}
}
}//package org.papervision3d.materials.special
Section 162
//ParticleMaterial (org.papervision3d.materials.special.ParticleMaterial)
package org.papervision3d.materials.special {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.render.draw.*;
public class ParticleMaterial extends MaterialObject3D implements IParticleDrawer {
public var shape:int;
public static var SHAPE_SQUARE:int = 0;
public static var SHAPE_CIRCLE:int = 1;
public function ParticleMaterial(_arg1:Number, _arg2:Number, _arg3:int=0){
this.shape = _arg3;
this.fillAlpha = _arg2;
this.fillColor = _arg1;
}
public function updateRenderRect(_arg1:Particle):void{
var _local2:Rectangle;
_local2 = _arg1.renderRect;
if (_arg1.size == 0){
_local2.width = 1;
_local2.height = 1;
} else {
_local2.width = (_arg1.renderScale * _arg1.size);
_local2.height = (_arg1.renderScale * _arg1.size);
};
_local2.x = (_arg1.vertex3D.vertex3DInstance.x - (_local2.width / 2));
_local2.y = (_arg1.vertex3D.vertex3DInstance.y - (_local2.width / 2));
}
public function drawParticle(_arg1:Particle, _arg2:Graphics, _arg3:RenderSessionData):void{
var _local4:Rectangle;
_arg2.beginFill(fillColor, fillAlpha);
_local4 = _arg1.renderRect;
if (shape == SHAPE_SQUARE){
_arg2.drawRect(_local4.x, _local4.y, _local4.width, _local4.height);
} else {
if (shape == SHAPE_CIRCLE){
_arg2.drawCircle((_local4.x + (_local4.width / 2)), (_local4.y + (_local4.width / 2)), (_local4.width / 2));
//unresolved jump
};
};
_arg2.endFill();
_arg3.renderStatistics.particles++;
}
}
}//package org.papervision3d.materials.special
Section 163
//MaterialsList (org.papervision3d.materials.utils.MaterialsList)
package org.papervision3d.materials.utils {
import org.papervision3d.core.proto.*;
import flash.utils.*;
public class MaterialsList {
protected var _materials:Dictionary;
public var materialsByName:Dictionary;
private var _materialsTotal:int;
public function MaterialsList(_arg1=null):void{
var _local2:String;
var _local3:String;
super();
this.materialsByName = new Dictionary(true);
this._materials = new Dictionary(false);
this._materialsTotal = 0;
if (_arg1){
if ((_arg1 is Array)){
for (_local2 in _arg1) {
this.addMaterial(_arg1[_local2]);
};
} else {
if ((_arg1 is Object)){
for (_local3 in _arg1) {
this.addMaterial(_arg1[_local3], _local3);
};
};
};
};
}
public function get numMaterials():int{
return (_materialsTotal);
}
public function addMaterial(_arg1:MaterialObject3D, _arg2:String=null):MaterialObject3D{
_arg2 = ((((_arg2) || (_arg1.name))) || (String(_arg1.id)));
this._materials[_arg1] = _arg2;
this.materialsByName[_arg2] = _arg1;
this._materialsTotal++;
return (_arg1);
}
public function removeMaterial(_arg1:MaterialObject3D):MaterialObject3D{
delete this.materialsByName[this._materials[_arg1]];
delete this._materials[_arg1];
return (_arg1);
}
public function toString():String{
var _local1:String;
var _local2:MaterialObject3D;
_local1 = "";
for each (_local2 in this.materialsByName) {
_local1 = (_local1 + (this._materials[_local2] + "\n"));
};
return (_local1);
}
public function removeMaterialByName(_arg1:String):MaterialObject3D{
return (removeMaterial(getMaterialByName(_arg1)));
}
public function clone():MaterialsList{
var _local1:MaterialsList;
var _local2:MaterialObject3D;
_local1 = new MaterialsList();
for each (_local2 in this.materialsByName) {
_local1.addMaterial(_local2.clone(), this._materials[_local2]);
};
return (_local1);
}
public function getMaterialByName(_arg1:String):MaterialObject3D{
return ((this.materialsByName[_arg1]) ? this.materialsByName[_arg1] : this.materialsByName["all"]);
}
}
}//package org.papervision3d.materials.utils
Section 164
//RenderRecStorage (org.papervision3d.materials.utils.RenderRecStorage)
package org.papervision3d.materials.utils {
import org.papervision3d.core.geom.renderables.*;
import flash.geom.*;
public class RenderRecStorage {
public var mat:Matrix;
public var v0:Vertex3DInstance;
public var v1:Vertex3DInstance;
public var v2:Vertex3DInstance;
public function RenderRecStorage(){
v0 = new Vertex3DInstance();
v1 = new Vertex3DInstance();
v2 = new Vertex3DInstance();
mat = new Matrix();
super();
}
}
}//package org.papervision3d.materials.utils
Section 165
//BitmapMaterial (org.papervision3d.materials.BitmapMaterial)
package org.papervision3d.materials {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import org.papervision3d.*;
import org.papervision3d.core.render.draw.*;
import org.papervision3d.core.math.util.*;
import org.papervision3d.core.material.*;
public class BitmapMaterial extends TriangleMaterial implements ITriangleDrawer {
protected var renderRecStorage:Array;
protected var mabz:Number;
protected var dcay:Number;
protected var dsab:Number;
protected var tempTriangleMatrix:Matrix;
protected var dsbc:Number;
private var b2:Number;
protected var _precise:Boolean;
protected var faz:Number;
public var uvMatrices:Dictionary;
protected var dsca:Number;
protected var ax:Number;
protected var az:Number;
protected var ay:Number;
protected var mcay:Number;
protected var bx:Number;
protected var by:Number;
protected var fbz:Number;
protected var fcz:Number;
public var minimumRenderSize:Number;// = 4
protected var bz:Number;
private var c2:Number;
protected var mcax:Number;
protected var dbcx:Number;
protected var cx:Number;
protected var cy:Number;
protected var cz:Number;
private var d2:Number;
protected var mcaz:Number;
protected var dbcy:Number;
protected var dabx:Number;
protected var _perPixelPrecision:int;// = 8
protected var daby:Number;
private var x0:Number;
private var x1:Number;
private var x2:Number;
protected var mbcy:Number;
protected var mbcz:Number;
private var y0:Number;
private var y1:Number;
private var y2:Number;
protected var _texture:Object;
protected var focus:Number;// = 200
protected var maby:Number;
protected var mabx:Number;
protected var dcax:Number;
protected var mbcx:Number;
private var a2:Number;
protected var _precision:int;// = 8
protected static const DEFAULT_FOCUS:Number = 200;
protected static var _triMatrix:Matrix = new Matrix();
protected static var _triMap:Matrix;
public static var AUTO_MIP_MAPPING:Boolean = false;
public static var MIP_MAP_DEPTH:Number = 8;
protected static var hitRect:Rectangle = new Rectangle();
protected static var _localMatrix:Matrix = new Matrix();
public function BitmapMaterial(_arg1:BitmapData=null, _arg2:Boolean=false){
focus = 200;
_precision = 8;
_perPixelPrecision = 8;
minimumRenderSize = 4;
uvMatrices = new Dictionary();
tempTriangleMatrix = new Matrix();
super();
if (_arg1){
texture = _arg1;
};
this.precise = _arg2;
createRenderRecStorage();
}
public function transformUV(_arg1:Triangle3D):Matrix{
var _local2:Array;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Matrix;
var _local16:Matrix;
if (!_arg1.uv){
Papervision3D.log("MaterialObject3D: transformUV() uv not found!");
} else {
if (bitmap){
_local2 = _arg1.uv;
_local3 = (bitmap.width * maxU);
_local4 = (bitmap.height * maxV);
_local5 = (_local3 * _arg1.uv0.u);
_local6 = (_local4 * (1 - _arg1.uv0.v));
_local7 = (_local3 * _arg1.uv1.u);
_local8 = (_local4 * (1 - _arg1.uv1.v));
_local9 = (_local3 * _arg1.uv2.u);
_local10 = (_local4 * (1 - _arg1.uv2.v));
if ((((((_local5 == _local7)) && ((_local6 == _local8)))) || ((((_local5 == _local9)) && ((_local6 == _local10)))))){
_local5 = (_local5 - ((_local5)>0.05) ? 0.05 : -0.05);
_local6 = (_local6 - ((_local6)>0.07) ? 0.07 : -0.07);
};
if ((((_local9 == _local7)) && ((_local10 == _local8)))){
_local9 = (_local9 - ((_local9)>0.05) ? 0.04 : -0.04);
_local10 = (_local10 - ((_local10)>0.06) ? 0.06 : -0.06);
};
_local11 = (_local7 - _local5);
_local12 = (_local8 - _local6);
_local13 = (_local9 - _local5);
_local14 = (_local10 - _local6);
_local15 = new Matrix(_local11, _local12, _local13, _local14, _local5, _local6);
_local15.invert();
_local16 = (uvMatrices[_arg1]) ? uvMatrices[_arg1] : uvMatrices[_arg1] = _local15.clone();
_local16.a = _local15.a;
_local16.b = _local15.b;
_local16.c = _local15.c;
_local16.d = _local15.d;
_local16.tx = _local15.tx;
_local16.ty = _local15.ty;
} else {
Papervision3D.log("MaterialObject3D: transformUV() material.bitmap not found!");
};
};
return (_local16);
}
protected function renderRec(_arg1:Graphics, _arg2:Matrix, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance, _arg5:Vertex3DInstance, _arg6:Number, _arg7:RenderSessionData, _arg8:BitmapData):void{
var _local9:int;
var _local10:RenderRecStorage;
var _local11:Matrix;
var _local12:Number;
az = _arg3.z;
bz = _arg4.z;
cz = _arg5.z;
if ((((((az <= 0)) && ((bz <= 0)))) && ((cz <= 0)))){
return;
};
cx = _arg5.x;
cy = _arg5.y;
bx = _arg4.x;
by = _arg4.y;
ax = _arg3.x;
ay = _arg3.y;
if (_arg7.viewPort.cullingRectangle){
hitRect.x = Math.min(cx, Math.min(bx, ax));
hitRect.width = (Math.max(cx, Math.max(bx, ax)) + Math.abs(hitRect.x));
hitRect.y = Math.min(cy, Math.min(by, ay));
hitRect.height = (Math.max(cy, Math.max(by, ay)) + Math.abs(hitRect.y));
if (!FastRectangleTools.intersects(hitRect, _arg7.viewPort.cullingRectangle)){
return;
};
};
if ((((((((_arg6 >= 100)) || ((hitRect.width < minimumRenderSize)))) || ((hitRect.height < minimumRenderSize)))) || ((focus == Infinity)))){
renderTriangleBitmap(_arg1, _arg2, _arg3, _arg4, _arg5, smooth, tiled, _arg8);
_arg7.renderStatistics.triangles++;
return;
};
faz = (focus + az);
fbz = (focus + bz);
fcz = (focus + cz);
mabz = (2 / (faz + fbz));
mbcz = (2 / (fbz + fcz));
mcaz = (2 / (fcz + faz));
mabx = (((ax * faz) + (bx * fbz)) * mabz);
maby = (((ay * faz) + (by * fbz)) * mabz);
mbcx = (((bx * fbz) + (cx * fcz)) * mbcz);
mbcy = (((by * fbz) + (cy * fcz)) * mbcz);
mcax = (((cx * fcz) + (ax * faz)) * mcaz);
mcay = (((cy * fcz) + (ay * faz)) * mcaz);
dabx = ((ax + bx) - mabx);
daby = ((ay + by) - maby);
dbcx = ((bx + cx) - mbcx);
dbcy = ((by + cy) - mbcy);
dcax = ((cx + ax) - mcax);
dcay = ((cy + ay) - mcay);
dsab = ((dabx * dabx) + (daby * daby));
dsbc = ((dbcx * dbcx) + (dbcy * dbcy));
dsca = ((dcax * dcax) + (dcay * dcay));
_local9 = (_arg6 + 1);
_local10 = RenderRecStorage(renderRecStorage[int(_arg6)]);
_local11 = _local10.mat;
if ((((((dsab <= _precision)) && ((dsca <= _precision)))) && ((dsbc <= _precision)))){
renderTriangleBitmap(_arg1, _arg2, _arg3, _arg4, _arg5, smooth, tiled, _arg8);
_arg7.renderStatistics.triangles++;
return;
};
if ((((((dsab > _precision)) && ((dsca > _precision)))) && ((dsbc > _precision)))){
_local11.a = (_arg2.a * 2);
_local11.b = (_arg2.b * 2);
_local11.c = (_arg2.c * 2);
_local11.d = (_arg2.d * 2);
_local11.tx = (_arg2.tx * 2);
_local11.ty = (_arg2.ty * 2);
_local10.v0.x = (mabx * 0.5);
_local10.v0.y = (maby * 0.5);
_local10.v0.z = ((az + bz) * 0.5);
_local10.v1.x = (mbcx * 0.5);
_local10.v1.y = (mbcy * 0.5);
_local10.v1.z = ((bz + cz) * 0.5);
_local10.v2.x = (mcax * 0.5);
_local10.v2.y = (mcay * 0.5);
_local10.v2.z = ((cz + az) * 0.5);
renderRec(_arg1, _local11, _arg3, _local10.v0, _local10.v2, _local9, _arg7, _arg8);
_local11.tx = (_local11.tx - 1);
renderRec(_arg1, _local11, _local10.v0, _arg4, _local10.v1, _local9, _arg7, _arg8);
_local11.ty = (_local11.ty - 1);
_local11.tx = (_arg2.tx * 2);
renderRec(_arg1, _local11, _local10.v2, _local10.v1, _arg5, _local9, _arg7, _arg8);
_local11.a = (-(_arg2.a) * 2);
_local11.b = (-(_arg2.b) * 2);
_local11.c = (-(_arg2.c) * 2);
_local11.d = (-(_arg2.d) * 2);
_local11.tx = ((-(_arg2.tx) * 2) + 1);
_local11.ty = ((-(_arg2.ty) * 2) + 1);
renderRec(_arg1, _local11, _local10.v1, _local10.v2, _local10.v0, _local9, _arg7, _arg8);
return;
};
_local12 = Math.max(dsab, Math.max(dsca, dsbc));
if (dsab == _local12){
_local11.a = (_arg2.a * 2);
_local11.b = _arg2.b;
_local11.c = (_arg2.c * 2);
_local11.d = _arg2.d;
_local11.tx = (_arg2.tx * 2);
_local11.ty = _arg2.ty;
_local10.v0.x = (mabx * 0.5);
_local10.v0.y = (maby * 0.5);
_local10.v0.z = ((az + bz) * 0.5);
renderRec(_arg1, _local11, _arg3, _local10.v0, _arg5, _local9, _arg7, _arg8);
_local11.a = ((_arg2.a * 2) + _arg2.b);
_local11.c = ((2 * _arg2.c) + _arg2.d);
_local11.tx = (((_arg2.tx * 2) + _arg2.ty) - 1);
renderRec(_arg1, _local11, _local10.v0, _arg4, _arg5, _local9, _arg7, _arg8);
return;
};
if (dsca == _local12){
_local11.a = _arg2.a;
_local11.b = (_arg2.b * 2);
_local11.c = _arg2.c;
_local11.d = (_arg2.d * 2);
_local11.tx = _arg2.tx;
_local11.ty = (_arg2.ty * 2);
_local10.v2.x = (mcax * 0.5);
_local10.v2.y = (mcay * 0.5);
_local10.v2.z = ((cz + az) * 0.5);
renderRec(_arg1, _local11, _arg3, _arg4, _local10.v2, _local9, _arg7, _arg8);
_local11.b = (_local11.b + _arg2.a);
_local11.d = (_local11.d + _arg2.c);
_local11.ty = (_local11.ty + (_arg2.tx - 1));
renderRec(_arg1, _local11, _local10.v2, _arg4, _arg5, _local9, _arg7, _arg8);
return;
};
_local11.a = (_arg2.a - _arg2.b);
_local11.b = (_arg2.b * 2);
_local11.c = (_arg2.c - _arg2.d);
_local11.d = (_arg2.d * 2);
_local11.tx = (_arg2.tx - _arg2.ty);
_local11.ty = (_arg2.ty * 2);
_local10.v1.x = (mbcx * 0.5);
_local10.v1.y = (mbcy * 0.5);
_local10.v1.z = ((bz + cz) * 0.5);
renderRec(_arg1, _local11, _arg3, _arg4, _local10.v1, _local9, _arg7, _arg8);
_local11.a = (_arg2.a * 2);
_local11.b = (_arg2.b - _arg2.a);
_local11.c = (_arg2.c * 2);
_local11.d = (_arg2.d - _arg2.c);
_local11.tx = (_arg2.tx * 2);
_local11.ty = (_arg2.ty - _arg2.tx);
renderRec(_arg1, _local11, _arg3, _local10.v1, _arg5, _local9, _arg7, _arg8);
}
protected function createRenderRecStorage():void{
var _local1:int;
this.renderRecStorage = new Array();
_local1 = 0;
while (_local1 <= 100) {
this.renderRecStorage[_local1] = new RenderRecStorage();
_local1++;
};
}
public function resetUVS():void{
uvMatrices = new Dictionary(false);
}
public function get texture():Object{
return (this._texture);
}
public function set pixelPrecision(_arg1:int):void{
_precision = ((_arg1 * _arg1) * 1.4);
_perPixelPrecision = _arg1;
}
protected function correctBitmap(_arg1:BitmapData):BitmapData{
var _local2:BitmapData;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Boolean;
_local3 = (1 << MIP_MAP_DEPTH);
_local4 = (_arg1.width / _local3);
_local4 = ((_local4 == uint(_local4))) ? _local4 : (uint(_local4) + 1);
_local5 = (_arg1.height / _local3);
_local5 = ((_local5 == uint(_local5))) ? _local5 : (uint(_local5) + 1);
_local6 = (_local3 * _local4);
_local7 = (_local3 * _local5);
_local8 = true;
if (_local6 > 2880){
_local6 = _arg1.width;
_local8 = false;
};
if (_local7 > 2880){
_local7 = _arg1.height;
_local8 = false;
};
if (!_local8){
Papervision3D.log((("Material " + this.name) + ": Texture too big for mip mapping. Resizing recommended for better performance and quality."));
};
if (((_arg1) && (((!(((_arg1.width % _local3) == 0))) || (!(((_arg1.height % _local3) == 0))))))){
_local2 = new BitmapData(_local6, _local7, _arg1.transparent, 0);
widthOffset = _arg1.width;
heightOffset = _arg1.height;
this.maxU = (_arg1.width / _local6);
this.maxV = (_arg1.height / _local7);
_local2.draw(_arg1);
extendBitmapEdges(_local2, _arg1.width, _arg1.height);
} else {
this.maxU = (this.maxV = 1);
_local2 = _arg1;
};
return (_local2);
}
protected function createBitmap(_arg1:BitmapData):BitmapData{
resetMapping();
if (AUTO_MIP_MAPPING){
return (correctBitmap(_arg1));
};
this.maxU = (this.maxV = 1);
return (_arg1);
}
public function get precise():Boolean{
return (_precise);
}
override public function clone():MaterialObject3D{
var _local1:MaterialObject3D;
_local1 = super.clone();
_local1.maxU = this.maxU;
_local1.maxV = this.maxV;
return (_local1);
}
public function set texture(_arg1:Object):void{
if ((_arg1 is BitmapData) == false){
Papervision3D.log("Error: BitmapMaterial.texture requires a BitmapData object for the texture");
return;
};
bitmap = createBitmap(BitmapData(_arg1));
_texture = _arg1;
}
override public function toString():String{
return (((((("Texture:" + this.texture) + " lineColor:") + this.lineColor) + " lineAlpha:") + this.lineAlpha));
}
override public function copy(_arg1:MaterialObject3D):void{
super.copy(_arg1);
this.maxU = _arg1.maxU;
this.maxV = _arg1.maxV;
}
override public function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void{
if (!_precise){
if (lineAlpha){
_arg2.lineStyle(lineThickness, lineColor, lineAlpha);
};
if (bitmap){
_triMap = (_arg5) ? _arg5 : ((uvMatrices[_arg1]) || (transformUV(_arg1)));
x0 = _arg1.v0.vertex3DInstance.x;
y0 = _arg1.v0.vertex3DInstance.y;
x1 = _arg1.v1.vertex3DInstance.x;
y1 = _arg1.v1.vertex3DInstance.y;
x2 = _arg1.v2.vertex3DInstance.x;
y2 = _arg1.v2.vertex3DInstance.y;
_triMatrix.a = (x1 - x0);
_triMatrix.b = (y1 - y0);
_triMatrix.c = (x2 - x0);
_triMatrix.d = (y2 - y0);
_triMatrix.tx = x0;
_triMatrix.ty = y0;
_localMatrix.a = _triMap.a;
_localMatrix.b = _triMap.b;
_localMatrix.c = _triMap.c;
_localMatrix.d = _triMap.d;
_localMatrix.tx = _triMap.tx;
_localMatrix.ty = _triMap.ty;
_localMatrix.concat(_triMatrix);
_arg2.beginBitmapFill((_arg4) ? _arg4 : bitmap, _localMatrix, tiled, smooth);
};
_arg2.moveTo(x0, y0);
_arg2.lineTo(x1, y1);
_arg2.lineTo(x2, y2);
_arg2.lineTo(x0, y0);
if (bitmap){
_arg2.endFill();
};
if (lineAlpha){
_arg2.lineStyle();
};
_arg3.renderStatistics.triangles++;
} else {
_triMap = (_arg5) ? _arg5 : ((uvMatrices[_arg1]) || (transformUV(_arg1)));
focus = _arg3.camera.focus;
renderRec(_arg2, _triMap, _arg1.v0.vertex3DInstance, _arg1.v1.vertex3DInstance, _arg1.v2.vertex3DInstance, 0, _arg3, (_arg4) ? _arg4 : bitmap);
};
}
public function resetMapping():void{
uvMatrices = new Dictionary();
}
public function get precision():int{
return (_precision);
}
public function get pixelPrecision():int{
return (_perPixelPrecision);
}
public function renderTriangleBitmap(_arg1:Graphics, _arg2:Matrix, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance, _arg5:Vertex3DInstance, _arg6:Boolean, _arg7:Boolean, _arg8:BitmapData):void{
a2 = (_arg4.x - _arg3.x);
b2 = (_arg4.y - _arg3.y);
c2 = (_arg5.x - _arg3.x);
d2 = (_arg5.y - _arg3.y);
tempTriangleMatrix.a = ((_arg2.a * a2) + (_arg2.b * c2));
tempTriangleMatrix.b = ((_arg2.a * b2) + (_arg2.b * d2));
tempTriangleMatrix.c = ((_arg2.c * a2) + (_arg2.d * c2));
tempTriangleMatrix.d = ((_arg2.c * b2) + (_arg2.d * d2));
tempTriangleMatrix.tx = (((_arg2.tx * a2) + (_arg2.ty * c2)) + _arg3.x);
tempTriangleMatrix.ty = (((_arg2.tx * b2) + (_arg2.ty * d2)) + _arg3.y);
_arg1.beginBitmapFill(_arg8, tempTriangleMatrix, _arg7, _arg6);
_arg1.moveTo(_arg3.x, _arg3.y);
_arg1.lineTo(_arg4.x, _arg4.y);
_arg1.lineTo(_arg5.x, _arg5.y);
_arg1.endFill();
}
public function set precise(_arg1:Boolean):void{
_precise = _arg1;
}
protected function extendBitmapEdges(_arg1:BitmapData, _arg2:Number, _arg3:Number):void{
var _local4:Rectangle;
var _local5:Point;
var _local6:int;
_local4 = new Rectangle();
_local5 = new Point();
if (_arg1.width > _arg2){
_local4.x = (_arg2 - 1);
_local4.y = 0;
_local4.width = 1;
_local4.height = _arg3;
_local5.y = 0;
_local6 = _arg2;
while (_local6 < _arg1.width) {
_local5.x = _local6;
_arg1.copyPixels(_arg1, _local4, _local5);
_local6++;
};
};
if (_arg1.height > _arg3){
_local4.x = 0;
_local4.y = (_arg3 - 1);
_local4.width = _arg1.width;
_local4.height = 1;
_local5.x = 0;
_local6 = _arg3;
while (_local6 < _arg1.height) {
_local5.y = _local6;
_arg1.copyPixels(_arg1, _local4, _local5);
_local6++;
};
};
}
override public function destroy():void{
super.destroy();
if (uvMatrices){
uvMatrices = null;
};
if (bitmap){
bitmap.dispose();
};
this.renderRecStorage = null;
}
public function set precision(_arg1:int):void{
_precision = _arg1;
}
}
}//package org.papervision3d.materials
Section 166
//MovieMaterial (org.papervision3d.materials.MovieMaterial)
package org.papervision3d.materials {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.render.material.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.*;
import org.papervision3d.core.render.draw.*;
public class MovieMaterial extends BitmapMaterial implements ITriangleDrawer, IUpdateBeforeMaterial {
private var _animated:Boolean;
public var movieTransparent:Boolean;
public var movie:DisplayObject;
public var allowAutoResize:Boolean;// = true
public function MovieMaterial(_arg1:DisplayObject=null, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Boolean=false){
allowAutoResize = true;
super();
movieTransparent = _arg2;
this.animated = _arg3;
this.interactive = interactive;
this.precise = _arg4;
if (_arg1){
texture = _arg1;
};
}
override public function get texture():Object{
return (this._texture);
}
public function set animated(_arg1:Boolean):void{
_animated = _arg1;
}
override public function set texture(_arg1:Object):void{
if ((_arg1 is DisplayObject) == false){
Papervision3D.log("Error: MovieMaterial.texture requires a Sprite to be passed as the object");
return;
};
bitmap = createBitmapFromSprite(DisplayObject(_arg1));
_texture = _arg1;
}
protected function initBitmap(_arg1:DisplayObject):void{
if (bitmap){
bitmap.dispose();
};
if ((((_arg1.width == 0)) || ((_arg1.height == 0)))){
bitmap = new BitmapData(0x0100, 0x0100, movieTransparent, fillColor);
} else {
bitmap = new BitmapData(_arg1.width, _arg1.height, this.movieTransparent);
};
}
public function updateBeforeRender(_arg1:RenderSessionData):void{
var _local2:int;
var _local3:int;
var _local4:Boolean;
if (_animated){
_local2 = int(movie.width);
_local3 = int(movie.height);
if (((allowAutoResize) && (((!((_local2 == bitmap.width))) || (!((_local3 == bitmap.height))))))){
initBitmap(movie);
_local4 = true;
};
drawBitmap();
if (_local4){
bitmap = super.createBitmap(bitmap);
};
};
}
public function get animated():Boolean{
return (_animated);
}
public function drawBitmap():void{
var _local1:Matrix;
bitmap.fillRect(bitmap.rect, this.fillColor);
_local1 = new Matrix();
_local1.scale(movie.scaleX, movie.scaleY);
bitmap.draw(movie, _local1, movie.transform.colorTransform);
}
protected function createBitmapFromSprite(_arg1:DisplayObject):BitmapData{
movie = _arg1;
initBitmap(movie);
drawBitmap();
bitmap = super.createBitmap(bitmap);
return (bitmap);
}
}
}//package org.papervision3d.materials
Section 167
//WireframeMaterial (org.papervision3d.materials.WireframeMaterial)
package org.papervision3d.materials {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.render.draw.*;
import org.papervision3d.core.material.*;
public class WireframeMaterial extends TriangleMaterial implements ITriangleDrawer {
public function WireframeMaterial(_arg1:Number=0xFF00FF, _arg2:Number=100, _arg3:Number=0){
this.lineColor = _arg1;
this.lineAlpha = _arg2;
this.lineThickness = _arg3;
this.doubleSided = false;
}
override public function toString():String{
return (((("WireframeMaterial - color:" + this.lineColor) + " alpha:") + this.lineAlpha));
}
override public function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void{
var _local6:Number;
var _local7:Number;
_local6 = _arg1.v0.vertex3DInstance.x;
_local7 = _arg1.v0.vertex3DInstance.y;
if (lineAlpha){
_arg2.lineStyle(lineThickness, lineColor, lineAlpha);
_arg2.moveTo(_local6, _local7);
_arg2.lineTo(_arg1.v1.vertex3DInstance.x, _arg1.v1.vertex3DInstance.y);
_arg2.lineTo(_arg1.v2.vertex3DInstance.x, _arg1.v2.vertex3DInstance.y);
_arg2.lineTo(_local6, _local7);
_arg2.lineStyle();
_arg3.renderStatistics.triangles++;
};
}
}
}//package org.papervision3d.materials
Section 168
//Cube (org.papervision3d.objects.primitives.Cube)
package org.papervision3d.objects.primitives {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.math.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.*;
public class Cube extends TriangleMesh3D {
private var insideFaces:int;
public var segments:Number3D;
private var excludeFaces:int;
public static var ALL:int = (((((FRONT + BACK) + RIGHT) + LEFT) + TOP) + BOTTOM);
public static var LEFT:int = 8;
public static var FRONT:int = 1;
public static var BOTTOM:int = 32;
public static var TOP:int = 16;
public static var BACK:int = 2;
public static var NONE:int = 0;
public static var RIGHT:int = 4;
public function Cube(_arg1:MaterialsList, _arg2:Number=500, _arg3:Number=500, _arg4:Number=500, _arg5:int=1, _arg6:int=1, _arg7:int=1, _arg8:int=0, _arg9:int=0, _arg10:Object=null){
super(_arg1.getMaterialByName("all"), new Array(), new Array(), null, _arg10);
this.materials = _arg1;
this.insideFaces = _arg8;
this.excludeFaces = _arg9;
segments = new Number3D(_arg5, _arg6, _arg7);
buildCube(_arg2, _arg4, _arg3);
}
private function buildPlane(_arg1:String, _arg2:String, _arg3:String, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false):void{
var _local8:MaterialObject3D;
var _local9:String;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Array;
var _local16:Array;
var _local17:Array;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:int;
var _local23:NumberUV;
var _local24:NumberUV;
var _local25:NumberUV;
var _local26:int;
var _local27:Vertex3D;
var _local28:Vertex3D;
var _local29:Vertex3D;
var _local30:Vertex3D;
_local8 = materials.getMaterialByName(_arg1);
if (!_local8){
_local8 = materials.getMaterialByName("all");
if (!_local8){
Papervision3D.log("Cube: Required material not found in given materials list. Supported materials are: front, back, right, left, top, bottom & all.");
return;
};
};
if ((((((_arg2 == "x")) && ((_arg3 == "y")))) || ((((_arg2 == "y")) && ((_arg3 == "x")))))){
_local9 = "z";
} else {
if ((((((_arg2 == "x")) && ((_arg3 == "z")))) || ((((_arg2 == "z")) && ((_arg3 == "x")))))){
_local9 = "y";
} else {
if ((((((_arg2 == "z")) && ((_arg3 == "y")))) || ((((_arg2 == "y")) && ((_arg3 == "z")))))){
_local9 = "x";
};
};
};
_local10 = (_arg7) ? -1 : 1;
_local11 = this.segments[_arg2];
_local12 = this.segments[_arg3];
_local13 = (_local11 + 1);
_local14 = (_local12 + 1);
_local15 = this.geometry.vertices;
_local16 = this.geometry.faces;
_local17 = new Array();
_local18 = (_arg4 / 2);
_local19 = (_arg5 / 2);
_local20 = (_arg4 / _local11);
_local21 = (_arg5 / _local12);
_local22 = 0;
while (_local22 < _local13) {
_local26 = 0;
while (_local26 < _local14) {
_local27 = new Vertex3D();
_local27[_arg2] = (((_local22 * _local20) - _local18) * _local10);
_local27[_arg3] = ((_local26 * _local21) - _local19);
_local27[_local9] = _arg6;
_local15.push(_local27);
_local17.push(_local27);
_local26++;
};
_local22++;
};
_local22 = 0;
while (_local22 < _local11) {
_local26 = 0;
while (_local26 < _local12) {
_local28 = _local17[((_local22 * _local14) + _local26)];
_local29 = _local17[((_local22 * _local14) + (_local26 + 1))];
_local30 = _local17[(((_local22 + 1) * _local14) + _local26)];
_local23 = new NumberUV((_local22 / _local11), (_local26 / _local12));
_local24 = new NumberUV((_local22 / _local11), ((_local26 + 1) / _local12));
_local25 = new NumberUV(((_local22 + 1) / _local11), (_local26 / _local12));
_local16.push(new Triangle3D(this, [_local28, _local30, _local29], _local8, [_local23, _local25, _local24]));
_local28 = _local17[(((_local22 + 1) * _local14) + (_local26 + 1))];
_local29 = _local17[(((_local22 + 1) * _local14) + _local26)];
_local30 = _local17[((_local22 * _local14) + (_local26 + 1))];
_local23 = new NumberUV(((_local22 + 1) / _local11), ((_local26 + 1) / _local12));
_local24 = new NumberUV(((_local22 + 1) / _local11), (_local26 / _local12));
_local25 = new NumberUV((_local22 / _local11), ((_local26 + 1) / _local12));
_local16.push(new Triangle3D(this, [_local29, _local28, _local30], _local8, [_local24, _local23, _local25]));
_local26++;
};
_local22++;
};
}
private function buildCube(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local4 = (_arg1 / 2);
_local5 = (_arg2 / 2);
_local6 = (_arg3 / 2);
if (!(excludeFaces & FRONT)){
buildPlane("front", "x", "y", _arg1, _arg2, _local6, !(Boolean((insideFaces & FRONT))));
};
if (!(excludeFaces & BACK)){
buildPlane("back", "x", "y", _arg1, _arg2, -(_local6), Boolean((insideFaces & BACK)));
};
if (!(excludeFaces & RIGHT)){
buildPlane("right", "z", "y", _arg3, _arg2, _local4, Boolean((insideFaces & RIGHT)));
};
if (!(excludeFaces & LEFT)){
buildPlane("left", "z", "y", _arg3, _arg2, -(_local4), !(Boolean((insideFaces & LEFT))));
};
if (!(excludeFaces & TOP)){
buildPlane("top", "x", "z", _arg1, _arg3, _local5, Boolean((insideFaces & TOP)));
};
if (!(excludeFaces & BOTTOM)){
buildPlane("bottom", "x", "z", _arg1, _arg3, -(_local5), !(Boolean((insideFaces & BOTTOM))));
};
mergeVertices();
this.geometry.ready = true;
}
}
}//package org.papervision3d.objects.primitives
Section 169
//Plane (org.papervision3d.objects.primitives.Plane)
package org.papervision3d.objects.primitives {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.geom.*;
public class Plane extends TriangleMesh3D {
public var segmentsH:Number;
public var segmentsW:Number;
public static var DEFAULT_SCALE:Number = 1;
public static var DEFAULT_SEGMENTS:Number = 1;
public static var DEFAULT_SIZE:Number = 500;
public function Plane(_arg1:MaterialObject3D=null, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Object=null){
var _local7:Number;
super(_arg1, new Array(), new Array(), null, _arg6);
this.segmentsW = ((_arg4) || (DEFAULT_SEGMENTS));
this.segmentsH = ((_arg5) || (this.segmentsW));
_local7 = DEFAULT_SCALE;
if (!_arg3){
if (_arg2){
_local7 = _arg2;
};
if (((_arg1) && (_arg1.bitmap))){
_arg2 = (_arg1.bitmap.width * _local7);
_arg3 = (_arg1.bitmap.height * _local7);
} else {
_arg2 = (DEFAULT_SIZE * _local7);
_arg3 = (DEFAULT_SIZE * _local7);
};
};
buildPlane(_arg2, _arg3);
}
private function buildPlane(_arg1:Number, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Array;
var _local8:Array;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:int;
var _local14:NumberUV;
var _local15:NumberUV;
var _local16:NumberUV;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:Vertex3D;
var _local21:Vertex3D;
var _local22:Vertex3D;
_local3 = this.segmentsW;
_local4 = this.segmentsH;
_local5 = (_local3 + 1);
_local6 = (_local4 + 1);
_local7 = this.geometry.vertices;
_local8 = this.geometry.faces;
_local9 = (_arg1 / 2);
_local10 = (_arg2 / 2);
_local11 = (_arg1 / _local3);
_local12 = (_arg2 / _local4);
_local13 = 0;
while (_local13 < (_local3 + 1)) {
_local17 = 0;
while (_local17 < _local6) {
_local18 = ((_local13 * _local11) - _local9);
_local19 = ((_local17 * _local12) - _local10);
_local7.push(new Vertex3D(_local18, _local19, 0));
_local17++;
};
_local13++;
};
_local13 = 0;
while (_local13 < _local3) {
_local17 = 0;
while (_local17 < _local4) {
_local20 = _local7[((_local13 * _local6) + _local17)];
_local21 = _local7[((_local13 * _local6) + (_local17 + 1))];
_local22 = _local7[(((_local13 + 1) * _local6) + _local17)];
_local14 = new NumberUV((_local13 / _local3), (_local17 / _local4));
_local15 = new NumberUV((_local13 / _local3), ((_local17 + 1) / _local4));
_local16 = new NumberUV(((_local13 + 1) / _local3), (_local17 / _local4));
_local8.push(new Triangle3D(this, [_local20, _local22, _local21], material, [_local14, _local16, _local15]));
_local20 = _local7[(((_local13 + 1) * _local6) + (_local17 + 1))];
_local21 = _local7[(((_local13 + 1) * _local6) + _local17)];
_local22 = _local7[((_local13 * _local6) + (_local17 + 1))];
_local14 = new NumberUV(((_local13 + 1) / _local3), ((_local17 + 1) / _local4));
_local15 = new NumberUV(((_local13 + 1) / _local3), (_local17 / _local4));
_local16 = new NumberUV((_local13 / _local3), ((_local17 + 1) / _local4));
_local8.push(new Triangle3D(this, [_local20, _local22, _local21], material, [_local14, _local16, _local15]));
_local17++;
};
_local13++;
};
this.geometry.ready = true;
}
}
}//package org.papervision3d.objects.primitives
Section 170
//DisplayObject3D (org.papervision3d.objects.DisplayObject3D)
package org.papervision3d.objects {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.math.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.core.data.*;
import org.papervision3d.view.layer.*;
import org.papervision3d.core.culling.*;
import org.papervision3d.*;
import org.papervision3d.core.ns.*;
public class DisplayObject3D extends DisplayObjectContainer3D {
public var extra:Object;
public var frustumTestMethod:int;// = 0
private var _rotationX:Number;
private var _rotationY:Number;
private var _rotationZ:Number;
private var position:Number3D;
public var meshSort:uint;// = 1
public var materials:MaterialsList;
public var id:int;
private var xAxis:Number3D;
private var zAxis:Number3D;
private var _scaleDirty:Boolean;// = false
private var _numClones:uint;// = 0
private var _scaleX:Number;
private var _scaleY:Number;
private var _scaleZ:Number;
public var screen:Number3D;
protected var _userData:UserData;
public var screenZ:Number;
protected var _useOwnContainer:Boolean;
public var transform:Matrix3D;
protected var _containerSortMode:int;
public var name:String;
private var target:Number3D;
public var world:Matrix3D;
private var _material:MaterialObject3D;
public var culled:Boolean;
public var visible:Boolean;
public var parent:DisplayObjectContainer3D;
public var geometry:GeometryObject3D;
public var view:Matrix3D;
protected var _scene:SceneObject3D;// = null
protected var _containerBlendMode:int;
public var faces:Array;
private var yAxis:Number3D;
protected var _filters:Array;
private var _rotation:Number3D;
protected var _sorted:Array;
protected var _transformDirty:Boolean;// = false
private var _rotationDirty:Boolean;// = false
private static const LEFT:Number3D = new Number3D(-1, 0, 0);
public static const MESH_SORT_CLOSE:uint = 3;
public static const MESH_SORT_CENTER:uint = 1;
private static const BACKWARD:Number3D = new Number3D(0, 0, -1);
private static const FORWARD:Number3D = new Number3D(0, 0, 1);
public static const MESH_SORT_FAR:uint = 2;
private static const DOWN:Number3D = new Number3D(0, -1, 0);
private static const UP:Number3D = new Number3D(0, 1, 0);
private static const RIGHT:Number3D = new Number3D(1, 0, 0);
private static var entry_count:uint = 0;
private static var _totalDisplayObjects:int = 0;
private static var _tempMatrix:Matrix3D = Matrix3D.IDENTITY;
public static var sortedArray:Array = new Array();
private static var _tempQuat:Quaternion = new Quaternion();
private static var toDEGREES:Number = 57.2957795130823;
public static var faceLevelMode:Boolean;
private static var toRADIANS:Number = 0.0174532925199433;
public function DisplayObject3D(_arg1:String=null, _arg2:GeometryObject3D=null, _arg3:Object=null):void{
var _local4:Number;
_transformDirty = false;
position = Number3D.ZERO;
target = Number3D.ZERO;
zAxis = Number3D.ZERO;
xAxis = Number3D.ZERO;
yAxis = Number3D.ZERO;
_rotation = Number3D.ZERO;
_rotationDirty = false;
_scaleDirty = false;
_numClones = 0;
frustumTestMethod = FrustumTestMethod.BOUNDING_SPHERE;
screen = new Number3D();
_scene = null;
meshSort = MESH_SORT_CENTER;
faces = new Array();
super();
if (_arg1 != null){
Papervision3D.log(("DisplayObject3D: " + _arg1));
};
this.culled = false;
this.transform = Matrix3D.IDENTITY;
this.world = Matrix3D.IDENTITY;
this.view = Matrix3D.IDENTITY;
if (_arg3 != null){
this.x = (_arg3.x) ? ((_arg3.x) || (0)) : 0;
this.y = (_arg3.y) ? ((_arg3.y) || (0)) : 0;
this.z = (_arg3.z) ? ((_arg3.z) || (0)) : 0;
};
rotationX = (_arg3) ? ((_arg3.rotationX) || (0)) : 0;
rotationY = (_arg3) ? ((_arg3.rotationY) || (0)) : 0;
rotationZ = (_arg3) ? ((_arg3.rotationZ) || (0)) : 0;
_local4 = (Papervision3D.usePERCENT) ? 100 : 1;
scaleX = (_arg3) ? ((_arg3.scaleX) || (_local4)) : _local4;
scaleY = (_arg3) ? ((_arg3.scaleY) || (_local4)) : _local4;
scaleZ = (_arg3) ? ((_arg3.scaleZ) || (_local4)) : _local4;
if (((_arg3) && (_arg3.extra))){
this.extra = _arg3.extra;
};
this.visible = true;
this.id = _totalDisplayObjects++;
this.name = ((_arg1) || (String(this.id)));
_numClones = 0;
if (_arg2){
addGeometry(_arg2);
};
}
public function get containerSortMode():int{
return (_containerSortMode);
}
public function set z(_arg1:Number):void{
this.transform.n34 = _arg1;
}
public function set containerSortMode(_arg1:int):void{
_containerSortMode = _arg1;
}
public function get filters():Array{
return (_filters);
}
public function moveDown(_arg1:Number):void{
translate(_arg1, DOWN);
}
public function set scene(_arg1:SceneObject3D):void{
var _local2:DisplayObject3D;
_scene = _arg1;
for each (_local2 in this._childrenByName) {
if (_local2.scene == null){
_local2.scene = _scene;
};
};
}
public function project(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{
var _local3:Number;
var _local4:Number;
var _local5:DisplayObject3D;
if (this._transformDirty){
updateTransform();
};
this.world.calculateMultiply(_arg1.world, this.transform);
if ((_arg2.camera is IObjectCuller)){
if (this === _arg2.camera){
this.culled = true;
} else {
this.culled = (IObjectCuller(_arg2.camera).testObject(this) < 0);
};
if (this.culled){
_arg2.renderStatistics.culledObjects++;
return (0);
};
if (_arg1 !== _arg2.camera){
this.view.calculateMultiply4x4(_arg1.view, this.transform);
};
} else {
if (_arg1 !== _arg2.camera){
this.view.calculateMultiply(_arg1.view, this.transform);
};
};
_local3 = 0;
_local4 = 0;
if (_useOwnContainer){
};
for each (_local5 in this._childrenByName) {
if (_local5.visible){
_local3 = (_local3 + _local5.project(this, _arg2));
_local4++;
};
};
return ((this.screenZ = (_local3 / _local4)));
}
public function set containerBlendMode(_arg1:int):void{
_containerBlendMode = _arg1;
}
public function get material():MaterialObject3D{
return (_material);
}
pv3dview function setLayerForViewport(_arg1:ViewportLayer):void{
}
private function calculateScreenCoords(_arg1:CameraObject3D):void{
var _local2:Number;
_local2 = ((_arg1.focus * _arg1.zoom) / (_arg1.focus + view.n34));
screen.x = (view.n14 * _local2);
screen.y = (view.n24 * _local2);
screen.z = view.n34;
}
public function lookAt(_arg1:DisplayObject3D, _arg2:Number3D=null):void{
var _local3:Matrix3D;
position.reset(this.x, this.y, this.z);
target.reset(_arg1.x, _arg1.y, _arg1.z);
zAxis.copyFrom(target);
zAxis.minusEq(position);
zAxis.normalize();
if (zAxis.modulo > 0.1){
xAxis = Number3D.cross(zAxis, ((_arg2) || (UP)), xAxis);
xAxis.normalize();
yAxis = Number3D.cross(zAxis, xAxis, yAxis);
yAxis.normalize();
_local3 = this.transform;
_local3.n11 = (xAxis.x * _scaleX);
_local3.n21 = (xAxis.y * _scaleX);
_local3.n31 = (xAxis.z * _scaleX);
_local3.n12 = (-(yAxis.x) * _scaleY);
_local3.n22 = (-(yAxis.y) * _scaleY);
_local3.n32 = (-(yAxis.z) * _scaleY);
_local3.n13 = (zAxis.x * _scaleZ);
_local3.n23 = (zAxis.y * _scaleZ);
_local3.n33 = (zAxis.z * _scaleZ);
this._transformDirty = false;
this._rotationDirty = true;
//unresolved jump
};
}
public function set rotationX(_arg1:Number):void{
this._rotationX = (Papervision3D.useDEGREES) ? (-(_arg1) * toRADIANS) : -(_arg1);
this._transformDirty = true;
}
public function get containerBlendMode():int{
return (_containerBlendMode);
}
public function get userData():UserData{
return (_userData);
}
public function set rotationZ(_arg1:Number):void{
this._rotationZ = (Papervision3D.useDEGREES) ? (-(_arg1) * toRADIANS) : -(_arg1);
this._transformDirty = true;
}
public function set rotationY(_arg1:Number):void{
this._rotationY = (Papervision3D.useDEGREES) ? (-(_arg1) * toRADIANS) : -(_arg1);
this._transformDirty = true;
}
public function addGeometry(_arg1:GeometryObject3D=null):void{
if (_arg1){
this.geometry = _arg1;
};
}
public function get sceneX():Number{
return (this.world.n14);
}
public function get sceneY():Number{
return (this.world.n24);
}
public function get scaleY():Number{
if (Papervision3D.usePERCENT){
return ((this._scaleY * 100));
};
return (this._scaleY);
}
public function get scaleZ():Number{
if (Papervision3D.usePERCENT){
return ((this._scaleZ * 100));
};
return (this._scaleZ);
}
public function moveUp(_arg1:Number):void{
translate(_arg1, UP);
}
public function get scaleX():Number{
if (Papervision3D.usePERCENT){
return ((this._scaleX * 100));
};
return (this._scaleX);
}
public function distanceTo(_arg1:DisplayObject3D):Number{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = (this.x - _arg1.x);
_local3 = (this.y - _arg1.y);
_local4 = (this.z - _arg1.z);
return (Math.sqrt((((_local2 * _local2) + (_local3 * _local3)) + (_local4 * _local4))));
}
public function get scale():Number{
if ((((this._scaleX == this._scaleY)) && ((this._scaleX == this._scaleZ)))){
if (Papervision3D.usePERCENT){
return ((this._scaleX * 100));
};
return (this._scaleX);
//unresolved jump
};
return (NaN);
}
public function set userData(_arg1:UserData):void{
_userData = _arg1;
}
public function get sceneZ():Number{
return (this.world.n34);
}
private function updateRotation():void{
_rotation = Matrix3D.matrix2euler(this.transform, _rotation);
this._rotationX = (_rotation.x * toRADIANS);
this._rotationY = (_rotation.y * toRADIANS);
this._rotationZ = (_rotation.z * toRADIANS);
this._rotationDirty = false;
}
public function hitTestObject(_arg1:DisplayObject3D, _arg2:Number=1):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local3 = (this.x - _arg1.x);
_local4 = (this.y - _arg1.y);
_local5 = (this.z - _arg1.z);
_local6 = (((_local3 * _local3) + (_local4 * _local4)) + (_local5 * _local5));
_local7 = (this.geometry) ? this.geometry.boundingSphere.maxDistance : 0;
_local8 = (_arg1.geometry) ? _arg1.geometry.boundingSphere.maxDistance : 0;
_local7 = (_local7 * _arg2);
return (((_local7 + _local8) > _local6));
}
override public function toString():String{
return (((((((this.name + ": x:") + Math.round(this.x)) + " y:") + Math.round(this.y)) + " z:") + Math.round(this.z)));
}
public function set material(_arg1:MaterialObject3D):void{
if (_material){
_material.unregisterObject(this);
};
_material = _arg1;
_material.registerObject(this);
}
public function copyTransform(_arg1):void{
var _local2:Matrix3D;
var _local3:Matrix3D;
_local2 = this.transform;
_local3 = ((_arg1 is DisplayObject3D)) ? _arg1.transform : _arg1;
_local2.n11 = _local3.n11;
_local2.n12 = _local3.n12;
_local2.n13 = _local3.n13;
_local2.n14 = _local3.n14;
_local2.n21 = _local3.n21;
_local2.n22 = _local3.n22;
_local2.n23 = _local3.n23;
_local2.n24 = _local3.n24;
_local2.n31 = _local3.n31;
_local2.n32 = _local3.n32;
_local2.n33 = _local3.n33;
_local2.n34 = _local3.n34;
this._transformDirty = false;
this._rotationDirty = true;
}
public function get y():Number{
return (this.transform.n24);
}
public function get z():Number{
return (this.transform.n34);
}
public function roll(_arg1:Number):void{
var _local2:Number3D;
_arg1 = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1;
_local2 = FORWARD.clone();
if (this._transformDirty){
updateTransform();
};
Matrix3D.rotateAxis(transform, _local2);
_tempMatrix = Matrix3D.rotationMatrix(_local2.x, _local2.y, _local2.z, _arg1, _tempMatrix);
this.transform.calculateMultiply3x3(_tempMatrix, transform);
this._rotationDirty = true;
}
public function yaw(_arg1:Number):void{
var _local2:Number3D;
_arg1 = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1;
_local2 = UP.clone();
if (this._transformDirty){
updateTransform();
};
Matrix3D.rotateAxis(transform, _local2);
_tempMatrix = Matrix3D.rotationMatrix(_local2.x, _local2.y, _local2.z, _arg1, _tempMatrix);
this.transform.calculateMultiply3x3(_tempMatrix, transform);
this._rotationDirty = true;
}
public function get x():Number{
return (this.transform.n14);
}
public function moveLeft(_arg1:Number):void{
translate(_arg1, LEFT);
}
public function get scene():SceneObject3D{
return (_scene);
}
public function set useOwnContainer(_arg1:Boolean):void{
_useOwnContainer = _arg1;
}
public function set scale(_arg1:Number):void{
if (Papervision3D.usePERCENT){
_arg1 = (_arg1 / 100);
};
this._scaleX = (this._scaleY = (this._scaleZ = _arg1));
this._transformDirty = true;
}
public function clone():DisplayObject3D{
var _local1:String;
var _local2:DisplayObject3D;
var _local3:DisplayObject3D;
_local1 = ((this.name + "_") + _numClones++);
_local2 = new DisplayObject3D(_local1);
if (this.material){
_local2.material = this.material;
};
if (this.materials){
_local2.materials = this.materials.clone();
};
if (this.geometry){
_local2.geometry = this.geometry.clone(_local2);
_local2.geometry.ready = true;
};
_local2.copyTransform(this.transform);
for each (_local3 in this.children) {
_local2.addChild(_local3.clone());
};
return (_local2);
}
public function getMaterialByName(_arg1:String):MaterialObject3D{
var _local2:MaterialObject3D;
var _local3:DisplayObject3D;
_local2 = this.materials.getMaterialByName(_arg1);
if (_local2){
return (_local2);
};
for each (_local3 in this._childrenByName) {
_local2 = _local3.getMaterialByName(_arg1);
if (_local2){
return (_local2);
};
};
return (null);
}
public function get rotationY():Number{
if (this._rotationDirty){
updateRotation();
};
return ((Papervision3D.useDEGREES) ? (-(this._rotationY) * toDEGREES) : -(this._rotationY));
}
public function get rotationZ():Number{
if (this._rotationDirty){
updateRotation();
};
return ((Papervision3D.useDEGREES) ? (-(this._rotationZ) * toDEGREES) : -(this._rotationZ));
}
public function set scaleY(_arg1:Number):void{
if (Papervision3D.usePERCENT){
this._scaleY = (_arg1 / 100);
} else {
this._scaleY = _arg1;
};
this._transformDirty = true;
}
public function set scaleZ(_arg1:Number):void{
if (Papervision3D.usePERCENT){
this._scaleZ = (_arg1 / 100);
} else {
this._scaleZ = _arg1;
};
this._transformDirty = true;
}
public function get rotationX():Number{
if (this._rotationDirty){
updateRotation();
};
return ((Papervision3D.useDEGREES) ? (-(this._rotationX) * toDEGREES) : -(this._rotationX));
}
public function translate(_arg1:Number, _arg2:Number3D):void{
var _local3:Number3D;
_local3 = _arg2.clone();
if (this._transformDirty){
updateTransform();
};
Matrix3D.rotateAxis(transform, _local3);
this.x = (this.x + (_arg1 * _local3.x));
this.y = (this.y + (_arg1 * _local3.y));
this.z = (this.z + (_arg1 * _local3.z));
}
public function set scaleX(_arg1:Number):void{
if (Papervision3D.usePERCENT){
this._scaleX = (_arg1 / 100);
} else {
this._scaleX = _arg1;
};
this._transformDirty = true;
}
public function pitch(_arg1:Number):void{
var _local2:Number3D;
_arg1 = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1;
_local2 = RIGHT.clone();
if (this._transformDirty){
updateTransform();
};
Matrix3D.rotateAxis(transform, _local2);
_tempMatrix = Matrix3D.rotationMatrix(_local2.x, _local2.y, _local2.z, _arg1, _tempMatrix);
this.transform.calculateMultiply3x3(_tempMatrix, transform);
this._rotationDirty = true;
}
public function moveForward(_arg1:Number):void{
translate(_arg1, FORWARD);
}
protected function updateTransform():void{
var _local1:Matrix3D;
_tempQuat = Matrix3D.euler2quaternion(-(this._rotationY), -(this._rotationZ), this._rotationX, _tempQuat);
_tempMatrix = Matrix3D.quaternion2matrix(_tempQuat.x, _tempQuat.y, _tempQuat.z, _tempQuat.w, _tempMatrix);
_local1 = this.transform;
_tempMatrix.n14 = _local1.n14;
_tempMatrix.n24 = _local1.n24;
_tempMatrix.n34 = _local1.n34;
_local1.copy(_tempMatrix);
_tempMatrix.reset();
_tempMatrix.n11 = this._scaleX;
_tempMatrix.n22 = this._scaleY;
_tempMatrix.n33 = this._scaleZ;
this.transform.calculateMultiply(_local1, _tempMatrix);
this._transformDirty = false;
}
public function copyPosition(_arg1):void{
var _local2:Matrix3D;
var _local3:Matrix3D;
_local2 = this.transform;
_local3 = ((_arg1 is DisplayObject3D)) ? _arg1.transform : _arg1;
_local2.n14 = _local3.n14;
_local2.n24 = _local3.n24;
_local2.n34 = _local3.n34;
}
public function get useOwnContainer():Boolean{
return (_useOwnContainer);
}
public function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = (this.x - _arg1);
_local5 = (this.y - _arg2);
_local6 = (this.z - _arg3);
_local7 = (((_local4 * _local4) + (_local5 * _local5)) + (_local6 * _local6));
_local8 = (this.geometry) ? this.geometry.boundingSphere.maxDistance : 0;
return ((_local8 > _local7));
}
public function moveRight(_arg1:Number):void{
translate(_arg1, RIGHT);
}
public function moveBackward(_arg1:Number):void{
translate(_arg1, BACKWARD);
}
public function set x(_arg1:Number):void{
this.transform.n14 = _arg1;
}
public function materialsList():String{
var _local1:String;
var _local2:String;
var _local3:DisplayObject3D;
_local1 = "";
for (_local2 in this.materials) {
_local1 = (_local1 + (_local2 + "\n"));
};
for each (_local3 in this._childrenByName) {
for (_local2 in _local3.materials.materialsByName) {
_local1 = (_local1 + (("+ " + _local2) + "\n"));
};
};
return (_local1);
}
public function set y(_arg1:Number):void{
this.transform.n24 = _arg1;
}
public function set filters(_arg1:Array):void{
_filters = _arg1;
}
override public function addChild(_arg1:DisplayObject3D, _arg2:String=null):DisplayObject3D{
_arg1 = super.addChild(_arg1, _arg2);
if (_arg1.scene == null){
_arg1.scene = scene;
};
return (_arg1);
}
public static function get ZERO():DisplayObject3D{
return (new (DisplayObject3D));
}
}
}//package org.papervision3d.objects
Section 171
//BasicRenderEngine (org.papervision3d.render.BasicRenderEngine)
package org.papervision3d.render {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.view.*;
import org.papervision3d.core.render.command.*;
import org.papervision3d.core.render.material.*;
import flash.geom.*;
import org.papervision3d.core.render.*;
import org.papervision3d.core.render.sort.*;
import org.papervision3d.core.render.project.*;
import org.papervision3d.core.render.filter.*;
import org.papervision3d.events.*;
import org.papervision3d.core.utils.*;
public class BasicRenderEngine extends AbstractRenderEngine implements IRenderEngine {
public var sorter:IRenderSorter;
public var projectionPipeline:ProjectionPipeline;
protected var renderStatistics:RenderStatistics;
protected var renderDoneEvent:RendererEvent;
protected var renderList:Array;
protected var renderSessionData:RenderSessionData;
protected var stopWatch:StopWatch;
protected var projectionDoneEvent:RendererEvent;
public var filter:IRenderFilter;
protected var cleanRHD:RenderHitData;
public function BasicRenderEngine():void{
cleanRHD = new RenderHitData();
super();
init();
}
override public function removeFromRenderList(_arg1:IRenderListItem):int{
return (renderList.splice(renderList.indexOf(_arg1), 1));
}
protected function doRender(_arg1:RenderSessionData):RenderStatistics{
var _local2:IRenderListItem;
stopWatch.reset();
stopWatch.start();
MaterialManager.getInstance().updateMaterialsBeforeRender(_arg1);
filter.filter(renderList);
sorter.sort(renderList);
while ((_local2 = renderList.pop())) {
_local2.render(_arg1);
_arg1.viewPort.lastRenderList.push(_local2);
};
MaterialManager.getInstance().updateMaterialsAfterRender(_arg1);
_arg1.renderStatistics.renderTime = stopWatch.stop();
_arg1.viewPort.updateAfterRender(_arg1);
return (renderStatistics);
}
protected function init():void{
renderStatistics = new RenderStatistics();
projectionPipeline = new BasicProjectionPipeline();
stopWatch = new StopWatch();
sorter = new BasicRenderSorter();
filter = new BasicRenderFilter();
renderList = new Array();
renderSessionData = new RenderSessionData();
renderSessionData.renderer = this;
projectionDoneEvent = new RendererEvent(RendererEvent.PROJECTION_DONE, renderSessionData);
renderDoneEvent = new RendererEvent(RendererEvent.RENDER_DONE, renderSessionData);
}
override public function renderScene(_arg1:SceneObject3D, _arg2:CameraObject3D, _arg3:Viewport3D, _arg4:Boolean=true):RenderStatistics{
renderSessionData.scene = _arg1;
renderSessionData.camera = _arg2;
renderSessionData.viewPort = _arg3;
renderSessionData.container = _arg3.containerSprite;
renderSessionData.triangleCuller = _arg3.triangleCuller;
renderSessionData.particleCuller = _arg3.particleCuller;
renderSessionData.renderStatistics.clear();
_arg3.updateBeforeRender(renderSessionData);
projectionPipeline.project(renderSessionData);
if (hasEventListener(RendererEvent.PROJECTION_DONE)){
dispatchEvent(projectionDoneEvent);
};
doRender(renderSessionData);
if (hasEventListener(RendererEvent.RENDER_DONE)){
dispatchEvent(renderDoneEvent);
};
return (renderSessionData.renderStatistics);
}
public function hitTestPoint2D(_arg1:Point, _arg2:Viewport3D):RenderHitData{
return (_arg2.hitTestPoint2D(_arg1));
}
override public function addToRenderList(_arg1:IRenderListItem):int{
return (renderList.push(_arg1));
}
public function destroy():void{
renderDoneEvent = null;
projectionDoneEvent = null;
projectionPipeline = null;
sorter = null;
filter = null;
renderStatistics = null;
renderList = null;
renderSessionData.destroy();
renderSessionData = null;
cleanRHD = null;
stopWatch = null;
}
}
}//package org.papervision3d.render
Section 172
//Scene3D (org.papervision3d.scenes.Scene3D)
package org.papervision3d.scenes {
import org.papervision3d.core.proto.*;
public class Scene3D extends SceneObject3D {
}
}//package org.papervision3d.scenes
Section 173
//ViewportBaseLayer (org.papervision3d.view.layer.ViewportBaseLayer)
package org.papervision3d.view.layer {
import org.papervision3d.view.*;
public class ViewportBaseLayer extends ViewportLayer {
public function ViewportBaseLayer(_arg1:Viewport3D){
super(_arg1, null);
}
}
}//package org.papervision3d.view.layer
Section 174
//ViewportLayer (org.papervision3d.view.layer.ViewportLayer)
package org.papervision3d.view.layer {
import org.papervision3d.view.*;
import org.papervision3d.objects.*;
import flash.display.*;
import org.papervision3d.core.ns.*;
public class ViewportLayer extends Sprite {
private var childLayers:Array;
protected var _displayObject3D:DisplayObject3D;
protected var viewport:Viewport3D;
public function ViewportLayer(_arg1:Viewport3D, _arg2:DisplayObject3D){
this.viewport = _arg1;
this.displayObject3D = _arg2;
init();
}
private function init():void{
childLayers = new Array();
}
pv3dview function getChildLayerFor(_arg1:DisplayObject3D):ViewportLayer{
var _local2:ViewportLayer;
if (_arg1){
_local2 = new ViewportLayer(viewport, _arg1);
addChild(_local2);
return (_local2);
};
return (null);
}
pv3dview function clear():void{
var _local1:ViewportLayer;
for each (_local1 in childLayers) {
_local1.clear();
removeChild(_local1);
};
graphics.clear();
}
public function set displayObject3D(_arg1:DisplayObject3D):void{
_displayObject3D = _arg1;
}
public function get displayObject3D():DisplayObject3D{
return (_displayObject3D);
}
}
}//package org.papervision3d.view.layer
Section 175
//Viewport3D (org.papervision3d.view.Viewport3D)
package org.papervision3d.view {
import flash.events.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.render.command.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.view.layer.*;
import org.papervision3d.core.culling.*;
import org.papervision3d.core.render.*;
import org.papervision3d.core.view.*;
import org.papervision3d.core.utils.*;
public class Viewport3D extends Sprite implements IViewport3D {
protected var _interactive:Boolean;
public var cullingRectangle:Rectangle;
protected var _viewportObjectFilter:ViewportObjectFilter;
protected var _hWidth:Number;
protected var _autoScaleToStage:Boolean;
protected var _lastRenderer:IRenderEngine;
protected var _containerSprite:ViewportBaseLayer;
protected var _hHeight:Number;
public var sizeRectangle:Rectangle;
protected var renderHitData:RenderHitData;
protected var _autoClipping:Boolean;
protected var _height:Number;
public var interactiveSceneManager:InteractiveSceneManager;
public var lastRenderList:Array;
public var lineCuller:ILineCuller;
protected var _autoCulling:Boolean;
public var particleCuller:IParticleCuller;
protected var _width:Number;
public var triangleCuller:ITriangleCuller;
public function Viewport3D(_arg1:Number=640, _arg2:Number=480, _arg3:Boolean=false, _arg4:Boolean=false, _arg5:Boolean=true, _arg6:Boolean=true){
init();
this.interactive = _arg4;
this.viewportWidth = _arg1;
this.viewportHeight = _arg2;
this.autoClipping = _arg5;
this.autoCulling = _arg6;
this.autoScaleToStage = _arg3;
}
public function set autoCulling(_arg1:Boolean):void{
if (_arg1){
triangleCuller = new RectangleTriangleCuller(cullingRectangle);
particleCuller = new RectangleParticleCuller(cullingRectangle);
lineCuller = new RectangleLineCuller(cullingRectangle);
} else {
if (!_arg1){
triangleCuller = new DefaultTriangleCuller();
particleCuller = new DefaultParticleCuller();
lineCuller = new DefaultLineCuller();
};
};
_autoCulling = _arg1;
}
protected function onRemovedFromStage(_arg1:Event):void{
stage.removeEventListener(Event.RESIZE, onStageResize);
}
public function hitTestMouse():RenderHitData{
var _local1:Point;
_local1 = new Point(containerSprite.mouseX, containerSprite.mouseY);
return (hitTestPoint2D(_local1));
}
protected function init():void{
this.renderHitData = new RenderHitData();
lastRenderList = new Array();
sizeRectangle = new Rectangle();
cullingRectangle = new Rectangle();
_containerSprite = new ViewportBaseLayer(this);
addChild(_containerSprite);
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
}
protected function onStageResize(_arg1:Event=null):void{
if (_autoScaleToStage){
viewportWidth = stage.stageWidth;
viewportHeight = stage.stageHeight;
};
}
public function set autoClipping(_arg1:Boolean):void{
if (_arg1){
scrollRect = sizeRectangle;
} else {
scrollRect = null;
};
_autoClipping = _arg1;
}
public function updateAfterRender(_arg1:RenderSessionData):void{
if (interactive){
interactiveSceneManager.updateRenderHitData();
};
}
public function get viewportHeight():Number{
return (_height);
}
public function get autoCulling():Boolean{
return (_autoCulling);
}
public function hitTestPoint2D(_arg1:Point):RenderHitData{
var _local2:RenderableListItem;
var _local3:RenderHitData;
var _local4:IRenderListItem;
var _local5:uint;
renderHitData.clear();
if (interactive){
_local3 = renderHitData;
_local5 = lastRenderList.length;
while ((_local4 = lastRenderList[--_local5])) {
if ((_local4 is RenderableListItem)){
_local2 = (_local4 as RenderableListItem);
_local3 = _local2.hitTestPoint2D(_arg1, _local3);
if (_local3.hasHit){
return (_local3);
};
};
};
};
return (renderHitData);
}
public function updateBeforeRender(_arg1:RenderSessionData):void{
lastRenderList.length = 0;
_containerSprite.clear();
}
public function set viewportWidth(_arg1:Number):void{
_width = _arg1;
_hWidth = (_arg1 / 2);
containerSprite.x = _hWidth;
cullingRectangle.x = -(_hWidth);
cullingRectangle.width = _arg1;
sizeRectangle.width = _arg1;
if (_autoClipping){
scrollRect = sizeRectangle;
};
}
protected function onAddedToStage(_arg1:Event):void{
stage.addEventListener(Event.RESIZE, onStageResize);
onStageResize();
}
public function get containerSprite():ViewportLayer{
return (_containerSprite);
}
public function get viewportObjectFilter():ViewportObjectFilter{
return (_viewportObjectFilter);
}
public function get autoClipping():Boolean{
return (_autoClipping);
}
public function set viewportObjectFilter(_arg1:ViewportObjectFilter):void{
_viewportObjectFilter = _arg1;
}
public function get viewportWidth():Number{
return (_width);
}
public function set autoScaleToStage(_arg1:Boolean):void{
_autoScaleToStage = _arg1;
if (((_arg1) && (!((stage == null))))){
onStageResize();
};
}
public function set interactive(_arg1:Boolean):void{
if (_arg1 != _interactive){
if (((_interactive) && (interactiveSceneManager))){
interactiveSceneManager.destroy();
interactiveSceneManager = null;
};
_interactive = _arg1;
if (_arg1){
interactiveSceneManager = new InteractiveSceneManager(this);
};
};
}
public function set viewportHeight(_arg1:Number):void{
_height = _arg1;
_hHeight = (_arg1 / 2);
containerSprite.y = _hHeight;
cullingRectangle.y = -(_hHeight);
cullingRectangle.height = _arg1;
sizeRectangle.height = _arg1;
if (_autoClipping){
scrollRect = sizeRectangle;
};
}
public function get autoScaleToStage():Boolean{
return (_autoScaleToStage);
}
public function get interactive():Boolean{
return (_interactive);
}
public function destroy():void{
if (interactiveSceneManager){
interactiveSceneManager.destroy();
interactiveSceneManager = null;
};
lastRenderList = null;
}
}
}//package org.papervision3d.view
Section 176
//Papervision3D (org.papervision3d.Papervision3D)
package org.papervision3d {
public class Papervision3D {
public static var useDEGREES:Boolean = true;
public static var VERBOSE:Boolean = true;
public static var AUTHOR:String = "(c) 2006-2007 Copyright by Carlos Ulloa - | John Grden | Ralph Hauwert | Tim Knip | Andy Zupko";
public static var DATE:String = "24.03.08";
public static var NAME:String = "Papervision3D";
public static var VERSION:String = "Public Alpha 2.0 - Great White";
public static var usePERCENT:Boolean = false;
public static function log(_arg1:String):void{
if (Papervision3D.VERBOSE){
};
}
}
}//package org.papervision3d
Section 177
//glitchScreen_26 (tower_defense_fla.glitchScreen_26)
package tower_defense_fla {
import flash.display.*;
import com.baitcontent.*;
import flash.text.*;
public dynamic class glitchScreen_26 extends MovieClip {
public var playNormal:ReplayBt;
public var playHard:ReplayBt;
public var txt:TextField;
public var infoText:MovieClip;
public var pic:MovieClip;
public var skipGameButton:RewindButton;
}
}//package tower_defense_fla
Section 178
//infoText_28 (tower_defense_fla.infoText_28)
package tower_defense_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class infoText_28 extends MovieClip {
public function infoText_28(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package tower_defense_fla
Section 179
//levelHex_11 (tower_defense_fla.levelHex_11)
package tower_defense_fla {
import flash.display.*;
public dynamic class levelHex_11 extends MovieClip {
public var level1:MovieClip;
public var level2:MovieClip;
public var level4:MovieClip;
public var level5:MovieClip;
public var level6:MovieClip;
public var level7:MovieClip;
public var level9:MovieClip;
public var level3:MovieClip;
public var level8:MovieClip;
public var level13:MovieClip;
public var level14:MovieClip;
public var level15:MovieClip;
public var level16:MovieClip;
public var level19:MovieClip;
public var level17:MovieClip;
public var level11:MovieClip;
public var level18:MovieClip;
public var level10:MovieClip;
public var level12:MovieClip;
public var level20:MovieClip;
}
}//package tower_defense_fla
Section 180
//replayBt_inner_34 (tower_defense_fla.replayBt_inner_34)
package tower_defense_fla {
import flash.display.*;
import flash.text.*;
public dynamic class replayBt_inner_34 extends MovieClip {
public var txt:TextField;
}
}//package tower_defense_fla
Section 181
//StartButton_30 (tower_defense_fla.StartButton_30)
package tower_defense_fla {
import flash.display.*;
public dynamic class StartButton_30 extends MovieClip {
public var inner:MovieClip;
}
}//package tower_defense_fla
Section 182
//StartUp_31 (tower_defense_fla.StartUp_31)
package tower_defense_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class StartUp_31 extends MovieClip {
public function StartUp_31(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package tower_defense_fla
Section 183
//WinFailPics_27 (tower_defense_fla.WinFailPics_27)
package tower_defense_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.system.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class WinFailPics_27 extends MovieClip {
public function WinFailPics_27(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package tower_defense_fla
Section 184
//addTower (addTower)
package {
import flash.media.*;
public dynamic class addTower extends Sound {
}
}//package
Section 185
//Beam (Beam)
package {
import flash.display.*;
public dynamic class Beam extends BitmapData {
public function Beam(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 186
//BeamTexture (BeamTexture)
package {
import flash.display.*;
public dynamic class BeamTexture extends BitmapData {
public function BeamTexture(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 187
//blast10 (blast10)
package {
import flash.display.*;
public dynamic class blast10 extends BitmapData {
public function blast10(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 188
//blast11 (blast11)
package {
import flash.display.*;
public dynamic class blast11 extends BitmapData {
public function blast11(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 189
//blast12 (blast12)
package {
import flash.display.*;
public dynamic class blast12 extends BitmapData {
public function blast12(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 190
//blast13 (blast13)
package {
import flash.display.*;
public dynamic class blast13 extends BitmapData {
public function blast13(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 191
//blast14 (blast14)
package {
import flash.display.*;
public dynamic class blast14 extends BitmapData {
public function blast14(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 192
//blast15 (blast15)
package {
import flash.display.*;
public dynamic class blast15 extends BitmapData {
public function blast15(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 193
//blast16 (blast16)
package {
import flash.display.*;
public dynamic class blast16 extends BitmapData {
public function blast16(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 194
//blast17 (blast17)
package {
import flash.display.*;
public dynamic class blast17 extends BitmapData {
public function blast17(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 195
//blast18 (blast18)
package {
import flash.display.*;
public dynamic class blast18 extends BitmapData {
public function blast18(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 196
//blast19 (blast19)
package {
import flash.display.*;
public dynamic class blast19 extends BitmapData {
public function blast19(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 197
//blast2 (blast2)
package {
import flash.display.*;
public dynamic class blast2 extends BitmapData {
public function blast2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 198
//blast20 (blast20)
package {
import flash.display.*;
public dynamic class blast20 extends BitmapData {
public function blast20(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 199
//blast21 (blast21)
package {
import flash.display.*;
public dynamic class blast21 extends BitmapData {
public function blast21(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 200
//blast22 (blast22)
package {
import flash.display.*;
public dynamic class blast22 extends BitmapData {
public function blast22(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 201
//blast23 (blast23)
package {
import flash.display.*;
public dynamic class blast23 extends BitmapData {
public function blast23(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 202
//blast24 (blast24)
package {
import flash.display.*;
public dynamic class blast24 extends BitmapData {
public function blast24(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 203
//blast3 (blast3)
package {
import flash.display.*;
public dynamic class blast3 extends BitmapData {
public function blast3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 204
//blast4 (blast4)
package {
import flash.display.*;
public dynamic class blast4 extends BitmapData {
public function blast4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 205
//blast5 (blast5)
package {
import flash.display.*;
public dynamic class blast5 extends BitmapData {
public function blast5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 206
//blast6 (blast6)
package {
import flash.display.*;
public dynamic class blast6 extends BitmapData {
public function blast6(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 207
//blast7 (blast7)
package {
import flash.display.*;
public dynamic class blast7 extends BitmapData {
public function blast7(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 208
//blast8 (blast8)
package {
import flash.display.*;
public dynamic class blast8 extends BitmapData {
public function blast8(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 209
//blast9 (blast9)
package {
import flash.display.*;
public dynamic class blast9 extends BitmapData {
public function blast9(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 210
//BulletSprite (BulletSprite)
package {
import flash.display.*;
public dynamic class BulletSprite extends BitmapData {
public function BulletSprite(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 211
//buttonClick (buttonClick)
package {
import flash.media.*;
public dynamic class buttonClick extends Sound {
}
}//package
Section 212
//CloseFx (CloseFx)
package {
import flash.media.*;
public dynamic class CloseFx extends Sound {
}
}//package
Section 213
//DeadsphereGameOver (DeadsphereGameOver)
package {
import com.baitcontent.*;
public dynamic class DeadsphereGameOver extends GameOver {
}
}//package
Section 214
//denied (denied)
package {
import flash.media.*;
public dynamic class denied extends Sound {
}
}//package
Section 215
//dome (dome)
package {
import flash.display.*;
public dynamic class dome extends MovieClip {
}
}//package
Section 216
//E1f1 (E1f1)
package {
import flash.display.*;
public dynamic class E1f1 extends BitmapData {
public function E1f1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 217
//E1f10 (E1f10)
package {
import flash.display.*;
public dynamic class E1f10 extends BitmapData {
public function E1f10(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 218
//E1f11 (E1f11)
package {
import flash.display.*;
public dynamic class E1f11 extends BitmapData {
public function E1f11(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 219
//E1f12 (E1f12)
package {
import flash.display.*;
public dynamic class E1f12 extends BitmapData {
public function E1f12(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 220
//E1f13 (E1f13)
package {
import flash.display.*;
public dynamic class E1f13 extends BitmapData {
public function E1f13(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 221
//E1f14 (E1f14)
package {
import flash.display.*;
public dynamic class E1f14 extends BitmapData {
public function E1f14(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 222
//E1f15 (E1f15)
package {
import flash.display.*;
public dynamic class E1f15 extends BitmapData {
public function E1f15(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 223
//E1f2 (E1f2)
package {
import flash.display.*;
public dynamic class E1f2 extends BitmapData {
public function E1f2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 224
//E1f3 (E1f3)
package {
import flash.display.*;
public dynamic class E1f3 extends BitmapData {
public function E1f3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 225
//E1f4 (E1f4)
package {
import flash.display.*;
public dynamic class E1f4 extends BitmapData {
public function E1f4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 226
//E1f5 (E1f5)
package {
import flash.display.*;
public dynamic class E1f5 extends BitmapData {
public function E1f5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 227
//E1f6 (E1f6)
package {
import flash.display.*;
public dynamic class E1f6 extends BitmapData {
public function E1f6(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 228
//E1f7 (E1f7)
package {
import flash.display.*;
public dynamic class E1f7 extends BitmapData {
public function E1f7(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 229
//E1f8 (E1f8)
package {
import flash.display.*;
public dynamic class E1f8 extends BitmapData {
public function E1f8(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 230
//E1f9 (E1f9)
package {
import flash.display.*;
public dynamic class E1f9 extends BitmapData {
public function E1f9(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 231
//E2f1 (E2f1)
package {
import flash.display.*;
public dynamic class E2f1 extends BitmapData {
public function E2f1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 232
//E2f10 (E2f10)
package {
import flash.display.*;
public dynamic class E2f10 extends BitmapData {
public function E2f10(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 233
//E2f11 (E2f11)
package {
import flash.display.*;
public dynamic class E2f11 extends BitmapData {
public function E2f11(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 234
//E2f12 (E2f12)
package {
import flash.display.*;
public dynamic class E2f12 extends BitmapData {
public function E2f12(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 235
//E2f13 (E2f13)
package {
import flash.display.*;
public dynamic class E2f13 extends BitmapData {
public function E2f13(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 236
//E2f14 (E2f14)
package {
import flash.display.*;
public dynamic class E2f14 extends BitmapData {
public function E2f14(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 237
//E2f15 (E2f15)
package {
import flash.display.*;
public dynamic class E2f15 extends BitmapData {
public function E2f15(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 238
//E2f16 (E2f16)
package {
import flash.display.*;
public dynamic class E2f16 extends BitmapData {
public function E2f16(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 239
//E2f17 (E2f17)
package {
import flash.display.*;
public dynamic class E2f17 extends BitmapData {
public function E2f17(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 240
//E2f18 (E2f18)
package {
import flash.display.*;
public dynamic class E2f18 extends BitmapData {
public function E2f18(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 241
//E2f19 (E2f19)
package {
import flash.display.*;
public dynamic class E2f19 extends BitmapData {
public function E2f19(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 242
//E2f2 (E2f2)
package {
import flash.display.*;
public dynamic class E2f2 extends BitmapData {
public function E2f2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 243
//E2f20 (E2f20)
package {
import flash.display.*;
public dynamic class E2f20 extends BitmapData {
public function E2f20(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 244
//E2f21 (E2f21)
package {
import flash.display.*;
public dynamic class E2f21 extends BitmapData {
public function E2f21(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 245
//E2f22 (E2f22)
package {
import flash.display.*;
public dynamic class E2f22 extends BitmapData {
public function E2f22(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 246
//E2f23 (E2f23)
package {
import flash.display.*;
public dynamic class E2f23 extends BitmapData {
public function E2f23(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 247
//E2f24 (E2f24)
package {
import flash.display.*;
public dynamic class E2f24 extends BitmapData {
public function E2f24(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 248
//E2f25 (E2f25)
package {
import flash.display.*;
public dynamic class E2f25 extends BitmapData {
public function E2f25(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 249
//E2f26 (E2f26)
package {
import flash.display.*;
public dynamic class E2f26 extends BitmapData {
public function E2f26(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 250
//E2f27 (E2f27)
package {
import flash.display.*;
public dynamic class E2f27 extends BitmapData {
public function E2f27(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 251
//E2f28 (E2f28)
package {
import flash.display.*;
public dynamic class E2f28 extends BitmapData {
public function E2f28(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 252
//E2f29 (E2f29)
package {
import flash.display.*;
public dynamic class E2f29 extends BitmapData {
public function E2f29(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 253
//E2f3 (E2f3)
package {
import flash.display.*;
public dynamic class E2f3 extends BitmapData {
public function E2f3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 254
//E2f30 (E2f30)
package {
import flash.display.*;
public dynamic class E2f30 extends BitmapData {
public function E2f30(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 255
//E2f4 (E2f4)
package {
import flash.display.*;
public dynamic class E2f4 extends BitmapData {
public function E2f4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 256
//E2f5 (E2f5)
package {
import flash.display.*;
public dynamic class E2f5 extends BitmapData {
public function E2f5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 257
//E2f6 (E2f6)
package {
import flash.display.*;
public dynamic class E2f6 extends BitmapData {
public function E2f6(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 258
//E2f7 (E2f7)
package {
import flash.display.*;
public dynamic class E2f7 extends BitmapData {
public function E2f7(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 259
//E2f8 (E2f8)
package {
import flash.display.*;
public dynamic class E2f8 extends BitmapData {
public function E2f8(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 260
//E2f9 (E2f9)
package {
import flash.display.*;
public dynamic class E2f9 extends BitmapData {
public function E2f9(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 261
//E3f1 (E3f1)
package {
import flash.display.*;
public dynamic class E3f1 extends BitmapData {
public function E3f1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 262
//E3f10 (E3f10)
package {
import flash.display.*;
public dynamic class E3f10 extends BitmapData {
public function E3f10(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 263
//E3f11 (E3f11)
package {
import flash.display.*;
public dynamic class E3f11 extends BitmapData {
public function E3f11(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 264
//E3f12 (E3f12)
package {
import flash.display.*;
public dynamic class E3f12 extends BitmapData {
public function E3f12(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 265
//E3f13 (E3f13)
package {
import flash.display.*;
public dynamic class E3f13 extends BitmapData {
public function E3f13(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 266
//E3f14 (E3f14)
package {
import flash.display.*;
public dynamic class E3f14 extends BitmapData {
public function E3f14(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 267
//E3f15 (E3f15)
package {
import flash.display.*;
public dynamic class E3f15 extends BitmapData {
public function E3f15(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 268
//E3f2 (E3f2)
package {
import flash.display.*;
public dynamic class E3f2 extends BitmapData {
public function E3f2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 269
//E3f3 (E3f3)
package {
import flash.display.*;
public dynamic class E3f3 extends BitmapData {
public function E3f3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 270
//E3f4 (E3f4)
package {
import flash.display.*;
public dynamic class E3f4 extends BitmapData {
public function E3f4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 271
//E3f5 (E3f5)
package {
import flash.display.*;
public dynamic class E3f5 extends BitmapData {
public function E3f5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 272
//E3f6 (E3f6)
package {
import flash.display.*;
public dynamic class E3f6 extends BitmapData {
public function E3f6(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 273
//E3f7 (E3f7)
package {
import flash.display.*;
public dynamic class E3f7 extends BitmapData {
public function E3f7(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 274
//E3f8 (E3f8)
package {
import flash.display.*;
public dynamic class E3f8 extends BitmapData {
public function E3f8(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 275
//E3f9 (E3f9)
package {
import flash.display.*;
public dynamic class E3f9 extends BitmapData {
public function E3f9(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 276
//E4f1 (E4f1)
package {
import flash.display.*;
public dynamic class E4f1 extends BitmapData {
public function E4f1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 277
//E4f10 (E4f10)
package {
import flash.display.*;
public dynamic class E4f10 extends BitmapData {
public function E4f10(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 278
//E4f11 (E4f11)
package {
import flash.display.*;
public dynamic class E4f11 extends BitmapData {
public function E4f11(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 279
//E4f12 (E4f12)
package {
import flash.display.*;
public dynamic class E4f12 extends BitmapData {
public function E4f12(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 280
//E4f13 (E4f13)
package {
import flash.display.*;
public dynamic class E4f13 extends BitmapData {
public function E4f13(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 281
//E4f14 (E4f14)
package {
import flash.display.*;
public dynamic class E4f14 extends BitmapData {
public function E4f14(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 282
//E4f15 (E4f15)
package {
import flash.display.*;
public dynamic class E4f15 extends BitmapData {
public function E4f15(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 283
//E4f16 (E4f16)
package {
import flash.display.*;
public dynamic class E4f16 extends BitmapData {
public function E4f16(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 284
//E4f17 (E4f17)
package {
import flash.display.*;
public dynamic class E4f17 extends BitmapData {
public function E4f17(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 285
//E4f18 (E4f18)
package {
import flash.display.*;
public dynamic class E4f18 extends BitmapData {
public function E4f18(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 286
//E4f19 (E4f19)
package {
import flash.display.*;
public dynamic class E4f19 extends BitmapData {
public function E4f19(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 287
//E4f2 (E4f2)
package {
import flash.display.*;
public dynamic class E4f2 extends BitmapData {
public function E4f2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 288
//E4f20 (E4f20)
package {
import flash.display.*;
public dynamic class E4f20 extends BitmapData {
public function E4f20(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 289
//E4f21 (E4f21)
package {
import flash.display.*;
public dynamic class E4f21 extends BitmapData {
public function E4f21(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 290
//E4f22 (E4f22)
package {
import flash.display.*;
public dynamic class E4f22 extends BitmapData {
public function E4f22(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 291
//E4f23 (E4f23)
package {
import flash.display.*;
public dynamic class E4f23 extends BitmapData {
public function E4f23(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 292
//E4f24 (E4f24)
package {
import flash.display.*;
public dynamic class E4f24 extends BitmapData {
public function E4f24(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 293
//E4f25 (E4f25)
package {
import flash.display.*;
public dynamic class E4f25 extends BitmapData {
public function E4f25(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 294
//E4f26 (E4f26)
package {
import flash.display.*;
public dynamic class E4f26 extends BitmapData {
public function E4f26(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 295
//E4f27 (E4f27)
package {
import flash.display.*;
public dynamic class E4f27 extends BitmapData {
public function E4f27(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 296
//E4f28 (E4f28)
package {
import flash.display.*;
public dynamic class E4f28 extends BitmapData {
public function E4f28(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 297
//E4f29 (E4f29)
package {
import flash.display.*;
public dynamic class E4f29 extends BitmapData {
public function E4f29(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 298
//E4f3 (E4f3)
package {
import flash.display.*;
public dynamic class E4f3 extends BitmapData {
public function E4f3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 299
//E4f30 (E4f30)
package {
import flash.display.*;
public dynamic class E4f30 extends BitmapData {
public function E4f30(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 300
//E4f4 (E4f4)
package {
import flash.display.*;
public dynamic class E4f4 extends BitmapData {
public function E4f4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 301
//E4f5 (E4f5)
package {
import flash.display.*;
public dynamic class E4f5 extends BitmapData {
public function E4f5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 302
//E4f6 (E4f6)
package {
import flash.display.*;
public dynamic class E4f6 extends BitmapData {
public function E4f6(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 303
//E4f7 (E4f7)
package {
import flash.display.*;
public dynamic class E4f7 extends BitmapData {
public function E4f7(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 304
//E4f8 (E4f8)
package {
import flash.display.*;
public dynamic class E4f8 extends BitmapData {
public function E4f8(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 305
//E4f9 (E4f9)
package {
import flash.display.*;
public dynamic class E4f9 extends BitmapData {
public function E4f9(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 306
//E5f1 (E5f1)
package {
import flash.display.*;
public dynamic class E5f1 extends BitmapData {
public function E5f1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 307
//E5f10 (E5f10)
package {
import flash.display.*;
public dynamic class E5f10 extends BitmapData {
public function E5f10(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 308
//E5f11 (E5f11)
package {
import flash.display.*;
public dynamic class E5f11 extends BitmapData {
public function E5f11(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 309
//E5f12 (E5f12)
package {
import flash.display.*;
public dynamic class E5f12 extends BitmapData {
public function E5f12(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 310
//E5f13 (E5f13)
package {
import flash.display.*;
public dynamic class E5f13 extends BitmapData {
public function E5f13(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 311
//E5f14 (E5f14)
package {
import flash.display.*;
public dynamic class E5f14 extends BitmapData {
public function E5f14(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 312
//E5f15 (E5f15)
package {
import flash.display.*;
public dynamic class E5f15 extends BitmapData {
public function E5f15(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 313
//E5f16 (E5f16)
package {
import flash.display.*;
public dynamic class E5f16 extends BitmapData {
public function E5f16(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 314
//E5f17 (E5f17)
package {
import flash.display.*;
public dynamic class E5f17 extends BitmapData {
public function E5f17(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 315
//E5f18 (E5f18)
package {
import flash.display.*;
public dynamic class E5f18 extends BitmapData {
public function E5f18(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 316
//E5f19 (E5f19)
package {
import flash.display.*;
public dynamic class E5f19 extends BitmapData {
public function E5f19(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 317
//E5f2 (E5f2)
package {
import flash.display.*;
public dynamic class E5f2 extends BitmapData {
public function E5f2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 318
//E5f20 (E5f20)
package {
import flash.display.*;
public dynamic class E5f20 extends BitmapData {
public function E5f20(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 319
//E5f3 (E5f3)
package {
import flash.display.*;
public dynamic class E5f3 extends BitmapData {
public function E5f3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 320
//E5f4 (E5f4)
package {
import flash.display.*;
public dynamic class E5f4 extends BitmapData {
public function E5f4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 321
//E5f5 (E5f5)
package {
import flash.display.*;
public dynamic class E5f5 extends BitmapData {
public function E5f5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 322
//E5f6 (E5f6)
package {
import flash.display.*;
public dynamic class E5f6 extends BitmapData {
public function E5f6(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 323
//E5f7 (E5f7)
package {
import flash.display.*;
public dynamic class E5f7 extends BitmapData {
public function E5f7(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 324
//E5f8 (E5f8)
package {
import flash.display.*;
public dynamic class E5f8 extends BitmapData {
public function E5f8(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 325
//E5f9 (E5f9)
package {
import flash.display.*;
public dynamic class E5f9 extends BitmapData {
public function E5f9(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 326
//Enemy1Paper (Enemy1Paper)
package {
import flash.display.*;
public dynamic class Enemy1Paper extends MovieClip {
}
}//package
Section 327
//escaped (escaped)
package {
import flash.media.*;
public dynamic class escaped extends Sound {
}
}//package
Section 328
//explode (explode)
package {
import flash.media.*;
public dynamic class explode extends Sound {
}
}//package
Section 329
//gelpodShoot (gelpodShoot)
package {
import flash.media.*;
public dynamic class gelpodShoot extends Sound {
}
}//package
Section 330
//Grass (Grass)
package {
import flash.display.*;
public dynamic class Grass extends BitmapData {
public function Grass(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 331
//GridSquare (GridSquare)
package {
import flash.display.*;
public dynamic class GridSquare extends MovieClip {
}
}//package
Section 332
//hurtEnemy (hurtEnemy)
package {
import flash.media.*;
public dynamic class hurtEnemy extends Sound {
}
}//package
Section 333
//insufficient (insufficient)
package {
import flash.media.*;
public dynamic class insufficient extends Sound {
}
}//package
Section 334
//LaserBase (LaserBase)
package {
import flash.display.*;
public dynamic class LaserBase extends BitmapData {
public function LaserBase(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 335
//LaserButton (LaserButton)
package {
import com.baitgames.towerdefense.*;
public dynamic class LaserButton extends WeaponButton {
}
}//package
Section 336
//LaserTowerTexture (LaserTowerTexture)
package {
import flash.display.*;
public dynamic class LaserTowerTexture extends BitmapData {
public function LaserTowerTexture(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 337
//launchRocket (launchRocket)
package {
import flash.media.*;
public dynamic class launchRocket extends Sound {
}
}//package
Section 338
//level1 (level1)
package {
import flash.media.*;
public dynamic class level1 extends Sound {
}
}//package
Section 339
//level2 (level2)
package {
import flash.media.*;
public dynamic class level2 extends Sound {
}
}//package
Section 340
//level3 (level3)
package {
import flash.media.*;
public dynamic class level3 extends Sound {
}
}//package
Section 341
//level4 (level4)
package {
import flash.media.*;
public dynamic class level4 extends Sound {
}
}//package
Section 342
//Lines (Lines)
package {
import flash.display.*;
public dynamic class Lines extends BitmapData {
public function Lines(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 343
//lose (lose)
package {
import flash.media.*;
public dynamic class lose extends Sound {
}
}//package
Section 344
//MissileBase (MissileBase)
package {
import flash.display.*;
public dynamic class MissileBase extends BitmapData {
public function MissileBase(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 345
//MissileTexture (MissileTexture)
package {
import flash.display.*;
public dynamic class MissileTexture extends BitmapData {
public function MissileTexture(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 346
//MissileTower (MissileTower)
package {
import com.baitgames.towerdefense.*;
public dynamic class MissileTower extends WeaponButton {
}
}//package
Section 347
//MusicSound (MusicSound)
package {
import flash.media.*;
public dynamic class MusicSound extends Sound {
}
}//package
Section 348
//newWave (newWave)
package {
import flash.media.*;
public dynamic class newWave extends Sound {
}
}//package
Section 349
//NukeButton (NukeButton)
package {
import com.baitgames.towerdefense.*;
public dynamic class NukeButton extends WeaponButton {
}
}//package
Section 350
//PreloadText (PreloadText)
package {
import flash.display.*;
public dynamic class PreloadText extends MovieClip {
}
}//package
Section 351
//pulse (pulse)
package {
import flash.media.*;
public dynamic class pulse extends Sound {
}
}//package
Section 352
//PulseBase (PulseBase)
package {
import flash.display.*;
public dynamic class PulseBase extends BitmapData {
public function PulseBase(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 353
//PulseButton (PulseButton)
package {
import com.baitgames.towerdefense.*;
public dynamic class PulseButton extends WeaponButton {
}
}//package
Section 354
//PulseTowerTexture (PulseTowerTexture)
package {
import flash.display.*;
public dynamic class PulseTowerTexture extends BitmapData {
public function PulseTowerTexture(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 355
//ReplayBt (ReplayBt)
package {
import com.baitcontent.*;
public dynamic class ReplayBt extends RewindButton {
}
}//package
Section 356
//Ring (Ring)
package {
import flash.display.*;
public dynamic class Ring extends BitmapData {
public function Ring(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 357
//rocketImpact (rocketImpact)
package {
import flash.media.*;
public dynamic class rocketImpact extends Sound {
}
}//package
Section 358
//RocketTowerTexture (RocketTowerTexture)
package {
import flash.display.*;
public dynamic class RocketTowerTexture extends BitmapData {
public function RocketTowerTexture(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 359
//RollFx (RollFx)
package {
import flash.media.*;
public dynamic class RollFx extends Sound {
}
}//package
Section 360
//SkyBox (SkyBox)
package {
import flash.display.*;
public dynamic class SkyBox extends BitmapData {
public function SkyBox(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 361
//Spark1 (Spark1)
package {
import flash.display.*;
public dynamic class Spark1 extends BitmapData {
public function Spark1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 362
//Spark2 (Spark2)
package {
import flash.display.*;
public dynamic class Spark2 extends BitmapData {
public function Spark2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 363
//Spark3 (Spark3)
package {
import flash.display.*;
public dynamic class Spark3 extends BitmapData {
public function Spark3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 364
//Spark4 (Spark4)
package {
import flash.display.*;
public dynamic class Spark4 extends BitmapData {
public function Spark4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 365
//Spark5 (Spark5)
package {
import flash.display.*;
public dynamic class Spark5 extends BitmapData {
public function Spark5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 366
//Spark6 (Spark6)
package {
import flash.display.*;
public dynamic class Spark6 extends BitmapData {
public function Spark6(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 367
//Spark7 (Spark7)
package {
import flash.display.*;
public dynamic class Spark7 extends BitmapData {
public function Spark7(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 368
//Spark8 (Spark8)
package {
import flash.display.*;
public dynamic class Spark8 extends BitmapData {
public function Spark8(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 369
//SparkFrames (SparkFrames)
package {
import flash.display.*;
public dynamic class SparkFrames extends MovieClip {
}
}//package
Section 370
//startLaser (startLaser)
package {
import flash.media.*;
public dynamic class startLaser extends Sound {
}
}//package
Section 371
//Tile (Tile)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Tile extends MovieClip {
public var txt:TextField;
}
}//package
Section 372
//tolleranceLow (tolleranceLow)
package {
import flash.media.*;
public dynamic class tolleranceLow extends Sound {
}
}//package
Section 373
//TowerBaseTexture (TowerBaseTexture)
package {
import flash.display.*;
public dynamic class TowerBaseTexture extends BitmapData {
public function TowerBaseTexture(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 374
//TowerButton (TowerButton)
package {
import com.baitgames.towerdefense.*;
public dynamic class TowerButton extends WeaponButton {
}
}//package
Section 375
//TowerDefenseGameOver (TowerDefenseGameOver)
package {
import com.baitcontent.*;
public dynamic class TowerDefenseGameOver extends GameOver {
}
}//package
Section 376
//tracking (tracking)
package {
import flash.media.*;
public dynamic class tracking extends Sound {
}
}//package
Section 377
//TurretTexture (TurretTexture)
package {
import flash.display.*;
public dynamic class TurretTexture extends BitmapData {
public function TurretTexture(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 378
//wallTile (wallTile)
package {
import flash.display.*;
public dynamic class wallTile extends BitmapData {
public function wallTile(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 379
//wave (wave)
package {
import flash.media.*;
public dynamic class wave extends Sound {
}
}//package
Section 380
//win (win)
package {
import flash.media.*;
public dynamic class win extends Sound {
}
}//package