Section 1
//Action_39 (3D_Sugar_Glider_fla.Action_39)
package 3D_Sugar_Glider_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.filters.*;
import flash.text.*;
import flash.ui.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Action_39 extends MovieClip {
public function Action_39(){
addFrameScript(0, frame1);
}
public function onComplete(_arg1:Event):void{
MovieClip(parent).gotoAndPlay("loaded");
}
public function progressHandler(_arg1:ProgressEvent):void{
var _local2:int;
_local2 = Math.round(((_arg1.target.bytesLoaded / _arg1.target.bytesTotal) * 100));
MovieClip(parent).gotoAndStop(_local2);
}
function frame1(){
MovieClip(root).stop();
root.loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
root.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
}
}
}//package 3D_Sugar_Glider_fla
Section 2
//EMDEBSTUFF_1 (3D_Sugar_Glider_fla.EMDEBSTUFF_1)
package 3D_Sugar_Glider_fla {
import flash.display.*;
public dynamic class EMDEBSTUFF_1 extends MovieClip {
public function EMDEBSTUFF_1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
visible = false;
}
}
}//package 3D_Sugar_Glider_fla
Section 3
//instruction_panel_30 (3D_Sugar_Glider_fla.instruction_panel_30)
package 3D_Sugar_Glider_fla {
import flash.display.*;
import flash.text.*;
public dynamic class instruction_panel_30 extends MovieClip {
public var sec:TextField;
public var back:SimpleButton;
}
}//package 3D_Sugar_Glider_fla
Section 4
//loadED_40 (3D_Sugar_Glider_fla.loadED_40)
package 3D_Sugar_Glider_fla {
import flash.display.*;
public dynamic class loadED_40 extends MovieClip {
public function loadED_40(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package 3D_Sugar_Glider_fla
Section 5
//me_end_28 (3D_Sugar_Glider_fla.me_end_28)
package 3D_Sugar_Glider_fla {
import flash.display.*;
import flash.text.*;
public dynamic class me_end_28 extends MovieClip {
public var messxk:TextField;
public var m_start:SimpleButton;
public var messx:TextField;
public var m_startno:SimpleButton;
public var mess:TextField;
}
}//package 3D_Sugar_Glider_fla
Section 6
//me_startz_20 (3D_Sugar_Glider_fla.me_startz_20)
package 3D_Sugar_Glider_fla {
import flash.display.*;
public dynamic class me_startz_20 extends MovieClip {
public var m_start:SimpleButton;
public var m_in:SimpleButton;
}
}//package 3D_Sugar_Glider_fla
Section 7
//menu_stats_25 (3D_Sugar_Glider_fla.menu_stats_25)
package 3D_Sugar_Glider_fla {
import flash.display.*;
import flash.text.*;
public dynamic class menu_stats_25 extends MovieClip {
public var clock:MovieClip;
public var health:TextField;
public var m1:met1;
public var heart:MovieClip;
public var m2:met1;
public var score:TextField;
public var time:TextField;
}
}//package 3D_Sugar_Glider_fla
Section 8
//NG_TANK_42 (3D_Sugar_Glider_fla.NG_TANK_42)
package 3D_Sugar_Glider_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import com.newgrounds.*;
import flash.media.*;
import flash.filters.*;
import flash.text.*;
import flash.ui.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class NG_TANK_42 extends MovieClip {
public var NG_Logo:SimpleButton;
public var ng_api;
public var ng_global;
public function NG_TANK_42(){
addFrameScript(0, frame1);
}
public function loadNGSite(_arg1:Event){
ng_api.LoadNewgrounds();
}
function frame1(){
ng_global = new Newgrounds_Global();
ng_api = ng_global.getData("API");
NG_Logo.addEventListener(MouseEvent.CLICK, loadNGSite);
}
}
}//package 3D_Sugar_Glider_fla
Section 9
//X_LOAD_35 (3D_Sugar_Glider_fla.X_LOAD_35)
package 3D_Sugar_Glider_fla {
import flash.events.*;
import flash.display.*;
public dynamic class X_LOAD_35 extends MovieClip {
public var NGButton:SimpleButton;
public function X_LOAD_35(){
addFrameScript(0, frame1, 100, frame101, 150, frame151, 164, frame165);
}
function frame151(){
NGButton.visible = true;
NGButton.addEventListener(MouseEvent.CLICK, PlayMovie);
}
function frame165(){
stop();
}
public function PlayMovie(_arg1:Event){
gotoAndStop("end");
MovieClip(root).play();
}
function frame1(){
NGButton.visible = false;
}
function frame101(){
play();
}
}
}//package 3D_Sugar_Glider_fla
Section 10
//Blocker (away3d.core.block.Blocker)
package away3d.core.block {
import away3d.core.draw.*;
public class Blocker extends DrawPrimitive {
public function block(_arg1:DrawPrimitive):Boolean{
return (false);
}
}
}//package away3d.core.block
Section 11
//BlockerArray (away3d.core.block.BlockerArray)
package away3d.core.block {
import away3d.core.render.*;
public class BlockerArray implements IBlockerConsumer {
private var _clip:Clipping;
private var _blockers:Array;
var blockers:Array;
public function set clip(_arg1:Clipping):void{
_clip = _arg1;
_blockers = [];
}
public function list():Array{
blockers = _blockers;
_blockers = null;
blockers.sortOn("screenZ", Array.NUMERIC);
return (blockers);
}
public function blocker(_arg1:Blocker):void{
if (_clip.check(_arg1)){
_blockers.push(_arg1);
};
}
}
}//package away3d.core.block
Section 12
//IBlockerConsumer (away3d.core.block.IBlockerConsumer)
package away3d.core.block {
public interface IBlockerConsumer {
function blocker(_arg1:Blocker):void;
}
}//package away3d.core.block
Section 13
//IBlockerProvider (away3d.core.block.IBlockerProvider)
package away3d.core.block {
public interface IBlockerProvider {
function blockers(_arg1:IBlockerConsumer):void;
}
}//package away3d.core.block
Section 14
//DrawDisplayObject (away3d.core.draw.DrawDisplayObject)
package away3d.core.draw {
import flash.display.*;
import away3d.core.render.*;
import away3d.core.scene.*;
public class DrawDisplayObject extends DrawPrimitive {
public var v:ScreenVertex;
public var displayobject:DisplayObject;
public var session:RenderSession;
public function DrawDisplayObject(_arg1:Object3D, _arg2:DisplayObject, _arg3:ScreenVertex, _arg4:RenderSession){
this.source = _arg1;
this.displayobject = _arg2;
this.v = _arg3;
this.session = _arg4;
calc();
}
override public function clear():void{
displayobject = null;
}
public function calc():void{
screenZ = v.z;
minZ = screenZ;
maxZ = screenZ;
minX = (v.x - (displayobject.width / 2));
minY = (v.y - (displayobject.height / 2));
maxX = (v.x + (displayobject.width / 2));
maxY = (v.y + (displayobject.height / 2));
}
override public function render():void{
displayobject.x = v.x;
displayobject.y = v.y;
session.addDisplayObject(displayobject);
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (true);
}
}
}//package away3d.core.draw
Section 15
//DrawPrimitive (away3d.core.draw.DrawPrimitive)
package away3d.core.draw {
import away3d.core.render.*;
import away3d.core.scene.*;
public class DrawPrimitive {
public var create:Function;
public var minX:Number;
public var minZ:Number;
public var projection:Projection;
public var source:Object3D;
public var minY:Number;
public var screenZ:Number;
public var maxX:Number;
public var maxY:Number;
public var quadrant:PrimitiveQuadrantTreeNode;
public var maxZ:Number;
public function getZ(_arg1:Number, _arg2:Number):Number{
return (screenZ);
}
public function clear():void{
}
public function render():void{
throw (new Error("Not implemented"));
}
public function contains(_arg1:Number, _arg2:Number):Boolean{
return (false);
}
public function shade():void{
throw (new Error("Not implemented"));
}
public function quarter(_arg1:Number):Array{
return (null);
}
public function toString():String{
return ((((((("P{ screenZ = " + screenZ) + ", minZ = ") + minZ) + ", maxZ = ") + maxZ) + " }"));
}
protected static function assert(_arg1:Boolean, _arg2:String="Assert failure"):void{
if (!_arg1){
throw (new Error(_arg2));
};
}
}
}//package away3d.core.draw
Section 16
//DrawScaledBitmap (away3d.core.draw.DrawScaledBitmap)
package away3d.core.draw {
import flash.display.*;
import away3d.core.scene.*;
import flash.geom.*;
public class DrawScaledBitmap extends DrawPrimitive {
private var sinh:Number;
public var width:Number;
private var sinw:Number;
public var height:Number;
public var left:ScreenVertex;
public var smooth:Boolean;
public var bitmap:BitmapData;
public var bottomleft:ScreenVertex;
private var cos:Number;
private var bounds:ScreenVertex;
private var cosh:Number;
public var scale:Number;
private var cosw:Number;
public var bottomright:ScreenVertex;
public var top:ScreenVertex;
private var sin:Number;
public var topleft:ScreenVertex;
private var mapping:Matrix;
public var topright:ScreenVertex;
public var v:ScreenVertex;
public var rotation:Number;
public function DrawScaledBitmap(_arg1:Object3D, _arg2:BitmapData, _arg3:ScreenVertex, _arg4:Number, _arg5:Number, _arg6:Boolean){
topleft = new ScreenVertex();
topright = new ScreenVertex();
bottomleft = new ScreenVertex();
bottomright = new ScreenVertex();
left = new ScreenVertex();
top = new ScreenVertex();
super();
this.source = _arg1;
this.bitmap = _arg2;
this.v = _arg3;
this.scale = _arg4;
this.rotation = _arg5;
this.smooth = _arg6;
calc();
}
override public function render():void{
var _local1:Graphics;
mapping = new Matrix((scale * cos), (-(scale) * sin), (scale * sin), (scale * cos), topleft.x, topleft.y);
_local1 = source.session.graphics;
_local1.lineStyle();
if (rotation != 0){
_local1.beginBitmapFill(bitmap, mapping, false, smooth);
_local1.moveTo(topleft.x, topleft.y);
_local1.lineTo(topright.x, topright.y);
_local1.lineTo(bottomright.x, bottomright.y);
_local1.lineTo(bottomleft.x, bottomleft.y);
_local1.lineTo(topleft.x, topleft.y);
_local1.endFill();
} else {
_local1.beginBitmapFill(bitmap, mapping, false, smooth);
_local1.drawRect(minX, minY, (maxX - minX), (maxY - minY));
};
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
var _local3:Point;
var _local4:uint;
if (rotation != 0){
if ((((topleft.x * (_arg2 - topright.y)) + (topright.x * (topleft.y - _arg2))) + (_arg1 * (topright.y - topleft.y))) > 0.001){
return (false);
};
if ((((topright.x * (_arg2 - bottomright.y)) + (bottomright.x * (topright.y - _arg2))) + (_arg1 * (bottomright.y - topright.y))) > 0.001){
return (false);
};
if ((((bottomright.x * (_arg2 - bottomleft.y)) + (bottomleft.x * (bottomright.y - _arg2))) + (_arg1 * (bottomleft.y - bottomright.y))) > 0.001){
return (false);
};
if ((((bottomleft.x * (_arg2 - topleft.y)) + (topleft.x * (bottomleft.y - _arg2))) + (_arg1 * (topleft.y - bottomleft.y))) > 0.001){
return (false);
};
};
if (!bitmap.transparent){
return (true);
};
mapping = new Matrix((scale * cos), (-(scale) * sin), (scale * sin), (scale * cos), topleft.x, topleft.y);
mapping.invert();
_local3 = mapping.transformPoint(new Point(_arg1, _arg2));
if (_local3.x < 0){
_local3.x = 0;
};
if (_local3.y < 0){
_local3.y = 0;
};
if (_local3.x >= bitmap.width){
_local3.x = (bitmap.width - 1);
};
if (_local3.y >= bitmap.height){
_local3.y = (bitmap.height - 1);
};
_local4 = bitmap.getPixel32(int(_local3.x), int(_local3.y));
return ((uint((_local4 >> 24)) > 128));
}
override public function clear():void{
bitmap = null;
}
public function calc():void{
var _local1:Array;
screenZ = v.z;
minZ = screenZ;
maxZ = screenZ;
width = (bitmap.width * scale);
height = (bitmap.height * scale);
cos = Math.cos(((rotation * Math.PI) / 180));
sin = Math.sin(((rotation * Math.PI) / 180));
cosw = ((cos * width) / 2);
cosh = ((cos * height) / 2);
sinw = ((sin * width) / 2);
sinh = ((sin * height) / 2);
topleft.x = ((v.x - cosw) - sinh);
topleft.y = ((v.y + sinw) - cosh);
topright.x = ((v.x + cosw) - sinh);
topright.y = ((v.y - sinw) - cosh);
bottomleft.x = ((v.x - cosw) + sinh);
bottomleft.y = ((v.y + sinw) + cosh);
bottomright.x = ((v.x + cosw) + sinh);
bottomright.y = ((v.y - sinw) + cosh);
if (rotation != 0){
_local1 = new Array();
_local1.push(topleft);
_local1.push(topright);
_local1.push(bottomleft);
_local1.push(bottomright);
minX = 100000;
minY = 100000;
maxX = -100000;
maxY = -100000;
for each (bounds in _local1) {
if (minX > bounds.x){
minX = bounds.x;
};
if (maxX < bounds.x){
maxX = bounds.x;
};
if (minY > bounds.y){
minY = bounds.y;
};
if (maxY < bounds.y){
maxY = bounds.y;
};
};
} else {
minX = topleft.x;
minY = topleft.y;
maxX = bottomright.x;
maxY = bottomright.y;
};
}
}
}//package away3d.core.draw
Section 17
//DrawSegment (away3d.core.draw.DrawSegment)
package away3d.core.draw {
import away3d.core.material.*;
public class DrawSegment extends DrawPrimitive {
var db:Number;
var yfocus:Number;
var det:Number;
var dx:Number;
var dy:Number;
var bzf:Number;
var faz:Number;
public var material:ISegmentMaterial;
var axf:Number;
var ayf:Number;
var ax:Number;
var ay:Number;
var az:Number;
var da:Number;
var fbz:Number;
var bxf:Number;
var azf:Number;
var bx:Number;
var by:Number;
var focus:Number;
var bz:Number;
var xfocus:Number;
public var length:Number;
var byf:Number;
public var v0:ScreenVertex;
public var v1:ScreenVertex;
override public function render():void{
material.renderSegment(this);
}
public function onepointcut(_arg1:ScreenVertex):Array{
return ([create(material, projection, v0, _arg1), create(material, projection, _arg1, v1)]);
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
if (Math.abs((((v0.x * (_arg2 - v1.y)) + (v1.x * (v0.y - _arg2))) + (_arg1 * (v1.y - v0.y)))) > ((0.001 * 1000) * 1000)){
return (false);
};
if ((distanceToCenter(_arg1, _arg2) * 2) > length){
return (false);
};
return (true);
}
override public function quarter(_arg1:Number):Array{
var _local2:ScreenVertex;
if (length < 5){
return (null);
};
_local2 = ScreenVertex.median(v0, v1, _arg1);
return ([create(material, projection, v0, _local2), create(material, projection, _local2, v1)]);
}
override public function getZ(_arg1:Number, _arg2:Number):Number{
if (projection == null){
return (screenZ);
};
focus = projection.focus;
ax = v0.x;
ay = v0.y;
az = v0.z;
bx = v1.x;
by = v1.y;
bz = v1.z;
if ((((ax == _arg1)) && ((ay == _arg2)))){
return (az);
};
if ((((bx == _arg1)) && ((by == _arg2)))){
return (bz);
};
dx = (bx - ax);
dy = (by - ay);
azf = (az / focus);
bzf = (bz / focus);
faz = (1 + azf);
fbz = (1 + bzf);
xfocus = _arg1;
yfocus = _arg2;
axf = ((ax * faz) - (_arg1 * azf));
bxf = ((bx * fbz) - (_arg1 * bzf));
ayf = ((ay * faz) - (_arg2 * azf));
byf = ((by * fbz) - (_arg2 * bzf));
det = ((dx * (axf - bxf)) + (dy * (ayf - byf)));
db = ((dx * (axf - _arg1)) + (dy * (ayf - _arg2)));
da = ((dx * (_arg1 - bxf)) + (dy * (_arg2 - byf)));
return ((((da * az) + (db * bz)) / det));
}
override public function clear():void{
v0 = null;
v1 = null;
}
public function calc():void{
if (v0.z < v1.z){
minZ = v0.z;
maxZ = (v1.z + 1);
} else {
minZ = v1.z;
maxZ = (v0.z + 1);
};
screenZ = ((v0.z + v1.z) / 2);
if (v0.x < v1.x){
minX = v0.x;
maxX = (v1.x + 1);
} else {
minX = v1.x;
maxX = (v0.x + 1);
};
if (v0.y < v1.y){
minY = v0.y;
maxY = (v1.y + 1);
} else {
minY = v1.y;
maxY = (v0.y + 1);
};
length = Math.sqrt((((maxX - minX) * (maxX - minX)) + ((maxY - minY) * (maxY - minY))));
}
public function distanceToCenter(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
_local3 = ((v0.x + v1.x) / 2);
_local4 = ((v0.y + v1.y) / 2);
return (Math.sqrt((((_local3 - _arg1) * (_local3 - _arg1)) + ((_local4 - _arg2) * (_local4 - _arg2)))));
}
override public function toString():String{
return ((((((("S{ screenZ = " + screenZ) + ", minZ = ") + minZ) + ", maxZ = ") + maxZ) + " }"));
}
}
}//package away3d.core.draw
Section 18
//DrawTriangle (away3d.core.draw.DrawTriangle)
package away3d.core.draw {
import flash.display.*;
import away3d.core.material.*;
import flash.geom.*;
import away3d.core.mesh.*;
public class DrawTriangle extends DrawPrimitive {
var _u2:Number;
var det:Number;
var bzf:Number;
var axf:Number;
var v12:ScreenVertex;
var _v0:Number;
var _v1:Number;
var _v2:Number;
var faz:Number;
public var material:ITriangleMaterial;
var materialHeight:Number;
public var bitmapDisplacementY:BitmapData;
var ayf:Number;
var ax:Number;
var ay:Number;
public var bitmapDisplacementX:BitmapData;
var av:Number;
var az:Number;
var au:Number;
var fbz:Number;
var v20:ScreenVertex;
public var texturemapping:Matrix;
var azf:Number;
var bx:Number;
var by:Number;
var bz:Number;
var bu:Number;
var bv:Number;
public var face:Face;
var d01:Number;
var uv01:UV;
public var normalRect:Rectangle;
var cv:Number;
public var bitmapMaterial:BitmapData;
var cz:Number;
var cu:Number;
public var v0:ScreenVertex;
public var v2:ScreenVertex;
var db:Number;
var fcz:Number;
public var v1:ScreenVertex;
public var invtexturemapping:Matrix;
var d12:Number;
var uv12:UV;
public var area:Number;
var cxf:Number;
var da:Number;
var cx:Number;
var cy:Number;
public var bitmapPhong:BitmapData;
var uv20:UV;
var dd12:Number;
var d20:Number;
var dd01:Number;
var t:Matrix;
public var uv0:UV;
public var uv1:UV;
public var uv2:UV;
var dc:Number;
var dd20:Number;
public var bitmapReflection:BitmapData;
var cyf:Number;
public var backface:Boolean;// = false
var czf:Number;
var bxf:Number;
var focus:Number;
var materialWidth:Number;
public var bitmapNormal:BitmapData;
var v01:ScreenVertex;
var _u0:Number;
var _u1:Number;
var byf:Number;
public function DrawTriangle(){
backface = false;
super();
}
final public function transformUV(_arg1:IUVMaterial):Matrix{
materialWidth = _arg1.width;
materialHeight = _arg1.height;
if ((((((uv0 == null)) || ((uv1 == null)))) || ((uv2 == null)))){
return (null);
};
_u0 = (materialWidth * uv0._u);
_u1 = (materialWidth * uv1._u);
_u2 = (materialWidth * uv2._u);
_v0 = (materialHeight * (1 - uv0._v));
_v1 = (materialHeight * (1 - uv1._v));
_v2 = (materialHeight * (1 - uv2._v));
if ((((((_u0 == _u1)) && ((_v0 == _v1)))) || ((((_u0 == _u2)) && ((_v0 == _v2)))))){
if (_u0 > 0.05){
_u0 = (_u0 - 0.05);
} else {
_u0 = (_u0 + 0.05);
};
if (_v0 > 0.07){
_v0 = (_v0 - 0.07);
} else {
_v0 = (_v0 + 0.07);
};
};
if ((((_u2 == _u1)) && ((_v2 == _v1)))){
if (_u2 > 0.04){
_u2 = (_u2 - 0.04);
} else {
_u2 = (_u2 + 0.04);
};
if (_v2 > 0.06){
_v2 = (_v2 - 0.06);
} else {
_v2 = (_v2 + 0.06);
};
};
if ((_arg1 is BitmapMaterialContainer)){
invtexturemapping = new Matrix((_u1 - _u0), (_v1 - _v0), (_u2 - _u0), (_v2 - _v0), (_u0 - face._bitmapRect.x), (_v0 - face._bitmapRect.y));
texturemapping = invtexturemapping.clone();
texturemapping.invert();
return (texturemapping);
};
texturemapping = new Matrix((_u1 - _u0), (_v1 - _v0), (_u2 - _u0), (_v2 - _v0), _u0, _v0);
texturemapping.invert();
return (texturemapping);
}
final public function bisect(_arg1:Number):Array{
d01 = v0.distanceSqr(v1);
d12 = v1.distanceSqr(v2);
d20 = v2.distanceSqr(v0);
if ((((d12 >= d01)) && ((d12 >= d20)))){
return (bisect12(_arg1));
};
if (d01 >= d20){
return (bisect01(_arg1));
};
return (bisect20(_arg1));
}
final override public function contains(_arg1:Number, _arg2:Number):Boolean{
if ((((v0.x * (_arg2 - v1.y)) + (v1.x * (v0.y - _arg2))) + (_arg1 * (v1.y - v0.y))) < -0.001){
return (false);
};
if ((((v0.x * (v2.y - _arg2)) + (_arg1 * (v0.y - v2.y))) + (v2.x * (_arg2 - v0.y))) < -0.001){
return (false);
};
if ((((_arg1 * (v2.y - v1.y)) + (v1.x * (_arg2 - v2.y))) + (v2.x * (v1.y - _arg2))) < -0.001){
return (false);
};
return (true);
}
final public function minEdgeSqr():Number{
return (Math.min(Math.min(v0.distanceSqr(v1), v1.distanceSqr(v2)), v2.distanceSqr(v0)));
}
override public function shade():void{
material.shadeTriangle(this);
}
final public function minDistortSqr(_arg1:Number):Number{
return (Math.min(Math.min(v0.distortSqr(v1, _arg1), v1.distortSqr(v2, _arg1)), v2.distortSqr(v0, _arg1)));
}
override public function clear():void{
v0 = null;
v1 = null;
v2 = null;
uv0 = null;
uv1 = null;
uv2 = null;
texturemapping = null;
}
final public function acuteAngled():Boolean{
d01 = v0.distanceSqr(v1);
d12 = v1.distanceSqr(v2);
d20 = v2.distanceSqr(v0);
dd01 = (d01 * d01);
dd12 = (d12 * d12);
dd20 = (d20 * d20);
return ((((((dd01 <= (dd12 + dd20))) && ((dd12 <= (dd20 + dd01))))) && ((dd20 <= (dd01 + dd12)))));
}
override public function toString():String{
var _local1:String;
_local1 = "";
if ((material is WireColorMaterial)){
switch ((material as WireColorMaterial).color){
case 0xFF00:
_local1 = "green";
break;
case 0xFFFF00:
_local1 = "yellow";
break;
case 0xFF0000:
_local1 = "red";
break;
case 0xFF:
_local1 = "blue";
break;
};
};
return (((((((((("T{" + _local1) + int(area)) + " screenZ = ") + num(screenZ)) + ", minZ = ") + num(minZ)) + ", maxZ = ") + num(maxZ)) + " }"));
}
final public function distortbisect(_arg1:Number):Array{
d01 = v0.distortSqr(v1, _arg1);
d12 = v1.distortSqr(v2, _arg1);
d20 = v2.distortSqr(v0, _arg1);
if ((((d12 >= d01)) && ((d12 >= d20)))){
return (bisect12(_arg1));
};
if (d01 >= d20){
return (bisect01(_arg1));
};
return (bisect20(_arg1));
}
public function getUV(_arg1:Number, _arg2:Number):UV{
if (uv0 == null){
return (null);
};
if (uv1 == null){
return (null);
};
if (uv2 == null){
return (null);
};
au = uv0._u;
av = uv0._v;
bu = uv1._u;
bv = uv1._v;
cu = uv2._u;
cv = uv2._v;
focus = projection.focus;
ax = v0.x;
ay = v0.y;
az = v0.z;
bx = v1.x;
by = v1.y;
bz = v1.z;
cx = v2.x;
cy = v2.y;
cz = v2.z;
if ((((ax == _arg1)) && ((ay == _arg2)))){
return (uv0);
};
if ((((bx == _arg1)) && ((by == _arg2)))){
return (uv1);
};
if ((((cx == _arg1)) && ((cy == _arg2)))){
return (uv2);
};
azf = (az / focus);
bzf = (bz / focus);
czf = (cz / focus);
faz = (1 + azf);
fbz = (1 + bzf);
fcz = (1 + czf);
axf = ((ax * faz) - (_arg1 * azf));
bxf = ((bx * fbz) - (_arg1 * bzf));
cxf = ((cx * fcz) - (_arg1 * czf));
ayf = ((ay * faz) - (_arg2 * azf));
byf = ((by * fbz) - (_arg2 * bzf));
cyf = ((cy * fcz) - (_arg2 * czf));
det = (((axf * (byf - cyf)) + (bxf * (cyf - ayf))) + (cxf * (ayf - byf)));
da = (((_arg1 * (byf - cyf)) + (bxf * (cyf - _arg2))) + (cxf * (_arg2 - byf)));
db = (((axf * (_arg2 - cyf)) + (_arg1 * (cyf - ayf))) + (cxf * (ayf - _arg2)));
dc = (((axf * (byf - _arg2)) + (bxf * (_arg2 - ayf))) + (_arg1 * (ayf - byf)));
return (new UV(((((da * au) + (db * bu)) + (dc * cu)) / det), ((((da * av) + (db * bv)) + (dc * cv)) / det)));
}
final private function bisect01(_arg1:Number):Array{
var _local2:ScreenVertex;
var _local3:UV;
_local2 = ScreenVertex.median(v0, v1, _arg1);
_local3 = UV.median(uv0, uv1);
return ([create(face, material, projection, v2, v0, _local2, uv2, uv0, _local3), create(face, material, projection, _local2, v1, v2, _local3, uv1, uv2)]);
}
override public function render():void{
material.renderTriangle(this);
}
public function calc():void{
if (v0.x > v1.x){
if (v0.x > v2.x){
maxX = v0.x;
} else {
maxX = v2.x;
};
} else {
if (v1.x > v2.x){
maxX = v1.x;
} else {
maxX = v2.x;
};
};
if (v0.x < v1.x){
if (v0.x < v2.x){
minX = v0.x;
} else {
minX = v2.x;
};
} else {
if (v1.x < v2.x){
minX = v1.x;
} else {
minX = v2.x;
};
};
if (v0.y > v1.y){
if (v0.y > v2.y){
maxY = v0.y;
} else {
maxY = v2.y;
};
} else {
if (v1.y > v2.y){
maxY = v1.y;
} else {
maxY = v2.y;
};
};
if (v0.y < v1.y){
if (v0.y < v2.y){
minY = v0.y;
} else {
minY = v2.y;
};
} else {
if (v1.y < v2.y){
minY = v1.y;
} else {
minY = v2.y;
};
};
if (v0.z > v1.z){
if (v0.z > v2.z){
maxZ = v0.z;
} else {
maxZ = v2.z;
};
} else {
if (v1.z > v2.z){
maxZ = v1.z;
} else {
maxZ = v2.z;
};
};
if (v0.z < v1.z){
if (v0.z < v2.z){
minZ = v0.z;
} else {
minZ = v2.z;
};
} else {
if (v1.z < v2.z){
minZ = v1.z;
} else {
minZ = v2.z;
};
};
screenZ = (((v0.z + v1.z) + v2.z) / 3);
area = (0.5 * (((v0.x * (v2.y - v1.y)) + (v1.x * (v0.y - v2.y))) + (v2.x * (v1.y - v0.y))));
}
public function fivepointcut(_arg1:ScreenVertex, _arg2:ScreenVertex, _arg3:ScreenVertex, _arg4:ScreenVertex, _arg5:ScreenVertex, _arg6:UV, _arg7:UV, _arg8:UV, _arg9:UV, _arg10:UV):Array{
if (_arg1.distanceSqr(_arg4) < _arg2.distanceSqr(_arg5)){
return ([create(face, material, projection, _arg1, _arg2, _arg4, _arg6, _arg7, _arg9), create(face, material, projection, _arg2, _arg3, _arg4, _arg7, _arg8, _arg9), create(face, material, projection, _arg1, _arg4, _arg5, _arg6, _arg9, _arg10)]);
};
return ([create(face, material, projection, _arg1, _arg2, _arg5, _arg6, _arg7, _arg10), create(face, material, projection, _arg2, _arg3, _arg4, _arg7, _arg8, _arg9), create(face, material, projection, _arg2, _arg4, _arg5, _arg7, _arg9, _arg10)]);
}
final private function bisect12(_arg1:Number):Array{
var _local2:ScreenVertex;
var _local3:UV;
_local2 = ScreenVertex.median(v1, v2, _arg1);
_local3 = UV.median(uv1, uv2);
return ([create(face, material, projection, v0, v1, _local2, uv0, uv1, _local3), create(face, material, projection, _local2, v2, v0, _local3, uv2, uv0)]);
}
final override public function quarter(_arg1:Number):Array{
if (area < 20){
return (null);
};
v01 = ScreenVertex.median(v0, v1, _arg1);
v12 = ScreenVertex.median(v1, v2, _arg1);
v20 = ScreenVertex.median(v2, v0, _arg1);
uv01 = UV.median(uv0, uv1);
uv12 = UV.median(uv1, uv2);
uv20 = UV.median(uv2, uv0);
return ([create(face, material, projection, v0, v01, v20, uv0, uv01, uv20), create(face, material, projection, v1, v12, v01, uv1, uv12, uv01), create(face, material, projection, v2, v20, v12, uv2, uv20, uv12), create(face, material, projection, v01, v12, v20, uv01, uv12, uv20)]);
}
final override public function getZ(_arg1:Number, _arg2:Number):Number{
if (projection == null){
return (screenZ);
};
focus = projection.focus;
ax = v0.x;
ay = v0.y;
az = v0.z;
bx = v1.x;
by = v1.y;
bz = v1.z;
cx = v2.x;
cy = v2.y;
cz = v2.z;
if ((((ax == _arg1)) && ((ay == _arg2)))){
return (az);
};
if ((((bx == _arg1)) && ((by == _arg2)))){
return (bz);
};
if ((((cx == _arg1)) && ((cy == _arg2)))){
return (cz);
};
azf = (az / focus);
bzf = (bz / focus);
czf = (cz / focus);
faz = (1 + azf);
fbz = (1 + bzf);
fcz = (1 + czf);
axf = ((ax * faz) - (_arg1 * azf));
bxf = ((bx * fbz) - (_arg1 * bzf));
cxf = ((cx * fcz) - (_arg1 * czf));
ayf = ((ay * faz) - (_arg2 * azf));
byf = ((by * fbz) - (_arg2 * bzf));
cyf = ((cy * fcz) - (_arg2 * czf));
det = (((axf * (byf - cyf)) + (bxf * (cyf - ayf))) + (cxf * (ayf - byf)));
da = (((_arg1 * (byf - cyf)) + (bxf * (cyf - _arg2))) + (cxf * (_arg2 - byf)));
db = (((axf * (_arg2 - cyf)) + (_arg1 * (cyf - ayf))) + (cxf * (ayf - _arg2)));
dc = (((axf * (byf - _arg2)) + (bxf * (_arg2 - ayf))) + (_arg1 * (ayf - byf)));
return (((((da * az) + (db * bz)) + (dc * cz)) / det));
}
final public function distanceToCenter(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
_local3 = (((v0.x + v1.x) + v2.x) / 3);
_local4 = (((v0.y + v1.y) + v2.y) / 3);
return (Math.sqrt((((_local3 - _arg1) * (_local3 - _arg1)) + ((_local4 - _arg2) * (_local4 - _arg2)))));
}
final public function maxDistortSqr(_arg1:Number):Number{
return (Math.max(Math.max(v0.distortSqr(v1, _arg1), v1.distortSqr(v2, _arg1)), v2.distortSqr(v0, _arg1)));
}
final public function maxEdgeSqr():Number{
return (Math.max(Math.max(v0.distanceSqr(v1), v1.distanceSqr(v2)), v2.distanceSqr(v0)));
}
final private function bisect20(_arg1:Number):Array{
var _local2:ScreenVertex;
var _local3:UV;
_local2 = ScreenVertex.median(v2, v0, _arg1);
_local3 = UV.median(uv2, uv0);
return ([create(face, material, projection, v1, v2, _local2, uv1, uv2, _local3), create(face, material, projection, _local2, v0, v1, _local3, uv0, uv1)]);
}
private static function num(_arg1:Number):Number{
return ((int((_arg1 * 1000)) / 1000));
}
}
}//package away3d.core.draw
Section 19
//ScreenVertex (away3d.core.draw.ScreenVertex)
package away3d.core.draw {
import away3d.core.mesh.*;
public final class ScreenVertex {
public var y:Number;
public var vx:Number;
public var vy:Number;
var fbz:Number;
public var z:Number;
public var num:Number;
var dx:Number;
var my2:Number;
var dy:Number;
var faz:Number;
var mx2:Number;
var ifmz2:Number;
public var visible:Boolean;
public var x:Number;
var persp:Number;
public function ScreenVertex(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.visible = false;
}
public function distortSqr(_arg1:ScreenVertex, _arg2:Number):Number{
faz = (_arg2 + z);
fbz = (_arg2 + z);
ifmz2 = (2 / (faz + fbz));
mx2 = (((x * faz) + (_arg1.x * fbz)) * ifmz2);
my2 = (((y * faz) + (_arg1.y * fbz)) * ifmz2);
dx = ((x + _arg1.x) - mx2);
dy = ((y + _arg1.y) - my2);
return ((50 * (((dx * dx) + dy) + dy)));
}
public function deperspective(_arg1:Number):Vertex{
persp = (1 + (z / _arg1));
return (new Vertex((x * persp), (y * persp), z));
}
public function distanceSqr(_arg1:ScreenVertex):Number{
return ((((x - _arg1.x) * (x - _arg1.x)) + ((y - _arg1.y) * (y - _arg1.y))));
}
public function toString():String{
return ((((((("new ScreenVertex(" + x) + ", ") + y) + ", ") + z) + ")"));
}
public function distance(_arg1:ScreenVertex):Number{
return (Math.sqrt((((x - _arg1.x) * (x - _arg1.x)) + ((y - _arg1.y) * (y - _arg1.y)))));
}
public static function median(_arg1:ScreenVertex, _arg2:ScreenVertex, _arg3:Number):ScreenVertex{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local4 = ((_arg1.z + _arg2.z) / 2);
_local5 = (_arg3 + _arg1.z);
_local6 = (_arg3 + _arg2.z);
_local7 = ((1 / (_arg3 + _local4)) / 2);
return (new ScreenVertex((((_arg1.x * _local5) + (_arg2.x * _local6)) * _local7), (((_arg1.y * _local5) + (_arg2.y * _local6)) * _local7), _local4));
}
public static function weighted(_arg1:ScreenVertex, _arg2:ScreenVertex, _arg3:Number, _arg4:Number, _arg5:Number):ScreenVertex{
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;
if ((((_arg4 == 0)) && ((_arg3 == 0)))){
throw (new Error("Zero weights"));
};
if (_arg4 == 0){
return (new ScreenVertex(_arg1.x, _arg1.y, _arg1.z));
};
if (_arg3 == 0){
return (new ScreenVertex(_arg2.x, _arg2.y, _arg2.z));
};
_local6 = (_arg3 + _arg4);
_local7 = (_arg3 / _local6);
_local8 = (_arg4 / _local6);
_local9 = ((_arg1.x * _local7) + (_arg2.x * _local8));
_local10 = ((_arg1.y * _local7) + (_arg2.y * _local8));
_local11 = (_arg1.z / _arg5);
_local12 = (_arg2.z / _arg5);
_local13 = (1 + _local11);
_local14 = (1 + _local12);
_local15 = ((_arg1.x * _local13) - (_local9 * _local11));
_local16 = ((_arg2.x * _local14) - (_local9 * _local12));
_local17 = ((_arg1.y * _local13) - (_local10 * _local11));
_local18 = ((_arg2.y * _local14) - (_local10 * _local12));
_local19 = ((_local15 * _local18) - (_local16 * _local17));
_local20 = ((_local9 * _local18) - (_local16 * _local10));
_local21 = ((_local15 * _local10) - (_local9 * _local17));
return (new ScreenVertex(_local9, _local10, (((_local20 * _arg1.z) + (_local21 * _arg2.z)) / _local19)));
}
}
}//package away3d.core.draw
Section 20
//AlphaBitmapMaterial (away3d.core.material.AlphaBitmapMaterial)
package away3d.core.material {
import away3d.core.math.*;
import flash.utils.*;
import flash.display.*;
import away3d.core.render.*;
import away3d.core.scene.*;
import flash.geom.*;
import away3d.core.draw.*;
import away3d.core.utils.*;
import away3d.core.*;
public class AlphaBitmapMaterial extends TransformBitmapMaterial implements ITriangleMaterial, IUVMaterial {
private var _alpha:Number;
private var _cache:Dictionary;
private var _grades:int;
public function AlphaBitmapMaterial(_arg1:BitmapData, _arg2:Object=null){
super(_arg1, _arg2);
if (!_arg1.transparent){
_bitmap = new BitmapData(_arg1.width, _arg1.height, true);
_bitmap.draw(_arg1);
};
_renderBitmap = _bitmap;
_cache = new Dictionary();
_arg2 = Init.parse(_arg2);
_grades = _arg2.getInt("grades", 32, {min:2, max:0x0100});
alpha = _arg2.getNumber("alpha", 1, {min:0, max:1});
}
public function set bitmap(_arg1:BitmapData):void{
_bitmap = _arg1;
_cache = new Dictionary();
updateCurrent();
}
private function updateCurrent():void{
if (_alpha == 1){
_renderBitmap = _bitmap;
return;
};
if (_alpha == 0){
_renderBitmap = null;
return;
};
_renderBitmap = _cache[_alpha];
if (_renderBitmap == null){
_renderBitmap = _bitmap.clone();
_renderBitmap.colorTransform(_renderBitmap.rect, new ColorTransform(1, 1, 1, _alpha));
_cache[_alpha] = _renderBitmap;
};
}
override public function get visible():Boolean{
return ((_alpha > 0));
}
public function set alpha(_arg1:Number):void{
if (_arg1 > 1){
_arg1 = 1;
};
if (_arg1 < 0){
_arg1 = 0;
};
if (_arg1 == _alpha){
return;
};
_arg1 = (Math.round((_arg1 * (_grades - 1))) / (_grades - 1));
_alpha = _arg1;
updateCurrent();
}
public function get alpha():Number{
return (_alpha);
}
}
}//package away3d.core.material
Section 21
//BitmapMaterial (away3d.core.material.BitmapMaterial)
package away3d.core.material {
import away3d.core.math.*;
import flash.utils.*;
import flash.display.*;
import away3d.core.render.*;
import away3d.core.scene.*;
import flash.geom.*;
import away3d.core.draw.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.*;
public class BitmapMaterial implements ITriangleMaterial, IUVMaterial {
var triangle:DrawTriangle;
var dsbc:Number;
var faz:Number;
var dsca:Number;
var ax:Number;
var ay:Number;
var az:Number;
var _renderBitmap:BitmapData;
var fbz:Number;
var _zeroPoint:Point;
var mcax:Number;
var _bitmap:BitmapData;
var mcaz:Number;
public var debug:Boolean;
var mcay:Number;
var bx:Number;
var by:Number;
var bz:Number;
var fcz:Number;
var map:Matrix;
var dbcx:Number;
var dbcy:Number;
var cx:Number;
var cy:Number;
var cz:Number;
public var precision:Number;// = 0
var graphics:Graphics;
var dmax:Number;
var dabx:Number;
var session:RenderSession;
public var repeat:Boolean;
var shape:Shape;
var daby:Number;
public var smooth:Boolean;
var svArray:Array;
var mbcx:Number;
var mbcy:Number;
var faceDictionaryVO:FaceDictionaryVO;
var mapping:Matrix;
var focus:Number;
var mbcz:Number;
var mabx:Number;
var maby:Number;
var dsab:Number;
var _faceDictionary:Dictionary;
var mabz:Number;
var dcax:Number;
var dcay:Number;
public function BitmapMaterial(_arg1:BitmapData, _arg2:Object=null){
_faceDictionary = new Dictionary(true);
_zeroPoint = new Point(0, 0);
precision = 0;
shape = new Shape();
map = new Matrix();
triangle = new DrawTriangle();
svArray = new Array();
super();
_renderBitmap = (_bitmap = _arg1);
_arg2 = Init.parse(_arg2);
smooth = _arg2.getBoolean("smooth", false);
debug = _arg2.getBoolean("debug", false);
repeat = _arg2.getBoolean("repeat", false);
precision = _arg2.getNumber("precision", 0);
precision = ((precision * precision) * 1.4);
createVertexArray();
}
public function renderFace(_arg1:Face, _arg2:Rectangle):void{
faceDictionaryVO = _faceDictionary[_arg1];
if (!faceDictionaryVO){
faceDictionaryVO = (_faceDictionary[_arg1.parent] = new FaceDictionaryVO(_arg2.width, _arg2.height));
};
mapping = new Matrix();
mapping.scale((_arg2.width / width), (_arg2.height / height));
faceDictionaryVO.dirty = false;
if ((((mapping.a == 1)) && ((mapping.d == 1)))){
faceDictionaryVO.bitmap.copyPixels(_bitmap, _arg2, _zeroPoint);
} else {
graphics = shape.graphics;
graphics.clear();
graphics.beginBitmapFill(_bitmap, mapping, repeat, smooth);
graphics.drawRect(0, 0, _arg2.width, _arg2.height);
graphics.endFill();
faceDictionaryVO.bitmap.draw(shape);
};
}
protected function renderRec(_arg1:ScreenVertex, _arg2:ScreenVertex, _arg3:ScreenVertex, _arg4:Number):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:ScreenVertex;
var _local12:ScreenVertex;
var _local13:ScreenVertex;
ax = _arg1.x;
ay = _arg1.y;
az = _arg1.z;
bx = _arg2.x;
by = _arg2.y;
bz = _arg2.z;
cx = _arg3.x;
cy = _arg3.y;
cz = _arg3.z;
if (!session.clip.rect(Math.min(ax, Math.min(bx, cx)), Math.min(ay, Math.min(by, cy)), Math.max(ax, Math.max(bx, cx)), Math.max(ay, Math.max(by, cy)))){
return;
};
if ((((((az <= 0)) && ((bz <= 0)))) && ((cz <= 0)))){
return;
};
if ((((((((_arg4 >= 100)) || ((focus == Infinity)))) || (((Math.max(Math.max(ax, bx), cx) - Math.min(Math.min(ax, bx), cx)) < 10)))) || (((Math.max(Math.max(ay, by), cy) - Math.min(Math.min(ay, by), cy)) < 10)))){
session.renderTriangleBitmap(_renderBitmap, map, _arg1, _arg2, _arg3, smooth, repeat);
if (debug){
session.renderTriangleLine(1, 0xFF00, 1, _arg1, _arg2, _arg3);
};
return;
};
faz = (focus + az);
fbz = (focus + bz);
fcz = (focus + cz);
mabz = (2 / (faz + fbz));
mbcz = (2 / (fbz + fcz));
mcaz = (2 / (fcz + faz));
dabx = ((ax + bx) - (mabx = (((ax * faz) + (bx * fbz)) * mabz)));
daby = ((ay + by) - (maby = (((ay * faz) + (by * fbz)) * mabz)));
dbcx = ((bx + cx) - (mbcx = (((bx * fbz) + (cx * fcz)) * mbcz)));
dbcy = ((by + cy) - (mbcy = (((by * fbz) + (cy * fcz)) * mbcz)));
dcax = ((cx + ax) - (mcax = (((cx * fcz) + (ax * faz)) * mcaz)));
dcay = ((cy + ay) - (mcay = (((cy * fcz) + (ay * faz)) * mcaz)));
dsab = ((dabx * dabx) + (daby * daby));
dsbc = ((dbcx * dbcx) + (dbcy * dbcy));
dsca = ((dcax * dcax) + (dcay * dcay));
if ((((((dsab <= precision)) && ((dsca <= precision)))) && ((dsbc <= precision)))){
session.renderTriangleBitmap(_renderBitmap, map, _arg1, _arg2, _arg3, smooth, repeat);
if (debug){
session.renderTriangleLine(1, 0xFF00, 1, _arg1, _arg2, _arg3);
};
return;
};
_local5 = map.a;
_local6 = map.b;
_local7 = map.c;
_local8 = map.d;
_local9 = map.tx;
_local10 = map.ty;
var _temp1 = _arg4;
_arg4 = (_arg4 + 1);
_local13 = svArray[_temp1];
_local13.x = (mbcx / 2);
_local13.y = (mbcy / 2);
_local13.z = ((bz + cz) / 2);
if ((((((dsab > precision)) && ((dsca > precision)))) && ((dsbc > precision)))){
var _temp2 = _arg4;
_arg4 = (_arg4 + 1);
_local11 = svArray[_temp2];
_local11.x = (mabx / 2);
_local11.y = (maby / 2);
_local11.z = ((az + bz) / 2);
var _temp3 = _arg4;
_arg4 = (_arg4 + 1);
_local12 = svArray[_temp3];
_local12.x = (mcax / 2);
_local12.y = (mcay / 2);
_local12.z = ((cz + az) / 2);
_local5 = (_local5 * 2);
map.a = _local5;
_local6 = (_local6 * 2);
map.b = _local6;
_local7 = (_local7 * 2);
map.c = _local7;
_local8 = (_local8 * 2);
map.d = _local8;
_local9 = (_local9 * 2);
map.tx = _local9;
_local10 = (_local10 * 2);
map.ty = _local10;
renderRec(_arg1, _local11, _local12, _arg4);
map.a = _local5;
map.b = _local6;
map.c = _local7;
map.d = _local8;
map.tx = (_local9 - 1);
map.ty = _local10;
renderRec(_local11, _arg2, _local13, _arg4);
map.a = _local5;
map.b = _local6;
map.c = _local7;
map.d = _local8;
map.tx = _local9;
map.ty = (_local10 - 1);
renderRec(_local12, _local13, _arg3, _arg4);
map.a = -(_local5);
map.b = -(_local6);
map.c = -(_local7);
map.d = -(_local8);
map.tx = (1 - _local9);
map.ty = (1 - _local10);
renderRec(_local13, _local12, _local11, _arg4);
return;
};
dmax = Math.max(dsab, Math.max(dsca, dsbc));
if (dsab == dmax){
var _temp4 = _arg4;
_arg4 = (_arg4 + 1);
_local11 = svArray[_temp4];
_local11.x = (mabx / 2);
_local11.y = (maby / 2);
_local11.z = ((az + bz) / 2);
_local5 = (_local5 * 2);
map.a = _local5;
_local7 = (_local7 * 2);
map.c = _local7;
_local9 = (_local9 * 2);
map.tx = _local9;
renderRec(_arg1, _local11, _arg3, _arg4);
map.a = (_local5 + _local6);
map.b = _local6;
map.c = (_local7 + _local8);
map.d = _local8;
map.tx = ((_local9 + _local10) - 1);
map.ty = _local10;
renderRec(_local11, _arg2, _arg3, _arg4);
return;
};
if (dsca == dmax){
var _temp5 = _arg4;
_arg4 = (_arg4 + 1);
_local12 = svArray[_temp5];
_local12.x = (mcax / 2);
_local12.y = (mcay / 2);
_local12.z = ((cz + az) / 2);
_local6 = (_local6 * 2);
map.b = _local6;
_local8 = (_local8 * 2);
map.d = _local8;
_local10 = (_local10 * 2);
map.ty = _local10;
renderRec(_arg1, _arg2, _local12, _arg4);
map.a = _local5;
map.b = (_local6 + _local5);
map.c = _local7;
map.d = (_local8 + _local7);
map.tx = _local9;
map.ty = ((_local10 + _local9) - 1);
renderRec(_local12, _arg2, _arg3, _arg4);
return;
};
map.a = (_local5 - _local6);
map.b = (_local6 * 2);
map.c = (_local7 - _local8);
map.d = (_local8 * 2);
map.tx = (_local9 - _local10);
map.ty = (_local10 * 2);
renderRec(_arg1, _arg2, _local13, _arg4);
map.a = (_local5 * 2);
map.b = (_local6 - _local5);
map.c = (_local7 * 2);
map.d = (_local8 - _local7);
map.tx = (_local9 * 2);
map.ty = (_local10 - _local9);
renderRec(_arg1, _local13, _arg3, _arg4);
}
public function get height():Number{
return (_bitmap.height);
}
public function get bitmap():BitmapData{
return (_bitmap);
}
public function shadeTriangle(_arg1:DrawTriangle):void{
}
public function createVertexArray():void{
var _local1:Number;
_local1 = 100;
while (_local1--) {
svArray.push(new ScreenVertex());
};
}
public function clearFaceDictionary():void{
for each (faceDictionaryVO in _faceDictionary) {
if (!faceDictionaryVO.dirty){
faceDictionaryVO.clear();
};
};
}
public function get visible():Boolean{
return (true);
}
public function getMapping(_arg1:DrawTriangle):Matrix{
return (((_arg1.texturemapping) || (_arg1.transformUV(this))));
}
public function renderTriangle(_arg1:DrawTriangle):void{
mapping = getMapping(_arg1);
if (precision){
session = _arg1.source.session;
focus = _arg1.projection.focus;
map.a = mapping.a;
map.b = mapping.b;
map.c = mapping.c;
map.d = mapping.d;
map.tx = mapping.tx;
map.ty = mapping.ty;
renderRec(_arg1.v0, _arg1.v1, _arg1.v2, 0);
} else {
_arg1.source.session.renderTriangleBitmap(_renderBitmap, mapping, _arg1.v0, _arg1.v1, _arg1.v2, smooth, repeat);
};
if (debug){
_arg1.source.session.renderTriangleLine(2, 0xFF, 1, _arg1.v0, _arg1.v1, _arg1.v2);
};
}
public function get width():Number{
return (_bitmap.width);
}
public function get faceDictionary():Dictionary{
return (_faceDictionary);
}
public function renderMaterial(_arg1:Mesh):void{
}
}
}//package away3d.core.material
Section 22
//BitmapMaterialContainer (away3d.core.material.BitmapMaterialContainer)
package away3d.core.material {
import flash.display.*;
import flash.geom.*;
import away3d.core.draw.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.*;
public class BitmapMaterialContainer extends BitmapMaterial implements ITriangleMaterial {
var _zeroRect:Rectangle;
var bitmapDictionaryFace:FaceDictionaryVO;
public var materials:Array;
var material:IUVMaterial;
var _height:Number;
var _bitmapRect:Rectangle;
var face:Face;
var dt:DrawTriangle;
var bitmapDictionarySource:FaceDictionaryVO;
var _width:Number;
var _transformDirty:Boolean;
public function BitmapMaterialContainer(_arg1:int, _arg2:int, _arg3:Object=null){
super(new BitmapData(_arg1, _arg2, true, 0xFFFFFF), _arg3);
_width = _arg1;
_height = _arg2;
_bitmapRect = new Rectangle(0, 0, _width, _height);
_arg3 = Init.parse(_arg3);
materials = _arg3.getArray("materials");
}
override public function getMapping(_arg1:DrawTriangle):Matrix{
face = _arg1.face;
dt = face._dt;
if (!dt.texturemapping){
_transformDirty = true;
face._bitmapRect = new Rectangle(int((_width * face.minU)), int((_height * (1 - face.maxV))), int(((_width * (face.maxU - face.minU)) + 2)), int(((_height * (face.maxV - face.minV)) + 2)));
dt.transformUV(this);
faceDictionaryVO = _faceDictionary[face];
if (faceDictionaryVO != null){
faceDictionaryVO.reset(face._bitmapRect.width, face._bitmapRect.height);
} else {
_faceDictionary[face] = new FaceDictionaryVO(face._bitmapRect.width, face._bitmapRect.height);
};
for each (material in materials) {
faceDictionaryVO = material.faceDictionary[face];
if (faceDictionaryVO != null){
faceDictionaryVO.reset(face._bitmapRect.width, face._bitmapRect.height);
};
};
} else {
for each (material in materials) {
if (((!(material.faceDictionary[face])) || (material.faceDictionary[face].dirty))){
_transformDirty = true;
};
};
};
if (!_arg1.texturemapping){
_arg1.transformUV(this);
};
faceDictionaryVO = _faceDictionary[face];
if (_transformDirty){
_transformDirty = false;
_zeroRect = new Rectangle(0, 0, face._bitmapRect.width, face._bitmapRect.height);
faceDictionaryVO.bitmap.lock();
faceDictionaryVO.clear();
for each (material in materials) {
bitmapDictionaryFace = material.faceDictionary[face];
bitmapDictionarySource = material.faceDictionary[_arg1.source];
if (((bitmapDictionarySource) && (!(bitmapDictionarySource.dirty)))){
bitmapDictionaryFace = bitmapDictionarySource;
} else {
if (((((!(bitmapDictionaryFace)) || (((bitmapDictionaryFace) && (bitmapDictionaryFace.dirty))))) || (((bitmapDictionarySource) && (bitmapDictionarySource.dirty))))){
material.renderFace(face, _bitmapRect);
};
};
bitmapDictionaryFace = material.faceDictionary[face];
bitmapDictionarySource = material.faceDictionary[_arg1.source];
if (((bitmapDictionarySource) && (bitmapDictionarySource.bitmap))){
faceDictionaryVO.bitmap.copyPixels(bitmapDictionarySource.bitmap, face._bitmapRect, _zeroPoint, null, null, true);
} else {
if (bitmapDictionaryFace.bitmap){
faceDictionaryVO.bitmap.copyPixels(bitmapDictionaryFace.bitmap, _zeroRect, _zeroPoint, null, null, true);
};
};
};
faceDictionaryVO.bitmap.unlock();
};
_renderBitmap = faceDictionaryVO.bitmap;
return (_arg1.texturemapping);
}
override public function renderMaterial(_arg1:Mesh):void{
}
}
}//package away3d.core.material
Section 23
//CenterLightingMaterial (away3d.core.material.CenterLightingMaterial)
package away3d.core.material {
import away3d.core.math.*;
import flash.display.*;
import away3d.core.render.*;
import away3d.core.scene.*;
import away3d.core.draw.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.*;
public class CenterLightingMaterial implements ITriangleMaterial {
var ksb:Number;
public var draw_fall_k:Number;// = 1
var diff:Number;
var ksr:Number;
var green:Number;
var source:PointLightSource;
var kdb:Number;
public var ak:Number;// = 20
public var draw_reflect_k:Number;// = 1
var kdg:Number;
var v0p:Number;
var dfy:Number;
var dfz:Number;
var kdr:Number;
var v0x:Number;
var v0y:Number;
var v0z:Number;
public var draw_normal:Boolean;// = false
var dfx:Number;
var rx:Number;
var ry:Number;
var rz:Number;
var sum:Number;
public var diffuse_brightness:Number;// = 1
var projection:Projection;
var v1p:Number;
public var ambient_brightness:Number;// = 1
var blue:Number;
var v1x:Number;
var v1y:Number;
var v1z:Number;
var ncy:Number;
var ncz:Number;
var ncx:Number;
var v2p:Number;
var cx:Number;
var v0:ScreenVertex;
var v1:ScreenVertex;
var v2:ScreenVertex;
var v2y:Number;
var v2z:Number;
var df:Number;
var v2x:Number;
var cz:Number;
var red:Number;
var graphics:Graphics;
public var draw_fall:Boolean;// = false
var cy:Number;
var fade:Number;
var session:RenderSession;
var amb:Number;
var ffy:Number;
var spec:Number;
var nf:Number;
var ffz:Number;
public var draw_reflect:Boolean;// = false
var rfx:Number;
var rfy:Number;
var rfz:Number;
var ffx:Number;
var d1x:Number;
var d1y:Number;
public var specular_brightness:Number;// = 1
var kag:Number;
var fx:Number;
var zoom:Number;
var kab:Number;
var kar:Number;
var focus:Number;
var fz:Number;
var d1z:Number;
var d2x:Number;
var c0x:Number;
var c0y:Number;
var c0z:Number;
var pdd:Number;
var pa:Number;
var d2y:Number;
var pc:Number;
var fy:Number;
var pb:Number;
var d2z:Number;
var ksg:Number;
public function CenterLightingMaterial(_arg1:Object=null){
ambient_brightness = 1;
diffuse_brightness = 1;
specular_brightness = 1;
ak = 20;
draw_normal = false;
draw_fall = false;
draw_fall_k = 1;
draw_reflect = false;
draw_reflect_k = 1;
super();
_arg1 = Init.parse(_arg1);
ak = _arg1.getNumber("ak", 20);
}
public function renderTri(_arg1:DrawTriangle, _arg2:RenderSession, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number):void{
throw (new Error("Not implemented"));
}
public function shadeTriangle(_arg1:DrawTriangle):void{
}
public function get visible():Boolean{
throw (new Error("Not implemented"));
}
public function renderTriangle(_arg1:DrawTriangle):void{
session = _arg1.source.session;
v0 = _arg1.v0;
v1 = _arg1.v1;
v2 = _arg1.v2;
projection = _arg1.projection;
focus = projection.focus;
zoom = projection.zoom;
v0z = v0.z;
v0p = ((1 + (v0z / focus)) / zoom);
v0x = (v0.x * v0p);
v0y = (v0.y * v0p);
v1z = v1.z;
v1p = ((1 + (v1z / focus)) / zoom);
v1x = (v1.x * v1p);
v1y = (v1.y * v1p);
v2z = v2.z;
v2p = ((1 + (v2z / focus)) / zoom);
v2x = (v2.x * v2p);
v2y = (v2.y * v2p);
d1x = (v1x - v0x);
d1y = (v1y - v0y);
d1z = (v1z - v0z);
d2x = (v2x - v0x);
d2y = (v2y - v0y);
d2z = (v2z - v0z);
pa = ((d1y * d2z) - (d1z * d2y));
pb = ((d1z * d2x) - (d1x * d2z));
pc = ((d1x * d2y) - (d1y * d2x));
pdd = Math.sqrt((((pa * pa) + (pb * pb)) + (pc * pc)));
pa = (pa / pdd);
pb = (pb / pdd);
pc = (pc / pdd);
c0x = (((v0x + v1x) + v2x) / 3);
c0y = (((v0y + v1y) + v2y) / 3);
c0z = (((v0z + v1z) + v2z) / 3);
kar = (kag = (kab = (kdr = (kdg = (kdb = (ksr = (ksg = (ksb = 0))))))));
for each (source in session.lightarray.points) {
red = source.red;
green = source.green;
blue = source.blue;
dfx = (source.x - c0x);
dfy = (source.y - c0y);
dfz = (source.z - c0z);
df = Math.sqrt((((dfx * dfx) + (dfy * dfy)) + (dfz * dfz)));
dfx = (dfx / df);
dfy = (dfy / df);
dfz = (dfz / df);
fade = ((1 / df) / df);
amb = ((source.ambient * fade) * ambient_brightness);
nf = (((dfx * pa) + (dfy * pb)) + (dfz * pc));
kar = (kar + (red * amb));
kag = (kag + (green * amb));
kab = (kab + (blue * amb));
if (nf < 0){
} else {
diff = (((source.diffuse * fade) * nf) * diffuse_brightness);
rfx = (dfx - ((2 * nf) * pa));
rfy = (dfy - ((2 * nf) * pb));
rfz = (dfz - ((2 * nf) * pc));
kdr = (kdr + (red * diff));
kdg = (kdg + (green * diff));
kdb = (kdb + (blue * diff));
if (rfz < 0){
} else {
spec = (((source.specular * fade) * Math.pow(rfz, ak)) * specular_brightness);
ksr = (ksr + (red * spec));
ksg = (ksg + (green * spec));
ksb = (ksb + (blue * spec));
};
};
};
renderTri(_arg1, session, kar, kag, kab, kdr, kdg, kdb, ksr, ksg, ksb);
if (((((draw_fall) || (draw_reflect))) || (draw_normal))){
graphics = session.graphics;
cz = c0z;
cx = ((c0x * zoom) / (1 + (cz / focus)));
cy = ((c0y * zoom) / (1 + (cz / focus)));
if (draw_normal){
ncz = (c0z + (30 * pc));
ncx = ((((c0x + (30 * pa)) * zoom) * focus) / (focus + ncz));
ncy = ((((c0y + (30 * pb)) * zoom) * focus) / (focus + ncz));
graphics.lineStyle(1, 0, 1);
graphics.moveTo(cx, cy);
graphics.lineTo(ncx, ncy);
graphics.moveTo(cx, cy);
graphics.drawCircle(cx, cy, 2);
};
if (((draw_fall) || (draw_reflect))){
for each (source in session.lightarray.points) {
red = source.red;
green = source.green;
blue = source.blue;
sum = (((red + green) + blue) / 0xFF);
red = (red / sum);
green = (green / sum);
blue = (blue / sum);
dfx = (source.x - c0x);
dfy = (source.y - c0y);
dfz = (source.z - c0z);
df = Math.sqrt((((dfx * dfx) + (dfy * dfy)) + (dfz * dfz)));
dfx = (dfx / df);
dfy = (dfy / df);
dfz = (dfz / df);
nf = (((dfx * pa) + (dfy * pb)) + (dfz * pc));
if (nf < 0){
} else {
if (draw_fall){
ffz = (c0z + ((30 * dfz) * (1 - draw_fall_k)));
ffx = ((((c0x + ((30 * dfx) * (1 - draw_fall_k))) * zoom) * focus) / (focus + ffz));
ffy = ((((c0y + ((30 * dfy) * (1 - draw_fall_k))) * zoom) * focus) / (focus + ffz));
fz = (c0z + (30 * dfz));
fx = ((((c0x + (30 * dfx)) * zoom) * focus) / (focus + fz));
fy = ((((c0y + (30 * dfy)) * zoom) * focus) / (focus + fz));
graphics.lineStyle(1, (((int(red) * 65536) + (int(green) * 0x0100)) + int(blue)), 1);
graphics.moveTo(ffx, ffy);
graphics.lineTo(fx, fy);
graphics.moveTo(ffx, ffy);
};
if (draw_reflect){
rfx = (dfx - ((2 * nf) * pa));
rfy = (dfy - ((2 * nf) * pb));
rfz = (dfz - ((2 * nf) * pc));
rz = (c0z - ((30 * rfz) * draw_reflect_k));
rx = ((((c0x - ((30 * rfx) * draw_reflect_k)) * zoom) * focus) / (focus + rz));
ry = ((((c0y - ((30 * rfy) * draw_reflect_k)) * zoom) * focus) / (focus + rz));
graphics.lineStyle(1, (((int((red * 0.5)) * 65536) + (int((green * 0.5)) * 0x0100)) + int((blue * 0.5))), 1);
graphics.moveTo(cx, cy);
graphics.lineTo(rx, ry);
graphics.moveTo(cx, cy);
};
};
};
};
};
}
}
}//package away3d.core.material
Section 24
//ColorMaterial (away3d.core.material.ColorMaterial)
package away3d.core.material {
import away3d.core.math.*;
import flash.display.*;
import away3d.core.render.*;
import away3d.core.scene.*;
import away3d.core.draw.*;
import away3d.core.utils.*;
import away3d.core.*;
public class ColorMaterial implements ITriangleMaterial {
public var color:uint;
public var alpha:Number;
public function ColorMaterial(_arg1=null, _arg2:Object=null){
if (_arg1 == null){
_arg1 = "random";
};
this.color = Cast.trycolor(_arg1);
_arg2 = Init.parse(_arg2);
alpha = _arg2.getNumber("alpha", 1, {min:0, max:1});
}
public function get visible():Boolean{
return ((alpha > 0));
}
public function shadeTriangle(_arg1:DrawTriangle):void{
}
public function renderTriangle(_arg1:DrawTriangle):void{
_arg1.source.session.renderTriangleColor(color, alpha, _arg1.v0, _arg1.v1, _arg1.v2);
}
}
}//package away3d.core.material
Section 25
//IMaterial (away3d.core.material.IMaterial)
package away3d.core.material {
public interface IMaterial {
function get visible():Boolean;
}
}//package away3d.core.material
Section 26
//ISegmentMaterial (away3d.core.material.ISegmentMaterial)
package away3d.core.material {
import away3d.core.draw.*;
public interface ISegmentMaterial extends IMaterial {
function renderSegment(_arg1:DrawSegment):void;
}
}//package away3d.core.material
Section 27
//ITriangleMaterial (away3d.core.material.ITriangleMaterial)
package away3d.core.material {
import away3d.core.draw.*;
public interface ITriangleMaterial extends IMaterial {
function shadeTriangle(_arg1:DrawTriangle):void;
function renderTriangle(_arg1:DrawTriangle):void;
}
}//package away3d.core.material
Section 28
//IUVMaterial (away3d.core.material.IUVMaterial)
package away3d.core.material {
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import away3d.core.mesh.*;
public interface IUVMaterial extends IMaterial {
function clearFaceDictionary():void;
function get width():Number;
function get height():Number;
function get bitmap():BitmapData;
function get faceDictionary():Dictionary;
function renderFace(_arg1:Face, _arg2:Rectangle):void;
function renderMaterial(_arg1:Mesh):void;
}
}//package away3d.core.material
Section 29
//MovieMaterial (away3d.core.material.MovieMaterial)
package away3d.core.material {
import away3d.core.math.*;
import flash.display.*;
import away3d.core.render.*;
import away3d.core.scene.*;
import flash.geom.*;
import away3d.core.draw.*;
import away3d.core.utils.*;
import away3d.core.*;
public class MovieMaterial extends TransformBitmapMaterial implements ITriangleMaterial, IUVMaterial {
public var interactive:Boolean;
public var movie:Sprite;
private var lastsession:int;
public var transparent:Boolean;
public var auto:Boolean;
public function MovieMaterial(_arg1:Sprite, _arg2:Object=null){
super(_bitmap, _arg2);
this.movie = _arg1;
_arg2 = Init.parse(_arg2);
transparent = _arg2.getBoolean("transparent", true);
auto = _arg2.getBoolean("auto", true);
interactive = _arg2.getBoolean("interactive", false);
_bitmap = (_renderBitmap = new BitmapData(_arg1.width, _arg1.height, transparent, (transparent) ? 0xFFFFFF : 4278190080));
}
public function update():void{
if (transparent){
_renderBitmap.fillRect(_renderBitmap.rect, 0xFFFFFF);
};
_renderBitmap.draw(movie, new Matrix(movie.scaleX, 0, 0, movie.scaleY), movie.transform.colorTransform);
}
public function resetInteractiveLayer():void{
movie.x = -10000;
movie.y = -10000;
}
public function onMouseMove(_arg1:MouseEvent3D):void{
movie.x = (_arg1.screenX - (_arg1.uv.u * movie.width));
movie.y = (_arg1.screenY - ((1 - _arg1.uv.v) * movie.height));
}
override public function get height():Number{
return (movie.height);
}
public function get normal():Number3D{
return (new Number3D(0, 0, 0));
}
public function get scale():Number2D{
return (new Number2D(0, 0));
}
public function onMouseOut(_arg1:MouseEvent3D):void{
if (_arg1.material == this){
_arg1.object.removeOnMouseMove(onMouseMove);
resetInteractiveLayer();
};
}
override public function renderTriangle(_arg1:DrawTriangle):void{
session = _arg1.source.session;
if (lastsession != session.time){
lastsession = session.time;
if (auto){
update();
};
if (interactive){
if (!session.view.interactiveLayer.contains(movie)){
session.view.interactiveLayer.addChild(movie);
resetInteractiveLayer();
_arg1.source.addOnMouseOver(onMouseOver);
_arg1.source.addOnMouseOut(onMouseOut);
};
};
};
super.renderTriangle(_arg1);
}
override public function get width():Number{
return (movie.width);
}
public function onMouseOver(_arg1:MouseEvent3D):void{
if (_arg1.material == this){
_arg1.object.addOnMouseMove(onMouseMove);
onMouseMove(_arg1);
};
}
}
}//package away3d.core.material
Section 30
//ShadingColorMaterial (away3d.core.material.ShadingColorMaterial)
package away3d.core.material {
import away3d.core.math.*;
import away3d.core.render.*;
import away3d.core.scene.*;
import away3d.core.draw.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.*;
public class ShadingColorMaterial extends CenterLightingMaterial {
var fr:int;
public var static:Boolean;
public var specular:int;
public var diffuse:int;
var sfb:int;
public var alpha:Number;
var sfr:int;
var fg:int;
var sfg:int;
public var ambient:int;
var fb:int;
public function ShadingColorMaterial(_arg1:Object=null){
var _local2:int;
super(_arg1);
_arg1 = Init.parse(_arg1);
_local2 = _arg1.getColor("color", 0xFFFFFF);
ambient = _arg1.getColor("ambient", _local2);
diffuse = _arg1.getColor("diffuse", _local2);
specular = _arg1.getColor("specular", _local2);
alpha = _arg1.getNumber("alpha", 1);
static = _arg1.getBoolean("static", false);
}
override public function renderTri(_arg1:DrawTriangle, _arg2:RenderSession, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number):void{
fr = int((((((ambient & 0xFF0000) * _arg3) + ((diffuse & 0xFF0000) * _arg6)) + ((specular & 0xFF0000) * _arg9)) >> 16));
fg = int((((((ambient & 0xFF00) * _arg4) + ((diffuse & 0xFF00) * _arg7)) + ((specular & 0xFF00) * _arg10)) >> 8));
fb = int(((((ambient & 0xFF) * _arg5) + ((diffuse & 0xFF) * _arg8)) + ((specular & 0xFF) * _arg11)));
if (fr > 0xFF){
fr = 0xFF;
};
if (fg > 0xFF){
fg = 0xFF;
};
if (fb > 0xFF){
fb = 0xFF;
};
_arg2.renderTriangleColor((((fr << 16) | (fg << 8)) | fb), alpha, _arg1.v0, _arg1.v1, _arg1.v2);
if (static){
if (_arg1.face != null){
sfr = int(((((ambient & 0xFF0000) * _arg3) + ((diffuse & 0xFF0000) * _arg6)) >> 16));
sfg = int(((((ambient & 0xFF00) * _arg4) + ((diffuse & 0xFF00) * _arg7)) >> 8));
sfb = int((((ambient & 0xFF) * _arg5) + ((diffuse & 0xFF) * _arg8)));
if (sfr > 0xFF){
sfr = 0xFF;
};
if (sfg > 0xFF){
sfg = 0xFF;
};
if (sfb > 0xFF){
sfb = 0xFF;
};
_arg1.face.material = new ColorMaterial((((sfr << 16) | (sfg << 8)) | sfb));
};
};
}
override public function get visible():Boolean{
return (true);
}
}
}//package away3d.core.material
Section 31
//TransformBitmapMaterial (away3d.core.material.TransformBitmapMaterial)
package away3d.core.material {
import away3d.core.math.*;
import flash.display.*;
import away3d.core.render.*;
import away3d.core.scene.*;
import flash.geom.*;
import away3d.core.draw.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.*;
public class TransformBitmapMaterial extends BitmapMaterial implements ITriangleMaterial, IUVMaterial {
var overlap:Boolean;
var face:Face;
var h:Number;
var i:String;
var t:Matrix;
var w:Number;
var mapa:Number;
var mapb:Number;
var mapd:Number;
var mapc:Number;
var point1:Point;
var DOWN:Number3D;
var fPoint1:Point;
var fPoint2:Point;
var fPoint3:Point;
var zero:Number;
var fPoint4:Point;
var point3:Point;
var point2:Point;
var _projectionVector:Number3D;
var _rotation:Number;// = 0
var maptx:Number;
var _offsetY:Number;// = 0
var _offsetX:Number;// = 0
public var throughProjection:Boolean;
var mapty:Number;
var _u0:Number;
var _u1:Number;
var _u2:Number;
var _v0:Number;
var _v2:Number;
var _v1:Number;
var v0y:Number;
var v0z:Number;
var v0x:Number;
var dot:Number;
var _bitmapRect:Rectangle;
var v1y:Number;
var v1z:Number;
var _scaleX:Number;// = 1
var _scaleY:Number;// = 1
var mPoint2:Point;
var mPoint3:Point;
var mPoint4:Point;
var v1x:Number;
var v2x:Number;
var v2y:Number;
var flag:Boolean;
var v2z:Number;
var mPoint1:Point;
var point:Point;
var sign:Number;
var _M:Number3D;
var _N:Number3D;
var transformDirty:Boolean;
var _transform:Matrix;
var line:Point;
var RIGHT:Number3D;
public function TransformBitmapMaterial(_arg1:BitmapData, _arg2:Object=null){
_transform = new Matrix();
_scaleX = 1;
_scaleY = 1;
_offsetX = 0;
_offsetY = 0;
_rotation = 0;
_N = new Number3D();
_M = new Number3D();
DOWN = new Number3D(0, -1, 0);
RIGHT = new Number3D(1, 0, 0);
fPoint1 = new Point();
fPoint2 = new Point();
fPoint3 = new Point();
fPoint4 = new Point();
mPoint1 = new Point();
mPoint2 = new Point();
mPoint3 = new Point();
mPoint4 = new Point();
line = new Point();
super(_arg1, _arg2);
_arg2 = Init.parse(_arg2);
transform = _arg2.getObject("transform", Matrix);
scaleX = _arg2.getNumber("scaleX", _scaleX);
scaleY = _arg2.getNumber("scaleY", _scaleY);
offsetX = _arg2.getNumber("offsetX", _offsetX);
offsetY = _arg2.getNumber("offsetY", _offsetY);
rotation = _arg2.getNumber("rotation", _rotation);
projectionVector = _arg2.getObject("projectionVector", Number3D);
throughProjection = _arg2.getBoolean("throughProjection", false);
}
public function get offsetX():Number{
return (_offsetX);
}
public function get offsetY():Number{
return (_offsetY);
}
public function set offsetX(_arg1:Number):void{
if (isNaN(_arg1)){
throw (new Error("isNaN(offsetX)"));
};
if (_arg1 == Infinity){
Debug.warning("offsetX == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("offsetX == -Infinity");
};
_offsetX = _arg1;
clearFaceDictionary();
transformDirty = true;
}
public function set offsetY(_arg1:Number):void{
if (isNaN(_arg1)){
throw (new Error("isNaN(offsetY)"));
};
if (_arg1 == Infinity){
Debug.warning("offsetY == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("offsetY == -Infinity");
};
_offsetY = _arg1;
clearFaceDictionary();
transformDirty = true;
}
public function get scaleX():Number{
return (_scaleX);
}
public function get scaleY():Number{
return (_scaleY);
}
override public function clearFaceDictionary():void{
if (!transformDirty){
super.clearFaceDictionary();
};
}
public function getContainerPoints(_arg1:Rectangle):Array{
return ([_arg1.topLeft, new Point(_arg1.top, _arg1.right), _arg1.bottomRight, new Point(_arg1.bottom, _arg1.left)]);
}
public function get projectionVector():Number3D{
return (_projectionVector);
}
override public function getMapping(_arg1:DrawTriangle):Matrix{
face = _arg1.face;
faceDictionaryVO = _faceDictionary[face];
if (((((!(faceDictionaryVO)) || (faceDictionaryVO.dirty))) || (!(_arg1.texturemapping)))){
if (!faceDictionaryVO){
_faceDictionary[face] = new FaceDictionaryVO();
} else {
faceDictionaryVO.dirty = false;
};
if (projectionVector){
_arg1.texturemapping = projectUV(_arg1);
} else {
_arg1.transformUV(this);
};
if (_transform){
mapping = _transform.clone();
mapping.concat(_arg1.texturemapping);
return ((_arg1.texturemapping = mapping));
};
};
return (_arg1.texturemapping);
}
public function set scaleY(_arg1:Number):void{
if (isNaN(_arg1)){
throw (new Error("isNaN(scaleY)"));
};
if (_arg1 == Infinity){
Debug.warning("scaleY == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("scaleY == -Infinity");
};
if (_arg1 == 0){
Debug.warning("scaleY == 0");
};
_scaleY = _arg1;
clearFaceDictionary();
transformDirty = true;
}
public function updateTransform():void{
if ((((((((((_scaleX == 1)) && ((_scaleY == 1)))) && ((_offsetX == 0)))) && ((_offsetY == 0)))) && ((_rotation == 0)))){
_transform = null;
} else {
_transform = new Matrix();
_transform.scale(_scaleX, _scaleY);
_transform.rotate(_rotation);
_transform.translate(_offsetX, _offsetY);
};
transformDirty = false;
}
public function set scaleX(_arg1:Number):void{
if (isNaN(_arg1)){
throw (new Error("isNaN(scaleX)"));
};
if (_arg1 == Infinity){
Debug.warning("scaleX == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("scaleX == -Infinity");
};
if (_arg1 == 0){
Debug.warning("scaleX == 0");
};
_scaleX = _arg1;
clearFaceDictionary();
transformDirty = true;
}
public function set transform(_arg1:Matrix):void{
_transform = _arg1;
if (_transform){
_rotation = Math.atan2(_transform.b, _transform.a);
_scaleX = (_transform.a / Math.cos(_rotation));
_scaleY = (_transform.d / Math.cos(_rotation));
_offsetX = _transform.tx;
_offsetY = _transform.ty;
} else {
_scaleX = (_scaleY = 1);
_offsetX = (_offsetY = (_rotation = 0));
};
clearFaceDictionary();
}
public function set projectionVector(_arg1:Number3D):void{
_projectionVector = _arg1;
if (_projectionVector){
_N.cross(_projectionVector, DOWN);
if (!_N.modulo){
_N = RIGHT;
};
_M.cross(_N, _projectionVector);
_N.cross(_M, _projectionVector);
_N.normalize();
_M.normalize();
};
clearFaceDictionary();
}
public function checkEdge(_arg1:Array, _arg2:Array):Boolean{
for (i in _arg1) {
point2 = _arg1[i];
if (int(i) == 0){
point1 = _arg1[(_arg1.length - 1)];
point3 = _arg1[(_arg1.length - 2)];
} else {
point1 = _arg1[(int(i) - 1)];
if (int(i) == 1){
point3 = _arg1[(_arg1.length - 1)];
} else {
point3 = _arg1[(int(i) - 2)];
};
};
line.x = (point2.y - point1.y);
line.y = (point1.x - point2.x);
zero = ((point1.x * line.x) + (point1.y * line.y));
sign = ((zero - (point3.x * line.x)) - (point3.y * line.y));
flag = true;
for each (point in _arg2) {
dot = ((point.x * line.x) + (point.y * line.y));
if ((zero * sign) > (dot * sign)){
flag = false;
break;
};
};
if (flag){
return (true);
};
};
return (false);
}
override public function renderMaterial(_arg1:Mesh):void{
}
public function set rotation(_arg1:Number):void{
if (isNaN(_arg1)){
throw (new Error("isNaN(rotation)"));
};
if (_arg1 == Infinity){
Debug.warning("rotation == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("rotation == -Infinity");
};
_rotation = _arg1;
clearFaceDictionary();
transformDirty = true;
}
public function findSeparatingAxis(_arg1:Array, _arg2:Array):Boolean{
if (checkEdge(_arg1, _arg2)){
return (true);
};
if (checkEdge(_arg2, _arg1)){
return (true);
};
return (false);
}
override public function renderFace(_arg1:Face, _arg2:Rectangle):void{
if (transformDirty){
updateTransform();
};
if (_transform){
mapping = _transform.clone();
} else {
mapping = new Matrix();
};
faceDictionaryVO = _faceDictionary[_arg1];
if (_projectionVector){
mapping.concat(projectUV(_arg1._dt));
mapping.concat(_arg1._dt.invtexturemapping);
_bitmapRect = _arg1._bitmapRect;
if (!faceDictionaryVO){
faceDictionaryVO = (_faceDictionary[_arg1] = new FaceDictionaryVO());
} else {
faceDictionaryVO.dirty = false;
};
if (((!(repeat)) && (findSeparatingAxis(getFacePoints(_arg1._dt.invtexturemapping), getMappingPoints(mapping))))){
return;
};
} else {
_bitmapRect = _arg2;
mapping.scale((_bitmapRect.width / width), (_bitmapRect.height / height));
if (!faceDictionaryVO){
faceDictionaryVO = (_faceDictionary[_arg1.parent] = new FaceDictionaryVO());
} else {
faceDictionaryVO.dirty = false;
};
};
if (((((_projectionVector) && (!(throughProjection)))) && ((_arg1.normal.dot(_projectionVector) < 0)))){
return;
};
if (!faceDictionaryVO.bitmap){
faceDictionaryVO.bitmap = new BitmapData(_bitmapRect.width, _bitmapRect.height, true, 0);
};
if ((((((((((((mapping.a == 1)) && ((mapping.d == 1)))) && ((mapping.b == 0)))) && ((mapping.c == 0)))) && ((mapping.tx == 0)))) && ((mapping.ty == 0)))){
faceDictionaryVO.bitmap.copyPixels(_bitmap, _bitmapRect, _zeroPoint);
} else {
graphics = shape.graphics;
graphics.clear();
graphics.beginBitmapFill(_bitmap, mapping, repeat, smooth);
graphics.drawRect(0, 0, _bitmapRect.width, _bitmapRect.height);
graphics.endFill();
faceDictionaryVO.bitmap.draw(shape);
};
}
final public function projectUV(_arg1:DrawTriangle):Matrix{
face = _arg1.face;
if (_arg1.backface){
v0x = face.v0.x;
v0y = face.v0.y;
v0z = face.v0.z;
v2x = face.v1.x;
v2y = face.v1.y;
v2z = face.v1.z;
v1x = face.v2.x;
v1y = face.v2.y;
v1z = face.v2.z;
} else {
v0x = face.v0.x;
v0y = face.v0.y;
v0z = face.v0.z;
v1x = face.v1.x;
v1y = face.v1.y;
v1z = face.v1.z;
v2x = face.v2.x;
v2y = face.v2.y;
v2z = face.v2.z;
};
_u0 = (((v0x * _N.x) + (v0y * _N.y)) + (v0z * _N.z));
_u1 = (((v1x * _N.x) + (v1y * _N.y)) + (v1z * _N.z));
_u2 = (((v2x * _N.x) + (v2y * _N.y)) + (v2z * _N.z));
_v0 = (((v0x * _M.x) + (v0y * _M.y)) + (v0z * _M.z));
_v1 = (((v1x * _M.x) + (v1y * _M.y)) + (v1z * _M.z));
_v2 = (((v2x * _M.x) + (v2y * _M.y)) + (v2z * _M.z));
if ((((((_u0 == _u1)) && ((_v0 == _v1)))) || ((((_u0 == _u2)) && ((_v0 == _v2)))))){
if (_u0 > 0.05){
_u0 = (_u0 - 0.05);
} else {
_u0 = (_u0 + 0.05);
};
if (_v0 > 0.07){
_v0 = (_v0 - 0.07);
} else {
_v0 = (_v0 + 0.07);
};
};
if ((((_u2 == _u1)) && ((_v2 == _v1)))){
if (_u2 > 0.04){
_u2 = (_u2 - 0.04);
} else {
_u2 = (_u2 + 0.04);
};
if (_v2 > 0.06){
_v2 = (_v2 - 0.06);
} else {
_v2 = (_v2 + 0.06);
};
};
t = new Matrix((_u1 - _u0), (_v1 - _v0), (_u2 - _u0), (_v2 - _v0), _u0, _v0);
t.invert();
return (t);
}
public function get transform():Matrix{
return (_transform);
}
public function get rotation():Number{
return (_rotation);
}
public function getFacePoints(_arg1:Matrix):Array{
fPoint1.x = (_u0 = _arg1.tx);
fPoint2.x = (_arg1.a + _u0);
fPoint3.x = (_arg1.c + _u0);
fPoint1.y = (_v0 = _arg1.ty);
fPoint2.y = (_arg1.b + _v0);
fPoint3.y = (_arg1.d + _v0);
return ([fPoint1, fPoint2, fPoint3]);
}
public function getMappingPoints(_arg1:Matrix):Array{
mapa = (_arg1.a * width);
mapb = (_arg1.b * height);
mapc = (_arg1.c * width);
mapd = (_arg1.d * height);
maptx = _arg1.tx;
mapty = _arg1.ty;
mPoint1.x = maptx;
mPoint1.y = mapty;
mPoint2.x = (maptx + mapc);
mPoint2.y = (mapty + mapd);
mPoint3.x = ((maptx + mapa) + mapc);
mPoint3.y = ((mapty + mapb) + mapd);
mPoint4.x = (maptx + mapa);
mPoint4.y = (mapty + mapb);
return ([mPoint1, mPoint2, mPoint3, mPoint4]);
}
override public function renderTriangle(_arg1:DrawTriangle):void{
if (transformDirty){
updateTransform();
};
super.renderTriangle(_arg1);
}
}
}//package away3d.core.material
Section 32
//TransparentMaterial (away3d.core.material.TransparentMaterial)
package away3d.core.material {
import away3d.core.draw.*;
public final class TransparentMaterial implements ITriangleMaterial, ISegmentMaterial {
public static var INSTANCE:TransparentMaterial = new (TransparentMaterial);
;
public function renderTriangle(_arg1:DrawTriangle):void{
}
public function get visible():Boolean{
return (false);
}
public function shadeTriangle(_arg1:DrawTriangle):void{
}
public function renderSegment(_arg1:DrawSegment):void{
}
}
}//package away3d.core.material
Section 33
//WhiteShadingBitmapMaterial (away3d.core.material.WhiteShadingBitmapMaterial)
package away3d.core.material {
import away3d.core.math.*;
import flash.utils.*;
import flash.display.*;
import away3d.core.render.*;
import away3d.core.scene.*;
import flash.geom.*;
import away3d.core.draw.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import flash.filters.*;
import away3d.core.*;
public class WhiteShadingBitmapMaterial extends CenterLightingMaterial implements IUVMaterial {
var br:Number;
public var blackrender:Boolean;
var faceDictionaryVO:FaceDictionaryVO;
var mapping:Matrix;
private var step:int;// = 1
var _faceDictionary:Dictionary;
public var whiterender:Boolean;
private var colorTransform:ColorMatrixFilter;
public var diffuse:BitmapData;
public var whitek:Number;// = 0.2
private var cache:Dictionary;
public var repeat:Boolean;
public var smooth:Boolean;
private var bitmapPoint:Point;
public function WhiteShadingBitmapMaterial(_arg1:BitmapData, _arg2:Object=null){
_faceDictionary = new Dictionary(true);
whitek = 0.2;
bitmapPoint = new Point(0, 0);
colorTransform = new ColorMatrixFilter();
cache = new Dictionary();
step = 1;
super(_arg2);
this.diffuse = _arg1;
_arg2 = Init.parse(_arg2);
smooth = _arg2.getBoolean("smooth", false);
repeat = _arg2.getBoolean("repeat", false);
}
public function doubleStepTo(_arg1:int):void{
if (step < _arg1){
step = (step * 2);
};
}
protected function ladder(_arg1:Number):Number{
if (_arg1 < (1 / 0xFF)){
return (0);
};
if (_arg1 > 0xFF){
_arg1 = 0xFF;
};
return (Math.exp((Math.round((Math.log(_arg1) * step)) / step)));
}
override public function renderTri(_arg1:DrawTriangle, _arg2:RenderSession, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number):void{
var _local12:Number;
var _local13:BitmapData;
br = (((((((((_arg3 + _arg4) + _arg5) + _arg6) + _arg7) + _arg8) + _arg9) + _arg10) + _arg11) / 3);
if (!(mapping = _arg1.texturemapping)){
mapping = (_arg1.texturemapping = _arg1.transformUV(this));
};
v0 = _arg1.v0;
v1 = _arg1.v1;
v2 = _arg1.v2;
if ((((br < 1)) && (((blackrender) || ((((step < 16)) && (!(diffuse.transparent)))))))){
_arg2.renderTriangleBitmap(diffuse, mapping, v0, v1, v2, smooth, repeat);
_arg2.renderTriangleColor(0, (1 - br), v0, v1, v2);
} else {
if ((((br > 1)) && (whiterender))){
_arg2.renderTriangleBitmap(diffuse, mapping, v0, v1, v2, smooth, repeat);
_arg2.renderTriangleColor(0xFFFFFF, ((br - 1) * whitek), v0, v1, v2);
} else {
if (step < 64){
if (Math.random() < 0.01){
doubleStepTo(64);
};
};
_local12 = ladder(br);
_local13 = cache[_local12];
if (_local13 == null){
_local13 = new BitmapData(diffuse.width, diffuse.height, true, 0);
colorTransform.matrix = [_local12, 0, 0, 0, 0, 0, _local12, 0, 0, 0, 0, 0, _local12, 0, 0, 0, 0, 0, 1, 0];
_local13.applyFilter(diffuse, _local13.rect, bitmapPoint, colorTransform);
cache[_local12] = _local13;
};
_arg2.renderTriangleBitmap(_local13, ((_arg1.texturemapping) || (_arg1.transformUV(this))), v0, v1, v2, smooth, repeat);
};
};
}
public function clearFaceDictionary():void{
for each (faceDictionaryVO in _faceDictionary) {
if (!faceDictionaryVO.dirty){
faceDictionaryVO.clear();
};
};
}
override public function get visible():Boolean{
return (true);
}
public function get faceDictionary():Dictionary{
return (_faceDictionary);
}
public function renderMaterial(_arg1:Mesh):void{
}
public function renderFace(_arg1:Face, _arg2:Rectangle):void{
}
public function get height():Number{
return (diffuse.height);
}
public function get bitmap():BitmapData{
return (diffuse);
}
public function get width():Number{
return (diffuse.width);
}
}
}//package away3d.core.material
Section 34
//WireColorMaterial (away3d.core.material.WireColorMaterial)
package away3d.core.material {
import away3d.core.math.*;
import flash.display.*;
import away3d.core.render.*;
import away3d.core.scene.*;
import away3d.core.draw.*;
import away3d.core.utils.*;
import away3d.core.*;
public class WireColorMaterial implements ITriangleMaterial {
public var color:int;
public var alpha:Number;
public var width:Number;
public var wirealpha:Number;
var graphics:Graphics;
public var wirecolor:int;
public function WireColorMaterial(_arg1=null, _arg2:Object=null){
if (_arg1 == null){
_arg1 = "random";
};
this.color = Cast.trycolor(_arg1);
_arg2 = Init.parse(_arg2);
alpha = _arg2.getNumber("alpha", 1, {min:0, max:1});
wirecolor = _arg2.getColor("wirecolor", 0);
width = _arg2.getNumber("width", 1, {min:0});
wirealpha = _arg2.getNumber("wirealpha", 1, {min:0, max:1});
}
public function renderTriangle(_arg1:DrawTriangle):void{
_arg1.source.session.renderTriangleLineFill(color, alpha, wirecolor, wirealpha, width, _arg1.v0, _arg1.v1, _arg1.v2);
}
public function get visible():Boolean{
return ((((alpha > 0)) || ((wirealpha > 0))));
}
public function shadeTriangle(_arg1:DrawTriangle):void{
}
}
}//package away3d.core.material
Section 35
//WireframeMaterial (away3d.core.material.WireframeMaterial)
package away3d.core.material {
import away3d.core.math.*;
import flash.display.*;
import away3d.core.render.*;
import away3d.core.scene.*;
import away3d.core.draw.*;
import away3d.core.utils.*;
import away3d.core.*;
public class WireframeMaterial implements ITriangleMaterial, ISegmentMaterial {
public var color:int;
public var width:Number;
public var alpha:Number;
public function WireframeMaterial(_arg1=null, _arg2:Object=null){
if (_arg1 == null){
_arg1 = "random";
};
this.color = Cast.trycolor(_arg1);
_arg2 = Init.parse(_arg2);
alpha = _arg2.getNumber("alpha", 1, {min:0, max:1});
width = _arg2.getNumber("width", 1, {min:0});
}
public function renderTriangle(_arg1:DrawTriangle):void{
if (alpha <= 0){
return;
};
_arg1.source.session.renderTriangleLine(color, alpha, width, _arg1.v0, _arg1.v1, _arg1.v2);
}
public function get visible():Boolean{
return ((alpha > 0));
}
public function shadeTriangle(_arg1:DrawTriangle):void{
}
public function renderSegment(_arg1:DrawSegment):void{
var _local2:Graphics;
if (alpha <= 0){
return;
};
_local2 = _arg1.source.session.graphics;
_local2.lineStyle(width, color, alpha);
_local2.moveTo(_arg1.v0.x, _arg1.v0.y);
_local2.lineTo(_arg1.v1.x, _arg1.v1.y);
_local2.moveTo(_arg1.v0.x, _arg1.v0.y);
}
}
}//package away3d.core.material
Section 36
//Matrix3D (away3d.core.math.Matrix3D)
package away3d.core.math {
public final class Matrix3D {
private var xx:Number;
private var xy:Number;
private var xz:Number;
private var yw:Number;
private var yz:Number;
private var yy:Number;
private var scos:Number;
private var nCos:Number;
private var zw:Number;
private var m211:Number;
private var m213:Number;
private var m212:Number;
private var m214:Number;
private var suv:Number;
private var suw:Number;
private var zz:Number;
private var su:Number;
private var sv:Number;
private var m221:Number;
private var m222:Number;
private var m224:Number;
private var sw:Number;
private var m:Matrix3D;
private var d:Number;
private var svw:Number;
private var m223:Number;
private var m231:Number;
public var tx:Number;
public var ty:Number;
public var tz:Number;
private var m114:Number;
var _position:Number3D;
private var m111:Number;
private var m112:Number;
private var m113:Number;
private var m232:Number;
private var m233:Number;
private var m234:Number;
private var nSin:Number;
private var m121:Number;
private var m123:Number;
private var m122:Number;
private var m124:Number;
public var sxx:Number;
public var sxy:Number;
public var sxz:Number;
private var m131:Number;
private var m132:Number;
private var m133:Number;
private var m134:Number;
public var syx:Number;
public var syy:Number;
public var syz:Number;
public var szx:Number;
public var szy:Number;
public var szz:Number;
private var xw:Number;
private static const toDEGREES:Number = 57.2957795130823;
private static const toRADIANS:Number = 0.0174532925199433;
public function Matrix3D(){
_position = new Number3D();
super();
sxx = (syy = (szz = 1));
sxy = (sxz = (tx = (syx = (syz = (ty = (szx = (szy = (tz = 0))))))));
}
public function get det():Number{
return ((((((sxx * syy) - (syx * sxy)) * szz) - (((sxx * szy) - (szx * sxy)) * syz)) + (((syx * szy) - (szx * syy)) * sxz)));
}
public function multiply(_arg1:Matrix3D, _arg2:Matrix3D):void{
m111 = _arg1.sxx;
m211 = _arg2.sxx;
m121 = _arg1.syx;
m221 = _arg2.syx;
m131 = _arg1.szx;
m231 = _arg2.szx;
m112 = _arg1.sxy;
m212 = _arg2.sxy;
m122 = _arg1.syy;
m222 = _arg2.syy;
m132 = _arg1.szy;
m232 = _arg2.szy;
m113 = _arg1.sxz;
m213 = _arg2.sxz;
m123 = _arg1.syz;
m223 = _arg2.syz;
m133 = _arg1.szz;
m233 = _arg2.szz;
m114 = _arg1.tx;
m214 = _arg2.tx;
m124 = _arg1.ty;
m224 = _arg2.ty;
m134 = _arg1.tz;
m234 = _arg2.tz;
sxx = (((m111 * m211) + (m112 * m221)) + (m113 * m231));
sxy = (((m111 * m212) + (m112 * m222)) + (m113 * m232));
sxz = (((m111 * m213) + (m112 * m223)) + (m113 * m233));
tx = ((((m111 * m214) + (m112 * m224)) + (m113 * m234)) + m114);
syx = (((m121 * m211) + (m122 * m221)) + (m123 * m231));
syy = (((m121 * m212) + (m122 * m222)) + (m123 * m232));
syz = (((m121 * m213) + (m122 * m223)) + (m123 * m233));
ty = ((((m121 * m214) + (m122 * m224)) + (m123 * m234)) + m124);
szx = (((m131 * m211) + (m132 * m221)) + (m133 * m231));
szy = (((m131 * m212) + (m132 * m222)) + (m133 * m232));
szz = (((m131 * m213) + (m132 * m223)) + (m133 * m233));
tz = ((((m131 * m214) + (m132 * m224)) + (m133 * m234)) + m134);
}
public function get position():Number3D{
_position.x = tx;
_position.y = ty;
_position.z = tz;
return (_position);
}
public function inverse(_arg1:Matrix3D):void{
d = _arg1.det;
if (Math.abs(d) < 0.001){
return;
};
d = (1 / d);
m111 = _arg1.sxx;
m121 = _arg1.syx;
m131 = _arg1.szx;
m112 = _arg1.sxy;
m122 = _arg1.syy;
m132 = _arg1.szy;
m113 = _arg1.sxz;
m123 = _arg1.syz;
m133 = _arg1.szz;
m114 = _arg1.tx;
m124 = _arg1.ty;
m134 = _arg1.tz;
sxx = (d * ((m122 * m133) - (m132 * m123)));
sxy = (-(d) * ((m112 * m133) - (m132 * m113)));
sxz = (d * ((m112 * m123) - (m122 * m113)));
tx = (-(d) * (((m112 * ((m123 * m134) - (m133 * m124))) - (m122 * ((m113 * m134) - (m133 * m114)))) + (m132 * ((m113 * m124) - (m123 * m114)))));
syx = (-(d) * ((m121 * m133) - (m131 * m123)));
syy = (d * ((m111 * m133) - (m131 * m113)));
syz = (-(d) * ((m111 * m123) - (m121 * m113)));
ty = (d * (((m111 * ((m123 * m134) - (m133 * m124))) - (m121 * ((m113 * m134) - (m133 * m114)))) + (m131 * ((m113 * m124) - (m123 * m114)))));
szx = (d * ((m121 * m132) - (m131 * m122)));
szy = (-(d) * ((m111 * m132) - (m131 * m112)));
szz = (d * ((m111 * m122) - (m121 * m112)));
tz = (-(d) * (((m111 * ((m122 * m134) - (m132 * m124))) - (m121 * ((m112 * m134) - (m132 * m114)))) + (m131 * ((m112 * m124) - (m122 * m114)))));
}
public function scale(_arg1:Number, _arg2:Number, _arg3:Number):void{
sxx = (sxx * _arg1);
syx = (syx * _arg1);
szx = (szx * _arg1);
sxy = (sxy * _arg2);
syy = (syy * _arg2);
szy = (szy * _arg2);
sxz = (sxz * _arg3);
syz = (syz * _arg3);
szz = (szz * _arg3);
}
public function clone():Matrix3D{
m = new Matrix3D();
m.sxx = sxx;
m.sxy = sxy;
m.sxz = sxz;
m.tx = tx;
m.syx = syx;
m.syy = syy;
m.syz = syz;
m.ty = ty;
m.szx = szx;
m.szy = szy;
m.szz = szz;
m.tz = tz;
return (m);
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + ((((((((int((sxx * 1000)) / 1000) + "\t\t") + (int((sxy * 1000)) / 1000)) + "\t\t") + (int((sxz * 1000)) / 1000)) + "\t\t") + (int((tx * 1000)) / 1000)) + "\n"));
_local1 = (_local1 + ((((((((int((syx * 1000)) / 1000) + "\t\t") + (int((syy * 1000)) / 1000)) + "\t\t") + (int((syz * 1000)) / 1000)) + "\t\t") + (int((ty * 1000)) / 1000)) + "\n"));
_local1 = (_local1 + ((((((((int((szx * 1000)) / 1000) + "\t\t") + (int((szy * 1000)) / 1000)) + "\t\t") + (int((szz * 1000)) / 1000)) + "\t\t") + (int((tz * 1000)) / 1000)) + "\n"));
return (_local1);
}
public function matrix2euler():Number3D{
var _local1:Number3D;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = new Number3D();
_local2 = -(Math.asin(Math.max(-1, Math.min(1, sxz))));
_local3 = Math.cos(_local2);
_local1.y = (_local2 * toDEGREES);
if (Math.abs(_local3) > 0.005){
_local4 = (szz / _local3);
_local5 = (-(syz) / _local3);
_local1.x = (Math.atan2(_local5, _local4) * toDEGREES);
_local4 = (sxx / _local3);
_local5 = (-(sxy) / _local3);
_local1.z = (Math.atan2(_local5, _local4) * toDEGREES);
} else {
_local1.x = 0;
_local4 = syy;
_local5 = syx;
_local1.z = (Math.atan2(_local5, _local4) * toDEGREES);
};
return (_local1);
}
public function multiply3x3(_arg1:Matrix3D, _arg2:Matrix3D):void{
m111 = _arg1.sxx;
m211 = _arg2.sxx;
m121 = _arg1.syx;
m221 = _arg2.syx;
m131 = _arg1.szx;
m231 = _arg2.szx;
m112 = _arg1.sxy;
m212 = _arg2.sxy;
m122 = _arg1.syy;
m222 = _arg2.syy;
m132 = _arg1.szy;
m232 = _arg2.szy;
m113 = _arg1.sxz;
m213 = _arg2.sxz;
m123 = _arg1.syz;
m223 = _arg2.syz;
m133 = _arg1.szz;
m233 = _arg2.szz;
sxx = (((m111 * m211) + (m112 * m221)) + (m113 * m231));
sxy = (((m111 * m212) + (m112 * m222)) + (m113 * m232));
sxz = (((m111 * m213) + (m112 * m223)) + (m113 * m233));
syx = (((m121 * m211) + (m122 * m221)) + (m123 * m231));
syy = (((m121 * m212) + (m122 * m222)) + (m123 * m232));
syz = (((m121 * m213) + (m122 * m223)) + (m123 * m233));
szx = (((m131 * m211) + (m132 * m221)) + (m133 * m231));
szy = (((m131 * m212) + (m132 * m222)) + (m133 * m232));
szz = (((m131 * m213) + (m132 * m223)) + (m133 * m233));
tx = _arg1.tx;
ty = _arg1.ty;
tz = _arg1.tz;
}
public function copy3x3(_arg1:Matrix3D):Matrix3D{
sxx = _arg1.sxx;
sxy = _arg1.sxy;
sxz = _arg1.sxz;
syx = _arg1.syx;
syy = _arg1.syy;
syz = _arg1.syz;
szx = _arg1.szx;
szy = _arg1.szy;
szz = _arg1.szz;
return (this);
}
public function scaleMatrix(_arg1:Number, _arg2:Number, _arg3:Number):void{
tx = (sxy = (sxz = 0));
syz = (ty = (syz = 0));
szx = (szy = (tz = 0));
sxx = _arg1;
syy = _arg2;
szz = _arg3;
}
public function quaternion2matrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
xx = (_arg1 * _arg1);
xy = (_arg1 * _arg2);
xz = (_arg1 * _arg3);
xw = (_arg1 * _arg4);
yy = (_arg2 * _arg2);
yz = (_arg2 * _arg3);
yw = (_arg2 * _arg4);
zz = (_arg3 * _arg3);
zw = (_arg3 * _arg4);
sxx = (1 - (2 * (yy + zz)));
sxy = (2 * (xy - zw));
sxz = (2 * (xz + yw));
syx = (2 * (xy + zw));
syy = (1 - (2 * (xx + zz)));
syz = (2 * (yz - xw));
szx = (2 * (xz - yw));
szy = (2 * (yz + xw));
szz = (1 - (2 * (xx + yy)));
}
public function translationMatrix(_arg1:Number, _arg2:Number, _arg3:Number):void{
sxx = (syy = (szz = 1));
sxy = (sxz = (syz = (syz = (szx = (szy = 0)))));
tx = _arg1;
ty = _arg2;
tz = _arg3;
}
public function rotationMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
nCos = Math.cos(_arg4);
nSin = Math.sin(_arg4);
scos = (1 - nCos);
suv = ((_arg1 * _arg2) * scos);
svw = ((_arg2 * _arg3) * scos);
suw = ((_arg1 * _arg3) * scos);
sw = (nSin * _arg3);
sv = (nSin * _arg2);
su = (nSin * _arg1);
sxx = (nCos + ((_arg1 * _arg1) * scos));
sxy = (-(sw) + suv);
sxz = (sv + suw);
syx = (sw + suv);
syy = (nCos + ((_arg2 * _arg2) * scos));
syz = (-(su) + svw);
szx = (-(sv) + suw);
szy = (su + svw);
szz = (nCos + ((_arg3 * _arg3) * scos));
}
public function array2matrix(_arg1:Array):void{
if (_arg1.length >= 12){
sxx = _arg1[0];
sxy = _arg1[1];
sxz = _arg1[2];
tx = _arg1[3];
syx = _arg1[4];
syy = _arg1[5];
syz = _arg1[6];
ty = _arg1[7];
szx = _arg1[8];
szy = _arg1[9];
szz = _arg1[10];
tz = _arg1[11];
};
}
}
}//package away3d.core.math
Section 37
//Number2D (away3d.core.math.Number2D)
package away3d.core.math {
public final class Number2D {
public var x:Number;
public var y:Number;
public static var LEFT:Number2D = new Number2D(-1, 0);
;
public static var DOWN:Number2D = new Number2D(0, -1);
;
public static var UP:Number2D = new Number2D(0, 1);
;
public static var RIGHT:Number2D = new Number2D(1, 0);
;
public function Number2D(_arg1:Number=0, _arg2:Number=0){
this.x = _arg1;
this.y = _arg2;
}
public function normalize():void{
var _local1:Number;
_local1 = modulo;
if (((!((_local1 == 0))) && (!((_local1 == 1))))){
this.x = (this.x / _local1);
this.y = (this.y / _local1);
};
}
public function get modulo():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function toString():String{
return (((("x:" + x) + " y:") + y));
}
public function clone():Number2D{
return (new Number2D(x, y));
}
public static function sub(_arg1:Number2D, _arg2:Number2D):Number2D{
return (new Number2D((_arg1.x - _arg2.x), (_arg1.y - _arg2.y)));
}
public static function add(_arg1:Number3D, _arg2:Number3D):Number2D{
return (new Number2D((_arg1.x + _arg2.x), (_arg1.y + _arg2.y)));
}
public static function scale(_arg1:Number2D, _arg2:Number):Number2D{
return (new Number2D((_arg1.x * _arg2), (_arg1.y * _arg2)));
}
public static function dot(_arg1:Number2D, _arg2:Number2D):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
}
}//package away3d.core.math
Section 38
//Number3D (away3d.core.math.Number3D)
package away3d.core.math {
public final class Number3D {
private var mod:Number;
private var num:Number3D;
private var dist:Number;
public var x:Number;
public var y:Number;
public var z:Number;
public static var BACKWARD:Number3D = new Number3D(0, 0, -1);
;
public static var FORWARD:Number3D = new Number3D(0, 0, 1);
;
public static var LEFT:Number3D = new Number3D(-1, 0, 0);
;
public static var DOWN:Number3D = new Number3D(0, -1, 0);
;
public static var UP:Number3D = new Number3D(0, 1, 0);
;
public static var RIGHT:Number3D = new Number3D(1, 0, 0);
;
public function Number3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function sub(_arg1:Number3D, _arg2:Number3D):void{
x = (_arg1.x - _arg2.x);
y = (_arg1.y - _arg2.y);
z = (_arg1.z - _arg2.z);
}
public function cross(_arg1:Number3D, _arg2:Number3D):void{
if ((((this == _arg1)) || ((this == _arg2)))){
throw (new Error("resultant cross product cannot be the same instance as an input"));
};
x = ((_arg2.y * _arg1.z) - (_arg2.z * _arg1.y));
y = ((_arg2.z * _arg1.x) - (_arg2.x * _arg1.z));
z = ((_arg2.x * _arg1.y) - (_arg2.y * _arg1.x));
}
public function dot(_arg1:Number3D):Number{
return ((((x * _arg1.x) + (y * _arg1.y)) + (z * _arg1.z)));
}
public function scale(_arg1:Number3D, _arg2:Number):void{
x = (_arg1.x * _arg2);
y = (_arg1.y * _arg2);
z = (_arg1.z * _arg2);
}
public function normalize(_arg1:Number=1):void{
mod = (modulo / _arg1);
if (((!((mod == 0))) && (!((mod == 1))))){
x = (x / mod);
y = (y / mod);
z = (z / mod);
};
}
public function closestPointOnPlane(_arg1:Number3D, _arg2:Number3D, _arg3:Number3D):Number3D{
if (!num){
num = new Number3D();
};
num.sub(_arg1, _arg2);
dist = _arg3.dot(num);
num.scale(_arg3, dist);
num.sub(_arg1, num);
return (num);
}
public function rotate(_arg1:Number3D, _arg2:Matrix3D):void{
x = (((_arg1.x * _arg2.sxx) + (_arg1.y * _arg2.sxy)) + (_arg1.z * _arg2.sxz));
y = (((_arg1.x * _arg2.syx) + (_arg1.y * _arg2.syy)) + (_arg1.z * _arg2.syz));
z = (((_arg1.x * _arg2.szx) + (_arg1.y * _arg2.szy)) + (_arg1.z * _arg2.szz));
}
public function getAngle(_arg1:Number3D=null):Number{
if (_arg1 == null){
_arg1 = new Number3D();
};
return (Math.acos((dot(_arg1) / (modulo * _arg1.modulo))));
}
public function add(_arg1:Number3D, _arg2:Number3D):void{
x = (_arg1.x + _arg2.x);
y = (_arg1.y + _arg2.y);
z = (_arg1.z + _arg2.z);
}
public function clone():Number3D{
return (new Number3D(x, y, z));
}
public function toString():String{
return (((((("x:" + x) + " y:") + y) + " z:") + z));
}
public function distance(_arg1:Number3D):Number{
return (Math.sqrt(((((x - _arg1.x) * (x - _arg1.x)) + ((y - _arg1.y) * (y - _arg1.y))) + ((z - _arg1.z) * (z - _arg1.z)))));
}
public function get modulo():Number{
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
public function get modulo2():Number{
return ((((x * x) + (y * y)) + (z * z)));
}
}
}//package away3d.core.math
Section 39
//Quaternion (away3d.core.math.Quaternion)
package away3d.core.math {
public final class Quaternion {
private var fCosPitchCosYaw:Number;
public var z:Number;
private var fSinPitch:Number;
private var fCosRoll:Number;
private var fSinPitchSinYaw:Number;
private var fCosYaw:Number;
private var fSinRoll:Number;
private var q:Quaternion;
public var w:Number;
public var x:Number;
public var y:Number;
private var fSinYaw:Number;
private var fCosPitch:Number;
public function normalize(_arg1:Number=1):void{
var _local2:Number;
_local2 = (magnitude * _arg1);
x = (x / _local2);
y = (y / _local2);
z = (z / _local2);
w = (w / _local2);
}
public function get magnitude():Number{
return (Math.sqrt(((((w * w) + (x * x)) + (y * y)) + (z * z))));
}
public function euler2quaternion(_arg1:Number, _arg2:Number, _arg3:Number):void{
fSinPitch = Math.sin((_arg1 * 0.5));
fCosPitch = Math.cos((_arg1 * 0.5));
fSinYaw = Math.sin((_arg2 * 0.5));
fCosYaw = Math.cos((_arg2 * 0.5));
fSinRoll = Math.sin((_arg3 * 0.5));
fCosRoll = Math.cos((_arg3 * 0.5));
fCosPitchCosYaw = (fCosPitch * fCosYaw);
fSinPitchSinYaw = (fSinPitch * fSinYaw);
x = ((fSinRoll * fCosPitchCosYaw) - (fCosRoll * fSinPitchSinYaw));
y = (((fCosRoll * fSinPitch) * fCosYaw) + ((fSinRoll * fCosPitch) * fSinYaw));
z = (((fCosRoll * fCosPitch) * fSinYaw) - ((fSinRoll * fSinPitch) * fCosYaw));
w = ((fCosRoll * fCosPitchCosYaw) + (fSinRoll * fSinPitchSinYaw));
}
public static function multiply(_arg1:Quaternion, _arg2:Quaternion):Quaternion{
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:Quaternion;
_local3 = _arg1.w;
_local4 = _arg1.x;
_local5 = _arg1.y;
_local6 = _arg1.z;
_local7 = _arg2.w;
_local8 = _arg2.x;
_local9 = _arg2.y;
_local10 = _arg2.z;
_local11 = new (Quaternion);
_local11.w = ((((_local3 * _local7) - (_local4 * _local8)) - (_local5 * _local9)) - (_local6 * _local10));
_local11.x = ((((_local3 * _local8) + (_local4 * _local7)) + (_local5 * _local10)) - (_local6 * _local9));
_local11.y = ((((_local3 * _local9) + (_local5 * _local7)) + (_local6 * _local8)) - (_local4 * _local10));
_local11.z = ((((_local3 * _local10) + (_local6 * _local7)) + (_local4 * _local9)) - (_local5 * _local8));
return (_local11);
}
public static function axis2quaternion(_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);
}
}
}//package away3d.core.math
Section 40
//Animation (away3d.core.mesh.Animation)
package away3d.core.mesh {
import away3d.core.math.*;
import flash.utils.*;
import away3d.core.material.*;
import away3d.core.*;
public class Animation implements IAnimation {
private var _loop:Boolean;// = false
private var _delay:Number;// = 0
private var _smooth:Boolean;// = false
private var _running:Boolean;
private var _sequence:Array;
private var _fps:Number;// = 24
private var _time:uint;
private var _frame:Number;// = 0
public function Animation(){
_frame = 0;
_fps = 24;
_loop = false;
_smooth = false;
_delay = 0;
_sequence = [];
super();
}
public function set sequence(_arg1:Array):void{
_sequence = _arg1;
}
public function update(_arg1:BaseMesh):void{
var _local2:uint;
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (!_running){
return;
};
_local2 = getTimer();
_frame = (_frame + (((_local2 - _time) * fps) / 1000));
_time = _local2;
if (_sequence.length == 1){
_frame = 0;
_running = false;
} else {
if (_loop){
while (_frame > ((_sequence.length - 1) + _delay)) {
_frame = (_frame - ((_sequence.length - 1) + _delay));
};
} else {
if (_frame > ((_sequence.length - 1) + _delay)){
_frame = ((_sequence.length - 1) + _delay);
_running = false;
};
};
};
_local3 = _frame;
if (!_smooth){
_local3 = Math.round(_local3);
};
if (_local3 < 0){
_local3 = 0;
};
if (_local3 > (_sequence.length - 1)){
_local3 = (_sequence.length - 1);
};
if (_local3 == Math.round(_local3)){
_arg1.frames[_sequence[int(_local3)].frame].adjust(1);
} else {
_local4 = Math.floor(_local3);
_local5 = Math.ceil(_local3);
_arg1.frames[_sequence[int(_local4)].frame].adjust(1);
_arg1.frames[_sequence[int(_local5)].frame].adjust((_local3 - _local4));
};
}
public function get sequence():Array{
return (_sequence);
}
public function stop():void{
_running = false;
}
public function set fps(_arg1:Number):void{
_fps = _arg1;
}
public function set loop(_arg1:Boolean):void{
_loop = _arg1;
}
public function set smooth(_arg1:Boolean):void{
_smooth = _arg1;
}
public function get loop():Boolean{
return (_loop);
}
public function get fps():Number{
return (_fps);
}
public function start():void{
_time = getTimer();
_running = true;
_frame = 0;
}
public function get smooth():Boolean{
return (_smooth);
}
}
}//package away3d.core.mesh
Section 41
//AnimationFrame (away3d.core.mesh.AnimationFrame)
package away3d.core.mesh {
public class AnimationFrame {
public var frame:Number;
public var time:uint;
public var sort:String;
public function AnimationFrame(_arg1:Number, _arg2:String=null){
this.frame = _arg1;
this.sort = _arg2;
}
}
}//package away3d.core.mesh
Section 42
//BaseMesh (away3d.core.mesh.BaseMesh)
package away3d.core.mesh {
import away3d.core.math.*;
import flash.utils.*;
import away3d.core.material.*;
import away3d.core.render.*;
import away3d.core.scene.*;
import away3d.core.draw.*;
import away3d.core.utils.*;
import away3d.objects.*;
import away3d.core.*;
public class BaseMesh extends Object3D {
private var _maxYElement:IMeshElement;// = null
public var framenames:Dictionary;
private var _radiusElement:IMeshElement;// = null
private var _minXElement:IMeshElement;// = null
private var _maxY:Number;
private var _maxZ:Number;
private var _maxX:Number;
private var _minYDirty:Boolean;// = false
protected var _dsStore:Array;
private var _frame:int;
var seg:DrawSegment;
private var _maxZDirty:Boolean;// = false
private var _radiusDirty:Boolean;// = false
public var frames:Dictionary;
private var _maxZElement:IMeshElement;// = null
private var _minZDirty:Boolean;// = false
private var _minYElement:IMeshElement;// = null
public var pushback:Boolean;
private var _needNotifyDimensionsChange:Boolean;// = false
private var _minY:Number;// = INF
private var _minZ:Number;// = INF
private var _needNotifyRadiusChange:Boolean;// = false
private var _maxXElement:IMeshElement;// = null
public var type:String;
private var _minX:Number;// = INF
private var _maxXDirty:Boolean;// = false
public var pushfront:Boolean;
private var _verticesDirty:Boolean;// = true
private var _vertices:Array;
public var url:String;
public var animation:Animation;
private var _minXDirty:Boolean;// = false
private var _radius:Number;// = 0
protected var _dsActive:Array;
private var _minZElement:IMeshElement;// = null
private var _maxYDirty:Boolean;// = false
public function BaseMesh(_arg1:Object=null){
_verticesDirty = true;
_radiusElement = null;
_radiusDirty = false;
_radius = 0;
_maxXElement = null;
_maxXDirty = false;
_maxX = -(Infinity);
_minXElement = null;
_minXDirty = false;
_minX = Infinity;
_maxYElement = null;
_maxYDirty = false;
_maxY = -(Infinity);
_minYElement = null;
_minYDirty = false;
_minY = Infinity;
_maxZElement = null;
_maxZDirty = false;
_maxZ = -(Infinity);
_minZElement = null;
_minZDirty = false;
_minZ = Infinity;
_needNotifyRadiusChange = false;
_needNotifyDimensionsChange = false;
_dsStore = new Array();
_dsActive = new Array();
super(_arg1);
_arg1 = Init.parse(_arg1);
pushback = _arg1.getBoolean("pushback", false);
pushfront = _arg1.getBoolean("pushfront", false);
}
override public function get minX():Number{
var _local1:Number;
var _local2:IMeshElement;
var _local3:Number;
if (_minXDirty){
_minXElement = null;
_local1 = Infinity;
for each (_local2 in elements) {
_local3 = _local2.minX;
if (_local3 < _local1){
_local1 = _local3;
_minXElement = _local2;
};
};
_minX = _local1;
_minXDirty = false;
};
return (_minX);
}
override public function get minZ():Number{
var _local1:Number;
var _local2:IMeshElement;
var _local3:Number;
if (_minZDirty){
_local1 = Infinity;
_minZElement = null;
for each (_local2 in elements) {
_local3 = _local2.minZ;
if (_local3 < _local1){
_local1 = _local3;
_minZElement = _local2;
};
};
_minZ = _local1;
_minZDirty = false;
};
return (_minZ);
}
override public function get minY():Number{
var _local1:Number;
var _local2:IMeshElement;
var _local3:Number;
if (_minYDirty){
_local1 = Infinity;
_minYElement = null;
for each (_local2 in elements) {
_local3 = _local2.minY;
if (_local3 < _local1){
_local1 = _local3;
_minYElement = _local2;
};
};
_minY = _local1;
_minYDirty = false;
};
return (_minY);
}
public function scaleZ(_arg1:Number):void{
if (_arg1 != 1){
scaleXYZ(1, 1, _arg1);
};
}
private function clear():void{
throw (new Error("Not implemented"));
}
public function scaleY(_arg1:Number):void{
if (_arg1 != 1){
scaleXYZ(1, _arg1, 1);
};
}
public function scaleX(_arg1:Number):void{
if (_arg1 != 1){
scaleXYZ(_arg1, 1, 1);
};
}
override public function primitives(_arg1:IPrimitiveConsumer, _arg2:RenderSession):void{
super.primitives(_arg1, _arg2);
_dsStore = _dsStore.concat(_dsActive);
_dsActive = new Array();
}
private function launchNotifies():void{
if (_needNotifyRadiusChange){
_needNotifyRadiusChange = false;
notifyRadiusChange();
};
if (_needNotifyDimensionsChange){
_needNotifyDimensionsChange = false;
notifyDimensionsChange();
};
}
override public function get radius():Number{
var _local1:Number;
var _local2:IMeshElement;
var _local3:Number;
if (_radiusDirty){
_radiusElement = null;
_local1 = 0;
for each (_local2 in elements) {
_local3 = _local2.radius2;
if (_local3 > _local1){
_local1 = _local3;
_radiusElement = _local2;
};
};
_radius = Math.sqrt(_local1);
_radiusDirty = false;
};
return (_radius);
}
public function createDrawSegment(_arg1:ISegmentMaterial, _arg2:Projection, _arg3:ScreenVertex, _arg4:ScreenVertex):DrawSegment{
if (_dsStore.length){
_dsActive.push((seg = _dsStore.pop()));
seg.create = createDrawSegment;
} else {
_dsActive.push((seg = new DrawSegment()));
seg.source = this;
seg.create = createDrawSegment;
};
seg.material = _arg1;
seg.projection = _arg2;
seg.v0 = _arg3;
seg.v1 = _arg4;
seg.calc();
return (seg);
}
public function set frame(_arg1:int):void{
if (_frame == _arg1){
return;
};
_frame = _arg1;
frames[_frame].adjust(1);
}
public function get elements():Array{
throw (new Error("Not implemented"));
}
protected function addElement(_arg1:IMeshElement):void{
_verticesDirty = true;
_arg1.addOnVertexChange(onElementVertexChange);
_arg1.addOnVertexValueChange(onElementVertexValueChange);
rememberElementRadius(_arg1);
launchNotifies();
}
private function rememberElementRadius(_arg1:IMeshElement):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local2 = _arg1.radius2;
if (_local2 > (_radius * _radius)){
_radius = Math.sqrt(_local2);
_radiusElement = _arg1;
_radiusDirty = false;
_needNotifyRadiusChange = true;
};
_local3 = _arg1.maxX;
if (_local3 > _maxX){
_maxX = _local3;
_maxXElement = _arg1;
_maxXDirty = false;
_needNotifyDimensionsChange = true;
};
_local4 = _arg1.minX;
if (_local4 < _minX){
_minX = _local4;
_minXElement = _arg1;
_minXDirty = false;
_needNotifyDimensionsChange = true;
};
_local5 = _arg1.maxY;
if (_local5 > _maxY){
_maxY = _local5;
_maxYElement = _arg1;
_maxYDirty = false;
_needNotifyDimensionsChange = true;
};
_local6 = _arg1.minY;
if (_local6 < _minY){
_minY = _local6;
_minYElement = _arg1;
_minYDirty = false;
_needNotifyDimensionsChange = true;
};
_local7 = _arg1.maxZ;
if (_local7 > _maxZ){
_maxZ = _local7;
_maxZElement = _arg1;
_maxZDirty = false;
_needNotifyDimensionsChange = true;
};
_local8 = _arg1.minZ;
if (_local8 < _minZ){
_minZ = _local8;
_minZElement = _arg1;
_minZDirty = false;
_needNotifyDimensionsChange = true;
};
}
private function onElementVertexChange(_arg1:MeshElementEvent):void{
var _local2:IMeshElement;
_local2 = _arg1.element;
forgetElementRadius(_local2);
rememberElementRadius(_local2);
_verticesDirty = true;
launchNotifies();
}
override public function scale(_arg1:Number):void{
scaleXYZ(_arg1, _arg1, _arg1);
}
public function play(_arg1:Object=null):void{
var _local2:Number;
var _local3:String;
var _local4:Boolean;
var _local5:Boolean;
var _local6:String;
_arg1 = Init.parse(_arg1);
_local2 = _arg1.getNumber("fps", 24);
_local3 = _arg1.getString("prefix", null);
_local4 = _arg1.getBoolean("smooth", false);
_local5 = _arg1.getBoolean("loop", false);
animation = new Animation();
animation.fps = _local2;
animation.smooth = _local4;
animation.loop = _local5;
if (_local3 != null){
for (_local6 in framenames) {
if (_local6.indexOf(_local3) == 0){
animation.sequence.push(new AnimationFrame(framenames[_local6], ("" + parseInt(_local6.substring(_local3.length)))));
};
};
animation.sequence.sortOn("sort", Array.NUMERIC);
};
animation.start();
}
public function get frame():int{
return (_frame);
}
override public function get maxY():Number{
var _local1:Number;
var _local2:IMeshElement;
var _local3:Number;
if (_maxYDirty){
_local1 = -(Infinity);
_maxYElement = null;
for each (_local2 in elements) {
_local3 = _local2.maxY;
if (_local3 > _local1){
_local1 = _local3;
_maxYElement = _local2;
};
};
_maxY = _local1;
_maxYDirty = false;
};
return (_maxY);
}
override public function get maxZ():Number{
var _local1:Number;
var _local2:IMeshElement;
var _local3:Number;
if (_maxZDirty){
_local1 = -(Infinity);
_maxZElement = null;
for each (_local2 in elements) {
_local3 = _local2.maxZ;
if (_local3 > _local1){
_local1 = _local3;
_maxZElement = _local2;
};
};
_maxZ = _local1;
_maxZDirty = false;
};
return (_maxZ);
}
override public function get maxX():Number{
var _local1:Number;
var _local2:IMeshElement;
var _local3:Number;
if (_maxXDirty){
_maxXElement = null;
_local1 = -(Infinity);
for each (_local2 in elements) {
_local3 = _local2.maxX;
if (_local3 > _local1){
_local1 = _local3;
_maxXElement = _local2;
};
};
_maxX = _local1;
_maxXDirty = false;
};
return (_maxX);
}
override public function tick(_arg1:int):void{
if (((!((animation == null))) && (!((frames == null))))){
animation.update(this);
};
}
private function onElementVertexValueChange(_arg1:MeshElementEvent):void{
var _local2:IMeshElement;
_local2 = _arg1.element;
forgetElementRadius(_local2);
rememberElementRadius(_local2);
launchNotifies();
}
private function forgetElementRadius(_arg1:IMeshElement):void{
if (_arg1 == _radiusElement){
_radiusElement = null;
_radiusDirty = true;
_needNotifyRadiusChange = true;
};
if (_arg1 == _maxXElement){
_maxXElement = null;
_maxXDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _minXElement){
_minXElement = null;
_minXDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _maxYElement){
_maxYElement = null;
_maxYDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _minYElement){
_minYElement = null;
_minYDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _maxZElement){
_maxZElement = null;
_maxZDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _minZElement){
_minZElement = null;
_minZDirty = true;
_needNotifyDimensionsChange = true;
};
}
protected function removeElement(_arg1:IMeshElement):void{
forgetElementRadius(_arg1);
_arg1.removeOnVertexValueChange(onElementVertexValueChange);
_arg1.removeOnVertexChange(onElementVertexChange);
_verticesDirty = true;
launchNotifies();
}
protected function scaleXYZ(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Vertex;
for each (_local4 in vertices) {
_local4.x = (_local4.x * _arg1);
_local4.y = (_local4.y * _arg2);
_local4.z = (_local4.z * _arg3);
};
}
public function get vertices():Array{
var _local1:Dictionary;
var _local2:IMeshElement;
var _local3:Vertex;
if (_verticesDirty){
_vertices = [];
_local1 = new Dictionary();
for each (_local2 in elements) {
for each (_local3 in _local2.vertices) {
if (!_local1[_local3]){
_vertices.push(_local3);
_local1[_local3] = true;
};
};
};
_verticesDirty = false;
};
return (_vertices);
}
}
}//package away3d.core.mesh
Section 43
//BaseMeshElement (away3d.core.mesh.BaseMeshElement)
package away3d.core.mesh {
import away3d.core.utils.*;
import away3d.core.*;
public class BaseMeshElement extends LazyEventDispatcher implements IMeshElement {
private var visiblechanged:MeshElementEvent;
private var vertexchanged:MeshElementEvent;
arcane var _visible:Boolean;// = true
private var vertexvaluechanged:MeshElementEvent;
public function BaseMeshElement(){
_visible = true;
super();
}
protected function notifyVisibleChange():void{
if (!hasEventListener("visiblechanged")){
return;
};
if (visiblechanged == null){
visiblechanged = new MeshElementEvent("visiblechanged", this);
};
dispatchEvent(visiblechanged);
}
public function removeOnVertexValueChange(_arg1:Function):void{
removeEventListener("vertexvaluechanged", _arg1, false);
}
public function get visible():Boolean{
return (_visible);
}
protected function notifyVertexValueChange():void{
if (!hasEventListener("vertexvaluechanged")){
return;
};
if (vertexvaluechanged == null){
vertexvaluechanged = new MeshElementEvent("vertexvaluechanged", this);
};
dispatchEvent(vertexvaluechanged);
}
public function removeOnVertexChange(_arg1:Function):void{
removeEventListener("vertexchanged", _arg1, false);
}
public function removeOnVisibleChange(_arg1:Function):void{
removeEventListener("visiblechanged", _arg1, false);
}
public function addOnVertexValueChange(_arg1:Function):void{
addEventListener("vertexvaluechanged", _arg1, false, 0, true);
}
public function addOnVisibleChange(_arg1:Function):void{
addEventListener("visiblechanged", _arg1, false, 0, true);
}
public function get minX():Number{
return (-(Math.sqrt(radius2)));
}
public function get minY():Number{
return (-(Math.sqrt(radius2)));
}
public function get minZ():Number{
return (-(Math.sqrt(radius2)));
}
protected function notifyVertexChange():void{
if (!hasEventListener("vertexchanged")){
return;
};
if (vertexchanged == null){
vertexchanged = new MeshElementEvent("vertexchanged", this);
};
dispatchEvent(vertexchanged);
}
public function set visible(_arg1:Boolean):void{
if (_arg1 == _visible){
return;
};
_visible = _arg1;
notifyVisibleChange();
}
public function get radius2():Number{
var _local1:Number;
var _local2:Vertex;
var _local3:Number;
_local1 = 0;
for each (_local2 in vertices) {
_local3 = (((_local2._x * _local2._x) + (_local2._y * _local2._y)) + (_local2._z * _local2._z));
if (_local3 > _local1){
_local1 = _local3;
};
};
return (_local1);
}
public function get maxX():Number{
return (Math.sqrt(radius2));
}
public function get maxZ():Number{
return (Math.sqrt(radius2));
}
public function get vertices():Array{
throw (new Error("Not implemented"));
}
public function addOnVertexChange(_arg1:Function):void{
addEventListener("vertexchanged", _arg1, false, 0, true);
}
public function get maxY():Number{
return (Math.sqrt(radius2));
}
}
}//package away3d.core.mesh
Section 44
//Face (away3d.core.mesh.Face)
package away3d.core.mesh {
import flash.events.*;
import away3d.core.math.*;
import away3d.core.material.*;
import away3d.core.render.*;
import flash.geom.*;
import away3d.core.draw.*;
import away3d.core.*;
public class Face extends BaseMeshElement {
private var _normal:Number3D;
public var extra:Object;
arcane var _v0:Vertex;
arcane var _v1:Vertex;
arcane var _v2:Vertex;
private var mappingchanged:FaceEvent;
arcane var _dt:DrawTriangle;
arcane var _bitmapRect:Rectangle;
var a:Number;
var b:Number;
var c:Number;
var s:Number;
arcane var _material:ITriangleMaterial;
public var parent:Mesh;
private var materialchanged:FaceEvent;
arcane var _mappingmaterial:IUVMaterial;
arcane var _back:ITriangleMaterial;
arcane var _uv0:UV;
arcane var _uv1:UV;
arcane var _uv2:UV;
public function Face(_arg1:Vertex, _arg2:Vertex, _arg3:Vertex, _arg4:ITriangleMaterial=null, _arg5:UV=null, _arg6:UV=null, _arg7:UV=null){
_dt = new DrawTriangle();
super();
this.v0 = _arg1;
this.v1 = _arg2;
this.v2 = _arg3;
this.material = _arg4;
this.uv0 = _arg5;
this.uv1 = _arg6;
this.uv2 = _arg7;
_dt.face = this;
}
public function get uvs():Array{
return ([_uv0, _uv1, _uv2]);
}
public function set v0(_arg1:Vertex):void{
if (_arg1 == _v0){
return;
};
if (_v0 != null){
if (((!((_v0 == _v1))) && (!((_v0 == _v2))))){
_v0.removeOnChange(onVertexValueChange);
};
};
_v0 = _arg1;
if (_v0 != null){
if (((!((_v0 == _v1))) && (!((_v0 == _v2))))){
_v0.addOnChange(onVertexValueChange);
};
};
notifyVertexChange();
}
private function onVertexValueChange(_arg1:Event):void{
_normal = null;
notifyVertexValueChange();
}
public function set v2(_arg1:Vertex):void{
if (_arg1 == _v2){
return;
};
if (_v2 != null){
if (((!((_v2 == _v1))) && (!((_v2 == _v0))))){
_v2.removeOnChange(onVertexValueChange);
};
};
_v2 = _arg1;
if (_v2 != null){
if (((!((_v2 == _v1))) && (!((_v2 == _v0))))){
_v2.addOnChange(onVertexValueChange);
};
};
notifyVertexChange();
}
public function get material():ITriangleMaterial{
return (_material);
}
arcane function front(_arg1:Projection):Number{
var _local2:ScreenVertex;
var _local3:ScreenVertex;
var _local4:ScreenVertex;
_local2 = _v0.project(_arg1);
_local3 = _v1.project(_arg1);
_local4 = _v2.project(_arg1);
return ((((_local2.x * (_local4.y - _local3.y)) + (_local3.x * (_local2.y - _local4.y))) + (_local4.x * (_local3.y - _local2.y))));
}
public function addOnMaterialChange(_arg1:Function):void{
addEventListener("materialchanged", _arg1, false, 0, true);
}
public function removeOnMaterialChange(_arg1:Function):void{
removeEventListener("materialchanged", _arg1, false);
}
public function get minU():Number{
if (_uv0._u < _uv1._u){
if (_uv0._u < _uv2._u){
return (_uv0._u);
};
return (_uv2._u);
//unresolved jump
};
if (_uv1._u < _uv2._u){
return (_uv1._u);
};
return (_uv2._u);
}
public function get minV():Number{
if (_uv0._v < _uv1._v){
if (_uv0._v < _uv2._v){
return (_uv0._v);
};
return (_uv2._v);
//unresolved jump
};
if (_uv1._v < _uv2._v){
return (_uv1._v);
};
return (_uv2._v);
}
override public function get minX():Number{
if (_v0._x < _v1._x){
if (_v0._x < _v2._x){
return (_v0._x);
};
return (_v2._x);
//unresolved jump
};
if (_v1._x < _v2._x){
return (_v1._x);
};
return (_v2._x);
}
override public function get minY():Number{
if (_v0._y < _v1._y){
if (_v0._y < _v2._y){
return (_v0._y);
};
return (_v2._y);
//unresolved jump
};
if (_v1._y < _v2._y){
return (_v1._y);
};
return (_v2._y);
}
override public function get minZ():Number{
if (_v0._z < _v1._z){
if (_v0._z < _v2._z){
return (_v0._z);
};
return (_v2._z);
//unresolved jump
};
if (_v1._z < _v2._z){
return (_v1._z);
};
return (_v2._z);
}
public function set material(_arg1:ITriangleMaterial):void{
if (_arg1 == _material){
return;
};
_material = _arg1;
notifyMaterialChange();
}
public function removeOnMappingChange(_arg1:Function):void{
removeEventListener("mappingchanged", _arg1, false);
}
protected function notifyMappingChange():void{
_dt.texturemapping = null;
if (!hasEventListener("mappingchanged")){
return;
};
if (mappingchanged == null){
mappingchanged = new FaceEvent("mappingchanged", this);
};
dispatchEvent(mappingchanged);
}
public function set uv1(_arg1:UV):void{
if (_arg1 == _uv1){
return;
};
if (_uv1 != null){
if (((!((_uv1 == _uv0))) && (!((_uv1 == _uv2))))){
_uv1.removeOnChange(onUVChange);
};
};
_uv1 = _arg1;
if (_uv1 != null){
if (((!((_uv1 == _uv0))) && (!((_uv1 == _uv2))))){
_uv1.addOnChange(onUVChange);
};
};
notifyMappingChange();
}
public function set uv0(_arg1:UV):void{
if (_arg1 == _uv0){
return;
};
if (_uv0 != null){
if (((!((_uv0 == _uv1))) && (!((_uv0 == _uv2))))){
_uv0.removeOnChange(onUVChange);
};
};
_uv0 = _arg1;
if (_uv0 != null){
if (((!((_uv0 == _uv1))) && (!((_uv0 == _uv2))))){
_uv0.addOnChange(onUVChange);
};
};
notifyMappingChange();
}
protected function notifyMaterialChange():void{
_dt.texturemapping = null;
if (!hasEventListener("materialchanged")){
return;
};
if (materialchanged == null){
materialchanged = new FaceEvent("materialchanged", this);
};
dispatchEvent(materialchanged);
}
public function set uv2(_arg1:UV):void{
if (_arg1 == _uv2){
return;
};
if (_uv2 != null){
if (((!((_uv2 == _uv1))) && (!((_uv2 == _uv0))))){
_uv2.removeOnChange(onUVChange);
};
};
_uv2 = _arg1;
if (_uv2 != null){
if (((!((_uv2 == _uv1))) && (!((_uv2 == _uv0))))){
_uv2.addOnChange(onUVChange);
};
};
notifyMappingChange();
}
public function get maxU():Number{
if (_uv0._u > _uv1._u){
if (_uv0.u > _uv2._u){
return (_uv0._u);
};
return (_uv2._u);
//unresolved jump
};
if (_uv1._u > _uv2._u){
return (_uv1._u);
};
return (_uv2._u);
}
override public function get maxX():Number{
if (_v0._x > _v1._x){
if (_v0._x > _v2._x){
return (_v0._x);
};
return (_v2._x);
//unresolved jump
};
if (_v1._x > _v2._x){
return (_v1._x);
};
return (_v2._x);
}
public function get maxV():Number{
if (_uv0._v > _uv1._v){
if (_uv0._v > _uv2._v){
return (_uv0._v);
};
return (_uv2._v);
//unresolved jump
};
if (_uv1._v > _uv2._v){
return (_uv1._v);
};
return (_uv2._v);
}
public function get v0():Vertex{
return (_v0);
}
public function get v1():Vertex{
return (_v1);
}
public function get v2():Vertex{
return (_v2);
}
override public function get maxZ():Number{
if (_v0._z > _v1._z){
if (_v0._z > _v2._z){
return (_v0._z);
};
return (_v2._z);
//unresolved jump
};
if (_v1._z > _v2._z){
return (_v1._z);
};
return (_v2._z);
}
override public function get maxY():Number{
if (_v0._y > _v1._y){
if (_v0._y > _v2._y){
return (_v0._y);
};
return (_v2._y);
//unresolved jump
};
if (_v1._y > _v2._y){
return (_v1._y);
};
return (_v2._y);
}
private function onUVChange(_arg1:Event):void{
notifyMappingChange();
}
public function get area():Number{
a = v0.position.distance(v1.position);
b = v1.position.distance(v2.position);
c = v2.position.distance(v0.position);
s = (((a + b) + c) / 2);
return (Math.sqrt((((s * (s - a)) * (s - b)) * (s - c))));
}
public function addOnMappingChange(_arg1:Function):void{
addEventListener("mappingchanged", _arg1, false, 0, true);
}
public function get uv0():UV{
return (_uv0);
}
public function get uv1():UV{
return (_uv1);
}
public function get uv2():UV{
return (_uv2);
}
public function set back(_arg1:ITriangleMaterial):void{
if (_arg1 == _back){
return;
};
_back = _arg1;
}
public function invert():void{
var _local1:Vertex;
var _local2:Vertex;
var _local3:UV;
var _local4:UV;
_local1 = this._v1;
_local2 = this._v2;
_local3 = this._uv1;
_local4 = this._uv2;
this._v1 = _local2;
this._v2 = _local1;
this._uv1 = _local4;
this._uv2 = _local3;
notifyVertexChange();
notifyMappingChange();
}
public function get normal():Number3D{
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;
var _local10:Number;
if (!_normal){
_normal = new Number3D();
_local1 = (_v1.x - _v0.x);
_local2 = (_v1.y - _v0.y);
_local3 = (_v1.z - _v0.z);
_local4 = (_v2.x - _v0.x);
_local5 = (_v2.y - _v0.y);
_local6 = (_v2.z - _v0.z);
_local7 = ((_local2 * _local6) - (_local3 * _local5));
_local8 = ((_local3 * _local4) - (_local1 * _local6));
_local9 = ((_local1 * _local5) - (_local2 * _local4));
_local10 = Math.sqrt((((_local7 * _local7) + (_local8 * _local8)) + (_local9 * _local9)));
_normal.x = (_local7 / _local10);
_normal.y = (_local8 / _local10);
_normal.z = (_local9 / _local10);
};
return (_normal);
}
public function get back():ITriangleMaterial{
return (_back);
}
override public function get radius2():Number{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = (((_v0._x * _v0._x) + (_v0._y * _v0._y)) + (_v0._z * _v0._z));
_local2 = (((_v1._x * _v1._x) + (_v1._y * _v1._y)) + (_v1._z * _v1._z));
_local3 = (((_v2._x * _v2._x) + (_v2._y * _v2._y)) + (_v2._z * _v2._z));
if (_local1 > _local2){
if (_local1 > _local3){
return (_local1);
};
return (_local3);
//unresolved jump
};
if (_local2 > _local3){
return (_local2);
};
return (_local3);
}
private function onVertexChange(_arg1:Event):void{
_normal = null;
notifyVertexChange();
}
public function set v1(_arg1:Vertex):void{
if (_arg1 == _v1){
return;
};
if (_v1 != null){
if (((!((_v1 == _v0))) && (!((_v1 == _v2))))){
_v1.removeOnChange(onVertexValueChange);
};
};
_v1 = _arg1;
if (_v1 != null){
if (((!((_v1 == _v0))) && (!((_v1 == _v2))))){
_v1.addOnChange(onVertexValueChange);
};
};
notifyVertexChange();
}
override public function get vertices():Array{
return ([_v0, _v1, _v2]);
}
}
}//package away3d.core.mesh
Section 45
//FaceEvent (away3d.core.mesh.FaceEvent)
package away3d.core.mesh {
import flash.events.*;
public class FaceEvent extends Event {
public var face:Face;
public function FaceEvent(_arg1:String, _arg2:Face){
super(_arg1);
this.face = _arg2;
}
override public function clone():Event{
return (new FaceEvent(type, face));
}
}
}//package away3d.core.mesh
Section 46
//Frame (away3d.core.mesh.Frame)
package away3d.core.mesh {
public class Frame {
public var vertexpositions:Array;
public function Frame(){
vertexpositions = [];
super();
}
public function adjust(_arg1:Number=1):void{
var _local2:VertexPosition;
for each (_local2 in vertexpositions) {
_local2.adjust(_arg1);
};
}
}
}//package away3d.core.mesh
Section 47
//IAnimation (away3d.core.mesh.IAnimation)
package away3d.core.mesh {
public interface IAnimation {
function update(_arg1:BaseMesh):void;
}
}//package away3d.core.mesh
Section 48
//IMeshElement (away3d.core.mesh.IMeshElement)
package away3d.core.mesh {
public interface IMeshElement {
function get radius2():Number;
function addOnVisibleChange(_arg1:Function):void;
function get minX():Number;
function get minZ():Number;
function get minY():Number;
function get visible():Boolean;
function get maxX():Number;
function get maxY():Number;
function get maxZ():Number;
function removeOnVertexChange(_arg1:Function):void;
function get vertices():Array;
function removeOnVertexValueChange(_arg1:Function):void;
function addOnVertexChange(_arg1:Function):void;
function addOnVertexValueChange(_arg1:Function):void;
function removeOnVisibleChange(_arg1:Function):void;
}
}//package away3d.core.mesh
Section 49
//Mesh (away3d.core.mesh.Mesh)
package away3d.core.mesh {
import away3d.core.math.*;
import flash.utils.*;
import flash.display.*;
import away3d.core.material.*;
import away3d.core.render.*;
import away3d.core.scene.*;
import away3d.core.draw.*;
import away3d.core.utils.*;
import away3d.objects.*;
import away3d.core.*;
public class Mesh extends BaseMesh implements IPrimitiveProvider {
public var outline:ISegmentMaterial;
private var _vertnormals:Dictionary;
private var _material:ITriangleMaterial;
private var _faces:Array;
var vt:ScreenVertex;
var uvmaterial:Boolean;
private var _vertnormalsDirty:Boolean;// = true
public var back:ITriangleMaterial;
var n01:Face;
public var _dtStore:Array;
public var _dtActive:Array;
private var _neighbour01:Dictionary;
public var bothsides:Boolean;
var n12:Face;
var n20:Face;
private var _neighboursDirty:Boolean;// = true
private var _neighbour12:Dictionary;
var transparent:ITriangleMaterial;
private var _neighbour20:Dictionary;
var backmat:ITriangleMaterial;
private var _vertfaces:Dictionary;
var tri:DrawTriangle;
var backface:Boolean;
private var _vertfacesDirty:Boolean;// = true
public var debugbb:Boolean;
var _debugboundingbox:WireCube;
var uvt:UV;
public function Mesh(_arg1:Object=null){
_faces = [];
_neighboursDirty = true;
_vertfacesDirty = true;
_vertnormalsDirty = true;
_dtStore = new Array();
_dtActive = new Array();
super(_arg1);
_arg1 = Init.parse(_arg1);
material = _arg1.getMaterial("material");
outline = _arg1.getSegmentMaterial("outline");
back = _arg1.getMaterial("back");
bothsides = _arg1.getBoolean("bothsides", false);
debugbb = _arg1.getBoolean("debugbb", false);
if ((((material == null)) && ((outline == null)))){
material = new WireColorMaterial();
};
}
arcane function getVertexNormal(_arg1:Vertex):Number3D{
if (_vertfacesDirty){
findVertFaces();
};
if (_vertnormalsDirty){
findVertNormals();
};
return (_vertnormals[_arg1]);
}
private function rememberFaceNeighbours(_arg1:Face):void{
var _local2:Face;
if (_neighboursDirty){
return;
};
for each (_local2 in _faces) {
if (_arg1 == _local2){
} else {
if ((((_arg1._v0 == _local2._v2)) && ((_arg1._v1 == _local2._v1)))){
_neighbour01[_arg1] = _local2;
_neighbour12[_local2] = _arg1;
};
if ((((_arg1._v0 == _local2._v0)) && ((_arg1._v1 == _local2._v2)))){
_neighbour01[_arg1] = _local2;
_neighbour20[_local2] = _arg1;
};
if ((((_arg1._v0 == _local2._v1)) && ((_arg1._v1 == _local2._v0)))){
_neighbour01[_arg1] = _local2;
_neighbour01[_local2] = _arg1;
};
if ((((_arg1._v1 == _local2._v2)) && ((_arg1._v2 == _local2._v1)))){
_neighbour12[_arg1] = _local2;
_neighbour12[_local2] = _arg1;
};
if ((((_arg1._v1 == _local2._v0)) && ((_arg1._v2 == _local2._v2)))){
_neighbour12[_arg1] = _local2;
_neighbour20[_local2] = _arg1;
};
if ((((_arg1._v1 == _local2._v1)) && ((_arg1._v2 == _local2._v0)))){
_neighbour12[_arg1] = _local2;
_neighbour01[_local2] = _arg1;
};
if ((((_arg1._v2 == _local2._v2)) && ((_arg1._v0 == _local2._v1)))){
_neighbour20[_arg1] = _local2;
_neighbour12[_local2] = _arg1;
};
if ((((_arg1._v2 == _local2._v0)) && ((_arg1._v0 == _local2._v2)))){
_neighbour20[_arg1] = _local2;
_neighbour20[_local2] = _arg1;
};
if ((((_arg1._v2 == _local2._v1)) && ((_arg1._v0 == _local2._v0)))){
_neighbour20[_arg1] = _local2;
_neighbour01[_local2] = _arg1;
};
};
};
}
private function clear():void{
var _local1:Face;
for each (_local1 in _faces.concat([])) {
removeFace(_local1);
};
}
public function set material(_arg1:ITriangleMaterial):void{
var _local2:Face;
if (_material == _arg1){
return;
};
_material = _arg1;
if ((_material is IUVMaterial)){
for each (_local2 in _faces) {
_local2._dt.texturemapping = null;
};
};
}
public function quarterFaces():void{
var _local1:Dictionary;
var _local2:Face;
var _local3:Vertex;
var _local4:Vertex;
var _local5:Vertex;
var _local6:Vertex;
var _local7:Vertex;
var _local8:Vertex;
var _local9:UV;
var _local10:UV;
var _local11:UV;
var _local12:UV;
var _local13:UV;
var _local14:UV;
var _local15:ITriangleMaterial;
_local1 = new Dictionary();
for each (_local2 in _faces.concat([])) {
_local3 = _local2.v0;
_local4 = _local2.v1;
_local5 = _local2.v2;
if (_local1[_local3] == null){
_local1[_local3] = new Dictionary();
};
if (_local1[_local4] == null){
_local1[_local4] = new Dictionary();
};
if (_local1[_local5] == null){
_local1[_local5] = new Dictionary();
};
_local6 = _local1[_local3][_local4];
if (_local6 == null){
_local6 = Vertex.median(_local3, _local4);
_local1[_local3][_local4] = _local6;
_local1[_local4][_local3] = _local6;
};
_local7 = _local1[_local4][_local5];
if (_local7 == null){
_local7 = Vertex.median(_local4, _local5);
_local1[_local4][_local5] = _local7;
_local1[_local5][_local4] = _local7;
};
_local8 = _local1[_local5][_local3];
if (_local8 == null){
_local8 = Vertex.median(_local5, _local3);
_local1[_local5][_local3] = _local8;
_local1[_local3][_local5] = _local8;
};
_local9 = _local2.uv0;
_local10 = _local2.uv1;
_local11 = _local2.uv2;
_local12 = UV.median(_local9, _local10);
_local13 = UV.median(_local10, _local11);
_local14 = UV.median(_local11, _local9);
_local15 = _local2.material;
removeFace(_local2);
addFace(new Face(_local3, _local6, _local8, _local15, _local9, _local12, _local14));
addFace(new Face(_local6, _local4, _local7, _local15, _local12, _local10, _local13));
addFace(new Face(_local8, _local7, _local5, _local15, _local14, _local13, _local11));
addFace(new Face(_local7, _local8, _local6, _local15, _local13, _local14, _local12));
};
}
override public function primitives(_arg1:IPrimitiveConsumer, _arg2:RenderSession):void{
var _local3:Face;
super.primitives(_arg1, _arg2);
_dtStore = _dtStore.concat(_dtActive);
_dtActive = new Array();
if (outline != null){
if (_neighboursDirty){
findNeighbours();
};
};
if (debugbb){
if (_debugboundingbox == null){
_debugboundingbox = new WireCube({material:"#white"});
};
_debugboundingbox.v000.x = minX;
_debugboundingbox.v001.x = minX;
_debugboundingbox.v010.x = minX;
_debugboundingbox.v011.x = minX;
_debugboundingbox.v100.x = maxX;
_debugboundingbox.v101.x = maxX;
_debugboundingbox.v110.x = maxX;
_debugboundingbox.v111.x = maxX;
_debugboundingbox.v000.y = minY;
_debugboundingbox.v001.y = minY;
_debugboundingbox.v010.y = maxY;
_debugboundingbox.v011.y = maxY;
_debugboundingbox.v100.y = minY;
_debugboundingbox.v101.y = minY;
_debugboundingbox.v110.y = maxY;
_debugboundingbox.v111.y = maxY;
_debugboundingbox.v000.z = minZ;
_debugboundingbox.v001.z = maxZ;
_debugboundingbox.v010.z = minZ;
_debugboundingbox.v011.z = maxZ;
_debugboundingbox.v100.z = minZ;
_debugboundingbox.v101.z = maxZ;
_debugboundingbox.v110.z = minZ;
_debugboundingbox.v111.z = maxZ;
if (_faces.length > 0){
_debugboundingbox.primitives(_arg1, _arg2);
};
};
transparent = TransparentMaterial.INSTANCE;
backmat = ((back) || (material));
for each (_local3 in _faces) {
if (!_local3._visible){
} else {
tri = _local3._dt;
tri.v0 = _local3._v0.project(projection);
tri.v1 = _local3._v1.project(projection);
tri.v2 = _local3._v2.project(projection);
if (!tri.v0.visible){
} else {
if (!tri.v1.visible){
} else {
if (!tri.v2.visible){
} else {
tri.calc();
if (tri.maxZ < 0){
} else {
backface = (tri.area < 0);
if (backface){
if (!bothsides){
continue;
};
tri.material = _local3._back;
} else {
tri.material = _local3._material;
};
if (tri.material == null){
if (backface){
tri.material = backmat;
} else {
tri.material = material;
};
};
if (tri.material != null){
if (!tri.material.visible){
tri.material = null;
};
};
if (outline == null){
//unresolved if
} else {
if (pushback){
tri.screenZ = tri.maxZ;
};
if (pushfront){
tri.screenZ = tri.minZ;
};
uvmaterial = (tri.material is IUVMaterial);
if (backface){
vt = tri.v1;
tri.v1 = tri.v2;
tri.v2 = vt;
tri.area = -(tri.area);
if (uvmaterial){
tri.uv0 = _local3._uv0;
tri.uv1 = _local3._uv2;
tri.uv2 = _local3._uv1;
};
} else {
if (uvmaterial){
tri.uv0 = _local3._uv0;
tri.uv1 = _local3._uv1;
tri.uv2 = _local3._uv2;
};
};
if (tri.backface != backface){
tri.backface = backface;
tri.texturemapping = null;
};
if (((!((outline == null))) && (!(backface)))){
n01 = _neighbour01[_local3];
if ((((n01 == null)) || ((n01.front(projection) <= 0)))){
_arg1.primitive(createDrawSegment(outline, projection, tri.v0, tri.v1));
};
n12 = _neighbour12[_local3];
if ((((n12 == null)) || ((n12.front(projection) <= 0)))){
_arg1.primitive(createDrawSegment(outline, projection, tri.v1, tri.v2));
};
n20 = _neighbour20[_local3];
if ((((n20 == null)) || ((n20.front(projection) <= 0)))){
_arg1.primitive(createDrawSegment(outline, projection, tri.v2, tri.v0));
};
//unresolved if
} else {
tri.projection = projection;
_arg1.primitive(tri);
};
};
};
};
};
};
};
};
}
private function findVertNormals():void{
var _local1:Vertex;
var _local2:Array;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Face;
var _local7:Number3D;
var _local8:Number3D;
if (!_vertnormalsDirty){
return;
};
_vertnormals = new Dictionary();
for each (_local1 in vertices) {
_local2 = _vertfaces[_local1];
_local3 = 0;
_local4 = 0;
_local5 = 0;
for each (_local6 in _local2) {
_local8 = _local6.normal;
_local3 = (_local3 + _local8.x);
_local4 = (_local4 + _local8.y);
_local5 = (_local5 + _local8.z);
};
_local7 = new Number3D(_local3, _local4, _local5);
_local7.normalize();
_vertnormals[_local1] = _local7;
};
_vertnormalsDirty = false;
}
private function findNeighbours():void{
var _local1:Face;
var _local2:Boolean;
var _local3:Face;
if (!_neighboursDirty){
return;
};
_neighbour01 = new Dictionary();
_neighbour12 = new Dictionary();
_neighbour20 = new Dictionary();
for each (_local1 in _faces) {
_local2 = true;
for each (_local3 in _faces) {
if (_local2){
if (_local1 == _local3){
_local2 = false;
};
} else {
if ((((_local1._v0 == _local3._v2)) && ((_local1._v1 == _local3._v1)))){
_neighbour01[_local1] = _local3;
_neighbour12[_local3] = _local1;
};
if ((((_local1._v0 == _local3._v0)) && ((_local1._v1 == _local3._v2)))){
_neighbour01[_local1] = _local3;
_neighbour20[_local3] = _local1;
};
if ((((_local1._v0 == _local3._v1)) && ((_local1._v1 == _local3._v0)))){
_neighbour01[_local1] = _local3;
_neighbour01[_local3] = _local1;
};
if ((((_local1._v1 == _local3._v2)) && ((_local1._v2 == _local3._v1)))){
_neighbour12[_local1] = _local3;
_neighbour12[_local3] = _local1;
};
if ((((_local1._v1 == _local3._v0)) && ((_local1._v2 == _local3._v2)))){
_neighbour12[_local1] = _local3;
_neighbour20[_local3] = _local1;
};
if ((((_local1._v1 == _local3._v1)) && ((_local1._v2 == _local3._v0)))){
_neighbour12[_local1] = _local3;
_neighbour01[_local3] = _local1;
};
if ((((_local1._v2 == _local3._v2)) && ((_local1._v0 == _local3._v1)))){
_neighbour20[_local1] = _local3;
_neighbour12[_local3] = _local1;
};
if ((((_local1._v2 == _local3._v0)) && ((_local1._v0 == _local3._v2)))){
_neighbour20[_local1] = _local3;
_neighbour20[_local3] = _local1;
};
if ((((_local1._v2 == _local3._v1)) && ((_local1._v0 == _local3._v0)))){
_neighbour20[_local1] = _local3;
_neighbour01[_local3] = _local1;
};
};
};
};
_neighboursDirty = false;
}
public function asXML():XML{
var result:XML;
var refvertices:Dictionary;
var verticeslist:Array;
var remembervertex:Function;
var refuvs:Dictionary;
var uvslist:Array;
var rememberuv:Function;
var face:Face;
var vn:int;
var v:Vertex;
var uvn:int;
var uv:UV;
var f:Face;
result = <mesh></mesh>
;
refvertices = new Dictionary();
verticeslist = [];
remembervertex = function (_arg1:Vertex):void{
if (refvertices[_arg1] == null){
refvertices[_arg1] = verticeslist.length;
verticeslist.push(_arg1);
};
};
refuvs = new Dictionary();
uvslist = [];
rememberuv = function (_arg1:UV):void{
if (_arg1 == null){
return;
};
if (refuvs[_arg1] == null){
refuvs[_arg1] = uvslist.length;
uvslist.push(_arg1);
};
};
for each (face in _faces) {
remembervertex(face._v0);
remembervertex(face._v1);
remembervertex(face._v2);
rememberuv(face._uv0);
rememberuv(face._uv1);
rememberuv(face._uv2);
};
vn = 0;
for each (v in verticeslist) {
result.appendChild(new XML((((((((("<vertex id=\"" + ??esc_xattr
) + "\" x=\"") + ??esc_xattr
) + "\" y=\"") + ??esc_xattr
) + "\" z=\"") + ??esc_xattr
) + "\"/>")));
vn = (vn + 1);
};
uvn = 0;
for each (uv in uvslist) {
result.appendChild(new XML((((((("<uv id=\"" + ??esc_xattr
) + "\" u=\"") + ??esc_xattr
) + "\" v=\"") + ??esc_xattr
) + "\"/>")));
uvn = (uvn + 1);
};
for each (f in _faces) {
result.appendChild(new XML((((((((((((("<face v0=\"" + ??esc_xattr
) + "\" v1=\"") + ??esc_xattr
) + "\" v2=\"") + ??esc_xattr
) + "\" uv0=\"") + ??esc_xattr
) + "\" uv1=\"") + ??esc_xattr
) + "\" uv2=\"") + ??esc_xattr
) + "\"/>")));
};
return (result);
}
public function createDrawTriangle(_arg1:Face, _arg2:ITriangleMaterial, _arg3:Projection, _arg4:ScreenVertex, _arg5:ScreenVertex, _arg6:ScreenVertex, _arg7:UV, _arg8:UV, _arg9:UV):DrawTriangle{
if (_dtStore.length){
_dtActive.push((tri = _dtStore.pop()));
tri.texturemapping = null;
tri.create = createDrawTriangle;
} else {
_dtActive.push((tri = new DrawTriangle()));
tri.source = this;
tri.create = createDrawTriangle;
};
tri.face = _arg1;
tri.material = _arg2;
tri.projection = _arg3;
tri.v0 = _arg4;
tri.v1 = _arg5;
tri.v2 = _arg6;
tri.uv0 = _arg7;
tri.uv1 = _arg8;
tri.uv2 = _arg9;
tri.calc();
return (tri);
}
public function addFace(_arg1:Face):void{
addElement(_arg1);
_faces.push(_arg1);
_arg1._dt.source = (_arg1.parent = this);
_arg1._dt.create = createDrawTriangle;
_arg1.addOnVertexChange(onFaceVertexChange);
rememberFaceNeighbours(_arg1);
_vertfacesDirty = true;
}
arcane function neighbour01(_arg1:Face):Face{
if (_neighboursDirty){
findNeighbours();
};
return (_neighbour01[_arg1]);
}
public function movePivot(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Boolean;
var _local5:Vertex;
_local4 = _neighboursDirty;
_neighboursDirty = true;
for each (_local5 in vertices) {
_local5.x = (_local5.x + _arg1);
_local5.y = (_local5.y + _arg2);
_local5.z = (_local5.z + _arg3);
};
x = (x - _arg1);
y = (y - _arg2);
z = (z - _arg3);
_neighboursDirty = _local4;
}
override public function get elements():Array{
return (_faces);
}
arcane function getFacesByVertex(_arg1:Vertex):Array{
if (_vertfacesDirty){
findVertFaces();
};
return (_vertfaces[_arg1]);
}
arcane function neighbour12(_arg1:Face):Face{
if (_neighboursDirty){
findNeighbours();
};
return (_neighbour12[_arg1]);
}
public function removeFace(_arg1:Face):void{
var _local2:int;
_local2 = _faces.indexOf(_arg1);
if (_local2 == -1){
return;
};
removeElement(_arg1);
_vertfacesDirty = true;
forgetFaceNeighbours(_arg1);
_arg1.removeOnVertexChange(onFaceVertexChange);
_faces.splice(_local2, 1);
}
arcane function neighbour20(_arg1:Face):Face{
if (_neighboursDirty){
findNeighbours();
};
return (_neighbour20[_arg1]);
}
public function get material():ITriangleMaterial{
return (_material);
}
arcane function recalcNeighbours():void{
var _local1:Dictionary;
var _local2:Dictionary;
var _local3:Dictionary;
if (!_neighboursDirty){
_neighboursDirty = true;
_local1 = _neighbour01;
_local2 = _neighbour12;
_local3 = _neighbour20;
findNeighbours();
};
}
override public function clone(_arg1=null){
var mesh:Mesh;
var clonedvertices:Dictionary;
var clonevertex:Function;
var cloneduvs:Dictionary;
var cloneuv:Function;
var face:Face;
var object = _arg1;
mesh = ((object) || (new Mesh()));
super.clone(mesh);
mesh.material = material;
mesh.outline = outline;
mesh.back = back;
mesh.bothsides = bothsides;
mesh.debugbb = debugbb;
clonedvertices = new Dictionary();
clonevertex = function (_arg1:Vertex):Vertex{
var _local2:Vertex;
_local2 = clonedvertices[_arg1];
if (_local2 == null){
_local2 = new Vertex(_arg1._x, _arg1._y, _arg1._z);
_local2.extra = ((_arg1.extra is IClonable)) ? (_arg1.extra as IClonable).clone() : _arg1.extra;
clonedvertices[_arg1] = _local2;
};
return (_local2);
};
cloneduvs = new Dictionary();
cloneuv = function (_arg1:UV):UV{
var _local2:UV;
if (_arg1 == null){
return (null);
};
_local2 = cloneduvs[_arg1];
if (_local2 == null){
_local2 = new UV(_arg1._u, _arg1._v);
cloneduvs[_arg1] = _local2;
};
return (_local2);
};
for each (face in _faces) {
mesh.addFace(new Face(clonevertex(face._v0), clonevertex(face._v1), clonevertex(face._v2), face.material, cloneuv(face._uv0), cloneuv(face._uv1), cloneuv(face._uv2)));
};
return (mesh);
}
private function onFaceVertexChange(_arg1:MeshElementEvent):void{
var _local2:Face;
if (!_neighboursDirty){
_local2 = (_arg1.element as Face);
forgetFaceNeighbours(_local2);
rememberFaceNeighbours(_local2);
};
_vertfacesDirty = true;
}
private function findVertFaces():void{
var _local1:Face;
var _local2:Vertex;
var _local3:Vertex;
var _local4:Vertex;
if (!_vertfacesDirty){
return;
};
_vertfaces = new Dictionary();
for each (_local1 in faces) {
_local2 = _local1.v0;
if (_vertfaces[_local1.v0] == null){
_vertfaces[_local1.v0] = [_local1];
} else {
_vertfaces[_local1.v0].push(_local1);
};
_local3 = _local1.v1;
if (_vertfaces[_local1.v1] == null){
_vertfaces[_local1.v1] = [_local1];
} else {
_vertfaces[_local1.v1].push(_local1);
};
_local4 = _local1.v2;
if (_vertfaces[_local1.v2] == null){
_vertfaces[_local1.v2] = [_local1];
} else {
_vertfaces[_local1.v2].push(_local1);
};
};
_vertfacesDirty = false;
}
private function forgetFaceNeighbours(_arg1:Face):void{
if (_neighboursDirty){
return;
};
n01 = _neighbour01[_arg1];
if (n01 != null){
delete _neighbour01[_arg1];
if (_neighbour01[n01] == _arg1){
delete _neighbour01[n01];
};
if (_neighbour12[n01] == _arg1){
delete _neighbour12[n01];
};
if (_neighbour20[n01] == _arg1){
delete _neighbour20[n01];
};
};
n12 = _neighbour12[_arg1];
if (n12 != null){
delete _neighbour12[_arg1];
if (_neighbour01[n12] == _arg1){
delete _neighbour01[n12];
};
if (_neighbour12[n12] == _arg1){
delete _neighbour12[n12];
};
if (_neighbour20[n12] == _arg1){
delete _neighbour20[n12];
};
};
n20 = _neighbour20[_arg1];
if (n20 != null){
delete _neighbour20[_arg1];
if (_neighbour01[n20] == _arg1){
delete _neighbour01[n20];
};
if (_neighbour12[n20] == _arg1){
delete _neighbour12[n20];
};
if (_neighbour20[n20] == _arg1){
delete _neighbour20[n20];
};
};
}
public function invertFaces():void{
var _local1:Face;
for each (_local1 in _faces) {
_local1.invert();
};
}
public function get faces():Array{
return (_faces);
}
public function asAS3Class(_arg1:String=null, _arg2:String=""):String{
var source:String;
var refvertices:Dictionary;
var verticeslist:Array;
var remembervertex:Function;
var refuvs:Dictionary;
var uvslist:Array;
var rememberuv:Function;
var face:Face;
var v:Vertex;
var uv:UV;
var f:Face;
var classname = _arg1;
var packagename = _arg2;
classname = ((((classname) || (name))) || ("MyAway3DObject"));
source = (((("package " + packagename) + "\n{\n\timport away3d.core.mesh.*;\n\n\tpublic class ") + classname) + " extends Mesh\n\t{\n");
source = (source + "\t\tprivate var varr:Array = [];\n");
source = (source + "\t\tprivate var uvarr:Array = [];\n\n");
source = (source + "\t\tprivate function v(x:Number,y:Number,z:Number):void\n\t\t{\n");
source = (source + "\t\t\tvarr.push(new Vertex(x,y,z));\n\t\t}\n\n");
source = (source + "\t\tprivate function uv(u:Number,v:Number):void\n\t\t{\n");
source = (source + "\t\t\tuvarr.push(new UV(u,v));\n\t\t}\n\n");
source = (source + "\t\tprivate function f(vn0:int, vn1:int, vn2:int, uvn0:int, uvn1:int, uvn2:int):void\n\t\t{\n");
source = (source + "\t\t\taddFace(new Face(varr[vn0],varr[vn1],varr[vn2], null, uvarr[uvn0],uvarr[uvn1],uvarr[uvn2]));\n\t\t}\n\n");
source = (source + (("\t\tpublic function " + classname) + "(init:Object = null)\n\t\t{\n\t\t\tsuper(init);\n\t\t\tbuild();\n\t\t}\n\n"));
source = (source + "\t\tprivate function build():void\n\t\t{\n");
refvertices = new Dictionary();
verticeslist = [];
remembervertex = function (_arg1:Vertex):void{
if (refvertices[_arg1] == null){
refvertices[_arg1] = verticeslist.length;
verticeslist.push(_arg1);
};
};
refuvs = new Dictionary();
uvslist = [];
rememberuv = function (_arg1:UV):void{
if (_arg1 == null){
return;
};
if (refuvs[_arg1] == null){
refuvs[_arg1] = uvslist.length;
uvslist.push(_arg1);
};
};
for each (face in _faces) {
remembervertex(face._v0);
remembervertex(face._v1);
remembervertex(face._v2);
rememberuv(face._uv0);
rememberuv(face._uv1);
rememberuv(face._uv2);
};
for each (v in verticeslist) {
source = (source + (((((("\t\t\tv(" + v._x) + ",") + v._y) + ",") + v._z) + ");\n"));
};
for each (uv in uvslist) {
source = (source + (((("\t\t\tuv(" + uv._u) + ",") + uv._v) + ");\n"));
};
for each (f in _faces) {
source = (source + (((((((((((("\t\t\tf(" + refvertices[f._v0]) + ",") + refvertices[f._v1]) + ",") + refvertices[f._v2]) + ",") + refuvs[f._uv0]) + ",") + refuvs[f._uv1]) + ",") + refuvs[f._uv2]) + ");\n"));
};
source = (source + "\t\t}\n\t}\n}");
return (source);
}
}
}//package away3d.core.mesh
Section 50
//MeshElementEvent (away3d.core.mesh.MeshElementEvent)
package away3d.core.mesh {
import flash.events.*;
public class MeshElementEvent extends Event {
public var element:IMeshElement;
public function MeshElementEvent(_arg1:String, _arg2:IMeshElement){
super(_arg1);
this.element = _arg2;
}
override public function clone():Event{
return (new MeshElementEvent(type, element));
}
}
}//package away3d.core.mesh
Section 51
//Segment (away3d.core.mesh.Segment)
package away3d.core.mesh {
import flash.events.*;
import away3d.core.material.*;
import away3d.core.draw.*;
import away3d.core.*;
public class Segment extends BaseMeshElement {
arcane var _material:ISegmentMaterial;
public var extra:Object;
arcane var _v0:Vertex;
arcane var _v1:Vertex;
public var parent:BaseMesh;
arcane var _ds:DrawSegment;
private var materialchanged:SegmentEvent;
public function Segment(_arg1:Vertex, _arg2:Vertex, _arg3:ISegmentMaterial=null){
_ds = new DrawSegment();
super();
this.v0 = _arg1;
this.v1 = _arg2;
this.material = _arg3;
}
override public function get vertices():Array{
return ([_v0, _v1]);
}
public function get v1():Vertex{
return (_v1);
}
override public function get maxX():Number{
if (_v0._x > _v1._x){
return (_v0._x);
};
return (_v1._x);
}
public function set v1(_arg1:Vertex):void{
if (_arg1 == _v1){
return;
};
if (_v1 != null){
if (_v1 != _v0){
_v1.removeOnChange(onVertexValueChange);
};
};
_v1 = _arg1;
if (_v1 != null){
if (_v1 != _v0){
_v1.addOnChange(onVertexValueChange);
};
};
notifyVertexChange();
}
public function get v0():Vertex{
return (_v0);
}
private function onVertexValueChange(_arg1:Event):void{
notifyVertexValueChange();
}
public function removeOnMaterialChange(_arg1:Function):void{
removeEventListener("materialchanged", _arg1, false);
}
public function set v0(_arg1:Vertex):void{
if (_arg1 == _v0){
return;
};
if (_v0 != null){
if (_v0 != _v1){
_v0.removeOnChange(onVertexValueChange);
};
};
_v0 = _arg1;
if (_v0 != null){
if (_v0 != _v1){
_v0.addOnChange(onVertexValueChange);
};
};
notifyVertexChange();
}
public function get material():ISegmentMaterial{
return (_material);
}
public function addOnMaterialChange(_arg1:Function):void{
addEventListener("materialchanged", _arg1, false, 0, true);
}
override public function get minX():Number{
if (_v0._x < _v1._x){
return (_v0._x);
};
return (_v1._x);
}
override public function get minY():Number{
if (_v0._y < _v1._y){
return (_v0._y);
};
return (_v1._y);
}
override public function get minZ():Number{
if (_v0._z < _v1._z){
return (_v0._z);
};
return (_v1._z);
}
override public function get radius2():Number{
var _local1:Number;
var _local2:Number;
_local1 = (((_v0._x * _v0._x) + (_v0._y * _v0._y)) + (_v0._z * _v0._z));
_local2 = (((_v1._x * _v1._x) + (_v1._y * _v1._y)) + (_v1._z * _v1._z));
if (_local1 > _local2){
return (_local1);
};
return (_local2);
}
protected function notifyMaterialChange():void{
if (!hasEventListener("materialchanged")){
return;
};
if (materialchanged == null){
materialchanged = new SegmentEvent("materialchanged", this);
};
dispatchEvent(materialchanged);
}
public function set material(_arg1:ISegmentMaterial):void{
if (_arg1 == _material){
return;
};
_material = _arg1;
notifyMaterialChange();
}
private function onVertexChange(_arg1:Event):void{
notifyVertexChange();
}
override public function get maxY():Number{
if (_v0._y > _v1._y){
return (_v0._y);
};
return (_v1._y);
}
override public function get maxZ():Number{
if (_v0._z > _v1._z){
return (_v0._z);
};
return (_v1._z);
}
}
}//package away3d.core.mesh
Section 52
//SegmentEvent (away3d.core.mesh.SegmentEvent)
package away3d.core.mesh {
import flash.events.*;
public class SegmentEvent extends Event {
public var segment:Segment;
public function SegmentEvent(_arg1:String, _arg2:Segment){
super(_arg1);
this.segment = _arg2;
}
override public function clone():Event{
return (new SegmentEvent(type, segment));
}
}
}//package away3d.core.mesh
Section 53
//UV (away3d.core.mesh.UV)
package away3d.core.mesh {
import away3d.core.utils.*;
import away3d.core.*;
public class UV extends ValueObject {
arcane var _u:Number;
arcane var _v:Number;
public var extra:Object;
public function UV(_arg1:Number=0, _arg2:Number=0){
_u = _arg1;
_v = _arg2;
}
public function clone():UV{
return (new UV(_u, _v));
}
public function toString():String{
return ((((("new UV(" + _u) + ", ") + _v) + ")"));
}
public function set u(_arg1:Number):void{
if (_arg1 == _u){
return;
};
_u = _arg1;
notifyChange();
}
public function set v(_arg1:Number):void{
if (_arg1 == _v){
return;
};
_v = _arg1;
notifyChange();
}
public function get u():Number{
return (_u);
}
public function get v():Number{
return (_v);
}
arcane static function median(_arg1:UV, _arg2:UV):UV{
if (_arg1 == null){
return (null);
};
if (_arg2 == null){
return (null);
};
return (new UV(((_arg1._u + _arg2._u) / 2), ((_arg1._v + _arg2._v) / 2)));
}
arcane static function weighted(_arg1:UV, _arg2:UV, _arg3:Number, _arg4:Number):UV{
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (_arg1 == null){
return (null);
};
if (_arg2 == null){
return (null);
};
_local5 = (_arg3 + _arg4);
_local6 = (_arg3 / _local5);
_local7 = (_arg4 / _local5);
return (new UV(((_arg1._u * _local6) + (_arg2._u * _local7)), ((_arg1._v * _local6) + (_arg2._v * _local7))));
}
}
}//package away3d.core.mesh
Section 54
//Vertex (away3d.core.mesh.Vertex)
package away3d.core.mesh {
import away3d.core.math.*;
import away3d.core.render.*;
import away3d.core.draw.*;
import away3d.core.utils.*;
import away3d.core.*;
public class Vertex extends ValueObject {
arcane var _y:Number;
private var _position:Number3D;
private var persp:Number;
public var extra:Object;
private var view:Matrix3D;
private var sz:Number;
arcane var _x:Number;
arcane var _z:Number;
private var projectionTime:int;
private var projected:ScreenVertex;
public function Vertex(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
_position = new Number3D();
projected = new ScreenVertex();
super();
_x = (_position.x = _arg1);
_y = (_position.y = _arg2);
_z = (_position.z = _arg3);
}
public function toString():String{
return ((((((("new Vertex(" + _x) + ", ") + _y) + ", ") + z) + ")"));
}
public function get y():Number{
return (_y);
}
arcane function perspective(_arg1:Number):ScreenVertex{
persp = (1 / (1 + (_z / _arg1)));
return (new ScreenVertex((_x * persp), (_y * persp), z));
}
public function set position(_arg1:Number3D):void{
_x = (_position.x = _arg1.x);
_y = (_position.y = _arg1.y);
_z = (_position.z = _arg1.z);
notifyChange();
}
public function set y(_arg1:Number):void{
if (_arg1 == _y){
return;
};
if (isNaN(_arg1)){
Debug.warning("isNaN(y)");
};
if (_arg1 == Infinity){
Debug.warning("y == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("y == -Infinity");
};
_y = (_position.y = _arg1);
notifyChange();
}
public function clone():Vertex{
return (new Vertex(_x, _y, _z));
}
public function project(_arg1:Projection):ScreenVertex{
if (projectionTime == _arg1.time){
return (projected);
};
projectionTime = _arg1.time;
view = _arg1.view;
sz = ((((_x * view.szx) + (_y * view.szy)) + (_z * view.szz)) + view.tz);
if (isNaN(sz)){
throw (new Error("isNaN(sz)"));
};
if ((sz * 2) <= -(_arg1.focus)){
projected.visible = false;
return (projected);
};
projected.visible = true;
persp = (_arg1.zoom / (1 + (sz / _arg1.focus)));
projected.x = (((((_x * view.sxx) + (_y * view.sxy)) + (_z * view.sxz)) + view.tx) * persp);
projected.y = (((((_x * view.syx) + (_y * view.syy)) + (_z * view.syz)) + view.ty) * persp);
projected.z = sz;
return (projected);
}
public function get position():Number3D{
return (_position);
}
arcane function transform(_arg1:Matrix3D):void{
setValue(((((_x * _arg1.sxx) + (_y * _arg1.sxy)) + (_z * _arg1.sxz)) + _arg1.tx), ((((_x * _arg1.syx) + (_y * _arg1.syy)) + (_z * _arg1.syz)) + _arg1.ty), ((((_x * _arg1.szx) + (_y * _arg1.szy)) + (_z * _arg1.szz)) + _arg1.tz));
}
arcane function setValue(_arg1:Number, _arg2:Number, _arg3:Number):void{
_x = (_position.x = _arg1);
_y = (_position.y = _arg2);
_z = (_position.z = _arg3);
notifyChange();
}
public function set z(_arg1:Number):void{
if (_arg1 == _z){
return;
};
if (isNaN(_arg1)){
throw (new Error("isNaN(z)"));
};
if (_arg1 == Infinity){
Debug.warning("z == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("z == -Infinity");
};
_z = (_position.z = _arg1);
notifyChange();
}
public function set x(_arg1:Number):void{
if (_arg1 == _x){
return;
};
if (isNaN(_arg1)){
Debug.warning("isNaN(x)");
};
if (_arg1 == Infinity){
Debug.warning("x == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("x == -Infinity");
};
_x = (_position.x = _arg1);
notifyChange();
}
public function get x():Number{
return (_x);
}
public function get z():Number{
return (_z);
}
arcane static function median(_arg1:Vertex, _arg2:Vertex):Vertex{
return (new Vertex(((_arg1._x + _arg2._x) / 2), ((_arg1._y + _arg2._y) / 2), ((_arg1._z + _arg2._z) / 2)));
}
arcane static function weighted(_arg1:Vertex, _arg2:Vertex, _arg3:Number, _arg4:Number):Vertex{
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local5 = (_arg3 + _arg4);
_local6 = (_arg3 / _local5);
_local7 = (_arg4 / _local5);
return (new Vertex(((_arg1._x * _local6) + (_arg2._x * _local7)), ((_arg1._y * _local6) + (_arg2._y * _local7)), ((_arg1._z * _local6) + (_arg2._z * _local7))));
}
arcane static function distanceSqr(_arg1:Vertex, _arg2:Vertex):Number{
return (((((_arg1._x + _arg2._x) * (_arg1._x + _arg2._x)) + ((_arg1._y + _arg2._y) * (_arg1._y + _arg2._y))) + ((_arg1._z + _arg2._z) * (_arg1._z + _arg2._z))));
}
}
}//package away3d.core.mesh
Section 55
//VertexPosition (away3d.core.mesh.VertexPosition)
package away3d.core.mesh {
public class VertexPosition {
public var vertex:Vertex;
public var x:Number;
public var y:Number;
public var z:Number;
public function VertexPosition(_arg1:Vertex){
this.vertex = _arg1;
this.x = 0;
this.y = 0;
this.z = 0;
}
public function adjust(_arg1:Number=1):void{
vertex._x = ((vertex._x * (1 - _arg1)) + (x * _arg1));
vertex._y = ((vertex._y * (1 - _arg1)) + (y * _arg1));
vertex._z = ((vertex._z * (1 - _arg1)) + (z * _arg1));
}
}
}//package away3d.core.mesh
Section 56
//WireMesh (away3d.core.mesh.WireMesh)
package away3d.core.mesh {
import away3d.core.math.*;
import away3d.core.material.*;
import away3d.core.render.*;
import away3d.core.scene.*;
import away3d.core.draw.*;
import away3d.core.utils.*;
import away3d.core.*;
public class WireMesh extends BaseMesh implements IPrimitiveProvider {
private var _segments:Array;
public var material:ISegmentMaterial;
public function WireMesh(_arg1:Object=null){
_segments = [];
super(_arg1);
_arg1 = Init.parse(_arg1);
material = _arg1.getSegmentMaterial("material");
if (material == null){
material = new WireframeMaterial();
};
}
public function removeSegment(_arg1:Segment):void{
var _local2:int;
_local2 = _segments.indexOf(_arg1);
if (_local2 == -1){
return;
};
removeElement(_arg1);
_segments.splice(_local2, 1);
}
private function clear():void{
var _local1:Segment;
for each (_local1 in _segments.concat([])) {
removeSegment(_local1);
};
}
public function addSegment(_arg1:Segment):void{
addElement(_arg1);
_segments.push(_arg1);
_arg1._ds.source = (_arg1.parent = this);
_arg1._ds.create = createDrawSegment;
}
override public function primitives(_arg1:IPrimitiveConsumer, _arg2:RenderSession):void{
var _local3:DrawSegment;
var _local4:Segment;
super.primitives(_arg1, _arg2);
for each (_local4 in _segments) {
_local3 = _local4._ds;
_local3.v0 = _local4._v0.project(projection);
_local3.v1 = _local4._v1.project(projection);
if (!_local3.v0.visible){
} else {
if (!_local3.v1.visible){
} else {
_local3.calc();
if (_local3.maxZ < 0){
} else {
_local3.material = ((_local4.material) || (material));
if (_local3.material == null){
} else {
if (!_local3.material.visible){
} else {
_local3.projection = projection;
_arg1.primitive(_local3);
};
};
};
};
};
};
}
public function get segments():Array{
return (_segments);
}
override public function get elements():Array{
return (_segments);
}
}
}//package away3d.core.mesh
Section 57
//AnotherRivalFilter (away3d.core.render.AnotherRivalFilter)
package away3d.core.render {
import flash.utils.*;
import flash.display.*;
import away3d.core.scene.*;
import away3d.core.draw.*;
public class AnotherRivalFilter implements IPrimitiveQuadrantFilter {
var q20w01:Boolean;
var ql20c:Number;
private var ZOrderHigher:int;// = -1
var q12rd:Number;
var q12w01d:Number;
var maxdeltaZ:Number;
var q20w12:Boolean;
var part:DrawPrimitive;
var q01ry:Number;
var q01w01x:Number;
var wl12q0:Number;
var wl12q1:Number;
var wl12q2:Number;
var q12rx:Number;
var q12ry:Number;
var q12w01y:Number;
var q01w01y:Number;
var ql20w2:Number;
var q20w20:Boolean;
var rivals:Array;
var q12w12x:Number;
var q12w01x:Number;
var q12w12y:Number;
var r0x:Number;
var r0y:Number;
var az:Number;
var q12w12d:Number;
var minZ:Number;
var bz:Number;
var r1x:Number;
var r1y:Number;
var ql01r1:Number;
var q12r:Boolean;
var ql01r0:Number;
var start:int;
var ql12a:Number;
var ql12b:Number;
var ql12c:Number;
var primitives:Array;
var cx:Number;
var ql12s:Number;
var q0x:Number;
var q0y:Number;
var ql12r1:Number;
var turn:int;
var q01r:Boolean;
var ql01a:Number;
var ql01b:Number;
var ql01c:Number;
var ql12r0:Number;
var cy:Number;
var ql01s:Number;
var q1x:Number;
var q1y:Number;
public var maxdelay:int;
var pri:DrawPrimitive;
var q2x:Number;
var q2y:Number;
private var ZOrderDeeper:int;// = 1
var parts:Array;
var q20rd:Number;
var wl20a:Number;
var wl20b:Number;
var wl20c:Number;
var ql01w1:Number;
var ql01w2:Number;
var wl20q0:Number;
private var ZOrderIrrelevant:int;// = 0
var q20rx:Number;
var q20w20d:Number;
var w0x:Number;
var wl20q1:Number;
var wl20q2:Number;
var ql01w0:Number;
var q20ry:Number;
var check:int;
var q20w20x:Number;
var q20w20y:Number;
var ql12w0:Number;
var ql12w1:Number;
var ql12w2:Number;
var w0y:Number;
var count:int;
var w1y:Number;
var wl20s:Number;
var w1x:Number;
var q12w01:Boolean;
var w2x:Number;
var q01w20d:Number;
var w2y:Number;
var q01w01:Boolean;
var q12w12:Boolean;
var q01w20x:Number;
var q01w20y:Number;
var ql20r0:Number;
var ql20r1:Number;
var leftover:Array;
var q12w20d:Number;
var q12w20:Boolean;
var q01w12:Boolean;
var rla:Number;
var rlb:Number;
var rlc:Number;
var wl12a:Number;
var wl12b:Number;
var wl12c:Number;
var q12w20x:Number;
var maxZ:Number;
var q20w12d:Number;
var wl12s:Number;
var q01w20:Boolean;
var q12w20y:Number;
var rival:DrawPrimitive;
var wl01a:Number;
var wl01c:Number;
var q20w12x:Number;
var q20w12y:Number;
var wl01b:Number;
var rlq0:Number;
var rlq2:Number;
var wl01s:Number;
private var ZOrderSame:int;// = 0
var q20w01d:Number;
var rlq1:Number;
var q20w01x:Number;
var q20w01y:Number;
var q01w12d:Number;
var q01w12y:Number;
var q01w12x:Number;
var q20r:Boolean;
var q01rd:Number;
var q01w01d:Number;
var ql20a:Number;
var ql20b:Number;
var ql20w1:Number;
var wl01q1:Number;
var wl01q2:Number;
var q01rx:Number;
var ql20w0:Number;
var ql20s:Number;
var wl01q0:Number;
public function AnotherRivalFilter(_arg1:int=60000){
ZOrderDeeper = 1;
ZOrderIrrelevant = 0;
ZOrderHigher = -1;
ZOrderSame = 0;
super();
this.maxdelay = _arg1;
}
public function zconflict(_arg1:DrawPrimitive, _arg2:DrawPrimitive):int{
if ((_arg1 is DrawTriangle)){
if ((_arg2 is DrawTriangle)){
return (zconflictTT((_arg1 as DrawTriangle), (_arg2 as DrawTriangle)));
};
if ((_arg2 is DrawSegment)){
return (zconflictTS((_arg1 as DrawTriangle), (_arg2 as DrawSegment)));
};
if ((_arg1 is DrawScaledBitmap)){
return (zconflictTB((_arg1 as DrawTriangle), (_arg2 as DrawScaledBitmap)));
};
} else {
if ((_arg1 is DrawSegment)){
if ((_arg2 is DrawTriangle)){
return (-(zconflictTS((_arg2 as DrawTriangle), (_arg1 as DrawSegment))));
};
} else {
if ((_arg1 is DrawScaledBitmap)){
if ((_arg2 is DrawTriangle)){
return (-(zconflictTB((_arg2 as DrawTriangle), (_arg1 as DrawScaledBitmap))));
};
if ((_arg2 is DrawScaledBitmap)){
return (zconflictBB((_arg1 as DrawScaledBitmap), (_arg2 as DrawScaledBitmap)));
};
};
};
};
return (ZOrderIrrelevant);
}
public function toString():String{
return (("AnotherRivalFilter" + ((maxdelay)==60000) ? "" : (("(" + maxdelay) + "ms)")));
}
private function zcompare(_arg1:DrawPrimitive, _arg2:DrawPrimitive, _arg3:Number, _arg4:Number):int{
az = _arg1.getZ(_arg3, _arg4);
bz = _arg2.getZ(_arg3, _arg4);
if (az > bz){
return (ZOrderDeeper);
};
if (az < bz){
return (ZOrderHigher);
};
return (ZOrderSame);
}
public function filter(_arg1:PrimitiveQuadrantTree, _arg2:Scene3D, _arg3:Camera3D, _arg4:Sprite, _arg5:Clipping):void{
start = getTimer();
check = 0;
primitives = _arg1.list();
turn = 0;
while (primitives.length > 0) {
leftover = new Array();
for each (pri in primitives) {
check++;
if (check == 10){
if ((getTimer() - start) > maxdelay){
return;
};
check = 0;
};
maxZ = (pri.maxZ + 1000);
minZ = (pri.minZ - 1000);
maxdeltaZ = 0;
rivals = _arg1.get(pri);
for each (rival in rivals) {
if (rival == pri){
} else {
switch (zconflict(pri, rival)){
case ZOrderIrrelevant:
break;
case ZOrderDeeper:
if (minZ < rival.screenZ){
minZ = rival.screenZ;
};
break;
case ZOrderHigher:
if (maxZ > rival.screenZ){
maxZ = rival.screenZ;
};
break;
};
};
};
if ((((maxZ >= pri.screenZ)) && ((pri.screenZ >= minZ)))){
} else {
if (maxZ >= minZ){
pri.screenZ = ((maxZ + minZ) / 2);
} else {
if ((turn % 3) == 2){
parts = pri.quarter(_arg3.focus);
if (parts == null){
continue;
};
_arg1.remove(pri);
for each (part in parts) {
leftover.push(part);
_arg1.push(part);
};
} else {
leftover.push(pri);
};
};
};
};
primitives = leftover;
turn = (turn + 1);
if (turn == 20){
break;
};
};
}
private function zconflictBB(_arg1:DrawScaledBitmap, _arg2:DrawScaledBitmap):int{
if (_arg1.screenZ > _arg2.screenZ){
return (ZOrderDeeper);
};
if (_arg1.screenZ < _arg2.screenZ){
return (ZOrderHigher);
};
return (ZOrderSame);
}
private function zconflictTB(_arg1:DrawTriangle, _arg2:DrawScaledBitmap):int{
if (_arg1.contains(_arg2.v.x, _arg2.v.y)){
return (zcompare(_arg1, _arg2, _arg2.v.x, _arg2.v.y));
};
if (_arg1.contains(_arg2.minX, _arg2.minY)){
return (zcompare(_arg1, _arg2, _arg2.minX, _arg2.minY));
};
if (_arg1.contains(_arg2.minX, _arg2.maxY)){
return (zcompare(_arg1, _arg2, _arg2.minX, _arg2.maxY));
};
if (_arg1.contains(_arg2.maxX, _arg2.minY)){
return (zcompare(_arg1, _arg2, _arg2.maxX, _arg2.minY));
};
if (_arg1.contains(_arg2.maxX, _arg2.maxY)){
return (zcompare(_arg1, _arg2, _arg2.maxX, _arg2.maxY));
};
return (ZOrderIrrelevant);
}
private function zconflictTS(_arg1:DrawTriangle, _arg2:DrawSegment):int{
q0x = _arg1.v0.x;
q0y = _arg1.v0.y;
q1x = _arg1.v1.x;
q1y = _arg1.v1.y;
q2x = _arg1.v2.x;
q2y = _arg1.v2.y;
r0x = _arg2.v0.x;
r0y = _arg2.v0.y;
r1x = _arg2.v1.x;
r1y = _arg2.v1.y;
ql01a = (q1y - q0y);
ql01b = (q0x - q1x);
ql01c = -(((ql01b * q0y) + (ql01a * q0x)));
ql01s = (((ql01a * q2x) + (ql01b * q2y)) + ql01c);
ql01r0 = ((((ql01a * r0x) + (ql01b * r0y)) + ql01c) * ql01s);
ql01r1 = ((((ql01a * r1x) + (ql01b * r1y)) + ql01c) * ql01s);
if ((((ql01r0 <= 0.0001)) && ((ql01r1 <= 0.0001)))){
return (ZOrderIrrelevant);
};
ql12a = (q2y - q1y);
ql12b = (q1x - q2x);
ql12c = -(((ql12b * q1y) + (ql12a * q1x)));
ql12s = (((ql12a * q0x) + (ql12b * q0y)) + ql12c);
ql12r0 = ((((ql12a * r0x) + (ql12b * r0y)) + ql12c) * ql12s);
ql12r1 = ((((ql12a * r1x) + (ql12b * r1y)) + ql12c) * ql12s);
if ((((ql12r0 <= 0.0001)) && ((ql12r1 <= 0.0001)))){
return (ZOrderIrrelevant);
};
ql20a = (q0y - q2y);
ql20b = (q2x - q0x);
ql20c = -(((ql20b * q2y) + (ql20a * q2x)));
ql20s = (((ql20a * q1x) + (ql20b * q1y)) + ql20c);
ql20r0 = ((((ql20a * r0x) + (ql20b * r0y)) + ql20c) * ql20s);
ql20r1 = ((((ql20a * r1x) + (ql20b * r1y)) + ql20c) * ql20s);
if ((((ql20r0 <= 0.0001)) && ((ql20r1 <= 0.0001)))){
return (ZOrderIrrelevant);
};
rla = (r1y - r0y);
rlb = (r0x - r1x);
rlc = -(((rlb * r0y) + (rla * r0x)));
rlq0 = (((rla * q0x) + (rlb * q0y)) + rlc);
rlq1 = (((rla * q1x) + (rlb * q1y)) + rlc);
rlq2 = (((rla * q2x) + (rlb * q2y)) + rlc);
if (((((((rlq0 * rlq1) >= 0.0001)) && (((rlq1 * rlq2) >= 0.0001)))) && (((rlq2 * rlq0) >= 0.0001)))){
return (ZOrderIrrelevant);
};
if ((((((((ql01r0 > -0.0001)) && ((ql12r0 > -0.0001)))) && ((ql20r0 > -0.0001)))) && ((((((ql01r1 > -0.0001)) && ((ql12r1 > -0.0001)))) && ((ql20r1 > -0.0001)))))){
return (zcompare(_arg1, _arg2, ((r0x + r1x) / 2), ((r0y + r1y) / 2)));
};
q01r = ((((rlq0 * rlq1) < 0.0001)) && (((ql01r0 * ql01r1) < 0.0001)));
q12r = ((((rlq1 * rlq2) < 0.0001)) && (((ql12r0 * ql12r1) < 0.0001)));
q20r = ((((rlq2 * rlq0) < 0.0001)) && (((ql20r0 * ql20r1) < 0.0001)));
count = 0;
cx = 0;
cy = 0;
if ((((((ql01r0 > 0.0001)) && ((ql12r0 > 0.0001)))) && ((ql20r0 > 0.0001)))){
cx = (cx + r0x);
cy = (cy + r0y);
count = (count + 1);
};
if ((((((ql01r1 > 0.0001)) && ((ql12r1 > 0.0001)))) && ((ql20r1 > 0.0001)))){
cx = (cx + r1x);
cy = (cy + r1y);
count = (count + 1);
};
if (q01r){
q01rd = ((ql01a * rlb) - (ql01b * rla));
if ((q01rd * q01rd) > 0.0001){
q01rx = (((ql01b * rlc) - (ql01c * rlb)) / q01rd);
q01ry = (((ql01c * rla) - (ql01a * rlc)) / q01rd);
cx = (cx + q01rx);
cy = (cy + q01ry);
count = (count + 1);
};
};
if (q12r){
q12rd = ((ql12a * rlb) - (ql12b * rla));
if ((q12rd * q12rd) > 0.0001){
q12rx = (((ql12b * rlc) - (ql12c * rlb)) / q12rd);
q12ry = (((ql12c * rla) - (ql12a * rlc)) / q12rd);
cx = (cx + q12rx);
cy = (cy + q12ry);
count = (count + 1);
};
};
if (q20r){
q20rd = ((ql20a * rlb) - (ql20b * rla));
if ((q20rd * q20rd) > 0.0001){
q20rx = (((ql20b * rlc) - (ql20c * rlb)) / q20rd);
q20ry = (((ql20c * rla) - (ql20a * rlc)) / q20rd);
cx = (cx + q20rx);
cy = (cy + q20ry);
count = (count + 1);
};
};
return (zcompare(_arg1, _arg2, (cx / count), (cy / count)));
}
private function zconflictTT(_arg1:DrawTriangle, _arg2:DrawTriangle):int{
q0x = _arg1.v0.x;
q0y = _arg1.v0.y;
q1x = _arg1.v1.x;
q1y = _arg1.v1.y;
q2x = _arg1.v2.x;
q2y = _arg1.v2.y;
w0x = _arg2.v0.x;
w0y = _arg2.v0.y;
w1x = _arg2.v1.x;
w1y = _arg2.v1.y;
w2x = _arg2.v2.x;
w2y = _arg2.v2.y;
ql01a = (q1y - q0y);
ql01b = (q0x - q1x);
ql01c = -(((ql01b * q0y) + (ql01a * q0x)));
ql01s = (((ql01a * q2x) + (ql01b * q2y)) + ql01c);
ql01w0 = ((((ql01a * w0x) + (ql01b * w0y)) + ql01c) * ql01s);
ql01w1 = ((((ql01a * w1x) + (ql01b * w1y)) + ql01c) * ql01s);
ql01w2 = ((((ql01a * w2x) + (ql01b * w2y)) + ql01c) * ql01s);
if ((((((ql01w0 <= 0.0001)) && ((ql01w1 <= 0.0001)))) && ((ql01w2 <= 0.0001)))){
return (ZOrderIrrelevant);
};
ql12a = (q2y - q1y);
ql12b = (q1x - q2x);
ql12c = -(((ql12b * q1y) + (ql12a * q1x)));
ql12s = (((ql12a * q0x) + (ql12b * q0y)) + ql12c);
ql12w0 = ((((ql12a * w0x) + (ql12b * w0y)) + ql12c) * ql12s);
ql12w1 = ((((ql12a * w1x) + (ql12b * w1y)) + ql12c) * ql12s);
ql12w2 = ((((ql12a * w2x) + (ql12b * w2y)) + ql12c) * ql12s);
if ((((((ql12w0 <= 0.0001)) && ((ql12w1 <= 0.0001)))) && ((ql12w2 <= 0.0001)))){
return (ZOrderIrrelevant);
};
ql20a = (q0y - q2y);
ql20b = (q2x - q0x);
ql20c = -(((ql20b * q2y) + (ql20a * q2x)));
ql20s = (((ql20a * q1x) + (ql20b * q1y)) + ql20c);
ql20w0 = ((((ql20a * w0x) + (ql20b * w0y)) + ql20c) * ql20s);
ql20w1 = ((((ql20a * w1x) + (ql20b * w1y)) + ql20c) * ql20s);
ql20w2 = ((((ql20a * w2x) + (ql20b * w2y)) + ql20c) * ql20s);
if ((((((ql20w0 <= 0.0001)) && ((ql20w1 <= 0.0001)))) && ((ql20w2 <= 0.0001)))){
return (ZOrderIrrelevant);
};
wl01a = (w1y - w0y);
wl01b = (w0x - w1x);
wl01c = -(((wl01b * w0y) + (wl01a * w0x)));
wl01s = (((wl01a * w2x) + (wl01b * w2y)) + wl01c);
wl01q0 = ((((wl01a * q0x) + (wl01b * q0y)) + wl01c) * wl01s);
wl01q1 = ((((wl01a * q1x) + (wl01b * q1y)) + wl01c) * wl01s);
wl01q2 = ((((wl01a * q2x) + (wl01b * q2y)) + wl01c) * wl01s);
if ((((((wl01q0 <= 0.0001)) && ((wl01q1 <= 0.0001)))) && ((wl01q2 <= 0.0001)))){
return (ZOrderIrrelevant);
};
wl12a = (w2y - w1y);
wl12b = (w1x - w2x);
wl12c = -(((wl12b * w1y) + (wl12a * w1x)));
wl12s = (((wl12a * w0x) + (wl12b * w0y)) + wl12c);
wl12q0 = ((((wl12a * q0x) + (wl12b * q0y)) + wl12c) * wl12s);
wl12q1 = ((((wl12a * q1x) + (wl12b * q1y)) + wl12c) * wl12s);
wl12q2 = ((((wl12a * q2x) + (wl12b * q2y)) + wl12c) * wl12s);
if ((((((wl12q0 <= 0.0001)) && ((wl12q1 <= 0.0001)))) && ((wl12q2 <= 0.0001)))){
return (ZOrderIrrelevant);
};
wl20a = (w0y - w2y);
wl20b = (w2x - w0x);
wl20c = -(((wl20b * w2y) + (wl20a * w2x)));
wl20s = (((wl20a * w1x) + (wl20b * w1y)) + wl20c);
wl20q0 = ((((wl20a * q0x) + (wl20b * q0y)) + wl20c) * wl20s);
wl20q1 = ((((wl20a * q1x) + (wl20b * q1y)) + wl20c) * wl20s);
wl20q2 = ((((wl20a * q2x) + (wl20b * q2y)) + wl20c) * wl20s);
if ((((((wl20q0 <= 0.0001)) && ((wl20q1 <= 0.0001)))) && ((wl20q2 <= 0.0001)))){
return (ZOrderIrrelevant);
};
if (((((((((((wl01q0 * wl01q0) <= 0.0001)) || (((wl12q0 * wl12q0) <= 0.0001)))) || (((wl20q0 * wl20q0) <= 0.0001)))) && (((((((wl01q1 * wl01q1) <= 0.0001)) || (((wl12q1 * wl12q1) <= 0.0001)))) || (((wl20q1 * wl20q1) <= 0.0001)))))) && (((((((wl01q2 * wl01q2) <= 0.0001)) || (((wl12q2 * wl12q2) <= 0.0001)))) || (((wl20q2 * wl20q2) <= 0.0001)))))){
return (zcompare(_arg1, _arg2, (((q0x + q1x) + q2x) / 3), (((q0y + q1y) + q2y) / 3)));
};
if (((((((((((ql01w0 * ql01w0) <= 0.0001)) || (((ql12w0 * ql12w0) <= 0.0001)))) || (((ql20w0 * ql20w0) <= 0.0001)))) && (((((((ql01w1 * ql01w1) <= 0.0001)) || (((ql12w1 * ql12w1) <= 0.0001)))) || (((ql20w1 * ql20w1) <= 0.0001)))))) && (((((((ql01w2 * ql01w2) <= 0.0001)) || (((ql12w2 * ql12w2) <= 0.0001)))) || (((ql20w2 * ql20w2) <= 0.0001)))))){
return (zcompare(_arg1, _arg2, (((w0x + w1x) + w2x) / 3), (((w0y + w1y) + w2y) / 3)));
};
q01w01 = ((((wl01q0 * wl01q1) < 0.0001)) && (((ql01w0 * ql01w1) < 0.0001)));
q12w01 = ((((wl01q1 * wl01q2) < 0.0001)) && (((ql12w0 * ql12w1) < 0.0001)));
q20w01 = ((((wl01q2 * wl01q0) < 0.0001)) && (((ql20w0 * ql20w1) < 0.0001)));
q01w12 = ((((wl12q0 * wl12q1) < 0.0001)) && (((ql01w1 * ql01w2) < 0.0001)));
q12w12 = ((((wl12q1 * wl12q2) < 0.0001)) && (((ql12w1 * ql12w2) < 0.0001)));
q20w12 = ((((wl12q2 * wl12q0) < 0.0001)) && (((ql20w1 * ql20w2) < 0.0001)));
q01w20 = ((((wl20q0 * wl20q1) < 0.0001)) && (((ql01w2 * ql01w0) < 0.0001)));
q12w20 = ((((wl20q1 * wl20q2) < 0.0001)) && (((ql12w2 * ql12w0) < 0.0001)));
q20w20 = ((((wl20q2 * wl20q0) < 0.0001)) && (((ql20w2 * ql20w0) < 0.0001)));
count = 0;
cx = 0;
cy = 0;
if ((((((ql01w0 > 0.0001)) && ((ql12w0 > 0.0001)))) && ((ql20w0 > 0.0001)))){
cx = (cx + w0x);
cy = (cy + w0y);
count = (count + 1);
};
if ((((((ql01w1 > 0.0001)) && ((ql12w1 > 0.0001)))) && ((ql20w1 > 0.0001)))){
cx = (cx + w1x);
cy = (cy + w1y);
count = (count + 1);
};
if ((((((ql01w2 > 0.0001)) && ((ql12w2 > 0.0001)))) && ((ql20w2 > 0.0001)))){
cx = (cx + w2x);
cy = (cy + w2y);
count = (count + 1);
};
if ((((((wl01q0 > 0.0001)) && ((wl12q0 > 0.0001)))) && ((wl20q0 > 0.0001)))){
cx = (cx + q0x);
cy = (cy + q0y);
count = (count + 1);
};
if ((((((wl01q1 > 0.0001)) && ((wl12q1 > 0.0001)))) && ((wl20q1 > 0.0001)))){
cx = (cx + q1x);
cy = (cy + q1y);
count = (count + 1);
};
if ((((((wl01q2 > 0.0001)) && ((wl12q2 > 0.0001)))) && ((wl20q2 > 0.0001)))){
cx = (cx + q2x);
cy = (cy + q2y);
count = (count + 1);
};
if (q01w01){
q01w01d = ((ql01a * wl01b) - (ql01b * wl01a));
if ((q01w01d * q01w01d) > 0.0001){
q01w01x = (((ql01b * wl01c) - (ql01c * wl01b)) / q01w01d);
q01w01y = (((ql01c * wl01a) - (ql01a * wl01c)) / q01w01d);
cx = (cx + q01w01x);
cy = (cy + q01w01y);
count = (count + 1);
};
};
if (q12w01){
q12w01d = ((ql12a * wl01b) - (ql12b * wl01a));
if ((q12w01d * q12w01d) > 0.0001){
q12w01x = (((ql12b * wl01c) - (ql12c * wl01b)) / q12w01d);
q12w01y = (((ql12c * wl01a) - (ql12a * wl01c)) / q12w01d);
cx = (cx + q12w01x);
cy = (cy + q12w01y);
count = (count + 1);
};
};
if (q20w01){
q20w01d = ((ql20a * wl01b) - (ql20b * wl01a));
if ((q20w01d * q20w01d) > 0.0001){
q20w01x = (((ql20b * wl01c) - (ql20c * wl01b)) / q20w01d);
q20w01y = (((ql20c * wl01a) - (ql20a * wl01c)) / q20w01d);
cx = (cx + q20w01x);
cy = (cy + q20w01y);
count = (count + 1);
};
};
if (q01w12){
q01w12d = ((ql01a * wl12b) - (ql01b * wl12a));
if ((q01w12d * q01w12d) > 0.0001){
q01w12x = (((ql01b * wl12c) - (ql01c * wl12b)) / q01w12d);
q01w12y = (((ql01c * wl12a) - (ql01a * wl12c)) / q01w12d);
cx = (cx + q01w12x);
cy = (cy + q01w12y);
count = (count + 1);
};
};
if (q12w12){
q12w12d = ((ql12a * wl12b) - (ql12b * wl12a));
if ((q12w12d * q12w12d) > 0.0001){
q12w12x = (((ql12b * wl12c) - (ql12c * wl12b)) / q12w12d);
q12w12y = (((ql12c * wl12a) - (ql12a * wl12c)) / q12w12d);
cx = (cx + q12w12x);
cy = (cy + q12w12y);
count = (count + 1);
};
};
if (q20w12){
q20w12d = ((ql20a * wl12b) - (ql20b * wl12a));
if ((q20w12d * q20w12d) > 0.0001){
q20w12x = (((ql20b * wl12c) - (ql20c * wl12b)) / q20w12d);
q20w12y = (((ql20c * wl12a) - (ql20a * wl12c)) / q20w12d);
cx = (cx + q20w12x);
cy = (cy + q20w12y);
count = (count + 1);
};
};
if (q01w20){
q01w20d = ((ql01a * wl20b) - (ql01b * wl20a));
if ((q01w20d * q01w20d) > 0.0001){
q01w20x = (((ql01b * wl20c) - (ql01c * wl20b)) / q01w20d);
q01w20y = (((ql01c * wl20a) - (ql01a * wl20c)) / q01w20d);
cx = (cx + q01w20x);
cy = (cy + q01w20y);
count = (count + 1);
};
};
if (q12w20){
q12w20d = ((ql12a * wl20b) - (ql12b * wl20a));
if ((q12w20d * q12w20d) > 0.0001){
q12w20x = (((ql12b * wl20c) - (ql12c * wl20b)) / q12w20d);
q12w20y = (((ql12c * wl20a) - (ql12a * wl20c)) / q12w20d);
cx = (cx + q12w20x);
cy = (cy + q12w20y);
count = (count + 1);
};
};
if (q20w20){
q20w20d = ((ql20a * wl20b) - (ql20b * wl20a));
if ((q20w20d * q20w20d) > 0.0001){
q20w20x = (((ql20b * wl20c) - (ql20c * wl20b)) / q20w20d);
q20w20y = (((ql20c * wl20a) - (ql20a * wl20c)) / q20w20d);
cx = (cx + q20w20x);
cy = (cy + q20w20y);
count = (count + 1);
};
};
return (zcompare(_arg1, _arg2, (cx / count), (cy / count)));
}
}
}//package away3d.core.render
Section 58
//BasicRenderer (away3d.core.render.BasicRenderer)
package away3d.core.render {
import flash.utils.*;
import flash.display.*;
import away3d.core.scene.*;
import away3d.core.draw.*;
import away3d.core.block.*;
public class BasicRenderer implements IRenderer {
protected var pritraverser:PrimitiveTraverser;
protected var container:Sprite;
protected var projtraverser:ProjectionTraverser;
protected var materials:Dictionary;
protected var scene:Scene3D;
protected var clip:Clipping;
protected var priarray:PrimitiveArray;
protected var blocktraverser:BlockerTraverser;
protected var session:RenderSession;
protected var triangle:DrawTriangle;
protected var lightarray:LightArray;
protected var blockerarray:BlockerArray;
protected var camera:Camera3D;
protected var primitives:Array;
protected var primitive:DrawPrimitive;
protected var filter:IPrimitiveFilter;
protected var blockers:Array;
protected var filters:Array;
protected var object:Object;
public function BasicRenderer(... _args){
projtraverser = new ProjectionTraverser();
blockerarray = new BlockerArray();
blocktraverser = new BlockerTraverser();
priarray = new PrimitiveArray();
lightarray = new LightArray();
pritraverser = new PrimitiveTraverser();
session = new RenderSession();
super();
this.filters = _args;
this.filters.push(new ZSortFilter());
}
public function desc():String{
return ((("Basic [" + filters.join("+")) + "]"));
}
public function render(_arg1:View3D):Array{
scene = _arg1.scene;
camera = _arg1.camera;
container = _arg1.canvas;
clip = _arg1.clip;
projtraverser.view = _arg1;
scene.traverse(projtraverser);
blockerarray.clip = clip;
blocktraverser.consumer = blockerarray;
blocktraverser.view = _arg1;
scene.traverse(blocktraverser);
blockers = blockerarray.list();
lightarray.clear();
session.view = _arg1;
session.container = container;
session.lightarray = lightarray;
priarray.clip = clip;
priarray.blockers = blockers;
pritraverser.consumer = priarray;
pritraverser.session = session;
scene.traverse(pritraverser);
primitives = priarray.list();
for each (filter in filters) {
primitives = filter.filter(primitives, scene, camera, container, clip);
};
for each (primitive in primitives) {
primitive.render();
};
if (_arg1.statsOpen){
_arg1.statsPanel.updateStats(primitives.length, camera);
};
return (primitives);
}
public function stats():String{
return ("");
}
}
}//package away3d.core.render
Section 59
//BlockerTraverser (away3d.core.render.BlockerTraverser)
package away3d.core.render {
import away3d.core.scene.*;
import away3d.core.block.*;
public class BlockerTraverser extends Traverser {
private var _view:View3D;
private var _consumer:IBlockerConsumer;
override public function match(_arg1:Object3D):Boolean{
if (!_arg1.visible){
return (false);
};
if ((_arg1 is ILODObject)){
return ((_arg1 as ILODObject).matchLOD(_view));
};
return (true);
}
public function set view(_arg1:View3D):void{
_view = _arg1;
}
public function set consumer(_arg1:IBlockerConsumer):void{
_consumer = _arg1;
}
override public function apply(_arg1:Object3D):void{
if ((_arg1 is IBlockerProvider)){
(_arg1 as IBlockerProvider).blockers(_consumer);
};
}
}
}//package away3d.core.render
Section 60
//Clipping (away3d.core.render.Clipping)
package away3d.core.render {
import flash.display.*;
import flash.geom.*;
import away3d.core.draw.*;
public class Clipping {
var globalPoint:Point;
var zeroPoint:Point;
var rectangleClipping:RectangleClipping;
public function Clipping(){
zeroPoint = new Point(0, 0);
super();
}
public function rect(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Boolean{
return (true);
}
public function check(_arg1:DrawPrimitive):Boolean{
return (true);
}
public function screen(_arg1:Sprite):Clipping{
if (_arg1.stage.align == StageAlign.TOP_LEFT){
if (!rectangleClipping){
rectangleClipping = new RectangleClipping();
};
globalPoint = _arg1.globalToLocal(zeroPoint);
rectangleClipping.maxX = ((rectangleClipping.minX = globalPoint.x) + _arg1.stage.stageWidth);
rectangleClipping.maxY = ((rectangleClipping.minY = globalPoint.y) + _arg1.stage.stageHeight);
return (rectangleClipping);
//unresolved jump
};
return (this);
}
public function asRectangleClipping():RectangleClipping{
if (!rectangleClipping){
rectangleClipping = new RectangleClipping();
};
rectangleClipping.minX = -1000000;
rectangleClipping.minY = -1000000;
rectangleClipping.maxX = 1000000;
rectangleClipping.maxY = 1000000;
return (rectangleClipping);
}
}
}//package away3d.core.render
Section 61
//FindHit (away3d.core.render.FindHit)
package away3d.core.render {
import away3d.core.math.*;
import away3d.core.material.*;
import away3d.core.scene.*;
import away3d.core.draw.*;
import away3d.core.mesh.*;
public class FindHit {
public var sceneX:Number;
public var sceneY:Number;
public var sceneZ:Number;
public var uv:UV;
public var drawpri:DrawPrimitive;
protected var view:View3D;
public var material:IUVMaterial;
public var screenX:Number;
public var screenY:Number;
public var screenZ:Number;// = INF
var inv:Matrix3D;
private var primitive:DrawPrimitive;
var persp:Number;
public var element:Object;
public var object:Object3D;
public function FindHit(_arg1:View3D, _arg2:Array, _arg3:Number, _arg4:Number){
screenZ = Infinity;
inv = new Matrix3D();
super();
this.view = _arg1;
screenX = _arg3;
screenY = _arg4;
for each (primitive in _arg2) {
checkPrimitive(primitive);
};
}
public function checkPrimitive(_arg1:DrawPrimitive):void{
var _local2:Number;
var _local3:DrawTriangle;
var _local4:UV;
var _local5:IUVMaterial;
if (!_arg1.source.mouseEnabled){
return;
};
if (_arg1.minX > screenX){
return;
};
if (_arg1.maxX < screenX){
return;
};
if (_arg1.minY > screenY){
return;
};
if (_arg1.maxY < screenY){
return;
};
if (_arg1.contains(screenX, screenY)){
_local2 = _arg1.getZ(screenX, screenY);
if (_local2 < screenZ){
if ((_arg1 is DrawTriangle)){
_local3 = (_arg1 as DrawTriangle);
_local4 = _local3.getUV(screenX, screenY);
if ((_local3.material is IUVMaterial)){
_local5 = (_local3.material as IUVMaterial);
if (!(_local5.bitmap.getPixel32((_local4.u * _local5.width), ((1 - _local4.v) * _local5.height)) >> 24)){
return;
};
uv = _local4;
};
material = _local5;
} else {
uv = null;
};
screenZ = _local2;
persp = (view.camera.zoom / (1 + (screenZ / view.camera.focus)));
inv.inverse(view.camera.view);
sceneX = (((((screenX / persp) * inv.sxx) + ((screenY / persp) * inv.sxy)) + (screenZ * inv.sxz)) + inv.tx);
sceneY = (((((screenX / persp) * inv.syx) + ((screenY / persp) * inv.syy)) + (screenZ * inv.syz)) + inv.ty);
sceneZ = (((((screenX / persp) * inv.szx) + ((screenY / persp) * inv.szy)) + (screenZ * inv.szz)) + inv.tz);
drawpri = _arg1;
object = _arg1.source;
element = null;
};
};
}
public function getMouseEvent(_arg1:String):MouseEvent3D{
var _local2:MouseEvent3D;
_local2 = new MouseEvent3D(_arg1);
_local2.screenX = screenX;
_local2.screenY = screenY;
_local2.screenZ = screenZ;
_local2.sceneX = sceneX;
_local2.sceneY = sceneY;
_local2.sceneZ = sceneZ;
_local2.view = view;
_local2.drawpri = drawpri;
_local2.material = material;
_local2.element = element;
_local2.object = object;
_local2.uv = uv;
return (_local2);
}
}
}//package away3d.core.render
Section 62
//IPrimitiveConsumer (away3d.core.render.IPrimitiveConsumer)
package away3d.core.render {
import away3d.core.draw.*;
public interface IPrimitiveConsumer {
function primitive(_arg1:DrawPrimitive):void;
}
}//package away3d.core.render
Section 63
//IPrimitiveFilter (away3d.core.render.IPrimitiveFilter)
package away3d.core.render {
import flash.display.*;
import away3d.core.scene.*;
public interface IPrimitiveFilter {
function filter(_arg1:Array, _arg2:Scene3D, _arg3:Camera3D, _arg4:Sprite, _arg5:Clipping):Array;
}
}//package away3d.core.render
Section 64
//IPrimitiveProvider (away3d.core.render.IPrimitiveProvider)
package away3d.core.render {
public interface IPrimitiveProvider {
function primitives(_arg1:IPrimitiveConsumer, _arg2:RenderSession):void;
}
}//package away3d.core.render
Section 65
//IPrimitiveQuadrantFilter (away3d.core.render.IPrimitiveQuadrantFilter)
package away3d.core.render {
import flash.display.*;
import away3d.core.scene.*;
public interface IPrimitiveQuadrantFilter {
function filter(_arg1:PrimitiveQuadrantTree, _arg2:Scene3D, _arg3:Camera3D, _arg4:Sprite, _arg5:Clipping):void;
}
}//package away3d.core.render
Section 66
//IRenderer (away3d.core.render.IRenderer)
package away3d.core.render {
import away3d.core.scene.*;
public interface IRenderer {
function desc():String;
function render(_arg1:View3D):Array;
function stats():String;
}
}//package away3d.core.render
Section 67
//LightArray (away3d.core.render.LightArray)
package away3d.core.render {
import away3d.core.math.*;
import away3d.core.scene.*;
public class LightArray implements ILightConsumer {
public var points:Array;
public var directed:Array;
var point:PointLightSource;
public var ambients:Array;
public function ambientLight(_arg1:int, _arg2:Number):void{
throw (new Error("Not implemented"));
}
public function pointLight(_arg1:Matrix3D, _arg2:Light3D, _arg3:int, _arg4:Number, _arg5:Number, _arg6:Number):void{
point = _arg2._ls;
point.x = _arg1.tx;
point.y = _arg1.ty;
point.z = _arg1.tz;
point.light = _arg2;
point.red = ((_arg3 & 0xFF0000) >> 16);
point.green = ((_arg3 & 0xFF00) >> 8);
point.blue = (_arg3 & 0xFF);
point.ambient = _arg4;
point.diffuse = _arg5;
point.specular = _arg6;
points.push(point);
}
public function directedLight(_arg1:Number3D, _arg2:int, _arg3:Number):void{
throw (new Error("Not implemented"));
}
public function clear():void{
ambients = [];
directed = [];
points = [];
}
}
}//package away3d.core.render
Section 68
//PointLightSource (away3d.core.render.PointLightSource)
package away3d.core.render {
import away3d.core.scene.*;
public class PointLightSource {
public var green:Number;
public var diffuse:Number;
public var blue:Number;
public var specular:Number;
public var red:Number;
public var light:Light3D;
public var x:Number;
public var y:Number;
public var z:Number;
public var ambient:Number;
}
}//package away3d.core.render
Section 69
//PrimitiveArray (away3d.core.render.PrimitiveArray)
package away3d.core.render {
import away3d.core.draw.*;
import away3d.core.block.*;
public class PrimitiveArray implements IPrimitiveConsumer {
private var primitives:Array;
private var _clip:Clipping;
private var _blockers:Array;
private var containers:Array;
private var materials:Array;
public function PrimitiveArray(){
primitives = [];
materials = [];
containers = [];
super();
}
public function set clip(_arg1:Clipping):void{
_clip = _arg1;
primitives = [];
}
public function list():Array{
var _local1:Array;
_local1 = this.primitives;
this.primitives = null;
return (_local1);
}
public function primitive(_arg1:DrawPrimitive):void{
var _local2:int;
var _local3:int;
var _local4:Blocker;
if (_clip.check(_arg1)){
_local2 = _blockers.length;
_local3 = 0;
while (_local3 < _local2) {
_local4 = _blockers[_local3];
if (_local4.screenZ > _arg1.minZ){
break;
};
if (_local4.block(_arg1)){
return;
};
_local3++;
};
primitives.push(_arg1);
};
}
public function set blockers(_arg1:Array):void{
_blockers = _arg1;
}
}
}//package away3d.core.render
Section 70
//PrimitiveQuadrantTree (away3d.core.render.PrimitiveQuadrantTree)
package away3d.core.render {
import away3d.core.scene.*;
import away3d.core.draw.*;
public final class PrimitiveQuadrantTree implements IPrimitiveConsumer {
private var _rect:RectangleClipping;
public var quadrantStore:Array;
var minX:Number;
var minY:Number;
var center:Array;
var except:Object3D;
var child:DrawPrimitive;
var result:Array;
public var root:PrimitiveQuadrantTreeNode;
public var quadrantActive:Array;
private var _clip:Clipping;
var i:int;
var maxX:Number;
var maxY:Number;
var children:Array;
public function getParent(_arg1:PrimitiveQuadrantTreeNode=null):void{
_arg1 = _arg1.parent;
if ((((_arg1 == null)) || (((_arg1.onlysourceFlag) && ((except == _arg1.onlysource)))))){
return;
};
children = _arg1.center;
if (children != null){
i = children.length;
while (i--) {
child = children[i];
if ((((((((((((except == null)) || (!((child.source == except))))) && ((child.maxX > minX)))) && ((child.minX < maxX)))) && ((child.maxY > minY)))) && ((child.minY < maxY)))){
result.push(child);
};
};
};
getParent(_arg1);
}
public function remove(_arg1:DrawPrimitive):void{
center = _arg1.quadrant.center;
center.splice(center.indexOf(_arg1), 1);
}
public function getList(_arg1:PrimitiveQuadrantTreeNode):void{
if (((_arg1.onlysourceFlag) && ((except == _arg1.onlysource)))){
return;
};
if (minX < _arg1.xdiv){
if (((_arg1.lefttopFlag) && ((minY < _arg1.ydiv)))){
getList(_arg1.lefttop);
};
if (((_arg1.leftbottomFlag) && ((maxY > _arg1.ydiv)))){
getList(_arg1.leftbottom);
};
};
if (maxX > _arg1.xdiv){
if (((_arg1.righttopFlag) && ((minY < _arg1.ydiv)))){
getList(_arg1.righttop);
};
if (((_arg1.rightbottomFlag) && ((maxY > _arg1.ydiv)))){
getList(_arg1.rightbottom);
};
};
children = _arg1.center;
if (children != null){
i = children.length;
while (i--) {
child = children[i];
if ((((((((((((except == null)) || (!((child.source == except))))) && ((child.maxX > minX)))) && ((child.minX < maxX)))) && ((child.maxY > minY)))) && ((child.minY < maxY)))){
result.push(child);
};
};
};
}
public function get(_arg1:DrawPrimitive, _arg2:Object3D=null):Array{
result = [];
minX = _arg1.minX;
minY = _arg1.minY;
maxX = _arg1.maxX;
maxY = _arg1.maxY;
except = _arg2;
getList(_arg1.quadrant);
getParent(_arg1.quadrant);
return (result);
}
public function push(_arg1:DrawPrimitive):void{
root.push(_arg1);
}
public function list():Array{
result = [];
minX = -1000000;
minY = -1000000;
maxX = 1000000;
maxY = 1000000;
except = null;
getList(root);
return (result);
}
public function set clip(_arg1:Clipping):void{
_clip = _arg1;
_rect = _clip.asRectangleClipping();
if (!root){
root = new PrimitiveQuadrantTreeNode(((_rect.minX + _rect.maxX) / 2), ((_rect.minY + _rect.maxY) / 2), ((_rect.maxX - _rect.minX) / 2), ((_rect.maxY - _rect.minY) / 2), 0);
} else {
root.reset(((_rect.minX + _rect.maxX) / 2), ((_rect.minY + _rect.maxY) / 2), ((_rect.maxX - _rect.minX) / 2), ((_rect.maxY - _rect.minY) / 2));
};
}
public function add(_arg1:Array):void{
var _local2:DrawPrimitive;
for each (_local2 in _arg1) {
root.push(_local2);
};
}
public function primitive(_arg1:DrawPrimitive):void{
if (_clip.check(_arg1)){
root.push(_arg1);
};
}
public function render():void{
root.render(-(Infinity));
}
}
}//package away3d.core.render
Section 71
//PrimitiveQuadrantTreeNode (away3d.core.render.PrimitiveQuadrantTreeNode)
package away3d.core.render {
import away3d.core.scene.*;
import away3d.core.draw.*;
public final class PrimitiveQuadrantTreeNode {
public var level:int;
public var xdiv:Number;
public var halfheight:Number;
public var maxlevel:int;// = 4
public var render_center_length:int;// = -1
public var parent:PrimitiveQuadrantTreeNode;
public var righttop:PrimitiveQuadrantTreeNode;
public var righttopFlag:Boolean;
public var rightbottom:PrimitiveQuadrantTreeNode;
public var onlysourceFlag:Boolean;// = true
public var center:Array;
public var onlysource:Object3D;
public var rightbottomFlag:Boolean;
private var i:int;
public var lefttop:PrimitiveQuadrantTreeNode;
public var render_center_index:int;// = -1
public var leftbottom:PrimitiveQuadrantTreeNode;
public var halfwidth:Number;
public var ydiv:Number;
public var lefttopFlag:Boolean;
public var create:Function;
public var leftbottomFlag:Boolean;
public function PrimitiveQuadrantTreeNode(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:int, _arg6:PrimitiveQuadrantTreeNode=null){
onlysourceFlag = true;
maxlevel = 4;
render_center_length = -1;
render_center_index = -1;
super();
this.level = _arg5;
this.xdiv = _arg1;
this.ydiv = _arg2;
halfwidth = (_arg3 / 2);
halfheight = (_arg4 / 2);
this.parent = _arg6;
}
public function render(_arg1:Number):void{
var _local2:DrawPrimitive;
if (render_center_length == -1){
if (center != null){
render_center_length = center.length;
if (render_center_length > 1){
center.sortOn("screenZ", (Array.DESCENDING | Array.NUMERIC));
};
} else {
render_center_length = 0;
};
render_center_index = 0;
};
while (render_center_index < render_center_length) {
_local2 = center[render_center_index];
if (_local2.screenZ < _arg1){
break;
};
render_other(_local2.screenZ);
_local2.render();
render_center_index++;
};
if (render_center_index == render_center_length){
center = null;
};
render_other(_arg1);
}
public function push(_arg1:DrawPrimitive):void{
if (onlysourceFlag){
if (((!((onlysource == null))) && (!((onlysource == _arg1.source))))){
onlysourceFlag = false;
};
onlysource = _arg1.source;
};
if (level < maxlevel){
if (_arg1.maxX <= xdiv){
if (_arg1.maxY <= ydiv){
if (lefttop == null){
lefttopFlag = true;
lefttop = new PrimitiveQuadrantTreeNode((xdiv - (halfwidth / 2)), (ydiv - (halfheight / 2)), halfwidth, halfheight, (level + 1), this);
} else {
if (!lefttopFlag){
lefttopFlag = true;
lefttop.reset((xdiv - (halfwidth / 2)), (ydiv - (halfheight / 2)), halfwidth, halfheight);
};
};
lefttop.push(_arg1);
return;
} else {
if (_arg1.minY >= ydiv){
if (leftbottom == null){
leftbottomFlag = true;
leftbottom = new PrimitiveQuadrantTreeNode((xdiv - (halfwidth / 2)), (ydiv - (halfheight / 2)), halfwidth, halfheight, (level + 1), this);
} else {
if (!leftbottomFlag){
leftbottomFlag = true;
leftbottom.reset((xdiv - (halfwidth / 2)), (ydiv - (halfheight / 2)), halfwidth, halfheight);
};
};
leftbottom.push(_arg1);
return;
};
};
} else {
if (_arg1.minX >= xdiv){
if (_arg1.maxY <= ydiv){
if (righttop == null){
righttopFlag = true;
righttop = new PrimitiveQuadrantTreeNode((xdiv - (halfwidth / 2)), (ydiv - (halfheight / 2)), halfwidth, halfheight, (level + 1), this);
} else {
if (!righttopFlag){
righttopFlag = true;
righttop.reset((xdiv - (halfwidth / 2)), (ydiv - (halfheight / 2)), halfwidth, halfheight);
};
};
righttop.push(_arg1);
return;
} else {
if (_arg1.minY >= ydiv){
if (rightbottom == null){
rightbottomFlag = true;
rightbottom = new PrimitiveQuadrantTreeNode((xdiv - (halfwidth / 2)), (ydiv - (halfheight / 2)), halfwidth, halfheight, (level + 1), this);
} else {
if (!rightbottomFlag){
rightbottomFlag = true;
rightbottom.reset((xdiv - (halfwidth / 2)), (ydiv - (halfheight / 2)), halfwidth, halfheight);
};
};
rightbottom.push(_arg1);
return;
};
};
};
};
};
if (center == null){
center = new Array();
};
center.push(_arg1);
_arg1.quadrant = this;
}
private function render_other(_arg1:Number):void{
if (lefttopFlag){
lefttop.render(_arg1);
};
if (leftbottomFlag){
leftbottom.render(_arg1);
};
if (righttopFlag){
righttop.render(_arg1);
};
if (rightbottomFlag){
rightbottom.render(_arg1);
};
}
public function reset(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
this.xdiv = _arg1;
this.ydiv = _arg2;
halfwidth = (_arg3 / 2);
halfheight = (_arg4 / 2);
lefttopFlag = false;
leftbottomFlag = false;
righttopFlag = false;
rightbottomFlag = false;
onlysourceFlag = true;
onlysource = null;
render_center_length = -1;
render_center_index = -1;
}
}
}//package away3d.core.render
Section 72
//PrimitiveTraverser (away3d.core.render.PrimitiveTraverser)
package away3d.core.render {
import away3d.core.scene.*;
public class PrimitiveTraverser extends Traverser {
private var _lights:ILightConsumer;
private var _view:View3D;
private var _zoom:Number;
private var _consumer:IPrimitiveConsumer;
private var _focus:Number;
private var _sessions:Array;
private var _session:RenderSession;
override public function match(_arg1:Object3D):Boolean{
if (!_arg1.visible){
return (false);
};
if ((_arg1 is ILODObject)){
return ((_arg1 as ILODObject).matchLOD(_view));
};
return (true);
}
public function set consumer(_arg1:IPrimitiveConsumer):void{
_consumer = _arg1;
}
public function set session(_arg1:RenderSession):void{
_session = _arg1;
_sessions = [];
_lights = _session.lightarray;
_view = _session.view;
_focus = _view.camera.focus;
_zoom = _view.camera.zoom;
}
override public function leave(_arg1:Object3D):void{
_session = _sessions.pop();
}
override public function enter(_arg1:Object3D):void{
_sessions.push(_session);
}
override public function apply(_arg1:Object3D):void{
if ((_arg1 is IPrimitiveProvider)){
(_arg1 as IPrimitiveProvider).primitives(_consumer, _session);
_session = _arg1.session;
};
if ((_arg1 is ILightProvider)){
(_arg1 as ILightProvider).light(_arg1.viewTransform, _lights);
};
}
}
}//package away3d.core.render
Section 73
//Projection (away3d.core.render.Projection)
package away3d.core.render {
import away3d.core.math.*;
public class Projection {
public var view:Matrix3D;
public var time:int;
public var focus:Number;
public var zoom:Number;
}
}//package away3d.core.render
Section 74
//ProjectionTraverser (away3d.core.render.ProjectionTraverser)
package away3d.core.render {
import away3d.core.math.*;
import flash.utils.*;
import away3d.core.scene.*;
import away3d.core.mesh.*;
public class ProjectionTraverser extends Traverser {
private var _view:View3D;
private var _cameraview:Matrix3D;
var _projection:Projection;
override public function match(_arg1:Object3D):Boolean{
if (!_arg1.visible){
return (false);
};
_arg1.viewTransform.multiply(_cameraview, _arg1.sceneTransform);
_projection = _arg1.projection;
_projection.view = _arg1.viewTransform;
_projection.focus = _view.camera.focus;
_projection.zoom = _view.camera.zoom;
_projection.time = getTimer();
if ((_arg1 is ILODObject)){
return ((_arg1 as ILODObject).matchLOD(_view));
};
return (true);
}
public function set view(_arg1:View3D):void{
_view = _arg1;
_cameraview = _view.camera.view;
if (_view.statsOpen){
_view.statsPanel.clearObjects();
};
}
override public function enter(_arg1:Object3D):void{
if (((_view.statsOpen) && ((_arg1 is BaseMesh)))){
_view.statsPanel.addObject((_arg1 as BaseMesh));
};
}
}
}//package away3d.core.render
Section 75
//QuadrantRenderer (away3d.core.render.QuadrantRenderer)
package away3d.core.render {
import flash.utils.*;
import flash.display.*;
import away3d.core.scene.*;
import away3d.core.draw.*;
public class QuadrantRenderer implements IRenderer {
protected var container:Sprite;
protected var projtraverser:ProjectionTraverser;
protected var pritree:PrimitiveQuadrantTree;
protected var scene:Scene3D;
protected var clip:Clipping;
protected var lightarray:LightArray;
private var qdrntfilters:Array;
protected var triangle:DrawTriangle;
protected var session:RenderSession;
protected var camera:Camera3D;
protected var primitives:Array;
protected var primitive:DrawPrimitive;
protected var materials:Dictionary;
protected var pritraverser:PrimitiveTraverser;
protected var qdrntfilter:IPrimitiveQuadrantFilter;
protected var object:Object;
public function QuadrantRenderer(... _args){
var _local2:IPrimitiveQuadrantFilter;
projtraverser = new ProjectionTraverser();
pritree = new PrimitiveQuadrantTree();
lightarray = new LightArray();
pritraverser = new PrimitiveTraverser();
session = new RenderSession();
super();
qdrntfilters = [];
for each (_local2 in _args) {
qdrntfilters.push(_local2);
};
}
public function stats():String{
return ("");
}
public function desc():String{
return ((("Quadrant [" + qdrntfilters.join("+")) + "]"));
}
public function render(_arg1:View3D):Array{
scene = _arg1.scene;
camera = _arg1.camera;
container = _arg1.canvas;
clip = _arg1.clip;
projtraverser.view = _arg1;
scene.traverse(projtraverser);
lightarray.clear();
session.view = _arg1;
session.container = container;
session.lightarray = lightarray;
pritree.clip = clip;
pritraverser.consumer = pritree;
pritraverser.session = session;
scene.traverse(pritraverser);
primitives = pritree.list();
for each (qdrntfilter in qdrntfilters) {
qdrntfilter.filter(pritree, scene, camera, container, clip);
};
pritree.render();
if (_arg1.statsOpen){
_arg1.statsPanel.updateStats(primitives.length, camera);
};
return (primitives);
}
}
}//package away3d.core.render
Section 76
//QuadrantRiddleFilter (away3d.core.render.QuadrantRiddleFilter)
package away3d.core.render {
import flash.utils.*;
import flash.display.*;
import away3d.core.scene.*;
import away3d.core.draw.*;
import away3d.core.mesh.*;
public class QuadrantRiddleFilter implements IPrimitiveQuadrantFilter {
var part:DrawPrimitive;
var ql20w2:Number;
var wl01q2:Number;
var apa:Number;
var apb:Number;
var apc:Number;
var apd:Number;
var wl12q1:Number;
var wl12q2:Number;
var wl12q0:Number;
var rivals:Array;
var sv0:Number;
var sv1:Number;
var sv2:Number;
var tv0p:Number;
var tv0x:Number;
var tv0y:Number;
var tv0z:Number;
var tv1p:Number;
var start:int;
var d:Number;
var ql12a:Number;
var ql12b:Number;
var ql12c:Number;
var tv1x:Number;
var tv1z:Number;
var primitives:Array;
var tv1y:Number;
var ql12s:Number;
var q0x:Number;
var turn:int;
var tv2p:Number;
var ql01a:Number;
var ql01b:Number;
var ql01c:Number;
var tv2x:Number;
var tv2y:Number;
var tv2z:Number;
var ql01s:Number;
var q1y:Number;
var q0y:Number;
public var maxdelay:int;
var subst:Array;
var pri:DrawPrimitive;
var q2x:Number;
var q2y:Number;
var q1x:Number;
var tv01p:Number;
var td1x:Number;
var td1z:Number;
var tv01x:Number;
var tv01z:Number;
var focus:Number;
var parts:Array;
var tv01y:Number;
var td1y:Number;
var wl20b:Number;
var wl20q1:Number;
var ql01w0:Number;
var ql01w1:Number;
var ql01w2:Number;
var wl20q0:Number;
var wl20q2:Number;
var td2y:Number;
var w0x:Number;
var td2x:Number;
var wl20a:Number;
var check:int;
var ql12w0:Number;
var ql12w1:Number;
var ql12w2:Number;
var w0y:Number;
var v01:ScreenVertex;
var td2z:Number;
var w1x:Number;
var w1y:Number;
var wl20s:Number;
var k0:Number;
var k1:Number;
var wl20c:Number;
var av0p:Number;
var av0x:Number;
var av0y:Number;
var av0z:Number;
var w2x:Number;
var sav0:Number;
var sav1:Number;
var sav2:Number;
var w2y:Number;
var av1p:Number;
var leftover:Array;
var av1x:Number;
var av1y:Number;
var av1z:Number;
var tpa:Number;
var tpb:Number;
var tpc:Number;
var tpd:Number;
var wl12a:Number;
var wl12b:Number;
var wl12c:Number;
var av2p:Number;
var av2x:Number;
var av2y:Number;
var av2z:Number;
var wl12s:Number;
var rival:DrawPrimitive;
var wl01a:Number;
var wl01b:Number;
var wl01c:Number;
var wl01s:Number;
var ad1x:Number;
var ad1y:Number;
var ad1z:Number;
var ql20a:Number;
var ql20b:Number;
var ad2y:Number;
var ad2z:Number;
var tv1:Vertex;
var tv2:Vertex;
var ql20w0:Number;
var ql20w1:Number;
var wl01q1:Number;
var ad2x:Number;
var ql20c:Number;
var ql20s:Number;
var wl01q0:Number;
var tv0:Vertex;
public function QuadrantRiddleFilter(_arg1:int=60000){
v01 = new ScreenVertex();
super();
this.maxdelay = _arg1;
}
public function overlap(_arg1:DrawTriangle, _arg2:DrawTriangle):Boolean{
q0x = _arg1.v0.x;
q0y = _arg1.v0.y;
q1x = _arg1.v1.x;
q1y = _arg1.v1.y;
q2x = _arg1.v2.x;
q2y = _arg1.v2.y;
w0x = _arg2.v0.x;
w0y = _arg2.v0.y;
w1x = _arg2.v1.x;
w1y = _arg2.v1.y;
w2x = _arg2.v2.x;
w2y = _arg2.v2.y;
ql01a = (q1y - q0y);
ql01b = (q0x - q1x);
ql01c = -(((ql01b * q0y) + (ql01a * q0x)));
ql01s = (((ql01a * q2x) + (ql01b * q2y)) + ql01c);
ql01w0 = ((((ql01a * w0x) + (ql01b * w0y)) + ql01c) * ql01s);
ql01w1 = ((((ql01a * w1x) + (ql01b * w1y)) + ql01c) * ql01s);
ql01w2 = ((((ql01a * w2x) + (ql01b * w2y)) + ql01c) * ql01s);
if ((((((ql01w0 <= 0.0001)) && ((ql01w1 <= 0.0001)))) && ((ql01w2 <= 0.0001)))){
return (false);
};
ql12a = (q2y - q1y);
ql12b = (q1x - q2x);
ql12c = -(((ql12b * q1y) + (ql12a * q1x)));
ql12s = (((ql12a * q0x) + (ql12b * q0y)) + ql12c);
ql12w0 = ((((ql12a * w0x) + (ql12b * w0y)) + ql12c) * ql12s);
ql12w1 = ((((ql12a * w1x) + (ql12b * w1y)) + ql12c) * ql12s);
ql12w2 = ((((ql12a * w2x) + (ql12b * w2y)) + ql12c) * ql12s);
if ((((((ql12w0 <= 0.0001)) && ((ql12w1 <= 0.0001)))) && ((ql12w2 <= 0.0001)))){
return (false);
};
ql20a = (q0y - q2y);
ql20b = (q2x - q0x);
ql20c = -(((ql20b * q2y) + (ql20a * q2x)));
ql20s = (((ql20a * q1x) + (ql20b * q1y)) + ql20c);
ql20w0 = ((((ql20a * w0x) + (ql20b * w0y)) + ql20c) * ql20s);
ql20w1 = ((((ql20a * w1x) + (ql20b * w1y)) + ql20c) * ql20s);
ql20w2 = ((((ql20a * w2x) + (ql20b * w2y)) + ql20c) * ql20s);
if ((((((ql20w0 <= 0.0001)) && ((ql20w1 <= 0.0001)))) && ((ql20w2 <= 0.0001)))){
return (false);
};
wl01a = (w1y - w0y);
wl01b = (w0x - w1x);
wl01c = -(((wl01b * w0y) + (wl01a * w0x)));
wl01s = (((wl01a * w2x) + (wl01b * w2y)) + wl01c);
wl01q0 = ((((wl01a * q0x) + (wl01b * q0y)) + wl01c) * wl01s);
wl01q1 = ((((wl01a * q1x) + (wl01b * q1y)) + wl01c) * wl01s);
wl01q2 = ((((wl01a * q2x) + (wl01b * q2y)) + wl01c) * wl01s);
if ((((((wl01q0 <= 0.0001)) && ((wl01q1 <= 0.0001)))) && ((wl01q2 <= 0.0001)))){
return (false);
};
wl12a = (w2y - w1y);
wl12b = (w1x - w2x);
wl12c = -(((wl12b * w1y) + (wl12a * w1x)));
wl12s = (((wl12a * w0x) + (wl12b * w0y)) + wl12c);
wl12q0 = ((((wl12a * q0x) + (wl12b * q0y)) + wl12c) * wl12s);
wl12q1 = ((((wl12a * q1x) + (wl12b * q1y)) + wl12c) * wl12s);
wl12q2 = ((((wl12a * q2x) + (wl12b * q2y)) + wl12c) * wl12s);
if ((((((wl12q0 <= 0.0001)) && ((wl12q1 <= 0.0001)))) && ((wl12q2 <= 0.0001)))){
return (false);
};
wl20a = (w0y - w2y);
wl20b = (w2x - w0x);
wl20c = -(((wl20b * w2y) + (wl20a * w2x)));
wl20s = (((wl20a * w1x) + (wl20b * w1y)) + wl20c);
wl20q0 = ((((wl20a * q0x) + (wl20b * q0y)) + wl20c) * wl20s);
wl20q1 = ((((wl20a * q1x) + (wl20b * q1y)) + wl20c) * wl20s);
wl20q2 = ((((wl20a * q2x) + (wl20b * q2y)) + wl20c) * wl20s);
if ((((((wl20q0 <= 0.0001)) && ((wl20q1 <= 0.0001)))) && ((wl20q2 <= 0.0001)))){
return (false);
};
return (true);
}
public function toString():String{
return (("QuadrantRiddleFilter" + ((maxdelay)==60000) ? "" : (("(" + maxdelay) + "ms)")));
}
public function riddle(_arg1:DrawPrimitive, _arg2:DrawPrimitive):Array{
if ((_arg1 is DrawTriangle)){
if ((_arg2 is DrawTriangle)){
return (riddleTT((_arg1 as DrawTriangle), (_arg2 as DrawTriangle)));
};
if ((_arg2 is DrawSegment)){
return (riddleTS((_arg1 as DrawTriangle), (_arg2 as DrawSegment)));
};
} else {
if ((_arg1 is DrawSegment)){
if ((_arg2 is DrawTriangle)){
return (riddleTS((_arg2 as DrawTriangle), (_arg1 as DrawSegment)));
};
};
};
return ([]);
}
public function riddleTS(_arg1:DrawTriangle, _arg2:DrawSegment):Array{
av0z = _arg1.v0.z;
av0p = (1 + (av0z / focus));
av0x = (_arg1.v0.x * av0p);
av0y = (_arg1.v0.y * av0p);
av1z = _arg1.v1.z;
av1p = (1 + (av1z / focus));
av1x = (_arg1.v1.x * av1p);
av1y = (_arg1.v1.y * av1p);
av2z = _arg1.v2.z;
av2p = (1 + (av2z / focus));
av2x = (_arg1.v2.x * av2p);
av2y = (_arg1.v2.y * av2p);
ad1x = (av1x - av0x);
ad1y = (av1y - av0y);
ad1z = (av1z - av0z);
ad2x = (av2x - av0x);
ad2y = (av2y - av0y);
ad2z = (av2z - av0z);
apa = ((ad1y * ad2z) - (ad1z * ad2y));
apb = ((ad1z * ad2x) - (ad1x * ad2z));
apc = ((ad1x * ad2y) - (ad1y * ad2x));
apd = -((((apa * av0x) + (apb * av0y)) + (apc * av0z)));
if ((((apa * apa) + (apb * apb)) + (apc * apc)) < 1){
return (null);
};
tv0z = _arg2.v0.z;
tv0p = (1 + (tv0z / focus));
tv0x = (_arg2.v0.x * tv0p);
tv0y = (_arg2.v0.y * tv0p);
tv1z = _arg2.v1.z;
tv1p = (1 + (tv1z / focus));
tv1x = (_arg2.v1.x * tv1p);
tv1y = (_arg2.v1.y * tv1p);
sv0 = ((((apa * tv0x) + (apb * tv0y)) + (apc * tv0z)) + apd);
sv1 = ((((apa * tv1x) + (apb * tv1y)) + (apc * tv1z)) + apd);
if ((sv0 * sv1) >= 0){
return (null);
};
d = (sv1 - sv0);
k0 = (sv1 / d);
k1 = (-(sv0) / d);
tv01z = ((tv0z * k0) + (tv1z * k1));
tv01p = (1 / (1 + (tv01z / focus)));
tv01x = (((tv0x * k0) + (tv1x * k1)) * tv01p);
tv01y = (((tv0y * k0) + (tv1y * k1)) * tv01p);
if (!_arg1.contains(tv01x, tv01y)){
return (null);
};
v01.x = tv01x;
v01.y = tv01y;
v01.z = tv01z;
return (_arg2.onepointcut(v01));
}
final public function riddleTT(_arg1:DrawTriangle, _arg2:DrawTriangle):Array{
if ((((((_arg1.area < 10)) || ((_arg2.area < 10)))) || (!(overlap(_arg1, _arg2))))){
return (null);
};
av0z = _arg2.v0.z;
av0p = (1 + (av0z / focus));
av0x = (_arg2.v0.x * av0p);
av0y = (_arg2.v0.y * av0p);
av1z = _arg2.v1.z;
av1p = (1 + (av1z / focus));
av1x = (_arg2.v1.x * av1p);
av1y = (_arg2.v1.y * av1p);
av2z = _arg2.v2.z;
av2p = (1 + (av2z / focus));
av2x = (_arg2.v2.x * av2p);
av2y = (_arg2.v2.y * av2p);
ad1x = (av1x - av0x);
ad1y = (av1y - av0y);
ad1z = (av1z - av0z);
ad2x = (av2x - av0x);
ad2y = (av2y - av0y);
ad2z = (av2z - av0z);
apa = ((ad1y * ad2z) - (ad1z * ad2y));
apb = ((ad1z * ad2x) - (ad1x * ad2z));
apc = ((ad1x * ad2y) - (ad1y * ad2x));
apd = (((apa * av0x) + (apb * av0y)) + (apc * av0z));
if ((((apa * apa) + (apb * apb)) + (apc * apc)) < 1){
return (null);
};
tv0z = _arg1.v0.z;
tv0p = (1 + (tv0z / focus));
tv0x = (_arg1.v0.x * tv0p);
tv0y = (_arg1.v0.y * tv0p);
tv1z = _arg1.v1.z;
tv1p = (1 + (tv1z / focus));
tv1x = (_arg1.v1.x * tv1p);
tv1y = (_arg1.v1.y * tv1p);
tv2z = _arg1.v2.z;
tv2p = (1 + (tv2z / focus));
tv2x = (_arg1.v2.x * tv2p);
tv2y = (_arg1.v2.y * tv2p);
sv0 = ((((apa * tv0x) + (apb * tv0y)) + (apc * tv0z)) - apd);
sv1 = ((((apa * tv1x) + (apb * tv1y)) + (apc * tv1z)) - apd);
sv2 = ((((apa * tv2x) + (apb * tv2y)) + (apc * tv2z)) - apd);
if ((sv0 * sv0) < 0.001){
sv0 = 0;
};
if ((sv1 * sv1) < 0.001){
sv1 = 0;
};
if ((sv2 * sv2) < 0.001){
sv2 = 0;
};
if (((((((sv0 * sv1) >= -0.01)) && (((sv1 * sv2) >= -0.01)))) && (((sv2 * sv0) >= -0.01)))){
return (null);
};
td1x = (tv1x - tv0x);
td1y = (tv1y - tv0y);
td1z = (tv1z - tv0z);
td2x = (tv2x - tv0x);
td2y = (tv2y - tv0y);
td2z = (tv2z - tv0z);
tpa = ((td1y * td2z) - (td1z * td2y));
tpb = ((td1z * td2x) - (td1x * td2z));
tpc = ((td1x * td2y) - (td1y * td2x));
tpd = (((tpa * tv0x) + (tpb * tv0y)) + (tpc * tv0z));
if ((((tpa * tpa) + (tpb * tpb)) + (tpc * tpc)) < 1){
return (null);
};
sav0 = ((((tpa * av0x) + (tpb * av0y)) + (tpc * av0z)) - tpd);
sav1 = ((((tpa * av1x) + (tpb * av1y)) + (tpc * av1z)) - tpd);
sav2 = ((((tpa * av2x) + (tpb * av2y)) + (tpc * av2z)) - tpd);
if ((sav0 * sav0) < 0.001){
sav0 = 0;
};
if ((sav1 * sav1) < 0.001){
sav1 = 0;
};
if ((sav2 * sav2) < 0.001){
sav2 = 0;
};
if (((((((sav0 * sav1) >= -0.01)) && (((sav1 * sav2) >= -0.01)))) && (((sav2 * sav0) >= -0.01)))){
return (null);
};
tv0 = _arg1.v0.deperspective(focus);
tv1 = _arg1.v1.deperspective(focus);
tv2 = _arg1.v2.deperspective(focus);
if ((sv1 * sv2) >= -1){
return (_arg1.fivepointcut(_arg1.v2, Vertex.weighted(tv2, tv0, -(sv0), sv2).perspective(focus), _arg1.v0, Vertex.weighted(tv0, tv1, sv1, -(sv0)).perspective(focus), _arg1.v1, _arg1.uv2, UV.weighted(_arg1.uv2, _arg1.uv0, -(sv0), sv2), _arg1.uv0, UV.weighted(_arg1.uv0, _arg1.uv1, sv1, -(sv0)), _arg1.uv1));
};
if ((sv0 * sv1) >= -1){
return (_arg1.fivepointcut(_arg1.v1, Vertex.weighted(tv1, tv2, -(sv2), sv1).perspective(focus), _arg1.v2, Vertex.weighted(tv2, tv0, sv0, -(sv2)).perspective(focus), _arg1.v0, _arg1.uv1, UV.weighted(_arg1.uv1, _arg1.uv2, -(sv2), sv1), _arg1.uv2, UV.weighted(_arg1.uv2, _arg1.uv0, sv0, -(sv2)), _arg1.uv0));
};
return (_arg1.fivepointcut(_arg1.v0, Vertex.weighted(tv0, tv1, -(sv1), sv0).perspective(focus), _arg1.v1, Vertex.weighted(tv1, tv2, sv2, -(sv1)).perspective(focus), _arg1.v2, _arg1.uv0, UV.weighted(_arg1.uv0, _arg1.uv1, -(sv1), sv0), _arg1.uv1, UV.weighted(_arg1.uv1, _arg1.uv2, sv2, -(sv1)), _arg1.uv2));
}
public function filter(_arg1:PrimitiveQuadrantTree, _arg2:Scene3D, _arg3:Camera3D, _arg4:Sprite, _arg5:Clipping):void{
var _local6:Array;
start = getTimer();
check = 0;
focus = _arg3.focus;
primitives = _arg1.list();
turn = 0;
while (primitives.length > 0) {
_local6 = new Array();
for each (pri in primitives) {
check++;
if (check == 10){
if ((getTimer() - start) > maxdelay){
return;
};
check = 0;
};
rivals = _arg1.get(pri, pri.source);
for each (rival in rivals) {
if (rival == pri){
} else {
if (rival.minZ >= pri.maxZ){
} else {
if (rival.maxZ <= pri.minZ){
} else {
parts = riddle(pri, rival);
if (parts == null){
} else {
_arg1.remove(pri);
for each (part in parts) {
_local6.push(part);
_arg1.push(part);
};
break;
};
};
};
};
};
};
primitives = _local6;
turn = (turn + 1);
if (turn == 40){
break;
};
};
}
}
}//package away3d.core.render
Section 77
//RectangleClipping (away3d.core.render.RectangleClipping)
package away3d.core.render {
import away3d.core.draw.*;
public class RectangleClipping extends Clipping {
public var minX:Number;// = -1000000
public var minY:Number;// = -1000000
public var maxX:Number;// = 1000000
public var maxY:Number;// = 1000000
public function RectangleClipping(){
minX = -1000000;
minY = -1000000;
maxX = 1000000;
maxY = 1000000;
super();
this.minX = minX;
this.maxX = maxX;
this.minY = minY;
this.maxY = maxY;
}
override public function rect(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Boolean{
if (this.maxX < _arg1){
return (false);
};
if (this.minX > _arg3){
return (false);
};
if (this.maxY < _arg2){
return (false);
};
if (this.minY > _arg4){
return (false);
};
return (true);
}
override public function check(_arg1:DrawPrimitive):Boolean{
if (_arg1.maxX < minX){
return (false);
};
if (_arg1.minX > maxX){
return (false);
};
if (_arg1.maxY < minY){
return (false);
};
if (_arg1.minY > maxY){
return (false);
};
return (true);
}
public function toString():String{
return ((((((((("{minX:" + minX) + " maxX:") + maxX) + " minY:") + minY) + " maxY:") + maxY) + "}"));
}
override public function asRectangleClipping():RectangleClipping{
return (this);
}
}
}//package away3d.core.render
Section 78
//Renderer (away3d.core.render.Renderer)
package away3d.core.render {
public class Renderer {
public static function get INTERSECTING_OBJECTS():IRenderer{
return (new QuadrantRenderer(new QuadrantRiddleFilter(), new AnotherRivalFilter()));
}
public static function get CORRECT_Z_ORDER():IRenderer{
return (new QuadrantRenderer(new AnotherRivalFilter()));
}
public static function get BASIC():IRenderer{
return (new BasicRenderer());
}
}
}//package away3d.core.render
Section 79
//RenderSession (away3d.core.render.RenderSession)
package away3d.core.render {
import flash.utils.*;
import flash.display.*;
import away3d.core.scene.*;
import flash.geom.*;
import away3d.core.draw.*;
public class RenderSession {
protected var _container:Sprite;
protected var _view:View3D;
var ty:Number;
public var graphics:Graphics;
var b2:Number;
var newCanvas:Sprite;
var tx:Number;
protected var _lightarray:LightArray;
var canvasActive:Array;
var c2:Number;
var v0x:Number;
var v0y:Number;
public var time:int;
var d2:Number;
public var clip:Clipping;
var map:Matrix;
var v1x:Number;
var v1y:Number;
var a:Number;
var c:Number;
var d:Number;
var b:Number;
var m:Matrix;
var canvasStore:Array;
var a2:Number;
var v2x:Number;
var v2y:Number;
public function RenderSession(){
m = new Matrix();
super();
}
public function addDisplayObject(_arg1:DisplayObject):void{
_container.addChild(_arg1);
_arg1.visible = true;
canvasStore = _view.canvasStore;
if (canvasStore.length){
newCanvas = canvasStore.pop();
} else {
newCanvas = new Sprite();
};
graphics = newCanvas.graphics;
_view.canvasActive.push(newCanvas);
_container.addChild(newCanvas);
}
public function get lightarray():LightArray{
return (_lightarray);
}
public function set lightarray(_arg1:LightArray):void{
_lightarray = _arg1;
}
public function set container(_arg1:Sprite):void{
_container = _arg1;
graphics = _container.graphics;
}
public function renderTriangleBitmap(_arg1:BitmapData, _arg2:Matrix, _arg3:ScreenVertex, _arg4:ScreenVertex, _arg5:ScreenVertex, _arg6:Boolean, _arg7:Boolean):void{
a2 = ((v1x = _arg4.x) - (v0x = _arg3.x));
b2 = ((v1y = _arg4.y) - (v0y = _arg3.y));
c2 = ((v2x = _arg5.x) - v0x);
d2 = ((v2y = _arg5.y) - v0y);
m.a = (((a = _arg2.a) * a2) + ((b = _arg2.b) * c2));
m.b = ((a * b2) + (b * d2));
m.c = (((c = _arg2.c) * a2) + ((d = _arg2.d) * c2));
m.d = ((c * b2) + (d * d2));
m.tx = ((((tx = _arg2.tx) * a2) + ((ty = _arg2.ty) * c2)) + v0x);
m.ty = (((tx * b2) + (ty * d2)) + v0y);
graphics.lineStyle();
graphics.beginBitmapFill(_arg1, m, _arg7, ((_arg6) && (((((v0x * (d2 - b2)) - (v1x * d2)) + (v2x * b2)) > 400))));
graphics.moveTo(v0x, v0y);
graphics.lineTo(v1x, v1y);
graphics.lineTo(v2x, v2y);
graphics.endFill();
}
public function get view():View3D{
return (_view);
}
public function renderTriangleColor(_arg1:int, _arg2:Number, _arg3:ScreenVertex, _arg4:ScreenVertex, _arg5:ScreenVertex):void{
graphics.lineStyle();
graphics.beginFill(_arg1, _arg2);
graphics.moveTo(_arg3.x, _arg3.y);
graphics.lineTo(_arg4.x, _arg4.y);
graphics.lineTo(_arg5.x, _arg5.y);
graphics.endFill();
}
public function set view(_arg1:View3D):void{
_view = _arg1;
clip = _view.clip;
time = getTimer();
}
public function renderTriangleLine(_arg1:int, _arg2:Number, _arg3:Number, _arg4:ScreenVertex, _arg5:ScreenVertex, _arg6:ScreenVertex):void{
graphics.lineStyle(_arg3, _arg1, _arg2);
graphics.moveTo((v0x = _arg4.x), (v0y = _arg4.y));
graphics.lineTo(_arg5.x, _arg5.y);
graphics.lineTo(_arg6.x, _arg6.y);
graphics.lineTo(v0x, v0y);
}
public function renderTriangleLineFill(_arg1:int, _arg2:Number, _arg3:int, _arg4:Number, _arg5:Number, _arg6:ScreenVertex, _arg7:ScreenVertex, _arg8:ScreenVertex):void{
if (_arg4 > 0){
graphics.lineStyle(_arg5, _arg3, _arg4);
} else {
graphics.lineStyle();
};
if (_arg2 > 0){
graphics.beginFill(_arg1, _arg2);
};
graphics.moveTo(_arg6.x, _arg6.y);
graphics.lineTo(_arg7.x, _arg7.y);
graphics.lineTo(_arg8.x, _arg8.y);
if (_arg4 > 0){
graphics.lineTo(_arg6.x, _arg6.y);
};
if (_arg2 > 0){
graphics.endFill();
};
}
}
}//package away3d.core.render
Section 80
//ZSortFilter (away3d.core.render.ZSortFilter)
package away3d.core.render {
import flash.display.*;
import away3d.core.scene.*;
public class ZSortFilter implements IPrimitiveFilter {
public function filter(_arg1:Array, _arg2:Scene3D, _arg3:Camera3D, _arg4:Sprite, _arg5:Clipping):Array{
_arg1.sortOn("screenZ", (Array.DESCENDING | Array.NUMERIC));
return (_arg1);
}
public function toString():String{
return ("ZSort");
}
}
}//package away3d.core.render
Section 81
//Camera3D (away3d.core.scene.Camera3D)
package away3d.core.scene {
import away3d.core.math.*;
import away3d.core.render.*;
import away3d.core.draw.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.*;
public class Camera3D extends Object3D {
private var _flipY:Matrix3D;
private var _view:Matrix3D;
var screenProjection:Projection;
public var focus:Number;
public var zoom:Number;
public function Camera3D(_arg1:Object=null){
var _local2:Number3D;
_view = new Matrix3D();
screenProjection = new Projection();
_flipY = new Matrix3D();
super(_arg1);
_arg1 = Init.parse(_arg1);
zoom = _arg1.getNumber("zoom", 10);
focus = _arg1.getNumber("focus", 100);
_local2 = _arg1.getPosition("lookat");
_flipY.syy = -1;
if (_local2 != null){
lookAt(_local2);
};
}
override public function clone(_arg1=null){
var _local2:Camera3D;
_local2 = ((_local2) || (new Camera3D()));
super.clone(_local2);
_local2.zoom = zoom;
_local2.focus = focus;
return (_local2);
}
public function get view():Matrix3D{
_view.multiply(sceneTransform, _flipY);
_view.inverse(_view);
return (_view);
}
public function screen(_arg1:Object3D, _arg2:Vertex=null):ScreenVertex{
if (_arg2 == null){
_arg2 = new Vertex(0, 0, 0);
};
_arg1.viewTransform.multiply(view, _arg1.sceneTransform);
screenProjection.view = _arg1.viewTransform;
screenProjection.focus = focus;
screenProjection.zoom = zoom;
return (_arg2.project(screenProjection));
}
public function pan(_arg1:Number):void{
super.yaw(_arg1);
}
public function tilt(_arg1:Number):void{
super.pitch(_arg1);
}
}
}//package away3d.core.scene
Section 82
//ILightConsumer (away3d.core.scene.ILightConsumer)
package away3d.core.scene {
import away3d.core.math.*;
public interface ILightConsumer {
function ambientLight(_arg1:int, _arg2:Number):void;
function pointLight(_arg1:Matrix3D, _arg2:Light3D, _arg3:int, _arg4:Number, _arg5:Number, _arg6:Number):void;
function directedLight(_arg1:Number3D, _arg2:int, _arg3:Number):void;
}
}//package away3d.core.scene
Section 83
//ILightProvider (away3d.core.scene.ILightProvider)
package away3d.core.scene {
import away3d.core.math.*;
public interface ILightProvider {
function light(_arg1:Matrix3D, _arg2:ILightConsumer):void;
}
}//package away3d.core.scene
Section 84
//ILODObject (away3d.core.scene.ILODObject)
package away3d.core.scene {
public interface ILODObject {
function matchLOD(_arg1:View3D):Boolean;
}
}//package away3d.core.scene
Section 85
//IPhysicsScene (away3d.core.scene.IPhysicsScene)
package away3d.core.scene {
public interface IPhysicsScene {
function updateTime(_arg1:int):void;
}
}//package away3d.core.scene
Section 86
//Light3D (away3d.core.scene.Light3D)
package away3d.core.scene {
import away3d.core.math.*;
import flash.display.*;
import away3d.core.material.*;
import away3d.core.render.*;
import flash.geom.*;
import away3d.core.draw.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.*;
public class Light3D extends Object3D implements ILightProvider, IPrimitiveProvider, IClonable {
public var _ls:PointLightSource;
public var debug:Boolean;
public var specular:Number;
public var diffuse:Number;
public var color:int;
var _bitmap:BitmapData;
public var ambient:Number;
public function Light3D(_arg1:Object=null){
var _local2:Number;
var _local3:Number;
_ls = new PointLightSource();
super(_arg1);
_arg1 = Init.parse(_arg1);
_bitmap = _arg1.getBitmap("bitmap");
_local2 = _arg1.getNumber("brightness", 1);
_local3 = _arg1.getNumber("distance", Math.sqrt(1000));
color = _arg1.getColor("color", 0xFFFFFF);
ambient = (((_arg1.getNumber("ambient", 1) * _local3) * _local3) * _local2);
diffuse = (((_arg1.getNumber("diffuse", 1) * _local3) * _local3) * _local2);
specular = (((_arg1.getNumber("specular", 1) * _local3) * _local3) * _local2);
debug = _arg1.getBoolean("debug", false);
}
public function get height():Number{
return (_bitmap.height);
}
public function get bitmap():BitmapData{
var _local1:Shape;
var _local2:Matrix;
if (_bitmap == null){
_bitmap = new BitmapData(0x0100, 0x0100, false, 0);
_local1 = new Shape();
_local2 = new Matrix();
_local2.createGradientBox(0x0100, 0x0100, 0, 0, 0);
_local1.graphics.beginGradientFill(GradientType.RADIAL, [0xFFFFFF, 0], [1, 1], [0, 0xFF], _local2);
_local1.graphics.drawCircle(127, 127, 127);
_bitmap.draw(_local1);
};
return (_bitmap);
}
public function light(_arg1:Matrix3D, _arg2:ILightConsumer):void{
_arg2.pointLight(_arg1, this, color, ambient, diffuse, specular);
}
override public function clone(_arg1=null){
var _local2:Light3D;
_local2 = ((_arg1) || (new Light3D()));
super.clone(_local2);
_local2.color = color;
_local2.ambient = ambient;
_local2.diffuse = diffuse;
_local2.specular = specular;
_local2.debug = debug;
return (_local2);
}
override public function primitives(_arg1:IPrimitiveConsumer, _arg2:RenderSession):void{
var _local3:Vertex;
var _local4:ScreenVertex;
var _local5:DrawTriangle;
super.primitives(_arg1, _arg2);
if (!debug){
return;
};
_local3 = new Vertex(0, 0, 0);
_local4 = _local3.project(projection);
if (!_local4.visible){
return;
};
_local5 = new DrawTriangle();
_local5.v0 = new ScreenVertex((_local4.x + 3), (_local4.y + 2), _local4.z);
_local5.v1 = new ScreenVertex((_local4.x - 3), (_local4.y + 2), _local4.z);
_local5.v2 = new ScreenVertex(_local4.x, (_local4.y - 3), _local4.z);
_local5.calc();
_local5.source = this;
_local5.projection = projection;
_local5.material = new ColorMaterial(color);
_arg1.primitive(_local5);
}
public function get width():Number{
return (_bitmap.width);
}
}
}//package away3d.core.scene
Section 87
//MouseEvent3D (away3d.core.scene.MouseEvent3D)
package away3d.core.scene {
import flash.events.*;
import away3d.core.material.*;
import away3d.core.draw.*;
import away3d.core.mesh.*;
public class MouseEvent3D extends Event {
public var shiftKey:Boolean;
public var sceneX:Number;
public var sceneY:Number;
public var sceneZ:Number;
public var view:View3D;
public var uv:UV;
public var screenY:Number;
public var screenZ:Number;
public var drawpri:DrawPrimitive;
public var screenX:Number;
public var ctrlKey:Boolean;
public var material:IUVMaterial;
public var element:Object;
public var object:Object3D;
public static var MOUSE_DOWN:String = "mouseDown3D";
public static var MOUSE_OUT:String = "mouseOut3D";
public static var MOUSE_UP:String = "mouseUp3D";
public static var MOUSE_MOVE:String = "mouseMove3D";
public static var MOUSE_OVER:String = "mouseOver3D";
public function MouseEvent3D(_arg1:String){
super(_arg1);
}
override public function clone():Event{
var _local1:MouseEvent3D;
_local1 = new MouseEvent3D(type);
_local1.screenX = screenX;
_local1.screenY = screenY;
_local1.screenZ = screenZ;
_local1.sceneX = sceneX;
_local1.sceneY = sceneY;
_local1.sceneZ = sceneZ;
_local1.view = view;
_local1.object = object;
_local1.element = element;
_local1.drawpri = drawpri;
_local1.material = material;
_local1.uv = uv;
_local1.ctrlKey = ctrlKey;
_local1.shiftKey = shiftKey;
return (_local1);
}
}
}//package away3d.core.scene
Section 88
//Object3D (away3d.core.scene.Object3D)
package away3d.core.scene {
import away3d.core.math.*;
import flash.display.*;
import away3d.core.render.*;
import away3d.core.draw.*;
import away3d.core.utils.*;
import away3d.core.*;
public class Object3D extends LazyEventDispatcher implements IClonable {
public var filters:Array;
public var extra:Object;
private var _rotationX:Number;
private var _rotationY:Number;
private var _rotationZ:Number;
public var ownSession:RenderSession;
var xAxis:Number3D;
var vector:Number3D;
public var viewTransform:Matrix3D;
public var projection:Projection;
var zAxis:Number3D;
public var canvas:Array;
private var _sceneTransform:Matrix3D;
var c:Sprite;
var m:Matrix3D;
var q:Quaternion;
public var visible:Boolean;// = true
var v:View3D;
public var ownCanvas:Boolean;// = false
var _position:Number3D;
public var name:String;
public var useHandCursor:Boolean;// = false
private var _scene:Scene3D;
public var inverseSceneTransform:Matrix3D;
public var blendMode:String;
public var session:RenderSession;
private var scenechanged:Object3DEvent;
private var _sceneTransformDirty:Boolean;
var yAxis:Number3D;
private var transformchanged:Object3DEvent;
private var _parent:ObjectContainer3D;
var rot:Number3D;
public var mouseEnabled:Boolean;// = true
private var dimensionschanged:Object3DEvent;
private var _transformDirty:Boolean;
private var radiuschanged:Object3DEvent;
private var _transform:Matrix3D;
private var _rotationDirty:Boolean;
private static var toDEGREES:Number = 57.2957795130823;
private static var toRADIANS:Number = 0.0174532925199433;
public function Object3D(_arg1:Object=null):void{
_transform = new Matrix3D();
_sceneTransform = new Matrix3D();
projection = new Projection();
inverseSceneTransform = new Matrix3D();
viewTransform = new Matrix3D();
visible = true;
canvas = new Array();
mouseEnabled = true;
useHandCursor = false;
ownCanvas = false;
_position = new Number3D();
q = new Quaternion();
vector = new Number3D();
m = new Matrix3D();
xAxis = new Number3D();
yAxis = new Number3D();
zAxis = new Number3D();
super();
_arg1 = Init.parse(_arg1);
name = _arg1.getString("name", name);
ownCanvas = _arg1.getBoolean("ownCanvas", ownCanvas);
visible = _arg1.getBoolean("visible", visible);
mouseEnabled = _arg1.getBoolean("mouseEnabled", mouseEnabled);
useHandCursor = _arg1.getBoolean("useHandCursor", useHandCursor);
filters = _arg1.getArray("filters");
x = _arg1.getNumber("x", 0);
y = _arg1.getNumber("y", 0);
z = _arg1.getNumber("z", 0);
rotationX = _arg1.getNumber("rotationX", 0);
rotationY = _arg1.getNumber("rotationY", 0);
rotationZ = _arg1.getNumber("rotationZ", 0);
extra = _arg1.getObject("extra");
parent = (_arg1.getObject3D("parent") as ObjectContainer3D);
if ((this is Scene3D)){
_scene = (this as Scene3D);
};
}
public function removeOnRadiusChange(_arg1:Function):void{
removeEventListener("radiuschanged", _arg1, false);
}
public function removeOnMouseOut(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_OUT, _arg1, false);
}
public function moveDown(_arg1:Number):void{
translate(Number3D.DOWN, _arg1);
}
arcane function get parentmaxX():Number{
return ((radius + _transform.tx));
}
arcane function get parentmaxY():Number{
return ((radius + _transform.ty));
}
public function removeOnMouseUp(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_UP, _arg1, false);
}
public function get position():Number3D{
if (_transformDirty){
updateTransform();
};
_position.x = _transform.tx;
_position.y = _transform.ty;
_position.z = _transform.tz;
return (_position);
}
arcane function get parentmaxZ():Number{
return ((radius + _transform.tz));
}
arcane function dispatchMouseEvent(_arg1:MouseEvent3D):Boolean{
if (!hasEventListener(_arg1.type)){
return (false);
};
dispatchEvent(_arg1);
return (true);
}
public function lookAt(_arg1:Number3D, _arg2:Number3D=null):void{
zAxis.sub(_arg1, position);
zAxis.normalize();
if (zAxis.modulo > 0.1){
xAxis.cross(zAxis, ((_arg2) || (Number3D.UP)));
xAxis.normalize();
yAxis.cross(zAxis, xAxis);
yAxis.normalize();
_transform.sxx = xAxis.x;
_transform.syx = xAxis.y;
_transform.szx = xAxis.z;
_transform.sxy = -(yAxis.x);
_transform.syy = -(yAxis.y);
_transform.szy = -(yAxis.z);
_transform.sxz = zAxis.x;
_transform.syz = zAxis.y;
_transform.szz = zAxis.z;
_transformDirty = false;
_rotationDirty = true;
_sceneTransformDirty = true;
notifyTransformChange();
};
}
public function set rotationX(_arg1:Number):void{
_rotationX = (-(_arg1) * toRADIANS);
_transformDirty = true;
notifyTransformChange();
}
public function moveTo(_arg1:Number3D):void{
_transform.tx = _arg1.x;
_transform.ty = _arg1.y;
_transform.tz = _arg1.z;
notifyTransformChange();
}
public function set rotationY(_arg1:Number):void{
_rotationY = (-(_arg1) * toRADIANS);
_transformDirty = true;
notifyTransformChange();
}
public function set rotationZ(_arg1:Number):void{
_rotationZ = (-(_arg1) * toRADIANS);
_transformDirty = true;
notifyTransformChange();
}
private function onParentSceneChange(_arg1:Object3DEvent):void{
if (_scene == _parent.scene){
return;
};
_scene = _parent.scene;
notifySceneChange();
}
public function get minX():Number{
return (-(radius));
}
public function get sceneTransform():Matrix3D{
if (_scene == null){
return (transform);
};
if (_transformDirty){
updateTransform();
};
if (_sceneTransformDirty){
updateSceneTransform();
};
return (_sceneTransform);
}
public function get minZ():Number{
return (-(radius));
}
public function moveUp(_arg1:Number):void{
translate(Number3D.UP, _arg1);
}
public function distanceTo(_arg1:Object3D):Number{
var _local2:Matrix3D;
var _local3:Matrix3D;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = ((scene == null)) ? transform : sceneTransform;
_local3 = ((_arg1.scene == null)) ? _arg1.transform : _arg1.sceneTransform;
_local4 = (_local2.tx - _local3.tx);
_local5 = (_local2.ty - _local3.ty);
_local6 = (_local2.tz - _local3.tz);
return (Math.sqrt((((_local4 * _local4) + (_local5 * _local5)) + (_local6 * _local6))));
}
public function scale(_arg1:Number):void{
}
public function set position(_arg1:Number3D):void{
_transform.tx = _arg1.x;
_transform.ty = _arg1.y;
_transform.tz = _arg1.z;
_sceneTransformDirty = true;
notifyTransformChange();
}
public function set parent(_arg1:ObjectContainer3D):void{
var _local2:Scene3D;
if (_arg1 == _parent){
return;
};
_local2 = scene;
if (_parent != null){
_parent.removeOnSceneChange(onParentSceneChange);
_parent.internalRemoveChild(this);
};
_parent = _arg1;
if (_parent != null){
_parent.internalAddChild(this);
_parent.addOnSceneChange(onParentSceneChange);
_parent.addOnTransformChange(onParentTransformChange);
};
_scene = (_parent) ? _parent.scene : null;
if (_scene != _local2){
notifySceneChange();
};
_sceneTransformDirty = true;
notifyTransformChange();
}
public function translate(_arg1:Number3D, _arg2:Number):void{
vector.rotate(_arg1, transform);
x = (x + (_arg2 * vector.x));
y = (y + (_arg2 * vector.y));
z = (z + (_arg2 * vector.z));
}
public function get minY():Number{
return (-(radius));
}
protected function notifySceneChange():void{
if (!hasEventListener("scenechanged")){
return;
};
if (scenechanged == null){
scenechanged = new Object3DEvent("scenechanged", this);
};
dispatchEvent(scenechanged);
}
public function rotate(_arg1:Number3D, _arg2:Number):void{
vector.rotate(_arg1, transform);
m.rotationMatrix(vector.x, vector.y, vector.z, (_arg2 * toRADIANS));
m.tx = _transform.tx;
m.ty = _transform.ty;
m.tz = _transform.tz;
_transform.multiply3x3(m, transform);
_rotationDirty = true;
_sceneTransformDirty = true;
notifyTransformChange();
}
public function clone(_arg1=null){
_arg1 = ((_arg1) || (new Object3D()));
_arg1.transform = transform;
_arg1.name = name;
_arg1.visible = visible;
_arg1.mouseEnabled = mouseEnabled;
_arg1.useHandCursor = useHandCursor;
_arg1.extra = ((extra is IClonable)) ? (extra as IClonable).clone() : extra;
return (_arg1);
}
protected function notifyDimensionsChange():void{
if (!hasEventListener("dimensionschanged")){
return;
};
if (dimensionschanged == null){
dimensionschanged = new Object3DEvent("dimensionschanged", this);
};
dispatchEvent(dimensionschanged);
}
public function pitch(_arg1:Number):void{
rotate(Number3D.RIGHT, _arg1);
}
private function updateRotation():void{
rot = _transform.matrix2euler();
_rotationX = (rot.x * toRADIANS);
_rotationY = (rot.y * toRADIANS);
_rotationZ = (rot.z * toRADIANS);
_rotationDirty = false;
}
private function updateSceneTransform():void{
if (!_sceneTransformDirty){
return;
};
_sceneTransform.multiply(_parent.sceneTransform, transform);
inverseSceneTransform.inverse(_sceneTransform);
_sceneTransformDirty = false;
}
public function get transform():Matrix3D{
if (_transformDirty){
updateTransform();
};
return (_transform);
}
public function addOnMouseDown(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_DOWN, _arg1, false, 0, false);
}
public function yaw(_arg1:Number):void{
rotate(Number3D.UP, _arg1);
}
public function primitives(_arg1:IPrimitiveConsumer, _arg2:RenderSession):void{
v = _arg2.view;
if (ownCanvas){
if (canvas[v] == null){
canvas[v] = new Sprite();
};
c = canvas[v];
c.graphics.clear();
c.filters = filters;
if (blendMode != null){
c.blendMode = blendMode;
} else {
c.blendMode = BlendMode.NORMAL;
};
_arg1.primitive(new DrawDisplayObject(this, c, new ScreenVertex(0, 0, Math.sqrt(((((viewTransform.tz * viewTransform.tz) + viewTransform.tx) + viewTransform.tx) + (viewTransform.ty * viewTransform.ty)))), _arg2));
if (!ownSession){
ownSession = new RenderSession();
};
ownSession.view = v;
ownSession.container = c;
ownSession.lightarray = _arg2.lightarray;
this.session = ownSession;
} else {
if (canvas[v] != null){
delete canvas[v];
};
this.session = _arg2;
};
}
public function get maxX():Number{
return (radius);
}
public function get maxY():Number{
return (radius);
}
public function get maxZ():Number{
return (radius);
}
public function get x():Number{
return (_transform.tx);
}
public function get y():Number{
return (_transform.ty);
}
public function get z():Number{
return (_transform.tz);
}
public function moveLeft(_arg1:Number):void{
translate(Number3D.LEFT, _arg1);
}
public function removeOnDimensionsChange(_arg1:Function):void{
removeEventListener("dimensionschanged", _arg1, false);
}
public function roll(_arg1:Number):void{
rotate(Number3D.FORWARD, _arg1);
}
public function traverse(_arg1:Traverser):void{
if (_arg1.match(this)){
_arg1.enter(this);
_arg1.apply(this);
_arg1.leave(this);
};
}
public function addOnRadiusChange(_arg1:Function):void{
addEventListener("radiuschanged", _arg1, false, 0, true);
}
private function onParentTransformChange(_arg1:Object3DEvent):void{
_sceneTransformDirty = true;
notifyTransformChange();
}
public function get radius():Number{
return (0);
}
public function get rotationX():Number{
if (_rotationDirty){
updateRotation();
};
return ((-(_rotationX) * toDEGREES));
}
public function get rotationY():Number{
if (_rotationDirty){
updateRotation();
};
return ((-(_rotationY) * toDEGREES));
}
public function get rotationZ():Number{
if (_rotationDirty){
updateRotation();
};
return ((-(_rotationZ) * toDEGREES));
}
public function tick(_arg1:int):void{
}
public function addOnMouseUp(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_UP, _arg1, false, 0, false);
}
private function updateTransform():void{
if (!_transformDirty){
return;
};
q.euler2quaternion(-(_rotationY), -(_rotationZ), _rotationX);
_transform.quaternion2matrix(q.x, q.y, q.z, q.w);
_transformDirty = false;
_sceneTransformDirty = true;
}
public function get scene():Scene3D{
return (_scene);
}
public function toString():String{
return ((((((((name) ? name : "$" + ": x:") + Math.round(x)) + " y:") + Math.round(y)) + " z:") + Math.round(z)));
}
public function get parent():ObjectContainer3D{
return (_parent);
}
public function removeOnMouseDown(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_DOWN, _arg1, false);
}
public function removeOnTransformChange(_arg1:Function):void{
removeEventListener("transformchanged", _arg1, false);
}
public function addOnDimensionsChange(_arg1:Function):void{
addEventListener("dimensionschanged", _arg1, false, 0, true);
}
public function moveForward(_arg1:Number):void{
translate(Number3D.FORWARD, _arg1);
}
public function addOnMouseOver(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_OVER, _arg1, false, 0, false);
}
arcane function get parentradius():Number{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = _transform.tx;
_local2 = _transform.ty;
_local3 = _transform.tz;
return ((Math.sqrt((((_local1 * _local1) + (_local2 * _local2)) + (_local3 * _local3))) + radius));
}
protected function notifyTransformChange():void{
if (!hasEventListener("transformchanged")){
return;
};
if (transformchanged == null){
transformchanged = new Object3DEvent("transformchanged", this);
};
dispatchEvent(transformchanged);
}
public function addOnTransformChange(_arg1:Function):void{
addEventListener("transformchanged", _arg1, false, 0, true);
}
public function moveRight(_arg1:Number):void{
translate(Number3D.RIGHT, _arg1);
}
public function addOnMouseMove(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_MOVE, _arg1, false, 0, false);
}
protected function notifyRadiusChange():void{
if (!hasEventListener("radiuschanged")){
return;
};
if (radiuschanged == null){
radiuschanged = new Object3DEvent("radiuschanged", this);
};
dispatchEvent(radiuschanged);
}
public function removeOnMouseMove(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_MOVE, _arg1, false);
}
public function moveBackward(_arg1:Number):void{
translate(Number3D.BACKWARD, _arg1);
}
public function get scenePosition():Number3D{
return (new Number3D(sceneTransform.tx, sceneTransform.ty, sceneTransform.tz));
}
public function removeOnMouseOver(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_OVER, _arg1, false);
}
public function set transform(_arg1:Matrix3D):void{
if (_arg1 == _transform){
return;
};
_transform = _arg1.clone();
_transformDirty = false;
_rotationDirty = true;
_sceneTransformDirty = true;
notifyTransformChange();
}
public function removeOnSceneChange(_arg1:Function):void{
removeEventListener("scenechanged", _arg1, false);
}
public function addOnSceneChange(_arg1:Function):void{
addEventListener("scenechanged", _arg1, false, 0, true);
}
arcane function get parentminX():Number{
return ((-(radius) + _transform.tx));
}
arcane function get parentminY():Number{
return ((-(radius) + _transform.ty));
}
public function set y(_arg1:Number):void{
if (isNaN(_arg1)){
throw (new Error("isNaN(y)"));
};
if (_arg1 == Infinity){
Debug.warning("y == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("y == -Infinity");
};
_transform.ty = _arg1;
_sceneTransformDirty = true;
notifyTransformChange();
}
public function set z(_arg1:Number):void{
if (isNaN(_arg1)){
throw (new Error("isNaN(z)"));
};
if (_arg1 == Infinity){
Debug.warning("z == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("z == -Infinity");
};
_transform.tz = _arg1;
_sceneTransformDirty = true;
notifyTransformChange();
}
public function set x(_arg1:Number):void{
if (isNaN(_arg1)){
throw (new Error("isNaN(x)"));
};
if (_arg1 == Infinity){
Debug.warning("x == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("x == -Infinity");
};
_transform.tx = _arg1;
_sceneTransformDirty = true;
notifyTransformChange();
}
public function addOnMouseOut(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_OUT, _arg1, false, 0, false);
}
arcane function get parentminZ():Number{
return ((-(radius) + _transform.tz));
}
}
}//package away3d.core.scene
Section 89
//Object3DEvent (away3d.core.scene.Object3DEvent)
package away3d.core.scene {
import flash.events.*;
public class Object3DEvent extends Event {
public var object:Object3D;
public function Object3DEvent(_arg1:String, _arg2:Object3D){
super(_arg1);
this.object = _arg2;
}
override public function clone():Event{
return (new Object3DEvent(type, object));
}
}
}//package away3d.core.scene
Section 90
//ObjectContainer3D (away3d.core.scene.ObjectContainer3D)
package away3d.core.scene {
import away3d.core.render.*;
import away3d.core.*;
public class ObjectContainer3D extends Object3D implements IPrimitiveProvider {
private var _minZDirty:Boolean;// = false
private var _needNotifyDimensionsChange:Boolean;// = false
private var child:Object3D;
private var _minY:Number;// = INF
private var _minZ:Number;// = INF
private var _minZChild:Object3D;// = null
private var _maxYChild:Object3D;// = null
private var _minX:Number;// = INF
private var _maxXDirty:Boolean;// = false
private var _maxX:Number;
private var _maxZ:Number;
private var _children:Array;
private var _minYDirty:Boolean;// = false
private var _needNotifyRadiusChange:Boolean;// = false
private var _maxXChild:Object3D;// = null
private var _radiusDirty:Boolean;// = false
private var _maxY:Number;
private var _minXDirty:Boolean;// = false
private var _radius:Number;// = 0
private var _maxZDirty:Boolean;// = false
private var _maxZChild:Object3D;// = null
private var _minYChild:Object3D;// = null
private var _maxYDirty:Boolean;// = false
private var _radiusChild:Object3D;// = null
private var _minXChild:Object3D;// = null
public function ObjectContainer3D(_arg1:Object=null, ... _args){
_children = new Array();
_radiusChild = null;
_radiusDirty = false;
_radius = 0;
_maxXChild = null;
_maxXDirty = false;
_maxX = -(Infinity);
_minXChild = null;
_minXDirty = false;
_minX = Infinity;
_maxYChild = null;
_maxYDirty = false;
_maxY = -(Infinity);
_minYChild = null;
_minYDirty = false;
_minY = Infinity;
_maxZChild = null;
_maxZDirty = false;
_maxZ = -(Infinity);
_minZChild = null;
_minZDirty = false;
_minZ = Infinity;
_needNotifyRadiusChange = false;
_needNotifyDimensionsChange = false;
if (_arg1 != null){
if ((_arg1 is Object3D)){
addChild((_arg1 as Object3D));
_arg1 = null;
};
};
super(_arg1);
for each (child in _args) {
addChild(child);
};
}
public function movePivot(_arg1:Number, _arg2:Number, _arg3:Number):void{
for each (child in _children) {
child.x = (child.x - _arg1);
child.y = (child.y - _arg2);
child.z = (child.z - _arg3);
};
x = (x + _arg1);
y = (y + _arg2);
z = (z + _arg3);
}
public function addChild(_arg1:Object3D):void{
if (_arg1 == null){
throw (new Error("ObjectContainer3D.addChild(null)"));
};
if (_arg1.parent == this){
return;
};
_arg1.parent = this;
}
arcane function internalRemoveChild(_arg1:Object3D):void{
var _local2:int;
_local2 = children.indexOf(_arg1);
if (_local2 == -1){
return;
};
forgetChild(_arg1);
_arg1.removeOnTransformChange(onChildChange);
_arg1.removeOnRadiusChange(onChildChange);
_children.splice(_local2, 1);
launchNotifies();
}
public function removeChild(_arg1:Object3D):void{
if (_arg1 == null){
throw (new Error("ObjectContainer3D.removeChild(null)"));
};
if (_arg1.parent != this){
return;
};
_arg1.parent = null;
}
private function forgetChild(_arg1:Object3D):void{
if (_arg1 == _radiusChild){
_radiusChild = null;
_radiusDirty = true;
_needNotifyRadiusChange = true;
};
if (_arg1 == _maxXChild){
_maxXChild = null;
_maxXDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _minXChild){
_minXChild = null;
_minXDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _maxYChild){
_maxYChild = null;
_maxYDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _minYChild){
_minYChild = null;
_minYDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _maxZChild){
_maxZChild = null;
_maxZDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _minZChild){
_minZChild = null;
_minZDirty = true;
_needNotifyDimensionsChange = true;
};
}
override public function get minX():Number{
var _local1:Number;
var _local2:Number;
if (_minXDirty){
_minXChild = null;
_local1 = Infinity;
for each (child in _children) {
_local2 = child.parentminX;
if (_local2 < _local1){
_local1 = _local2;
_minXChild = child;
};
};
_minX = _local1;
_minXDirty = false;
};
return (_minX);
}
override public function get minZ():Number{
var _local1:Number;
var _local2:Number;
if (_minZDirty){
_local1 = Infinity;
_minZChild = null;
for each (child in _children) {
_local2 = child.parentminZ;
if (_local2 < _local1){
_local1 = _local2;
_minZChild = child;
};
};
_minZ = _local1;
_minZDirty = false;
};
return (_minZ);
}
override public function scale(_arg1:Number):void{
for each (child in children) {
child.x = (child.x * _arg1);
child.y = (child.y * _arg1);
child.z = (child.z * _arg1);
child.scale(_arg1);
};
}
override public function get minY():Number{
var _local1:Number;
var _local2:Number;
if (_minYDirty){
_local1 = Infinity;
_minYChild = null;
for each (child in _children) {
_local2 = child.parentminY;
if (_local2 < _local1){
_local1 = _local2;
_minYChild = child;
};
};
_minY = _local1;
_minYDirty = false;
};
return (_minY);
}
override public function clone(_arg1=null){
var _local2:ObjectContainer3D;
_local2 = ((_arg1) || (new ObjectContainer3D()));
super.clone(_local2);
for each (child in children) {
_local2.addChild(child.clone());
};
return (_local2);
}
override public function traverse(_arg1:Traverser):void{
if (_arg1.match(this)){
_arg1.enter(this);
_arg1.apply(this);
for each (child in children) {
child.traverse(_arg1);
};
_arg1.leave(this);
};
}
override public function get maxY():Number{
var _local1:Number;
var _local2:Number;
if (_maxYDirty){
_local1 = -(Infinity);
_maxYChild = null;
for each (child in _children) {
_local2 = child.parentmaxY;
if (_local2 > _local1){
_local1 = _local2;
_maxYChild = child;
};
};
_maxY = _local1;
_maxYDirty = false;
};
return (_maxY);
}
override public function get maxZ():Number{
var _local1:Number;
var _local2:Number;
if (_maxZDirty){
_local1 = -(Infinity);
_maxZChild = null;
for each (child in _children) {
_local2 = child.parentmaxZ;
if (_local2 > _local1){
_local1 = _local2;
_maxZChild = child;
};
};
_maxZ = _local1;
_maxZDirty = false;
};
return (_maxZ);
}
override public function get maxX():Number{
var _local1:Number;
var _local2:Number;
if (_maxXDirty){
_maxXChild = null;
_local1 = -(Infinity);
for each (child in _children) {
_local2 = child.parentmaxX;
if (_local2 > _local1){
_local1 = _local2;
_maxXChild = child;
};
};
_maxX = _local1;
_maxXDirty = false;
};
return (_maxX);
}
private function rememberChild(_arg1:Object3D):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local2 = _arg1.parentradius;
if (_local2 > _radius){
_radius = _local2;
_radiusChild = _arg1;
_radiusDirty = false;
_needNotifyRadiusChange = true;
};
_local3 = _arg1.parentmaxX;
if (_local3 > _maxX){
_maxX = _local3;
_maxXChild = _arg1;
_maxXDirty = false;
_needNotifyDimensionsChange = true;
};
_local4 = _arg1.parentminX;
if (_local4 < _minX){
_minX = _local4;
_minXChild = _arg1;
_minXDirty = false;
_needNotifyDimensionsChange = true;
};
_local5 = _arg1.parentmaxY;
if (_local5 > _maxY){
_maxY = _local5;
_maxYChild = _arg1;
_maxYDirty = false;
_needNotifyDimensionsChange = true;
};
_local6 = _arg1.parentminY;
if (_local6 < _minY){
_minY = _local6;
_minYChild = _arg1;
_minYDirty = false;
_needNotifyDimensionsChange = true;
};
_local7 = _arg1.parentmaxZ;
if (_local7 > _maxZ){
_maxZ = _local7;
_maxZChild = _arg1;
_maxZDirty = false;
_needNotifyDimensionsChange = true;
};
_local8 = _arg1.parentminZ;
if (_local8 < _minZ){
_minZ = _local8;
_minZChild = _arg1;
_minZDirty = false;
_needNotifyDimensionsChange = true;
};
}
override public function get radius():Number{
var _local1:Number;
var _local2:Number;
if (_radiusDirty){
_radiusChild = null;
_local1 = 0;
for each (child in _children) {
_local2 = child.parentradius;
if (_local2 > _local1){
_local1 = _local2;
_radiusChild = child;
};
};
_radius = _local1;
_radiusDirty = false;
};
return (_radius);
}
public function getChildByName(_arg1:String):Object3D{
for each (child in children) {
if (child.name == _arg1){
return (child);
};
};
return (null);
}
public function removeChildByName(_arg1:String):void{
removeChild(getChildByName(_arg1));
}
public function addChildren(... _args):void{
for each (child in _args) {
addChild(child);
};
}
private function launchNotifies():void{
if (_needNotifyRadiusChange){
_needNotifyRadiusChange = false;
notifyRadiusChange();
};
if (_needNotifyDimensionsChange){
_needNotifyDimensionsChange = false;
notifyDimensionsChange();
};
}
arcane function internalAddChild(_arg1:Object3D):void{
_children.push(_arg1);
_arg1.addOnTransformChange(onChildChange);
_arg1.addOnRadiusChange(onChildChange);
rememberChild(_arg1);
launchNotifies();
}
private function onChildChange(_arg1:Object3DEvent):void{
child = _arg1.object;
forgetChild(child);
rememberChild(child);
launchNotifies();
}
public function get children():Array{
return (_children);
}
}
}//package away3d.core.scene
Section 91
//Scene3D (away3d.core.scene.Scene3D)
package away3d.core.scene {
import away3d.core.math.*;
import flash.utils.*;
import away3d.core.material.*;
import away3d.core.render.*;
import away3d.core.draw.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.*;
public class Scene3D extends ObjectContainer3D {
public var tickTraverser:TickTraverser;
public var physics:IPhysicsScene;
public function Scene3D(_arg1:Object=null, ... _args){
var _local3:Object;
var _local4:Object3D;
tickTraverser = new TickTraverser();
super();
if (_arg1 != null){
if ((_arg1 is Object3D)){
addChild((_arg1 as Object3D));
_arg1 = null;
};
};
_arg1 = Init.parse(_arg1);
_local3 = _arg1.getObject("physics");
if ((_local3 is IPhysicsScene)){
physics = (_local3 as IPhysicsScene);
};
if ((_local3 is Boolean)){
if (_local3 == true){
physics = null;
};
};
if ((_local3 is Object)){
physics = null;
};
for each (_local4 in _args) {
addChild(_local4);
};
}
public function updateTime(_arg1:int=-1):void{
if (_arg1 == -1){
_arg1 = getTimer();
};
tickTraverser.now = _arg1;
traverse(tickTraverser);
if (physics != null){
physics.updateTime(_arg1);
};
}
override public function get sceneTransform():Matrix3D{
return (transform);
}
override public function set parent(_arg1:ObjectContainer3D):void{
if (_arg1 != null){
throw (new Error("Scene can't be parented"));
};
}
}
}//package away3d.core.scene
Section 92
//TickTraverser (away3d.core.scene.TickTraverser)
package away3d.core.scene {
public class TickTraverser extends Traverser {
public var now:int;
override public function enter(_arg1:Object3D):void{
_arg1.tick(now);
}
}
}//package away3d.core.scene
Section 93
//Traverser (away3d.core.scene.Traverser)
package away3d.core.scene {
public class Traverser {
public function match(_arg1:Object3D):Boolean{
return (true);
}
public function leave(_arg1:Object3D):void{
}
public function enter(_arg1:Object3D):void{
}
public function apply(_arg1:Object3D):void{
}
}
}//package away3d.core.scene
Section 94
//View3D (away3d.core.scene.View3D)
package away3d.core.scene {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import away3d.core.material.*;
import away3d.core.render.*;
import away3d.core.draw.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.stats.*;
import away3d.core.*;
public class View3D extends Sprite {
public var bitmapTexture:Bitmap;
public var mouseMaterial:IUVMaterial;
private var defaultclip:Clipping;
public var camera:Camera3D;
public var bitmapShader:Bitmap;
public var background:Sprite;
private var _lastmove_mouseX:Number;
public var findhit:FindHit;
public var mouseObject:Object3D;
public var clip:Clipping;
public var canvas:Sprite;
public var canvasStore:Array;
var c:Sprite;
var i:int;
public var mouseZeroMove:Boolean;
public var primitives:Array;
public var statsOpen:Boolean;
public var interactiveLayer:Sprite;
public var bmp:Bitmap;
public var stats:Boolean;
public var scene:Scene3D;
public var statsPanel:Stats;
public var canvasActive:Array;
public var renderer:IRenderer;
protected var mousedown:Boolean;
private var _lastmove_mouseY:Number;
public var hud:Sprite;
public function View3D(_arg1:Object=null){
background = new Sprite();
canvas = new Sprite();
bitmapTexture = new Bitmap();
bitmapShader = new Bitmap();
interactiveLayer = new Sprite();
hud = new Sprite();
defaultclip = new Clipping();
canvasStore = new Array();
canvasActive = new Array();
super();
_arg1 = Init.parse(_arg1);
stats = _arg1.getBoolean("stats", true);
clip = _arg1.getObject("clip", Clipping);
scene = ((_arg1.getObjectOrInit("scene", Scene3D)) || (new Scene3D()));
camera = ((_arg1.getObjectOrInit("camera", Camera3D)) || (new Camera3D({x:0, y:0, z:1000, lookat:"center"})));
renderer = ((_arg1.getObject("renderer")) || (new BasicRenderer()));
mouseZeroMove = _arg1.getBoolean("mouseZeroMove", false);
x = _arg1.getNumber("x", 0);
y = _arg1.getNumber("y", 0);
addChild(background);
addChild(canvas);
addChild(bitmapTexture);
addChild(bitmapShader);
addChild(interactiveLayer);
addChild(hud);
interactiveLayer.blendMode = BlendMode.ALPHA;
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
if (!clip){
clip = defaultclip;
};
if (stats){
addEventListener(Event.ADDED_TO_STAGE, createStatsMenu);
};
}
private function onMouseOver(_arg1:MouseEvent):void{
if (_arg1.eventPhase != EventPhase.AT_TARGET){
return;
};
fireMouseEvent(MouseEvent3D.MOUSE_OVER, _arg1.localX, _arg1.localY, _arg1.ctrlKey, _arg1.shiftKey);
}
public function createStatsMenu(_arg1:Event):void{
statsPanel = new Stats(this, stage.frameRate);
statsOpen = false;
}
public function removeOnMouseOut(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_OUT, _arg1, false);
}
public function fireMouseMoveEvent(_arg1:Boolean=false):void{
if (!((mouseZeroMove) || (_arg1))){
if ((((mouseX == _lastmove_mouseX)) && ((mouseY == _lastmove_mouseY)))){
return;
};
};
fireMouseEvent(MouseEvent3D.MOUSE_MOVE, mouseX, mouseY);
_lastmove_mouseX = mouseX;
_lastmove_mouseY = mouseY;
}
arcane function dispatchMouseEvent(_arg1:MouseEvent3D):void{
if (!hasEventListener(_arg1.type)){
return;
};
dispatchEvent(_arg1);
}
public function removeOnMouseUp(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_UP, _arg1, false);
}
private function onMouseUp(_arg1:MouseEvent):void{
mousedown = false;
fireMouseEvent(MouseEvent3D.MOUSE_UP, _arg1.localX, _arg1.localY, _arg1.ctrlKey, _arg1.shiftKey);
}
public function addOnMouseDown(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_DOWN, _arg1, false, 0, false);
}
public function clear():void{
canvas.graphics.clear();
i = canvasActive.length;
while (i--) {
c = canvasActive[i];
c.graphics.clear();
canvasStore.push(canvasActive.pop());
};
i = canvas.numChildren;
while (i--) {
canvas.removeChild(canvas.getChildAt(i));
};
}
private function onMouseOut(_arg1:MouseEvent):void{
if (_arg1.eventPhase != EventPhase.AT_TARGET){
return;
};
fireMouseEvent(MouseEvent3D.MOUSE_OUT, _arg1.localX, _arg1.localY, _arg1.ctrlKey, _arg1.shiftKey);
}
public function addOnMouseOver(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_OVER, _arg1, false, 0, false);
}
public function bubbleMouseEvent(_arg1:MouseEvent3D):void{
var _local2:Object3D;
_local2 = _arg1.object;
while (_local2 != null) {
if (_local2.dispatchMouseEvent(_arg1)){
break;
};
_local2 = _local2.parent;
};
}
public function addOnMouseUp(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_UP, _arg1, false, 0, false);
}
public function fireMouseEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false):void{
var _local6:MouseEvent3D;
var _local7:Object3D;
var _local8:IUVMaterial;
findhit = new FindHit(this, primitives, _arg2, _arg3);
_local6 = findhit.getMouseEvent(_arg1);
_local7 = _local6.object;
_local8 = _local6.material;
_local6.ctrlKey = _arg4;
_local6.shiftKey = _arg5;
if (((!((_arg1 == MouseEvent3D.MOUSE_OUT))) && (!((_arg1 == MouseEvent3D.MOUSE_OVER))))){
dispatchMouseEvent(_local6);
bubbleMouseEvent(_local6);
};
if (((!((mouseObject == _local7))) || (!((mouseMaterial == _local8))))){
if (mouseObject != null){
_local6 = findhit.getMouseEvent(MouseEvent3D.MOUSE_OUT);
_local6.object = mouseObject;
_local6.material = mouseMaterial;
dispatchMouseEvent(_local6);
bubbleMouseEvent(_local6);
mouseObject = null;
buttonMode = false;
};
if (((!((_local7 == null))) && ((mouseObject == null)))){
_local6 = findhit.getMouseEvent(MouseEvent3D.MOUSE_OVER);
_local6.object = (mouseObject = _local7);
_local6.material = (mouseMaterial = _local8);
dispatchMouseEvent(_local6);
bubbleMouseEvent(_local6);
buttonMode = mouseObject.useHandCursor;
};
};
}
protected function onMouseDown(_arg1:MouseEvent):void{
mousedown = true;
fireMouseEvent(MouseEvent3D.MOUSE_DOWN, _arg1.localX, _arg1.localY, _arg1.ctrlKey, _arg1.shiftKey);
}
public function render():void{
var _local1:Clipping;
clear();
_local1 = clip;
if (clip == defaultclip){
clip = defaultclip.screen(this);
};
primitives = renderer.render(this);
clip = _local1;
Init.checkUnusedArguments();
fireMouseMoveEvent();
}
public function removeOnMouseDown(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_DOWN, _arg1, false);
}
public function removeOnMouseMove(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_MOVE, _arg1, false);
}
public function removeOnMouseOver(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_OVER, _arg1, false);
}
public function addOnMouseOut(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_OUT, _arg1, false, 0, false);
}
public function addOnMouseMove(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_MOVE, _arg1, false, 0, false);
}
}
}//package away3d.core.scene
Section 95
//Sprite2D (away3d.core.sprite.Sprite2D)
package away3d.core.sprite {
import away3d.core.math.*;
import flash.display.*;
import away3d.core.material.*;
import away3d.core.render.*;
import away3d.core.scene.*;
import away3d.core.draw.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.*;
public class Sprite2D extends Object3D implements IPrimitiveProvider {
public var bitmap:BitmapData;
private var center:Vertex;
public var scaling:Number;
public var deltaZ:Number;
public var rotation:Number;
public var smooth:Boolean;
public function Sprite2D(_arg1:Object=null){
center = new Vertex();
super(_arg1);
_arg1 = Init.parse(_arg1);
scaling = _arg1.getNumber("scaling", 1, {min:0});
rotation = _arg1.getNumber("rotation", 0);
bitmap = _arg1.getBitmap("bitmap");
smooth = _arg1.getBoolean("smooth", false);
deltaZ = _arg1.getNumber("deltaZ", 0);
}
override public function primitives(_arg1:IPrimitiveConsumer, _arg2:RenderSession):void{
var _local3:ScreenVertex;
var _local4:Number;
super.primitives(_arg1, _arg2);
_local3 = center.project(projection);
if (!_local3.visible){
return;
};
_local4 = (projection.zoom / (1 + (_local3.z / projection.focus)));
_local3.z = (_local3.z + deltaZ);
_arg1.primitive(new DrawScaledBitmap(this, bitmap, _local3, (_local4 * scaling), rotation, smooth));
}
}
}//package away3d.core.sprite
Section 96
//Stats (away3d.core.stats.Stats)
package away3d.core.stats {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import away3d.core.scene.*;
import flash.geom.*;
import away3d.core.mesh.*;
import flash.text.*;
import flash.ui.*;
import flash.net.*;
import flash.system.*;
public class Stats extends Sprite {
private const APPLICATION_NAME:String = "Away3D.com";
private const VERSION:String = "1";
private const REVISION:String = "9.3";
private var bar:Sprite;
private var swfframerateLabel:TextField;
private var cambtn:Sprite;
private var geomLastAdded:String;
private var faceRenderLabel:TextField;
private var defautTF:TextFormat;
private var camLabel:TextField;
private var bestfps:int;// = 0
private var stageframerate:Number;
private var rectclose:Rectangle;
private var faceLabel:TextField;
private var aTypes:Array;
public var stats:String;
public var geomMenu:Sprite;// = null
private var avfpsLabel:TextField;
private var refreshes:int;// = 0
private var totalFaces:int;// = 0
var facecount:int;
private var rectclear:Rectangle;
private var displayState:int;
private var clearbtn:Sprite;
private var meshLabel:TextField;
private var barscale:int;// = 0
var type:String;
private var geomDetailsLabel:TextField;
public var displayMenu:Sprite;// = null
private var maxminbtn:Sprite;
private var peakLabel:TextField;
private var meshes:int;// = 0
private var closebtn:Sprite;
private var rectcam:Rectangle;
var url:String;
private var oStats:Object;
private var ramLabel:TextField;
private var titleField:TextField;
private var fpsLabel:TextField;
private var contextmenu:ContextMenu;
private var perfLabel:TextField;
private var geombtn:Sprite;
private var barwidth:int;// = 0
private var lastrender:int;
private var camMenu:Sprite;
private var camProp:Array;
public var scopeMenu:View3D;// = null
private var rectdetails:Rectangle;
private var lowestfps:int;// = 999
private var fpstotal:int;// = 0
public function Stats(_arg1:View3D, _arg2:Number=0){
var _local3:ContextMenuItem;
var _local4:ContextMenuItem;
var _local5:ContextMenuItem;
oStats = new Object();
totalFaces = 0;
meshes = 0;
aTypes = new Array();
scopeMenu = null;
displayMenu = null;
geomMenu = null;
fpstotal = 0;
refreshes = 0;
bestfps = 0;
lowestfps = 999;
barwidth = 0;
barscale = 0;
rectclose = new Rectangle(228, 4, 18, 17);
rectcam = new Rectangle(207, 4, 18, 17);
rectclear = new Rectangle(186, 4, 18, 17);
rectdetails = new Rectangle(165, 4, 18, 17);
defautTF = new TextFormat("Verdana", 10, 0);
super();
scopeMenu = _arg1;
contextmenu = new ContextMenu();
stageframerate = (_arg2) ? _arg2 : 30;
displayState = 0;
_local3 = new ContextMenuItem(((((APPLICATION_NAME + "\tv") + VERSION) + ".") + REVISION), true, true, true);
_local4 = new ContextMenuItem("Away3D Project stats", true, true, true);
_local5 = new ContextMenuItem(" ");
contextmenu.customItems = [_local4, _local3, _local5];
_local3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, visitWebsite);
_local4.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, displayStats);
scopeMenu.contextMenu = contextmenu;
scopeMenu.contextMenu.hideBuiltInItems();
}
public function clearObjects():void{
stats = "";
totalFaces = 0;
meshes = 0;
geomLastAdded = "";
}
private function showGeomInfo():void{
if (geomMenu == null){
createGeometrieMenu();
} else {
displayMenu.addChild(geomMenu);
geomMenu.y = 26;
};
}
private function clearStats():void{
fpstotal = 0;
refreshes = 0;
bestfps = 0;
lowestfps = 999;
}
private function closeOtherScreen(_arg1:int):void{
switch (_arg1){
case 1:
hideCamInfo();
break;
case 2:
hideGeomInfo();
};
}
private function generateSprite():void{
var _local1:Matrix;
var _local2:Sprite;
var _local3:Graphics;
var _local4:Graphics;
var _local5:Graphics;
var _local6:TextField;
var _local7:TextField;
var _local8:TextField;
var _local9:TextField;
var _local10:TextField;
var _local11:TextField;
var _local12:TextField;
var _local13:TextField;
var _local14:TextField;
displayMenu = new Sprite();
_local1 = new Matrix();
_local1.rotate(((90 * Math.PI) / 180));
displayMenu.graphics.beginGradientFill("linear", [3355494, 0xCCCCCC], [1, 1], [0, 0xFF], _local1, "pad", "rgb", 0);
displayMenu.graphics.drawRect(0, 0, 250, 86);
displayMenu.graphics.beginFill(3355494);
displayMenu.graphics.drawRect(3, 3, 244, 20);
scopeMenu.addChild(displayMenu);
displayMenu.x = (displayMenu.x - (displayMenu.width * 0.5));
displayMenu.y = (displayMenu.y - (displayMenu.height * 0.5));
closebtn = new Sprite();
closebtn.graphics.beginFill(0x666666);
closebtn.graphics.drawRect(0, 0, 18, 17);
_local2 = new Sprite();
_local2.graphics.beginFill(13029592);
_local2.graphics.drawRect(2, 7, 14, 4);
_local2.graphics.endFill();
_local2.graphics.beginFill(13029592);
_local2.graphics.drawRect(7, 2, 4, 14);
_local2.graphics.endFill();
_local2.rotation = 45;
_local2.x = (_local2.x + 9);
_local2.y = (_local2.y - 4);
closebtn.addChild(_local2);
displayMenu.addChild(closebtn);
closebtn.x = 228;
closebtn.y = 4;
cambtn = new Sprite();
_local3 = cambtn.graphics;
_local3.beginFill(0x666666);
_local3.drawRect(0, 0, 18, 17);
_local3.endFill();
_local3.beginFill(13029592);
_local3.moveTo(10, 8);
_local3.lineTo(16, 4);
_local3.lineTo(16, 14);
_local3.lineTo(10, 10);
_local3.lineTo(10, 8);
_local3.drawRect(2, 6, 8, 6);
_local3.endFill();
displayMenu.addChild(cambtn);
cambtn.x = 207;
cambtn.y = 4;
clearbtn = new Sprite();
_local4 = clearbtn.graphics;
_local4.beginFill(0x666666);
_local4.drawRect(0, 0, 18, 17);
_local4.endFill();
_local4.beginFill(13029592);
_local4.drawRect(6, 6, 6, 6);
_local4.endFill();
displayMenu.addChild(clearbtn);
clearbtn.x = 186;
clearbtn.y = 4;
geombtn = new Sprite();
_local5 = geombtn.graphics;
_local5.beginFill(0x666666);
_local5.drawRect(0, 0, 18, 17);
_local5.endFill();
_local5.beginFill(13029592, 0.7);
_local5.moveTo(3, 4);
_local5.lineTo(11, 2);
_local5.lineTo(16, 5);
_local5.lineTo(7, 7);
_local5.lineTo(3, 4);
_local5.beginFill(8225929, 0.8);
_local5.moveTo(3, 4);
_local5.lineTo(7, 7);
_local5.lineTo(7, 16);
_local5.lineTo(3, 12);
_local5.lineTo(3, 4);
_local5.beginFill(13029592, 1);
_local5.moveTo(7, 7);
_local5.lineTo(16, 5);
_local5.lineTo(15, 13);
_local5.lineTo(7, 16);
_local5.lineTo(7, 7);
_local5.endFill();
_local5.endFill();
displayMenu.addChild(geombtn);
geombtn.x = 165;
geombtn.y = 4;
displayMenu.graphics.beginGradientFill("linear", [0, 0xFFFFFF], [1, 1], [0, 0xFF], new Matrix(), "pad", "rgb", 0);
displayMenu.graphics.drawRect(3, 22, 244, 4);
displayMenu.graphics.endFill();
bar = new Sprite();
bar.graphics.beginFill(0xFFFFFF);
bar.graphics.drawRect(0, 0, 244, 4);
displayMenu.addChild(bar);
bar.x = 3;
bar.y = 22;
barwidth = 244;
barscale = int((barwidth / stageframerate));
displayPicto();
titleField = new TextField();
titleField.defaultTextFormat = new TextFormat("Verdana", 10, 0xFFFFFF, true, null, null, null, null, "left");
titleField.text = "AWAY3D PROJECT";
titleField.selectable = false;
titleField.height = 20;
titleField.width = 140;
titleField.x = 22;
titleField.y = 4;
displayMenu.addChild(titleField);
_local6 = new TextField();
_local6.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local6.text = "FPS:";
fpsLabel = new TextField();
fpsLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local6);
displayMenu.addChild(fpsLabel);
_local6.x = 3;
_local6.y = (fpsLabel.y = 30);
_local6.autoSize = "left";
fpsLabel.x = ((_local6.x + _local6.width) - 2);
_local7 = new TextField();
_local7.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local7.text = "AFPS:";
avfpsLabel = new TextField();
avfpsLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local7);
displayMenu.addChild(avfpsLabel);
_local7.x = 52;
_local7.y = (avfpsLabel.y = fpsLabel.y);
_local7.autoSize = "left";
avfpsLabel.x = ((_local7.x + _local7.width) - 2);
_local8 = new TextField();
_local8.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local8.text = "Max:";
peakLabel = new TextField();
peakLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local8);
displayMenu.addChild(peakLabel);
_local8.x = 107;
_local8.y = (peakLabel.y = avfpsLabel.y);
_local8.autoSize = "left";
peakLabel.x = ((_local8.x + _local8.width) - 2);
_local9 = new TextField();
_local9.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local9.text = "MS:";
perfLabel = new TextField();
perfLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local9);
displayMenu.addChild(perfLabel);
_local9.x = 177;
_local9.y = (perfLabel.y = fpsLabel.y);
_local9.autoSize = "left";
perfLabel.x = ((_local9.x + _local9.width) - 2);
_local10 = new TextField();
_local10.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local10.text = "RAM:";
ramLabel = new TextField();
ramLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local10);
displayMenu.addChild(ramLabel);
_local10.x = 3;
_local10.y = (ramLabel.y = 46);
_local10.autoSize = "left";
ramLabel.x = ((_local10.x + _local10.width) - 2);
_local11 = new TextField();
_local11.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local11.text = "MESHES:";
meshLabel = new TextField();
meshLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local11);
displayMenu.addChild(meshLabel);
_local11.x = 90;
_local11.y = (meshLabel.y = ramLabel.y);
_local11.autoSize = "left";
meshLabel.x = ((_local11.x + _local11.width) - 2);
_local12 = new TextField();
_local12.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local12.text = "SWF FR:";
swfframerateLabel = new TextField();
swfframerateLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local12);
displayMenu.addChild(swfframerateLabel);
_local12.x = 170;
_local12.y = (swfframerateLabel.y = ramLabel.y);
_local12.autoSize = "left";
swfframerateLabel.x = ((_local12.x + _local12.width) - 2);
_local13 = new TextField();
_local13.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local13.text = "T FACES:";
faceLabel = new TextField();
faceLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local13);
displayMenu.addChild(faceLabel);
_local13.x = 3;
_local13.y = (faceLabel.y = 62);
_local13.autoSize = "left";
faceLabel.x = ((_local13.x + _local13.width) - 2);
_local14 = new TextField();
_local14.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local14.text = "R FACES:";
faceRenderLabel = new TextField();
faceRenderLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local14);
displayMenu.addChild(faceRenderLabel);
_local14.x = 105;
_local14.y = (faceRenderLabel.y = faceLabel.y);
_local14.autoSize = "left";
faceRenderLabel.x = ((_local14.x + _local14.width) - 2);
}
private function createGeometrieMenu():void{
var _local1:Matrix;
geomMenu = new Sprite();
_local1 = new Matrix();
_local1.rotate(((90 * Math.PI) / 180));
geomMenu.graphics.beginGradientFill("linear", [3355494, 0xCCCCCC], [1, 1], [0, 0xFF], _local1, "pad", "rgb", 0);
geomMenu.graphics.drawRect(0, 0, 250, 200);
displayMenu.addChild(geomMenu);
geomMenu.y = 26;
geomDetailsLabel = new TextField();
geomDetailsLabel.x = 3;
geomDetailsLabel.y = 3;
geomDetailsLabel.defaultTextFormat = defautTF;
geomDetailsLabel.text = stats;
geomDetailsLabel.height = 200;
geomDetailsLabel.width = 235;
geomDetailsLabel.multiline = true;
geomDetailsLabel.selectable = true;
geomDetailsLabel.wordWrap = true;
geomMenu.addChild(geomDetailsLabel);
}
public function visitWebsite(_arg1:ContextMenuEvent):void{
var url:String;
var request:URLRequest;
var e = _arg1;
url = "http://www.away3d.com";
request = new URLRequest(url);
try {
navigateToURL(request);
} catch(e:Error) {
};
}
public function displayStats(_arg1:ContextMenuEvent):void{
if (!displayMenu){
scopeMenu.statsOpen = true;
generateSprite();
addEventMouse();
};
}
private function mouseReleased(_arg1:MouseEvent):void{
displayMenu.stopDrag();
scopeMenu.removeEventListener(MouseEvent.MOUSE_UP, mouseReleased);
}
private function createCamMenu():void{
var _local1:Matrix;
var _local2:TextFormat;
var _local3:TextField;
var _local4:int;
camMenu = new Sprite();
_local1 = new Matrix();
_local1.rotate(((90 * Math.PI) / 180));
camMenu.graphics.beginGradientFill("linear", [3355494, 0xCCCCCC], [1, 1], [0, 0xFF], _local1, "pad", "rgb", 0);
camMenu.graphics.drawRect(0, 0, 250, 220);
displayMenu.addChild(camMenu);
camMenu.y = 26;
camLabel = new TextField();
camLabel.height = 210;
camLabel.width = 170;
camLabel.x = 100;
camLabel.multiline = true;
_local2 = defautTF;
_local2.leading = 1.5;
camLabel.defaultTextFormat = _local2;
camLabel.wordWrap = true;
camMenu.addChild(camLabel);
camLabel.x = 100;
camLabel.y = 3;
camProp = ["x", "y", "z", "zoom", "focus", "distance", "panangle", "tiltangle", "targetpanangle", "targettiltangle", "mintiltangle", "maxtiltangle", "steps", "target"];
_local3 = new TextField();
_local2 = new TextFormat("Verdana", 10, 0, true);
_local2.leading = 1.5;
_local2.align = "right";
_local3.defaultTextFormat = _local2;
_local3.x = (_local3.y = 3);
_local3.multiline = true;
_local3.selectable = false;
_local3.autoSize = "left";
_local3.height = 210;
_local4 = 0;
while (_local4 < camProp.length) {
_local3.appendText((camProp[_local4] + ":\n"));
_local4++;
};
camMenu.addChild(_local3);
}
public function addObject(_arg1:BaseMesh):void{
type = _arg1.type;
if ((_arg1 is Mesh)){
facecount = (_arg1 as Mesh).faces.length;
} else {
facecount = 0;
};
url = _arg1.url;
if (((!((type == null))) && (!((facecount == 0))))){
stats = (stats + ((((((" - " + type) + " , faces: ") + facecount) + ", url: ") + url) + "\n"));
geomLastAdded = ((((((" - " + type) + " , faces: ") + facecount) + ", url: ") + url) + "\n");
totalFaces = (totalFaces + facecount);
meshes = (meshes + 1);
} else {
stats = (stats + ((((" - " + type) + " , url: ") + url) + "\n"));
geomLastAdded = ((((" - " + type) + " , url: ") + url) + "\n");
};
}
public function updateStats(_arg1:int, _arg2:Camera3D):void{
var now:int;
var perf:int;
var procent:int;
var colorTransform:ColorTransform;
var fps:int;
var average:int;
var w:int;
var caminfo:String;
var i:int;
var info:String;
var renderedfaces = _arg1;
var camera = _arg2;
now = getTimer();
perf = (now - lastrender);
lastrender = now;
if (perf < 1000){
fps = int((1000 / (perf + 0.001)));
fpstotal = (fpstotal + fps);
refreshes++;
average = (fpstotal / refreshes);
bestfps = ((fps)>bestfps) ? fps : bestfps;
lowestfps = ((fps)<lowestfps) ? fps : lowestfps;
w = (barscale * fps);
bar.width = ((w)<=barwidth) ? w : barwidth;
};
procent = ((bar.width / barwidth) * 100);
colorTransform = bar.transform.colorTransform;
colorTransform.color = ((((0xFF - (2.55 * procent)) << 16) | ((2.55 * procent) << 8)) | 40);
bar.transform.colorTransform = colorTransform;
if (displayState == 0){
avfpsLabel.text = ("" + average);
ramLabel.text = (("" + (int(((System.totalMemory / 0x0400) / 102.4)) / 10)) + "MB");
peakLabel.text = ((lowestfps + "/") + bestfps);
fpsLabel.text = ("" + fps);
perfLabel.text = ("" + perf);
faceLabel.text = ("" + totalFaces);
faceRenderLabel.text = ("" + renderedfaces);
meshLabel.text = ("" + meshes);
swfframerateLabel.text = ("" + stageframerate);
} else {
if (displayState == 1){
caminfo = "";
i = 0;
while (i < camProp.length) {
try {
if (i > 12){
caminfo = (caminfo + (String(camera[camProp[i]]) + "\n"));
} else {
info = String(camera[camProp[i]]);
caminfo = (caminfo + (info.substring(0, 19) + "\n"));
};
} catch(e:Error) {
caminfo = (caminfo + "\n");
};
i = (i + 1);
};
camLabel.text = caminfo;
} else {
if (displayState == 2){
geomDetailsLabel.text = stats;
geomDetailsLabel.scrollV = geomDetailsLabel.maxScrollV;
};
};
};
}
private function get image():Array{
return ([[7, 1, 262151], [8, 1, 3215136], [9, 1, 2033436], [10, 1, 1], [7, 2, 2098723], [8, 2, 5908501], [9, 2, 4922400], [10, 2, 720913], [6, 3, 327691], [7, 3, 6957102], [8, 3, 5975556], [9, 3, 6368779], [10, 3, 4789809], [11, 3, 2], [6, 4, 2361127], [7, 4, 10833686], [8, 4, 4926728], [9, 4, 6239495], [10, 4, 9190690], [11, 4, 1114647], [5, 5, 786453], [6, 5, 7088423], [7, 5, 14055707], [8, 5, 2103310], [9, 5, 3877139], [10, 5, 13134098], [11, 5, 5577773], [12, 5, 131077], [4, 6, 1], [5, 6, 3608110], [6, 6, 11227664], [7, 6, 12748351], [8, 6, 65793], [9, 6, 986379], [10, 6, 14980667], [11, 6, 10044437], [12, 6, 2230306], [4, 7, 0x12001C], [5, 7, 8007967], [6, 7, 14911011], [7, 7, 6509633], [10, 7, 9138771], [11, 7, 13989655], [12, 7, 7350824], [13, 7, 327689], [3, 8, 262153], [4, 8, 4592689], [5, 8, 12016138], [6, 8, 15774570], [7, 8, 855309], [10, 8, 2434083], [11, 8, 16233056], [12, 8, 11489803], [13, 8, 3345958], [3, 9, 1966887], [4, 9, 8665113], [5, 9, 15636021], [6, 9, 6773581], [11, 9, 9140836], [12, 9, 15240489], [13, 9, 8467743], [14, 9, 852240], [2, 10, 458767], [3, 10, 5774639], [4, 10, 13265683], [5, 10, 10845518], [6, 10, 0x0101], [11, 10, 657931], [12, 10, 14396016], [13, 10, 12739344], [14, 10, 5184297], [15, 10, 2], [2, 11, 2557230], [3, 11, 10307863], [4, 11, 12548133], [5, 11, 723464], [12, 11, 1512721], [13, 11, 14651446], [14, 11, 10307352], [15, 11, 1508630], [1, 12, 983068], [2, 12, 7154221], [3, 12, 9522185], [4, 12, 1314568], [6, 12, 131586], [7, 12, 921102], [8, 12, 0x1A1A1A], [9, 12, 0x171717], [10, 12, 657930], [13, 12, 2892051], [14, 12, 12610067], [15, 12, 7220009], [16, 12, 196614], [1, 13, 3936052], [2, 13, 5908749], [3, 13, 1773570], [4, 13, 4402968], [5, 13, 10714191], [6, 13, 12884326], [7, 13, 14396274], [8, 13, 15053429], [9, 13, 14790257], [10, 13, 13935206], [11, 13, 12159571], [12, 13, 9265971], [13, 13, 2759432], [14, 13, 2561537], [15, 13, 8601360], [16, 13, 3346464], [1, 14, 3938326], [2, 14, 5712395], [3, 14, 10900499], [4, 14, 11951126], [5, 14, 11490833], [6, 14, 11358991], [7, 14, 11227662], [8, 14, 11161870], [9, 14, 11030286], [10, 14, 10964497], [11, 14, 10898963], [12, 14, 10833429], [13, 14, 11096344], [14, 14, 8797973], [15, 14, 4595726], [16, 14, 4594459], [17, 14, 327941], [1, 15, 2296596], [2, 15, 3280925], [3, 15, 2821148], [4, 15, 2624284], [5, 15, 2558749], [6, 15, 2624031], [7, 15, 2558496], [8, 15, 2558498], [9, 15, 2492705], [10, 15, 2361630], [11, 15, 2361374], [12, 15, 2295839], [13, 15, 2295840], [14, 15, 2427171], [15, 15, 2624036], [16, 15, 1377300]]);
}
private function showCamInfo():void{
if (camMenu == null){
createCamMenu();
} else {
displayMenu.addChild(camMenu);
camMenu.y = 26;
};
}
private function hideGeomInfo():void{
if (geomMenu != null){
displayMenu.removeChild(geomMenu);
};
}
private function hideCamInfo():void{
if (camMenu != null){
displayMenu.removeChild(camMenu);
};
}
private function closeStats():void{
scopeMenu.statsOpen = false;
displayState = 0;
scopeMenu.removeEventListener(MouseEvent.MOUSE_DOWN, onCheckMouse);
scopeMenu.removeEventListener(MouseEvent.MOUSE_MOVE, updateTips);
scopeMenu.removeChild(displayMenu);
displayMenu = null;
}
private function updateTips(_arg1:MouseEvent):void{
var x:Number;
var y:Number;
var pt:Point;
var me = _arg1;
if (scopeMenu != null){
x = displayMenu.mouseX;
y = displayMenu.mouseY;
pt = new Point(x, y);
try {
if (rectcam.containsPoint(pt)){
titleField.text = "CAMERA INFO";
} else {
if (rectclose.containsPoint(pt)){
titleField.text = "CLOSE STATS";
} else {
if (rectclear.containsPoint(pt)){
titleField.text = "CLEAR AVERAGES";
} else {
if (rectdetails.containsPoint(pt)){
titleField.text = "MESH INFO";
} else {
titleField.text = "AWAY3D PROJECT";
};
};
};
};
} catch(e:Error) {
};
};
}
private function addEventMouse():void{
scopeMenu.addEventListener(MouseEvent.MOUSE_DOWN, onCheckMouse);
scopeMenu.addEventListener(MouseEvent.MOUSE_MOVE, updateTips);
}
private function onCheckMouse(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:Number;
var _local4:Point;
_local2 = displayMenu.mouseX;
_local3 = displayMenu.mouseY;
_local4 = new Point(_local2, _local3);
if (rectcam.containsPoint(_local4)){
if (displayState != 1){
closeOtherScreen(displayState);
displayState = 1;
showCamInfo();
} else {
displayState = 0;
hideCamInfo();
};
} else {
if (rectdetails.containsPoint(_local4)){
if (displayState != 2){
closeOtherScreen(displayState);
displayState = 2;
showGeomInfo();
} else {
displayState = 0;
hideGeomInfo();
};
} else {
if (rectclose.containsPoint(_local4)){
closeStats();
} else {
if (rectclear.containsPoint(_local4)){
clearStats();
} else {
displayMenu.startDrag();
scopeMenu.addEventListener(MouseEvent.MOUSE_UP, mouseReleased);
};
};
};
};
}
private function generateClipBoardInfo():void{
var _local1:String;
var _local2:Camera3D;
_local1 = "-- AWAY3D STATS REPORT --\n\n";
_local1 = (_local1 + "GEOMETRY:\n");
_local1 = (_local1 + stats);
_local1 = (_local1 + "\nCAMERA:\n");
_local2 = scopeMenu.camera;
}
private function displayPicto():void{
var _local1:Sprite;
var _local2:Graphics;
var _local3:Array;
var _local4:int;
_local1 = new Sprite();
_local2 = _local1.graphics;
_local2.beginFill(0);
_local2.drawRect(0, 0, 18, 17);
_local3 = image;
_local4 = 0;
while (_local4 < _local3.length) {
_local2.beginFill(Number(_local3[_local4][2]));
_local2.drawRect(_local3[_local4][0], _local3[_local4][1], 1, 1);
_local4++;
};
_local2.endFill();
displayMenu.addChild(_local1);
_local1.x = (_local1.y = 4);
}
}
}//package away3d.core.stats
Section 97
//Cast (away3d.core.utils.Cast)
package away3d.core.utils {
import flash.utils.*;
import flash.display.*;
import away3d.core.material.*;
import away3d.core.scene.*;
import away3d.core.mesh.*;
import away3d.loaders.*;
public class Cast {
private static var colornames:Dictionary;
private static var hexchars:String = "0123456789abcdefABCDEF";
private static var classes:Dictionary = new Dictionary();
private static var notclasses:Dictionary = new Dictionary();
public static function color(_arg1):uint{
var _local2:uint;
_local2 = trycolor(_arg1);
if (_local2 == 4294967295){
throw (new CastError(("Can't cast to color: " + _arg1)));
};
return (_local2);
}
public static function material(_arg1):ITriangleMaterial{
var hash:Array;
var line:Array;
var bmd:BitmapData;
var bitmap:BitmapData;
var color:uint;
var alpha:Number;
var lighting:Boolean;
var static:Boolean;
var wire:WireframeMaterial;
var smooth:Number;
var precision:Number;
var data = _arg1;
if (data == null){
return (null);
};
if ((data is String)){
data = tryclass(data);
};
if ((data is Class)){
try {
data = new (data);
} catch(error:ArgumentError) {
data = new data(0, 0);
};
};
if ((data is IMaterial)){
return (data);
};
if ((data is int)){
return (new ColorMaterial(data));
};
if ((data is MovieClip)){
return (new MovieMaterial(data));
};
if ((data is String)){
if (data == ""){
return (null);
};
if (data == "transparent"){
return (new TransparentMaterial());
};
if (data.indexOf("#") != -1){
hash = data.split("#");
if (hash[1] == ""){
return (new WireColorMaterial(color(hash[0])));
};
if (hash[1].indexOf("|") == -1){
if (hash[0] == ""){
return (new WireframeMaterial(color(hash[1])));
};
return (new WireColorMaterial(color(hash[0]), {wirecolor:color(hash[1])}));
} else {
line = hash[1].split("|");
if (hash[0] == ""){
return (new WireframeMaterial(color(line[0]), {width:parseFloat(line[1])}));
};
return (new WireColorMaterial(color(hash[0]), {wirecolor:color(line[0]), width:parseFloat(line[1])}));
};
} else {
if (data.indexOf("@") != -1){
hash = data.split("@");
if (hash[1] == ""){
return (new ShadingColorMaterial({color:color(hash[0])}));
};
} else {
return (new ColorMaterial(color(data)));
};
};
};
try {
bmd = Cast.bitmap(data);
return (new BitmapMaterial(bmd));
} catch(error:CastError) {
};
if ((data is Object)){
data = Init.parse(data);
bitmap = data.getBitmap("bitmap");
color = data.getColor("color", 4294967295);
alpha = data.getNumber("alpha", 1, {min:0, max:1});
lighting = data.getBoolean("lighting", false);
static = data.getBoolean("static", false);
wire = (wirematerial(data.getObject("wire")) as WireframeMaterial);
if (((!((bitmap == null))) && (!((color == 4294967295))))){
throw (new CastError(("Can't create material with color and bitmap: " + data)));
};
if (bitmap != null){
if (wire != null){
Debug.warning("Bitmap materials do not support wire");
};
smooth = data.getNumber("smooth", false);
precision = data.getNumber("precision", Infinity);
if (precision < Infinity){
if (lighting){
Debug.warning("Can't create precise bitmap material with lighting (yet)");
};
if (alpha < 1){
Debug.warning("Can't create precise bitmap material with alpha (yet)");
};
return (new BitmapMaterial(bitmap, {smooth:smooth}));
};
if (lighting){
if (alpha < 1){
Debug.warning("Can't create bitmap material with lighting and alpha (yet)");
};
return (new WhiteShadingBitmapMaterial(bitmap, {smooth:smooth}));
};
if (alpha < 1){
return (new AlphaBitmapMaterial(bitmap, {smooth:smooth, alpha:alpha}));
};
return (new BitmapMaterial(bitmap, {smooth:smooth}));
};
if (color != 4294967295){
if (lighting){
if (wire != null){
Debug.warning("Can't create shading material with wire");
};
return (new ShadingColorMaterial({color:color, alpha:alpha, static:static}));
};
if (wire == null){
return (new ColorMaterial(color, {alpha:alpha}));
};
return (new WireColorMaterial(color, {alpha:alpha, wirecolor:wire.color, wirealpha:wire.alpha, width:wire.width}));
};
if (wire != null){
return (wire);
};
};
throw (new CastError(("Can't cast to material: " + data)));
}
public static function trycolor(_arg1):uint{
if ((_arg1 is uint)){
return ((_arg1 as uint));
};
if ((_arg1 is int)){
return ((_arg1 as uint));
};
if ((_arg1 is String)){
if (_arg1 == "random"){
return (uint((Math.random() * 16777216)));
};
if (colornames == null){
colornames = new Dictionary();
colornames["steelblue"] = 4620980;
colornames["royalblue"] = 267920;
colornames["cornflowerblue"] = 6591981;
colornames["lightsteelblue"] = 11584734;
colornames["mediumslateblue"] = 8087790;
colornames["slateblue"] = 6970061;
colornames["darkslateblue"] = 4734347;
colornames["midnightblue"] = 1644912;
colornames["navy"] = 128;
colornames["darkblue"] = 139;
colornames["mediumblue"] = 205;
colornames["blue"] = 0xFF;
colornames["dodgerblue"] = 2003199;
colornames["deepskyblue"] = 49151;
colornames["lightskyblue"] = 8900346;
colornames["skyblue"] = 8900331;
colornames["lightblue"] = 11393254;
colornames["powderblue"] = 11591910;
colornames["azure"] = 15794175;
colornames["lightcyan"] = 14745599;
colornames["paleturquoise"] = 11529966;
colornames["mediumturquoise"] = 4772300;
colornames["lightseagreen"] = 2142890;
colornames["darkcyan"] = 0x8B8B;
colornames["teal"] = 0x8080;
colornames["cadetblue"] = 6266528;
colornames["darkturquoise"] = 52945;
colornames["aqua"] = 0xFFFF;
colornames["cyan"] = 0xFFFF;
colornames["turquoise"] = 4251856;
colornames["aquamarine"] = 8388564;
colornames["mediumaquamarine"] = 6737322;
colornames["darkseagreen"] = 9419919;
colornames["mediumseagreen"] = 3978097;
colornames["seagreen"] = 3050327;
colornames["darkgreen"] = 0x6400;
colornames["green"] = 0x8000;
colornames["forestgreen"] = 2263842;
colornames["limegreen"] = 3329330;
colornames["lime"] = 0xFF00;
colornames["chartreuse"] = 0x7FFF00;
colornames["lawngreen"] = 0x7CFC00;
colornames["greenyellow"] = 11403055;
colornames["yellowgreen"] = 10145074;
colornames["palegreen"] = 10025880;
colornames["lightgreen"] = 9498256;
colornames["springgreen"] = 65407;
colornames["mediumspringgreen"] = 64154;
colornames["darkolivegreen"] = 5597999;
colornames["olivedrab"] = 7048739;
colornames["olive"] = 0x808000;
colornames["darkkhaki"] = 12433259;
colornames["darkgoldenrod"] = 12092939;
colornames["goldenrod"] = 14329120;
colornames["gold"] = 0xFFD700;
colornames["yellow"] = 0xFFFF00;
colornames["khaki"] = 15787660;
colornames["palegoldenrod"] = 15657130;
colornames["blanchedalmond"] = 16772045;
colornames["moccasin"] = 16770229;
colornames["wheat"] = 16113331;
colornames["navajowhite"] = 16768685;
colornames["burlywood"] = 14596231;
colornames["tan"] = 13808780;
colornames["rosybrown"] = 12357519;
colornames["sienna"] = 10506797;
colornames["saddlebrown"] = 9127187;
colornames["chocolate"] = 13789470;
colornames["peru"] = 13468991;
colornames["sandybrown"] = 16032864;
colornames["darkred"] = 0x8B0000;
colornames["maroon"] = 0x800000;
colornames["brown"] = 10824234;
colornames["firebrick"] = 11674146;
colornames["indianred"] = 13458524;
colornames["lightcoral"] = 15761536;
colornames["salmon"] = 16416882;
colornames["darksalmon"] = 15308410;
colornames["lightsalmon"] = 16752762;
colornames["coral"] = 16744272;
colornames["tomato"] = 16737095;
colornames["darkorange"] = 0xFF8C00;
colornames["orange"] = 0xFFA500;
colornames["orangered"] = 0xFF4500;
colornames["crimson"] = 14423100;
colornames["red"] = 0xFF0000;
colornames["deeppink"] = 16716947;
colornames["fuchsia"] = 0xFF00FF;
colornames["magenta"] = 0xFF00FF;
colornames["hotpink"] = 16738740;
colornames["lightpink"] = 16758465;
colornames["pink"] = 16761035;
colornames["palevioletred"] = 14381203;
colornames["mediumvioletred"] = 13047173;
colornames["purple"] = 0x800080;
colornames["darkmagenta"] = 0x8B008B;
colornames["mediumpurple"] = 9662683;
colornames["blueviolet"] = 9055202;
colornames["indigo"] = 0x4B0082;
colornames["darkviolet"] = 0x9400D3;
colornames["darkorchid"] = 10040012;
colornames["mediumorchid"] = 12211667;
colornames["orchid"] = 14315734;
colornames["violet"] = 15631086;
colornames["plum"] = 14524637;
colornames["thistle"] = 14204888;
colornames["lavender"] = 15132410;
colornames["ghostwhite"] = 16316671;
colornames["aliceblue"] = 15792383;
colornames["mintcream"] = 16121850;
colornames["honeydew"] = 15794160;
colornames["lightgoldenrodyellow"] = 16448210;
colornames["lemonchiffon"] = 16775885;
colornames["cornsilk"] = 16775388;
colornames["lightyellow"] = 16777184;
colornames["ivory"] = 16777200;
colornames["floralwhite"] = 16775920;
colornames["linen"] = 16445670;
colornames["oldlace"] = 16643558;
colornames["antiquewhite"] = 16444375;
colornames["bisque"] = 16770244;
colornames["peachpuff"] = 16767673;
colornames["papayawhip"] = 16773077;
colornames["beige"] = 16119260;
colornames["seashell"] = 16774638;
colornames["lavenderblush"] = 16773365;
colornames["mistyrose"] = 16770273;
colornames["snow"] = 16775930;
colornames["white"] = 0xFFFFFF;
colornames["whitesmoke"] = 0xF5F5F5;
colornames["gainsboro"] = 0xDCDCDC;
colornames["lightgrey"] = 0xD3D3D3;
colornames["silver"] = 0xC0C0C0;
colornames["darkgrey"] = 0xA9A9A9;
colornames["grey"] = 0x808080;
colornames["lightslategrey"] = 7833753;
colornames["slategrey"] = 7372944;
colornames["dimgrey"] = 0x696969;
colornames["darkslategrey"] = 3100495;
colornames["black"] = 0;
colornames["transparent"] = 4278190080;
};
if (colornames[_arg1] != null){
return (colornames[_arg1]);
};
if ((((_arg1.length == 6)) && (hexstring(_arg1)))){
return (parseInt(("0x" + _arg1)));
};
};
return (4294967295);
}
private static function hexstring(_arg1:String):Boolean{
var _local2:int;
_local2 = 0;
while (_local2 < _arg1.length) {
if (hexchars.indexOf(_arg1.charAt(_local2)) == -1){
return (false);
};
_local2++;
};
return (true);
}
public static function wirematerial(_arg1):ISegmentMaterial{
var _local2:Array;
var _local3:uint;
var _local4:Number;
var _local5:Number;
if (_arg1 == null){
return (null);
};
if ((_arg1 is ISegmentMaterial)){
return (_arg1);
};
if ((_arg1 is int)){
return (new WireframeMaterial(_arg1));
};
if ((_arg1 is String)){
if (_arg1 == ""){
return (null);
};
if (_arg1 == "transparent"){
return (new TransparentMaterial());
};
if (_arg1.indexOf("#") == 0){
_arg1 = _arg1.substring(1);
};
if (_arg1.indexOf("|") == -1){
return (new WireframeMaterial(color(_arg1)));
};
_local2 = _arg1.split("|");
return (new WireframeMaterial(color(_local2[0]), {width:parseFloat(_local2[1])}));
};
if ((_arg1 is Object)){
_arg1 = Init.parse(_arg1);
_local3 = _arg1.getColor("color", 0);
_local4 = _arg1.getNumber("alpha", 1, {min:0, max:1});
_local5 = _arg1.getNumber("width", 1, {min:0});
return (new WireframeMaterial(_local3, {alpha:_local4, width:_local5}));
};
throw (new CastError(("Can't cast to wirematerial: " + _arg1)));
}
public static function bitmap(_arg1):BitmapData{
var sprite:Sprite;
var bmd:BitmapData;
var data = _arg1;
if (data == null){
return (null);
};
if ((data is String)){
data = tryclass(data);
};
if ((data is Class)){
try {
data = new (data);
} catch(error:ArgumentError) {
data = new data(0, 0);
};
};
if ((data is BitmapData)){
return (data);
};
if (data.hasOwnProperty("bitmapData")){
return (data.bitmapData);
};
if ((data is Sprite)){
sprite = (data as Sprite);
bmd = new BitmapData(sprite.width, sprite.height, true, 0xFFFFFF);
bmd.draw(sprite, null, null, null, bmd.rect, true);
return (bmd);
};
throw (new CastError(("Can't cast to bitmap: " + data)));
}
public static function bytearray(_arg1):ByteArray{
if ((_arg1 is Class)){
_arg1 = new (_arg1);
};
if ((_arg1 is ByteArray)){
return (_arg1);
};
return (ByteArray(_arg1));
}
public static function xml(_arg1):XML{
if ((_arg1 is Class)){
_arg1 = new (_arg1);
};
if ((_arg1 is XML)){
return (_arg1);
};
return (XML(_arg1));
}
public static function string(_arg1):String{
if ((_arg1 is Class)){
_arg1 = new (_arg1);
};
if ((_arg1 is String)){
return (_arg1);
};
return (String(_arg1));
}
public static function tryclass(_arg1:String):Object{
var result:Class;
var name = _arg1;
if (notclasses[name]){
return (name);
};
result = classes[name];
if (result != null){
return (result);
};
try {
result = (getDefinitionByName(name) as Class);
classes[name] = result;
return (result);
} catch(error:ReferenceError) {
};
notclasses[name] = true;
return (name);
}
}
}//package away3d.core.utils
Section 98
//CastError (away3d.core.utils.CastError)
package away3d.core.utils {
public class CastError extends Error {
public function CastError(_arg1:String){
super(_arg1);
}
}
}//package away3d.core.utils
Section 99
//Debug (away3d.core.utils.Debug)
package away3d.core.utils {
public class Debug {
public static var warningsAsErrors:Boolean = false;
public static var active:Boolean = false;
public static function warning(_arg1:Object):void{
if (warningsAsErrors){
error(_arg1);
return;
};
trace(("WARNING: " + _arg1));
}
public static function trace(_arg1:Object):void{
dotrace(_arg1);
}
public static function delimiter():void{
}
public static function clear():void{
}
public static function error(_arg1:Object):void{
trace(("ERROR: " + _arg1));
throw (new Error(_arg1));
}
}
}//package away3d.core.utils
private const dotrace:Function = function (_arg1:Object):void{
trace(_arg1);
};
Section 100
//FaceDictionaryVO (away3d.core.utils.FaceDictionaryVO)
package away3d.core.utils {
import flash.display.*;
public class FaceDictionaryVO {
public var dirty:Boolean;
public var bitmap:BitmapData;
public function FaceDictionaryVO(_arg1:Number=0, _arg2:Number=0){
if (((_arg1) && (_arg2))){
bitmap = new BitmapData(_arg1, _arg2, true, 0);
};
}
public function reset(_arg1:Number, _arg2:Number):void{
if (bitmap){
bitmap.dispose();
};
bitmap = new BitmapData(_arg1, _arg2, true, 0);
dirty = true;
}
public function clear():void{
if (bitmap){
bitmap.fillRect(bitmap.rect, 0);
};
dirty = true;
}
}
}//package away3d.core.utils
Section 101
//IClonable (away3d.core.utils.IClonable)
package away3d.core.utils {
public interface IClonable {
function clone(_arg1=null);
}
}//package away3d.core.utils
Section 102
//Init (away3d.core.utils.Init)
package away3d.core.utils {
import away3d.core.math.*;
import flash.display.*;
import away3d.core.material.*;
import away3d.core.scene.*;
import away3d.core.*;
public class Init {
private var init:Object;
private static var inits:Array = [];
public function Init(_arg1:Object){
this.init = _arg1;
}
public function getArray(_arg1:String):Array{
var _local2:Array;
if (init == null){
return ([]);
};
if (!init.hasOwnProperty(_arg1)){
return ([]);
};
_local2 = init[_arg1];
delete init[_arg1];
return (_local2);
}
public function getSegmentMaterial(_arg1:String):ISegmentMaterial{
var _local2:ISegmentMaterial;
if (init == null){
return (null);
};
if (!init.hasOwnProperty(_arg1)){
return (null);
};
_local2 = Cast.wirematerial(init[_arg1]);
delete init[_arg1];
return (_local2);
}
public function getBitmap(_arg1:String):BitmapData{
var _local2:BitmapData;
if (init == null){
return (null);
};
if (!init.hasOwnProperty(_arg1)){
return (null);
};
_local2 = Cast.bitmap(init[_arg1]);
delete init[_arg1];
return (_local2);
}
public function getObject3D(_arg1:String):Object3D{
return ((getObject(_arg1, Object3D) as Object3D));
}
public function getString(_arg1:String, _arg2:String):String{
var _local3:String;
if (init == null){
return (_arg2);
};
if (!init.hasOwnProperty(_arg1)){
return (_arg2);
};
_local3 = init[_arg1];
delete init[_arg1];
return (_local3);
}
public function getObjectOrInit(_arg1:String, _arg2:Class=null):Object{
var _local3:Object;
if (init == null){
return (null);
};
if (!init.hasOwnProperty(_arg1)){
return (null);
};
_local3 = init[_arg1];
delete init[_arg1];
if (_local3 == null){
return (null);
};
if (_arg2 != null){
if (!(_local3 is _arg2)){
return (new _arg2(_local3));
};
};
return (_local3);
}
public function getPosition(_arg1:String):Number3D{
var _local2:Object;
var _local3:Object;
_local2 = getObject(_arg1);
if (_local2 == null){
return (null);
};
if ((_local2 is Number3D)){
return ((_local2 as Number3D));
};
if ((_local2 is Object3D)){
_local3 = (_local2 as Object3D);
return ((_local3.scene) ? _local3.scenePosition : _local3.position);
};
if ((_local2 is String)){
if (_local2 == "center"){
return (new Number3D());
};
};
throw (new CastError(("Cast get position of " + _local2)));
}
public function getInit(_arg1:String):Init{
var _local2:Init;
if (init == null){
return (new Init(null));
};
if (!init.hasOwnProperty(_arg1)){
return (new Init(null));
};
_local2 = Init.parse(init[_arg1]);
delete init[_arg1];
return (_local2);
}
public function getNumber2D(_arg1:String):Number2D{
return ((getObject(_arg1, Number2D) as Number2D));
}
public function getBoolean(_arg1:String, _arg2:Boolean):Boolean{
var _local3:Boolean;
if (init == null){
return (_arg2);
};
if (!init.hasOwnProperty(_arg1)){
return (_arg2);
};
_local3 = init[_arg1];
delete init[_arg1];
return (_local3);
}
public function getColor(_arg1:String, _arg2:uint):uint{
var _local3:uint;
if (init == null){
return (_arg2);
};
if (!init.hasOwnProperty(_arg1)){
return (_arg2);
};
_local3 = Cast.color(init[_arg1]);
delete init[_arg1];
return (_local3);
}
public function getObject(_arg1:String, _arg2:Class=null):Object{
var _local3:Object;
if (init == null){
return (null);
};
if (!init.hasOwnProperty(_arg1)){
return (null);
};
_local3 = init[_arg1];
delete init[_arg1];
if (_local3 == null){
return (null);
};
if (_arg2 != null){
if (!(_local3 is _arg2)){
throw (new CastError(((((("Parameter \"" + _arg1) + "\" is not of class ") + _arg2) + ": ") + _local3)));
};
};
return (_local3);
}
public function getNumber3D(_arg1:String):Number3D{
return ((getObject(_arg1, Number3D) as Number3D));
}
arcane function addForCheck():void{
if (init == null){
return;
};
init.dontCheckUnused = false;
inits.push(init);
}
public function getInt(_arg1:String, _arg2:int, _arg3:Object=null):int{
var _local4:int;
var _local5:int;
var _local6:int;
if (init == null){
return (_arg2);
};
if (!init.hasOwnProperty(_arg1)){
return (_arg2);
};
_local4 = init[_arg1];
if (_arg3 != null){
if (_arg3.hasOwnProperty("min")){
_local5 = _arg3["min"];
if (_local4 < _local5){
_local4 = _local5;
};
};
if (_arg3.hasOwnProperty("max")){
_local6 = _arg3["max"];
if (_local4 > _local6){
_local4 = _local6;
};
};
};
delete init[_arg1];
return (_local4);
}
arcane function removeFromCheck():void{
if (init == null){
return;
};
init.dontCheckUnused = true;
}
public function getMaterial(_arg1:String):ITriangleMaterial{
var _local2:ITriangleMaterial;
if (init == null){
return (null);
};
if (!init.hasOwnProperty(_arg1)){
return (null);
};
_local2 = Cast.material(init[_arg1]);
delete init[_arg1];
return (_local2);
}
public function getNumber(_arg1:String, _arg2:Number, _arg3:Object=null):Number{
var _local4:Number;
var _local5:Number;
var _local6:Number;
if (init == null){
return (_arg2);
};
if (!init.hasOwnProperty(_arg1)){
return (_arg2);
};
_local4 = init[_arg1];
if (_arg3 != null){
if (_arg3.hasOwnProperty("min")){
_local5 = _arg3["min"];
if (_local4 < _local5){
_local4 = _local5;
};
};
if (_arg3.hasOwnProperty("max")){
_local6 = _arg3["max"];
if (_local4 > _local6){
_local4 = _local6;
};
};
};
delete init[_arg1];
return (_local4);
}
arcane static function checkUnusedArguments():void{
var _local1:Array;
var _local2:Object;
var _local3:String;
var _local4:String;
if (inits.length == 0){
return;
};
_local1 = inits;
inits = [];
for each (_local2 in _local1) {
if (_local2.hasOwnProperty("dontCheckUnused")){
//unresolved if
} else {
_local3 = null;
for (_local4 in _local2) {
if (_local4 == "dontCheckUnused"){
} else {
if (_local3 == null){
_local3 = "";
} else {
_local3 = (_local3 + ", ");
};
_local3 = (_local3 + ((_local4 + ":") + _local2[_local4]));
};
};
if (_local3 != null){
Debug.warning((("Unused arguments: {" + _local3) + "}"));
};
};
};
}
public static function parse(_arg1:Object):Init{
if (_arg1 == null){
return (new Init(null));
};
if ((_arg1 is Init)){
return ((_arg1 as Init));
};
inits.push(_arg1);
return (new Init(_arg1));
}
}
}//package away3d.core.utils
Section 103
//LazyEventDispatcher (away3d.core.utils.LazyEventDispatcher)
package away3d.core.utils {
import flash.events.*;
import away3d.core.*;
public class LazyEventDispatcher {
private var _dispatcher:EventDispatcher;
protected function dispatchEvent(_arg1:Event):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.dispatchEvent(_arg1));
}
protected function willTrigger(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.willTrigger(_arg1));
}
arcane function get dispatcher():EventDispatcher{
return (_dispatcher);
}
protected function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (_dispatcher == null){
return;
};
_dispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
protected function hasEventListener(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.hasEventListener(_arg1));
}
protected function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (_dispatcher == null){
_dispatcher = new EventDispatcher();
};
_dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4);
}
}
}//package away3d.core.utils
Section 104
//ValueObject (away3d.core.utils.ValueObject)
package away3d.core.utils {
import flash.events.*;
public class ValueObject extends LazyEventDispatcher {
private static var changed:Event;
public function addOnChange(_arg1:Function):void{
addEventListener("changed", _arg1, false, 0, true);
}
public function removeOnChange(_arg1:Function):void{
removeEventListener("changed", _arg1, false);
}
protected function notifyChange():void{
if (!hasEventListener("changed")){
return;
};
if (changed == null){
changed = new Event("changed");
};
dispatchEvent(changed);
}
}
}//package away3d.core.utils
Section 105
//arcane (away3d.core.arcane)
package away3d.core {
public namespace arcane;
}//package away3d.core
Section 106
//Lathe (away3d.extrusions.Lathe)
package away3d.extrusions {
import away3d.core.math.*;
import away3d.core.material.*;
import away3d.core.scene.*;
import flash.geom.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.*;
public class Lathe extends Mesh {
private var uvarr:Array;
private var varr:Array;
private var varr2:Array;
public function Lathe(_arg1:Array, _arg2:Object=null){
var _local3:String;
var _local4:Number;
var _local5:int;
var _local6:int;
var _local7:Number;
var _local8:Object;
var _local9:String;
var _local10:Object;
var _local11:Number;
var _local12:Boolean;
var _local13:Boolean;
var _local14:Boolean;
var _local15:int;
var _local16:String;
var _local17:String;
var _local18:String;
var _local19:Array;
varr = new Array();
varr2 = new Array();
uvarr = new Array();
if (_arg2.material != null){
_arg2.materials = {defaultmaterial:_arg2.material};
};
if ((((_arg2.material == null)) && (!((_arg2.materials == null))))){
_arg2.material = _arg2.materials.defaultmaterial;
};
_arg2 = Init.parse(_arg2);
super(_arg2);
_local3 = _arg2.getString("axis", "y");
_local4 = _arg2.getNumber("rotations", 1, {min:0.1});
_local5 = _arg2.getInt("subdivision", 2, {min:2});
_local6 = _arg2.getNumber("offsetradius", 0);
_local7 = _arg2.getNumber("scaling", 1);
_local8 = _arg2.getObject("materials", null);
_local9 = _arg2.getString("omit", "");
_local10 = _arg2.getObject("tweek", null);
_local11 = _arg2.getNumber("thickness", 0, {min:0});
_local12 = _arg2.getBoolean("coverall", true);
_local13 = _arg2.getBoolean("recenter", false);
_local14 = _arg2.getBoolean("flip", false);
if (_local7 != 1){
_local15 = 0;
while (_local15 < _arg1.length) {
_arg1[_local15].x = (_arg1[_local15].x * _local7);
_arg1[_local15].y = (_arg1[_local15].y * _local7);
_arg1[_local15].z = (_arg1[_local15].z * _local7);
_local15++;
};
};
if (_arg1.length > 1){
_local10 = ((_local10)==null) ? {x:0, y:0, z:0, radius:0, rotation:0} : _local10;
if (_local11 != 0){
switch (_local3){
case "x":
_local16 = "x";
_local17 = "z";
_local18 = "y";
break;
case "y":
_local16 = "y";
_local17 = "x";
_local18 = "z";
break;
case "z":
_local16 = "z";
_local17 = "y";
_local18 = "x";
};
_local19 = buildThicknessPoints(_arg1, _local11, _local16, _local17);
generateWithThickness(_arg1, _local19, _local3, _local16, _local17, _local18, _local6, _local4, _local5, _local10, _local12, _local8, _local9, _local14);
} else {
generate(_arg1, _local3, _local6, _local4, _local5, _local10, _local12, _local14);
};
} else {
trace("Lathe error: at least 2 number3D are required!");
};
varr = null;
varr2 = null;
uvarr = null;
if (_local13){
movePivot((-((this.minX + this.maxX)) * 0.5), (-((this.minY + this.maxY)) * 0.5), (-((this.minZ + this.maxZ)) * 0.5));
} else {
x = _arg1[0].x;
y = _arg1[0].y;
z = _arg1[0].z;
};
type = "Lathe";
url = "Extrude";
}
private function defineLines(_arg1:int, _arg2:int, _arg3:Object, _arg4:Object=null, _arg5:Array=null):Object{
var _local6:Object;
var _local7:Object;
var _local8:Object;
var _local9:Object;
var _local10:Object;
var _local11:Point;
var _local12:Point;
_local6 = _arg5[(_arg1 - 1)];
if (_arg4 == null){
return ({pt1:_local6.pt3, pt2:_local6.pt4, pt3:_arg3.pt3, pt4:_arg3.pt4});
};
_local7 = buildObjectLine(_arg3.pt1.x, _arg3.pt1.y, _arg3.pt3.x, _arg3.pt3.y);
_local8 = buildObjectLine(_arg3.pt2.x, _arg3.pt2.y, _arg3.pt4.x, _arg3.pt4.y);
_local9 = buildObjectLine(_arg4.pt1.x, _arg4.pt1.y, _arg4.pt3.x, _arg4.pt3.y);
_local10 = buildObjectLine(_arg4.pt2.x, _arg4.pt2.y, _arg4.pt4.x, _arg4.pt4.y);
_local11 = lineIntersect(_local9, _local7);
_local12 = lineIntersect(_local8, _local10);
if (((!((_local11 == null))) && (!((_local12 == null))))){
if (_arg1 == 0){
return ({pt1:_arg3.pt1, pt2:_arg3.pt2, pt3:_local11, pt4:_local12});
};
return ({pt1:_local6.pt3, pt2:_local6.pt4, pt3:_local11, pt4:_local12});
//unresolved jump
};
return (null);
}
private function defineAnchors(_arg1:Number3D, _arg2:Number3D, _arg3:Number, _arg4:String, _arg5:String):Object{
var _local6:Number;
var _local7:Number;
var _local8:Point;
var _local9:Point;
var _local10:Point;
var _local11:Point;
var _local12:Number;
_local6 = ((Math.atan2((_arg1[_arg5] - _arg2[_arg5]), (_arg1[_arg4] - _arg2[_arg4])) * 180) / Math.PI);
_local6 = (_local6 - 270);
_local7 = (_local6 + 180);
_local8 = new Point(_arg1[_arg4], _arg1[_arg5]);
_local9 = new Point(_arg1[_arg4], _arg1[_arg5]);
_local10 = new Point(_arg2[_arg4], _arg2[_arg5]);
_local11 = new Point(_arg2[_arg4], _arg2[_arg5]);
_local12 = (_arg3 * 0.5);
_local8.x = (_local8.x + (Math.cos(((-(_local6) / 180) * Math.PI)) * _local12));
_local8.y = (_local8.y + (Math.sin(((_local6 / 180) * Math.PI)) * _local12));
_local9.x = (_local9.x + (Math.cos(((-(_local7) / 180) * Math.PI)) * _local12));
_local9.y = (_local9.y + (Math.sin(((_local7 / 180) * Math.PI)) * _local12));
_local10.x = (_local10.x + (Math.cos(((-(_local6) / 180) * Math.PI)) * _local12));
_local10.y = (_local10.y + (Math.sin(((_local6 / 180) * Math.PI)) * _local12));
_local11.x = (_local11.x + (Math.cos(((-(_local7) / 180) * Math.PI)) * _local12));
_local11.y = (_local11.y + (Math.sin(((_local7 / 180) * Math.PI)) * _local12));
return ({pt1:_local8, pt2:_local9, pt3:_local10, pt4:_local11});
}
private function closeTopBottom(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5, _arg6, _arg7:Object, _arg8:Boolean):void{
var _local9:UV;
var _local10:UV;
var _local11:UV;
var _local12:UV;
var _local13:Vertex;
var _local14:Vertex;
var _local15:Vertex;
var _local16:Vertex;
var _local17:int;
var _local18:int;
var _local19:Number;
var _local20:Number;
var _local21:int;
var _local22:int;
var _local23:int;
_local17 = 0;
_local21 = (varr.length - (_arg1 + 1));
_local22 = _arg1;
_local23 = 0;
while (_local23 < _local21) {
if (_local23 != 0){
if (_arg4){
_local19 = (_local23 / _local21);
_local20 = ((_local23 + _local22) / _local21);
_local9 = new UV(0, _local19);
_local10 = new UV(0, _local20);
_local11 = new UV(1, _local20);
_local12 = new UV(1, _local19);
} else {
_local9 = new UV(0, 0);
_local10 = new UV(0, 1);
_local11 = new UV(1, 1);
_local12 = new UV(1, 0);
};
if (_arg7.top){
_local13 = new Vertex(varr[_local23].x, varr[_local23].y, varr[_local23].z);
_local14 = new Vertex(varr[(_local23 + _local22)].x, varr[(_local23 + _local22)].y, varr[(_local23 + _local22)].z);
_local15 = new Vertex(varr2[(_local23 + _local22)].x, varr2[(_local23 + _local22)].y, varr2[(_local23 + _local22)].z);
_local16 = new Vertex(varr2[_local23].x, varr2[_local23].y, varr2[_local23].z);
if (_arg8){
addFace(new Face(_local13, _local14, _local15, _arg5, _local9, _local10, _local11));
addFace(new Face(_local13, _local15, _local16, _arg5, _local9, _local11, _local12));
} else {
addFace(new Face(_local14, _local13, _local15, _arg5, _local10, _local9, _local11));
addFace(new Face(_local15, _local13, _local16, _arg5, _local11, _local9, _local12));
};
};
if (_arg7.bottom){
_local18 = ((_local23 + _local22) - 1);
_local13 = new Vertex(varr[_local18].x, varr[_local18].y, varr[_local18].z);
_local14 = new Vertex(varr[(_local18 + _local22)].x, varr[(_local18 + _local22)].y, varr[(_local18 + _local22)].z);
_local15 = new Vertex(varr2[(_local18 + _local22)].x, varr2[(_local18 + _local22)].y, varr2[(_local18 + _local22)].z);
_local16 = new Vertex(varr2[_local18].x, varr2[_local18].y, varr2[_local18].z);
if (_arg8){
addFace(new Face(_local14, _local13, _local15, _arg6, _local10, _local9, _local11));
addFace(new Face(_local15, _local13, _local16, _arg6, _local11, _local9, _local12));
} else {
addFace(new Face(_local13, _local14, _local15, _arg6, _local9, _local10, _local11));
addFace(new Face(_local13, _local15, _local16, _arg6, _local9, _local11, _local12));
};
};
};
_local17 = (_local17 + _arg1);
_local23 = (_local23 + _local22);
};
}
private function buildObjectLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Object{
return ({ax:_arg1, ay:_arg2, bx:(_arg3 - _arg1), by:(_arg4 - _arg2)});
}
private function closeSides(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5, _arg6, _arg7:Object, _arg8:Boolean):void{
var _local9:UV;
var _local10:UV;
var _local11:UV;
var _local12:UV;
var _local13:Vertex;
var _local14:Vertex;
var _local15:Vertex;
var _local16:Vertex;
var _local17:int;
var _local18:int;
var _local19:Number;
var _local20:Number;
var _local21:int;
_local17 = (varr.length - _arg1);
_local21 = 0;
while (_local21 < (_arg1 - 1)) {
if (_arg4){
_local19 = (_local21 / (_arg1 - 1));
_local20 = ((_local21 + 1) / (_arg1 - 1));
_local9 = new UV(0, _local19);
_local10 = new UV(0, _local20);
_local11 = new UV(1, _local20);
_local12 = new UV(1, _local19);
} else {
_local9 = new UV(0, 0);
_local10 = new UV(0, 1);
_local11 = new UV(1, 1);
_local12 = new UV(1, 0);
};
if (_arg7.left){
_local13 = new Vertex(varr[(_local21 + 1)].x, varr[(_local21 + 1)].y, varr[(_local21 + 1)].z);
_local14 = new Vertex(varr[_local21].x, varr[_local21].y, varr[_local21].z);
_local15 = new Vertex(varr2[_local21].x, varr2[_local21].y, varr2[_local21].z);
_local16 = new Vertex(varr2[(_local21 + 1)].x, varr2[(_local21 + 1)].y, varr2[(_local21 + 1)].z);
if (_arg8){
addFace(new Face(_local13, _local14, _local15, _arg6, _local9, _local10, _local11));
addFace(new Face(_local13, _local15, _local16, _arg6, _local9, _local11, _local12));
} else {
addFace(new Face(_local14, _local13, _local15, _arg6, _local10, _local9, _local11));
addFace(new Face(_local15, _local13, _local16, _arg6, _local11, _local9, _local12));
};
};
if (_arg7.right){
_local18 = (_local17 + _local21);
_local13 = new Vertex(varr[(_local18 + 1)].x, varr[(_local18 + 1)].y, varr[(_local18 + 1)].z);
_local14 = new Vertex(varr[_local18].x, varr[_local18].y, varr[_local18].z);
_local15 = new Vertex(varr2[_local18].x, varr2[_local18].y, varr2[_local18].z);
_local16 = new Vertex(varr2[(_local18 + 1)].x, varr2[(_local18 + 1)].y, varr2[(_local18 + 1)].z);
if (_arg8){
addFace(new Face(_local14, _local13, _local15, _arg5, _local10, _local9, _local11));
addFace(new Face(_local15, _local13, _local16, _arg5, _local11, _local9, _local12));
} else {
addFace(new Face(_local13, _local14, _local15, _arg5, _local9, _local10, _local11));
addFace(new Face(_local13, _local15, _local16, _arg5, _local9, _local11, _local12));
};
};
_local21++;
};
}
private function buildThicknessPoints(_arg1:Array, _arg2:Number, _arg3:String, _arg4:String):Array{
var _local5:Array;
var _local6:Array;
var _local7:int;
var _local8:uint;
var _local9:Object;
_local5 = new Array();
_local6 = new Array();
_local7 = 0;
while (_local7 < (_arg1.length - 1)) {
if ((((_arg1[_local7][_arg3] == 0)) && ((_arg1[_local7][_arg4] == 0)))){
_arg1[_local7][_arg3] = 0.0001;
};
if (((!((_arg1[(_local7 + 1)][_arg4] == null))) && ((_arg1[_local7][_arg4] == _arg1[(_local7 + 1)][_arg4])))){
_arg1[(_local7 + 1)][_arg3] = (_arg1[(_local7 + 1)][_arg3] + 0.0001);
};
if (((!((_arg1[_local7][_arg3] == null))) && ((_arg1[_local7][_arg3] == _arg1[(_local7 + 1)][_arg3])))){
_arg1[(_local7 + 1)][_arg3] = (_arg1[(_local7 + 1)][_arg3] + 0.0001);
};
_local5.push(defineAnchors(_arg1[_local7], _arg1[(_local7 + 1)], _arg2, _arg3, _arg4));
_local7++;
};
_local8 = _local5.length;
if (_local8 > 1){
_local7 = 0;
while (_local7 < _local8) {
if (_local7 < _local8){
_local9 = defineLines(_local7, _local8, _local5[_local7], _local5[(_local7 + 1)], _local6);
} else {
_local9 = defineLines(_local7, _local8, _local5[_local7], _local5[(_local7 - 1)], _local6);
};
_local7++;
};
} else {
_local6 = [{pt1:_local5[0].pt1, pt2:_local5[0].pt2, pt3:_local5[0].pt3, pt4:_local5[0].pt4}];
};
return (_local6);
}
private function lineIntersect(_arg1:Object, _arg2:Object):Point{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_arg1.bx = ((_arg1.bx)==0) ? 0.0001 : _arg1.bx;
_arg2.bx = ((_arg2.bx)==0) ? 0.0001 : _arg2.bx;
_local3 = (_arg1.by / _arg1.bx);
_local4 = (_arg1.ay - (_local3 * _arg1.ax));
_local5 = (_arg2.by / _arg2.bx);
_local6 = (_arg2.ay - (_local5 * _arg2.ax));
_local7 = (((_local3 - _local5))==0) ? 0.0001 : (_local3 - _local5);
_local8 = ((_local6 - _local4) / _local7);
_local9 = ((_local3 * _local8) + _local4);
if (((isFinite(_local8)) && (isFinite(_local9)))){
return (new Point(_local8, _local9));
};
trace("infinity");
return (null);
}
private function generate(_arg1:Array, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Object, _arg7:Boolean, _arg8:Boolean=false, _arg9=null, _arg10:Boolean=true, _arg11:Boolean=false):void{
var _local12:Number;
var _local13:Number;
var _local14:int;
var _local15:int;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Array;
var _local22:Array;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:int;
var _local27:int;
var _local28:int;
var _local29:UV;
var _local30:UV;
var _local31:UV;
var _local32:UV;
var _local33:Vertex;
var _local34:Vertex;
var _local35:Vertex;
var _local36:Vertex;
if (((isNaN(_arg6.x)) || (!(_arg6.x)))){
_arg6.x = 0;
};
if (((isNaN(_arg6.y)) || (!(_arg6.y)))){
_arg6.y = 0;
};
if (((isNaN(_arg6.z)) || (!(_arg6.z)))){
_arg6.z = 0;
};
if (((isNaN(_arg6.radius)) || (!(_arg6.radius)))){
_arg6.radius = 0;
};
_local12 = 0;
_local13 = (360 / _arg5);
_local16 = 0;
_local17 = 0;
_local18 = 0;
_local19 = 0;
_local20 = 0;
_local22 = new Array();
_local14 = 0;
while (_local14 < _arg1.length) {
varr.push(new Vertex(_arg1[_local14].x, _arg1[_local14].y, _arg1[_local14].z));
uvarr.push(new UV(0, (1 % _local14)));
_local14++;
};
_arg3 = -(_arg3);
_local25 = 0;
_local14 = 0;
while (_local14 <= (_arg5 * _arg4)) {
_local21 = new Array();
_local21 = _arg1.concat();
_local15 = 0;
while (_local15 < _local21.length) {
_local25 = ((_arg4 - 1) / (varr.length + 1));
if (_arg6.x != 0){
_local16 = (_local16 + ((_arg6.x * _local25) / _arg4));
};
if (_arg6.y != 0){
_local17 = (_local17 + ((_arg6.y * _local25) / _arg4));
};
if (_arg6.z != 0){
_local18 = (_local18 + ((_arg6.z * _local25) / _arg4));
};
if (_arg6.radius != 0){
_local19 = (_local19 + (_arg6.radius / (varr.length + 1)));
};
if (_arg6.rotation != 0){
_local20 = (_local20 + (360 / (_arg6.rotation * _arg5)));
};
if (_arg2 == "x"){
if (_local14 == 0){
_local22[_local15] = (_arg3 - Math.abs(_local21[_local15].z));
};
_local21[_local15].z = (Math.cos(((-(_local12) / 180) * Math.PI)) * (_local22[_local15] + _local19));
_local21[_local15].y = (Math.sin(((_local12 / 180) * Math.PI)) * (_local22[_local15] + _local19));
if (_local14 == 0){
varr[_local15].z = (varr[_local15].z + _local21[_local15].z);
varr[_local15].y = (varr[_local15].y + _local21[_local15].y);
};
} else {
if (_arg2 == "y"){
if (_local14 == 0){
_local22[_local15] = (_arg3 - Math.abs(_local21[_local15].x));
};
_local21[_local15].x = (Math.cos(((-(_local12) / 180) * Math.PI)) * (_local22[_local15] + _local19));
_local21[_local15].z = (Math.sin(((_local12 / 180) * Math.PI)) * (_local22[_local15] + _local19));
if (_local14 == 0){
varr[_local15].x = _local21[_local15].x;
varr[_local15].z = _local21[_local15].z;
};
} else {
if (_arg2 == "z"){
if (_local14 == 0){
_local22[_local15] = (_arg3 - Math.abs(_local21[_local15].y));
};
_local21[_local15].x = (Math.cos(((-(_local12) / 180) * Math.PI)) * (_local22[_local15] + _local19));
_local21[_local15].y = (Math.sin(((_local12 / 180) * Math.PI)) * (_local22[_local15] + _local19));
if (_local14 == 0){
varr[_local15].x = _local21[_local15].x;
varr[_local15].y = _local21[_local15].y;
};
};
};
};
_local21[_local15].x = (_local21[_local15].x + _local16);
_local21[_local15].y = (_local21[_local15].y + _local17);
_local21[_local15].z = (_local21[_local15].z + _local18);
varr.push(new Vertex(_local21[_local15].x, _local21[_local15].y, _local21[_local15].z));
if (_arg7){
_local23 = (_local12 / (360 * _arg4));
} else {
_local23 = (((_local14 % 2))==0) ? 0 : 1;
};
_local24 = (1 - (_local15 / (_local21.length - 1)));
uvarr.push(new UV(_local23, _local24));
_local15++;
};
_local12 = (_local12 + _local13);
_local14++;
};
if (_arg10){
_local27 = _arg1.length;
_local28 = (varr.length - _arg1.length);
_local14 = 0;
while (_local14 < _local28) {
_local26 = 0;
_local15 = 1;
while (_local15 < _arg1.length) {
if (_local14 > 0){
_local29 = uvarr[(_local14 + (_local26 + 1))];
_local30 = uvarr[(_local14 + _local26)];
_local31 = uvarr[((_local14 + _local26) + _arg1.length)];
_local32 = uvarr[(((_local14 + _local26) + _arg1.length) + 1)];
_local33 = new Vertex(varr[(_local14 + (_local26 + 1))].x, varr[(_local14 + (_local26 + 1))].y, varr[(_local14 + (_local26 + 1))].z);
_local34 = new Vertex(varr[(_local14 + _local26)].x, varr[(_local14 + _local26)].y, varr[(_local14 + _local26)].z);
_local35 = new Vertex(varr[((_local14 + _local26) + _arg1.length)].x, varr[((_local14 + _local26) + _arg1.length)].y, varr[((_local14 + _local26) + _arg1.length)].z);
_local36 = new Vertex(varr[(((_local14 + _local26) + _arg1.length) + 1)].x, varr[(((_local14 + _local26) + _arg1.length) + 1)].y, varr[(((_local14 + _local26) + _arg1.length) + 1)].z);
if (_arg11){
if (_arg8){
addFace(new Face(_local34, _local33, _local35, _arg9, new UV((1 - _local30.u), _local30.v), new UV((1 - _local29.u), _local29.v), new UV((1 - _local31.u), _local31.v)));
addFace(new Face(_local35, _local33, _local36, _arg9, new UV((1 - _local31.u), _local31.v), new UV((1 - _local29.u), _local29.v), new UV((1 - _local32.u), _local32.v)));
} else {
addFace(new Face(_local33, _local34, _local35, _arg9, _local29, _local30, _local31));
addFace(new Face(_local33, _local35, _local36, _arg9, _local29, _local31, _local32));
};
} else {
if (_arg8){
addFace(new Face(_local33, _local34, _local35, _arg9, new UV((1 - _local29.u), _local29.v), new UV((1 - _local30.u), _local30.v), new UV((1 - _local31.u), _local31.v)));
addFace(new Face(_local33, _local35, _local36, _arg9, new UV((1 - _local29.u), _local29.v), new UV((1 - _local31.u), _local31.v), new UV((1 - _local32.u), _local32.v)));
} else {
addFace(new Face(_local34, _local33, _local35, _arg9, _local30, _local29, _local31));
addFace(new Face(_local35, _local33, _local36, _arg9, _local31, _local29, _local32));
};
};
};
_local26++;
_local15++;
};
_local14 = (_local14 + _local27);
};
};
}
private function generateWithThickness(_arg1:Array, _arg2:Array, _arg3:String, _arg4:String, _arg5:String, _arg6:String, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Object, _arg11:Boolean, _arg12:Object=null, _arg13:String="", _arg14:Boolean=false):void{
var _local15:Array;
var _local16:Object;
var _local17:Object;
var _local18:int;
var _local19:int;
var _local20:Object;
var _local21:Object;
var _local22:Object;
var _local23:Object;
var _local24:Array;
var _local25:Array;
var _local26:*;
var _local27:*;
var _local28:*;
var _local29:*;
var _local30:*;
var _local31:*;
_local15 = ["top", "bottom", "right", "left", "front", "back"];
_local16 = {};
_local18 = 0;
while (_local18 < _local15.length) {
_local16[_local15[_local18]] = (_arg13.indexOf(_local15[_local18]) == -1);
_local18++;
};
_local24 = new Array();
_local25 = new Array();
_local18 = 0;
while (_local18 < _arg2.length) {
_local17 = _arg2[_local18];
_local20 = {};
_local21 = {};
if (_local18 == 0){
_local20[_arg4] = _local17.pt2.x.toFixed(4);
_local20[_arg5] = _local17.pt2.y.toFixed(4);
_local20[_arg6] = _arg1[0][_arg6];
_local24.push(new Number3D(_local20.x, _local20.y, _local20.z));
_local21[_arg4] = _local17.pt1.x.toFixed(4);
_local21[_arg5] = _local17.pt1.y.toFixed(4);
_local21[_arg6] = _arg1[0][_arg6];
_local25.push(new Number3D(_local21.x, _local21.y, _local21.z));
if (_arg2.length == 1){
_local22 = {};
_local23 = {};
_local22[_arg4] = _local17.pt4.x.toFixed(4);
_local22[_arg5] = _local17.pt4.y.toFixed(4);
_local22[_arg6] = _arg1[0][_arg6];
_local24.push(new Number3D(_local22.x, _local22.y, _local22.z));
_local23[_arg4] = _local17.pt3.x.toFixed(4);
_local23[_arg5] = _local17.pt3.y.toFixed(4);
_local23[_arg6] = _arg1[0][_arg6];
_local25.push(new Number3D(_local23.x, _local23.y, _local23.z));
};
} else {
if (_local18 == (_arg2.length - 1)){
_local20[_arg4] = (_local17.pt2.x + 10);
_local20[_arg5] = (_local17.pt2.y + 10);
_local20[_arg6] = _arg1[_local18][_arg6];
_local24.push(new Number3D(_local20.x, _local20.y, _local20.z));
_local21[_arg4] = _local17.pt1.x;
_local21[_arg5] = _local17.pt1.y;
_local21[_arg6] = _arg1[_local18][_arg6];
_local25.push(new Number3D(_local21.x, _local21.y, _local21.z));
_local22 = {};
_local23 = {};
_local22[_arg4] = _local17.pt4.x;
_local22[_arg5] = _local17.pt4.y;
_local22[_arg6] = _arg1[_local18][_arg6];
_local24.push(new Number3D(_local22.x, _local22.y, _local22.z));
_local23[_arg4] = _local17.pt3.x;
_local23[_arg5] = _local17.pt3.y;
_local23[_arg6] = _arg1[_local18][_arg6];
_local25.push(new Number3D(_local23.x, _local23.y, _local23.z));
} else {
_local20[_arg4] = _local17.pt2.x;
_local20[_arg5] = _local17.pt2.y;
_local20[_arg6] = _arg1[_local18][_arg6];
_local24.push(new Number3D(_local20.x, _local20.y, _local20.z));
_local21[_arg4] = _local17.pt1.x;
_local21[_arg5] = _local17.pt1.y;
_local21[_arg6] = _arg1[_local18][_arg6];
_local25.push(new Number3D(_local21.x, _local21.y, _local21.z));
};
};
_local18++;
};
if (_arg12 != null){
_local26 = ((_arg12.front)!=null) ? _arg12.front : null;
_local27 = ((_arg12.back)!=null) ? _arg12.back : null;
_local28 = ((_arg12.top)!=null) ? _arg12.top : null;
_local29 = ((_arg12.bottom)!=null) ? _arg12.bottom : null;
_local30 = ((_arg12.right)!=null) ? _arg12.right : null;
_local31 = ((_arg12.left)!=null) ? _arg12.left : null;
};
varr = new Array();
generate(_local24, _arg3, _arg7, _arg8, _arg9, _arg10, _arg11, false, _local26, _local16.front, _arg14);
varr2 = new Array();
varr2 = varr2.concat(varr);
varr = new Array();
generate(_local25, _arg3, _arg7, _arg8, _arg9, _arg10, _arg11, true, _local27, _local16.back, _arg14);
if (_arg8 != 1){
closeSides(_arg1.length, _arg9, _arg8, _arg11, _local30, _local31, _local16, _arg14);
};
closeTopBottom(_arg1.length, _arg9, _arg8, _arg11, _local28, _local29, _local16, _arg14);
}
}
}//package away3d.extrusions
Section 107
//PeteLathe (away3d.extrusions.PeteLathe)
package away3d.extrusions {
import away3d.core.math.*;
import away3d.core.material.*;
import away3d.core.scene.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.stats.*;
import away3d.core.*;
public class PeteLathe extends Mesh {
private var uvarr:Array;
private var varr:Array;
public function PeteLathe(_arg1:Array, _arg2:Object=null){
var _local3:String;
var _local4:Number;
var _local5:int;
var _local6:int;
var _local7:Number;
var _local8:Object;
varr = [];
uvarr = [];
_arg2 = Init.parse(_arg2);
super(_arg2);
_local3 = _arg2.getString("axis", "y");
_local4 = _arg2.getNumber("rotations", 1, {min:0.1});
_local5 = _arg2.getInt("subdivision", 2, {min:2});
_local6 = _arg2.getNumber("offsetradius", 100);
_local7 = _arg2.getNumber("scaling", 1);
_local8 = _arg2.getObject("tweek", null);
if (_arg1.length > 1){
_local8 = ((_local8)==null) ? {x:0, y:0, z:0, radius:0} : _local8;
generate(_arg1, _local3, _local6, _local4, _local5, _local8);
} else {
trace("Lathe error: at least 2 number3D are required!");
};
movePivot((-((this.minX + this.maxX)) * 0.5), (-((this.minY + this.maxY)) * 0.5), (-((this.minZ + this.maxZ)) * 0.5));
}
private function generate(_arg1:Array, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Object):void{
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:int;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Array;
var _local16:Array;
var _local17:Number;
var _local18:Number;
var _local19:int;
var _local20:Number;
var _local21:Number;
var _local22:UV;
var _local23:UV;
var _local24:UV;
var _local25:UV;
var _local26:Vertex;
var _local27:Vertex;
var _local28:Vertex;
var _local29:Vertex;
if (((isNaN(_arg6.x)) || (!(_arg6.x)))){
_arg6.x = 0;
};
if (((isNaN(_arg6.y)) || (!(_arg6.y)))){
_arg6.y = 0;
};
if (((isNaN(_arg6.z)) || (!(_arg6.z)))){
_arg6.z = 0;
};
if (((isNaN(_arg6.radius)) || (!(_arg6.radius)))){
_arg6.radius = 0;
};
_local7 = 0;
_local8 = (360 / _arg5);
_local11 = 0;
_local12 = 0;
_local13 = 0;
_local14 = 0;
_local16 = [];
_local17 = 0;
_local9 = 0;
while (_local9 < _arg1.length) {
varr.push(new Vertex(_arg1[_local9].x, _arg1[_local9].y, _arg1[_local9].z));
uvarr.push(new UV(0, (1 % _local9)));
switch (_arg2){
case "x":
_local17 = Math.max(Math.abs(_arg1[_local9].z), _local17);
break;
case "y":
_local17 = Math.max(Math.abs(_arg1[_local9].x), _local17);
break;
case "z":
_local17 = Math.max(Math.abs(_arg1[_local9].y), _local17);
break;
};
_local9++;
};
_local18 = 0;
_local9 = 1;
while (_local9 <= ((_arg5 * _arg4) + 1)) {
_local15 = [];
_local15 = _arg1.concat();
_local10 = 0;
while (_local10 < _local15.length) {
_local18 = (_arg4 / (varr.length + 1));
if (_arg6.x != 0){
_local11 = (_local11 + ((_arg6.x * _local18) / _arg4));
};
if (_arg6.y != 0){
_local12 = (_local12 + ((_arg6.y * _local18) / _arg4));
};
if (_arg6.z != 0){
_local13 = (_local13 + ((_arg6.z * _local18) / _arg4));
};
if (_arg6.radius != 0){
_local14 = (_local14 + (_arg6.radius / (varr.length + 1)));
};
switch (_arg2){
case "x":
if (_local9 == 1){
_local16[_local10] = (((_arg3 * 0.5) - _local17) - Math.abs(_local15[_local10].z));
};
_local15[_local10].z = (Math.cos(((-(_local7) / 180) * Math.PI)) * ((_local16[_local10] + (_arg3 * 0.5)) + _local14));
_local15[_local10].y = (Math.sin(((_local7 / 180) * Math.PI)) * ((_local16[_local10] + (_arg3 * 0.5)) + _local14));
break;
case "y":
if (_local9 == 1){
_local16[_local10] = (((_arg3 * 0.5) - _local17) - Math.abs(_local15[_local10].x));
};
_local15[_local10].x = (Math.cos(((-(_local7) / 180) * Math.PI)) * ((_local16[_local10] + (_arg3 * 0.5)) + _local14));
_local15[_local10].z = (Math.sin(((_local7 / 180) * Math.PI)) * ((_local16[_local10] + (_arg3 * 0.5)) + _local14));
break;
case "z":
if (_local9 == 1){
_local16[_local10] = (((_arg3 * 0.5) - _local17) - Math.abs(_local15[_local10].y));
};
_local15[_local10].x = (Math.cos(((-(_local7) / 180) * Math.PI)) * ((_local16[_local10] + (_arg3 * 0.5)) + _local14));
_local15[_local10].y = (Math.sin(((_local7 / 180) * Math.PI)) * ((_local16[_local10] + (_arg3 * 0.5)) + _local14));
};
_local15[_local10].x = (_local15[_local10].x + _local11);
_local15[_local10].y = (_local15[_local10].y + _local12);
_local15[_local10].z = (_local15[_local10].z + _local13);
varr.push(new Vertex(_local15[_local10].x, _local15[_local10].y, _local15[_local10].z));
_local20 = ((1 / 360) * (_local7 % 360));
_local21 = ((_local10)==0) ? 0 : (1 / _local10);
uvarr.push(new UV(_local20, _local21));
_local10++;
};
_local7 = (_local7 + _local8);
_local9++;
};
_local9 = 0;
while (_local9 < (varr.length - _arg1.length)) {
_local19 = 0;
_local10 = 1;
while (_local10 < _arg1.length) {
if (_local9 > 0){
_local22 = uvarr[(_local9 + (_local19 + 1))];
_local23 = uvarr[(_local9 + _local19)];
_local24 = uvarr[((_local9 + _local19) + _arg1.length)];
_local25 = uvarr[(((_local9 + _local19) + _arg1.length) + 1)];
_local26 = new Vertex(varr[(_local9 + (_local19 + 1))].x, varr[(_local9 + (_local19 + 1))].y, varr[(_local9 + (_local19 + 1))].z);
_local27 = new Vertex(varr[(_local9 + _local19)].x, varr[(_local9 + _local19)].y, varr[(_local9 + _local19)].z);
_local28 = new Vertex(varr[((_local9 + _local19) + _arg1.length)].x, varr[((_local9 + _local19) + _arg1.length)].y, varr[((_local9 + _local19) + _arg1.length)].z);
_local29 = new Vertex(varr[(((_local9 + _local19) + _arg1.length) + 1)].x, varr[(((_local9 + _local19) + _arg1.length) + 1)].y, varr[(((_local9 + _local19) + _arg1.length) + 1)].z);
addFace(new Face(_local26, _local27, _local28, null, _local22, _local23, _local24));
addFace(new Face(_local26, _local28, _local29, null, _local22, _local24, _local25));
};
_local19++;
_local10++;
};
_local9 = (_local9 + _arg1.length);
};
}
}
}//package away3d.extrusions
Section 108
//SegmentsExtrude (away3d.extrusions.SegmentsExtrude)
package away3d.extrusions {
import away3d.core.math.*;
import away3d.core.material.*;
import away3d.core.scene.*;
import flash.geom.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.*;
public class SegmentsExtrude extends Mesh {
private var uvarr:Array;
private var varr:Array;
private var varr2:Array;
public function SegmentsExtrude(_arg1, _arg2:Object=null){
var _local3:String;
var _local4:Number;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:Boolean;
var _local9:Number;
var _local10:Object;
var _local11:String;
var _local12:Boolean;
var _local13:Boolean;
var _local14:Boolean;
var _local15:int;
var _local16:Boolean;
varr = new Array();
varr2 = new Array();
uvarr = new Array();
if (_arg2.material != null){
_arg2.materials = {defaultmaterial:_arg2.material};
};
if ((((_arg2.material == null)) && (!((_arg2.materials == null))))){
_arg2.material = _arg2.materials.defaultmaterial;
};
_arg2 = Init.parse(_arg2);
super(_arg2);
_local3 = _arg2.getString("axis", "y");
_local4 = _arg2.getNumber("offset", 10);
_local5 = _arg2.getInt("subdivision", 1, {min:1});
_local6 = Math.abs(_arg2.getNumber("thickness", 0));
_local7 = _arg2.getInt("thickness_subdivision", 1, {min:1});
_local8 = _arg2.getBoolean("flip", false);
_local9 = _arg2.getNumber("scaling", 1);
_local10 = _arg2.getObject("materials", null);
_local11 = _arg2.getString("omit", "");
_local12 = _arg2.getBoolean("coverall", false);
_local13 = _arg2.getBoolean("recenter", false);
_local14 = _arg2.getBoolean("closepath", false);
if (_local14){
_local11 = (_local11 + "left,right");
};
if ((_arg1[0] is Array)){
_local15 = 0;
while (_local15 < _arg1.length) {
if (_arg1[_local15].length > 1){
varr = new Array();
varr2 = new Array();
uvarr = new Array();
generate(_arg1[_local15], _local10, _local3, _local4, _local5, _local6, _local7, _local9, _local11, _local12, _local14, _local8);
} else {
throw (new Error((("SegmentsExtrude error: at index " + _local15) + " , at least 2 points are required per extrude!")));
};
_local15++;
};
} else {
if (_local14){
_arg1.push(new Number3D(_arg1[0].x, _arg1[0].y, _arg1[0].z));
};
if (_arg1.length > 1){
generate(_arg1, _local10, _local3, _local4, _local5, _local6, _local7, _local9, _local11, _local12, _local14, _local8);
} else {
throw (new Error("SegmentsExtrude error: at least 2 points in an array are required per extrude!"));
};
};
if (_local13){
movePivot((-((this.minX + this.maxX)) * 0.5), (-((this.minY + this.maxY)) * 0.5), (-((this.minZ + this.maxZ)) * 0.5));
} else {
_local16 = (_arg1[0] is Array);
x = (_local16) ? _arg1[0][0].x : _arg1[0].x;
y = (_local16) ? _arg1[0][0].y : _arg1[0].y;
z = (_local16) ? _arg1[0][0].z : _arg1[0].z;
};
varr = null;
varr2 = null;
uvarr = null;
type = "SegmentsExtrude";
url = "Extrude";
}
private function defineLines(_arg1:int, _arg2:int, _arg3:Object, _arg4:Object=null, _arg5:Array=null):Object{
var _local6:Object;
var _local7:Object;
var _local8:Object;
var _local9:Object;
var _local10:Object;
var _local11:Point;
var _local12:Point;
_local6 = _arg5[(_arg1 - 1)];
if (_arg4 == null){
return ({pt1:_local6.pt3, pt2:_local6.pt4, pt3:_arg3.pt3, pt4:_arg3.pt4});
};
_local7 = buildObjectLine(_arg3.pt1.x, _arg3.pt1.y, _arg3.pt3.x, _arg3.pt3.y);
_local8 = buildObjectLine(_arg3.pt2.x, _arg3.pt2.y, _arg3.pt4.x, _arg3.pt4.y);
_local9 = buildObjectLine(_arg4.pt1.x, _arg4.pt1.y, _arg4.pt3.x, _arg4.pt3.y);
_local10 = buildObjectLine(_arg4.pt2.x, _arg4.pt2.y, _arg4.pt4.x, _arg4.pt4.y);
_local11 = lineIntersect(_local9, _local7);
_local12 = lineIntersect(_local8, _local10);
if (((!((_local11 == null))) && (!((_local12 == null))))){
if (_arg1 == 0){
return ({pt1:_arg3.pt1, pt2:_arg3.pt2, pt3:_local11, pt4:_local12});
};
return ({pt1:_local6.pt3, pt2:_local6.pt4, pt3:_local11, pt4:_local12});
//unresolved jump
};
return (null);
}
private function defineAnchors(_arg1:Number3D, _arg2:Number3D, _arg3:Number, _arg4:String, _arg5:String):Object{
var _local6:Number;
var _local7:Number;
var _local8:Point;
var _local9:Point;
var _local10:Point;
var _local11:Point;
var _local12:Number;
_local6 = ((Math.atan2((_arg1[_arg5] - _arg2[_arg5]), (_arg1[_arg4] - _arg2[_arg4])) * 180) / Math.PI);
_local6 = (_local6 - 270);
_local7 = (_local6 + 180);
_local8 = new Point(_arg1[_arg4], _arg1[_arg5]);
_local9 = new Point(_arg1[_arg4], _arg1[_arg5]);
_local10 = new Point(_arg2[_arg4], _arg2[_arg5]);
_local11 = new Point(_arg2[_arg4], _arg2[_arg5]);
_local12 = (_arg3 * 0.5);
_local8.x = (_local8.x + (Math.cos(((-(_local6) / 180) * Math.PI)) * _local12));
_local8.y = (_local8.y + (Math.sin(((_local6 / 180) * Math.PI)) * _local12));
_local9.x = (_local9.x + (Math.cos(((-(_local7) / 180) * Math.PI)) * _local12));
_local9.y = (_local9.y + (Math.sin(((_local7 / 180) * Math.PI)) * _local12));
_local10.x = (_local10.x + (Math.cos(((-(_local6) / 180) * Math.PI)) * _local12));
_local10.y = (_local10.y + (Math.sin(((_local6 / 180) * Math.PI)) * _local12));
_local11.x = (_local11.x + (Math.cos(((-(_local7) / 180) * Math.PI)) * _local12));
_local11.y = (_local11.y + (Math.sin(((_local7 / 180) * Math.PI)) * _local12));
return ({pt1:_local8, pt2:_local9, pt3:_local10, pt4:_local11});
}
private function buildObjectLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Object{
return ({ax:_arg1, ay:_arg2, bx:(_arg3 - _arg1), by:(_arg4 - _arg2)});
}
private function addThicknessSubdivision(_arg1:Array, _arg2:Array, _arg3:int, _arg4:Number, _arg5:Number, _arg6=null, _arg7:Boolean=false):void{
var _local8:int;
var _local9:int;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:UV;
var _local14:UV;
var _local15:UV;
var _local16:UV;
var _local17:Vertex;
var _local18:Vertex;
var _local19:Vertex;
var _local20:Vertex;
var _local21:int;
var _local22:Number;
var _local23:Number;
var _local24:Array;
_local21 = 0;
_local22 = 0;
_local23 = 0;
_local24 = new Array();
_local8 = 0;
while (_local8 < _arg1.length) {
_local10 = ((_arg2[_local8].x - _arg1[_local8].x) / _arg3);
_local11 = ((_arg2[_local8].y - _arg1[_local8].y) / _arg3);
_local12 = ((_arg2[_local8].z - _arg1[_local8].z) / _arg3);
_local9 = 0;
while (_local9 < (_arg3 + 1)) {
_local24.push(new Vertex((_arg1[_local8].x + (_local10 * _local9)), (_arg1[_local8].y + (_local11 * _local9)), (_arg1[_local8].z + (_local12 * _local9))));
_local9++;
};
_local8++;
};
_local8 = 0;
while (_local8 < (_arg1.length - 1)) {
_local9 = 0;
while (_local9 < _arg3) {
_local22 = (_local9 / _arg3);
_local23 = ((_local9 + 1) / _arg3);
_local13 = new UV(_arg4, _local22);
_local14 = new UV(_arg4, _local23);
_local15 = new UV(_arg5, _local23);
_local16 = new UV(_arg5, _local22);
_local17 = _local24[(_local21 + _local9)];
_local18 = _local24[((_local21 + _local9) + 1)];
_local19 = _local24[((_local21 + _local9) + (_arg3 + 2))];
_local20 = _local24[((_local21 + _local9) + (_arg3 + 1))];
if (_arg7){
addFace(new Face(_local18, _local17, _local19, ((_arg6)==null) ? null : _arg6, _local14, _local13, _local15));
addFace(new Face(_local19, _local17, _local20, ((_arg6)==null) ? null : _arg6, _local15, _local13, _local16));
} else {
addFace(new Face(_local17, _local18, _local19, ((_arg6)==null) ? null : _arg6, _local13, _local14, _local15));
addFace(new Face(_local17, _local19, _local20, ((_arg6)==null) ? null : _arg6, _local13, _local15, _local16));
};
_local9++;
};
_local21 = (_local21 + (_arg3 + 1));
_local8++;
};
}
private function buildThicknessPoints(_arg1:Array, _arg2:Number, _arg3:String, _arg4:String, _arg5:Boolean):Array{
var _local6:Array;
var _local7:Array;
var _local8:int;
var _local9:int;
var _local10:Object;
var _local11:Array;
var _local12:Array;
_local6 = new Array();
_local7 = new Array();
_local8 = 0;
while (_local8 < (_arg1.length - 1)) {
if ((((_arg1[_local8][_arg3] == 0)) && ((_arg1[_local8][_arg4] == 0)))){
_arg1[_local8][_arg3] = 0.0001;
};
if (((!((_arg1[(_local8 + 1)][_arg4] == null))) && ((_arg1[_local8][_arg4] == _arg1[(_local8 + 1)][_arg4])))){
_arg1[(_local8 + 1)][_arg4] = (_arg1[(_local8 + 1)][_arg4] + 0.0001);
};
if (((!((_arg1[_local8][_arg3] == null))) && ((_arg1[_local8][_arg3] == _arg1[(_local8 + 1)][_arg3])))){
_arg1[(_local8 + 1)][_arg3] = (_arg1[(_local8 + 1)][_arg3] + 0.0001);
};
_local6.push(defineAnchors(_arg1[_local8], _arg1[(_local8 + 1)], _arg2, _arg3, _arg4));
_local8++;
};
_local9 = _local6.length;
if (_local9 > 1){
_local8 = 0;
while (_local8 < _local9) {
if (_local8 < _local9){
_local10 = defineLines(_local8, _local9, _local6[_local8], _local6[(_local8 + 1)], _local7);
} else {
_local10 = defineLines(_local8, _local9, _local6[_local8], _local6[(_local8 - 1)], _local7);
};
if (_local10 != null){
_local7.push(_local10);
};
_local8++;
};
if (((_arg5) && ((_local6.length > 2)))){
_local6.push(defineAnchors(_arg1[(_local6.length - 1)], _arg1[0], _arg2, _arg3, _arg4));
_local11 = [_local6[(_local6.length - 1)], _local6[0], _local6[1], _local6[2]];
_local12 = new Array();
_local8 = 0;
while (_local8 < 2) {
_local10 = defineLines(_local8, _local9, _local11[_local8], _local11[(_local8 + 1)], _local11);
if (_local10 != null){
_local12.push(_local10);
};
_local8++;
};
_local7[0].pt1 = _local12[0].pt3;
_local7[0].pt2 = _local12[0].pt4;
_local7[0].pt3 = _local12[1].pt1;
_local7[0].pt4 = _local12[1].pt2;
_local7[(_local7.length - 1)].pt3 = _local12[0].pt3;
_local7[(_local7.length - 1)].pt4 = _local12[0].pt4;
};
} else {
_local7 = [{pt1:_local6[0].pt1, pt2:_local6[0].pt2, pt3:_local6[0].pt3, pt4:_local6[0].pt4}];
};
return (_local7);
}
private function lineIntersect(_arg1:Object, _arg2:Object):Point{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_arg1.bx = ((_arg1.bx)==0) ? 0.0001 : _arg1.bx;
_arg2.bx = ((_arg2.bx)==0) ? 0.0001 : _arg2.bx;
_local3 = (_arg1.by / _arg1.bx);
_local4 = (_arg1.ay - (_local3 * _arg1.ax));
_local5 = (_arg2.by / _arg2.bx);
_local6 = (_arg2.ay - (_local5 * _arg2.ax));
_local7 = (((_local3 - _local5))==0) ? 0.0001 : (_local3 - _local5);
_local8 = ((_local6 - _local4) / _local7);
_local9 = ((_local3 * _local8) + _local4);
if (((isFinite(_local8)) && (isFinite(_local9)))){
return (new Point(_local8, _local9));
};
trace("infinity");
return (null);
}
private function generate(_arg1:Array, _arg2:Object=null, _arg3:String="y", _arg4:Number=0, _arg5:int=1, _arg6:Number=0, _arg7:int=1, _arg8:Number=1, _arg9:String="", _arg10:Boolean=false, _arg11:Boolean=false, _arg12:Boolean=false):void{
var _local13:int;
var _local14:int;
var _local15:Object;
var _local16:Object;
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:Array;
var _local28:String;
var _local29:String;
var _local30:String;
var _local31:Array;
var _local32:int;
var _local33:int;
var _local34:Array;
var _local35:UV;
var _local36:UV;
var _local37:UV;
var _local38:UV;
var _local39:Object;
var _local40:Object;
var _local41:Object;
var _local42:Object;
var _local43:Object;
var _local44:*;
var _local45:*;
var _local46:*;
var _local47:*;
var _local48:*;
var _local49:*;
var _local50:Number;
var _local51:Number;
var _local52:Vertex;
var _local53:Vertex;
var _local54:Vertex;
var _local55:Vertex;
var _local56:Vertex;
var _local57:Vertex;
var _local58:Vertex;
var _local59:Vertex;
var _local60:Vertex;
var _local61:Vertex;
var _local62:Vertex;
var _local63:Vertex;
_local17 = ((_arg5)==1) ? _arg4 : (_arg4 / _arg5);
_local18 = _arg1[0].x;
_local19 = _arg1[0].x;
_local20 = _arg1[0].y;
_local21 = _arg1[0].y;
_local22 = _arg1[0].z;
_local23 = _arg1[0].z;
_local13 = 0;
while (_local13 < _arg1.length) {
if (_arg8 != 1){
_arg1[_local13].x = (_arg1[_local13].x * _arg8);
_arg1[_local13].y = (_arg1[_local13].y * _arg8);
_arg1[_local13].z = (_arg1[_local13].z * _arg8);
};
_local18 = Math.max(_arg1[_local13].x, _local18);
_local19 = Math.min(_arg1[_local13].x, _local19);
_local20 = Math.max(_arg1[_local13].y, _local20);
_local21 = Math.min(_arg1[_local13].y, _local21);
_local22 = Math.max(_arg1[_local13].z, _local22);
_local23 = Math.min(_arg1[_local13].z, _local23);
_local13++;
};
_local26 = 0;
switch (_arg3){
case "x":
_local24 = (Math.abs(_local18) - Math.abs(_local19));
if ((((_local23 > 0)) && ((_local22 > 0)))){
_local25 = (_local22 - _local23);
_local26 = -(_local23);
} else {
if ((((_local23 < 0)) && ((_local22 < 0)))){
_local25 = Math.abs((_local23 - _local22));
_local26 = -(_local23);
} else {
_local25 = (Math.abs(_local22) + Math.abs(_local23));
_local26 = (Math.abs(_local23) + ((_local22)<0) ? -(_local22) : 0);
};
};
break;
case "y":
_local24 = (Math.abs(_local20) - Math.abs(_local21));
if ((((_local19 > 0)) && ((_local18 > 0)))){
_local25 = (_local18 - _local19);
_local26 = -(_local19);
} else {
if ((((_local19 < 0)) && ((_local18 < 0)))){
_local25 = Math.abs((_local19 - _local18));
_local26 = -(_local19);
} else {
_local25 = (Math.abs(_local18) + Math.abs(_local19));
_local26 = (Math.abs(_local19) + ((_local18)<0) ? -(_local18) : 0);
};
};
break;
case "z":
_local24 = (Math.abs(_local22) - Math.abs(_local23));
if ((((_local21 > 0)) && ((_local20 > 0)))){
_local25 = (_local20 - _local21);
_local26 = -(_local21);
} else {
if ((((_local21 < 0)) && ((_local20 < 0)))){
_local25 = Math.abs((_local21 - _local20));
_local26 = -(_local21);
} else {
_local25 = (Math.abs(_local20) + Math.abs(_local21));
_local26 = (Math.abs(_local21) + ((_local20)<0) ? -(_local20) : 0);
};
};
break;
};
_local31 = ["top", "bottom", "right", "left", "front", "back"];
if (_arg6 != 0){
_local39 = {};
_local13 = 0;
while (_local13 < _local31.length) {
_local39[_local31[_local13]] = (_arg9.indexOf(_local31[_local13]) == -1);
_local13++;
};
switch (_arg3){
case "x":
_local28 = "z";
_local29 = "y";
_local30 = "x";
break;
case "y":
_local28 = "x";
_local29 = "z";
_local30 = "y";
break;
case "z":
_local28 = "y";
_local29 = "x";
_local30 = "z";
};
_local27 = buildThicknessPoints(_arg1, _arg6, _local28, _local29, _arg11);
_local13 = 0;
while (_local13 < _local27.length) {
_local40 = _local27[_local13];
_local15 = {};
_local16 = {};
if (_local13 == 0){
_local15[_local28] = _local40.pt2.x.toFixed(4);
_local15[_local29] = _local40.pt2.y.toFixed(4);
_local15[_local30] = _arg1[0][_local30];
varr.push(new Vertex(_local15.x, _local15.y, _local15.z));
_local16[_local28] = _local40.pt1.x.toFixed(4);
_local16[_local29] = _local40.pt1.y.toFixed(4);
_local16[_local30] = _arg1[0][_local30];
varr2.push(new Vertex(_local16.x, _local16.y, _local16.z));
elevate(_arg5, _arg3, _local15, _local16, _local25, _local24, _local17);
if (_local27.length == 1){
_local42 = {};
_local43 = {};
_local42[_local28] = _local40.pt4.x.toFixed(4);
_local42[_local29] = _local40.pt4.y.toFixed(4);
_local42[_local30] = _arg1[0][_local30];
varr.push(new Vertex(_local42.x, _local42.y, _local42.z));
_local43[_local28] = _local40.pt3.x.toFixed(4);
_local43[_local29] = _local40.pt3.y.toFixed(4);
_local43[_local30] = _arg1[0][_local30];
varr2.push(new Vertex(_local43.x, _local43.y, _local43.z));
elevate(_arg5, _arg3, _local42, _local43, _local25, _local24, _local17);
};
} else {
if (_local13 == (_local27.length - 1)){
_local15[_local28] = (_local40.pt2.x + 10);
_local15[_local29] = (_local40.pt2.y + 10);
_local15[_local30] = _arg1[_local13][_local30];
varr.push(new Vertex(_local15.x, _local15.y, _local15.z));
_local16[_local28] = _local40.pt1.x;
_local16[_local29] = _local40.pt1.y;
_local16[_local30] = _arg1[_local13][_local30];
varr2.push(new Vertex(_local16.x, _local16.y, _local16.z));
elevate(_arg5, _arg3, _local15, _local16, _local25, _local24, _local17);
_local42 = {};
_local43 = {};
_local42[_local28] = _local40.pt4.x;
_local42[_local29] = _local40.pt4.y;
_local42[_local30] = _arg1[_local13][_local30];
varr.push(new Vertex(_local42.x, _local42.y, _local42.z));
_local43[_local28] = _local40.pt3.x;
_local43[_local29] = _local40.pt3.y;
_local43[_local30] = _arg1[_local13][_local30];
varr2.push(new Vertex(_local43.x, _local43.y, _local43.z));
elevate(_arg5, _arg3, _local42, _local43, _local25, _local24, _local17);
} else {
_local15[_local28] = _local40.pt2.x;
_local15[_local29] = _local40.pt2.y;
_local15[_local30] = _arg1[_local13][_local30];
varr.push(new Vertex(_local15.x, _local15.y, _local15.z));
_local16[_local28] = _local40.pt1.x;
_local16[_local29] = _local40.pt1.y;
_local16[_local30] = _arg1[_local13][_local30];
varr2.push(new Vertex(_local16.x, _local16.y, _local16.z));
elevate(_arg5, _arg3, _local15, _local16, _local25, _local24, _local17);
};
};
_local13++;
};
} else {
_local13 = 0;
while (_local13 < _arg1.length) {
_local15 = {x:_arg1[_local13].x, y:_arg1[_local13].y, z:_arg1[_local13].z};
varr.push(new Vertex(_local15.x, _local15.y, _local15.z));
switch (_arg3){
case "x":
uvarr.push(new UV(Math.abs((_local15.z % _local25)), (_local15.x % _local24)));
break;
case "y":
uvarr.push(new UV(Math.abs((_local15.x % _local25)), (_local15.y % _local24)));
break;
case "z":
uvarr.push(new UV(Math.abs((_local15.y % _local25)), (_local15.z % _local24)));
break;
};
_local14 = 0;
while (_local14 < _arg5) {
_local15[_arg3] = (_local15[_arg3] + _local17);
switch (_arg3){
case "x":
uvarr.push(new UV(Math.abs((_local15.z % _local25)), (_local15.x % _local24)));
break;
case "y":
uvarr.push(new UV(Math.abs((_local15.x % _local25)), (_local15.y % _local24)));
break;
case "z":
uvarr.push(new UV(Math.abs((_local15.y % _local25)), (_local15.z % _local24)));
break;
};
varr.push(new Vertex(_local15.x, _local15.y, _local15.z));
_local14++;
};
_local13++;
};
};
switch (_arg3){
case "x":
_arg3 = "z";
break;
case "y":
_arg3 = "x";
break;
case "z":
_arg3 = "y";
};
_local32 = 0;
_local34 = ["x", "y", "z"];
if (_arg6 != 0){
if (_arg2 != null){
_local44 = ((_arg2.front)!=null) ? _arg2.front : null;
_local45 = ((_arg2.back)!=null) ? _arg2.back : null;
_local46 = ((_arg2.top)!=null) ? _arg2.top : null;
_local47 = ((_arg2.bottom)!=null) ? _arg2.bottom : null;
_local48 = ((_arg2.right)!=null) ? _arg2.right : null;
_local49 = ((_arg2.left)!=null) ? _arg2.left : null;
};
};
_local13 = 0;
while (_local13 < (_arg1.length - 1)) {
_local50 = ((Math.abs((_arg1[_local13][_arg3] + _local26)) / _local25) / 1);
_local51 = ((Math.abs((_arg1[(_local13 + 1)][_arg3] + _local26)) / _local25) / 1);
_local14 = 0;
while (_local14 < _arg5) {
if (_arg10){
_local35 = new UV(_local50, (_local14 / _arg5));
_local36 = new UV(_local50, ((_local14 + 1) / _arg5));
_local37 = new UV(_local51, ((_local14 + 1) / _arg5));
_local38 = new UV(_local51, (_local14 / _arg5));
} else {
_local35 = new UV(0, (_local14 / _arg5));
_local36 = new UV(0, ((_local14 + 1) / _arg5));
_local37 = new UV(1, ((_local14 + 1) / _arg5));
_local38 = new UV(1, (_local14 / _arg5));
};
if (_arg6 == 0){
if (_arg12){
addFace(new Face(varr[((_local32 + _local14) + 1)], varr[(_local32 + _local14)], varr[((_local32 + _local14) + (_arg5 + 2))], null, _local36, _local35, _local37));
addFace(new Face(varr[((_local32 + _local14) + (_arg5 + 2))], varr[(_local32 + _local14)], varr[((_local32 + _local14) + (_arg5 + 1))], null, _local37, _local35, _local38));
} else {
addFace(new Face(varr[(_local32 + _local14)], varr[((_local32 + _local14) + 1)], varr[((_local32 + _local14) + (_arg5 + 2))], null, _local35, _local36, _local37));
addFace(new Face(varr[(_local32 + _local14)], varr[((_local32 + _local14) + (_arg5 + 2))], varr[((_local32 + _local14) + (_arg5 + 1))], null, _local35, _local37, _local38));
};
} else {
_local52 = varr[(_local32 + _local14)];
_local53 = varr[((_local32 + _local14) + 1)];
_local54 = varr[((_local32 + _local14) + (_arg5 + 2))];
_local55 = varr[(_local32 + _local14)];
_local56 = varr[((_local32 + _local14) + (_arg5 + 2))];
_local57 = varr[((_local32 + _local14) + (_arg5 + 1))];
_local58 = varr2[(_local32 + _local14)];
_local59 = varr2[((_local32 + _local14) + 1)];
_local60 = varr2[((_local32 + _local14) + (_arg5 + 2))];
_local61 = varr2[(_local32 + _local14)];
_local62 = varr2[((_local32 + _local14) + (_arg5 + 2))];
_local63 = varr2[((_local32 + _local14) + (_arg5 + 1))];
if (_local39.front){
if (_arg12){
addFace(new Face(_local53, _local52, _local54, _local44, new UV((1 - _local36.u), _local36.v), new UV((1 - _local35.u), _local35.v), new UV((1 - _local37.u), _local37.v)));
addFace(new Face(_local56, _local55, _local57, _local44, new UV((1 - _local37.u), _local37.v), new UV((1 - _local35.u), _local35.v), new UV((1 - _local38.u), _local38.v)));
} else {
addFace(new Face(_local52, _local53, _local54, _local44, new UV((1 - _local35.u), _local35.v), new UV((1 - _local36.u), _local36.v), new UV((1 - _local37.u), _local37.v)));
addFace(new Face(_local55, _local56, _local57, _local44, new UV((1 - _local35.u), _local35.v), new UV((1 - _local37.u), _local37.v), new UV((1 - _local38.u), _local38.v)));
};
};
if (_local39.back){
if (_arg12){
addFace(new Face(_local59, _local63, _local58, _local45, _local36, _local38, _local35));
addFace(new Face(_local62, _local63, _local59, _local45, _local37, _local38, _local36));
} else {
addFace(new Face(_local63, _local59, _local58, _local45, _local38, _local36, _local35));
addFace(new Face(_local63, _local62, _local59, _local45, _local38, _local37, _local36));
};
};
if ((((_local14 == 0)) && (_local39.bottom))){
addThicknessSubdivision([_local57, _local52], [_local63, _local58], _arg7, _local38.u, _local36.u, _local46, _arg12);
};
if ((((_local14 == (_arg5 - 1))) && (_local39.top))){
addThicknessSubdivision([_local53, _local54], [_local59, _local60], _arg7, (1 - _local35.u), (1 - _local37.u), _local46, _arg12);
};
if ((((_local13 == 0)) && (_local39.left))){
if (_arg12){
addFace(new Face(_local59, _local58, _local53, _local48, new UV((1 - _local36.u), _local36.v), new UV((1 - _local35.u), _local35.v), new UV((1 - _local37.u), _local37.v)));
addFace(new Face(_local53, _local58, _local52, _local48, new UV((1 - _local37.u), _local37.v), new UV((1 - _local35.u), _local35.v), new UV((1 - _local38.u), _local38.v)));
} else {
addFace(new Face(_local58, _local59, _local53, _local48, new UV((1 - _local35.u), _local35.v), new UV((1 - _local36.u), _local36.v), new UV((1 - _local37.u), _local37.v)));
addFace(new Face(_local58, _local53, _local52, _local48, new UV((1 - _local35.u), _local35.v), new UV((1 - _local37.u), _local37.v), new UV((1 - _local38.u), _local38.v)));
};
};
if ((((_local13 == (_arg1.length - 2))) && (_local39.right))){
if (_arg12){
addFace(new Face(_local56, _local57, _local60, _local49, new UV((1 - _local36.u), _local36.v), new UV((1 - _local35.u), _local35.v), new UV((1 - _local37.u), _local37.v)));
addFace(new Face(_local60, _local57, _local63, _local49, new UV((1 - _local37.u), _local37.v), new UV((1 - _local35.u), _local35.v), new UV((1 - _local38.u), _local38.v)));
} else {
addFace(new Face(_local57, _local56, _local60, _local49, new UV((1 - _local35.u), _local35.v), new UV((1 - _local36.u), _local36.v), new UV((1 - _local37.u), _local37.v)));
addFace(new Face(_local57, _local60, _local63, _local49, new UV((1 - _local35.u), _local35.v), new UV((1 - _local37.u), _local37.v), new UV((1 - _local38.u), _local38.v)));
};
};
};
_local14++;
};
_local32 = (_local32 + (_arg5 + 1));
_local13++;
};
}
private function elevate(_arg1:int, _arg2:String, _arg3:Object, _arg4:Object, _arg5:Number, _arg6:Number, _arg7:Number):void{
var _local8:int;
switch (_arg2){
case "x":
uvarr.push(new UV(Math.abs((_arg3.z % _arg5)), (_arg3.x % _arg6)));
break;
case "y":
uvarr.push(new UV(Math.abs((_arg3.x % _arg5)), (_arg3.y % _arg6)));
break;
case "z":
uvarr.push(new UV(Math.abs((_arg3.y % _arg5)), (_arg3.z % _arg6)));
break;
};
_local8 = 0;
while (_local8 < _arg1) {
_arg3[_arg2] = (_arg3[_arg2] + _arg7);
_arg4[_arg2] = (_arg4[_arg2] + _arg7);
switch (_arg2){
case "x":
uvarr.push(new UV(Math.abs((_arg3.z % _arg5)), (_arg3.x % _arg6)));
break;
case "y":
uvarr.push(new UV(Math.abs((_arg3.x % _arg5)), (_arg3.y % _arg6)));
break;
case "z":
uvarr.push(new UV(Math.abs((_arg3.y % _arg5)), (_arg3.z % _arg6)));
break;
};
varr.push(new Vertex(_arg3.x, _arg3.y, _arg3.z));
varr2.push(new Vertex(_arg4.x, _arg4.y, _arg4.z));
_local8++;
};
}
}
}//package away3d.extrusions
Section 109
//Plane (away3d.objects.Plane)
package away3d.objects {
import away3d.core.math.*;
import away3d.core.material.*;
import away3d.core.scene.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.stats.*;
import away3d.core.*;
public class Plane extends Mesh {
private var grid:Array;
public function Plane(_arg1:Object=null){
var _local2:Number;
var _local3:Number;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:IUVMaterial;
super(_arg1);
_arg1 = Init.parse(_arg1);
_local2 = _arg1.getNumber("width", 0, {min:0});
_local3 = _arg1.getNumber("height", 0, {min:0});
_local4 = _arg1.getInt("segments", 1, {min:1});
_local5 = _arg1.getInt("segmentsW", _local4, {min:1});
_local6 = _arg1.getInt("segmentsH", _local4, {min:1});
if ((_local2 * _local3) == 0){
if ((material is IUVMaterial)){
_local7 = (material as IUVMaterial);
if (_local2 == 0){
_local2 = _local7.width;
};
if (_local3 == 0){
_local3 = _local7.height;
};
} else {
_local2 = 100;
_local3 = 100;
};
};
buildPlane(_local2, _local3, _local5, _local6);
}
private function buildPlane(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int):void{
var _local5:int;
var _local6:int;
var _local7:Vertex;
var _local8:Vertex;
var _local9:Vertex;
var _local10:Vertex;
var _local11:UV;
var _local12:UV;
var _local13:UV;
var _local14:UV;
grid = new Array((_arg3 + 1));
_local5 = 0;
while (_local5 <= _arg3) {
grid[_local5] = new Array((_arg4 + 1));
_local6 = 0;
while (_local6 <= _arg4) {
grid[_local5][_local6] = new Vertex((((_local5 / _arg3) - 0.5) * _arg1), 0, (((_local6 / _arg4) - 0.5) * _arg2));
_local6++;
};
_local5++;
};
_local5 = 0;
while (_local5 < _arg3) {
_local6 = 0;
while (_local6 < _arg4) {
_local7 = grid[_local5][_local6];
_local8 = grid[(_local5 + 1)][_local6];
_local9 = grid[_local5][(_local6 + 1)];
_local10 = grid[(_local5 + 1)][(_local6 + 1)];
_local11 = new UV((_local5 / _arg3), (_local6 / _arg4));
_local12 = new UV(((_local5 + 1) / _arg3), (_local6 / _arg4));
_local13 = new UV((_local5 / _arg3), ((_local6 + 1) / _arg4));
_local14 = new UV(((_local5 + 1) / _arg3), ((_local6 + 1) / _arg4));
addFace(new Face(_local7, _local8, _local9, null, _local11, _local12, _local13));
addFace(new Face(_local10, _local9, _local8, null, _local14, _local13, _local12));
_local6++;
};
_local5++;
};
type = "Plane";
url = "primitive";
}
public function vertex(_arg1:int, _arg2:int):Vertex{
return (grid[_arg1][_arg2]);
}
}
}//package away3d.objects
Section 110
//RoundPlane (away3d.objects.RoundPlane)
package away3d.objects {
import away3d.core.math.*;
import away3d.core.material.*;
import away3d.core.scene.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.*;
public class RoundPlane extends Mesh {
public function RoundPlane(_arg1:Object=null){
var _local2:Number;
var _local3:Number;
var _local4:Number;
super(_arg1);
_arg1 = Init.parse(_arg1);
_local2 = _arg1.getNumber("radius", 10, {min:10});
_local3 = _arg1.getNumber("subdivision", 1, {min:1});
_local4 = _arg1.getNumber("innersubdivision", 1, {min:1});
buildRoundPlane(_local2, _local3, _local4);
type = "RoundPlane";
url = "primitive";
}
private function buildRoundPlane(_arg1:Number, _arg2:int, _arg3:int):void{
var _local4:*;
var _local5:int;
var _local6:int;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:UV;
var _local12:UV;
var _local13:UV;
var _local14:UV;
var _local15:Vertex;
var _local16:Vertex;
var _local17:Vertex;
var _local18:Vertex;
var _local19:Number3D;
var _local20:UV;
_local4 = new Array();
_local5 = 0;
_local6 = 0;
_local7 = (_arg1 / _arg3);
_local8 = (360 / _arg2);
_local9 = 0;
_local10 = _local8;
while (_local5 <= _arg3) {
_local4.push(new Number3D((_local5 * _local7), 0, 0));
_local5++;
};
_local19 = new Number3D(0, 0, 0);
_local20 = new UV(0.5, 0.5);
_local5 = 0;
while (_local5 < _arg2) {
_local6 = 0;
while (_local6 < (_local4.length - 1)) {
_local11 = new UV(((Math.cos(((-(_local10) / 180) * Math.PI)) / ((_arg3 * 2) / _local6)) + 0.5), ((Math.sin(((_local10 / 180) * Math.PI)) / ((_arg3 * 2) / _local6)) + 0.5));
_local12 = new UV(((Math.cos(((-(_local9) / 180) * Math.PI)) / ((_arg3 * 2) / (_local6 + 1))) + 0.5), ((Math.sin(((_local9 / 180) * Math.PI)) / ((_arg3 * 2) / (_local6 + 1))) + 0.5));
_local13 = new UV(((Math.cos(((-(_local10) / 180) * Math.PI)) / ((_arg3 * 2) / (_local6 + 1))) + 0.5), ((Math.sin(((_local10 / 180) * Math.PI)) / ((_arg3 * 2) / (_local6 + 1))) + 0.5));
_local14 = new UV(((Math.cos(((-(_local9) / 180) * Math.PI)) / ((_arg3 * 2) / _local6)) + 0.5), ((Math.sin(((_local9 / 180) * Math.PI)) / ((_arg3 * 2) / _local6)) + 0.5));
if (_local6 == 0){
_local15 = new Vertex(_local19.x, _local19.y, _local19.z);
_local16 = new Vertex((Math.cos(((-(_local9) / 180) * Math.PI)) * _local4[1].x), _local19.y, (Math.sin(((_local9 / 180) * Math.PI)) * _local4[1].x));
_local17 = new Vertex((Math.cos(((-(_local10) / 180) * Math.PI)) * _local4[1].x), _local19.y, (Math.sin(((_local10 / 180) * Math.PI)) * _local4[1].x));
addFace(new Face(_local15, _local16, _local17, null, _local20, _local12, _local13));
} else {
_local15 = new Vertex((Math.cos(((-(_local10) / 180) * Math.PI)) * _local4[_local6].x), _local19.y, (Math.sin(((_local10 / 180) * Math.PI)) * _local4[_local6].x));
_local16 = new Vertex((Math.cos(((-(_local10) / 180) * Math.PI)) * _local4[(_local6 + 1)].x), _local19.y, (Math.sin(((_local10 / 180) * Math.PI)) * _local4[(_local6 + 1)].x));
_local17 = new Vertex((Math.cos(((-(_local9) / 180) * Math.PI)) * _local4[(_local6 + 1)].x), _local19.y, (Math.sin(((_local9 / 180) * Math.PI)) * _local4[(_local6 + 1)].x));
_local18 = new Vertex((Math.cos(((-(_local9) / 180) * Math.PI)) * _local4[_local6].x), _local19.y, (Math.sin(((_local9 / 180) * Math.PI)) * _local4[_local6].x));
addFace(new Face(_local17, _local16, _local15, null, _local12, _local13, _local11));
addFace(new Face(_local17, _local15, _local18, null, _local12, _local11, _local14));
};
_local6++;
};
_local9 = (_local9 + _local8);
_local10 = (_local10 + _local8);
_local5++;
};
}
}
}//package away3d.objects
Section 111
//Sphere (away3d.objects.Sphere)
package away3d.objects {
import away3d.core.math.*;
import away3d.core.material.*;
import away3d.core.scene.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.stats.*;
import away3d.core.*;
public class Sphere extends Mesh {
private var grid:Array;
public function Sphere(_arg1:Object=null){
var _local2:Number;
var _local3:int;
var _local4:int;
super(_arg1);
_arg1 = Init.parse(_arg1);
_local2 = _arg1.getNumber("radius", 100, {min:0});
_local3 = _arg1.getInt("segmentsW", 8, {min:3});
_local4 = _arg1.getInt("segmentsH", 6, {min:2});
buildSphere(_local2, _local3, _local4);
}
public function vertex(_arg1:int, _arg2:int):Vertex{
return (grid[_arg2][_arg1]);
}
private function buildSphere(_arg1:Number, _arg2:int, _arg3:int):void{
var _local4:int;
var _local5:int;
var _local6:Vertex;
var _local7:Vertex;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Vertex;
var _local15:Vertex;
var _local16:Vertex;
var _local17:Vertex;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:UV;
var _local23:UV;
var _local24:UV;
var _local25:UV;
grid = new Array((_arg3 + 1));
_local6 = new Vertex(0, -(_arg1), 0);
grid[0] = new Array(_arg2);
_local4 = 0;
while (_local4 < _arg2) {
grid[0][_local4] = _local6;
_local4++;
};
_local5 = 1;
while (_local5 < _arg3) {
_local8 = ((_local5 / _arg3) * Math.PI);
_local9 = (-(_arg1) * Math.cos(_local8));
_local10 = (_arg1 * Math.sin(_local8));
grid[_local5] = new Array(_arg2);
_local4 = 0;
while (_local4 < _arg2) {
_local11 = (((2 * _local4) / _arg2) * Math.PI);
_local12 = (_local10 * Math.sin(_local11));
_local13 = (_local10 * Math.cos(_local11));
grid[_local5][_local4] = new Vertex(_local13, _local9, _local12);
_local4++;
};
_local5++;
};
_local7 = new Vertex(0, _arg1, 0);
grid[_arg3] = new Array(_arg2);
_local4 = 0;
while (_local4 < _arg2) {
grid[_arg3][_local4] = _local7;
_local4++;
};
_local5 = 1;
while (_local5 <= _arg3) {
_local4 = 0;
while (_local4 < _arg2) {
_local14 = grid[_local5][_local4];
_local15 = grid[_local5][(((_local4 - 1) + _arg2) % _arg2)];
_local16 = grid[(_local5 - 1)][(((_local4 - 1) + _arg2) % _arg2)];
_local17 = grid[(_local5 - 1)][_local4];
_local18 = (_local5 / _arg3);
_local19 = ((_local5 - 1) / _arg3);
_local20 = ((_local4 + 1) / _arg2);
_local21 = (_local4 / _arg2);
_local22 = new UV(_local20, _local18);
_local23 = new UV(_local21, _local18);
_local24 = new UV(_local21, _local19);
_local25 = new UV(_local20, _local19);
if (_local5 < _arg3){
addFace(new Face(_local14, _local15, _local16, null, _local22, _local23, _local24));
};
if (_local5 > 1){
addFace(new Face(_local14, _local16, _local17, null, _local22, _local24, _local25));
};
_local4++;
};
_local5++;
};
type = "Sphere";
url = "primitive";
}
}
}//package away3d.objects
Section 112
//WireCube (away3d.objects.WireCube)
package away3d.objects {
import away3d.core.material.*;
import away3d.core.scene.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.*;
public class WireCube extends WireMesh {
public var v010:Vertex;
public var v011:Vertex;
public var v110:Vertex;
public var v001:Vertex;
public var v100:Vertex;
public var v111:Vertex;
public var v101:Vertex;
public var v000:Vertex;
public function WireCube(_arg1:Object=null){
var _local2:Number;
var _local3:Number;
var _local4:Number;
super(_arg1);
_arg1 = Init.parse(_arg1);
_local2 = _arg1.getNumber("width", 100, {min:0});
_local3 = _arg1.getNumber("height", 100, {min:0});
_local4 = _arg1.getNumber("depth", 100, {min:0});
v000 = new Vertex((-(_local2) / 2), (-(_local3) / 2), (-(_local4) / 2));
v001 = new Vertex((-(_local2) / 2), (-(_local3) / 2), (_local4 / 2));
v010 = new Vertex((-(_local2) / 2), (_local3 / 2), (-(_local4) / 2));
v011 = new Vertex((-(_local2) / 2), (_local3 / 2), (_local4 / 2));
v100 = new Vertex((_local2 / 2), (-(_local3) / 2), (-(_local4) / 2));
v101 = new Vertex((_local2 / 2), (-(_local3) / 2), (_local4 / 2));
v110 = new Vertex((_local2 / 2), (_local3 / 2), (-(_local4) / 2));
v111 = new Vertex((_local2 / 2), (_local3 / 2), (_local4 / 2));
addSegment(new Segment(v000, v001));
addSegment(new Segment(v011, v001));
addSegment(new Segment(v011, v010));
addSegment(new Segment(v000, v010));
addSegment(new Segment(v100, v000));
addSegment(new Segment(v101, v001));
addSegment(new Segment(v111, v011));
addSegment(new Segment(v110, v010));
addSegment(new Segment(v100, v101));
addSegment(new Segment(v111, v101));
addSegment(new Segment(v111, v110));
addSegment(new Segment(v100, v110));
type = "WireCube";
url = "primitive";
}
}
}//package away3d.objects
Section 113
//Newgrounds_Global (com.newgrounds.Newgrounds_Global)
package com.newgrounds {
public class Newgrounds_Global {
var who;
private static var GlobalData:Object = new Object();
public function Newgrounds_Global(){
trace("globalized");
}
public function getData(_arg1:String){
return (GlobalData[_arg1]);
}
public function onAdsApproved(_arg1){
return (_arg1.startAd(getData("ad_url")));
}
public function setData(_arg1:String, _arg2){
GlobalData[_arg1] = _arg2;
}
}
}//package com.newgrounds
Section 114
//NewgroundsAPI_AS3 (com.newgrounds.NewgroundsAPI_AS3)
package com.newgrounds {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class NewgroundsAPI_AS3 {
private var movie_version:String;
private var movie_id:Number;
private var stat_ids:Object;
public var onSettingsLoaded:Function;
public var onDenyHost:Function;
private var debug_mode:Boolean;
private var host:String;
public var onNewVersionAvailable:Function;
private var data_object:Object;
public var onAdsApproved:Function;
private var script_url:String;
public function NewgroundsAPI_AS3(_arg1:Number, _arg2:String){
var ngparams:*;
var id = _arg1;
var url = _arg2;
super();
this.script_url = "http://www.ngads.com/gateway.php";
this.movie_id = id;
trace(url, "<<<<<<<<<-------------------------AGAIN URL");
this.host = url.split("/")[2];
trace(this.host);
if (this.host.length < 1){
this.host = "localhost";
};
this.stat_ids = new Object();
this.stat_ids.movie_views = 1;
this.stat_ids.author_referral = 2;
this.stat_ids.newgrounds_referral = 3;
this.stat_ids.version_referral = 4;
this.data_object = new Newgrounds_Global();
if (!this.data_object.getData("API")){
this.data_object.setData("API", this);
ngparams = new Object();
ngparams.id = this.movie_id;
ngparams.host = this.host;
ngparams.stat = this.stat_ids.movie_views;
ngparams.value = 1;
this.sendStats(ngparams);
};
this.onAdsApproved = function (){
};
this.onDenyHost = function (){
};
this.onSettingsLoaded = function (){
};
this.onNewVersionAvailable = function (){
};
}
public function SetDebugMode(_arg1:Boolean){
this.debug_mode = _arg1;
}
public function LoadNewgrounds(_arg1=null){
var _local2:Object;
var _local3:*;
_local2 = new Object();
_local2.id = this.movie_id;
_local2.host = this.host;
_local2.stat = this.stat_ids.newgrounds_referral;
_local3 = new Newgrounds_Global();
if (!_local3.getData("loaded_newgrounds")){
_local3.setData("loaded_newgrounds", true);
} else {
_local2.skiplog = 1;
};
if (_arg1){
_local2.page = _arg1;
};
this.sendStats(_local2, true);
}
private function eventHandler(_arg1){
var i:*;
var ngparams = _arg1;
try {
if (data_object.getData("ad_url")){
this.onAdsApproved();
};
if (data_object.getData("deny_host")){
this.onDenyHost();
};
if (data_object.getData("movie_version") != this.movie_version){
this.onNewVersionAvailable(data_object.getData("movie_version"), data_object.getData("movie_url"));
};
if (data_object.getData("settings_loaded")){
this.onSettingsLoaded(ngparams[i]);
};
for (i in ngparams) {
data_object.setData(i, unescape(ngparams[i]));
};
} catch(e:Error) {
};
}
public function SetMovieVersion(_arg1:String){
this.movie_version = _arg1;
}
function XML_Loaded(_arg1:Event){
var _local2:XML;
var _local3:Object;
var _local4:XMLList;
var _local5:XML;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
XML.ignoreWhitespace = true;
_local2 = XML(_arg1.target.data);
_local3 = new Object();
_local4 = _local2.children();
for each (_local5 in _local4) {
_local8 = _local5.localName();
_local9 = _local5.attribute("value");
if (_local9 == Number(_local9)){
_local9 = Number(_local9);
};
_local3[_local8] = _local9;
};
_local6 = new Newgrounds_Global();
_local7 = _local6.getData("API");
_local7.eventHandler(_local3);
}
public function LoadMySite(){
var _local1:Object;
var _local2:*;
_local1 = new Object();
_local1.id = this.movie_id;
_local1.host = this.host;
_local1.stat = this.stat_ids.author_referral;
_local2 = new Newgrounds_Global();
if (!_local2.getData("loaded_mysite")){
_local2.setData("loaded_mysite", true);
} else {
_local1.skiplog = 1;
};
this.sendStats(_local1, true);
}
private function sendStats(_arg1, _arg2:Boolean=false){
var _local3:*;
var _local4:*;
var _local5:URLRequest;
var _local6:URLLoader;
if (this.debug_mode){
_arg1["debug"] = true;
};
_local3 = (this.script_url + "?version=1.5");
for (_local4 in _arg1) {
_local3 = (_local3 + ((("&" + _local4) + "=") + escape(String(_arg1[_local4]))));
};
trace(_local3, " <<<<<<< GATEWAY URL");
if (_arg2){
_local5 = new URLRequest(_local3);
navigateToURL(_local5, "_blank");
} else {
_local6 = new URLLoader(new URLRequest(_local3));
_local6.addEventListener(Event.COMPLETE, XML_Loaded);
};
}
}
}//package com.newgrounds
Section 115
//acorn (acorn)
package {
import flash.display.*;
public dynamic class acorn extends BitmapData {
public function acorn(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 116
//apple (apple)
package {
import flash.display.*;
public dynamic class apple extends BitmapData {
public function apple(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 117
//bfly (bfly)
package {
import flash.display.*;
public dynamic class bfly extends BitmapData {
public function bfly(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 118
//blueberry (blueberry)
package {
import flash.display.*;
public dynamic class blueberry extends BitmapData {
public function blueberry(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 119
//bluecross (bluecross)
package {
import flash.display.*;
public dynamic class bluecross extends BitmapData {
public function bluecross(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 120
//Butterfly (Butterfly)
package {
import flash.utils.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.stats.*;
public class Butterfly extends Mesh {
private var uvarr:Array;
private var varr:Array;
private var fnarr:Array;
private var scaling:Number;
public function Butterfly(_arg1:Object=null){
varr = [];
uvarr = [];
fnarr = [];
super(_arg1);
_arg1 = Init.parse(_arg1);
scaling = _arg1.getNumber("scaling", 1);
build();
}
private function f(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int):void{
addFace(new Face(varr[_arg1], varr[_arg2], varr[_arg3], null, uvarr[_arg4], uvarr[_arg5], uvarr[_arg6]));
}
private function build():void{
var _local1:Object;
var _local2:int;
var _local3:int;
var _local4:Frame;
var _local5:int;
var _local6:VertexPosition;
v();
uv(0.9805, 0.9844);
uv(0.0234, 0.1172);
uv(0.0234, 0.9844);
uv(0.9805, 0.3125);
uv(0.25, 0.1445);
uv(0.8594, 0.2109);
uv(0.8594, 0.0781);
uv(0.543, 0.0078);
uv(0.0703, 0.0977);
uv(0.543, 0.0977);
uv(0.543, 0.0078);
uv(0.9883, 0.1445);
uv(0.6406, 0.0586);
f(0, 6, 8, 0, 1, 2);
f(2, 6, 0, 3, 1, 0);
f(6, 2, 5, 4, 5, 6);
f(1, 6, 5, 7, 8, 9);
f(1, 2, 6, 10, 9, 8);
f(3, 6, 4, 2, 1, 0);
f(4, 6, 5, 0, 1, 3);
f(2, 7, 5, 5, 11, 6);
f(2, 1, 7, 9, 10, 12);
f(7, 1, 5, 12, 7, 9);
frames = new Dictionary();
framenames = new Dictionary();
_local1 = new Object();
_local1.fly1 = [-742.3324, 781.8129, 746.8398, -216.9387, -604.0709, -0.2636, -216.9387, -413.8516, 85.9407, 763.009, 781.8129, -666.9097, -742.3324, 781.8129, -718.6323, -216.9387, -413.8516, -86.4678, 432.4243, -413.8516, 11.2303, -458.974, -489.9393, 11.2303, 763.009, 781.8129, 695.1173];
_local1.fly2 = [-742.3324, -198.2692, 922.6578, -216.9387, -389.6779, 11.903, -216.9387, -198.2692, 102.9785, 763.009, -198.2692, -800.7704, -742.3324, -198.2692, -863.8227, -216.9387, -198.2692, -72.1666, 432.4243, -198.2692, 25.9147, -458.974, -274.8327, 25.9147, 763.009, -198.2692, 859.6055];
_local1.fly3 = [-742.3324, -688.3104, 449.4807, -216.9387, 190.2805, 30.446, -216.9387, 383.6546, 116.1576, 763.009, -688.3104, -331.4477, -742.3324, -688.3104, -360.0182, -216.9387, 383.6546, -58.4402, 432.4243, 383.6546, 43.144, -458.974, 307.9865, 43.144, 763.009, -688.3104, 420.9101];
_local1.fly4 = [-742.3324, 0.81, 892.0303, -216.9387, -190.5986, -18.7244, -216.9387, 0.81, 72.3511, 763.009, 0.81, -831.3978, -742.3324, 0.81, -894.4501, -216.9387, 0.81, -102.7941, 432.4243, 0.81, -4.7128, -458.974, -75.7534, -4.7128, 763.009, 0.81, 828.9781];
_local1.sit = [-742.3324, 0.8098, 892.0303, -216.9387, -190.5988, -18.7244, -216.9387, 0.8098, 72.3511, 763.009, 0.8098, -831.3978, -742.3324, 0.8098, -894.4501, -216.9387, 0.8098, -102.7941, 432.4243, 0.8098, -4.7128, -458.974, -75.7536, -4.7128, 763.009, 0.8098, 828.9781];
fnarr = ["fly1", "fly2", "fly3", "fly4", "sit"];
_local5 = 0;
while (_local5 < fnarr.length) {
trace((("[ " + fnarr[_local5]) + " ]"));
_local4 = new Frame();
framenames[fnarr[_local5]] = _local5;
frames[_local5] = _local4;
_local3 = 0;
_local2 = 0;
while (_local2 < _local1[fnarr[_local5]].length) {
_local6 = new VertexPosition(varr[_local3]);
_local3++;
_local6.x = (_local1[fnarr[_local5]][_local2] * scaling);
_local6.y = (_local1[fnarr[_local5]][(_local2 + 1)] * scaling);
_local6.z = (_local1[fnarr[_local5]][(_local2 + 2)] * scaling);
_local4.vertexpositions.push(_local6);
_local2 = (_local2 + 3);
};
if (_local5 == 0){
_local4.adjust();
};
_local5++;
};
}
private function uv(_arg1:Number, _arg2:Number):void{
uvarr.push(new UV(_arg1, _arg2));
}
private function v():void{
var _local1:int;
_local1 = 0;
while (_local1 < 9) {
varr.push(new Vertex(0, 0, 0));
_local1++;
};
}
}
}//package
Section 121
//cloudstrip (cloudstrip)
package {
import flash.display.*;
public dynamic class cloudstrip extends BitmapData {
public function cloudstrip(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 122
//darkglider (darkglider)
package {
import flash.display.*;
public dynamic class darkglider extends BitmapData {
public function darkglider(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 123
//floor_grass (floor_grass)
package {
import flash.display.*;
public dynamic class floor_grass extends MovieClip {
}
}//package
Section 124
//glo (glo)
package {
import flash.display.*;
public dynamic class glo extends BitmapData {
public function glo(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 125
//heart (heart)
package {
import flash.display.*;
public dynamic class heart extends BitmapData {
public function heart(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 126
//honeydew (honeydew)
package {
import flash.display.*;
public dynamic class honeydew extends BitmapData {
public function honeydew(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 127
//LoaderBar (LoaderBar)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LoaderBar extends MovieClip {
public var bar:MovieClip;
public var total:TextField;
public var percent:TextField;
public var prog:TextField;
}
}//package
Section 128
//MARK1 (MARK1)
package {
import flash.display.*;
public dynamic class MARK1 extends MovieClip {
}
}//package
Section 129
//met1 (met1)
package {
import flash.display.*;
public dynamic class met1 extends MovieClip {
}
}//package
Section 130
//MochiAd (MochiAd)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public var MONEY:Number;// = 1
public function MochiAd(){
MONEY = 1;
super();
}
public static function getVersion():String{
return ("2.1");
}
public static function showTimedAd(_arg1:Object):void{
MochiAd.showInterLevelAd(_arg1);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var f:Function;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip._mochiad_loaded){
return (null);
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
g = function (_arg1:Object):void{
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
_arg1.removeChild(_arg1._mochiad);
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
_local3 = true;
};
};
};
if ((((_local2 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
bar.x = 10;
bar.y = (h - 20);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (!this.parent.parent){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
_local4 = true;
};
};
};
if ((((_local3 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
MochiAd.showPreGameAd(_arg1);
}
public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
mc.removeEventListener(Event.ENTER_FRAME, f);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 131
//mulitplayers (mulitplayers)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mulitplayers extends MovieClip {
public var xm:TextField;
public var scoredegv:TextField;
public function mulitplayers(){
addFrameScript(0, frame1);
}
function frame1(){
visible = false;
}
}
}//package
Section 132
//mystarshadow (mystarshadow)
package {
import flash.display.*;
public dynamic class mystarshadow extends BitmapData {
public function mystarshadow(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 133
//mytextureb (mytextureb)
package {
import flash.display.*;
public dynamic class mytextureb extends MovieClip {
}
}//package
Section 134
//newgrounds (newgrounds)
package {
import flash.display.*;
public dynamic class newgrounds extends MovieClip {
public var ng_play:MovieClip;
public var ng_ad:MovieClip;
public var NG_Button:SimpleButton;
public var awaybutton:SimpleButton;
public function newgrounds(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package
Section 135
//PeteGame (PeteGame)
package {
import flash.events.*;
import away3d.core.math.*;
import flash.utils.*;
import flash.display.*;
import away3d.core.material.*;
import away3d.core.render.*;
import away3d.core.scene.*;
import flash.geom.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.sprite.*;
import flash.media.*;
import flash.filters.*;
import away3d.objects.*;
import away3d.extrusions.*;
import flash.net.*;
import away3d.core.*;
import away3d.loaders.*;
class PeteGame extends Sprite {
var sphereAway3D;
var aPoints2;
var s_points_:Sound;
var waterC:ObjectContainer3D;
var loader;
var butter1;
var butter2;
var butter3;
var torus;
var s_powerb_:Sound;
var ipx;
var tmpnllX_BALL;
var mscore:int;// = 1
var s_jump1_:Sound;
var mouseP:int;// = 0
var matxx;
var waterstrip:Mesh;
var viewX:View3D;
var gliderfps:Number;// = 7.9
var s_jump2_:Sound;
var i:int;
var gspeed:Number;// = 1
var hurtcount:Number;// = 0
var Pscores;
var glidernull;
var gamestarted:Number;// = 0
var health:Number;// = 100
var pork;
var oMat;
var scene:Scene3D;
var falling:int;// = 0
var skystrip;
var score:Number;// = 0
var pshowobj:Object;
var aPoints;
var view:View3D;
var myrot:Number;// = 0
var u:Number;// = 0
var s_intro_:Sound;
var mousenum:Number3D;
var maxsmoke:uint;// = 30
var VT:Vertex;
var display:Bitmap;
var myscores;
var torusb;
var channelXrev:SoundChannel;
var max_apple:Number;// = 2
var fakescore:Number;// = 0
var distfart:Number;
var lathe;
var max_acorn:Number;// = 1
var gliderstop:Number;// = 0
var nnnnn:int;// = 0
var r:Number;// = 0
var bluecrossX;
var time:Number;// = 3600
var gameready:Number;// = 0
var smokeshot:uint;
var transrev:SoundTransform;
var MOCHSHOW:Number;// = 0
var mymenu;
var blur:BlurFilter;
var skybox;
var keysDown;
var maxrain:uint;// = 3
var popped:uint;
var shadow;
var camera:Camera3D;
var mousemoving:Number;// = 0
var ip:uint;// = 0
var sceneC:ObjectContainer3D;
var maxpspheres:uint;// = 0
var s_chat_:Sound;
var tmpnllX;
var max_butter:Number;// = 4
var sceneX:Scene3D;
var s_power_:Sound;
var nextsky:int;// = 1
var shadowp;
var testAxis:String;// = "y"
var jumped:int;// = 0
var tmpnlll;
var myrotkeys:Number;// = 0
var tempNULL:Object3D;
var s_hurt_:Sound;
var planeA;
var planeB;
var mat;
var glider;
var planeC;
var distmarker:int;// = 1
var max_honeydew:Number;// = 2
var bitDat:BitmapData;
var testguy:Object3D;
var max_clock:Number;// = 3
var mousecret:Number;// = 0
var timemax:Number;
var popcorn:uint;// = 4
var extrude:Object3D;
var max_heart:Number;// = 2
var mousenumX:Number3D;
var secretone:Number;// = 0
var filterA:Array;
var landed:int;// = 1
var s_warn_:Sound;
var cameraX:Camera3D;
var displayX:Sprite;
var s_bark_:Sound;
var max_blueberry:Number;// = 1
var demo:String;// = ""
var p1view:Sprite;
var mytravel;
var stage3D:Stage;
var tmpnll;
var myzoomkeys:Number;// = 0
var gameover:Number;// = 0
function PeteGame(){
transrev = new SoundTransform(0.9);
tmpnll = new ObjectContainer3D();
tmpnlll = new ObjectContainer3D();
MOCHSHOW = 0;
demo = "";
aPoints = [];
aPoints2 = [];
testAxis = "y";
filterA = new Array(new GlowFilter(0xFFFFFF, 1, 49, 49, 1, 1, false, false));
pshowobj = new Object();
ip = 0;
max_blueberry = 1;
max_clock = 3;
max_acorn = 1;
max_honeydew = 2;
max_apple = 2;
max_heart = 2;
max_butter = 4;
nnnnn = 0;
jumped = 0;
landed = 1;
gspeed = 1;
falling = 0;
distmarker = 1;
mouseP = 0;
gliderstop = 0;
myrot = 0;
VT = new Vertex();
gliderfps = 7.9;
mscore = 1;
secretone = 0;
health = 100;
time = 3600;
timemax = time;
score = 0;
fakescore = 0;
hurtcount = 0;
gameover = 0;
mousecret = 0;
mousenum = new Number3D(0, 90, 0);
mousenumX = new Number3D(0, 90, 0);
mousemoving = 0;
nextsky = 1;
gamestarted = 0;
gameready = 0;
smokeshot = maxsmoke;
maxpspheres = 0;
popcorn = 4;
popped = popcorn;
maxrain = 3;
maxsmoke = 30;
r = 0;
u = 0;
myrotkeys = 0;
myzoomkeys = 0;
super();
}
function make_ad(_arg1):void{
var _local2:Date;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:MovieClip;
var _local7:String;
var _local8:String;
_local2 = new Date();
_local3 = _local2.getMonth();
_local4 = _local2.getDate();
_local5 = _local2.getFullYear();
trace("Pete is ruling flash on ", _local4, _local3, _local5);
if ((((((_local3 > 1)) && ((_local4 > 0)))) && ((_local5 > 2007)))){
MOCHSHOW = 1;
};
if (MOCHSHOW > 0){
_local6 = _arg1.addChild(new MovieClip());
trace("made ad");
_local7 = "0c8631e2778584f5";
_local8 = "600x400";
MochiAd.showPreGameAd({clip:_local6, id:_local7, res:_local8, ad_finished:ad_finished});
} else {
ad_finished();
};
}
function my_MOUSE_GLIDER(_arg1:MouseEvent3D):void{
if (secretone > 0){
mousecret++;
trace("lol!");
if (mousecret == 3){
glider.material = Cast.material({bitmap:"sg"});
};
if (mousecret > 7){
mousecret = 0;
glider.material = Cast.material({bitmap:"sga"});
};
} else {
mousecret++;
if (mousecret == 50){
glider.material = Cast.material({bitmap:"darkglider"});
};
if (mousecret > 50){
glider.material = Cast.material({bitmap:"sga"});
mousecret = 0;
};
};
}
function rm(_arg1){
var _local2:*;
_local2 = ((Math.random() * _arg1) - (_arg1 / 2));
return (_local2);
}
function rn(_arg1){
var _local2:*;
_local2 = (Math.random() * _arg1);
return (_local2);
}
function demoCrender(_arg1):void{
var who = _arg1;
try {
hitme();
if ((((jumped > 0)) && ((gspeed > 10)))){
gspeed = (gspeed * 0.63);
glidernull.y = (glidernull.y + gspeed);
} else {
if (jumped > 0){
glider.play({prefix:"fly", fps:11, loop:true, smooth:true});
falling = 1;
jumped = 0;
gspeed = 10;
};
};
if ((((falling > 0)) && ((glidernull.y > 0)))){
if (falling < 2){
gspeed = (gspeed * 1.05);
} else {
gspeed = (gspeed + 20);
};
glidernull.y = (glidernull.y - gspeed);
};
if ((((falling > 0)) && ((glidernull.y < 0)))){
falling = 0;
glidernull.y = 0;
planeA.mouseEnabled = true;
mytravel = 77;
glider.play({prefix:"run", fps:gliderfps, loop:true, smooth:true});
gliderstop = 1;
};
tmpnll.moveTo(new Number3D(0, sphereAway3D.y, 0));
if (sphereAway3D.distanceTo(tmpnll) > 3000){
};
sphereAway3D.lookAt(mousenum);
glidernull.lookAt(new Number3D(bluecrossX.x, glidernull.y, bluecrossX.z));
tmpnll.moveTo(mousenum);
bluecrossX.x = tmpnll.x;
bluecrossX.rotationY = (bluecrossX.rotationY + 5);
glider.y = -10;
bluecrossX.y = 0;
bluecrossX.z = tmpnll.z;
distmarker = sphereAway3D.distanceTo(tmpnll);
if (gameready > 50){
MOFF(glider);
if (glidernull.y > 10){
if (rn(3000) > 2300){
pork.rotationY = (pork.rotationY + (rn(5) / 10));
};
if (rn(3000) > 2930){
pork.rotationY = rn(360);
};
if ((((pork.distanceTo(planeA) > 3000)) || ((rn(3000) > 2990)))){
pork.lookAt(new Number3D(0.1, 0, 0.1));
};
pork.moveForward(10);
} else {
distfart = glidernull.distanceTo(pork);
if (distfart > 100){
pork.lookAt(new Number3D(glidernull.x, 0, glidernull.z));
pork.moveForward(20);
};
};
if (distmarker > 170){
if (gliderstop < 1){
gliderstop = 1;
glider.play({prefix:"run", fps:gliderfps, loop:true, smooth:true});
};
sphereAway3D.moveForward(mytravel);
} else {
if ((((gliderstop > 0)) && ((glidernull.y == 0)))){
gliderstop = 0;
glider.play({prefix:"sit", fps:3.5, loop:true, smooth:true});
mscore = 0;
mymenu.multi.visible = false;
};
};
};
shadow.x = (glidernull.x = sphereAway3D.x);
shadow.y = -10;
shadow.z = (glidernull.z = sphereAway3D.z);
shadowp.x = pork.x;
shadowp.y = 50;
shadowp.z = pork.z;
glider.rotationY = 90;
if (mousemoving){
myrot = (myrot + ((view.mouseX / 300) + myrotkeys));
} else {
myrot = (myrot + ((view.mouseX / 1200) + myrotkeys));
};
mousemoving = 0;
if (rn(10) > -900){
tmpnll.moveTo(new Number3D(sphereAway3D.x, ((glidernull.y / 1.3) + 900), sphereAway3D.z));
if (gameready < 50){
tmpnll.rotationY = (myrot + ((mouseX - 400) / 10));
tmpnll.rotationX = ((-3 + (glidernull.y / 390)) + Math.min(5, Math.max(-15, (5 - (mouseY / 30)))));
tmpnll.moveBackward((((4000 - myzoomkeys) + (mouseY / 9)) + (12000 - (240 * gameready))));
tmpnll.moveUp((400 - (myzoomkeys / 5.9)));
} else {
if (gameover < 1){
tmpnll.rotationY = (myrot + ((mouseX - 400) / 10));
tmpnll.rotationX = ((-3 + (glidernull.y / 390)) + Math.min(5, Math.max(-15, (5 - (mouseY / 30)))));
tmpnll.moveBackward(((4000 - myzoomkeys) + (mouseY / 9)));
tmpnll.moveUp((400 - (myzoomkeys / 5.9)));
tmpnll.extra = 1;
} else {
if (gamestarted == 1){
tmpnll.rotationY = (myrot + ((mouseX - 400) / 10));
tmpnll.rotationX = -10;
tmpnll.moveTo(new Number3D(sphereAway3D.x, 500, sphereAway3D.z));
tmpnll.extra = Math.min(1200, (tmpnll.extra + 10));
tmpnll.moveBackward((((4000 - myzoomkeys) - tmpnll.extra) + (mouseY / 9)));
};
};
};
camera.moveTo(tmpnll.position);
view.camera.rotationX = tmpnll.rotationX;
view.camera.rotationY = tmpnll.rotationY;
camera.zoom = 420;
camera.focus = 1.1;
view.y = (viewX.y = (120 - (mouseY / 9)));
} else {
camera.moveTo(new Number3D(glidernull.x, (glidernull.y + 200), glidernull.z));
camera.rotationY = glidernull.rotationY;
camera.zoom = 15;
camera.focus = 20;
view.y = (viewX.y = 220);
camera.moveBackward(1800);
};
if (maxpspheres > 0){
addstranslate();
};
updatelife();
scene.updateTime();
} catch(e:Error) {
trace(e.message);
};
}
function views(_arg1, _arg2):void{
var who = _arg1;
var what = _arg2;
try {
scene = new Scene3D();
sceneX = new Scene3D();
camera = new Camera3D();
cameraX = new Camera3D();
stage3D = who.stage;
stage3D.frameRate = 50;
stage3D.quality = "LOW";
p1view = new Sprite();
who.addChild(p1view);
p1view.x = 10;
p1view.y = 10;
p1view.graphics.beginFill(0);
p1view.graphics.drawRect(0, 0, (who.swd - 20), (who.swh - 20));
p1view.graphics.endFill();
p1view.scrollRect = new Rectangle(0, 0, (who.swd - 20), (who.swh - 20));
p1view.addChild((viewX = new View3D({stats:false, scene:sceneX, camera:cameraX, x:(who.swd / 2), y:(who.swh / 2), renderer:Renderer.BASIC})));
p1view.addChild((view = new View3D({stats:false, scene:scene, camera:camera, x:(who.swd / 2), y:(who.swh / 2), renderer:Renderer.BASIC})));
sceneC = new ObjectContainer3D();
scene.addChild(sceneC);
mymenu = new petemenu();
who.addChild(mymenu);
myscores = new scorepanel();
who.addChild(myscores);
Pscores = new PeteScores();
myscores.visible = false;
myscores.x = 420;
myscores.y = 190;
myscores.go.addEventListener(MouseEvent.MOUSE_DOWN, Pscores.menuclickSCORE);
mymenu.me_start.m_start.addEventListener(MouseEvent.MOUSE_DOWN, menuclick2);
mymenu.me_start.m_in.addEventListener(MouseEvent.MOUSE_DOWN, menuclick1);
mymenu.instruct.back.addEventListener(MouseEvent.MOUSE_DOWN, menuclick1back);
mymenu.me_end.m_start.addEventListener(MouseEvent.MOUSE_DOWN, menuclick3);
mymenu.me_end.m_startno.addEventListener(MouseEvent.MOUSE_DOWN, menuclick13);
mymenu.me_end.visible = false;
mymenu.me_stats.visible = false;
mymenu.instruct.visible = false;
demo = what;
if (what == "create"){
create();
} else {
if (what == "demoA"){
demoA();
} else {
if (what == "demoB"){
demoB();
} else {
if (what == "demoC"){
demoC(who);
} else {
if (what == "gameA"){
gameA(who);
} else {
if (what == "gameB"){
demoC(who);
} else {
if (what == "gameC"){
demoC(who);
} else {
if (what == "speedtest"){
speedtest();
};
};
};
};
};
};
};
};
p1view.visible = false;
mymenu.visible = false;
make_ad(who);
} catch(e:Error) {
trace(e.message);
};
}
function hitme(){
if (gameready > 50){
ip = 1;
while (ip < max_heart) {
distfart = glidernull.distanceTo(pshowobj[("heart" + ip)]);
if ((((distfart < 300)) && ((health < 100)))){
channelXrev = s_points_.play(0, 1, transrev);
pshowobj[("heart" + ip)].x = ((Math.random() * 2400) - (Math.random() * 2400));
pshowobj[("heart" + ip)].z = ((Math.random() * 2400) - (Math.random() * 2400));
health = (health + 1);
};
pshowobj[("heartS" + ip)].x = (pshowobj[("heartS" + ip)].x = pshowobj[("heart" + ip)].x);
pshowobj[("heartS" + ip)].z = (pshowobj[("heartS" + ip)].z = pshowobj[("heart" + ip)].z);
ip++;
};
ip = 1;
while (ip < max_clock) {
distfart = glidernull.distanceTo(pshowobj[("stopwatch" + ip)]);
if ((((distfart < 300)) && (((time + 50) < timemax)))){
channelXrev = s_points_.play(0, 1, transrev);
pshowobj[("stopwatch" + ip)].x = ((Math.random() * 2400) - (Math.random() * 2400));
pshowobj[("stopwatch" + ip)].z = ((Math.random() * 2400) - (Math.random() * 2400));
time = (time + 50);
};
pshowobj[("stopwatchS" + ip)].x = (pshowobj[("stopwatchS" + ip)].x = pshowobj[("stopwatch" + ip)].x);
pshowobj[("stopwatchS" + ip)].z = (pshowobj[("stopwatchS" + ip)].z = pshowobj[("stopwatch" + ip)].z);
ip++;
};
ip = 1;
while (ip < max_acorn) {
distfart = glidernull.distanceTo(pshowobj[("acorn" + ip)]);
if (distfart < 300){
channelXrev = s_powerb_.play(0, 1, transrev);
updatescore(1);
};
ip++;
};
ip = 1;
while (ip < max_apple) {
pshowobj[("apple" + ip)].rotationY = (pshowobj[("apple" + ip)].rotationY + 5);
distfart = glidernull.distanceTo(pshowobj[("apple" + ip)]);
if (distfart < 600){
channelXrev = s_power_.play(0, 1, transrev);
if (maxpspheres > 0){
addshootball(6, pshowobj[("apple" + ip)]);
};
pshowobj[("apple" + ip)].x = ((Math.random() * 2400) - (Math.random() * 2400));
pshowobj[("apple" + ip)].z = ((Math.random() * 2400) - (Math.random() * 2400));
updatescore(10);
if (maxpspheres > 0){
addshootball(4, glidernull);
};
};
pshowobj[("appleS" + ip)].moveTo(pshowobj[("apple" + ip)].position);
pshowobj[("appleS" + ip)].y = 0;
lookY(pshowobj[("appleG" + ip)], camera, 0);
pshowobj[("appleG" + ip)].x = pshowobj[("apple" + ip)].x;
pshowobj[("appleG" + ip)].z = pshowobj[("apple" + ip)].z;
ip++;
};
ip = 1;
while (ip < max_honeydew) {
pshowobj[("honeydew" + ip)].rotationY = (pshowobj[("honeydew" + ip)].rotationY + 10);
distfart = glidernull.distanceTo(pshowobj[("honeydew" + ip)]);
if (distfart < 450){
channelXrev = s_powerb_.play(0, 1, transrev);
if (maxpspheres > 0){
addshootball(4, pshowobj[("honeydew" + ip)]);
};
pshowobj[("honeydew" + ip)].x = ((Math.random() * 2400) - (Math.random() * 2400));
pshowobj[("honeydew" + ip)].z = ((Math.random() * 2400) - (Math.random() * 2400));
updatescore(5);
if (maxpspheres > 0){
addshootball(3, glidernull);
};
};
pshowobj[("honeydewS" + ip)].moveTo(pshowobj[("honeydew" + ip)].position);
pshowobj[("honeydewS" + ip)].y = 0;
lookY(pshowobj[("honeydewG" + ip)], camera, 0);
pshowobj[("honeydewG" + ip)].x = pshowobj[("honeydew" + ip)].x;
pshowobj[("honeydewG" + ip)].z = pshowobj[("honeydew" + ip)].z;
ip++;
};
ip = 1;
while (ip < max_butter) {
distfart = glidernull.distanceTo(pshowobj[("butterc" + ip)]);
if (distfart < 300){
channelXrev = s_hurt_.play(0, 1, transrev);
pshowobj[("butterc" + ip)].x = ((Math.random() * 2400) - (Math.random() * 2400));
pshowobj[("butterc" + ip)].z = ((Math.random() * 2400) - (Math.random() * 2400));
updatescore(1);
};
pshowobj[("butterS" + ip)].moveTo(pshowobj[("butterc" + ip)].position);
pshowobj[("butterS" + ip)].y = 0;
if (pshowobj[("butterc" + ip)].y < 100){
pshowobj[("butterc" + ip)].y = 100;
};
if (rn(3000) > 2930){
pshowobj[("butterc" + ip)].rotationY = rn(360);
};
if ((((pshowobj[("butterc" + ip)].distanceTo(planeA) > 3000)) || ((rn(3000) > 2990)))){
pshowobj[("butterc" + ip)].lookAt(new Number3D(0.1, (2000 + rn(1000)), 0.1));
};
pshowobj[("butterc" + ip)].moveForward(30);
ip++;
};
hurtcount--;
distfart = glidernull.distanceTo(pork);
if (distfart < 300){
if (hurtcount < 0){
hurtcount = 10;
if (gameover < 1){
if (health > 0){
health = (health - 25);
};
channelXrev = s_bark_.play(0, 1, transrev);
};
};
};
};
}
function gameA(_arg1):void{
demoB();
}
function add(_arg1):void{
view.scene.addChild(_arg1);
}
function create_SKYSTRIP(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6):void{
nextsky++;
aPoints = [];
i = 0;
while (i < 360) {
tmpnll.moveTo(new Number3D(1, 1, 1));
tmpnll.rotationY = i;
tmpnll.moveBackward(_arg1);
aPoints.push(tmpnll.position);
trace(aPoints[i]);
i = (i + 19);
};
skystrip = new SegmentsExtrude(aPoints, {material:_arg5, offset:_arg2, thickness:_arg3, bothsides:true, recenter:true, subdivision:1, closepath:true});
sceneC.addChild(skystrip);
skystrip.name = ("skystrip" + nextsky);
trace(skystrip.name);
MOFF(skystrip);
}
function listener(_arg1:Event){
trace(_arg1.target);
}
function demoA():void{
sphereAway3D = new Sphere({material:{bitmap:"mytexture"}, z:0, segmentsW:1, segmentsH:1, radius:100, x:0, bothsides:false});
view.scene.addChild(sphereAway3D);
}
public function keyPressed(_arg1:KeyboardEvent):void{
keysDown[_arg1.keyCode] = true;
}
function demoB():void{
view.y = 320;
if (demo != "demoC"){
sphereAway3D = new Sphere({material:new BitmapMaterial(bitDat), z:0, segmentsW:1, segmentsH:1, radius:1000, x:0, bothsides:true});
sphereAway3D.y = 500;
};
tempNULL = new Object3D();
waterC = new ObjectContainer3D();
sceneC.addChild(waterC);
create_FLOORSTRIP(200, 6300, 1200, 70, Cast.material({bitmap:"scroll_far"}));
create_SKYBOX(4.5, 0.8, 2800);
i = 1;
while (i < 12) {
pshowobj[("GBLADE" + i)] = new Sprite2D({bitmap:"scroll_blade", scaling:(2 - (rm(2000) / 2000)), smooth:false});
tempNULL.x = (tempNULL.y = (tempNULL.z = 0));
tempNULL.rotationY = rm(360);
tempNULL.moveBackward((3000 + rm(200)));
pshowobj[("GBLADE" + i)].x = tempNULL.x;
pshowobj[("GBLADE" + i)].y = (tempNULL.y + 100);
pshowobj[("GBLADE" + i)].z = tempNULL.z;
pshowobj[("GBLADE" + i)].y = (pshowobj[("GBLADE" + i)].scaling * 75);
sceneC.addChild(pshowobj[("GBLADE" + i)]);
MOFF(pshowobj[("GBLADE" + i)]);
i++;
};
i = 1;
while (i < 5) {
pshowobj[("GBLADE" + i)] = new Sprite2D({bitmap:"scroll_grass", scaling:(2 - (rm(2000) / 2000)), smooth:false});
tempNULL.x = (tempNULL.y = (tempNULL.z = 0));
tempNULL.rotationY = rm(360);
tempNULL.moveBackward((3000 + rm(500)));
pshowobj[("GBLADE" + i)].x = tempNULL.x;
pshowobj[("GBLADE" + i)].y = tempNULL.y;
pshowobj[("GBLADE" + i)].z = tempNULL.z;
pshowobj[("GBLADE" + i)].y = (pshowobj[("GBLADE" + i)].scaling * 75);
sceneC.addChild(pshowobj[("GBLADE" + i)]);
MOFF(pshowobj[("GBLADE" + i)]);
pshowobj[("tr" + i)] = new Sprite2D({bitmap:"tree1", scaling:8, smooth:false});
tempNULL.x = (tempNULL.y = (tempNULL.z = 0));
tempNULL.rotationY = rn(270);
tempNULL.moveBackward((9000 + rm(2000)));
pshowobj[("tr" + i)].x = tempNULL.x;
pshowobj[("tr" + i)].y = tempNULL.y;
pshowobj[("tr" + i)].z = tempNULL.z;
pshowobj[("tr" + i)].y = 980;
pshowobj[("trb" + i)] = new Sprite2D({bitmap:"tree2", scaling:9, smooth:false});
tempNULL.x = (tempNULL.y = (tempNULL.z = 0));
tempNULL.rotationY = rn(270);
tempNULL.moveBackward((9000 + rm(2200)));
pshowobj[("trb" + i)].x = tempNULL.x;
pshowobj[("trb" + i)].y = tempNULL.y;
pshowobj[("trb" + i)].z = tempNULL.z;
pshowobj[("trb" + i)].y = 880;
sceneC.addChild(pshowobj[("tr" + i)]);
sceneC.addChild(pshowobj[("trb" + i)]);
MOFF(pshowobj[("tr" + i)]);
MOFF(pshowobj[("trb" + i)]);
i++;
};
planeA = new RoundPlane({material:Cast.material({bitmap:"scroll_grassmap"}), z:1, y:-9, radius:5300, innersubdivision:5, subdivision:15, bothsides:false});
planeA.pushback = true;
sceneC.addChild(planeA);
makekeys(this);
}
private function menuclick1back(_arg1:MouseEvent):void{
mymenu.instruct.visible = false;
}
public function keyReleased(_arg1:KeyboardEvent):void{
delete keysDown[_arg1.keyCode];
}
function gameArender(_arg1):void{
var who = _arg1;
try {
demoBrender();
} catch(e:Error) {
trace(e.message);
};
}
function demoC(_arg1):void{
var who = _arg1;
try {
trace("doingdemoC");
demoB();
s_intro_ = new s_intro();
s_hurt_ = new s_hurt();
s_jump1_ = new s_jump1();
s_jump2_ = new s_jump2();
s_points_ = new s_points();
s_power_ = new s_power();
s_powerb_ = new s_powerb();
s_chat_ = new s_chat();
s_warn_ = new s_warn();
s_bark_ = new s_bark();
ip = 1;
while (ip < max_apple) {
pshowobj[("apple" + ip)] = new Star({material:Cast.material({bitmap:"star3"}), bothsides:true, scaling:1});
pshowobj[("apple" + ip)].y = 2400;
pshowobj[("apple" + ip)].x = ((Math.random() * 2400) - (Math.random() * 2400));
pshowobj[("apple" + ip)].z = ((Math.random() * 2400) - (Math.random() * 2400));
scene.addChild(pshowobj[("apple" + ip)]);
pshowobj[("apple" + ip)].play({prefix:"anim", fps:7, loop:true, smooth:true});
pshowobj[("appleS" + ip)] = new Plane({material:Cast.material({bitmap:"mystarshadow"}), width:500, height:500, segmentsW:1, segmentsH:1, bothsides:false});
scene.addChild(pshowobj[("appleS" + ip)]);
MOFF(pshowobj[("apple" + ip)]);
MOFF(pshowobj[("appleS" + ip)]);
pshowobj[("appleG" + ip)] = new Plane({material:Cast.material({bitmap:"glo"}), width:150, height:2400, segmentsW:1, segmentsH:1, bothsides:false, y:1200, rotationX:90});
pshowobj[("appleG" + ip)].x = (pshowobj[("appleS" + ip)].x = pshowobj[("apple" + ip)].x);
pshowobj[("appleG" + ip)].z = (pshowobj[("appleS" + ip)].z = pshowobj[("apple" + ip)].z);
scene.addChild(pshowobj[("appleG" + ip)]);
MOFF(pshowobj[("appleG" + ip)]);
ip++;
};
ip = 1;
while (ip < max_honeydew) {
pshowobj[("honeydew" + ip)] = new Star({material:Cast.material({bitmap:"star3"}), bothsides:true, scaling:0.5});
pshowobj[("honeydew" + ip)].y = 1200;
pshowobj[("honeydew" + ip)].x = ((Math.random() * 2400) - (Math.random() * 2400));
pshowobj[("honeydew" + ip)].z = ((Math.random() * 2400) - (Math.random() * 2400));
scene.addChild(pshowobj[("honeydew" + ip)]);
pshowobj[("honeydewS" + ip)] = new Plane({material:Cast.material({bitmap:"mystarshadow"}), width:500, height:500, segmentsW:1, segmentsH:1, bothsides:false});
scene.addChild(pshowobj[("honeydewS" + ip)]);
MOFF(pshowobj[("honeydew" + ip)]);
MOFF(pshowobj[("honeydewS" + ip)]);
pshowobj[("honeydewG" + ip)] = new Plane({material:Cast.material({bitmap:"glo"}), width:75, height:1200, segmentsW:1, segmentsH:1, bothsides:false, y:600, rotationX:90});
scene.addChild(pshowobj[("honeydewG" + ip)]);
MOFF(pshowobj[("honeydewG" + ip)]);
pshowobj[("honeydewG" + ip)].x = (pshowobj[("honeydewS" + ip)].x = pshowobj[("honeydew" + ip)].x);
pshowobj[("honeydewG" + ip)].z = (pshowobj[("honeydewS" + ip)].z = pshowobj[("honeydew" + ip)].z);
ip++;
};
ip = 1;
while (ip < max_acorn) {
pshowobj[("acorn" + ip)] = new Sprite2D({bitmap:"acorn", scaling:3, smooth:false});
pshowobj[("acorn" + ip)].y = 50;
pshowobj[("acorn" + ip)].x = ((Math.random() * 2400) - (Math.random() * 2400));
pshowobj[("acorn" + ip)].z = ((Math.random() * 2400) - (Math.random() * 2400));
scene.addChild(pshowobj[("acorn" + ip)]);
ip++;
};
ip = 1;
while (ip < max_blueberry) {
pshowobj[("blueberry" + ip)] = new Sprite2D({bitmap:"blueberry", scaling:3, smooth:false});
pshowobj[("blueberry" + ip)].y = 50;
pshowobj[("blueberry" + ip)].x = ((Math.random() * 2400) - (Math.random() * 2400));
pshowobj[("blueberry" + ip)].z = ((Math.random() * 2400) - (Math.random() * 2400));
scene.addChild(pshowobj[("blueberry" + ip)]);
MOFF(pshowobj[("blueberry" + ip)]);
ip++;
};
ip = 1;
while (ip < max_clock) {
pshowobj[("stopwatch" + ip)] = new Sprite2D({bitmap:"stopwatch", scaling:3, smooth:false});
pshowobj[("stopwatch" + ip)].y = 150;
pshowobj[("stopwatch" + ip)].x = ((Math.random() * 2400) - (Math.random() * 2400));
pshowobj[("stopwatch" + ip)].z = ((Math.random() * 2400) - (Math.random() * 2400));
scene.addChild(pshowobj[("stopwatch" + ip)]);
MOFF(pshowobj[("stopwatch" + ip)]);
pshowobj[("stopwatchS" + ip)] = new Plane({material:Cast.material({bitmap:"shd"}), width:400, height:400, segmentsW:1, segmentsH:1, bothsides:false});
scene.addChild(pshowobj[("stopwatchS" + ip)]);
MOFF(pshowobj[("stopwatchS" + ip)]);
pshowobj[("stopwatchS" + ip)].x = (pshowobj[("stopwatchS" + ip)].x = pshowobj[("stopwatch" + ip)].x);
pshowobj[("stopwatchS" + ip)].z = (pshowobj[("stopwatchS" + ip)].z = pshowobj[("stopwatch" + ip)].z);
ip++;
};
ip = 1;
while (ip < max_heart) {
pshowobj[("heart" + ip)] = new Sprite2D({bitmap:"heart", scaling:3, smooth:false});
pshowobj[("heart" + ip)].y = 150;
pshowobj[("heart" + ip)].x = ((Math.random() * 2400) - (Math.random() * 2400));
pshowobj[("heart" + ip)].z = ((Math.random() * 2400) - (Math.random() * 2400));
scene.addChild(pshowobj[("heart" + ip)]);
MOFF(pshowobj[("heart" + ip)]);
pshowobj[("heartS" + ip)] = new Plane({material:Cast.material({bitmap:"shd"}), width:300, height:300, segmentsW:1, segmentsH:1, bothsides:false});
scene.addChild(pshowobj[("heartS" + ip)]);
MOFF(pshowobj[("heartS" + ip)]);
pshowobj[("heartS" + ip)].x = (pshowobj[("heartS" + ip)].x = pshowobj[("heart" + ip)].x);
pshowobj[("heartS" + ip)].z = (pshowobj[("heartS" + ip)].z = pshowobj[("heart" + ip)].z);
ip++;
};
ip = 1;
while (ip < max_butter) {
pshowobj[("butter" + ip)] = new Butterfly({material:Cast.material({bitmap:"bfly"}), bothsides:true, scaling:0.13, y:0, x:0, z:0});
pshowobj[("butter" + ip)].play({prefix:"fly", fps:(11 + (ip * 2)), loop:true, smooth:true});
pshowobj[("butter" + ip)].rotationY = 90;
pshowobj[("butterc" + ip)] = new ObjectContainer3D(pshowobj[("butter" + ip)]);
pshowobj[("butterc" + ip)].y = 150;
pshowobj[("butterc" + ip)].x = ((Math.random() * 2400) - (Math.random() * 2400));
pshowobj[("butterc" + ip)].z = ((Math.random() * 2400) - (Math.random() * 2400));
pshowobj[("butterS" + ip)] = new Plane({material:Cast.material({bitmap:"shd"}), width:300, height:300, segmentsW:1, segmentsH:1, bothsides:false});
scene.addChild(pshowobj[("butterS" + ip)]);
scene.addChild(pshowobj[("butterc" + ip)]);
MOFF(pshowobj[("butter" + ip)]);
MOFF(pshowobj[("butterS" + ip)]);
MOFF(pshowobj[("butterc" + ip)]);
ip++;
};
bluecrossX = new Plane({material:Cast.material({bitmap:"bluecross"}), z:0, y:5, width:300, height:300, segmentsW:1, segmentsH:1, bothsides:false, name:"bluecross_"});
shadow = new Plane({material:Cast.material({bitmap:"shd2"}), z:0, y:-145, width:500, height:500, segmentsW:1, segmentsH:1, bothsides:false, name:"bluecross_"});
shadowp = new Plane({material:Cast.material({bitmap:"shd2"}), z:0, y:80, width:900, height:900, segmentsW:1, segmentsH:1, bothsides:false, name:"bluecross_"});
MOFF(shadow);
MOFF(shadowp);
MOFF(bluecrossX);
scene.addChild(bluecrossX);
scene.addChild(shadow);
scene.addChild(shadowp);
who.addEventListener(MouseEvent.MOUSE_DOWN, mouseClicked);
who.addEventListener(MouseEvent.MOUSE_UP, mouseReleased);
pork = new Porcupine({material:Cast.material({bitmap:"porky"}), bothsides:false, scaling:0.5});
pork.play({prefix:"walk", fps:9, loop:true, smooth:true});
scene.addChild(pork);
pork.z = 3000;
pork.pushfront = true;
MOFF(pork);
glider = new SugarGlider({material:Cast.material({bitmap:"sga"}), bothsides:false, scaling:1.5});
glider.play({prefix:"run", fps:5.9, loop:true, smooth:true});
glider.y = 900;
glider.pushback = true;
glider.addOnMouseDown(my_MOUSE_GLIDER);
glidernull = new ObjectContainer3D(glider);
MOFF(glidernull);
scene.addChild(glidernull);
sphereAway3D = new Sphere({material:new WireColorMaterial(), z:0, segmentsW:5, segmentsH:5, radius:180, x:0, bothsides:true});
sphereAway3D.y = 90;
scene.addChild(sphereAway3D);
sphereAway3D.visible = false;
scene.addOnMouseMove(my_MOUSE_MOVE);
MOFF(sceneC);
sceneC.mouseEnabled = true;
MOFF(sphereAway3D);
planeA.mouseEnabled = true;
if (maxpspheres > 0){
addspheres();
};
trace("madedemoc");
} catch(e:Error) {
trace(e.message);
};
}
function create():void{
}
private function mouseReleased(_arg1:MouseEvent):void{
mouseP = 0;
}
function ad_finished():void{
p1view.visible = true;
mymenu.visible = true;
}
private function menuclick1212(_arg1:MouseEvent):void{
var url:String;
var request:URLRequest;
var event = _arg1;
url = "http://www.away3d.com";
request = new URLRequest(url);
try {
navigateToURL(request);
} catch(e:Error) {
};
trace("1111111");
}
function demoBrender():void{
view.scene.getChildByName("skystrip3").rotationY = (view.scene.getChildByName("skystrip3").rotationY - 0.02);
view.scene.getChildByName("skystrip4").rotationY = (view.scene.getChildByName("skystrip4").rotationY + 0.05);
sphereAway3D.rotationY = (sphereAway3D.rotationY + 2);
view.camera.moveTo(sphereAway3D.position);
view.camera.rotationY = (mouseX / 2);
view.camera.rotationX = (30 - (mouseY / 4));
view.camera.moveUp((1100 - (mouseY * 5)));
view.camera.zoom = 450;
view.camera.focus = 1;
view.camera.moveBackward((3500 + (mouseY * 7)));
}
function addspheres():void{
var _local1:Number;
ip = 1;
while (ip < maxpspheres) {
pshowobj[("Ppball" + ip)] = new Ppball();
_local1 = int(((Math.random() * 11) + 1));
pshowobj[("psphereP" + ip)] = new Sprite2D({bitmap:"spark1", scaling:1, smooth:false});
pshowobj[("psphereP" + ip)].x = (Math.random() * 1000);
pshowobj[("psphereP" + ip)].y = (Math.random() * 1000);
pshowobj[("psphereP" + ip)].z = (Math.random() * 1000);
pshowobj[("psphereP" + ip)].visible = false;
scene.addChild(pshowobj[("psphereP" + ip)]);
ip++;
};
}
function addshootball(_arg1, _arg2):void{
ipx = 1;
while (ipx < _arg1) {
popped--;
if (popped < 1){
popped = (maxpspheres - 1);
};
pshowobj[("Ppball" + popped)].pinitgravity = 2;
pshowobj[("psphereP" + popped)].visible = true;
pshowobj[("Ppball" + popped)].life = 0;
pshowobj[("Ppball" + popped)].death = ((Math.random() * 4000) / 500);
pshowobj[("psphereP" + popped)].scaling = (5 + ((Math.random() * 200) / 50));
pshowobj[("Ppball" + popped)].shootball(pshowobj[("psphereP" + popped)], _arg2, 0, rm(50), (-30 - rm(40)), rm(50));
ipx++;
};
}
public function isDown(_arg1:uint):Boolean{
return (Boolean(keysDown[_arg1]));
}
function create_SKYBOXExtrude(_arg1):void{
aPoints = [];
aPoints.push(new Number3D(1, 0, 0));
aPoints.push(new Number3D(_arg1, 0, 0));
view.scene.addChild(skybox);
skybox.x = (_arg1 / 2);
skybox.y = (-(_arg1) / 2);
skybox.scale(-1);
skybox.scaleY(0.7);
skybox.rotationX = 180;
skybox.pushback = true;
skybox.y = (skybox.y + 3600);
}
function updatelife(){
var _local1:Number;
Pscores.xname = myscores.xname.text;
if ((((((gameready > 50)) && ((time > 0)))) && ((gameover < 1)))){
time--;
};
if ((((((health < 1)) || ((time < 1)))) && ((Pscores.sent < 1)))){
mymenu.multi.visible = false;
if (health < 1){
health = 0;
mymenu.me_end.mess.text = "G U L P E D !";
} else {
mymenu.me_end.mess.text = "Y O U W I N !";
};
gameover = 1;
glider.y = 900;
mymenu.me_end.visible = true;
glider.visible = false;
shadow.visible = false;
bluecrossX.visible = false;
myscores.score.text = (Pscores.oldhiscore = score);
myscores.visible = true;
myscores.go.visible = true;
};
_local1 = int((time / 60));
if (fakescore < score){
fakescore = (fakescore + int(1));
};
mymenu.me_stats.time.text = ("" + int(_local1));
mymenu.me_stats.health.text = ("" + health);
mymenu.me_stats.score.text = ("" + fakescore);
mymenu.me_stats.m1.scaleX = (1 / (100 / health));
mymenu.me_stats.heart.x = (mymenu.me_stats.m1.x + mymenu.me_stats.m1.width);
mymenu.me_stats.m2.scaleX = (1 / (60 / _local1));
mymenu.me_stats.clock.x = (mymenu.me_stats.m2.x + mymenu.me_stats.m2.width);
}
function updatescore(_arg1){
if ((((((gameready > 50)) && ((time > 0)))) && ((gameover < 1)))){
if (sphereAway3D.y > 1){
mscore = (mscore + 1);
if (mscore > 1){
mymenu.multi.xm.text = (mscore + "X");
mymenu.multi.visible = true;
};
} else {
mymenu.multi.visible = false;
mscore = 1;
};
score = (score + (_arg1 * mscore));
if (score > 500){
mymenu.instruct.sec.text = "Click GLIDER 3 times in the beginning of the game for an albino GLIDER";
secretone = 1;
};
trace(mscore);
};
}
private function menuclick13(_arg1:MouseEvent):void{
var url:String;
var request:URLRequest;
var event = _arg1;
url = "http://www.free3darcade.com";
request = new URLRequest(url);
try {
navigateToURL(request);
} catch(e:Error) {
};
health = 1;
time = 1;
gamestarted = 1;
p1view.visible = false;
mymenu.visible = false;
myscores.visible = false;
SoundMixer.stopAll();
trace("endgame");
}
function speedtest():void{
stage3D.frameRate = 999;
sphereAway3D = new Sphere({material:{bitmap:"mytexture"}, z:0, segmentsW:1, segmentsH:1, radius:100, x:0, bothsides:false});
view.scene.addChild(sphereAway3D);
}
function dokeys(_arg1):void{
if (((keysDown[39]) || (keysDown[70]))){
u = 1;
myrotkeys = -3;
} else {
if (((keysDown[37]) || (keysDown[83]))){
u = -1;
myrotkeys = 3;
} else {
u = 0;
myrotkeys = 0;
};
};
if (((keysDown[38]) || (keysDown[69]))){
r = 1;
myzoomkeys = (myzoomkeys + 150);
} else {
if (((keysDown[40]) || (keysDown[68]))){
myzoomkeys = (myzoomkeys - 150);
r = -1;
} else {
r = 0;
};
};
myzoomkeys = Math.max(-4000, Math.min(2200, myzoomkeys));
}
private function generateFromLib(_arg1:String):BitmapData{
var _local2:Class;
var _local3:Sprite;
var _local4:BitmapData;
_local2 = (getDefinitionByName(_arg1) as Class);
_local3 = new (_local2);
_local4 = new BitmapData(_local3.width, _local3.height, true, 0xFFFFFF);
_local4.draw(_local3, null, null, null, _local4.rect, true);
return (_local4);
}
function makekeys(_arg1):void{
keysDown = new Object();
stage3D.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed, false, 0, true);
stage3D.addEventListener(KeyboardEvent.KEY_UP, keyReleased, false, 0, true);
}
function demoBb():void{
sphereAway3D = new Sphere({material:{bitmap:"mytexture"}, z:0, segmentsW:1, segmentsH:1, radius:100, x:0, bothsides:false});
view.scene.addChild(sphereAway3D);
}
function create_WATERSTRIP(_arg1, _arg2, _arg3, _arg4):void{
var _local5:IMaterial;
_local5 = new BitmapMaterial(this.generateFromLib("waterb"), {smooth:false});
aPoints = [];
aPoints.push(new Number3D(_arg1, 0, 0));
aPoints.push(new Number3D(_arg2, 0, 0));
lathe = new Lathe(aPoints, {material:_local5, axis:testAxis, offsetradius:_arg3, subdivision:22, rotations:0.5, scaling:1, bothsides:false});
lathe.pushback = true;
waterC.addChild(lathe);
lathe.z = ((-((_arg3 / 2)) + (_arg2 / 2)) + _arg4);
lathe.rotationY = 180;
aPoints = [];
aPoints.push(new Number3D(_arg1, 0, 0));
aPoints.push(new Number3D(_arg2, 0, 0));
lathe = new Lathe(aPoints, {material:_local5, axis:testAxis, offsetradius:_arg3, subdivision:22, rotations:0.5, scaling:1, bothsides:false});
lathe.pushback = true;
waterC.addChild(lathe);
}
function create_SKYBOX(_arg1, _arg2, _arg3):void{
skybox = new SkyBox({material:Cast.material({bitmap:"skyb"})});
skybox.scaleY(_arg2);
skybox.scale(_arg1);
skybox.y = _arg3;
skybox.pushback = true;
sceneC.addChild(skybox);
MOFF(skybox);
}
function create_FLOORSTRIP(_arg1, _arg2, _arg3, _arg4, _arg5):void{
aPoints = [];
aPoints.push(new Number3D(_arg1, 0, 0));
aPoints.push(new Number3D(_arg2, 0, 0));
lathe = new PeteLathe(aPoints, {material:_arg5, axis:testAxis, offsetradius:_arg3, subdivision:15, rotations:1, scaling:1, bothsides:true});
sceneC.addChild(lathe);
lathe.rotationZ = 180;
lathe.x = (_arg2 / 50);
}
function addstranslate():void{
ip = 1;
while (ip < maxpspheres) {
pshowobj[("Ppball" + ip)].doball(pshowobj[("psphereP" + ip)], pshowobj[("psphereP" + ip)], 1, 0.96, 0.91, 0.9, -19000, 19000, -10, 19000, -19000, 19000, 0);
pshowobj[("Ppball" + ip)].life++;
if (pshowobj[("Ppball" + ip)].life > pshowobj[("Ppball" + ip)].death){
if (pshowobj[("psphereP" + ip)].scaling > 0.01){
pshowobj[("psphereP" + ip)].scaling = (pshowobj[("psphereP" + ip)].scaling - 0.02);
} else {
pshowobj[("psphereP" + ip)].visible = false;
};
};
ip++;
};
}
function renderme(_arg1):void{
var who = _arg1;
try {
dokeys(this);
if (demo == "demoA"){
demoArender();
} else {
if (demo == "demoA"){
demoArender();
} else {
if (demo == "demoB"){
demoBrender();
} else {
if (demo == "gameA"){
gameArender(who);
} else {
if (demo == "demoC"){
if (gamestarted > 0){
gameready++;
demoCrender(who);
view.visible = true;
} else {
if (gameover < 1){
sphereAway3D.x = (glider.x = 0);
sphereAway3D.z = (glider.z = 0);
glider.y = 1900;
view.camera.moveTo(new Number3D(0, 1700, 0));
view.camera.rotationY = (view.camera.rotationY + (view.mouseX / 199));
view.camera.rotationX = ((-(mouseY) / 5) + 27);
view.camera.moveBackward(900);
view.camera.moveDown(30);
view.camera.focus = 15;
view.camera.zoom = 27;
};
};
};
};
};
};
};
this.view.render();
this.viewX.render();
} catch(e:Error) {
trace(e.message);
};
}
function my_MOUSE_MOVE(_arg1:MouseEvent3D):void{
mousemoving = 1;
if ((((((gameover < 1)) && ((jumped == 0)))) && ((glidernull.y == 0)))){
mscore = 0;
mymenu.multi.visible = false;
mousenum = new Number3D(_arg1.sceneX, 90, _arg1.sceneZ);
tmpnll.moveTo(new Number3D(_arg1.sceneX, 90, _arg1.sceneZ));
if (tmpnll.distanceTo(planeA) > 3500){
tmpnlll.moveTo(planeA.position);
lookY(tmpnlll, tmpnll, 180);
tmpnlll.moveBackward(-3500);
tmpnll.moveTo(tmpnlll.position);
mousenum = new Number3D(tmpnlll.x, 90, tmpnlll.z);
};
};
}
private function resetgame():void{
glider.mouseEnabled = true;
time = timemax;
Pscores.sent = 0;
myscores.visible = false;
mymenu.me_start.visible = false;
mymenu.me_stats.visible = true;
mymenu.me_end.visible = false;
gamestarted = 1;
gameready = 0;
gameover = 0;
score = 0;
fakescore = 0;
health = 100;
mousenum = new Number3D(0, 0, 0);
pork.z = 3000;
pork.x = 0;
pork.y = 0;
glidernull.x = (glidernull.y = (glidernull.z = 0));
jumped = 0;
landed = 1;
gspeed = 1;
falling = 0;
distmarker = 1;
mytravel = 77;
sphereAway3D.x = (sphereAway3D.y = (sphereAway3D.z = 0));
glider.visible = true;
shadow.visible = true;
bluecrossX.visible = true;
myscores.visible = false;
}
private function menuclick1(_arg1:MouseEvent):void{
mymenu.instruct.visible = true;
}
private function menuclick2(_arg1:MouseEvent):void{
resetgame();
}
private function mouseClicked(_arg1:MouseEvent):void{
if ((((((gamestarted > 0)) && ((gameready > 50)))) && ((gameover < 1)))){
mouseP = 1;
if ((((falling == 0)) && ((jumped < 2)))){
if (jumped > 0){
channelXrev = s_jump1_.play(0, 1, transrev);
mytravel = (distmarker / 73);
} else {
mytravel = (distmarker / 67);
channelXrev = s_jump2_.play(0, 1, transrev);
};
jumped++;
gspeed = 800;
planeA.mouseEnabled = false;
glider.play({prefix:"run", fps:5.9, loop:false, smooth:true});
};
if ((((falling == 1)) && ((jumped == 0)))){
falling++;
mytravel = (distmarker / 15);
};
};
}
private function menuclick4(_arg1:MouseEvent):void{
mymenu.visible = false;
}
function demoArender():void{
sphereAway3D.rotationY = (sphereAway3D.rotationY + 2);
view.camera.moveTo(sphereAway3D.position);
view.camera.rotationY = (mouseX / 2);
view.camera.rotationX = (mouseY / 2);
view.camera.moveBackward(500);
}
private function menuclick3(_arg1:MouseEvent):void{
gamestarted = 0;
gameover = 0;
mymenu.me_start.visible = true;
mymenu.me_stats.visible = false;
mymenu.me_end.visible = false;
myscores.visible = false;
}
function lookY(_arg1, _arg2, _arg3):void{
_arg1.rotationY = (((Math.atan2((_arg1.x - _arg2.x), (_arg1.z - _arg2.z)) * 180) / Math.PI) + _arg3);
}
function MOFF(_arg1):void{
_arg1.mouseEnabled = false;
}
}
}//package
Section 136
//petemenu (petemenu)
package {
import flash.display.*;
public dynamic class petemenu extends MovieClip {
public var me_stats:MovieClip;
public var multi:mulitplayers;
public var me_start:MovieClip;
public var instruct:MovieClip;
public var me_end:MovieClip;
}
}//package
Section 137
//PeteScores (PeteScores)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.filters.*;
import flash.net.*;
class PeteScores extends Sprite {
var xname;// = "Testname"
var xxxxxo;
var hiscore:uint;// = 9991000
var thiscore;
var oldhiscore:uint;
var xgame;// = "sglider"
var xxo;
var xxxxo;
var sent:Number;// = 0
var mynewstring:String;
var xxxo;
function PeteScores(){
xgame = "sglider";
xname = "Testname";
hiscore = 9991000;
oldhiscore = hiscore;
sent = 0;
xxo = xgame.charAt(3);
xxxo = xgame.charAt(1);
xxxxo = xgame.charAt(2);
xxxxxo = xgame.charAt(0);
super();
SCOREEEE();
}
function doscoreX():void{
}
function xxxxx(_arg1, _arg2, _arg3){
return (_arg1.split(_arg2).join(_arg3));
}
function menuclickSCORE(_arg1:MouseEvent):void{
var url:String;
var request:URLRequest;
var event = _arg1;
SCOREEEE();
url = ((((((("http://www.free3darcade.com/scoresender.php?hiscore=" + oldhiscore) + "&xname=") + xname) + "&xgame=") + xgame) + "&date=") + thiscore);
request = new URLRequest(url);
try {
navigateToURL(request);
event.target.visible = false;
sent = 1;
} catch(e:Error) {
};
}
function sendscorex(){
var _local1:*;
var _local2:*;
_local2 = (xgame.length - 1);
while (_local2 > -1) {
_local1 = (_local1 + xgame.charAt(_local2));
_local2--;
};
return (_local1);
}
function doscore():void{
}
function SCOREEEE():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
mynewstring = ("" + (int((oldhiscore * 3)) + 10001));
thiscore = mynewstring;
_local1 = "";
_local2 = thiscore.length;
while (_local2 > -1) {
_local1 = (_local1 + thiscore.charAt(_local2));
_local2--;
};
thiscore = _local1;
_local3 = new Array("xxxxx", "xxx", "xxx", "xxx", "xxxxxxx", "xx", "xxxxxxxx", "xxxxuxxx", "xoxxx", "xxxxxxsxx");
_local4 = new Array("xxxxxx", "xixxx", "xxexxxx", "xxxxxxxxxx", "xxxox", "xxxxxa", "xxxxxrx", "xxxx", "xxxxxxxxxx", "xxkxxxx");
_local5 = new Array("li", "lll", "lv", "ly", "lu", "lp", "la", "le", "lw", "lh");
_local6 = new Array("xxxx", "xxixx", "oxxxxx", "xwxxxx", "xxxx", "nxxx", "xxxyxxx", "xxxxuxxx", "xoxxxxxx", "xxxxxxsxx");
_local7 = new Array("xxxxx", "xxxxxx", "xxexxx", "xwxxxx", "xxxxx", "xxxxxa", "xxxxx", "xxxx", "xexxx", "xxkxxxx");
_local8 = new Array(333333, 444444444444, 66666666666666, 77777);
_local9 = 10;
thiscore = String(thiscore);
thiscore = thiscore.split("");
thiscore = thiscore.join("_");
while (_local9 > -1) {
_local9--;
xxxxx(thiscore, "", _local5[_local9]);
};
_local10 = 0;
thiscore = thiscore.split("_");
_local11 = new Array();
_local12 = 0;
while (_local12 < thiscore.length) {
_local11[_local10] = thiscore[_local12];
_local10++;
_local11[_local10] = _local5[thiscore[_local12]];
_local10++;
_local12++;
};
thiscore = _local11.join("");
thiscore = String(thiscore);
thiscore = ((((xxo + xxxo) + xxxxo) + xxxxxo) + thiscore);
hiscore = thiscore;
}
}
}//package
Section 138
//Porcupine (Porcupine)
package {
import flash.utils.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.stats.*;
public class Porcupine extends Mesh {
private var uvarr:Array;
private var varr:Array;
private var fnarr:Array;
private var scaling:Number;
public function Porcupine(_arg1:Object=null){
varr = [];
uvarr = [];
fnarr = [];
super(_arg1);
_arg1 = Init.parse(_arg1);
scaling = _arg1.getNumber("scaling", 1);
build();
}
private function f(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int):void{
addFace(new Face(varr[_arg1], varr[_arg2], varr[_arg3], null, uvarr[_arg4], uvarr[_arg5], uvarr[_arg6]));
}
private function build():void{
var _local1:Object;
var _local2:int;
var _local3:int;
var _local4:Frame;
var _local5:int;
var _local6:VertexPosition;
v();
uv(0.675, 0.4);
uv(0.8525, 0.0225);
uv(0.83, 0.935);
uv(0.995, 0.44);
uv(0.3575, 0.0375);
uv(0.6875, 0.2375);
uv(0.3775, 0.3925);
uv(0.045, 0.23);
uv(0.665, 0.4325);
uv(0.02, 0.395);
uv(0.0175, 0.5325);
uv(0.515, 0.5);
uv(0.7425, 0.7925);
uv(0.44, 0.765);
uv(0.5, 0.985);
uv(0.1375, 0.55);
uv(0.015, 0.6775);
uv(0.3275, 0.91);
uv(0.43, 0.8925);
uv(0.815, 0.4125);
uv(0.8775, 0.4225);
uv(0.9425, 0.4);
f(51, 54, 52, 0, 1, 2);
f(53, 52, 54, 3, 2, 1);
f(6, 5, 17, 4, 5, 6);
f(6, 17, 7, 4, 6, 7);
f(8, 7, 18, 8, 9, 10);
f(8, 18, 9, 8, 10, 9);
f(10, 9, 19, 4, 7, 6);
f(10, 19, 11, 4, 6, 5);
f(12, 11, 20, 4, 7, 6);
f(12, 20, 13, 4, 6, 5);
f(16, 15, 22, 4, 5, 6);
f(16, 22, 5, 4, 6, 7);
f(13, 21, 1, 11, 12, 13);
f(1, 21, 23, 13, 12, 14);
f(15, 24, 21, 11, 13, 12);
f(24, 23, 21, 13, 14, 12);
f(14, 0, 24, 15, 16, 13);
f(15, 14, 24, 11, 15, 13);
f(13, 1, 14, 11, 13, 15);
f(14, 1, 0, 15, 13, 16);
f(0, 2, 24, 16, 17, 13);
f(0, 1, 2, 16, 13, 17);
f(1, 4, 2, 13, 18, 17);
f(1, 23, 4, 13, 14, 18);
f(2, 4, 23, 17, 18, 14);
f(24, 3, 23, 13, 18, 14);
f(24, 2, 3, 13, 17, 18);
f(2, 23, 3, 17, 14, 18);
f(25, 26, 27, 19, 0, 2);
f(25, 27, 28, 0, 2, 3);
f(26, 29, 27, 0, 1, 2);
f(28, 27, 29, 3, 2, 1);
f(30, 31, 32, 20, 2, 0);
f(30, 33, 31, 20, 3, 2);
f(32, 31, 34, 0, 2, 1);
f(33, 34, 31, 3, 1, 2);
f(35, 36, 37, 3, 0, 2);
f(35, 37, 38, 3, 2, 21);
f(36, 39, 37, 0, 1, 2);
f(38, 37, 39, 21, 2, 1);
f(40, 41, 42, 0, 3, 2);
f(40, 42, 43, 19, 2, 0);
f(41, 44, 42, 3, 1, 2);
f(43, 42, 44, 0, 2, 1);
f(45, 46, 47, 3, 21, 2);
f(45, 47, 48, 3, 2, 0);
f(46, 49, 47, 21, 1, 2);
f(48, 47, 49, 0, 2, 1);
f(50, 51, 52, 20, 0, 2);
f(50, 52, 53, 20, 2, 3);
frames = new Dictionary();
framenames = new Dictionary();
_local1 = new Object();
_local1.walk1 = [21.2973, 243.7872, 518.2952, -93.5031, 321.5121, 207.4137, 21.2973, 373.3287, 287.8141, 143.7511, 430.3269, 255.6539, -104.9832, 430.3269, 255.6539, 381.0054, 166.0624, -162.4282, 315.9518, 2.8402, -414.3494, 116.9644, 166.0624, -521.55, 21.2973, 114.2458, -848.5116, -78.1964, 166.0624, -521.55, -277.1838, 2.8402, -414.3494, -342.2374, 166.0624, -162.4282, -277.1838, 2.8402, 89.4931, -101.1565, 140.1541, 159.1734, 21.2973, 158.2899, 432.5348, 139.9245, 140.1541, 159.1734, 315.9518, 2.8402, 89.4931, 243.2449, 316.3304, -317.869, 21.2973, 243.7872, -467.9497, -204.4769, 316.3304, -317.869, -204.4769, 370.7378, -6.9874, 21.2973, 339.6479, 3.7326, 243.2449, 370.7378, -6.9874, 21.2973, 412.1911, 196.6936, 132.2711, 321.5121, 207.4137, -78.1964, 166.0624, -521.55, 21.2973, 243.7872, -467.9497, -250.3971, 544.3234, -591.2303, -204.4769, 316.3304, -317.869, 21.2973, 438.0994, -162.4282, 381.0054, 166.0624, -162.4282, 507.2859, 663.5015, -232.1085, 243.2449, 316.3304, -317.869, 243.2449, 370.7378, -6.9874, 21.2973, 438.0994, -162.4282, -101.1565, 140.1541, 159.1734, -204.4769, 370.7378, -6.9874, -250.3971, 637.5932, 223.4937, 21.2973, 339.6479, 3.7326, 21.2973, 438.0994, -162.4282, 116.9644, 166.0624, -521.55, 243.2449, 316.3304, -317.869, 289.165, 544.3234, -591.2303, 21.2973, 243.7872, -467.9497, 21.2973, 438.0994, -162.4282, 139.9245, 140.1541, 159.1734, 21.2973, 339.6479, 3.7326, 289.165, 637.5932, 223.4937, 243.2449, 370.7378, -6.9874, 21.2973, 438.0994, -162.4282, -342.2374, 166.0624, -162.4282, -204.4769, 316.3304, -317.869, -468.5179, 663.5015, -232.1085, -204.4769, 370.7378, -6.9874, 21.2973, 438.0994, -162.4282];
_local1.walk2 = [-35.6543, 243.2968, 509.7428, -171.322, 321.5958, 213.2264, -54.4971, 373.7951, 283.3121, 66.0964, 428.6044, 234.7912, -182.6276, 428.6044, 261.7473, 382.6542, 164.9977, -104.8548, 435.4138, 11.0097, -649.3668, 182.9213, 164.9977, -503.8042, -77.1083, 112.7984, -865.0151, -9.2745, 164.9977, -536.1515, -404.9718, 3.1798, -487.6306, -329.6009, 164.9977, -228.8526, -348.4436, 34.4994, 245.5737, -148.7107, 141.508, 132.3583, -43.1914, 159.7778, 428.8747, 88.7077, 141.508, 175.488, 476.8678, -2.0401, -18.5955, 273.3664, 316.3758, -282.7647, 77.402, 245.9067, -466.0658, -163.7849, 316.3758, -358.2416, -220.313, 371.1851, -45.5516, -1.7374, 339.8655, -2.4219, 216.8382, 371.1851, 29.9254, -62.0341, 412.9446, 191.6616, 51.0222, 321.5958, 191.6616, -9.2745, 164.9977, -536.1515, 77.402, 245.9067, -466.0658, -163.7849, 546.0529, -633.1932, -163.7849, 316.3758, -358.2416, 24.6424, 436.4343, -164.1581, 382.6542, 164.9977, -104.8548, 518.3218, 663.5015, -147.9845, 273.3664, 316.3758, -282.7647, 216.8382, 371.1851, 29.9254, 24.6424, 436.4343, -164.1581, -148.7107, 141.508, 132.3583, -220.313, 371.1851, -45.5516, -306.9896, 637.4018, 170.0968, -1.7374, 339.8655, -2.4219, 24.6424, 436.4343, -164.1581, 182.9213, 164.9977, -503.8042, 273.3664, 316.3758, -282.7647, 363.8115, 546.0529, -536.1515, 77.402, 245.9067, -466.0658, 24.6424, 436.4343, -164.1581, 88.7077, 141.508, 175.488, -1.7374, 339.8655, -2.4219, 224.3753, 637.4018, 261.7473, 216.8382, 371.1851, 29.9254, 24.6424, 436.4343, -164.1581, -329.6009, 164.9977, -228.8526, -163.7849, 316.3758, -358.2416, -442.6572, 663.5015, -315.1119, -220.313, 371.1851, -45.5516, 24.6424, 436.4343, -164.1581];
_local1.walk3 = [21.2973, 244.8374, 518.2952, -93.5031, 322.8493, 206.9201, 21.2973, 372.2569, 288.8609, 143.7511, 429.4656, 256.0846, -104.9832, 429.4656, 256.0846, 381.0054, 166.8255, -164.5449, 434.5789, 3.0004, -563.3235, 116.9644, 166.8255, -525.0845, 25.124, 114.8175, -874.6986, -78.1964, 166.8255, -525.0845, -399.6376, 3.0004, -563.3235, -342.2374, 166.8255, -164.5449, -422.5977, 0.4, 114.0539, -101.1565, 140.8215, 157.7556, 21.2973, 159.0243, 436.3544, 139.9244, 140.8215, 157.7556, 488.1524, 0.4, 86.7403, 243.2448, 315.0481, -322.9638, 21.2973, 244.8374, -470.4573, -204.4769, 315.0481, -322.9638, -204.4769, 369.6565, -6.126, 21.2973, 341.0521, 4.7994, 243.2448, 369.6565, -6.126, 21.2973, 413.8633, 201.4574, 132.2711, 322.8493, 206.9201, -78.1964, 166.8255, -525.0845, 21.2973, 244.8374, -470.4573, -250.397, 543.8831, -590.6371, -204.4769, 315.0481, -322.9638, 21.2973, 437.2668, -164.5449, 381.0054, 166.8255, -164.5449, 507.2858, 663.5014, -230.0976, 243.2448, 315.0481, -322.9638, 243.2448, 369.6565, -6.126, 21.2973, 437.2668, -164.5449, -101.1565, 140.8215, 157.7556, -204.4769, 369.6565, -6.126, -250.397, 637.4975, 223.3083, 21.2973, 341.0521, 4.7994, 21.2973, 437.2668, -164.5449, 116.9644, 166.8255, -525.0845, 243.2448, 315.0481, -322.9638, 289.165, 543.8831, -590.6371, 21.2973, 244.8374, -470.4573, 21.2973, 437.2668, -164.5449, 139.9244, 140.8215, 157.7556, 21.2973, 341.0521, 4.7994, 289.165, 637.4975, 223.3083, 243.2448, 369.6565, -6.126, 21.2973, 437.2668, -164.5449, -342.2374, 166.8255, -164.5449, -204.4769, 315.0481, -322.9638, -468.5179, 663.5014, -230.0976, -204.4769, 369.6565, -6.126, 21.2973, 437.2668, -164.5449];
_local1.walk4 = [86.0313, 243.2967, 508.6822, -4.1817, 321.5957, 191.373, 101.7205, 373.7951, 277.4229, 227.2343, 428.6044, 255.9104, -23.7932, 428.6044, 239.7761, 368.4372, 164.9977, -233.4987, 470.4171, -2.0402, -513.161, 38.9637, 164.9977, -534.6735, 66.4198, 112.7984, -862.739, -153.2292, 164.9977, -497.0267, -451.3243, 3.1797, -674.5047, -345.4221, 164.9977, -93.6675, -521.9258, 3.1797, 35.4074, -47.327, 141.508, 175.2386, 89.9536, 159.7778, 428.0104, 191.9335, 141.508, 126.8355, 395.8933, 5.7897, 239.7761, 199.7781, 316.3758, -362.5736, -47.327, 245.9067, -464.7579, -235.5976, 316.3758, -276.5237, -176.763, 371.1851, 35.4074, 42.886, 339.8655, -2.2394, 258.6127, 371.1851, -50.6425, 105.6429, 412.9446, 191.373, 219.3897, 321.5957, 207.5073, -153.2292, 164.9977, -497.0267, -47.327, 245.9067, -464.7579, -333.6552, 546.0529, -534.6735, -235.5976, 316.3758, -276.5237, 11.5076, 436.4343, -163.5831, 368.4372, 164.9977, -233.4987, 478.2617, 663.5014, -324.9268, 199.7781, 316.3758, -362.5736, 258.6127, 371.1851, -50.6425, 11.5076, 436.4343, -163.5831, -47.327, 141.508, 175.2386, -176.763, 371.1851, 35.4074, -176.763, 637.4018, 266.6667, 42.886, 339.8655, -2.2394, 11.5076, 436.4343, -163.5831, 38.9637, 164.9977, -534.6735, 199.7781, 316.3758, -362.5736, 195.8558, 546.0529, -636.8579, -47.327, 245.9067, -464.7579, 11.5076, 436.4343, -163.5831, 191.9335, 141.508, 126.8355, 42.886, 339.8655, -2.2394, 348.8257, 637.4018, 164.4824, 258.6127, 371.1851, -50.6425, 11.5076, 436.4343, -163.5831, -345.4221, 164.9977, -93.6675, -235.5976, 316.3758, -276.5237, -478.7804, 663.5014, -136.6925, -176.763, 371.1851, 35.4074, 11.5076, 436.4343, -163.5831];
fnarr = ["walk1", "walk2", "walk3", "walk4"];
_local5 = 0;
while (_local5 < fnarr.length) {
trace((("[ " + fnarr[_local5]) + " ]"));
_local4 = new Frame();
framenames[fnarr[_local5]] = _local5;
frames[_local5] = _local4;
_local3 = 0;
_local2 = 0;
while (_local2 < _local1[fnarr[_local5]].length) {
_local6 = new VertexPosition(varr[_local3]);
_local3++;
_local6.x = (_local1[fnarr[_local5]][_local2] * scaling);
_local6.y = (_local1[fnarr[_local5]][(_local2 + 1)] * scaling);
_local6.z = (_local1[fnarr[_local5]][(_local2 + 2)] * scaling);
_local4.vertexpositions.push(_local6);
_local2 = (_local2 + 3);
};
if (_local5 == 0){
_local4.adjust();
};
_local5++;
};
}
private function uv(_arg1:Number, _arg2:Number):void{
uvarr.push(new UV(_arg1, _arg2));
}
private function v():void{
var _local1:int;
_local1 = 0;
while (_local1 < 55) {
varr.push(new Vertex(0, 0, 0));
_local1++;
};
}
}
}//package
Section 139
//porky (porky)
package {
import flash.display.*;
public dynamic class porky extends BitmapData {
public function porky(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 140
//Ppball (Ppball)
package {
import flash.events.*;
import flash.display.*;
public dynamic class Ppball {
var pspeedz:Number;
var pregdamp;// = 0.97
var pspeedy:Number;
var psuperstop;// = 0.2
var pspeedx:Number;
var pinitspeedx;// = 10
var pinitspeedy;// = 10
var pinitspeedz;// = 10
var pdist:Number;
var lasty:Number;
var Xpspeedx;// = 0
var Xpspeedy;// = 0
var Xpspeedz;// = 0
var lastx:Number;
var lastz:Number;
var Xmass;// = 100000000000
var pinitgravity:Number;// = 20
var pgravity:Number;
var psuperdamp;// = 0.9
var ballstopped;// = 0
private var pballstage:Stage;
var pstop;
var mass;// = 1E-6
public function Ppball(){
Xpspeedx = 0;
Xpspeedy = 0;
Xpspeedz = 0;
pinitspeedx = 10;
pinitspeedz = 10;
pinitspeedy = 10;
pregdamp = 0.97;
psuperdamp = 0.9;
psuperstop = 0.2;
pspeedx = pinitspeedx;
pspeedz = pinitspeedy;
pspeedy = pinitspeedz;
mass = 1E-6;
Xmass = 100000000000;
ballstopped = 0;
pinitgravity = 20;
pgravity = pinitgravity;
super();
}
function doball(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13):void{
var _local14:Number;
_local14 = (3 - (Math.random() * 6));
lastx = _arg1.x;
lasty = _arg1.y;
lastz = _arg1.z;
if (_arg3){
if (_arg13){
doboxhit(_arg1, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12);
};
if ((((((pspeedy < 10)) && ((pspeedy > -10)))) && ((_arg1.y < (_arg9 + 100))))){
pspeedx = 0;
pspeedz = 0;
pspeedy = 0;
} else {
if ((_arg1.y < _arg9)){
pspeedy = (pspeedy * -1);
pspeedx = (pspeedx * _arg5);
pspeedy = (pspeedy * _arg6);
pspeedz = (pspeedz * _arg5);
_arg1.y = _arg9;
pgravity = (pgravity * _arg5);
} else {
_arg1.moveUp(pspeedy);
_arg1.moveLeft(pspeedx);
_arg1.moveForward(pspeedz);
pspeedx = (pspeedx * _arg4);
pspeedz = (pspeedz * _arg4);
pspeedy = ((pspeedy * _arg4) - pgravity);
};
};
if (_arg2 != "single"){
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
_arg2.z = _arg1.z;
};
};
}
function returnyspeed():void{
}
function shootball(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6):void{
ballstopped = 0;
lastx = (_arg1.x = (_arg2.x - _arg4));
lasty = (_arg1.y = (_arg2.y - _arg5));
lastz = (_arg1.z = (_arg2.z - _arg6));
pspeedx = (_arg1.x - _arg2.x);
pspeedy = (_arg1.y - _arg2.y);
pspeedz = (_arg1.z - _arg2.z);
_arg1.x = (_arg2.x + pspeedx);
_arg1.y = (_arg2.y + pspeedy);
_arg1.z = (_arg2.z + pspeedz);
pgravity = pinitgravity;
}
function doboxhit(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7):void{
if (_arg1.y < 0){
};
if (_arg1.z < _arg6){
_arg1.z = _arg6;
pspeedz = (pspeedz * -1);
pspeedx = (pspeedx * pregdamp);
pspeedy = (pspeedy * pregdamp);
};
if (_arg1.z > _arg7){
_arg1.z = _arg7;
pspeedz = (pspeedz * -1);
pspeedx = (pspeedx * pregdamp);
pspeedy = (pspeedy * pregdamp);
};
if (_arg1.x < _arg2){
_arg1.x = _arg2;
pspeedx = (pspeedx * -1);
pspeedz = (pspeedz * pregdamp);
pspeedy = (pspeedy * pregdamp);
};
if (_arg1.x > _arg3){
_arg1.x = _arg3;
pspeedx = (pspeedx * -1);
pspeedz = (pspeedz * pregdamp);
pspeedy = (pspeedy * pregdamp);
};
if (_arg1.y < _arg4){
_arg1.y = _arg4;
pspeedy = (pspeedy * -1);
pspeedx = (pspeedx * pregdamp);
pspeedz = (pspeedz * pregdamp);
};
if (_arg1.y > _arg5){
_arg1.y = _arg5;
pspeedy = (pspeedy * -1);
pspeedx = (pspeedx * pregdamp);
pspeedz = (pspeedz * pregdamp);
pspeedy = (pspeedy * psuperdamp);
};
}
function ballBallReaction(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6):void{
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
var _local16:*;
var _local17:*;
var _local18:*;
var _local19:*;
var _local20:*;
var _local21:*;
var _local22:*;
var _local23:*;
var _local24:*;
var _local25:*;
var _local26:*;
var _local27:*;
var _local28:*;
var _local29:*;
_local7 = (_arg2.x - _arg1.x);
_local8 = (_arg2.y - _arg1.y);
_local9 = (_arg2.z - _arg1.z);
_local10 = Math.atan2(_local8, _local7);
_local11 = Math.atan2(_local8, _local9);
_local12 = Math.cos(_local10);
_local13 = Math.sin(_local10);
_local14 = Math.sin(_local10);
_local15 = Math.cos(_local11);
_local16 = Math.sin(_local11);
_local17 = Math.sin(_local11);
if (_arg3 != "single"){
Xpspeedx = _arg3.pspeedx;
Xpspeedy = _arg3.pspeedy;
Xpspeedz = _arg3.pspeedz;
};
_local18 = ((_local12 * pspeedx) + (_local13 * pspeedy));
_local19 = ((_local12 * pspeedy) - (_local13 * pspeedx));
_local20 = ((_local15 * pspeedy) - (_local16 * pspeedz));
_local21 = ((_local12 * Xpspeedx) + (_local13 * Xpspeedy));
_local22 = ((_local12 * Xpspeedy) - (_local13 * Xpspeedx));
_local23 = ((_local15 * Xpspeedy) - (_local16 * Xpspeedz));
_local24 = ((_local18 * mass) + (_local21 * Xmass));
_local25 = (_local18 - _local21);
_local18 = ((_local24 - (Xmass * _local25)) / (mass + Xmass));
_local21 = (_local25 + _local18);
pspeedz = -(((_local15 * _local19) + (_local16 * _local20)));
_local26 = (((_arg5 + _arg5) - _arg6) / 2);
_local27 = (_local12 * _local26);
_local28 = (_local13 * _local26);
_local29 = (_local16 * _local26);
_arg1.x = lastx;
_arg1.y = lasty;
_arg1.z = lastz;
_arg1.x = (_arg1.x - (_local27 / 1.5));
_arg1.y = (_arg1.y - (_local28 / 1.5));
_arg1.z = (_arg1.z - (_local29 / 1.5));
if (_arg4 > -10){
};
}
function hitpcheck(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7):void{
pdist = Math.sqrt(((((_arg2.x - _arg1.x) * (_arg2.x - _arg1.x)) + ((_arg2.y - _arg1.y) * (_arg2.y - _arg1.y))) + ((_arg2.z - _arg1.z) * (_arg2.z - _arg1.z))));
if (pdist < _arg5){
ballBallReaction(_arg1, _arg2, _arg3, _arg4, _arg6, _arg7);
};
}
function ballBallReactionFUCKED(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6):void{
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:*;
var _local16:*;
var _local17:*;
var _local18:*;
var _local19:*;
var _local20:*;
var _local21:*;
var _local22:*;
var _local23:*;
var _local24:*;
var _local25:*;
var _local26:*;
var _local27:*;
var _local28:*;
var _local29:*;
_local7 = (_arg2.x - _arg1.x);
_local8 = (_arg2.y - _arg1.y);
_local9 = (_arg2.z - _arg1.z);
_local10 = Math.atan2(_local8, _local7);
_local11 = Math.atan2(_local8, _local9);
_local12 = Math.cos(_local10);
_local13 = Math.sin(_local10);
_local14 = Math.sin(_local10);
_local15 = Math.cos(_local11);
_local16 = Math.sin(_local11);
_local17 = Math.sin(_local11);
if (_arg3 != "single"){
Xpspeedx = _arg3.pspeedx;
Xpspeedy = _arg3.pspeedy;
Xpspeedz = _arg3.pspeedz;
};
_local18 = ((_local12 * pspeedx) + (_local13 * pspeedy));
_local19 = ((_local12 * pspeedy) - (_local13 * pspeedx));
_local20 = ((_local15 * pspeedy) - (_local16 * pspeedz));
_local21 = ((_local12 * Xpspeedx) + (_local13 * Xpspeedy));
_local22 = ((_local12 * Xpspeedy) - (_local13 * Xpspeedx));
_local23 = ((_local15 * Xpspeedy) - (_local16 * Xpspeedz));
_local24 = ((_local18 * mass) + (_local21 * Xmass));
_local25 = (_local18 - _local21);
_local18 = ((_local24 - (Xmass * _local25)) / (mass + Xmass));
_local21 = (_local25 + _local18);
pspeedx = -(((_local12 * _local18) - (_local13 * _local19)));
pspeedy = ((_local12 * _local19) + (_local13 * _local18));
pspeedz = -(((_local15 * _local19) + (_local16 * _local20)));
_local26 = (((_arg5 + _arg5) - _arg6) / 2);
_local27 = (_local12 * _local26);
_local28 = (_local13 * _local26);
_local29 = (_local14 * _local26);
if (_arg4 > -10){
};
}
}
}//package
Section 141
//Preloader (Preloader)
package {
import flash.events.*;
import flash.display.*;
import com.newgrounds.*;
import flash.net.*;
public class Preloader extends MovieClip {
var loaderbar:LoaderBar;
var wait:Number;// = 0
var ng_API;
var swh:Number;// = 400
var swd:Number;// = 600
var movie_id;
var adfinished:Number;// = 0
var checkurlvar;// = 1
var ADSHOW:Number;// = 1
var ng_api;
var ad_loader:URLLoader;
var perstart:Number;// = 0.17
var MyHelloWorld;
var ng_global;
var NG_LIB_MC;
public function Preloader(){
swd = 600;
swh = 400;
wait = 0;
perstart = 0.17;
ADSHOW = 1;
adfinished = 0;
checkurlvar = 1;
super();
addFrameScript(0, frame1, 1, frame2);
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.frameRate = 60;
NGAD(this);
addChild((loaderbar = new LoaderBar()));
loaderbar.visible = false;
}
function loadgame(_arg1:Event){
NG_LIB_MC.visible = false;
ad_finished();
addEventListener(Event.ENTER_FRAME, finishload);
}
function loadNGSite(_arg1:Event){
ng_API.LoadNewgrounds();
}
function ad_finished():void{
trace("ad finished");
adfinished = 1;
}
function frame2(){
stop();
}
function startAd(_arg1){
ad_loader = new URLLoader(new URLRequest(_arg1));
ad_loader.addEventListener(Event.COMPLETE, ad_Loaded);
}
function COMP_(_arg1:Event):void{
getpercent(_arg1.target);
}
function getpercent(_arg1){
var _local2:int;
var _local3:int;
var _local4:int;
_local2 = _arg1.bytesLoaded;
_local3 = _arg1.bytesTotal;
_local4 = (((_local2 - (_local3 * perstart)) / (_local3 - (_local3 * perstart))) * 100);
loaderbar.visible = true;
loaderbar.y = (swh / 2);
loaderbar.bar.x = 50;
loaderbar.bar.scaleX = (((swd - 100) / 100) * (_local4 / 100));
loaderbar.percent.x = ((swd - 100) * (_local4 / 100));
loaderbar.percent.text = ((" " + _local4) + "%");
loaderbar.total.text = (_local3 + " k");
loaderbar.prog.text = (("" + _local2) + " k");
if (_local4 >= 100){
} else {
return (_local4);
};
}
function loadAWAYSite(_arg1:Event){
var urla:String;
var requesta:URLRequest;
var event = _arg1;
urla = "http://www.away3d.com";
requesta = new URLRequest(urla);
try {
navigateToURL(requesta);
} catch(e:Error) {
};
}
function PROG_(_arg1:ProgressEvent):void{
getpercent(_arg1.target);
}
function frame1(){
play();
}
function checkurl(_arg1:Event):void{
var e = _arg1;
try {
checkurlvar++;
if (checkurlvar > 3){
if (ng_global.getData("ad_url")){
startAd(ng_global.getData("ad_url"));
removeEventListener(Event.ENTER_FRAME, checkurl);
};
};
} catch(e:Error) {
};
}
function finishedrender(_arg1:Event):void{
MyHelloWorld.renderme(this);
}
function NGAD(_arg1):void{
var _local2:Date;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = new Date();
_local3 = _local2.getMonth();
_local4 = _local2.getDate();
_local5 = _local2.getFullYear();
trace("Pete is ruling flash on ", _local4, _local3, _local5);
if ((((((_local3 > 0)) && ((_local4 > 0)))) && ((_local5 > 2007)))){
ADSHOW = 1;
};
if (ADSHOW > 0){
ng_global = new Newgrounds_Global();
ng_api = ng_global.getData("API");
movie_id = 40;
trace("<<<<<<<<<<<<<<<<<<<LINFO");
ng_API = new NewgroundsAPI_AS3(movie_id, loaderInfo.url);
NG_LIB_MC = new newgrounds();
_arg1.addChild(NG_LIB_MC);
NG_LIB_MC.x = (swd / 2);
NG_LIB_MC.y = ((swh / 2) + 15);
NG_LIB_MC.ng_play.NGButton.addEventListener(MouseEvent.CLICK, loadgame);
NG_LIB_MC.NG_Button.addEventListener(MouseEvent.CLICK, loadNGSite);
NG_LIB_MC.awaybutton.addEventListener(MouseEvent.CLICK, loadAWAYSite);
addEventListener(Event.ENTER_FRAME, checkurl);
trace("made ad");
};
}
function ad_Loaded(_arg1:Event){
var _local2:*;
var _local3:Loader;
trace("SAYS AD IS LOADDED!");
_local2 = String(_arg1.target.data);
_local3 = new Loader();
_local3.load(new URLRequest(_local2));
NG_LIB_MC.ng_ad.addChild(_local3);
NG_LIB_MC.ng_ad.NG_Logo.visible = false;
}
function finishload(_arg1:Event):void{
if (adfinished > 0){
if (wait == 16){
trace("about to make away3d game");
MyHelloWorld = new PeteGame();
MyHelloWorld.views(this, "demoC");
} else {
if (wait > 16){
addEventListener(Event.ENTER_FRAME, finishedrender);
removeEventListener(Event.ENTER_FRAME, finishload);
};
};
wait++;
};
loaderbar.visible = false;
}
}
Security.allowDomain("70.87.128.99");
Security.allowInsecureDomain("70.87.128.99");
Security.allowDomain("ads.shizmoo.com");
Security.allowInsecureDomain("ads.shizmoo.com");
Security.allowDomain("www.cpmstar.com");
Security.allowInsecureDomain("www.cpmstar.com");
Security.allowDomain("server.cpmstar.com");
var _local1:* = Security.allowInsecureDomain("server.cpmstar.com");
return (_local1);
}//package
Section 142
//s_bark (s_bark)
package {
import flash.media.*;
public dynamic class s_bark extends Sound {
}
}//package
Section 143
//s_chat (s_chat)
package {
import flash.media.*;
public dynamic class s_chat extends Sound {
}
}//package
Section 144
//s_hurt (s_hurt)
package {
import flash.media.*;
public dynamic class s_hurt extends Sound {
}
}//package
Section 145
//s_intro (s_intro)
package {
import flash.media.*;
public dynamic class s_intro extends Sound {
}
}//package
Section 146
//s_jump1 (s_jump1)
package {
import flash.media.*;
public dynamic class s_jump1 extends Sound {
}
}//package
Section 147
//s_jump2 (s_jump2)
package {
import flash.media.*;
public dynamic class s_jump2 extends Sound {
}
}//package
Section 148
//s_points (s_points)
package {
import flash.media.*;
public dynamic class s_points extends Sound {
}
}//package
Section 149
//s_power (s_power)
package {
import flash.media.*;
public dynamic class s_power extends Sound {
}
}//package
Section 150
//s_powerb (s_powerb)
package {
import flash.media.*;
public dynamic class s_powerb extends Sound {
}
}//package
Section 151
//s_warn (s_warn)
package {
import flash.media.*;
public dynamic class s_warn extends Sound {
}
}//package
Section 152
//scorepanel (scorepanel)
package {
import flash.display.*;
import flash.text.*;
public dynamic class scorepanel extends MovieClip {
public var xname:TextField;
public var highestscore:TextField;
public var score:TextField;
public var go:SimpleButton;
public function scorepanel(){
addFrameScript(8, frame9, 19, frame20);
}
function frame20(){
stop();
}
function frame9(){
stop();
}
}
}//package
Section 153
//scroll_blade (scroll_blade)
package {
import flash.display.*;
public dynamic class scroll_blade extends BitmapData {
public function scroll_blade(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 154
//scroll_far (scroll_far)
package {
import flash.display.*;
public dynamic class scroll_far extends BitmapData {
public function scroll_far(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 155
//scroll_floorA (scroll_floorA)
package {
import flash.display.*;
public dynamic class scroll_floorA extends BitmapData {
public function scroll_floorA(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 156
//scroll_grass (scroll_grass)
package {
import flash.display.*;
public dynamic class scroll_grass extends BitmapData {
public function scroll_grass(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 157
//scroll_grassmap (scroll_grassmap)
package {
import flash.display.*;
public dynamic class scroll_grassmap extends BitmapData {
public function scroll_grassmap(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 158
//scroll_shrub (scroll_shrub)
package {
import flash.display.*;
public dynamic class scroll_shrub extends BitmapData {
public function scroll_shrub(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 159
//sg (sg)
package {
import flash.display.*;
public dynamic class sg extends BitmapData {
public function sg(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 160
//sga (sga)
package {
import flash.display.*;
public dynamic class sga extends BitmapData {
public function sga(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 161
//shd (shd)
package {
import flash.display.*;
public dynamic class shd extends BitmapData {
public function shd(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 162
//shd2 (shd2)
package {
import flash.display.*;
public dynamic class shd2 extends BitmapData {
public function shd2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 163
//signature (signature)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.text.*;
public dynamic class signature extends MovieClip {
public var A_now:Number;
public var A_fps:String;
public var A_old:Number;
public var AWAY3D_FPS:TextField;
public var A_now_old:Number;
public var A_current:Number;
public var A_current_calc:Number;
public var A_total:Number;
public function signature(){
addFrameScript(0, frame1);
}
function frame1(){
this.addEventListener(Event.ENTER_FRAME, AWAY3D);
A_old = getTimer();
A_now_old = getTimer();
A_total = 0;
}
public function AWAY3D(_arg1:Event):void{
A_current = getTimer();
A_now = (A_current - A_old);
A_current_calc = (A_current - A_now_old);
if (A_current_calc >= 1000){
A_fps = A_total.toString();
A_total = 0;
A_now_old = A_current;
} else {
A_total++;
};
A_old = A_current;
AWAY3D_FPS.text = (A_fps + " fps");
}
}
}//package
Section 164
//sky (sky)
package {
import flash.display.*;
public dynamic class sky extends BitmapData {
public function sky(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 165
//skyb (skyb)
package {
import flash.display.*;
public dynamic class skyb extends BitmapData {
public function skyb(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 166
//SkyBox (SkyBox)
package {
import away3d.core.mesh.*;
public class SkyBox extends Mesh {
private var uvarr:Array;
private var varr:Array;
public function SkyBox(_arg1:Object=null){
varr = [];
uvarr = [];
super(_arg1);
build();
}
private function f(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int):void{
addFace(new Face(varr[_arg1], varr[_arg2], varr[_arg3], null, uvarr[_arg4], uvarr[_arg5], uvarr[_arg6]));
}
private function build():void{
v(2500, 833, -2500);
v(833, 833, -2500);
v(2500, 2500, -2500);
v(833, 2500, -2500);
v(-833, 833, -2500);
v(-833, 2500, -2500);
v(-2500, 833, -2500);
v(-2500, 2500, -2500);
v(-2500, 2500, 2500);
v(-2500, 833, 2500);
v(-833, 2500, 2500);
v(-833, 833, 2500);
v(833, 2500, 2500);
v(833, 833, 2500);
v(2500, 2500, 2500);
v(2500, 833, 2500);
v(2500, -833, -2500);
v(833, -833, -2500);
v(-833, -833, -2500);
v(-2500, -833, -2500);
v(-2500, -833, 2500);
v(-833, -833, 2500);
v(833, -833, 2500);
v(2500, -833, 2500);
v(2500, -2500, -2500);
v(833, -2500, -2500);
v(-833, -2500, -2500);
v(-2500, -2500, -2500);
v(-2500, -2500, 2500);
v(-833, -2500, 2500);
v(833, -2500, 2500);
v(2500, -2500, 2500);
v(-2500, 833, -833);
v(-2500, 2500, -833);
v(-2500, 833, 833);
v(-2500, 2500, 833);
v(2500, 2500, 833);
v(2500, 833, 833);
v(2500, 2500, -833);
v(2500, 833, -833);
v(-2500, -833, -833);
v(-2500, -833, 833);
v(2500, -833, 833);
v(2500, -833, -833);
v(-2500, -2500, -833);
v(-2500, -2500, 833);
v(2500, -2500, 833);
v(2500, -2500, -833);
v(833, 2500, -833);
v(833, 2500, 833);
v(-833, 2500, -833);
v(-833, 2500, 833);
v(833, -2500, -833);
v(833, -2500, 833);
v(-833, -2500, -833);
v(-833, -2500, 833);
uv(0, 0.835);
uv(0.11, 0.835);
uv(0, 1);
uv(0.11, 0.835);
uv(0.11, 1);
uv(0, 1);
uv(0.11, 0.835);
uv(0.222, 0.835);
uv(0.11, 1);
uv(0.222, 0.835);
uv(0.222, 1);
uv(0.11, 1);
uv(0.222, 0.835);
uv(0.332, 0.835);
uv(0.222, 1);
uv(0.332, 0.835);
uv(0.332, 1);
uv(0.222, 1);
uv(0.67, 1);
uv(0.67, 0.832);
uv(0.78, 1);
uv(0.67, 0.832);
uv(0.78, 0.832);
uv(0.78, 1);
uv(0.78, 1);
uv(0.78, 0.832);
uv(0.888, 1);
uv(0.78, 0.832);
uv(0.888, 0.832);
uv(0.888, 1);
uv(0.888, 1);
uv(0.888, 0.832);
uv(1, 1);
uv(0.888, 0.832);
uv(1, 0.832);
uv(1, 1);
uv(0, 0.67);
uv(0.11, 0.67);
uv(0, 0.835);
uv(0.11, 0.67);
uv(0.11, 0.835);
uv(0, 0.835);
uv(0.11, 0.67);
uv(0.222, 0.67);
uv(0.11, 0.835);
uv(0.222, 0.67);
uv(0.222, 0.835);
uv(0.11, 0.835);
uv(0.222, 0.67);
uv(0.332, 0.67);
uv(0.222, 0.835);
uv(0.332, 0.67);
uv(0.332, 0.835);
uv(0.222, 0.835);
uv(0.67, 0.832);
uv(0.67, 0.668);
uv(0.78, 0.832);
uv(0.67, 0.668);
uv(0.78, 0.668);
uv(0.78, 0.832);
uv(0.78, 0.832);
uv(0.78, 0.668);
uv(0.888, 0.832);
uv(0.78, 0.668);
uv(0.888, 0.668);
uv(0.888, 0.832);
uv(0.888, 0.832);
uv(0.888, 0.668);
uv(1, 0.832);
uv(0.888, 0.668);
uv(1, 0.668);
uv(1, 0.832);
uv(0, 0.507);
uv(0.11, 0.507);
uv(0, 0.67);
uv(0.11, 0.507);
uv(0.11, 0.67);
uv(0, 0.67);
uv(0.11, 0.507);
uv(0.222, 0.507);
uv(0.11, 0.67);
uv(0.222, 0.507);
uv(0.222, 0.67);
uv(0.11, 0.67);
uv(0.222, 0.507);
uv(0.332, 0.507);
uv(0.222, 0.67);
uv(0.332, 0.507);
uv(0.332, 0.67);
uv(0.222, 0.67);
uv(0.67, 0.668);
uv(0.67, 0.505);
uv(0.78, 0.668);
uv(0.67, 0.505);
uv(0.78, 0.505);
uv(0.78, 0.668);
uv(0.78, 0.668);
uv(0.78, 0.505);
uv(0.888, 0.668);
uv(0.78, 0.505);
uv(0.888, 0.505);
uv(0.888, 0.668);
uv(0.888, 0.668);
uv(0.888, 0.505);
uv(1, 0.668);
uv(0.888, 0.505);
uv(1, 0.505);
uv(1, 0.668);
uv(0.333, 0.835);
uv(0.445, 0.835);
uv(0.333, 1);
uv(0.445, 0.835);
uv(0.445, 1);
uv(0.333, 1);
uv(0.445, 0.835);
uv(0.557, 0.835);
uv(0.445, 1);
uv(0.557, 0.835);
uv(0.557, 1);
uv(0.445, 1);
uv(0.557, 0.835);
uv(0.668, 0.835);
uv(0.557, 1);
uv(0.668, 0.835);
uv(0.668, 1);
uv(0.557, 1);
uv(0, 0.498);
uv(0, 0.335);
uv(0.11, 0.498);
uv(0, 0.335);
uv(0.11, 0.335);
uv(0.11, 0.498);
uv(0.11, 0.498);
uv(0.11, 0.335);
uv(0.22, 0.498);
uv(0.11, 0.335);
uv(0.22, 0.335);
uv(0.22, 0.498);
uv(0.22, 0.498);
uv(0.22, 0.335);
uv(0.33, 0.498);
uv(0.22, 0.335);
uv(0.33, 0.335);
uv(0.33, 0.498);
uv(0.333, 0.67);
uv(0.445, 0.67);
uv(0.333, 0.835);
uv(0.445, 0.67);
uv(0.445, 0.835);
uv(0.333, 0.835);
uv(0.445, 0.67);
uv(0.557, 0.67);
uv(0.445, 0.835);
uv(0.557, 0.67);
uv(0.557, 0.835);
uv(0.445, 0.835);
uv(0.557, 0.67);
uv(0.668, 0.67);
uv(0.557, 0.835);
uv(0.668, 0.67);
uv(0.668, 0.835);
uv(0.557, 0.835);
uv(0, 0.335);
uv(0, 0.17);
uv(0.11, 0.335);
uv(0, 0.17);
uv(0.11, 0.17);
uv(0.11, 0.335);
uv(0.11, 0.335);
uv(0.11, 0.17);
uv(0.22, 0.335);
uv(0.11, 0.17);
uv(0.22, 0.17);
uv(0.22, 0.335);
uv(0.22, 0.335);
uv(0.22, 0.17);
uv(0.33, 0.335);
uv(0.22, 0.17);
uv(0.33, 0.17);
uv(0.33, 0.335);
uv(0.333, 0.507);
uv(0.445, 0.507);
uv(0.333, 0.67);
uv(0.445, 0.507);
uv(0.445, 0.67);
uv(0.333, 0.67);
uv(0.445, 0.507);
uv(0.557, 0.507);
uv(0.445, 0.67);
uv(0.557, 0.507);
uv(0.557, 0.67);
uv(0.445, 0.67);
uv(0.557, 0.507);
uv(0.668, 0.507);
uv(0.557, 0.67);
uv(0.668, 0.507);
uv(0.668, 0.67);
uv(0.557, 0.67);
uv(0, 0.17);
uv(0, 0);
uv(0.11, 0.17);
uv(0, 0);
uv(0.11, 0);
uv(0.11, 0.17);
uv(0.11, 0.17);
uv(0.11, 0);
uv(0.22, 0.17);
uv(0.11, 0);
uv(0.22, 0);
uv(0.22, 0.17);
uv(0.22, 0.17);
uv(0.22, 0);
uv(0.33, 0.17);
uv(0.22, 0);
uv(0.33, 0);
uv(0.33, 0.17);
uv(0.555, 0.498);
uv(0.555, 0.335);
uv(0.665, 0.498);
uv(0.555, 0.335);
uv(0.665, 0.335);
uv(0.665, 0.498);
uv(0.555, 0.335);
uv(0.555, 0.17);
uv(0.665, 0.335);
uv(0.555, 0.17);
uv(0.665, 0.17);
uv(0.665, 0.335);
uv(0.555, 0.17);
uv(0.555, 0);
uv(0.665, 0.17);
uv(0.555, 0);
uv(0.665, 0);
uv(0.665, 0.17);
uv(0.445, 0.498);
uv(0.445, 0.335);
uv(0.555, 0.498);
uv(0.445, 0.335);
uv(0.555, 0.335);
uv(0.555, 0.498);
uv(0.445, 0.335);
uv(0.445, 0.17);
uv(0.555, 0.335);
uv(0.445, 0.17);
uv(0.555, 0.17);
uv(0.555, 0.335);
uv(0.445, 0.17);
uv(0.445, 0);
uv(0.555, 0.17);
uv(0.445, 0);
uv(0.555, 0);
uv(0.555, 0.17);
uv(0.335, 0.498);
uv(0.335, 0.335);
uv(0.445, 0.498);
uv(0.335, 0.335);
uv(0.445, 0.335);
uv(0.445, 0.498);
uv(0.335, 0.335);
uv(0.335, 0.17);
uv(0.445, 0.335);
uv(0.335, 0.17);
uv(0.445, 0.17);
uv(0.445, 0.335);
uv(0.335, 0.17);
uv(0.335, 0);
uv(0.445, 0.17);
uv(0.335, 0);
uv(0.445, 0);
uv(0.445, 0.17);
uv(0.672, 0.335);
uv(0.782, 0.335);
uv(0.672, 0.5);
uv(0.782, 0.335);
uv(0.782, 0.5);
uv(0.672, 0.5);
uv(0.672, 0.17);
uv(0.782, 0.17);
uv(0.672, 0.335);
uv(0.782, 0.17);
uv(0.782, 0.335);
uv(0.672, 0.335);
uv(0.672, 0.005);
uv(0.782, 0.005);
uv(0.672, 0.17);
uv(0.782, 0.005);
uv(0.782, 0.17);
uv(0.672, 0.17);
uv(0.782, 0.335);
uv(0.89, 0.335);
uv(0.782, 0.5);
uv(0.89, 0.335);
uv(0.89, 0.5);
uv(0.782, 0.5);
uv(0.782, 0.17);
uv(0.89, 0.17);
uv(0.782, 0.335);
uv(0.89, 0.17);
uv(0.89, 0.335);
uv(0.782, 0.335);
uv(0.782, 0.005);
uv(0.89, 0.005);
uv(0.782, 0.17);
uv(0.89, 0.005);
uv(0.89, 0.17);
uv(0.782, 0.17);
uv(0.89, 0.335);
uv(1, 0.335);
uv(0.89, 0.5);
uv(1, 0.335);
uv(1, 0.5);
uv(0.89, 0.5);
uv(0.89, 0.17);
uv(1, 0.17);
uv(0.89, 0.335);
uv(1, 0.17);
uv(1, 0.335);
uv(0.89, 0.335);
uv(0.89, 0.005);
uv(1, 0.005);
uv(0.89, 0.17);
uv(1, 0.005);
uv(1, 0.17);
uv(0.89, 0.17);
f(0, 1, 2, 0, 1, 2);
f(1, 3, 2, 3, 4, 5);
f(1, 4, 3, 6, 7, 8);
f(4, 5, 3, 9, 10, 11);
f(4, 6, 5, 12, 13, 14);
f(6, 7, 5, 15, 16, 17);
f(8, 9, 10, 18, 19, 20);
f(9, 11, 10, 21, 22, 23);
f(10, 11, 12, 24, 25, 26);
f(11, 13, 12, 27, 28, 29);
f(12, 13, 14, 30, 31, 32);
f(13, 15, 14, 33, 34, 35);
f(16, 17, 0, 36, 37, 38);
f(17, 1, 0, 39, 40, 41);
f(17, 18, 1, 42, 43, 44);
f(18, 4, 1, 45, 46, 47);
f(18, 19, 4, 48, 49, 50);
f(19, 6, 4, 51, 52, 53);
f(9, 20, 11, 54, 55, 56);
f(20, 21, 11, 57, 58, 59);
f(11, 21, 13, 60, 61, 62);
f(21, 22, 13, 63, 64, 65);
f(13, 22, 15, 66, 67, 68);
f(22, 23, 15, 69, 70, 71);
f(24, 25, 16, 72, 73, 74);
f(25, 17, 16, 75, 76, 77);
f(25, 26, 17, 78, 79, 80);
f(26, 18, 17, 81, 82, 83);
f(26, 27, 18, 84, 85, 86);
f(27, 19, 18, 87, 88, 89);
f(20, 28, 21, 90, 91, 92);
f(28, 29, 21, 93, 94, 95);
f(21, 29, 22, 96, 97, 98);
f(29, 30, 22, 99, 100, 101);
f(22, 30, 23, 102, 103, 104);
f(30, 31, 23, 105, 106, 107);
f(6, 32, 7, 108, 109, 110);
f(32, 33, 7, 111, 112, 113);
f(32, 34, 33, 114, 115, 116);
f(34, 35, 33, 117, 118, 119);
f(34, 9, 35, 120, 121, 122);
f(9, 8, 35, 123, 124, 125);
f(14, 15, 36, 126, 127, 128);
f(15, 37, 36, 129, 130, 131);
f(36, 37, 38, 132, 133, 134);
f(37, 39, 38, 135, 136, 137);
f(38, 39, 2, 138, 139, 140);
f(39, 0, 2, 141, 142, 143);
f(19, 40, 6, 144, 145, 146);
f(40, 32, 6, 147, 148, 149);
f(40, 41, 32, 150, 151, 152);
f(41, 34, 32, 153, 154, 155);
f(41, 20, 34, 156, 157, 158);
f(20, 9, 34, 159, 160, 161);
f(15, 23, 37, 162, 163, 164);
f(23, 42, 37, 165, 166, 167);
f(37, 42, 39, 168, 169, 170);
f(42, 43, 39, 171, 172, 173);
f(39, 43, 0, 174, 175, 176);
f(43, 16, 0, 177, 178, 179);
f(27, 44, 19, 180, 181, 182);
f(44, 40, 19, 183, 184, 185);
f(44, 45, 40, 186, 187, 188);
f(45, 41, 40, 189, 190, 191);
f(45, 28, 41, 192, 193, 194);
f(28, 20, 41, 195, 196, 197);
f(23, 31, 42, 198, 199, 200);
f(31, 46, 42, 201, 202, 203);
f(42, 46, 43, 204, 205, 206);
f(46, 47, 43, 207, 208, 209);
f(43, 47, 16, 210, 211, 212);
f(47, 24, 16, 213, 214, 215);
f(3, 48, 2, 216, 217, 218);
f(48, 38, 2, 219, 220, 221);
f(48, 49, 38, 222, 223, 224);
f(49, 36, 38, 225, 226, 227);
f(49, 12, 36, 228, 229, 230);
f(12, 14, 36, 231, 232, 233);
f(5, 50, 3, 234, 235, 236);
f(50, 48, 3, 237, 238, 239);
f(50, 51, 48, 240, 241, 242);
f(51, 49, 48, 243, 244, 245);
f(51, 10, 49, 246, 247, 248);
f(10, 12, 49, 249, 250, 251);
f(7, 33, 5, 252, 253, 254);
f(33, 50, 5, 0xFF, 0x0100, 0x0101);
f(33, 35, 50, 258, 259, 260);
f(35, 51, 50, 261, 262, 263);
f(35, 8, 51, 264, 265, 266);
f(8, 10, 51, 267, 268, 269);
f(47, 52, 24, 270, 271, 272);
f(52, 25, 24, 273, 274, 275);
f(46, 53, 47, 276, 277, 278);
f(53, 52, 47, 279, 280, 281);
f(31, 30, 46, 282, 283, 284);
f(30, 53, 46, 285, 286, 287);
f(52, 54, 25, 288, 289, 290);
f(54, 26, 25, 291, 292, 293);
f(53, 55, 52, 294, 295, 296);
f(55, 54, 52, 297, 298, 299);
f(30, 29, 53, 300, 301, 302);
f(29, 55, 53, 303, 304, 305);
f(54, 44, 26, 306, 307, 308);
f(44, 27, 26, 309, 310, 311);
f(55, 45, 54, 312, 313, 314);
f(45, 44, 54, 315, 316, 317);
f(29, 28, 55, 318, 319, 320);
f(28, 45, 55, 321, 322, 323);
}
private function uv(_arg1:Number, _arg2:Number):void{
uvarr.push(new UV(_arg1, _arg2));
}
private function v(_arg1:Number, _arg2:Number, _arg3:Number):void{
varr.push(new Vertex(_arg1, _arg2, _arg3));
}
}
}//package
Section 167
//smogstrip (smogstrip)
package {
import flash.display.*;
public dynamic class smogstrip extends BitmapData {
public function smogstrip(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 168
//spark1 (spark1)
package {
import flash.display.*;
public dynamic class spark1 extends BitmapData {
public function spark1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 169
//Star (Star)
package {
import flash.utils.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.stats.*;
public class Star extends Mesh {
private var uvarr:Array;
private var varr:Array;
private var fnarr:Array;
private var scaling:Number;
public function Star(_arg1:Object=null){
varr = [];
uvarr = [];
fnarr = [];
super(_arg1);
_arg1 = Init.parse(_arg1);
scaling = _arg1.getNumber("scaling", 1);
build();
}
private function f(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int):void{
addFace(new Face(varr[_arg1], varr[_arg2], varr[_arg3], null, uvarr[_arg4], uvarr[_arg5], uvarr[_arg6]));
}
private function build():void{
var _local1:Object;
var _local2:int;
var _local3:int;
var _local4:Frame;
var _local5:int;
var _local6:VertexPosition;
v();
uv(0.345, 0.665);
uv(0.5, 0.935);
uv(0.5, 0.47);
uv(0.65, 0.665);
uv(0.97, 0.615);
uv(0.745, 0.395);
uv(0.79, 0.095);
uv(0.5, 0.23);
uv(0.205, 0.095);
uv(0.25, 0.395);
uv(0.025, 0.615);
uv(0.65, 0.665);
uv(0.5, 0.47);
uv(0.5, 0.935);
uv(0.345, 0.665);
uv(0.025, 0.615);
uv(0.25, 0.395);
uv(0.205, 0.095);
uv(0.5, 0.23);
uv(0.79, 0.095);
uv(0.745, 0.395);
uv(0.97, 0.615);
f(1, 0, 10, 0, 1, 2);
f(10, 0, 9, 2, 1, 3);
f(10, 9, 8, 2, 3, 4);
f(7, 10, 8, 5, 2, 4);
f(6, 10, 7, 6, 2, 5);
f(6, 5, 10, 6, 7, 2);
f(4, 10, 5, 8, 2, 7);
f(4, 3, 10, 8, 9, 2);
f(3, 2, 10, 9, 10, 2);
f(2, 1, 10, 10, 0, 2);
f(1, 11, 0, 11, 12, 13);
f(11, 9, 0, 12, 14, 13);
f(11, 8, 9, 12, 15, 14);
f(7, 8, 11, 16, 15, 12);
f(6, 7, 11, 17, 16, 12);
f(6, 11, 5, 17, 12, 18);
f(4, 5, 11, 19, 18, 12);
f(4, 11, 3, 19, 12, 20);
f(3, 11, 2, 20, 12, 21);
f(2, 11, 1, 21, 12, 11);
frames = new Dictionary();
framenames = new Dictionary();
_local1 = new Object();
_local1.anim1 = [-0.4235, 307.5893, 1.1472, -0.4235, 106.8365, 76.8621, -0.4235, 95.9261, 292.5348, -0.4235, -41.5459, 125.0443, -0.4235, -248.845, 180.1097, -0.4235, -131.0118, 1.1472, -0.4235, -248.845, -180.1097, -0.4235, -41.5459, -125.0443, -0.4235, 95.9261, -292.5348, -0.4235, 106.8365, -76.8621, 107.9905, -0.0861, 1.1472, -107.9905, -0.0861, 1.1472];
_local1.anim2 = [-0.225, 425.3383, 1.5863, -0.225, 105.4909, 77.7314, -0.225, 132.6477, 404.5207, -0.225, -39.3457, 125.3221, -0.225, -344.1059, 249.0579, -0.225, -129.8685, 1.5863, -0.225, -344.1059, -249.0579, -0.225, -39.3457, -125.3221, -0.225, 132.6477, -404.5208, -0.225, 105.4909, -77.7314, 57.3699, -0.1191, 1.5863, -57.3699, -0.1191, 1.5863];
_local1.anim3 = [-0.4235, 307.5893, 1.1472, -0.4235, 106.8365, 76.8621, -0.4235, 95.9261, 292.5348, -0.4235, -41.5459, 125.0443, -0.4235, -248.845, 180.1097, -0.4235, -131.0118, 1.1472, -0.4235, -248.845, -180.1097, -0.4235, -41.5459, -125.0443, -0.4235, 95.9261, -292.5348, -0.4235, 106.8365, -76.8621, 107.9905, -0.0861, 1.1472, -107.9905, -0.0861, 1.1472];
fnarr = ["anim1", "anim2", "anim3"];
_local5 = 0;
while (_local5 < fnarr.length) {
trace((("[ " + fnarr[_local5]) + " ]"));
_local4 = new Frame();
framenames[fnarr[_local5]] = _local5;
frames[_local5] = _local4;
_local3 = 0;
_local2 = 0;
while (_local2 < _local1[fnarr[_local5]].length) {
_local6 = new VertexPosition(varr[_local3]);
_local3++;
_local6.x = (_local1[fnarr[_local5]][_local2] * scaling);
_local6.y = (_local1[fnarr[_local5]][(_local2 + 1)] * scaling);
_local6.z = (_local1[fnarr[_local5]][(_local2 + 2)] * scaling);
_local4.vertexpositions.push(_local6);
_local2 = (_local2 + 3);
};
if (_local5 == 0){
_local4.adjust();
};
_local5++;
};
}
private function uv(_arg1:Number, _arg2:Number):void{
uvarr.push(new UV(_arg1, _arg2));
}
private function v():void{
var _local1:int;
_local1 = 0;
while (_local1 < 12) {
varr.push(new Vertex(0, 0, 0));
_local1++;
};
}
}
}//package
Section 170
//star (star)
package {
import flash.display.*;
public dynamic class star extends BitmapData {
public function star(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 171
//star3 (star3)
package {
import flash.display.*;
public dynamic class star3 extends BitmapData {
public function star3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 172
//stopwatch (stopwatch)
package {
import flash.display.*;
public dynamic class stopwatch extends BitmapData {
public function stopwatch(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 173
//strip_clouds (strip_clouds)
package {
import flash.display.*;
public dynamic class strip_clouds extends MovieClip {
}
}//package
Section 174
//strip_smog (strip_smog)
package {
import flash.display.*;
public dynamic class strip_smog extends MovieClip {
}
}//package
Section 175
//strip_trees (strip_trees)
package {
import flash.display.*;
public dynamic class strip_trees extends MovieClip {
}
}//package
Section 176
//SugarGlider (SugarGlider)
package {
import flash.utils.*;
import away3d.core.mesh.*;
import away3d.core.utils.*;
import away3d.core.stats.*;
public class SugarGlider extends Mesh {
private var uvarr:Array;
private var varr:Array;
private var fnarr:Array;
private var scaling:Number;
public function SugarGlider(_arg1:Object=null){
varr = [];
uvarr = [];
fnarr = [];
super(_arg1);
_arg1 = Init.parse(_arg1);
scaling = _arg1.getNumber("scaling", 1);
build();
}
private function f(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int):void{
addFace(new Face(varr[_arg1], varr[_arg2], varr[_arg3], null, uvarr[_arg4], uvarr[_arg5], uvarr[_arg6]));
}
private function build():void{
var _local1:Object;
var _local2:int;
var _local3:int;
var _local4:Frame;
var _local5:int;
var _local6:VertexPosition;
v();
uv(0.52, 0.1225);
uv(0.655, 0.215);
uv(0.67, 0.0475);
uv(0.6875, 0.2325);
uv(0.66, 0.81);
uv(0.5875, 0.8525);
uv(0.7, 0.9);
uv(0.6925, 0.79);
uv(0.675, 0.9775);
uv(0.525, 0.9025);
uv(0.6875, 0.2325);
uv(0.7675, 0.0775);
uv(0.7725, 0.95);
uv(0.2275, 0.3375);
uv(0.3375, 0.36);
uv(0.2925, 0.1625);
uv(0.21, 0.1625);
uv(0.215, 0.8625);
uv(0.295, 0.8625);
uv(0.22, 0.6225);
uv(0.1875, 0.6675);
uv(0.2775, 0.4925);
uv(0.1825, 0.3575);
uv(0.2825, 0.535);
uv(0.1925, 0.4925);
uv(0.15, 0.4925);
uv(0.2175, 0.4025);
uv(0.2, 0.4225);
uv(0.2175, 0.4025);
uv(0.2, 0.4225);
uv(0.2625, 0.535);
uv(0.2025, 0.6025);
uv(0.23, 0.535);
uv(0.16, 0.175);
uv(0.155, 0.325);
uv(0.1625, 0.8475);
uv(0.1125, 0.68);
uv(0.94, 0.51);
uv(0.9425, 0.6475);
uv(0.865, 0.5775);
uv(0.82, 0.3875);
uv(0.645, 0.5475);
uv(0.705, 0.61);
uv(0.6625, 0.6575);
uv(0.66, 0.5);
uv(0.865, 0.5775);
uv(0.785, 0.695);
uv(0.78, 0.65);
uv(0.785, 0.695);
uv(0.705, 0.61);
uv(0.9725, 0.435);
uv(0.91, 0.3275);
uv(0.5925, 0.4925);
uv(0.615, 0.4925);
uv(0.6, 0.36);
uv(0.395, 0.535);
uv(0.4675, 0.705);
uv(0.455, 0.535);
uv(0.3875, 0.4925);
uv(0.82, 0.3875);
uv(0.66, 0.5);
uv(0.865, 0.5775);
uv(0.705, 0.61);
uv(0.78, 0.65);
uv(0.0125, 0.76);
uv(0.085, 0.8325);
uv(0.0475, 0.665);
uv(0.1075, 0.345);
uv(0.0075, 0.265);
uv(0.08, 0.1925);
uv(0.0425, 0.36);
uv(0.0725, 0.4925);
uv(0.1225, 0.4175);
uv(0.1225, 0.4175);
uv(0.1275, 0.6075);
uv(0.1575, 0.535);
uv(0.015, 0.4925);
uv(0.055, 0.4375);
uv(0.055, 0.4375);
uv(0.06, 0.5875);
uv(0.1, 0.535);
uv(0.02, 0.535);
uv(0.05, 0.535);
uv(0.4675, 0.3675);
uv(0.4375, 0.1475);
uv(0.4425, 0.875);
uv(0.375, 0.77);
uv(0.5075, 0.4925);
uv(0.78, 0.65);
uv(0.94, 0.51);
uv(0.9425, 0.6475);
uv(0.645, 0.5475);
uv(0.6625, 0.6575);
uv(0.865, 0.5775);
uv(0.78, 0.65);
uv(0.705, 0.61);
uv(0.9725, 0.435);
uv(0.91, 0.3275);
uv(0.605, 0.665);
uv(0.3125, 0.535);
f(22, 20, 28, 0, 1, 2);
f(28, 20, 26, 2, 1, 3);
f(20, 21, 27, 4, 5, 6);
f(26, 20, 27, 7, 4, 6);
f(28, 27, 21, 8, 6, 5);
f(22, 28, 21, 9, 8, 5);
f(29, 31, 23, 7, 6, 4);
f(23, 31, 25, 4, 6, 5);
f(30, 29, 23, 2, 10, 1);
f(24, 30, 23, 0, 2, 1);
f(24, 25, 30, 9, 5, 8);
f(30, 25, 31, 8, 5, 6);
f(28, 26, 33, 2, 3, 11);
f(26, 27, 33, 7, 6, 12);
f(28, 33, 27, 8, 12, 6);
f(29, 32, 31, 7, 12, 6);
f(30, 32, 29, 2, 11, 10);
f(30, 31, 32, 8, 6, 12);
f(48, 12, 0, 13, 14, 15);
f(48, 0, 51, 13, 15, 16);
f(51, 0, 80, 17, 18, 19);
f(51, 80, 49, 17, 19, 20);
f(55, 48, 49, 21, 13, 22);
f(55, 49, 80, 23, 20, 19);
f(55, 12, 48, 21, 14, 13);
f(52, 81, 15, 17, 19, 18);
f(47, 52, 15, 13, 16, 15);
f(47, 15, 14, 13, 15, 14);
f(55, 47, 14, 21, 13, 14);
f(55, 50, 47, 21, 22, 13);
f(55, 81, 50, 23, 19, 20);
f(52, 50, 81, 17, 20, 19);
f(46, 42, 81, 24, 25, 26);
f(81, 42, 45, 26, 25, 27);
f(46, 80, 42, 24, 28, 25);
f(80, 43, 42, 28, 29, 25);
f(80, 41, 43, 19, 30, 31);
f(41, 44, 43, 30, 32, 31);
f(41, 45, 44, 30, 31, 32);
f(81, 45, 41, 19, 31, 30);
f(48, 56, 58, 13, 33, 34);
f(48, 51, 56, 13, 16, 33);
f(56, 49, 57, 35, 20, 36);
f(56, 51, 49, 35, 17, 20);
f(54, 36, 3, 37, 38, 39);
f(16, 54, 3, 40, 37, 39);
f(55, 80, 46, 21, 28, 24);
f(61, 4, 40, 41, 42, 43);
f(19, 4, 61, 44, 42, 41);
f(3, 53, 9, 45, 46, 47);
f(3, 36, 53, 39, 38, 48);
f(4, 9, 53, 49, 47, 46);
f(4, 53, 40, 42, 48, 43);
f(16, 37, 54, 40, 50, 37);
f(38, 37, 16, 51, 50, 40);
f(34, 38, 16, 52, 53, 54);
f(39, 19, 61, 55, 56, 57);
f(55, 35, 12, 21, 58, 14);
f(17, 18, 1, 59, 60, 61);
f(18, 2, 1, 60, 62, 61);
f(16, 3, 19, 40, 39, 44);
f(19, 3, 4, 44, 39, 42);
f(3, 9, 4, 39, 63, 42);
f(67, 65, 66, 64, 65, 66);
f(58, 57, 49, 34, 67, 22);
f(48, 58, 49, 13, 34, 22);
f(47, 62, 64, 13, 34, 33);
f(47, 64, 52, 13, 33, 16);
f(47, 50, 62, 13, 22, 34);
f(62, 50, 63, 34, 22, 67);
f(64, 63, 50, 35, 36, 20);
f(64, 50, 52, 35, 20, 17);
f(67, 58, 65, 68, 34, 69);
f(65, 58, 56, 69, 34, 33);
f(65, 57, 66, 65, 36, 66);
f(65, 56, 57, 65, 35, 36);
f(67, 66, 58, 68, 70, 34);
f(58, 66, 57, 34, 70, 67);
f(68, 70, 62, 68, 69, 34);
f(70, 64, 62, 69, 33, 34);
f(68, 62, 69, 68, 34, 70);
f(62, 63, 69, 34, 67, 70);
f(70, 69, 63, 65, 66, 36);
f(70, 63, 64, 65, 36, 35);
f(42, 71, 74, 25, 71, 72);
f(42, 74, 45, 25, 72, 27);
f(42, 72, 71, 25, 73, 71);
f(42, 43, 72, 25, 29, 73);
f(43, 44, 72, 31, 32, 74);
f(44, 73, 72, 32, 75, 74);
f(44, 74, 73, 32, 74, 75);
f(45, 74, 44, 31, 74, 32);
f(71, 75, 78, 71, 76, 77);
f(71, 78, 74, 71, 77, 72);
f(71, 76, 75, 71, 78, 76);
f(71, 72, 76, 71, 73, 78);
f(72, 73, 76, 74, 75, 79);
f(73, 77, 76, 75, 80, 79);
f(73, 78, 77, 75, 79, 80);
f(74, 78, 73, 74, 79, 75);
f(75, 79, 78, 81, 82, 79);
f(75, 76, 79, 81, 79, 82);
f(76, 77, 79, 79, 80, 82);
f(78, 79, 77, 79, 82, 80);
f(5, 16, 59, 83, 54, 84);
f(12, 59, 0, 14, 84, 15);
f(12, 5, 59, 14, 83, 84);
f(59, 19, 6, 85, 56, 86);
f(0, 6, 80, 18, 86, 19);
f(0, 59, 6, 18, 85, 86);
f(35, 5, 12, 58, 83, 14);
f(35, 7, 5, 58, 87, 83);
f(7, 16, 5, 87, 54, 83);
f(7, 34, 16, 87, 52, 54);
f(80, 6, 41, 19, 86, 30);
f(1, 2, 13, 61, 62, 88);
f(68, 69, 70, 64, 66, 65);
f(54, 1, 36, 89, 61, 90);
f(17, 1, 54, 59, 61, 89);
f(55, 46, 81, 21, 24, 26);
f(61, 40, 2, 91, 92, 62);
f(18, 61, 2, 60, 91, 62);
f(1, 13, 53, 93, 94, 48);
f(1, 53, 36, 61, 46, 90);
f(2, 53, 13, 95, 48, 94);
f(2, 40, 53, 62, 92, 46);
f(17, 54, 37, 59, 89, 96);
f(38, 17, 37, 97, 59, 96);
f(34, 17, 38, 52, 54, 53);
f(39, 61, 18, 55, 57, 56);
f(55, 14, 35, 21, 14, 58);
f(22, 59, 16, 0, 84, 54);
f(22, 16, 20, 0, 54, 1);
f(16, 19, 21, 98, 56, 5);
f(20, 16, 21, 4, 98, 5);
f(22, 19, 59, 9, 56, 85);
f(22, 21, 19, 9, 5, 56);
f(23, 25, 17, 4, 5, 98);
f(17, 25, 18, 98, 5, 56);
f(24, 17, 60, 0, 54, 84);
f(24, 23, 17, 0, 1, 54);
f(24, 60, 18, 9, 85, 56);
f(24, 18, 25, 9, 56, 5);
f(6, 8, 41, 86, 99, 30);
f(6, 19, 39, 86, 56, 55);
f(6, 39, 8, 86, 55, 99);
f(10, 60, 17, 83, 84, 54);
f(14, 15, 60, 14, 15, 84);
f(14, 60, 10, 14, 84, 83);
f(60, 11, 18, 85, 86, 56);
f(15, 81, 11, 18, 19, 86);
f(15, 11, 60, 18, 86, 85);
f(35, 14, 10, 58, 14, 83);
f(35, 10, 7, 58, 83, 87);
f(7, 10, 17, 87, 83, 54);
f(7, 17, 34, 87, 54, 52);
f(81, 41, 11, 19, 30, 86);
f(11, 41, 8, 86, 30, 99);
f(11, 8, 39, 86, 99, 55);
f(11, 39, 18, 86, 55, 56);
frames = new Dictionary();
framenames = new Dictionary();
_local1 = new Object();
_local1.fly = [38.7157, 54.9443, 102.9148, -100.1045, 151.4363, -30.9307, -42.9432, 160.3432, -51.1762, -100.1045, 151.4363, 30.9307, -42.9432, 160.3432, 51.1762, -28.2446, 62.3667, 71.4218, 24.0171, 110.6127, 51.1762, -44.5764, 46.7796, -0.5624, 37.0826, 126.9421, -0.5624, -44.5764, 191.5176, 79.295, -28.2446, 62.3667, -71.4218, 24.0171, 110.6127, -51.1762, 20.7508, 45.2951, 63.5485, -44.5764, 191.5176, -79.295, 20.7508, 45.2951, -63.5485, 38.7157, 54.9443, -102.9148, -83.7727, 92.7988, 30.9307, -83.7727, 92.7988, -30.9307, -23.3451, 123.9732, -47.802, -23.3451, 123.9732, 47.802, -88.6722, 90.5721, 90.5426, -75.6068, 109.1282, 81.5445, -56.0087, 79.4384, 127.6594, -88.6722, 90.5721, -90.5426, -56.0087, 79.4384, -127.6594, -75.6068, 109.1282, -81.5445, -118.0695, 85.3764, 109.6634, -98.4713, 103.1903, 119.7861, -83.7727, 77.2116, 137.7822, -118.0695, 85.3764, -109.6633, -83.7727, 77.2116, -137.7822, -98.4713, 103.1903, -119.7861, -132.7681, 91.3143, -143.4059, -132.7681, 91.3143, 143.4059, -80.5063, 83.8919, -0.5624, 4.419, 27.4812, -0.5624, -100.1045, 160.3432, -0.5624, -137.6676, 107.6437, -0.5624, -90.3054, 90.5721, -0.5624, 2.7858, 134.3646, -0.5624, -34.7773, 172.2192, -0.5624, 58.3139, 109.8705, -0.5624, 99.1434, 76.4694, -0.5624, 100.7765, 103.9325, 16.3089, 97.5102, 115.8085, -0.5624, 100.7765, 103.9325, -16.3089, 82.8116, 63.109, -0.5624, 73.0125, 40.0993, -30.9307, 73.0125, 40.0993, 30.9307, 92.6106, 63.8512, 50.0515, 92.6106, 63.8512, -50.0515, 64.8466, 46.7796, 100.6653, 64.8466, 46.7796, -100.6653, -67.4409, 173.7037, -0.5624, -118.0695, 122.4887, -0.5624, 59.9471, 43.0683, -0.5624, 82.8116, 40.8416, 102.9148, 108.9424, 41.5838, 72.5465, 99.1434, 34.9036, 59.0495, -18.4455, 76.4694, 115.2871, -18.4455, 76.4694, -115.2871, -20.0787, 139.5603, -0.5624, 99.1434, 34.9036, -59.0495, 108.9424, 41.5838, -72.5465, 82.8116, 40.8416, -102.9148, 102.4097, 26.7389, 118.6614, 128.5406, 30.4501, 91.6673, 123.641, 2.2448, 138.9069, 123.641, 2.2448, -138.9069, 128.5406, 30.4501, -91.6673, 102.4097, 26.7389, -118.6614, 177.536, 100.9635, -0.5624, 166.1037, 119.5197, 17.4337, 162.8374, 132.1379, -0.5624, 166.1037, 119.5197, -17.4337, 257.5617, 140.3026, -0.5624, 251.029, 156.632, 12.9347, 242.8631, 171.4769, -0.5624, 251.029, 156.632, -12.9346, 278.7931, 174.4459, -0.5624, 74.6457, 87.6031, 26.4317, 74.6457, 87.6031, -26.4317];
_local1.run1 = [43.8778, 54.9038, 75.7488, -97.6813, 150.8606, -30.8606, -42.2886, 160.2223, -51.7016, -97.6813, 150.8606, 30.8606, -42.2886, 160.2223, 51.7016, -28.7482, 50.223, 28.4559, 11.8731, 106.3928, 54.1063, -44.7505, 46.7123, 0.4008, 36.4921, 127.4565, 0.4008, -52.1362, 187.137, 78.1535, -28.7482, 50.223, -28.4559, 11.8731, 106.3928, -54.1063, 24.1826, 39.6911, 30.0591, -52.1362, 187.137, -78.1536, 24.1826, 39.6911, -30.0591, 43.8778, 54.9038, -75.7488, -82.9099, 92.3504, 30.0591, -82.9099, 92.3504, -30.0591, -26.2863, 127.4565, -38.8764, -26.2863, 127.4565, 38.8764, -106.2979, 90.0099, 63.7252, -75.5242, 99.3716, 73.3441, -50.9052, 79.4781, 84.5661, -106.2979, 90.0099, -63.7252, -50.9052, 79.4781, -84.5662, -75.5242, 99.3716, -73.3441, -119.8384, 85.3291, 59.7173, -122.3003, 97.0312, 83.7646, -112.4527, 77.1377, 102.2008, -121.0693, 85.3291, -59.7173, -113.6836, 77.1377, -102.2008, -122.3003, 97.0312, -83.7646, -153.074, 91.1802, -94.9866, -153.074, 91.1802, 94.9866, -80.448, 84.1589, 0.4008, 4.4874, 27.9891, 0.4008, -98.9122, 160.2223, 0.4008, -135.8407, 107.563, 0.4008, -89.0647, 90.0099, 0.4008, 2.0256, 134.4778, 0.4008, -33.672, 171.9243, 0.4008, 57.4182, 109.9034, 0.4008, 101.7324, 99.3716, 0.4008, 82.0372, 118.0949, 15.6307, 70.9587, 123.9459, 0.4008, 82.0372, 118.0949, -15.6307, 84.4991, 71.2867, 0.4008, 69.7277, 31.4997, -34.8685, 69.7277, 31.4997, 34.8685, 88.192, 54.9038, 30.8606, 88.192, 54.9038, -30.8606, 77.1134, 46.7123, 75.7488, 77.1134, 46.7123, -75.7488, -65.6766, 174.2648, 0.4008, -117.3765, 122.7757, 0.4008, 50.0326, 22.138, 0.4008, 98.0396, 40.8613, 72.5425, 120.1966, 46.7123, 34.0669, 100.5015, 35.0103, 38.0748, -16.4387, 75.9675, 78.9551, -16.4387, 75.9675, -78.9551, -21.3625, 141.499, 0.4008, 100.5015, 35.0103, -38.0748, 120.1966, 46.7123, -34.0669, 98.0396, 40.8613, -72.5425, 131.2752, 23.3082, 68.5346, 146.0466, 37.3507, 30.0591, 160.8179, 1.0743, 52.5032, 160.8179, 1.0743, -52.5032, 146.0466, 37.3507, -30.0591, 131.2752, 23.3082, -68.5347, 134.968, 175.435, 0.4008, 112.8109, 177.7754, 17.2339, 101.7324, 183.6264, 0.4008, 112.8109, 177.7754, -17.2339, 158.356, 260.86, 0.4008, 141.1228, 266.711, 12.4244, 125.1204, 271.3918, 0.4008, 141.1228, 266.711, -12.4244, 146.0466, 299.4768, 0.4008, 74.6515, 90.0099, 20.4402, 74.6515, 90.0099, -20.4402];
_local1.run2 = [19.9821, 82.3855, 84.1209, -105.5437, 139.1514, -30.9095, -52.1284, 160.9845, -51.2551, -105.5437, 139.1514, 30.9095, -52.1284, 160.9845, 51.255, -29.427, 66.0108, 28.562, 11.9699, 121.685, 54.3851, -45.4515, 61.6442, 0.3913, 36.0067, 142.4264, 0.3913, -68.153, 183.9092, 77.8607, -29.427, 66.0108, -28.562, 11.9699, 121.685, -54.3851, 23.9883, 55.0942, 30.127, -68.153, 183.9092, -77.8607, 23.9883, 55.0942, -30.127, 19.9821, 82.3855, -84.1209, -78.8361, 85.6605, 30.127, -78.8361, 85.6605, -30.127, -29.427, 131.5099, -38.7347, -29.427, 131.5099, 38.7347, -62.8115, 54.0026, 63.7754, -76.1653, 76.9273, 70.818, -44.1162, 80.2022, 84.9034, -62.8115, 54.0026, -63.7754, -44.1162, 80.2022, -84.9034, -76.1653, 76.9273, -70.8181, -81.5068, 15.7948, 67.688, -94.8606, 56.1859, 84.1209, -82.8422, 43.0861, 99.7713, -82.8422, 15.7948, -67.688, -84.1776, 43.0861, -99.7713, -94.8606, 56.1859, -84.1209, -101.5375, 14.7031, -95.0762, -101.5375, 14.7031, 95.0762, -73.4945, 78.0189, 0.3913, 3.9576, 43.0861, 0.3913, -106.8791, 148.9763, 0.3913, -133.5867, 88.9355, 0.3913, -84.1776, 82.3855, 0.3913, 2.6222, 150.068, 0.3913, -46.7869, 172.9927, 0.3913, 57.3728, 124.96, 0.3913, 101.4404, 114.0434, 0.3913, 81.4097, 133.6932, 16.0417, 70.7266, 139.1514, 0.3913, 81.4097, 133.6932, -16.0417, 84.0804, 86.7521, 0.3913, 34.6713, 49.636, -38.7347, 34.6713, 49.636, 38.7347, 74.7328, 67.1024, 30.9095, 74.7328, 67.1024, -30.9095, 50.6959, 66.0108, 78.6432, 50.6959, 66.0108, -78.6432, -77.5007, 168.626, 0.3913, -117.5621, 108.5852, 0.3913, 41.3482, 47.4527, 0.3913, 49.3605, 50.7276, 72.3831, 61.379, 36.5362, 34.0396, 44.019, 46.361, 37.9522, -16.0732, 91.1188, 78.6432, -16.0732, 91.1188, -78.6432, -28.0916, 146.793, 0.3913, 44.019, 46.361, -37.9522, 61.379, 36.5362, -34.0396, 49.3605, 50.7276, -72.3831, 36.0067, 25.6196, 68.4705, 60.0436, 21.253, 30.127, 14.6406, 5.9699, 52.0376, 14.6406, 5.9699, -52.0376, 60.0436, 21.253, -30.127, 36.0067, 25.6196, -68.4705, 146.8433, 175.176, 0.3913, 128.148, 186.0925, 16.8242, 118.8003, 197.009, 0.3913, 128.148, 186.0925, -16.8242, 202.9294, 243.95, 0.3913, 189.5755, 257.0499, 12.1291, 176.2217, 266.8747, 0.3913, 189.5755, 257.0499, -12.1291, 206.9355, 284.3412, 0.3913, 74.7328, 105.3102, 20.7368, 74.7328, 105.3102, -20.7368];
_local1.run3 = [19.526, 82.3567, 84.1209, -106.1827, 132.1931, -30.9095, -55.5727, 158.2271, -51.2551, -106.1827, 132.1931, 30.9095, -55.5727, 158.2271, 51.255, -29.4514, 65.9925, 28.562, 11.3631, 121.0357, 54.3851, -45.7772, 62.2733, 0.3913, 35.8518, 142.6067, 0.3913, -73.5311, 179.7981, 77.8607, -29.4514, 65.9925, -28.562, 11.3631, 121.0357, -54.3851, 24.4237, 54.835, 30.127, -73.5311, 179.7981, -77.8607, 24.4237, 54.835, -30.127, 19.526, 82.3567, -84.1209, -73.5311, 80.869, 30.127, -73.5311, 80.869, -30.127, -31.084, 131.4493, -38.7347, -31.084, 131.4493, 38.7347, -22.9211, 65.9925, 63.7754, -62.103, 74.9184, 70.818, -44.1446, 80.1252, 84.9034, -22.9211, 65.9925, -63.7754, -44.1446, 80.1252, -84.9034, -62.103, 74.9184, -70.8181, 1.5676, 31.7764, 67.688, -40.8795, 39.2147, 84.1209, -22.9211, 43.6776, 99.7713, -0.065, 31.7764, -67.688, -24.5537, 43.6776, -99.7713, -40.8795, 39.2147, -84.1209, -8.2279, 15.4122, -95.0762, -8.2279, 15.4122, 95.0762, -68.6334, 73.4307, 0.3913, 3.2002, 42.9338, 0.3913, -109.4479, 141.1191, 0.3913, -129.0388, 78.6375, 0.3913, -78.4288, 77.1499, 0.3913, 3.2002, 149.3012, 0.3913, -52.3075, 171.616, 0.3913, 57.0753, 124.7549, 0.3913, 110.9505, 104.6715, 0.3913, 99.5224, 129.9617, 16.0417, 92.9921, 140.3752, 0.3913, 99.5224, 129.9617, -16.0417, 84.8292, 86.8196, 0.3913, 34.2192, 49.6282, -38.7347, 34.2192, 49.6282, 38.7347, 75.0337, 67.4801, 30.9095, 75.0337, 67.4801, -30.9095, 50.545, 65.9925, 78.6432, 50.545, 65.9925, -78.6432, -81.694, 163.4339, 0.3913, -114.3456, 99.4647, 0.3913, 42.3821, 47.3968, 0.3913, 48.9124, 51.1159, 72.3831, 32.5866, 16.8998, 34.0396, 21.1586, 33.264, 37.9522, -16.3908, 91.2826, 78.6432, -16.3908, 91.2826, -78.6432, -29.4514, 147.0697, 0.3913, 21.1586, 33.264, -37.9522, 32.5866, 16.8998, -34.0396, 48.9124, 51.1159, -72.3831, 3.2002, 18.3875, 68.4705, 22.7911, 4.2547, 30.127, -24.5537, 10.9492, 52.0376, -24.5537, 10.9492, -52.0376, 22.7911, 4.2547, -30.127, 3.2002, 18.3875, -68.4705, 176.2537, 142.6067, 0.3913, 163.1931, 159.7148, 16.8242, 159.9279, 173.1037, 0.3913, 163.1931, 159.7148, -16.8242, 261.1479, 160.4586, 0.3913, 257.8827, 177.5666, 12.1291, 251.3524, 193.9309, 0.3913, 257.8827, 177.5666, -12.1291, 287.2692, 190.9555, 0.3913, 75.0337, 104.6715, 20.7368, 75.0337, 104.6715, -20.7368];
_local1.run4 = [20.6671, 81.9358, 84.1209, -109.0607, 158.2771, -30.9095, -53.2638, 169.844, -51.2551, -109.0607, 158.2771, 30.9095, -53.2638, 169.844, 51.255, -29.5501, 65.7422, 28.562, 10.9027, 121.2631, 54.3851, -44.8942, 62.2721, 0.3913, 36.0113, 142.0835, 0.3913, -64.4231, 195.2911, 77.8607, -29.5501, 65.7422, -28.562, 10.9027, 121.2631, -54.3851, 24.8519, 55.332, 30.127, -64.4231, 195.2911, -77.8607, 24.8519, 55.332, -30.127, 20.6671, 81.9358, -84.1209, -90.9267, 100.4428, 30.127, -90.9267, 100.4428, -30.127, -36.5247, 136.3001, -38.7347, -36.5247, 136.3001, 38.7347, -81.1622, 69.2122, 63.7754, -68.6079, 90.0326, 70.818, -63.0282, 71.5256, 84.9034, -81.1622, 69.2122, -63.7754, -63.0282, 71.5256, -84.9034, -68.6079, 90.0326, -70.8181, -111.8505, 40.2951, 67.688, -110.4556, 81.9358, 84.1209, -103.481, 65.7422, 99.7713, -113.2454, 40.2951, -67.688, -104.8759, 65.7422, -99.7713, -110.4556, 81.9358, -84.1209, -129.9845, 46.0785, -95.0762, -129.9845, 46.0785, 95.0762, -68.6079, 73.839, 0.3913, 3.9281, 42.6084, 0.3913, -109.0607, 167.5306, 0.3913, -145.3287, 113.1663, 0.3913, -97.9013, 96.9727, 0.3913, 2.5332, 149.0236, 0.3913, -44.8942, 180.2542, 0.3913, 58.3301, 124.7332, 0.3913, 109.9422, 105.0695, 0.3913, 100.1777, 130.5166, 16.0417, 91.8082, 140.9268, 0.3913, 100.1777, 130.5166, -16.0417, 84.8336, 86.5625, 0.3913, 34.6164, 49.5485, -38.7347, 34.6164, 49.5485, 38.7347, 100.1777, 61.1154, 30.9095, 100.1777, 61.1154, -30.9095, 51.3555, 65.7422, 78.6432, 51.3555, 65.7422, -78.6432, -76.9774, 181.4109, 0.3913, -125.7997, 129.36, 0.3913, 41.591, 47.2352, 0.3913, 75.0691, 46.0785, 72.3831, 136.4457, 46.0785, 34.0396, 109.9422, 28.7282, 37.9522, -16.9958, 91.1893, 78.6432, -16.9958, 91.1893, -78.6432, -30.945, 151.337, 0.3913, 109.9422, 28.7282, -37.9522, 136.4457, 46.0785, -34.0396, 75.0691, 46.0785, -72.3831, 121.1016, 21.7881, 68.4705, 143.4204, 32.1982, 30.127, 114.127, -5.9724, 52.0376, 114.127, -5.9724, -52.0376, 143.4204, 32.1982, -30.127, 121.1016, 21.7881, -68.4705, 167.134, 162.9039, 0.3913, 150.395, 175.6274, 16.8242, 143.4204, 187.1943, 0.3913, 150.395, 175.6274, -16.8242, 210.3766, 249.6554, 0.3913, 195.0325, 257.7522, 12.1291, 178.2934, 262.379, 0.3913, 195.0325, 257.7522, -12.1291, 202.0071, 288.9828, 0.3913, 75.0691, 105.0695, 20.7368, 75.0691, 105.0695, -20.7368];
_local1.sit1 = [-4.8178, 63.962, 83.9581, -50.235, 212.1302, -31.5258, 5.4377, 218.8216, -51.4368, -50.235, 212.1302, 31.5258, 5.4377, 218.8216, 51.4368, -39.9795, 101.2431, 28.2073, 27.4138, 88.816, 54.0916, -51.7001, 113.6701, 0.3318, 56.7152, 75.4331, 0.3318, -3.3527, 245.5875, 77.9848, -39.9795, 101.2431, -28.2073, 27.4138, 88.816, -54.0916, -26.7938, 48.6673, 30.1984, -3.3527, 245.5875, -77.9848, -26.7938, 48.6673, -30.1984, -4.8178, 63.962, -83.9581, -44.3747, 153.8188, 30.1984, -44.3747, 153.8188, -30.1984, 21.5535, 159.5544, -52.7642, 21.5535, 159.5544, 52.7642, -67.8159, 120.3615, 49.4457, -51.7001, 148.0833, 71.3478, -34.1192, 120.3615, 84.6218, -67.8159, 120.3615, -49.4457, -34.1192, 120.3615, -84.6218, -51.7001, 148.0833, -71.3478, -94.1871, 86.9042, 40.8176, -98.5824, 128.9648, 65.3745, -89.7919, 113.6701, 77.9848, -95.6522, 86.9042, -40.8176, -89.7919, 113.6701, -77.9848, -98.5824, 128.9648, -65.3745, -113.2331, 90.7279, -57.4101, -113.2331, 90.7279, 57.4101, -50.235, 146.1715, 0.3318, -47.3048, 61.0943, 0.3318, -50.235, 221.6894, 0.3318, -91.257, 171.0255, 0.3318, -44.3747, 150.9511, 0.3318, 47.9248, 108.8904, 0.3318, 14.2282, 229.3368, 0.3318, 50.855, 48.6673, 0.3318, 59.6454, 4.6948, 0.3318, 68.4358, 30.5047, 16.2607, 69.9009, 43.8876, 0.3318, 68.4358, 30.5047, -16.2607, 27.4138, 8.5185, 0.3318, -28.2589, 37.1962, -38.8265, -28.2589, 37.1962, 38.8265, 5.4377, 8.5185, 30.8621, 5.4377, 8.5185, -30.8621, -6.2828, 29.5488, 79.3122, -6.2828, 29.5488, -79.3122, -16.5383, 233.1605, 0.3318, -70.746, 185.3643, 0.3318, -26.7938, 29.5488, 0.3318, -19.4685, 24.7692, 72.6752, -26.7938, 6.6066, 33.5169, -25.3288, 26.681, 38.1628, -12.1431, 101.2431, 78.6485, -12.1431, 101.2431, -78.6485, 25.9487, 198.7472, 0.3318, -25.3288, 26.681, -38.1628, -26.7938, 6.6066, -33.5169, -19.4685, 24.7692, -72.6752, -48.7699, 24.7692, 68.693, -41.4446, 1.827, 30.1984, -75.1412, 35.2843, 52.1005, -75.1412, 35.2843, -52.1005, -41.4446, 1.827, -30.1984, -48.7699, 24.7692, -68.693, 134.364, 5.6507, 0.3318, 135.8291, 27.6369, 16.9244, 141.6894, 40.064, 0.3318, 135.8291, 27.6369, -16.9244, 222.2684, 5.6507, 0.3318, 228.1286, 21.9014, 12.2785, 231.0588, 39.108, 0.3318, 228.1286, 21.9014, -12.2785, 260.3602, 19.0336, 0.3318, 39.1344, 24.7692, 20.2429, 39.1344, 24.7692, -20.2429];
_local1.sit2 = [-4.4382, 63.3877, 83.9581, -39.2526, 205.6836, -50.1094, 21.6726, 212.748, -50.7731, -59.5609, 215.7755, 7.6326, -13.1418, 228.895, 44.1361, -40.7032, 100.7277, 28.2073, 27.475, 88.6174, 54.0916, -50.8573, 113.8472, 0.3318, 56.4869, 75.498, 0.3318, -31.9996, 259.1707, 61.3923, -40.7032, 100.7277, -28.2073, 27.475, 88.6174, -54.0916, -27.6478, 48.2498, 30.1984, 21.6726, 233.941, -83.2944, -27.6478, 48.2498, -30.1984, -4.4382, 63.3877, -83.9581, -53.7585, 159.2608, 18.9155, -33.4502, 149.1689, -37.4991, 21.6726, 160.27, -52.7642, 21.6726, 160.27, 52.7642, -68.2645, 119.9024, 49.4457, -50.8573, 148.1597, 71.3478, -34.9008, 120.9116, 84.6218, -68.2645, 119.9024, -49.4457, -34.9008, 120.9116, -84.6218, -50.8573, 148.1597, -71.3478, -94.3753, 86.5991, 40.8176, -98.7271, 128.9851, 65.3745, -88.5729, 113.8472, 77.9848, -95.8259, 87.6083, -40.8176, -90.0235, 113.8472, -77.9848, -98.7271, 128.9851, -65.3745, -113.2331, 90.6358, -57.4101, -113.2331, 90.6358, 57.4101, -47.9561, 146.1413, -9.6237, -46.5055, 61.3693, 0.3318, -49.4067, 219.8123, -22.8977, -87.1223, 168.3435, -27.5436, -43.6043, 151.1873, -8.96, 47.7834, 109.8105, 0.3318, 11.5184, 231.9226, -2.323, 50.6846, 49.259, 0.3318, 60.8387, 4.8546, 0.3318, 68.0917, 31.0936, 16.2607, 69.5423, 43.2038, 0.3318, 68.0917, 31.0936, -16.2607, 27.475, 7.8822, 0.3318, -27.6478, 37.1487, -38.8265, -27.6478, 37.1487, 38.8265, 5.716, 8.8914, 30.8621, 5.716, 8.8914, -30.8621, -5.8888, 29.0752, 79.3122, -5.8888, 29.0752, -79.3122, -17.4936, 233.941, -13.6059, -68.2645, 182.4722, -23.5614, -26.1972, 29.0752, 0.3318, -20.3948, 24.0292, 72.6752, -27.6478, 6.873, 33.5169, -26.1972, 26.0476, 38.1628, -11.6912, 100.7277, 78.6485, -11.6912, 100.7277, -78.6485, 23.1232, 202.656, 6.9689, -26.1972, 26.0476, -38.1628, -27.6478, 6.873, -33.5169, -20.3948, 24.0292, -72.6752, -49.4067, 25.0384, 68.693, -42.1537, 1.827, 30.1984, -75.5175, 36.1395, 52.1005, -75.5175, 36.1395, -52.1005, -42.1537, 1.827, -30.1984, -49.4067, 25.0384, -68.693, 134.8193, 5.8638, 10.2874, 131.9181, 28.066, 27.5436, 142.0723, 40.1763, 12.2785, 140.6217, 28.066, -5.6415, 220.4046, 5.8638, 33.5169, 221.8552, 22.0108, 46.7909, 229.1082, 39.1671, 35.508, 229.1082, 22.0108, 22.8977, 256.6695, 18.9833, 43.4724, 40.5304, 25.0384, 20.2429, 40.5304, 25.0384, -20.2429];
_local1.sit3 = [-4.2007, 63.962, 83.9581, -50.0282, 212.1302, -31.5258, 6.1474, 218.8216, -51.4368, -50.0282, 212.1302, 31.5258, 6.1474, 218.8216, 51.4368, -41.1583, 101.2431, 28.2073, 26.8436, 88.816, 54.0916, -51.5065, 113.6701, 0.3318, 56.4097, 75.4331, 0.3318, -2.7224, 245.5875, 77.9848, -41.1583, 101.2431, -28.2073, 26.8436, 88.816, -54.0916, -26.3753, 48.6673, 30.1984, -2.7224, 245.5875, -77.9848, -26.3753, 48.6673, -30.1984, -4.2007, 63.962, -83.9581, -44.115, 153.8188, 30.1984, -44.115, 153.8188, -30.1984, 22.4087, 159.5544, -52.7642, 22.4087, 159.5544, 52.7642, -64.8112, 114.626, 49.4457, -51.5065, 148.0833, 71.3478, -35.2451, 120.3615, 84.6218, -64.8112, 114.626, -49.4457, -35.2451, 120.3615, -84.6218, -51.5065, 148.0833, -71.3478, -101.7688, 92.6397, 40.8176, -91.4207, 133.7445, 65.3745, -86.9858, 116.5378, 77.9848, -101.7688, 93.5957, -40.8176, -88.4641, 116.5378, -77.9848, -91.4207, 133.7445, -65.3745, -118.0302, 102.199, -57.4101, -118.0302, 102.199, 57.4101, -50.0282, 146.1715, 0.3318, -47.0716, 61.0943, 0.3318, -50.0282, 221.6894, 0.3318, -91.4207, 171.0255, 0.3318, -44.115, 150.9511, 0.3318, 47.5399, 108.8904, 0.3318, 15.0172, 229.3368, 0.3318, 50.4965, 48.6673, 0.3318, 60.8446, 4.6948, 0.3318, 68.2361, 30.5047, 16.2607, 69.7145, 43.8876, 0.3318, 68.2361, 30.5047, -16.2607, 28.3219, 8.5185, 0.3318, -27.8536, 37.1962, -38.8265, -27.8536, 37.1962, 38.8265, 6.1474, 8.5185, 30.8621, 6.1474, 8.5185, -30.8621, -5.6791, 29.5488, 79.3122, -5.6791, 29.5488, -79.3122, -17.5055, 233.1605, 0.3318, -70.7244, 185.3643, 0.3318, -26.3753, 29.5488, 0.3318, -20.4621, 24.7692, 72.6752, -26.3753, 6.6066, 33.5169, -26.3753, 26.681, 38.1628, -11.5923, 101.2431, 78.6485, -11.5923, 101.2431, -78.6485, 25.3653, 198.7472, 0.3318, -26.3753, 26.681, -38.1628, -26.3753, 6.6066, -33.5169, -20.4621, 24.7692, -72.6752, -48.5499, 24.7692, 68.693, -42.6367, 1.827, 30.1984, -75.1593, 35.2843, 52.1005, -75.1593, 35.2843, -52.1005, -42.6367, 1.827, -30.1984, -48.5499, 24.7692, -68.693, 133.2815, 5.6507, -0.3319, 134.7598, 27.6369, 16.9244, 140.673, 40.064, 0.3318, 136.2381, 27.6369, -17.5881, 220.5015, 5.6507, 4.3141, 226.4147, 21.9014, 16.9244, 229.3713, 39.108, 4.9778, 227.893, 21.9014, -7.6326, 258.9374, 19.0336, 6.3052, 40.1484, 24.7692, 20.2429, 40.1484, 24.7692, -20.2429];
_local1.sit4 = [-4.4074, 63.9884, 83.9581, -65.0426, 212.9783, 2.9867, -33.2813, 224.8185, -46.7909, -26.0628, 208.0448, 52.1005, 30.2412, 216.925, 33.5169, -40.4998, 101.4825, 28.2073, 27.3539, 88.6556, 54.0916, -52.0493, 114.3095, 0.3318, 56.2277, 75.8286, 0.3318, 38.9034, 240.6055, 63.3834, -40.4998, 101.4825, -28.2073, 27.3539, 88.6556, -54.0916, -27.5065, 48.2014, 30.1984, -56.3804, 253.4325, -58.7375, -27.5065, 48.2014, -30.1984, -4.4074, 63.9884, -83.9581, -21.7318, 150.8169, 41.4813, -59.2678, 155.7504, -6.3052, 21.5791, 159.6971, -52.7642, 21.5791, 159.6971, 52.7642, -66.4863, 117.2695, 49.4457, -52.0493, 147.8569, 71.3478, -34.725, 120.2296, 84.6218, -66.4863, 117.2695, -49.4457, -34.725, 120.2296, -84.6218, -52.0493, 147.8569, -71.3478, -95.3602, 85.6955, 40.8176, -96.8039, 128.1231, 65.3745, -89.5854, 112.3361, 77.9848, -96.8039, 85.6955, -40.8176, -89.5854, 112.3361, -77.9848, -96.8039, 128.1231, -65.3745, -114.1282, 90.6289, -57.4101, -114.1282, 90.6289, 57.4101, -44.8309, 145.8835, 20.2429, -46.2746, 61.0283, 0.3318, -46.2746, 220.8718, 28.2073, -78.0358, 167.5906, 48.1183, -41.9435, 150.8169, 17.5881, 47.5656, 109.376, 0.3318, 5.6984, 232.712, -10.2874, 50.453, 49.188, 0.3318, 60.5588, 4.7871, 0.3318, 69.221, 30.441, 16.2607, 69.221, 43.2679, 0.3318, 69.221, 30.441, -16.2607, 27.3539, 7.7471, 0.3318, -27.5065, 37.3478, -38.8265, -27.5065, 37.3478, 38.8265, 5.6984, 8.7338, 30.8621, 5.6984, 8.7338, -30.8621, -5.8511, 29.4543, 79.3122, -5.8511, 29.4543, -79.3122, -20.2881, 233.6987, 8.96, -62.1552, 182.3909, 36.8354, -26.0628, 29.4543, 0.3318, -20.2881, 24.5208, 72.6752, -27.5065, 6.7605, 33.5169, -26.0628, 26.4942, 38.1628, -11.6259, 100.4958, 78.6485, -11.6259, 100.4958, -78.6485, 14.3606, 202.1247, -20.9066, -26.0628, 26.4942, -38.1628, -27.5065, 6.7605, -33.5169, -20.2881, 24.5208, -72.6752, -49.162, 25.5075, 68.693, -41.9435, 1.827, 30.1984, -75.1485, 35.3744, 52.1005, -75.1485, 35.3744, -52.1005, -41.9435, 1.827, -30.1984, -49.162, 25.5075, -68.693, 132.7436, 5.7738, -12.9422, 138.5183, 27.4809, 2.9867, 139.962, 39.3212, -14.9333, 129.8562, 27.4809, -30.1984, 217.9215, 5.7738, -36.1717, 226.5837, 22.5475, -25.5525, 226.5837, 39.3212, -38.1628, 219.3652, 22.5475, -49.4457, 254.0139, 19.5874, -46.1272, 40.3471, 24.5208, 20.2429, 40.3471, 24.5208, -20.2429];
_local1.sit5 = [-4.7656, 63.962, 83.9581, -49.9688, 212.1302, -31.5258, 5.4416, 218.8216, -51.4368, -49.9688, 212.1302, 31.5258, 5.4416, 218.8216, 51.4368, -41.2198, 101.2431, 28.2073, 27.3141, 88.816, 54.0916, -51.427, 113.6701, 0.3318, 56.4774, 75.4331, 0.3318, -3.3075, 245.5875, 77.9848, -41.2198, 101.2431, -28.2073, 27.3141, 88.816, -54.0916, -26.6381, 48.6673, 30.1984, -3.3075, 245.5875, -77.9848, -26.6381, 48.6673, -30.1984, -4.7656, 63.962, -83.9581, -44.1362, 153.8188, 30.1984, -44.1362, 153.8188, -30.1984, 21.4814, 159.5544, -52.7642, 21.4814, 159.5544, 52.7642, -67.4668, 117.4938, 49.4457, -51.427, 148.0833, 71.3478, -33.929, 120.3615, 84.6218, -67.4668, 117.4938, -49.4457, -33.929, 120.3615, -84.6218, -51.427, 148.0833, -71.3478, -95.172, 85.9483, 40.8176, -96.6302, 128.0089, 65.3745, -89.3394, 112.7141, 77.9848, -96.6302, 85.9483, -40.8176, -90.7975, 112.7141, -77.9848, -96.6302, 128.0089, -65.3745, -114.1282, 89.772, -57.4101, -114.1282, 89.772, 57.4101, -49.9688, 146.1715, 0.3318, -47.0525, 61.0943, 0.3318, -49.9688, 221.6894, 0.3318, -90.7975, 171.0255, 0.3318, -44.1362, 150.9511, 0.3318, 47.7284, 108.8904, 0.3318, 14.1906, 229.3368, 0.3318, 50.6448, 48.6673, 0.3318, 60.8519, 4.6948, 0.3318, 68.1428, 30.5047, 16.2607, 69.6009, 43.8876, 0.3318, 68.1428, 30.5047, -16.2607, 27.3141, 8.5185, 0.3318, -28.0963, 37.1962, -38.8265, -28.0963, 37.1962, 38.8265, 5.4416, 8.5185, 30.8621, 5.4416, 8.5185, -30.8621, -6.2238, 29.5488, 79.3122, -6.2238, 29.5488, -79.3122, -16.431, 233.1605, 0.3318, -70.3832, 185.3643, 0.3318, -26.6381, 29.5488, 0.3318, -19.3473, 24.7692, 72.6752, -26.6381, 6.6066, 33.5169, -26.6381, 26.681, 38.1628, -12.0565, 101.2431, 78.6485, -12.0565, 101.2431, -78.6485, 25.8559, 198.7472, 0.3318, -26.6381, 26.681, -38.1628, -26.6381, 6.6066, -33.5169, -19.3473, 24.7692, -72.6752, -48.5107, 24.7692, 68.693, -41.2198, 1.827, 30.1984, -76.2158, 35.2843, 52.1005, -76.2158, 35.2843, -52.1005, -41.2198, 1.827, -30.1984, -48.5107, 24.7692, -68.693, 132.3022, 5.6507, -0.3319, 133.7603, 27.6369, 16.9244, 139.593, 40.064, -0.3319, 133.7603, 27.6369, -16.9244, 219.7922, 5.6507, -0.3319, 225.6249, 21.9014, 12.2785, 228.5412, 39.108, -0.3319, 225.6249, 21.9014, -12.2785, 257.7046, 19.0336, -0.3319, 40.4376, 24.7692, 20.2429, 40.4376, 24.7692, -20.2429];
fnarr = ["fly", "run1", "run2", "run3", "run4", "sit1", "sit2", "sit3", "sit4", "sit5"];
_local5 = 0;
while (_local5 < fnarr.length) {
trace((("[ " + fnarr[_local5]) + " ]"));
_local4 = new Frame();
framenames[fnarr[_local5]] = _local5;
frames[_local5] = _local4;
_local3 = 0;
_local2 = 0;
while (_local2 < _local1[fnarr[_local5]].length) {
_local6 = new VertexPosition(varr[_local3]);
_local3++;
_local6.x = (_local1[fnarr[_local5]][_local2] * scaling);
_local6.y = (_local1[fnarr[_local5]][(_local2 + 1)] * scaling);
_local6.z = (_local1[fnarr[_local5]][(_local2 + 2)] * scaling);
_local4.vertexpositions.push(_local6);
_local2 = (_local2 + 3);
};
if (_local5 == 0){
_local4.adjust();
};
_local5++;
};
}
private function uv(_arg1:Number, _arg2:Number):void{
uvarr.push(new UV(_arg1, _arg2));
}
private function v():void{
var _local1:int;
_local1 = 0;
while (_local1 < 82) {
varr.push(new Vertex(0, 0, 0));
_local1++;
};
}
}
}//package
Section 177
//transparentpng (transparentpng)
package {
import flash.display.*;
public dynamic class transparentpng extends BitmapData {
public function transparentpng(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 178
//tree1 (tree1)
package {
import flash.display.*;
public dynamic class tree1 extends BitmapData {
public function tree1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 179
//tree2 (tree2)
package {
import flash.display.*;
public dynamic class tree2 extends BitmapData {
public function tree2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 180
//water (water)
package {
import flash.display.*;
public dynamic class water extends BitmapData {
public function water(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 181
//waterb (waterb)
package {
import flash.display.*;
public dynamic class waterb extends MovieClip {
public function waterb(){
addFrameScript(151, frame152);
}
function frame152(){
}
}
}//package