STORY LOOP FURRY PORN GAMES C SERVICES [?] [R] RND POPULAR | Archived flashes: 229594 |
/disc/ · /res/ — /show/ · /fap/ · /gg/ · /swf/ | P0001 · P2595 · P5190 |
This is the info page for Flash #95446 |
chris mckenzie |
ActionScript [AS3]
Section 1//TweenEvent (com.aarf.events.TweenEvent) package com.aarf.events { import flash.events.*; public class TweenEvent extends Event { public var positionObject:Object; public var tweenTarget:Object; public static const LOOP:String = "loop"; public function TweenEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){ super(_arg1, _arg2, _arg3); } } }//package com.aarf.eventsSection 2//DebugDispatcher (com.blitzagency.xray.logger.events.DebugDispatcher) package com.blitzagency.xray.logger.events { import flash.events.*; public class DebugDispatcher extends EventDispatcher { public static var TRACE:String = "trace"; public function sendEvent(_arg1:String, _arg2:Object):void{ trace(_arg2.message); dispatchEvent(new DebugEvent(DebugDispatcher.TRACE, false, false, _arg2)); } } }//package com.blitzagency.xray.logger.eventsSection 3//DebugEvent (com.blitzagency.xray.logger.events.DebugEvent) package com.blitzagency.xray.logger.events { import flash.events.*; public class DebugEvent extends Event { public var obj:Object; public function DebugEvent(_arg1:String, _arg2:Boolean, _arg3:Boolean, _arg4:Object):void{ obj = new Object(); super(_arg1, _arg2, _arg3); obj = _arg4; } } }//package com.blitzagency.xray.logger.eventsSection 4//ObjectTools (com.blitzagency.xray.logger.util.ObjectTools) package com.blitzagency.xray.logger.util { import com.blitzagency.xray.logger.*; import flash.utils.*; public class ObjectTools { private static var log:XrayLog = new XrayLog(); public function resolveBaseType(_arg1:Object):String{ return (""); } public static function getImmediateClassPath(_arg1:Object):String{ var _local2:String; var _local3:String; _local2 = getQualifiedClassName(_arg1); _local3 = getQualifiedSuperclassName(_arg1); _local2 = ((_local2.indexOf("::") > -1)) ? _local2.split("::").join(".") : _local2; if (_local3 == null){ return (_local2); }; _local3 = ((_local3.indexOf("::") > -1)) ? _local3.split("::").join(".") : _local3; return (((_local3 + ".") + _local2)); } public static function getFullClassPath(_arg1:Object):String{ var _local2:XML; var _local3:Array; var _local4:String; var _local5:XML; var _local6:String; _local2 = describeType(_arg1); _local3 = []; _local4 = getQualifiedClassName(_arg1); _local4 = ((_local4.indexOf("::") > -1)) ? _local4.split("::").join(".") : _local4; _local3.push(_local4); for each (_local5 in _local2.extendsClass) { _local6 = ((_local5.@type.toString().indexOf("::") > -1)) ? _local5.@type.toString().split("::")[1] : _local5.@type.toString(); _local3.push(_local6); }; return (_local3.join(".")); } } }//package com.blitzagency.xray.logger.utilSection 5//PropertyTools (com.blitzagency.xray.logger.util.PropertyTools) package com.blitzagency.xray.logger.util { import flash.utils.*; public class PropertyTools { private static function getVariables():void{ } public static function getProperties(_arg1:Object):Array{ var ary:Array; var xmlDoc:XML; var item:XML; var name:String; var type:String; var value:Object; var obj = _arg1; ary = []; try { xmlDoc = describeType(obj); for each (item in xmlDoc.variable) { name = item.@name.toString(); type = item.@type.toString(); value = ((obj[name])!=null) ? obj[name] : ""; ary.push({name:name, type:type, value:value}); }; } catch(e:Error) { }; return (ary); } private static function getMethods():void{ } } }//package com.blitzagency.xray.logger.utilSection 6//Debug (com.blitzagency.xray.logger.Debug) package com.blitzagency.xray.logger { import flash.events.*; import flash.utils.*; import com.blitzagency.xray.logger.events.*; import flash.net.*; public class Debug { private static var connected:Boolean = false; private static var xrayLC:LocalConnection; private static var ed:DebugDispatcher = new DebugDispatcher(); public static function traceObject(_arg1:Object, _arg2:Number=254, _arg3:Number=0, _arg4:String="", _arg5:Number=0):void{ var recurseDepth:Number; var indent:Number; var prop:String; var lead:String; var i:Number; var obj:String; var o = _arg1; var pRecurseDepth = _arg2; var pIndent = _arg3; var pPackage = _arg4; var pLevel = _arg5; try { recurseDepth = pRecurseDepth; indent = pIndent; for (prop in o) { lead = ""; i = 0; while (i < indent) { lead = (lead + " "); i = (i + 1); }; obj = o[prop].toString(); if ((o[prop] is Array)){ obj = "[Array]"; }; if (obj == "[object Object]"){ obj = "[Object]"; }; Debug.trace((((lead + prop) + ": ") + obj), pPackage, pLevel); if (recurseDepth > 0){ Debug.traceObject(o[prop], (recurseDepth - 1), (indent + 1), pPackage, pLevel); }; }; } catch(e:Error) { }; } public static function trace(_arg1:Object, _arg2:String="", _arg3:Number=0):void{ var msg:String; var pMsg = _arg1; var pPackage = _arg2; var pLevel = _arg3; ed.sendEvent(DebugDispatcher.TRACE, {message:pMsg, classPackage:pPackage}); if (!connected){ makeConnection(); }; if (connected){ try { msg = ((String(pMsg).length >= 39995)) ? (String(pMsg).substr(0, 39995) + "...") : String(pMsg); xrayLC.send("_xray_view_conn", "setTrace", msg, pLevel, pPackage); } catch(e:LogError) { LogError("No Xray Interface running"); }; }; } private static function makeConnection():void{ var err:LogError; xrayLC = new LocalConnection(); xrayLC.addEventListener("status", statusHandler); xrayLC.allowDomain("*"); try { xrayLC.connect(("_xray_standAlone_debug" + getTimer())); connected = true; } catch(e:Error) { err = new LogError("log"); setTimeout(makeConnection, 1000); }; } public static function addEventListener(_arg1:String, _arg2:Function):void{ ed.addEventListener(_arg1, _arg2); } private static function initialize():Boolean{ ed = new DebugDispatcher(); return (true); } private static function statusHandler(_arg1:StatusEvent):void{ if ((((((_arg1.code == null)) && ((_arg1.level == "error")))) && (connected))){ connected = false; } else { if ((((_arg1.level == "status")) && ((_arg1.code == null)))){ connected = true; }; }; } } }//package com.blitzagency.xray.logger class LogError extends Error { private function LogError(_arg1:String){ super(_arg1); } }Section 7//Log (com.blitzagency.xray.logger.Log) package com.blitzagency.xray.logger { import com.blitzagency.xray.logger.util.*; public class Log { private var level:Number; private var caller:String;// = "" private var classPackage:String; private var dump:Object; private var message:String; public function Log(_arg1:String, _arg2:Object, _arg3:Number, ... _args){ var err:LogError; var nullArray:Array; var str:String; var p_message = _arg1; var p_dump = _arg2; var p_level = _arg3; var rest = _args; caller = ""; super(); try { nullArray.push("bogus"); } catch(e:Error) { err = new LogError("log"); } finally { if (err.hasOwnProperty("getStackTrace")){ str = err.getStackTrace(); setCaller(resolveCaller(str)); } else { setCaller(""); }; setMessage(p_message); setDump(p_dump); setLevel(p_level); setClassPackage(p_dump); }; } public function setLevel(_arg1:Number):void{ level = _arg1; } public function getCaller():String{ return (caller); } public function setMessage(_arg1:String):void{ message = _arg1; } public function getLevel():Number{ return (level); } public function getDump():Object{ return (dump); } public function setCaller(_arg1:String):void{ caller = _arg1; } public function setClassPackage(_arg1:Object):void{ classPackage = ObjectTools.getImmediateClassPath(_arg1); } public function getMessage():String{ return (message); } public function getClassPackage():String{ return (classPackage); } public function setDump(_arg1:Object):void{ dump = _arg1; } private function resolveCaller(_arg1:String):String{ var ary:Array; var str = _arg1; ary = []; try { str = str.split("\n").join(""); ary = str.split("\tat "); str = ary[3]; } catch(e:Error) { } finally { str = ""; }; return (str); } } }//package com.blitzagency.xray.logger class LogError extends Error { private function LogError(_arg1:String){ super(_arg1); } }Section 8//Logger (com.blitzagency.xray.logger.Logger) package com.blitzagency.xray.logger { public interface Logger { function setLevel(_arg1:Number=0):void; function debug(_arg1:Log):void; function fatal(_arg1:Log):void; function warn(_arg1:Log):void; function error(_arg1:Log):void; function log(_arg1:String, _arg2:String, _arg3:String, _arg4:Number, _arg5:Object=null):void; function info(_arg1:Log):void; } }//package com.blitzagency.xray.loggerSection 9//XrayLog (com.blitzagency.xray.logger.XrayLog) package com.blitzagency.xray.logger { public class XrayLog { private var logger:XrayLogger; public function XrayLog(){ logger = XrayLogger.getInstance(); } public function debug(_arg1:String, ... _args):void{ var _local3:Number; if (_args.length == 0){ logger.debug(new Log(_arg1, null, XrayLogger.DEBUG)); }; _local3 = 0; while (_local3 < _args.length) { if (_local3 > 0){ _arg1 = ""; }; logger.debug(new Log(_arg1, _args[_local3], XrayLogger.DEBUG)); _local3++; }; } public function fatal(_arg1:String, ... _args):void{ var _local3:Number; if (_args.length == 0){ logger.fatal(new Log(_arg1, null, XrayLogger.FATAL)); }; _local3 = 0; while (_local3 < _args.length) { if (_local3 > 0){ _arg1 = ""; }; logger.fatal(new Log(_arg1, _args[_local3], XrayLogger.FATAL)); _local3++; }; } public function info(_arg1:String, ... _args):void{ var _local3:Number; if (_args.length == 0){ logger.info(new Log(_arg1, null, XrayLogger.INFO)); }; _local3 = 0; while (_local3 < _args.length) { if (_local3 > 0){ _arg1 = ""; }; logger.info(new Log(_arg1, _args[_local3], XrayLogger.INFO)); _local3++; }; } public function warn(_arg1:String, ... _args):void{ var _local3:Number; if (_args.length == 0){ logger.warn(new Log(_arg1, null, XrayLogger.WARN)); }; _local3 = 0; while (_local3 < _args.length) { if (_local3 > 0){ _arg1 = ""; }; logger.warn(new Log(_arg1, _args[_local3], XrayLogger.WARN)); _local3++; }; } public function error(_arg1:String, ... _args):void{ var _local3:Number; if (_args.length == 0){ logger.error(new Log(_arg1, null, XrayLogger.ERROR)); }; _local3 = 0; while (_local3 < _args.length) { if (_local3 > 0){ _arg1 = ""; }; logger.error(new Log(_arg1, _args[_local3], XrayLogger.ERROR)); _local3++; }; } } }//package com.blitzagency.xray.loggerSection 10//XrayLogger (com.blitzagency.xray.logger.XrayLogger) package com.blitzagency.xray.logger { import flash.events.*; import flash.utils.*; import com.blitzagency.xray.logger.util.*; public class XrayLogger extends EventDispatcher implements Logger { private var displayObjectRecursionDepth:Number;// = 3 private var level:Number;// = 0 private var indentation:Number;// = 0 private var objectRecursionDepth:Number;// = 254 private var filters:Array; public static var FATAL:Number = 4; public static var WARN:Number = 2; public static var ERROR:Number = 3; public static var INFO:Number = 1; public static var DEBUG:Number = 0; private static var _instance:XrayLogger = null; public static var NONE:Number = 5; public function XrayLogger(){ level = 0; displayObjectRecursionDepth = 3; objectRecursionDepth = 254; indentation = 0; filters = []; super(); } public function checkFilters():Boolean{ var _local1:uint; if (filters.length == 0){ return (true); }; _local1 = 0; while (_local1 < filters.length) { _local1++; }; return (true); } public function debug(_arg1:Log):void{ if (_arg1.getLevel() == level){ log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 0, _arg1.getDump()); }; } public function setIndentation(_arg1:Number=0):void{ indentation = _arg1; } public function error(_arg1:Log):void{ if (_arg1.getLevel() >= level){ log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 3, _arg1.getDump()); }; } public function setLevel(_arg1:Number=0):void{ level = _arg1; } public function fatal(_arg1:Log):void{ if (_arg1.getLevel() >= level){ log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 4, _arg1.getDump()); }; } public function warn(_arg1:Log):void{ if (_arg1.getLevel() >= level){ log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 2, _arg1.getDump()); }; } public function setObjectRecursionDepth(_arg1:Number):void{ objectRecursionDepth = _arg1; } public function setDisplayClipRecursionDepth(_arg1:Number):void{ displayObjectRecursionDepth = _arg1; } public function info(_arg1:Log):void{ if (_arg1.getLevel() >= level){ log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 1, _arg1.getDump()); }; } public function log(_arg1:String, _arg2:String, _arg3:String, _arg4:Number, _arg5:Object=null):void{ var _local6:String; var _local7:String; var _local8:String; var _local9:Object; _local6 = (("(" + getTimer()) + ") "); if (_arg3.length > 0){ _local6 = (_local6 + (_arg2 + "\n")); }; _local6 = (_local6 + _arg1); if (_arg1.length > 0){ Debug.trace(_local6, _arg3, _arg4); }; if (_arg5 == null){ return; }; _local7 = typeof(_arg5); if ((((((((((_local7 == "string")) || ((_local7 == "number")))) || ((_local7 == "boolean")))) || ((_local7 == "undefined")))) || ((_local7 == "null")))){ Debug.trace(_arg5, _arg3, _arg4); } else { if (_local7 == "xml"){ Debug.trace(_arg5.toString(), _arg3, _arg4); } else { _local8 = ObjectTools.getImmediateClassPath(_arg5); if ((((_local8 == "Object")) || ((_local8 == "Object.Array")))){ Debug.traceObject(_arg5, objectRecursionDepth, indentation, _arg3, _arg4); } else { _local9 = PropertyTools.getProperties(_arg5); Debug.traceObject(_local9, displayObjectRecursionDepth, indentation, _arg3, _arg4); }; }; }; } public function setFilters(_arg1:Array):void{ filters = _arg1; } public static function getInstance():XrayLogger{ if (_instance == null){ _instance = new (XrayLogger); }; return (_instance); } public static function resolveLevelAsName(_arg1:Number):String{ switch (_arg1){ case 0: return ("debug"); case 1: return ("info"); case 2: return ("warn"); case 3: return ("error"); case 4: return ("fatal"); default: return ("debug"); }; } } }//package com.blitzagency.xray.loggerSection 11//Elastic (com.mckenzie.transition.easing.Elastic) package com.mckenzie.transition.easing { public class Elastic { public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=-1, _arg6:Number=-1, ... _args):Number{ var _local8:*; if (_arg1 == 0){ return (_arg2); }; _arg1 = (_arg1 / _arg4); if (_arg1 == 1){ return ((_arg2 + _arg3)); }; _arg6 = -1; if (_arg6){ _arg6 = (_arg4 * 0.3); }; if ((((_arg5 == -1)) || ((_arg5 < Math.abs(_arg3))))){ _arg5 = _arg3; _local8 = (_arg6 / 4); } else { _local8 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5))); }; return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local8) * (2 * Math.PI)) / _arg6))) + _arg3) + _arg2)); } public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=-1, _arg6:Number=-1, ... _args):Number{ var _local8:*; if (_arg1 == 0){ return (_arg2); }; _arg1 = (_arg1 / _arg4); if (_arg1 == 1){ return ((_arg2 + _arg3)); }; _arg6 = -1; if (_arg6){ _arg6 = (_arg4 * 0.3); }; if ((((_arg5 == -1)) || ((_arg5 < Math.abs(_arg3))))){ _arg5 = _arg3; _local8 = (_arg6 / 4); } else { _local8 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5))); }; --_arg1; return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local8) * (2 * Math.PI)) / _arg6)))) + _arg2)); } public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=-1, _arg6:Number=-1, ... _args):Number{ var _local8:*; if (_arg1 == 0){ return (_arg2); }; _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 == 2){ return ((_arg2 + _arg3)); }; _arg6 = -1; if (_arg6){ _arg6 = (_arg4 * (0.3 * 1.5)); }; if ((((_arg5 == -1)) || ((_arg5 < Math.abs(_arg3))))){ _arg5 = _arg3; _local8 = (_arg6 / 4); } else { _local8 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5))); }; if (_arg1 < 1){ --_arg1; return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local8) * (2 * Math.PI)) / _arg6)))) + _arg2)); }; --_arg1; return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local8) * (2 * Math.PI)) / _arg6))) * 0.5) + _arg3) + _arg2)); } } }//package com.mckenzie.transition.easingSection 12//Tween (com.mckenzie.transition.Tween) package com.mckenzie.transition { import flash.display.*; import flash.events.*; import com.aarf.events.*; public class Tween extends EventDispatcher { private var _count:Number; private var _changeValues:Array; private var _begValues:Array; private var _remArgs:Array; public var round:Boolean;// = false private var _func:Function; private var _target:Object; private var _props:Array; private var _duration:Number; private var _mc:Sprite; public static const COMPLETE:String = "complete"; public static const LOOP:String = "loop"; public function Tween(_arg1:Boolean=false){ round = false; super(); this._mc = new Sprite(); this.round = _arg1; } private function _onLoop(_arg1:Object):void{ var _local2:TweenEvent; _local2 = new TweenEvent(Tween.LOOP); _local2.tweenTarget = this._target; _local2.positionObject = _arg1; this.dispatchEvent(_local2); } public function cancel():void{ if (this._mc.hasEventListener(Event.ENTER_FRAME)){ this._mc.removeEventListener(Event.ENTER_FRAME, this._doEase); }; } private function _onComplete(_arg1:Object):void{ var _local2:TweenEvent; _local2 = new TweenEvent(Tween.COMPLETE); _local2.tweenTarget = this._target; _local2.positionObject = _arg1; this.dispatchEvent(_local2); } override public function toString():String{ return ("[Tween]"); } public function ease(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Function, ... _args):void{ var _local6:String; var _local7:Number; this.cancel(); this._begValues = []; this._changeValues = []; this._props = []; for (_local6 in _arg2) { _local7 = (_arg1[_local6]) ? _arg1[_local6] : 0; this._begValues.push(_local7); this._changeValues.push((_arg2[_local6] - _local7)); this._props.push(_local6); }; this._target = _arg1; this._func = _arg4; this._count = 1; this._duration = _arg3; this._remArgs = _args; this._mc.addEventListener(Event.ENTER_FRAME, this._doEase); } private function _doEase(_arg1:Event=null):void{ var _local2:Object; var _local3:Number; var _local4:Array; _local2 = new Object(); _local3 = 0; while (_local3 < this._props.length) { _local4 = [this._count, this._begValues[_local3], this._changeValues[_local3], this._duration]; _local4 = _local4.concat(this._remArgs); if (this.round){ this._target[this._props[_local3]] = (_local2[this._props[_local3]] = Math.round(new Number(this._func.apply(null, _local4)))); } else { this._target[this._props[_local3]] = (_local2[this._props[_local3]] = this._func.apply(null, _local4)); }; _local3++; }; this._onLoop(_local2); this._count++; if (this._count > this._duration){ this.cancel(); this._onComplete(_local2); }; } } }//package com.mckenzie.transitionSection 13//StageReference (com.mckenzie.utils.StageReference) package com.mckenzie.utils { import flash.display.*; public class StageReference { public static var STAGE:Stage; } }//package com.mckenzie.utilsSection 14//Camera3D (org.papervision3d.cameras.Camera3D) package org.papervision3d.cameras { import org.papervision3d.core.proto.*; import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import flash.geom.*; import org.papervision3d.core.math.*; import org.papervision3d.objects.*; import org.papervision3d.core.culling.*; public class Camera3D extends CameraObject3D { private var _prevZoom:Number; private var _prevOrthoProjection:Boolean; private var _prevHeight:Number; private var _prevFocus:Number; private var _prevUseProjection:Boolean; private var _focusFix:Matrix3D; private var _prevOrtho:Boolean; private var _prevWidth:Number; private var _projection:Matrix3D; public function Camera3D(_arg1:Number=60, _arg2:Number=10, _arg3:Number=5000, _arg4:Boolean=false, _arg5:Boolean=false){ super(_arg2, 40); _prevFocus = 0; _prevZoom = 0; _prevOrtho = false; _prevUseProjection = false; _useCulling = _arg4; _useProjectionMatrix = _arg5; _far = _arg3; _focusFix = Matrix3D.IDENTITY; } override public function set far(_arg1:Number):void{ if (_arg1 > this.focus){ _far = _arg1; this.update(this.viewport); }; } override public function projectVertices(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{ var _local3:Matrix3D; var _local4:Array; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local23:Number; var _local24:Vertex3D; var _local25:Vertex3DInstance; var _local26:Number; var _local27:int; var _local28:Number; var _local29:Number; var _local30:Number; var _local31:Number; var _local32:Number; var _local33:Number; if (((!(_arg1.geometry)) || (!(_arg1.geometry.vertices)))){ return (0); }; _local3 = _arg1.view; _local4 = _arg1.geometry.vertices; _local5 = _local3.n11; _local6 = _local3.n12; _local7 = _local3.n13; _local8 = _local3.n21; _local9 = _local3.n22; _local10 = _local3.n23; _local11 = _local3.n31; _local12 = _local3.n32; _local13 = _local3.n33; _local14 = _local3.n41; _local15 = _local3.n42; _local16 = _local3.n43; _local27 = _local4.length; _local28 = _arg2.camera.focus; _local29 = (_local28 * _arg2.camera.zoom); _local30 = (viewport.width / 2); _local31 = (viewport.height / 2); _local32 = _arg2.camera.far; _local33 = (_local32 - _local28); while ((_local24 = _local4[--_local27])) { _local17 = _local24.x; _local18 = _local24.y; _local19 = _local24.z; _local22 = ((((_local17 * _local11) + (_local18 * _local12)) + (_local19 * _local13)) + _local3.n34); _local25 = _local24.vertex3DInstance; if (_useProjectionMatrix){ _local23 = ((((_local17 * _local14) + (_local18 * _local15)) + (_local19 * _local16)) + _local3.n44); _local22 = (_local22 / _local23); if ((_local25.visible = (((_local22 > 0)) && ((_local22 < 1))))){ _local20 = (((((_local17 * _local5) + (_local18 * _local6)) + (_local19 * _local7)) + _local3.n14) / _local23); _local21 = (((((_local17 * _local8) + (_local18 * _local9)) + (_local19 * _local10)) + _local3.n24) / _local23); _local25.x = (_local20 * _local30); _local25.y = (_local21 * _local31); _local25.z = (_local22 * _local23); }; } else { if ((_local25.visible = ((_local28 + _local22) > 0))){ _local20 = ((((_local17 * _local5) + (_local18 * _local6)) + (_local19 * _local7)) + _local3.n14); _local21 = ((((_local17 * _local8) + (_local18 * _local9)) + (_local19 * _local10)) + _local3.n24); _local26 = (_local29 / (_local28 + _local22)); _local25.x = (_local20 * _local26); _local25.y = (_local21 * _local26); _local25.z = _local22; }; }; }; return (0); } override public function transformView(_arg1:Matrix3D=null):void{ if (((((((((((!((ortho == _prevOrtho))) || (!((_prevUseProjection == _useProjectionMatrix))))) || (!((focus == _prevFocus))))) || (!((zoom == _prevZoom))))) || (!((viewport.width == _prevWidth))))) || (!((viewport.height == _prevHeight))))){ update(viewport); }; if (_target){ lookAt(_target); } else { if (_transformDirty){ updateTransform(); }; }; if (_useProjectionMatrix){ super.transformView(); this.eye.calculateMultiply4x4(_projection, this.eye); } else { _focusFix.copy(this.transform); _focusFix.n14 = (_focusFix.n14 + (focus * this.transform.n13)); _focusFix.n24 = (_focusFix.n24 + (focus * this.transform.n23)); _focusFix.n34 = (_focusFix.n34 + (focus * this.transform.n33)); super.transformView(_focusFix); }; if ((culler is FrustumCuller)){ FrustumCuller(culler).transform.copy(this.transform); }; } override public function orbit(_arg1:Number, _arg2:Number, _arg3:Boolean=true, _arg4:DisplayObject3D=null):void{ var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; _arg4 = ((_arg4) || (_target)); _arg4 = ((_arg4) || (DisplayObject3D.ZERO)); if (_arg3){ _arg1 = (_arg1 * (Math.PI / 180)); _arg2 = (_arg2 * (Math.PI / 180)); }; _local5 = (_arg4.world.n14 - this.x); _local6 = (_arg4.world.n24 - this.y); _local7 = (_arg4.world.n34 - this.z); _local8 = Math.sqrt((((_local5 * _local5) + (_local6 * _local6)) + (_local7 * _local7))); _local9 = (Math.cos(_arg2) * Math.sin(_arg1)); _local10 = (Math.sin(_arg2) * Math.sin(_arg1)); _local11 = Math.cos(_arg1); this.x = (_arg4.world.n14 + (_local9 * _local8)); this.y = (_arg4.world.n24 + (_local11 * _local8)); this.z = (_arg4.world.n34 + (_local10 * _local8)); this.lookAt(_arg4); } override public function set near(_arg1:Number):void{ if (_arg1 > 0){ this.focus = _arg1; this.update(this.viewport); }; } public function update(_arg1:Rectangle):void{ if (!_arg1){ throw (new Error(("Camera3D#update: Invalid viewport rectangle! " + _arg1))); }; this.viewport = _arg1; _prevFocus = this.focus; _prevZoom = this.zoom; _prevWidth = this.viewport.width; _prevHeight = this.viewport.height; if (_prevOrtho != this.ortho){ if (this.ortho){ _prevOrthoProjection = this.useProjectionMatrix; this.useProjectionMatrix = true; } else { this.useProjectionMatrix = _prevOrthoProjection; }; } else { if (_prevUseProjection != _useProjectionMatrix){ this.useProjectionMatrix = this._useProjectionMatrix; }; }; _prevOrtho = this.ortho; _prevUseProjection = _useProjectionMatrix; this.useCulling = _useCulling; } override public function set orthoScale(_arg1:Number):void{ super.orthoScale = _arg1; this.useProjectionMatrix = this.useProjectionMatrix; _prevOrtho = !(this.ortho); this.update(this.viewport); } override public function set useProjectionMatrix(_arg1:Boolean):void{ var _local2:Number; var _local3:Number; if (_arg1){ if (this.ortho){ _local2 = (viewport.width / 2); _local3 = (viewport.height / 2); _projection = createOrthoMatrix(-(_local2), _local2, -(_local3), _local3, -(_far), _far); _projection = Matrix3D.multiply(_orthoScaleMatrix, _projection); } else { _projection = createPerspectiveMatrix(fov, (viewport.width / viewport.height), this.focus, this.far); }; } else { if (this.ortho){ _arg1 = true; }; }; super.useProjectionMatrix = _arg1; } override public function set useCulling(_arg1:Boolean):void{ super.useCulling = _arg1; if (_useCulling){ if (!this.culler){ this.culler = new FrustumCuller(); }; FrustumCuller(this.culler).initialize(this.fov, (this.viewport.width / this.viewport.height), (this.focus / this.zoom), _far); } else { this.culler = null; }; } public static function createPerspectiveMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Matrix3D{ var _local5:Number; var _local6:Number; var _local7:Number; _local5 = ((_arg1 / 2) * (Math.PI / 180)); _local6 = Math.tan(_local5); _local7 = (1 / _local6); return (new Matrix3D([(_local7 / _arg2), 0, 0, 0, 0, _local7, 0, 0, 0, 0, -(((_arg3 + _arg4) / (_arg3 - _arg4))), (((2 * _arg4) * _arg3) / (_arg3 - _arg4)), 0, 0, 1, 0])); } public static function createOrthoMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Matrix3D{ var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Matrix3D; _local7 = ((_arg2 + _arg1) / (_arg2 - _arg1)); _local8 = ((_arg4 + _arg3) / (_arg4 - _arg3)); _local9 = ((_arg6 + _arg5) / (_arg6 - _arg5)); _local10 = new Matrix3D([(2 / (_arg2 - _arg1)), 0, 0, _local7, 0, (2 / (_arg4 - _arg3)), 0, _local8, 0, 0, (-2 / (_arg6 - _arg5)), _local9, 0, 0, 0, 1]); _local10.calculateMultiply(Matrix3D.scaleMatrix(1, 1, -1), _local10); return (_local10); } } }//package org.papervision3d.camerasSection 15//DefaultLineCuller (org.papervision3d.core.culling.DefaultLineCuller) package org.papervision3d.core.culling { import org.papervision3d.core.geom.renderables.*; public class DefaultLineCuller implements ILineCuller { public function testLine(_arg1:Line3D):Boolean{ return (((_arg1.v0.vertex3DInstance.visible) && (_arg1.v1.vertex3DInstance.visible))); } } }//package org.papervision3d.core.cullingSection 16//DefaultParticleCuller (org.papervision3d.core.culling.DefaultParticleCuller) package org.papervision3d.core.culling { import org.papervision3d.core.geom.renderables.*; public class DefaultParticleCuller implements IParticleCuller { public function testParticle(_arg1:Particle):Boolean{ if (_arg1.material.invisible == false){ if (_arg1.vertex3D.vertex3DInstance.visible == true){ return (true); }; }; return (false); } } }//package org.papervision3d.core.cullingSection 17//DefaultTriangleCuller (org.papervision3d.core.culling.DefaultTriangleCuller) package org.papervision3d.core.culling { import org.papervision3d.core.proto.*; import org.papervision3d.core.geom.renderables.*; public class DefaultTriangleCuller implements ITriangleCuller { protected static var y2:Number; protected static var y1:Number; protected static var y0:Number; protected static var x0:Number; protected static var x1:Number; protected static var x2:Number; public function testFace(_arg1:Triangle3D, _arg2:Vertex3DInstance, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance):Boolean{ var _local5:MaterialObject3D; if (((((_arg2.visible) && (_arg3.visible))) && (_arg4.visible))){ _local5 = (_arg1.material) ? _arg1.material : _arg1.instance.material; if (_local5.invisible){ return (false); }; x0 = _arg2.x; y0 = _arg2.y; x1 = _arg3.x; y1 = _arg3.y; x2 = _arg4.x; y2 = _arg4.y; if (_local5.oneSide){ if (_local5.opposite){ if ((((x2 - x0) * (y1 - y0)) - ((y2 - y0) * (x1 - x0))) > 0){ return (false); }; } else { if ((((x2 - x0) * (y1 - y0)) - ((y2 - y0) * (x1 - x0))) < 0){ return (false); }; }; }; return (true); }; return (false); } } }//package org.papervision3d.core.cullingSection 18//FrustumCuller (org.papervision3d.core.culling.FrustumCuller) package org.papervision3d.core.culling { import org.papervision3d.core.geom.renderables.*; import org.papervision3d.core.math.*; import org.papervision3d.objects.*; public class FrustumCuller implements IObjectCuller { private var _tang:Number; private var _ratio:Number; private var _near:Number; private var _fov:Number; private var _far:Number; private var _nh:Number; private var _fh:Number; public var transform:Matrix3D; private var _sphereY:Number; private var _nw:Number; private var _sphereX:Number; private var _fw:Number; public static const OUTSIDE:int = -1; public static const INSIDE:int = 1; public static const INTERSECT:int = 0; public function FrustumCuller(){ this.transform = Matrix3D.IDENTITY; this.initialize(); } public function get ratio():Number{ return (_ratio); } public function pointInFrustum(_arg1:Number, _arg2:Number, _arg3:Number):int{ var _local4:Matrix3D; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; _local4 = this.transform; _local5 = (_arg1 - _local4.n14); _local6 = (_arg2 - _local4.n24); _local7 = (_arg3 - _local4.n34); _local8 = (((_local5 * _local4.n13) + (_local6 * _local4.n23)) + (_local7 * _local4.n33)); if ((((_local8 > _far)) || ((_local8 < _near)))){ return (OUTSIDE); }; _local9 = (((_local5 * _local4.n12) + (_local6 * _local4.n22)) + (_local7 * _local4.n32)); _local10 = (_local8 * _tang); if ((((_local9 > _local10)) || ((_local9 < -(_local10))))){ return (OUTSIDE); }; _local11 = (((_local5 * _local4.n11) + (_local6 * _local4.n21)) + (_local7 * _local4.n31)); _local10 = (_local10 * _ratio); if ((((_local11 > _local10)) || ((_local11 < -(_local10))))){ return (OUTSIDE); }; return (INSIDE); } public function initialize(_arg1:Number=60, _arg2:Number=1.333, _arg3:Number=1, _arg4:Number=5000):void{ var _local5:Number; var _local6:Number; _fov = _arg1; _ratio = _arg2; _near = _arg3; _far = _arg4; _local5 = (((Math.PI / 180) * _fov) * 0.5); _tang = Math.tan(_local5); _nh = (_near * _tang); _nw = (_nh * _ratio); _fh = (_far * _tang); _fw = (_fh * _ratio); _local6 = Math.atan((_tang * _ratio)); _sphereX = (1 / Math.cos(_local6)); _sphereY = (1 / Math.cos(_local5)); } public function get fov():Number{ return (_fov); } public function set ratio(_arg1:Number):void{ this.initialize(_fov, _arg1, _near, _far); } public function get far():Number{ return (_far); } public function set fov(_arg1:Number):void{ this.initialize(_arg1, _ratio, _near, _far); } public function get near():Number{ return (_near); } public function set far(_arg1:Number):void{ this.initialize(_fov, _ratio, _near, _arg1); } public function set near(_arg1:Number):void{ this.initialize(_fov, _ratio, _arg1, _far); } public function sphereInFrustum(_arg1:DisplayObject3D, _arg2:BoundingSphere):int{ var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:int; var _local9:Matrix3D; var _local10:Number; var _local11:Number; var _local12:Number; _local3 = _arg2.radius; _local8 = INSIDE; _local9 = this.transform; _local10 = (_arg1.world.n14 - _local9.n14); _local11 = (_arg1.world.n24 - _local9.n24); _local12 = (_arg1.world.n34 - _local9.n34); _local7 = (((_local10 * _local9.n13) + (_local11 * _local9.n23)) + (_local12 * _local9.n33)); if ((((_local7 > (_far + _local3))) || ((_local7 < (_near - _local3))))){ return (OUTSIDE); }; if ((((_local7 > (_far - _local3))) || ((_local7 < (_near + _local3))))){ _local8 = INTERSECT; }; _local6 = (((_local10 * _local9.n12) + (_local11 * _local9.n22)) + (_local12 * _local9.n32)); _local4 = (_sphereY * _local3); _local7 = (_local7 * _tang); if ((((_local6 > (_local7 + _local4))) || ((_local6 < (-(_local7) - _local4))))){ return (OUTSIDE); }; if ((((_local6 > (_local7 - _local4))) || ((_local6 < (-(_local7) + _local4))))){ _local8 = INTERSECT; }; _local5 = (((_local10 * _local9.n11) + (_local11 * _local9.n21)) + (_local12 * _local9.n31)); _local7 = (_local7 * _ratio); _local4 = (_sphereX * _local3); if ((((_local5 > (_local7 + _local4))) || ((_local5 < (-(_local7) - _local4))))){ return (OUTSIDE); }; if ((((_local5 > (_local7 - _local4))) || ((_local5 < (-(_local7) + _local4))))){ _local8 = INTERSECT; }; return (_local8); } public function testObject(_arg1:DisplayObject3D):int{ var _local2:int; _local2 = INSIDE; if (((((!(_arg1.geometry)) || (!(_arg1.geometry.vertices)))) || (!(_arg1.geometry.vertices.length)))){ return (_local2); }; switch (_arg1.frustumTestMethod){ case FrustumTestMethod.BOUNDING_SPHERE: _local2 = sphereInFrustum(_arg1, _arg1.geometry.boundingSphere); break; case FrustumTestMethod.BOUNDING_BOX: _local2 = aabbInFrustum(_arg1, _arg1.geometry.aabb); break; case FrustumTestMethod.NO_TESTING: break; default: break; }; return (_local2); } public function aabbInFrustum(_arg1:DisplayObject3D, _arg2:AxisAlignedBoundingBox, _arg3:Boolean=true):int{ var _local4:Vertex3D; var _local5:Number3D; var _local6:int; var _local7:int; var _local8:Array; _local6 = 0; _local7 = 0; _local8 = _arg2.getBoxVertices(); for each (_local4 in _local8) { _local5 = _local4.toNumber3D(); Matrix3D.multiplyVector(_arg1.world, _local5); if (pointInFrustum(_local5.x, _local5.y, _local5.z) == INSIDE){ _local6++; if (_arg3){ return (INSIDE); }; } else { _local7++; }; if (((_local6) && (_local7))){ return (INTERSECT); }; }; if (_local6){ return (((_local6 < 8)) ? INTERSECT : INSIDE); //unresolved jump }; return (OUTSIDE); } } }//package org.papervision3d.core.cullingSection 19//FrustumTestMethod (org.papervision3d.core.culling.FrustumTestMethod) package org.papervision3d.core.culling { public class FrustumTestMethod { public static const BOUNDING_BOX:int = 1; public static const NO_TESTING:int = -1; public static const BOUNDING_SPHERE:int = 0; } }//package org.papervision3d.core.cullingSection 20//ILineCuller (org.papervision3d.core.culling.ILineCuller) package org.papervision3d.core.culling { import org.papervision3d.core.geom.renderables.*; public interface ILineCuller { function testLine(_arg1:Line3D):Boolean; } }//package org.papervision3d.core.cullingSection 21//IObjectCuller (org.papervision3d.core.culling.IObjectCuller) package org.papervision3d.core.culling { import org.papervision3d.objects.*; public interface IObjectCuller { function testObject(_arg1:DisplayObject3D):int; } }//package org.papervision3d.core.cullingSection 22//IParticleCuller (org.papervision3d.core.culling.IParticleCuller) package org.papervision3d.core.culling { import org.papervision3d.core.geom.renderables.*; public interface IParticleCuller { function testParticle(_arg1:Particle):Boolean; } }//package org.papervision3d.core.cullingSection 23//ITriangleCuller (org.papervision3d.core.culling.ITriangleCuller) package org.papervision3d.core.culling { import org.papervision3d.core.geom.renderables.*; public interface ITriangleCuller { function testFace(_arg1:Triangle3D, _arg2:Vertex3DInstance, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance):Boolean; } }//package org.papervision3d.core.cullingSection 24//RectangleLineCuller (org.papervision3d.core.culling.RectangleLineCuller) package org.papervision3d.core.culling { import org.papervision3d.core.geom.renderables.*; import flash.geom.*; import org.papervision3d.core.math.util.*; public class RectangleLineCuller implements ILineCuller { private var rectIntersection:Rectangle; private var lineBoundsRect:Rectangle; private var cullingRectangle:Rectangle; public function RectangleLineCuller(_arg1:Rectangle=null):void{ if (_arg1){ this.cullingRectangle = _arg1; }; lineBoundsRect = new Rectangle(); rectIntersection = new Rectangle(); } public function testLine(_arg1:Line3D):Boolean{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; if (((!(_arg1.v0.vertex3DInstance.visible)) || (!(_arg1.v1.vertex3DInstance.visible)))){ return (false); }; _local2 = _arg1.v0.vertex3DInstance.x; _local3 = _arg1.v0.vertex3DInstance.y; _local4 = _arg1.v1.vertex3DInstance.x; _local5 = _arg1.v1.vertex3DInstance.y; lineBoundsRect.width = Math.abs((_local4 - _local2)); lineBoundsRect.height = Math.abs((_local5 - _local3)); if (_local2 < _local4){ lineBoundsRect.x = _local2; } else { lineBoundsRect.x = _local4; }; if (_local3 < _local5){ lineBoundsRect.y = _local3; } else { lineBoundsRect.y = _local5; }; if (cullingRectangle.containsRect(lineBoundsRect)){ return (true); }; if (!FastRectangleTools.intersects(lineBoundsRect, cullingRectangle)){ return (false); }; rectIntersection = FastRectangleTools.intersection(lineBoundsRect, cullingRectangle); _local6 = ((_local5 - _local3) / (_local4 - _local2)); _local7 = (_local3 - (_local6 * _local2)); _local8 = ((cullingRectangle.top - _local7) / _local6); if ((((_local8 > rectIntersection.left)) && ((_local8 < rectIntersection.right)))){ return (true); }; _local8 = ((cullingRectangle.bottom - _local7) / _local6); if ((((_local8 > rectIntersection.left)) && ((_local8 < rectIntersection.right)))){ return (true); }; _local9 = ((_local6 * cullingRectangle.left) + _local7); if ((((_local9 > rectIntersection.top)) && ((_local9 < rectIntersection.bottom)))){ return (true); }; _local9 = ((_local6 * cullingRectangle.right) + _local7); if ((((_local9 > rectIntersection.top)) && ((_local9 < rectIntersection.bottom)))){ return (true); }; return (false); } } }//package org.papervision3d.core.cullingSection 25//RectangleParticleCuller (org.papervision3d.core.culling.RectangleParticleCuller) package org.papervision3d.core.culling { import org.papervision3d.core.geom.renderables.*; import flash.geom.*; import org.papervision3d.core.math.util.*; public class RectangleParticleCuller implements IParticleCuller { public var cullingRectangle:Rectangle; private static var vInstance:Vertex3DInstance; private static var testPoint:Point; public function RectangleParticleCuller(_arg1:Rectangle=null){ this.cullingRectangle = _arg1; testPoint = new Point(); } public function testParticle(_arg1:Particle):Boolean{ vInstance = _arg1.vertex3D.vertex3DInstance; if (_arg1.material.invisible == false){ if (vInstance.visible){ if (FastRectangleTools.intersects(_arg1.renderRect, cullingRectangle)){ return (true); }; }; }; return (false); } } }//package org.papervision3d.core.cullingSection 26//RectangleTriangleCuller (org.papervision3d.core.culling.RectangleTriangleCuller) package org.papervision3d.core.culling { import org.papervision3d.core.geom.renderables.*; import flash.geom.*; import org.papervision3d.core.math.util.*; public class RectangleTriangleCuller extends DefaultTriangleCuller implements ITriangleCuller { public var cullingRectangle:Rectangle; private static const DEFAULT_RECT_X:Number = -((DEFAULT_RECT_W / 2)); private static const DEFAULT_RECT_W:Number = 640; private static const DEFAULT_RECT_H:Number = 480; private static const DEFAULT_RECT_Y:Number = -((DEFAULT_RECT_H / 2)); private static var hitRect:Rectangle = new Rectangle(); public function RectangleTriangleCuller(_arg1:Rectangle=null):void{ cullingRectangle = new Rectangle(DEFAULT_RECT_X, DEFAULT_RECT_Y, DEFAULT_RECT_W, DEFAULT_RECT_H); super(); if (_arg1){ this.cullingRectangle = _arg1; }; } override public function testFace(_arg1:Triangle3D, _arg2:Vertex3DInstance, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance):Boolean{ if (super.testFace(_arg1, _arg2, _arg3, _arg4)){ hitRect.x = Math.min(_arg4.x, Math.min(_arg3.x, _arg2.x)); hitRect.width = (Math.max(_arg4.x, Math.max(_arg3.x, _arg2.x)) + Math.abs(hitRect.x)); hitRect.y = Math.min(_arg4.y, Math.min(_arg3.y, _arg2.y)); hitRect.height = (Math.max(_arg4.y, Math.max(_arg3.y, _arg2.y)) + Math.abs(hitRect.y)); return (FastRectangleTools.intersects(cullingRectangle, hitRect)); }; return (false); } } }//package org.papervision3d.core.cullingSection 27//ViewportObjectFilter (org.papervision3d.core.culling.ViewportObjectFilter) package org.papervision3d.core.culling { import org.papervision3d.objects.*; import flash.utils.*; public class ViewportObjectFilter implements IObjectCuller { protected var _mode:int; protected var objects:Dictionary; public function ViewportObjectFilter(_arg1:int):void{ this.mode = _arg1; init(); } public function addObject(_arg1:DisplayObject3D):void{ objects[_arg1] = _arg1; } public function removeObject(_arg1:DisplayObject3D):void{ delete objects[_arg1]; } public function set mode(_arg1:int):void{ _mode = _arg1; } public function get mode():int{ return (_mode); } private function init():void{ objects = new Dictionary(true); } public function testObject(_arg1:DisplayObject3D):int{ if (objects[_arg1]){ if (_mode == ViewportObjectFilterMode.INCLUSIVE){ return (1); }; if (_mode == ViewportObjectFilterMode.EXCLUSIVE){ return (0); }; } else { if (_mode == ViewportObjectFilterMode.INCLUSIVE){ return (0); }; if (_mode == ViewportObjectFilterMode.EXCLUSIVE){ return (1); }; }; return (0); } public function destroy():void{ objects = null; } } }//package org.papervision3d.core.cullingSection 28//ViewportObjectFilterMode (org.papervision3d.core.culling.ViewportObjectFilterMode) package org.papervision3d.core.culling { public class ViewportObjectFilterMode { public static const INCLUSIVE:int = 0; public static const EXCLUSIVE:int = 1; } }//package org.papervision3d.core.cullingSection 29//UserData (org.papervision3d.core.data.UserData) package org.papervision3d.core.data { public class UserData { public var data; public function UserData(_arg1=null){ this.data = _arg1; } } }//package org.papervision3d.core.dataSection 30//AbstractRenderable (org.papervision3d.core.geom.renderables.AbstractRenderable) package org.papervision3d.core.geom.renderables { import org.papervision3d.core.render.command.*; import org.papervision3d.objects.*; import org.papervision3d.core.data.*; public class AbstractRenderable implements IRenderable { public var _userData:UserData; public var instance:DisplayObject3D; public function getRenderListItem():IRenderListItem{ return (null); } public function set userData(_arg1:UserData):void{ _userData = _arg1; } public function get userData():UserData{ return (_userData); } } }//package org.papervision3d.core.geom.renderablesSection 31//IRenderable (org.papervision3d.core.geom.renderables.IRenderable) package org.papervision3d.core.geom.renderables { import org.papervision3d.core.render.command.*; public interface IRenderable { function getRenderListItem():IRenderListItem; } }//package org.papervision3d.core.geom.renderablesSection 32//Line3D (org.papervision3d.core.geom.renderables.Line3D) package org.papervision3d.core.geom.renderables { import org.papervision3d.core.render.command.*; import org.papervision3d.materials.special.*; import org.papervision3d.core.geom.*; public class Line3D extends AbstractRenderable implements IRenderable { public var size:Number; public var cV:Vertex3D; public var renderCommand:RenderLine; public var material:LineMaterial; public var v0:Vertex3D; public var v1:Vertex3D; public function Line3D(_arg1:Lines3D, _arg2:LineMaterial, _arg3:Number, _arg4:Vertex3D, _arg5:Vertex3D, _arg6:Vertex3D=null){ this.size = _arg3; this.material = _arg2; this.v0 = _arg4; this.v1 = _arg5; this.cV = _arg5; this.instance = _arg1; this.renderCommand = new RenderLine(this); } public function addControlVertex(_arg1:Number, _arg2:Number, _arg3:Number):void{ cV = new Vertex3D(_arg1, _arg2, _arg3); if (instance.geometry.vertices.indexOf(cV) == -1){ instance.geometry.vertices.push(cV); }; } override public function getRenderListItem():IRenderListItem{ return (this.renderCommand); } } }//package org.papervision3d.core.geom.renderablesSection 33//Particle (org.papervision3d.core.geom.renderables.Particle) package org.papervision3d.core.geom.renderables { import org.papervision3d.core.render.command.*; import flash.geom.*; import org.papervision3d.materials.special.*; public class Particle extends AbstractRenderable implements IRenderable { public var size:Number; public var renderScale:Number; public var vertex3D:Vertex3D; public var renderRect:Rectangle; public var renderCommand:RenderParticle; public var material:ParticleMaterial; public function Particle(_arg1:ParticleMaterial, _arg2:Number=1, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0){ this.material = _arg1; this.size = _arg2; this.renderCommand = new RenderParticle(this); this.renderRect = new Rectangle(); vertex3D = new Vertex3D(_arg3, _arg4, _arg5); } public function get y():Number{ return (vertex3D.y); } public function updateRenderRect():void{ material.updateRenderRect(this); } public function set z(_arg1:Number):void{ vertex3D.z = _arg1; } public function set x(_arg1:Number):void{ vertex3D.x = _arg1; } public function set y(_arg1:Number):void{ vertex3D.y = _arg1; } public function get x():Number{ return (vertex3D.x); } public function get z():Number{ return (vertex3D.z); } override public function getRenderListItem():IRenderListItem{ return (renderCommand); } } }//package org.papervision3d.core.geom.renderablesSection 34//Triangle3D (org.papervision3d.core.geom.renderables.Triangle3D) package org.papervision3d.core.geom.renderables { import org.papervision3d.core.proto.*; import org.papervision3d.core.render.command.*; import org.papervision3d.core.math.*; import org.papervision3d.objects.*; public class Triangle3D extends AbstractRenderable implements IRenderable { public var vertices:Array; public var v1:Vertex3D; public var face3DInstance:Triangle3DInstance; public var _uvArray:Array; public var visible:Boolean; public var id:Number; public var material:MaterialObject3D; public var renderCommand:RenderTriangle; public var screenZ:Number; public var uv0:NumberUV; public var uv1:NumberUV; public var uv2:NumberUV; public var faceNormal:Number3D; public var _materialName:String; public var v0:Vertex3D; public var v2:Vertex3D; private static var _totalFaces:Number = 0; public function Triangle3D(_arg1:DisplayObject3D, _arg2:Array, _arg3:MaterialObject3D=null, _arg4:Array=null){ this.instance = _arg1; this.renderCommand = new RenderTriangle(this); face3DInstance = new Triangle3DInstance(this, _arg1); faceNormal = new Number3D(); if (((_arg2) && ((_arg2.length == 3)))){ this.vertices = _arg2; v0 = _arg2[0]; v1 = _arg2[1]; v2 = _arg2[2]; createNormal(); } else { _arg2 = new Array(); v0 = (_arg2[0] = new Vertex3D()); v1 = (_arg2[1] = new Vertex3D()); v2 = (_arg2[2] = new Vertex3D()); }; this.material = _arg3; this.uv = _arg4; this.id = _totalFaces++; } public function set uv(_arg1:Array):void{ if (((_arg1) && ((_arg1.length == 3)))){ uv0 = NumberUV(_arg1[0]); uv1 = NumberUV(_arg1[1]); uv2 = NumberUV(_arg1[2]); }; _uvArray = _arg1; } public function createNormal():void{ var _local1:Number3D; var _local2:Number3D; var _local3:Number3D; _local1 = v0.getPosition(); _local2 = v1.getPosition(); _local3 = v2.getPosition(); _local2.minusEq(_local1); _local3.minusEq(_local1); faceNormal = Number3D.cross(_local2, _local3, faceNormal); faceNormal.normalize(); } public function get uv():Array{ return (_uvArray); } public function updateVertices():void{ v0 = vertices[0]; v1 = vertices[1]; v2 = vertices[2]; } override public function getRenderListItem():IRenderListItem{ return (renderCommand); } } }//package org.papervision3d.core.geom.renderablesSection 35//Triangle3DInstance (org.papervision3d.core.geom.renderables.Triangle3DInstance) package org.papervision3d.core.geom.renderables { import flash.display.*; import org.papervision3d.core.math.*; import org.papervision3d.objects.*; public class Triangle3DInstance { public var container:Sprite; public var faceNormal:Number3D; public var screenZ:Number; public var visible:Boolean;// = false public var instance:DisplayObject3D; public function Triangle3DInstance(_arg1:Triangle3D, _arg2:DisplayObject3D){ visible = false; super(); this.instance = _arg2; faceNormal = new Number3D(); } } }//package org.papervision3d.core.geom.renderablesSection 36//Vertex3D (org.papervision3d.core.geom.renderables.Vertex3D) package org.papervision3d.core.geom.renderables { import org.papervision3d.core.render.command.*; import org.papervision3d.core.math.*; import flash.utils.*; public class Vertex3D extends AbstractRenderable implements IRenderable { public var vertex3DInstance:Vertex3DInstance; public var extra:Object; public var normal:Number3D; protected var position:Number3D; public var connectedFaces:Dictionary; public var x:Number; public var y:Number; public var z:Number; public function Vertex3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){ position = new Number3D(); super(); this.x = (position.x = _arg1); this.y = (position.y = _arg2); this.z = (position.z = _arg3); this.vertex3DInstance = new Vertex3DInstance(); this.normal = new Number3D(); this.connectedFaces = new Dictionary(); } public function clone():Vertex3D{ var _local1:Vertex3D; _local1 = new Vertex3D(x, y, z); _local1.extra = extra; _local1.vertex3DInstance = vertex3DInstance.clone(); _local1.normal = normal.clone(); return (_local1); } public function getPosition():Number3D{ position.x = x; position.y = y; position.z = z; return (position); } public function toNumber3D():Number3D{ return (new Number3D(x, y, z)); } public function calculateNormal():void{ var _local1:Triangle3D; var _local2:Number; var _local3:Number3D; _local2 = 0; normal.reset(); for each (_local1 in connectedFaces) { if (_local1.faceNormal){ _local2++; normal.plusEq(_local1.faceNormal); }; }; normal.x = (normal.x / _local2); normal.y = (normal.y / _local2); normal.z = (normal.z / _local2); _local3 = getPosition(); _local3.x = (_local3.x / _local2); _local3.y = (_local3.y / _local2); _local3.z = (_local3.z / _local2); _local3.normalize(); normal.plusEq(_local3); normal.normalize(); } override public function getRenderListItem():IRenderListItem{ return (null); } } }//package org.papervision3d.core.geom.renderablesSection 37//Vertex3DInstance (org.papervision3d.core.geom.renderables.Vertex3DInstance) package org.papervision3d.core.geom.renderables { import org.papervision3d.core.math.*; public class Vertex3DInstance { public var visible:Boolean; public var normal:Number3D; public var extra:Object; public var x:Number; public var y:Number; public var z:Number; public function Vertex3DInstance(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){ this.x = _arg1; this.y = _arg2; this.z = _arg3; this.visible = false; this.normal = new Number3D(); } public function clone():Vertex3DInstance{ var _local1:Vertex3DInstance; _local1 = new Vertex3DInstance(x, y, z); _local1.visible = visible; _local1.extra = extra; return (_local1); } public static function cross(_arg1:Vertex3DInstance, _arg2:Vertex3DInstance):Number{ return (((_arg1.x * _arg2.y) - (_arg2.x * _arg1.y))); } public static function dot(_arg1:Vertex3DInstance, _arg2:Vertex3DInstance):Number{ return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y))); } public static function subTo(_arg1:Vertex3DInstance, _arg2:Vertex3DInstance, _arg3:Vertex3DInstance):void{ _arg3.x = (_arg2.x - _arg1.x); _arg3.y = (_arg2.y - _arg1.y); } public static function sub(_arg1:Vertex3DInstance, _arg2:Vertex3DInstance):Vertex3DInstance{ return (new Vertex3DInstance((_arg2.x - _arg1.x), (_arg2.y - _arg1.y))); } } }//package org.papervision3d.core.geom.renderablesSection 38//Lines3D (org.papervision3d.core.geom.Lines3D) package org.papervision3d.core.geom { import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import org.papervision3d.objects.*; import org.papervision3d.materials.special.*; import org.papervision3d.core.render.draw.*; import org.papervision3d.*; public class Lines3D extends Vertices3D { public var lines:Array; private var _material:ILineDrawer; public function Lines3D(_arg1:LineMaterial, _arg2:String=null){ super(null, _arg2); this.material = _arg1; init(); } private function init():void{ this.lines = new Array(); } override public function project(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{ var _local3:Line3D; var _local4:Number; super.project(_arg1, _arg2); for each (_local3 in lines) { if (_arg2.viewPort.lineCuller.testLine(_local3)){ _local3.renderCommand.renderer = _local3.material; _local4 = (_local4 + (_local3.renderCommand.screenDepth = ((_local3.v0.vertex3DInstance.z + _local3.v1.vertex3DInstance.z) / 2))); _arg2.renderer.addToRenderList(_local3.renderCommand); }; }; return ((_local4 / (lines.length + 1))); } public function addLine(_arg1:Line3D):void{ lines.push(_arg1); _arg1.instance = this; if (geometry.vertices.indexOf(_arg1.v0) == -1){ geometry.vertices.push(_arg1.v0); }; if (geometry.vertices.indexOf(_arg1.v1) == -1){ geometry.vertices.push(_arg1.v1); }; if (_arg1.cV){ if (geometry.vertices.indexOf(_arg1.cV) == -1){ geometry.vertices.push(_arg1.cV); }; }; } public function addNewSegmentedLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):void{ var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Line3D; var _local13:Vertex3D; var _local14:Vertex3D; var _local15:Number; _local9 = ((_arg6 - _arg3) / _arg2); _local10 = ((_arg7 - _arg4) / _arg2); _local11 = ((_arg8 - _arg5) / _arg2); _local13 = new Vertex3D(_arg3, _arg4, _arg5); _local15 = 0; while (_local15 <= _arg2) { _local14 = new Vertex3D((_arg3 + (_local9 * _local15)), (_arg4 + (_local10 * _local15)), (_arg5 + (_local11 * _local15))); _local12 = new Line3D(this, (material as LineMaterial), _arg1, _local13, _local14); addLine(_local12); _local13 = _local14; _local15++; }; } public function removeAllLines():void{ trace("WARNING - Lines3D.removeAllLines not yet implemented"); } public function removeLine(_arg1:Line3D):void{ var _local2:int; _local2 = lines.indexOf(_arg1); if (_local2 > -1){ lines.splice(_local2, 1); } else { if (Papervision3D.VERBOSE){ trace("Papervision3D Lines3D.removeLine : WARNING removal of non-existant line attempted. "); }; }; } public function addNewLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Line3D{ var _local8:Line3D; _local8 = new Line3D(this, (material as LineMaterial), _arg1, new Vertex3D(_arg2, _arg3, _arg4), new Vertex3D(_arg5, _arg6, _arg7)); addLine(_local8); return (_local8); } } }//package org.papervision3d.core.geomSection 39//TriangleMesh3D (org.papervision3d.core.geom.TriangleMesh3D) package org.papervision3d.core.geom { import org.papervision3d.core.proto.*; import org.papervision3d.core.render.data.*; import org.papervision3d.core.render.command.*; import org.papervision3d.core.geom.renderables.*; import org.papervision3d.core.math.*; import org.papervision3d.objects.*; import org.papervision3d.core.culling.*; import flash.utils.*; import org.papervision3d.core.render.draw.*; public class TriangleMesh3D extends Vertices3D { public function TriangleMesh3D(_arg1:MaterialObject3D, _arg2:Array, _arg3:Array, _arg4:String=null){ super(_arg2, _arg4); this.geometry.faces = ((_arg3) || (new Array())); this.material = ((_arg1) || (MaterialObject3D.DEFAULT)); } override public function project(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{ var _local3:Array; var _local4:Number; var _local5:Number; var _local6:ITriangleCuller; var _local7:Vertex3DInstance; var _local8:Vertex3DInstance; var _local9:Vertex3DInstance; var _local10:Triangle3DInstance; var _local11:Triangle3D; var _local12:MaterialObject3D; var _local13:RenderTriangle; super.project(_arg1, _arg2); if (!this.culled){ _local3 = this.geometry.faces; _local4 = 0; _local5 = 0; _local6 = _arg2.triangleCuller; for each (_local11 in _local3) { _local12 = (_local11.material) ? _local11.material : material; _local10 = _local11.face3DInstance; _local7 = _local11.v0.vertex3DInstance; _local8 = _local11.v1.vertex3DInstance; _local9 = _local11.v2.vertex3DInstance; if ((_local10.visible = _local6.testFace(_local11, _local7, _local8, _local9))){ _local4 = (_local4 + (_local10.screenZ = (((_local7.z + _local8.z) + _local9.z) / 3))); _local13 = _local11.renderCommand; _local5++; _local13.renderer = (_local12 as ITriangleDrawer); _local13.screenDepth = _local10.screenZ; _arg2.renderer.addToRenderList(_local13); } else { _arg2.renderStatistics.culledTriangles++; }; }; return ((this.screenZ = (_local4 / _local5))); //unresolved jump }; _arg2.renderStatistics.culledObjects++; return (0); } public function mergeVertices():void{ var _local1:Dictionary; var _local2:Array; var _local3:Vertex3D; var _local4:Triangle3D; var _local5:Vertex3D; _local1 = new Dictionary(); _local2 = new Array(); for each (_local3 in this.geometry.vertices) { for each (_local5 in _local1) { if ((((((_local3.x == _local5.x)) && ((_local3.y == _local5.y)))) && ((_local3.z == _local5.z)))){ _local1[_local3] = _local5; break; }; }; if (!_local1[_local3]){ _local1[_local3] = _local3; _local2.push(_local3); }; }; this.geometry.vertices = _local2; for each (_local4 in geometry.faces) { _local4.v0 = _local1[_local4.v0]; _local4.v1 = _local1[_local4.v1]; _local4.v2 = _local1[_local4.v2]; }; } override public function clone():DisplayObject3D{ var _local1:DisplayObject3D; var _local2:TriangleMesh3D; _local1 = super.clone(); _local2 = new TriangleMesh3D(this.material, [], [], _local1.name); if (this.materials){ _local2.materials = this.materials.clone(); }; if (_local1.geometry){ _local2.geometry = _local1.geometry.clone(_local2); }; _local2.copyTransform(this.transform); return (_local2); } override public function set material(_arg1:MaterialObject3D):void{ var _local2:Triangle3D; super.material = _arg1; for each (_local2 in geometry.faces) { _local2.material = _arg1; }; } public function quarterFaces():void{ var _local1:Array; var _local2:Array; var _local3:Array; var _local4:Triangle3D; var _local5:int; var _local6:Vertex3D; var _local7:Vertex3D; var _local8:Vertex3D; var _local9:Vertex3D; var _local10:Vertex3D; var _local11:Vertex3D; var _local12:NumberUV; var _local13:NumberUV; var _local14:NumberUV; var _local15:NumberUV; var _local16:NumberUV; var _local17:NumberUV; var _local18:Triangle3D; var _local19:Triangle3D; var _local20:Triangle3D; var _local21:Triangle3D; _local1 = new Array(); _local2 = new Array(); _local3 = this.geometry.faces; _local5 = _local3.length; while ((_local4 = _local3[--_local5])) { _local6 = _local4.v0; _local7 = _local4.v1; _local8 = _local4.v2; _local9 = new Vertex3D(((_local6.x + _local7.x) / 2), ((_local6.y + _local7.y) / 2), ((_local6.z + _local7.z) / 2)); _local10 = new Vertex3D(((_local7.x + _local8.x) / 2), ((_local7.y + _local8.y) / 2), ((_local7.z + _local8.z) / 2)); _local11 = new Vertex3D(((_local8.x + _local6.x) / 2), ((_local8.y + _local6.y) / 2), ((_local8.z + _local6.z) / 2)); this.geometry.vertices.push(_local9, _local10, _local11); _local12 = _local4.uv[0]; _local13 = _local4.uv[1]; _local14 = _local4.uv[2]; _local15 = new NumberUV(((_local12.u + _local13.u) / 2), ((_local12.v + _local13.v) / 2)); _local16 = new NumberUV(((_local13.u + _local14.u) / 2), ((_local13.v + _local14.v) / 2)); _local17 = new NumberUV(((_local14.u + _local12.u) / 2), ((_local14.v + _local12.v) / 2)); _local18 = new Triangle3D(this, [_local6, _local9, _local11], _local4.material, [_local12, _local15, _local17]); _local19 = new Triangle3D(this, [_local9, _local7, _local10], _local4.material, [_local15, _local13, _local16]); _local20 = new Triangle3D(this, [_local11, _local10, _local8], _local4.material, [_local17, _local16, _local14]); _local21 = new Triangle3D(this, [_local9, _local10, _local11], _local4.material, [_local15, _local16, _local17]); _local2.push(_local18, _local19, _local20, _local21); }; this.geometry.faces = _local2; this.mergeVertices(); this.geometry.ready = true; } public function projectTexture(_arg1:String="x", _arg2:String="y"):void{ var _local3:Array; var _local4:Object; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:MaterialObject3D; var _local10:String; var _local11:Triangle3D; var _local12:Array; var _local13:Vertex3D; var _local14:Vertex3D; var _local15:Vertex3D; var _local16:NumberUV; var _local17:NumberUV; var _local18:NumberUV; _local3 = this.geometry.faces; _local4 = this.boundingBox(); _local5 = _local4.min[_arg1]; _local6 = _local4.size[_arg1]; _local7 = _local4.min[_arg2]; _local8 = _local4.size[_arg2]; _local9 = this.material; for (_local10 in _local3) { _local11 = _local3[Number(_local10)]; _local12 = _local11.vertices; _local13 = _local12[0]; _local14 = _local12[1]; _local15 = _local12[2]; _local16 = new NumberUV(((_local13[_arg1] - _local5) / _local6), ((_local13[_arg2] - _local7) / _local8)); _local17 = new NumberUV(((_local14[_arg1] - _local5) / _local6), ((_local14[_arg2] - _local7) / _local8)); _local18 = new NumberUV(((_local15[_arg1] - _local5) / _local6), ((_local15[_arg2] - _local7) / _local8)); _local11.uv = [_local16, _local17, _local18]; }; } } }//package org.papervision3d.core.geomSection 40//Vertices3D (org.papervision3d.core.geom.Vertices3D) package org.papervision3d.core.geom { import org.papervision3d.core.proto.*; import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import org.papervision3d.core.math.*; import org.papervision3d.objects.*; import org.papervision3d.core.culling.*; public class Vertices3D extends DisplayObject3D { public function Vertices3D(_arg1:Array, _arg2:String=null){ super(_arg2, new GeometryObject3D()); this.geometry.vertices = ((_arg1) || (new Array())); } public function projectFrustum(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{ return (0); } override public function project(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{ super.project(_arg1, _arg2); if (this.culled){ return (0); }; if ((_arg2.camera is IObjectCuller)){ return (projectFrustum(_arg1, _arg2)); }; return (_arg2.camera.projectVertices(this, _arg2)); } override public function clone():DisplayObject3D{ var _local1:DisplayObject3D; var _local2:Vertices3D; _local1 = super.clone(); _local2 = new Vertices3D(null, _local1.name); _local2.material = _local1.material; if (_local1.materials){ _local2.materials = _local1.materials.clone(); }; if (this.geometry){ _local2.geometry = this.geometry.clone(_local2); }; _local2.copyTransform(this.transform); return (_local2); } public function transformVertices(_arg1:Matrix3D):void{ geometry.transformVertices(_arg1); } public function boundingBox():Object{ var _local1:Array; var _local2:Object; var _local3:Vertex3D; _local1 = this.geometry.vertices; _local2 = new Object(); _local2.min = new Number3D(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); _local2.max = new Number3D(-(Number.MAX_VALUE), -(Number.MAX_VALUE), -(Number.MAX_VALUE)); _local2.size = new Number3D(); for each (_local3 in _local1) { _local2.min.x = Math.min(_local3.x, _local2.min.x); _local2.min.y = Math.min(_local3.y, _local2.min.y); _local2.min.z = Math.min(_local3.z, _local2.min.z); _local2.max.x = Math.max(_local3.x, _local2.max.x); _local2.max.y = Math.max(_local3.y, _local2.max.y); _local2.max.z = Math.max(_local3.z, _local2.max.z); }; _local2.size.x = (_local2.max.x - _local2.min.x); _local2.size.y = (_local2.max.y - _local2.min.y); _local2.size.z = (_local2.max.z - _local2.min.z); return (_local2); } } }//package org.papervision3d.core.geomSection 41//TriangleMaterial (org.papervision3d.core.material.TriangleMaterial) package org.papervision3d.core.material { import org.papervision3d.core.proto.*; import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import flash.display.*; import flash.geom.*; import org.papervision3d.core.render.draw.*; public class TriangleMaterial extends MaterialObject3D implements ITriangleDrawer { override public function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void{ } } }//package org.papervision3d.core.materialSection 42//FastRectangleTools (org.papervision3d.core.math.util.FastRectangleTools) package org.papervision3d.core.math.util { import flash.geom.*; public class FastRectangleTools { public static function intersection(_arg1:Rectangle, _arg2:Rectangle, _arg3:Rectangle=null):Rectangle{ if (!_arg3){ _arg3 = new Rectangle(); }; if (!intersects(_arg1, _arg2)){ _arg3.x = (_arg3.y = (_arg3.width = (_arg3.height = 0))); return (_arg3); }; _arg3.left = ((_arg1.left)>_arg2.left) ? _arg1.left : _arg2.left; _arg3.right = ((_arg1.right)<_arg2.right) ? _arg1.right : _arg2.right; _arg3.top = ((_arg1.top)>_arg2.top) ? _arg1.top : _arg2.top; _arg3.bottom = ((_arg1.bottom)<_arg2.bottom) ? _arg1.bottom : _arg2.bottom; return (_arg3); } public static function intersects(_arg1:Rectangle, _arg2:Rectangle):Boolean{ if (!(((_arg1.right < _arg2.left)) || ((_arg1.left > _arg2.right)))){ if (!(((_arg1.bottom < _arg2.top)) || ((_arg1.top > _arg2.bottom)))){ return (true); }; }; return (false); } } }//package org.papervision3d.core.math.utilSection 43//AxisAlignedBoundingBox (org.papervision3d.core.math.AxisAlignedBoundingBox) package org.papervision3d.core.math { import org.papervision3d.core.geom.renderables.*; public class AxisAlignedBoundingBox { public var minX:Number; public var minY:Number; public var minZ:Number; public var maxX:Number; public var maxY:Number; protected var _vertices:Array; public var maxZ:Number; public function AxisAlignedBoundingBox(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){ this.minX = _arg1; this.minY = _arg2; this.minZ = _arg3; this.maxX = _arg4; this.maxY = _arg5; this.maxZ = _arg6; createBoxVertices(); } protected function createBoxVertices():void{ _vertices = new Array(); _vertices.push(new Vertex3D(minX, minY, minZ)); _vertices.push(new Vertex3D(minX, minY, maxZ)); _vertices.push(new Vertex3D(minX, maxY, minZ)); _vertices.push(new Vertex3D(minX, maxY, maxZ)); _vertices.push(new Vertex3D(maxX, minY, minZ)); _vertices.push(new Vertex3D(maxX, minY, maxZ)); _vertices.push(new Vertex3D(maxX, maxY, minZ)); _vertices.push(new Vertex3D(maxX, maxY, maxZ)); } public function getBoxVertices():Array{ return (_vertices); } public function merge(_arg1:AxisAlignedBoundingBox):void{ this.minX = Math.min(this.minX, _arg1.minX); this.minY = Math.min(this.minY, _arg1.minY); this.minZ = Math.min(this.minZ, _arg1.minZ); this.maxX = Math.max(this.maxX, _arg1.maxX); this.maxY = Math.max(this.maxY, _arg1.maxY); this.maxZ = Math.max(this.maxZ, _arg1.maxZ); createBoxVertices(); } public static function createFromVertices(_arg1:Array):AxisAlignedBoundingBox{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Vertex3D; _local2 = Number.MAX_VALUE; _local3 = Number.MAX_VALUE; _local4 = Number.MAX_VALUE; _local5 = -(_local2); _local6 = -(_local3); _local7 = -(_local4); for each (_local8 in _arg1) { _local2 = Math.min(_local2, _local8.x); _local3 = Math.min(_local3, _local8.y); _local4 = Math.min(_local4, _local8.z); _local5 = Math.max(_local5, _local8.x); _local6 = Math.max(_local6, _local8.y); _local7 = Math.max(_local7, _local8.z); }; return (new AxisAlignedBoundingBox(_local2, _local3, _local4, _local5, _local6, _local7)); } } }//package org.papervision3d.core.mathSection 44//BoundingSphere (org.papervision3d.core.math.BoundingSphere) package org.papervision3d.core.math { import org.papervision3d.core.geom.renderables.*; public class BoundingSphere { public var maxDistance:Number; public var radius:Number; public function BoundingSphere(_arg1:Number){ this.maxDistance = _arg1; this.radius = Math.sqrt(_arg1); } public static function getFromVertices(_arg1:Array):BoundingSphere{ var _local2:Number; var _local3:Number; var _local4:Vertex3D; _local2 = 0; for each (_local4 in _arg1) { _local3 = (((_local4.x * _local4.x) + (_local4.y * _local4.y)) + (_local4.z * _local4.z)); _local2 = ((_local3)>_local2) ? _local3 : _local2; }; return (new BoundingSphere(_local2)); } } }//package org.papervision3d.core.mathSection 45//Matrix3D (org.papervision3d.core.math.Matrix3D) package org.papervision3d.core.math { import org.papervision3d.*; public class Matrix3D { public var n31:Number; public var n32:Number; public var n11:Number; public var n13:Number; public var n14:Number; public var n33:Number; public var n12:Number; public var n42:Number; public var n21:Number; public var n22:Number; public var n23:Number; public var n24:Number; public var n34:Number; public var n41:Number; public var n43:Number; public var n44:Number; private static var _cos:Function = Math.cos; private static var _sin:Function = Math.sin; private static var temp:Matrix3D = Matrix3D.IDENTITY; private static var n3Di:Number3D = Number3D.ZERO; private static var n3Dj:Number3D = Number3D.ZERO; private static var n3Dk:Number3D = Number3D.ZERO; private static var toDEGREES:Number = 57.2957795130823; private static var toRADIANS:Number = 0.0174532925199433; public function Matrix3D(_arg1:Array=null){ reset(_arg1); } public function calculateMultiply3x3(_arg1:Matrix3D, _arg2:Matrix3D):void{ var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; _local3 = _arg1.n11; _local4 = _arg2.n11; _local5 = _arg1.n21; _local6 = _arg2.n21; _local7 = _arg1.n31; _local8 = _arg2.n31; _local9 = _arg1.n12; _local10 = _arg2.n12; _local11 = _arg1.n22; _local12 = _arg2.n22; _local13 = _arg1.n32; _local14 = _arg2.n32; _local15 = _arg1.n13; _local16 = _arg2.n13; _local17 = _arg1.n23; _local18 = _arg2.n23; _local19 = _arg1.n33; _local20 = _arg2.n33; this.n11 = (((_local3 * _local4) + (_local9 * _local6)) + (_local15 * _local8)); this.n12 = (((_local3 * _local10) + (_local9 * _local12)) + (_local15 * _local14)); this.n13 = (((_local3 * _local16) + (_local9 * _local18)) + (_local15 * _local20)); this.n21 = (((_local5 * _local4) + (_local11 * _local6)) + (_local17 * _local8)); this.n22 = (((_local5 * _local10) + (_local11 * _local12)) + (_local17 * _local14)); this.n23 = (((_local5 * _local16) + (_local11 * _local18)) + (_local17 * _local20)); this.n31 = (((_local7 * _local4) + (_local13 * _local6)) + (_local19 * _local8)); this.n32 = (((_local7 * _local10) + (_local13 * _local12)) + (_local19 * _local14)); this.n33 = (((_local7 * _local16) + (_local13 * _local18)) + (_local19 * _local20)); } public function calculateMultiply4x4(_arg1:Matrix3D, _arg2:Matrix3D):void{ var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local23:Number; var _local24:Number; var _local25:Number; var _local26:Number; var _local27:Number; var _local28:Number; var _local29:Number; var _local30:Number; var _local31:Number; var _local32:Number; var _local33:Number; var _local34:Number; _local3 = _arg1.n11; _local4 = _arg2.n11; _local5 = _arg1.n21; _local6 = _arg2.n21; _local7 = _arg1.n31; _local8 = _arg2.n31; _local9 = _arg1.n41; _local10 = _arg2.n41; _local11 = _arg1.n12; _local12 = _arg2.n12; _local13 = _arg1.n22; _local14 = _arg2.n22; _local15 = _arg1.n32; _local16 = _arg2.n32; _local17 = _arg1.n42; _local18 = _arg2.n42; _local19 = _arg1.n13; _local20 = _arg2.n13; _local21 = _arg1.n23; _local22 = _arg2.n23; _local23 = _arg1.n33; _local24 = _arg2.n33; _local25 = _arg1.n43; _local26 = _arg2.n43; _local27 = _arg1.n14; _local28 = _arg2.n14; _local29 = _arg1.n24; _local30 = _arg2.n24; _local31 = _arg1.n34; _local32 = _arg2.n34; _local33 = _arg1.n44; _local34 = _arg2.n44; this.n11 = (((_local3 * _local4) + (_local11 * _local6)) + (_local19 * _local8)); this.n12 = (((_local3 * _local12) + (_local11 * _local14)) + (_local19 * _local16)); this.n13 = (((_local3 * _local20) + (_local11 * _local22)) + (_local19 * _local24)); this.n14 = ((((_local3 * _local28) + (_local11 * _local30)) + (_local19 * _local32)) + _local27); this.n21 = (((_local5 * _local4) + (_local13 * _local6)) + (_local21 * _local8)); this.n22 = (((_local5 * _local12) + (_local13 * _local14)) + (_local21 * _local16)); this.n23 = (((_local5 * _local20) + (_local13 * _local22)) + (_local21 * _local24)); this.n24 = ((((_local5 * _local28) + (_local13 * _local30)) + (_local21 * _local32)) + _local29); this.n31 = (((_local7 * _local4) + (_local15 * _local6)) + (_local23 * _local8)); this.n32 = (((_local7 * _local12) + (_local15 * _local14)) + (_local23 * _local16)); this.n33 = (((_local7 * _local20) + (_local15 * _local22)) + (_local23 * _local24)); this.n34 = ((((_local7 * _local28) + (_local15 * _local30)) + (_local23 * _local32)) + _local31); this.n41 = (((_local9 * _local4) + (_local17 * _local6)) + (_local25 * _local8)); this.n42 = (((_local9 * _local12) + (_local17 * _local14)) + (_local25 * _local16)); this.n43 = (((_local9 * _local20) + (_local17 * _local22)) + (_local25 * _local24)); this.n44 = ((((_local9 * _local28) + (_local17 * _local30)) + (_local25 * _local32)) + _local33); } public function get det():Number{ return ((((((this.n11 * this.n22) - (this.n21 * this.n12)) * this.n33) - (((this.n11 * this.n32) - (this.n31 * this.n12)) * this.n23)) + (((this.n21 * this.n32) - (this.n31 * this.n22)) * this.n13))); } public function copy(_arg1:Matrix3D):Matrix3D{ this.n11 = _arg1.n11; this.n12 = _arg1.n12; this.n13 = _arg1.n13; this.n14 = _arg1.n14; this.n21 = _arg1.n21; this.n22 = _arg1.n22; this.n23 = _arg1.n23; this.n24 = _arg1.n24; this.n31 = _arg1.n31; this.n32 = _arg1.n32; this.n33 = _arg1.n33; this.n34 = _arg1.n34; return (this); } public function copy3x3(_arg1:Matrix3D):Matrix3D{ this.n11 = _arg1.n11; this.n12 = _arg1.n12; this.n13 = _arg1.n13; this.n21 = _arg1.n21; this.n22 = _arg1.n22; this.n23 = _arg1.n23; this.n31 = _arg1.n31; this.n32 = _arg1.n32; this.n33 = _arg1.n33; return (this); } public function calculateAdd(_arg1:Matrix3D, _arg2:Matrix3D):void{ this.n11 = (_arg1.n11 + _arg2.n11); this.n12 = (_arg1.n12 + _arg2.n12); this.n13 = (_arg1.n13 + _arg2.n13); this.n14 = (_arg1.n14 + _arg2.n14); this.n21 = (_arg1.n21 + _arg2.n21); this.n22 = (_arg1.n22 + _arg2.n22); this.n23 = (_arg1.n23 + _arg2.n23); this.n24 = (_arg1.n24 + _arg2.n24); this.n31 = (_arg1.n31 + _arg2.n31); this.n32 = (_arg1.n32 + _arg2.n32); this.n33 = (_arg1.n33 + _arg2.n33); this.n34 = (_arg1.n34 + _arg2.n34); } public function calculateMultiply(_arg1:Matrix3D, _arg2:Matrix3D):void{ var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local23:Number; var _local24:Number; var _local25:Number; var _local26:Number; _local3 = _arg1.n11; _local4 = _arg2.n11; _local5 = _arg1.n21; _local6 = _arg2.n21; _local7 = _arg1.n31; _local8 = _arg2.n31; _local9 = _arg1.n12; _local10 = _arg2.n12; _local11 = _arg1.n22; _local12 = _arg2.n22; _local13 = _arg1.n32; _local14 = _arg2.n32; _local15 = _arg1.n13; _local16 = _arg2.n13; _local17 = _arg1.n23; _local18 = _arg2.n23; _local19 = _arg1.n33; _local20 = _arg2.n33; _local21 = _arg1.n14; _local22 = _arg2.n14; _local23 = _arg1.n24; _local24 = _arg2.n24; _local25 = _arg1.n34; _local26 = _arg2.n34; this.n11 = (((_local3 * _local4) + (_local9 * _local6)) + (_local15 * _local8)); this.n12 = (((_local3 * _local10) + (_local9 * _local12)) + (_local15 * _local14)); this.n13 = (((_local3 * _local16) + (_local9 * _local18)) + (_local15 * _local20)); this.n14 = ((((_local3 * _local22) + (_local9 * _local24)) + (_local15 * _local26)) + _local21); this.n21 = (((_local5 * _local4) + (_local11 * _local6)) + (_local17 * _local8)); this.n22 = (((_local5 * _local10) + (_local11 * _local12)) + (_local17 * _local14)); this.n23 = (((_local5 * _local16) + (_local11 * _local18)) + (_local17 * _local20)); this.n24 = ((((_local5 * _local22) + (_local11 * _local24)) + (_local17 * _local26)) + _local23); this.n31 = (((_local7 * _local4) + (_local13 * _local6)) + (_local19 * _local8)); this.n32 = (((_local7 * _local10) + (_local13 * _local12)) + (_local19 * _local14)); this.n33 = (((_local7 * _local16) + (_local13 * _local18)) + (_local19 * _local20)); this.n34 = ((((_local7 * _local22) + (_local13 * _local24)) + (_local19 * _local26)) + _local25); } public function invert():void{ temp.copy(this); calculateInverse(temp); } public function calculateInverse(_arg1:Matrix3D):void{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; _local2 = _arg1.det; if (Math.abs(_local2) > 0.001){ _local2 = (1 / _local2); _local3 = _arg1.n11; _local4 = _arg1.n21; _local5 = _arg1.n31; _local6 = _arg1.n12; _local7 = _arg1.n22; _local8 = _arg1.n32; _local9 = _arg1.n13; _local10 = _arg1.n23; _local11 = _arg1.n33; _local12 = _arg1.n14; _local13 = _arg1.n24; _local14 = _arg1.n34; this.n11 = (_local2 * ((_local7 * _local11) - (_local8 * _local10))); this.n12 = (-(_local2) * ((_local6 * _local11) - (_local8 * _local9))); this.n13 = (_local2 * ((_local6 * _local10) - (_local7 * _local9))); this.n14 = (-(_local2) * (((_local6 * ((_local10 * _local14) - (_local11 * _local13))) - (_local7 * ((_local9 * _local14) - (_local11 * _local12)))) + (_local8 * ((_local9 * _local13) - (_local10 * _local12))))); this.n21 = (-(_local2) * ((_local4 * _local11) - (_local5 * _local10))); this.n22 = (_local2 * ((_local3 * _local11) - (_local5 * _local9))); this.n23 = (-(_local2) * ((_local3 * _local10) - (_local4 * _local9))); this.n24 = (_local2 * (((_local3 * ((_local10 * _local14) - (_local11 * _local13))) - (_local4 * ((_local9 * _local14) - (_local11 * _local12)))) + (_local5 * ((_local9 * _local13) - (_local10 * _local12))))); this.n31 = (_local2 * ((_local4 * _local8) - (_local5 * _local7))); this.n32 = (-(_local2) * ((_local3 * _local8) - (_local5 * _local6))); this.n33 = (_local2 * ((_local3 * _local7) - (_local4 * _local6))); this.n34 = (-(_local2) * (((_local3 * ((_local7 * _local14) - (_local8 * _local13))) - (_local4 * ((_local6 * _local14) - (_local8 * _local12)))) + (_local5 * ((_local6 * _local13) - (_local7 * _local12))))); }; } public function calculateTranspose():void{ 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; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; _local1 = this.n11; _local2 = this.n21; _local3 = this.n31; _local4 = this.n41; _local5 = this.n12; _local6 = this.n22; _local7 = this.n32; _local8 = this.n42; _local9 = this.n13; _local10 = this.n23; _local11 = this.n33; _local12 = this.n43; _local13 = this.n14; _local14 = this.n24; _local15 = this.n34; _local16 = this.n44; this.n11 = _local1; this.n12 = _local2; this.n13 = _local3; this.n14 = _local4; this.n21 = _local5; this.n22 = _local6; this.n23 = _local7; this.n24 = _local8; this.n31 = _local9; this.n32 = _local10; this.n33 = _local11; this.n34 = _local12; this.n41 = _local13; this.n42 = _local14; this.n43 = _local15; this.n44 = _local16; } public function toString():String{ var _local1:String; _local1 = ""; _local1 = (_local1 + ((((((((int((n11 * 1000)) / 1000) + "\t\t") + (int((n12 * 1000)) / 1000)) + "\t\t") + (int((n13 * 1000)) / 1000)) + "\t\t") + (int((n14 * 1000)) / 1000)) + "\n")); _local1 = (_local1 + ((((((((int((n21 * 1000)) / 1000) + "\t\t") + (int((n22 * 1000)) / 1000)) + "\t\t") + (int((n23 * 1000)) / 1000)) + "\t\t") + (int((n24 * 1000)) / 1000)) + "\n")); _local1 = (_local1 + ((((((((int((n31 * 1000)) / 1000) + "\t\t") + (int((n32 * 1000)) / 1000)) + "\t\t") + (int((n33 * 1000)) / 1000)) + "\t\t") + (int((n34 * 1000)) / 1000)) + "\n")); _local1 = (_local1 + ((((((((int((n41 * 1000)) / 1000) + "\t\t") + (int((n42 * 1000)) / 1000)) + "\t\t") + (int((n43 * 1000)) / 1000)) + "\t\t") + (int((n44 * 1000)) / 1000)) + "\n")); return (_local1); } public function reset(_arg1:Array=null):void{ if (((!(_arg1)) || ((_arg1.length < 12)))){ n11 = (n22 = (n33 = (n44 = 1))); n12 = (n13 = (n14 = (n21 = (n23 = (n24 = (n31 = (n32 = (n34 = (n41 = (n42 = (n43 = 0))))))))))); } else { n11 = _arg1[0]; n12 = _arg1[1]; n13 = _arg1[2]; n14 = _arg1[3]; n21 = _arg1[4]; n22 = _arg1[5]; n23 = _arg1[6]; n24 = _arg1[7]; n31 = _arg1[8]; n32 = _arg1[9]; n33 = _arg1[10]; n34 = _arg1[11]; if (_arg1.length == 16){ n41 = _arg1[12]; n42 = _arg1[13]; n43 = _arg1[14]; n44 = _arg1[15]; } else { n41 = (n42 = (n43 = 0)); n44 = 1; }; }; } public static function rotationMatrixWithReference(_arg1:Number3D, _arg2:Number, _arg3:Number3D):Matrix3D{ var _local4:Matrix3D; _local4 = Matrix3D.translationMatrix(_arg3.x, -(_arg3.y), _arg3.z); Matrix3D.translationMatrix(_arg3.x, -(_arg3.y), _arg3.z).calculateMultiply(_local4, Matrix3D.rotationMatrix(_arg1.x, _arg1.y, _arg1.z, _arg2)); _local4.calculateMultiply(_local4, Matrix3D.translationMatrix(-(_arg3.x), _arg3.y, -(_arg3.z))); return (_local4); } public static function multiplyVector(_arg1:Matrix3D, _arg2:Number3D):void{ var _local3:Number; var _local4:Number; var _local5:Number; _local3 = _arg2.x; _local4 = _arg2.y; _local5 = _arg2.z; _arg2.x = ((((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13)) + _arg1.n14); _arg2.y = ((((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23)) + _arg1.n24); _arg2.z = ((((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33)) + _arg1.n34); } public static function multiplyVector4x4(_arg1:Matrix3D, _arg2:Number3D):void{ var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; _local3 = _arg2.x; _local4 = _arg2.y; _local5 = _arg2.z; _local6 = (1 / ((((_local3 * _arg1.n41) + (_local4 * _arg1.n42)) + (_local5 * _arg1.n43)) + _arg1.n44)); _arg2.x = ((((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13)) + _arg1.n14); _arg2.y = ((((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23)) + _arg1.n24); _arg2.z = ((((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33)) + _arg1.n34); _arg2.x = (_arg2.x * _local6); _arg2.y = (_arg2.y * _local6); _arg2.z = (_arg2.z * _local6); } public static function multiply3x3(_arg1:Matrix3D, _arg2:Matrix3D):Matrix3D{ var _local3:Matrix3D; _local3 = new (Matrix3D); _local3.calculateMultiply3x3(_arg1, _arg2); return (_local3); } public static function normalizeQuaternion(_arg1:Object):Object{ var _local2:Number; _local2 = magnitudeQuaternion(_arg1); _arg1.x = (_arg1.x / _local2); _arg1.y = (_arg1.y / _local2); _arg1.z = (_arg1.z / _local2); _arg1.w = (_arg1.w / _local2); return (_arg1); } public static function multiplyVector3x3(_arg1:Matrix3D, _arg2:Number3D):void{ var _local3:Number; var _local4:Number; var _local5:Number; _local3 = _arg2.x; _local4 = _arg2.y; _local5 = _arg2.z; _arg2.x = (((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13)); _arg2.y = (((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23)); _arg2.z = (((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33)); } public static function axis2quaternion(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Object{ var _local5:Number; var _local6:Number; var _local7:Object; _local5 = Math.sin((_arg4 / 2)); _local6 = Math.cos((_arg4 / 2)); _local7 = new Object(); _local7.x = (_arg1 * _local5); _local7.y = (_arg2 * _local5); _local7.z = (_arg3 * _local5); _local7.w = _local6; return (normalizeQuaternion(_local7)); } public static function translationMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{ var _local4:Matrix3D; _local4 = IDENTITY; _local4.n14 = _arg1; _local4.n24 = _arg2; _local4.n34 = _arg3; return (_local4); } public static function magnitudeQuaternion(_arg1:Object):Number{ return (Math.sqrt(((((_arg1.w * _arg1.w) + (_arg1.x * _arg1.x)) + (_arg1.y * _arg1.y)) + (_arg1.z * _arg1.z)))); } public static function rotationX(_arg1:Number):Matrix3D{ var _local2:Matrix3D; var _local3:Number; var _local4:Number; _local2 = IDENTITY; _local3 = Math.cos(_arg1); _local4 = Math.sin(_arg1); _local2.n22 = _local3; _local2.n23 = -(_local4); _local2.n32 = _local4; _local2.n33 = _local3; return (_local2); } public static function rotationY(_arg1:Number):Matrix3D{ var _local2:Matrix3D; var _local3:Number; var _local4:Number; _local2 = IDENTITY; _local3 = Math.cos(_arg1); _local4 = Math.sin(_arg1); _local2.n11 = _local3; _local2.n13 = -(_local4); _local2.n31 = _local4; _local2.n33 = _local3; return (_local2); } public static function rotationZ(_arg1:Number):Matrix3D{ var _local2:Matrix3D; var _local3:Number; var _local4:Number; _local2 = IDENTITY; _local3 = Math.cos(_arg1); _local4 = Math.sin(_arg1); _local2.n11 = _local3; _local2.n12 = -(_local4); _local2.n21 = _local4; _local2.n22 = _local3; return (_local2); } public static function clone(_arg1:Matrix3D):Matrix3D{ return (new Matrix3D([_arg1.n11, _arg1.n12, _arg1.n13, _arg1.n14, _arg1.n21, _arg1.n22, _arg1.n23, _arg1.n24, _arg1.n31, _arg1.n32, _arg1.n33, _arg1.n34])); } public static function rotationMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Matrix3D=null):Matrix3D{ var _local6:Matrix3D; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; if (!_arg5){ _local6 = IDENTITY; } else { _local6 = _arg5; }; _local7 = Math.cos(_arg4); _local8 = Math.sin(_arg4); _local9 = (1 - _local7); _local10 = ((_arg1 * _arg2) * _local9); _local11 = ((_arg2 * _arg3) * _local9); _local12 = ((_arg1 * _arg3) * _local9); _local13 = (_local8 * _arg3); _local14 = (_local8 * _arg2); _local15 = (_local8 * _arg1); _local6.n11 = (_local7 + ((_arg1 * _arg1) * _local9)); _local6.n12 = (-(_local13) + _local10); _local6.n13 = (_local14 + _local12); _local6.n14 = 0; _local6.n21 = (_local13 + _local10); _local6.n22 = (_local7 + ((_arg2 * _arg2) * _local9)); _local6.n23 = (-(_local15) + _local11); _local6.n24 = 0; _local6.n31 = (-(_local14) + _local12); _local6.n32 = (_local15 + _local11); _local6.n33 = (_local7 + ((_arg3 * _arg3) * _local9)); _local6.n34 = 0; return (_local6); } public static function add(_arg1:Matrix3D, _arg2:Matrix3D):Matrix3D{ var _local3:Matrix3D; _local3 = new (Matrix3D); _local3.calculateAdd(_arg1, _arg2); return (_local3); } public static function multiply(_arg1:Matrix3D, _arg2:Matrix3D):Matrix3D{ var _local3:Matrix3D; _local3 = new (Matrix3D); _local3.calculateMultiply(_arg1, _arg2); return (_local3); } public static function euler2quaternion(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Quaternion=null):Quaternion{ var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Quaternion; _local5 = Math.sin((_arg1 * 0.5)); _local6 = Math.cos((_arg1 * 0.5)); _local7 = Math.sin((_arg2 * 0.5)); _local8 = Math.cos((_arg2 * 0.5)); _local9 = Math.sin((_arg3 * 0.5)); _local10 = Math.cos((_arg3 * 0.5)); _local11 = (_local6 * _local8); _local12 = (_local5 * _local7); if (!_arg4){ _local13 = new Quaternion(); } else { _local13 = _arg4; }; _local13.x = ((_local9 * _local11) - (_local10 * _local12)); _local13.y = (((_local10 * _local5) * _local8) + ((_local9 * _local6) * _local7)); _local13.z = (((_local10 * _local6) * _local7) - ((_local9 * _local5) * _local8)); _local13.w = ((_local10 * _local11) + (_local9 * _local12)); return (_local13); } public static function quaternion2matrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Matrix3D=null):Matrix3D{ var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Matrix3D; _local6 = (_arg1 * _arg1); _local7 = (_arg1 * _arg2); _local8 = (_arg1 * _arg3); _local9 = (_arg1 * _arg4); _local10 = (_arg2 * _arg2); _local11 = (_arg2 * _arg3); _local12 = (_arg2 * _arg4); _local13 = (_arg3 * _arg3); _local14 = (_arg3 * _arg4); if (!_arg5){ _local15 = IDENTITY; } else { _local15 = _arg5; }; _local15.n11 = (1 - (2 * (_local10 + _local13))); _local15.n12 = (2 * (_local7 - _local14)); _local15.n13 = (2 * (_local8 + _local12)); _local15.n21 = (2 * (_local7 + _local14)); _local15.n22 = (1 - (2 * (_local6 + _local13))); _local15.n23 = (2 * (_local11 - _local9)); _local15.n31 = (2 * (_local8 - _local12)); _local15.n32 = (2 * (_local11 + _local9)); _local15.n33 = (1 - (2 * (_local6 + _local10))); return (_local15); } public static function inverse(_arg1:Matrix3D):Matrix3D{ var _local2:Matrix3D; _local2 = new (Matrix3D); _local2.calculateInverse(_arg1); return (_local2); } public static function euler2matrix(_arg1:Number3D):Matrix3D{ var _local2:Matrix3D; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; temp.reset(); _local2 = temp; _local2 = temp; _local3 = (_arg1.x * toRADIANS); _local4 = (_arg1.y * toRADIANS); _local5 = (_arg1.z * toRADIANS); _local6 = Math.cos(_local3); _local7 = Math.sin(_local3); _local8 = Math.cos(_local4); _local9 = Math.sin(_local4); _local10 = Math.cos(_local5); _local11 = Math.sin(_local5); _local12 = (_local6 * _local9); _local13 = (_local7 * _local9); _local2.n11 = (_local8 * _local10); _local2.n12 = (-(_local8) * _local11); _local2.n13 = _local9; _local2.n21 = ((_local13 * _local10) + (_local6 * _local11)); _local2.n22 = ((-(_local13) * _local11) + (_local6 * _local10)); _local2.n23 = (-(_local7) * _local8); _local2.n31 = ((-(_local12) * _local10) + (_local7 * _local11)); _local2.n32 = ((_local12 * _local11) + (_local7 * _local10)); _local2.n33 = (_local6 * _local8); return (_local2); } public static function scaleMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{ var _local4:Matrix3D; _local4 = IDENTITY; _local4.n11 = _arg1; _local4.n22 = _arg2; _local4.n33 = _arg3; return (_local4); } public static function rotateAxis(_arg1:Matrix3D, _arg2:Number3D):void{ var _local3:Number; var _local4:Number; var _local5:Number; _local3 = _arg2.x; _local4 = _arg2.y; _local5 = _arg2.z; _arg2.x = (((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13)); _arg2.y = (((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23)); _arg2.z = (((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33)); _arg2.normalize(); } public static function matrix2euler(_arg1:Matrix3D, _arg2:Number3D=null, _arg3:Number3D=null):Number3D{ var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; _arg2 = ((_arg2) || (new Number3D())); _local4 = (((_arg3) && ((_arg3.x == 1)))) ? 1 : Math.sqrt((((_arg1.n11 * _arg1.n11) + (_arg1.n21 * _arg1.n21)) + (_arg1.n31 * _arg1.n31))); _local5 = (((_arg3) && ((_arg3.y == 1)))) ? 1 : Math.sqrt((((_arg1.n12 * _arg1.n12) + (_arg1.n22 * _arg1.n22)) + (_arg1.n32 * _arg1.n32))); _local6 = (((_arg3) && ((_arg3.z == 1)))) ? 1 : Math.sqrt((((_arg1.n13 * _arg1.n13) + (_arg1.n23 * _arg1.n23)) + (_arg1.n33 * _arg1.n33))); _local7 = (_arg1.n11 / _local4); _local8 = (_arg1.n21 / _local5); _local9 = (_arg1.n31 / _local6); _local10 = (_arg1.n32 / _local6); _local11 = (_arg1.n33 / _local6); _local9 = ((_local9 > 1)) ? 1 : _local9; _local9 = ((_local9 < -1)) ? -1 : _local9; _arg2.y = Math.asin(-(_local9)); _arg2.z = Math.atan2(_local8, _local7); _arg2.x = Math.atan2(_local10, _local11); if (Papervision3D.useDEGREES){ _arg2.x = (_arg2.x * toDEGREES); _arg2.y = (_arg2.y * toDEGREES); _arg2.z = (_arg2.z * toDEGREES); }; return (_arg2); } public static function multiplyQuaternion(_arg1:Object, _arg2:Object):Object{ var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Object; _local3 = _arg1.x; _local4 = _arg1.y; _local5 = _arg1.z; _local6 = _arg1.w; _local7 = _arg2.x; _local8 = _arg2.y; _local9 = _arg2.z; _local10 = _arg2.w; _local11 = new Object(); _local11.x = ((((_local6 * _local7) + (_local3 * _local10)) + (_local4 * _local9)) - (_local5 * _local8)); _local11.y = ((((_local6 * _local8) + (_local4 * _local10)) + (_local5 * _local7)) - (_local3 * _local9)); _local11.z = ((((_local6 * _local9) + (_local5 * _local10)) + (_local3 * _local8)) - (_local4 * _local7)); _local11.w = ((((_local6 * _local10) - (_local3 * _local7)) - (_local4 * _local8)) - (_local5 * _local9)); return (_local11); } public static function get IDENTITY():Matrix3D{ return (new Matrix3D([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])); } } }//package org.papervision3d.core.mathSection 46//Number2D (org.papervision3d.core.math.Number2D) package org.papervision3d.core.math { import org.papervision3d.*; public class Number2D { public var x:Number; public var y:Number; public static const DEGTORAD:Number = 0.0174532925199433; public static const RADTODEG:Number = 57.2957795130823; public function Number2D(_arg1:Number=0, _arg2:Number=0){ this.x = _arg1; this.y = _arg2; } public function divideEq(_arg1:Number):void{ x = (x / _arg1); y = (y / _arg1); } public function copyTo(_arg1:Number2D):void{ _arg1.x = this.x; _arg1.y = this.y; } public function get moduloSquared():Number{ return (((this.x * this.x) + (this.y * this.y))); } public function angle():Number{ if (Papervision3D.useDEGREES){ return ((RADTODEG * Math.atan2(y, x))); }; return (Math.atan2(y, x)); } public function reset(_arg1:Number=0, _arg2:Number=0):void{ this.x = _arg1; this.y = _arg2; } public function isModuloGreaterThan(_arg1:Number):Boolean{ return ((moduloSquared > (_arg1 * _arg1))); } public function clone():Number2D{ return (new Number2D(this.x, this.y)); } public function reverse():void{ this.x = -(this.x); this.y = -(this.y); } public function plusEq(_arg1:Number2D):void{ x = (x + _arg1.x); y = (y + _arg1.y); } public function rotate(_arg1:Number):void{ var _local2:Number; var _local3:Number; var _local4:Number2D; if (Papervision3D.useDEGREES){ _arg1 = (_arg1 * DEGTORAD); }; _local2 = Math.cos(_arg1); _local3 = Math.sin(_arg1); _local4 = clone(); this.x = ((_local4.x * _local2) - (_local4.y * _local3)); this.y = ((_local4.x * _local3) + (_local4.y * _local2)); } public function toString():String{ var _local1:Number; var _local2:Number; _local1 = (Math.round((this.x * 1000)) / 1000); _local2 = (Math.round((this.y * 1000)) / 1000); return ((((("[" + _local1) + ", ") + _local2) + "]")); } public function isModuloEqualTo(_arg1:Number):Boolean{ return ((moduloSquared == (_arg1 * _arg1))); } public function multiplyEq(_arg1:Number):void{ x = (x * _arg1); y = (y * _arg1); } public function normalise():void{ var _local1:Number; _local1 = this.modulo; this.x = (this.x / _local1); this.y = (this.y / _local1); } public function get modulo():Number{ return (Math.sqrt(((x * x) + (y * y)))); } public function isModuloLessThan(_arg1:Number):Boolean{ return ((moduloSquared < (_arg1 * _arg1))); } public function minusEq(_arg1:Number2D):void{ x = (x - _arg1.x); y = (y - _arg1.y); } public function copyFrom(_arg1:Number2D):void{ this.x = _arg1.x; this.y = _arg1.y; } public static function multiplyScalar(_arg1:Number2D, _arg2:Number):Number2D{ return (new Number2D((_arg1.x * _arg2), (_arg1.y * _arg2))); } public static function add(_arg1:Number2D, _arg2:Number2D):Number2D{ return (new Number2D((_arg1.x = (_arg1.x + _arg2.x)), (_arg1.y + _arg2.y))); } public static function dot(_arg1:Number2D, _arg2:Number2D):Number{ return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y))); } public static function subtract(_arg1:Number2D, _arg2:Number2D):Number2D{ return (new Number2D((_arg1.x - _arg2.x), (_arg1.y - _arg2.y))); } } }//package org.papervision3d.core.mathSection 47//Number3D (org.papervision3d.core.math.Number3D) package org.papervision3d.core.math { import org.papervision3d.*; public class Number3D { public var z:Number; public var x:Number; public var y:Number; public static var toDEGREES:Number = 57.2957795130823; private static var temp:Number3D = Number3D.ZERO; public static var toRADIANS:Number = 0.0174532925199433; public function Number3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){ this.x = _arg1; this.y = _arg2; this.z = _arg3; } public function normalize():void{ var _local1:Number; _local1 = this.modulo; if (((!((_local1 == 0))) && (!((_local1 == 1))))){ this.x = (this.x / _local1); this.y = (this.y / _local1); this.z = (this.z / _local1); }; } public function copyTo(_arg1:Number3D):void{ _arg1.x = x; _arg1.y = y; _arg1.z = z; } public function get moduloSquared():Number{ return ((((this.x * this.x) + (this.y * this.y)) + (this.z * this.z))); } public function reset(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):void{ x = _arg1; y = _arg2; z = _arg3; } public function isModuloGreaterThan(_arg1:Number):Boolean{ return ((moduloSquared > (_arg1 * _arg1))); } public function rotateX(_arg1:Number):void{ var _local2:Number; var _local3:Number; if (Papervision3D.useDEGREES){ _arg1 = (_arg1 * toRADIANS); }; _local2 = Math.cos(_arg1); _local3 = Math.sin(_arg1); temp.copyFrom(this); this.y = ((temp.y * _local2) - (temp.z * _local3)); this.z = ((temp.y * _local3) + (temp.z * _local2)); } public function rotateY(_arg1:Number):void{ var _local2:Number; var _local3:Number; if (Papervision3D.useDEGREES){ _arg1 = (_arg1 * toRADIANS); }; _local2 = Math.cos(_arg1); _local3 = Math.sin(_arg1); temp.copyFrom(this); this.x = ((temp.x * _local2) + (temp.z * _local3)); this.z = ((temp.x * -(_local3)) + (temp.z * _local2)); } public function rotateZ(_arg1:Number):void{ var _local2:Number; var _local3:Number; if (Papervision3D.useDEGREES){ _arg1 = (_arg1 * toRADIANS); }; _local2 = Math.cos(_arg1); _local3 = Math.sin(_arg1); temp.copyFrom(this); this.x = ((temp.x * _local2) - (temp.y * _local3)); this.y = ((temp.x * _local3) + (temp.y * _local2)); } public function clone():Number3D{ return (new Number3D(this.x, this.y, this.z)); } public function plusEq(_arg1:Number3D):void{ x = (x + _arg1.x); y = (y + _arg1.y); z = (z + _arg1.z); } public function toString():String{ return (((((("x:" + (Math.round((x * 100)) / 100)) + " y:") + (Math.round((y * 100)) / 100)) + " z:") + (Math.round((z * 100)) / 100))); } public function isModuloEqualTo(_arg1:Number):Boolean{ return ((moduloSquared == (_arg1 * _arg1))); } public function multiplyEq(_arg1:Number):void{ x = (x * _arg1); y = (y * _arg1); z = (z * _arg1); } public function get modulo():Number{ return (Math.sqrt((((this.x * this.x) + (this.y * this.y)) + (this.z * this.z)))); } public function isModuloLessThan(_arg1:Number):Boolean{ return ((moduloSquared < (_arg1 * _arg1))); } public function minusEq(_arg1:Number3D):void{ x = (x - _arg1.x); y = (y - _arg1.y); z = (z - _arg1.z); } public function copyFrom(_arg1:Number3D):void{ x = _arg1.x; y = _arg1.y; z = _arg1.z; } public static function sub(_arg1:Number3D, _arg2:Number3D):Number3D{ return (new Number3D((_arg1.x - _arg2.x), (_arg1.y - _arg2.y), (_arg1.z - _arg2.z))); } public static function add(_arg1:Number3D, _arg2:Number3D):Number3D{ return (new Number3D((_arg1.x + _arg2.x), (_arg1.y + _arg2.y), (_arg1.z + _arg2.z))); } public static function cross(_arg1:Number3D, _arg2:Number3D, _arg3:Number3D=null):Number3D{ if (!_arg3){ _arg3 = ZERO; }; _arg3.reset(((_arg2.y * _arg1.z) - (_arg2.z * _arg1.y)), ((_arg2.z * _arg1.x) - (_arg2.x * _arg1.z)), ((_arg2.x * _arg1.y) - (_arg2.y * _arg1.x))); return (_arg3); } public static function dot(_arg1:Number3D, _arg2:Number3D):Number{ return ((((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)) + (_arg2.z * _arg1.z))); } public static function get ZERO():Number3D{ return (new Number3D(0, 0, 0)); } } }//package org.papervision3d.core.mathSection 48//NumberUV (org.papervision3d.core.math.NumberUV) package org.papervision3d.core.math { public class NumberUV { public var u:Number; public var v:Number; public function NumberUV(_arg1:Number=0, _arg2:Number=0){ this.u = _arg1; this.v = _arg2; } public function toString():String{ return (((("u:" + u) + " v:") + v)); } public function clone():NumberUV{ return (new NumberUV(this.u, this.v)); } public static function get ZERO():NumberUV{ return (new NumberUV(0, 0)); } } }//package org.papervision3d.core.mathSection 49//Quaternion (org.papervision3d.core.math.Quaternion) package org.papervision3d.core.math { public class Quaternion { private var _matrix:Matrix3D; public var w:Number; public var x:Number; public var y:Number; public var z:Number; public static const EPSILON:Number = 1E-6; public static const DEGTORAD:Number = 0.0174532925199433; public static const RADTODEG:Number = 57.2957795130823; public function Quaternion(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=1){ this.x = _arg1; this.y = _arg2; this.z = _arg3; this.w = _arg4; _matrix = Matrix3D.IDENTITY; } public function setFromEuler(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=false):void{ var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; if (_arg4){ _arg1 = (_arg1 * DEGTORAD); _arg2 = (_arg2 * DEGTORAD); _arg3 = (_arg3 * DEGTORAD); }; _local5 = Math.sin((_arg1 * 0.5)); _local6 = Math.cos((_arg1 * 0.5)); _local7 = Math.sin((_arg2 * 0.5)); _local8 = Math.cos((_arg2 * 0.5)); _local9 = Math.sin((_arg3 * 0.5)); _local10 = Math.cos((_arg3 * 0.5)); _local11 = (_local6 * _local8); _local12 = (_local5 * _local7); this.x = ((_local9 * _local11) - (_local10 * _local12)); this.y = (((_local10 * _local5) * _local8) + ((_local9 * _local6) * _local7)); this.z = (((_local10 * _local6) * _local7) - ((_local9 * _local5) * _local8)); this.w = ((_local10 * _local11) + (_local9 * _local12)); } public function setFromAxisAngle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{ var _local5:Number; var _local6:Number; _local5 = Math.sin((_arg4 / 2)); _local6 = Math.cos((_arg4 / 2)); this.x = (_arg1 * _local5); this.y = (_arg2 * _local5); this.z = (_arg3 * _local5); this.w = _local6; this.normalize(); } public function get matrix():Matrix3D{ var _local1:Number; var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; _local1 = (x * x); _local2 = (x * y); _local3 = (x * z); _local4 = (x * w); _local5 = (y * y); _local6 = (y * z); _local7 = (y * w); _local8 = (z * z); _local9 = (z * w); _matrix.n11 = (1 - (2 * (_local5 + _local8))); _matrix.n12 = (2 * (_local2 - _local9)); _matrix.n13 = (2 * (_local3 + _local7)); _matrix.n21 = (2 * (_local2 + _local9)); _matrix.n22 = (1 - (2 * (_local1 + _local8))); _matrix.n23 = (2 * (_local6 - _local4)); _matrix.n31 = (2 * (_local3 - _local7)); _matrix.n32 = (2 * (_local6 + _local4)); _matrix.n33 = (1 - (2 * (_local1 + _local5))); return (_matrix); } public function calculateMultiply(_arg1:Quaternion, _arg2:Quaternion):void{ this.x = ((((_arg1.w * _arg2.x) + (_arg1.x * _arg2.w)) + (_arg1.y * _arg2.z)) - (_arg1.z * _arg2.y)); this.y = ((((_arg1.w * _arg2.y) - (_arg1.x * _arg2.z)) + (_arg1.y * _arg2.w)) + (_arg1.z * _arg2.x)); this.z = ((((_arg1.w * _arg2.z) + (_arg1.x * _arg2.y)) - (_arg1.y * _arg2.x)) + (_arg1.z * _arg2.w)); this.w = ((((_arg1.w * _arg2.w) - (_arg1.x * _arg2.x)) - (_arg1.y * _arg2.y)) - (_arg1.z * _arg2.z)); } public function toString():String{ return (((((((("Quaternion: x:" + this.x) + " y:") + this.y) + " z:") + this.z) + " w:") + this.w)); } public function normalize():void{ var _local1:Number; var _local2:Number; _local1 = this.modulo; if (Math.abs(_local1) < EPSILON){ x = (y = (z = 0)); w = 1; } else { _local2 = (1 / _local1); x = (x * _local2); y = (y * _local2); z = (z * _local2); w = (w * _local2); }; } public function get modulo():Number{ return (Math.sqrt(((((x * x) + (y * y)) + (z * z)) + (w * w)))); } public function toEuler():Number3D{ var _local1:Number3D; var _local2:Quaternion; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; _local1 = new Number3D(); _local2 = this; _local3 = ((_local2.x * _local2.y) + (_local2.z * _local2.w)); if (_local3 > 0.499){ _local1.x = (2 * Math.atan2(_local2.x, _local2.w)); _local1.y = (Math.PI / 2); _local1.z = 0; return (_local1); }; if (_local3 < -0.499){ _local1.x = (-2 * Math.atan2(_local2.x, _local2.w)); _local1.y = (-(Math.PI) / 2); _local1.z = 0; return (_local1); }; _local4 = (_local2.x * _local2.x); _local5 = (_local2.y * _local2.y); _local6 = (_local2.z * _local2.z); _local1.x = Math.atan2((((2 * _local2.y) * _local2.w) - ((2 * _local2.x) * _local2.z)), ((1 - (2 * _local5)) - (2 * _local6))); _local1.y = Math.asin((2 * _local3)); _local1.z = Math.atan2((((2 * _local2.x) * _local2.w) - ((2 * _local2.y) * _local2.z)), ((1 - (2 * _local4)) - (2 * _local6))); return (_local1); } public function clone():Quaternion{ return (new Quaternion(this.x, this.y, this.z, this.w)); } public function mult(_arg1:Quaternion):void{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; _local2 = this.w; _local3 = this.x; _local4 = this.y; _local5 = this.z; x = ((((_local2 * _arg1.x) + (_local3 * _arg1.w)) + (_local4 * _arg1.z)) - (_local5 * _arg1.y)); y = ((((_local2 * _arg1.y) - (_local3 * _arg1.z)) + (_local4 * _arg1.w)) + (_local5 * _arg1.x)); z = ((((_local2 * _arg1.z) + (_local3 * _arg1.y)) - (_local4 * _arg1.x)) + (_local5 * _arg1.w)); w = ((((_local2 * _arg1.w) - (_local3 * _arg1.x)) - (_local4 * _arg1.y)) - (_local5 * _arg1.z)); } public static function sub(_arg1:Quaternion, _arg2:Quaternion):Quaternion{ return (new Quaternion((_arg1.x - _arg2.x), (_arg1.y - _arg2.y), (_arg1.z - _arg2.z), (_arg1.w - _arg2.w))); } public static function add(_arg1:Quaternion, _arg2:Quaternion):Quaternion{ return (new Quaternion((_arg1.x + _arg2.x), (_arg1.y + _arg2.y), (_arg1.z + _arg2.z), (_arg1.w + _arg2.w))); } public static function createFromEuler(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=false):Quaternion{ var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Quaternion; if (_arg4){ _arg1 = (_arg1 * DEGTORAD); _arg2 = (_arg2 * DEGTORAD); _arg3 = (_arg3 * DEGTORAD); }; _local5 = Math.sin((_arg1 * 0.5)); _local6 = Math.cos((_arg1 * 0.5)); _local7 = Math.sin((_arg2 * 0.5)); _local8 = Math.cos((_arg2 * 0.5)); _local9 = Math.sin((_arg3 * 0.5)); _local10 = Math.cos((_arg3 * 0.5)); _local11 = (_local6 * _local8); _local12 = (_local5 * _local7); _local13 = new (Quaternion); _local13.x = ((_local9 * _local11) - (_local10 * _local12)); _local13.y = (((_local10 * _local5) * _local8) + ((_local9 * _local6) * _local7)); _local13.z = (((_local10 * _local6) * _local7) - ((_local9 * _local5) * _local8)); _local13.w = ((_local10 * _local11) + (_local9 * _local12)); return (_local13); } public static function createFromMatrix(_arg1:Matrix3D):Quaternion{ var _local2:Quaternion; var _local3:Number; var _local4:Array; var _local5:int; var _local6:int; var _local7:int; var _local8:Number; var _local9:Array; var _local10:Array; _local2 = new (Quaternion); _local4 = new Array(4); _local8 = ((_arg1.n11 + _arg1.n22) + _arg1.n33); if (_local8 > 0){ _local3 = Math.sqrt((_local8 + 1)); _local2.w = (_local3 / 2); _local3 = (0.5 / _local3); _local2.x = ((_arg1.n32 - _arg1.n23) * _local3); _local2.y = ((_arg1.n13 - _arg1.n31) * _local3); _local2.z = ((_arg1.n21 - _arg1.n12) * _local3); } else { _local9 = [1, 2, 0]; _local10 = [[_arg1.n11, _arg1.n12, _arg1.n13, _arg1.n14], [_arg1.n21, _arg1.n22, _arg1.n23, _arg1.n24], [_arg1.n31, _arg1.n32, _arg1.n33, _arg1.n34]]; _local5 = 0; if (_local10[1][1] > _local10[0][0]){ _local5 = 1; }; if (_local10[2][2] > _local10[_local5][_local5]){ _local5 = 2; }; _local6 = _local9[_local5]; _local7 = _local9[_local6]; _local3 = Math.sqrt(((_local10[_local5][_local5] - (_local10[_local6][_local6] + _local10[_local7][_local7])) + 1)); _local4[_local5] = (_local3 * 0.5); if (_local3 != 0){ _local3 = (0.5 / _local3); }; _local4[3] = ((_local10[_local7][_local6] - _local10[_local6][_local7]) * _local3); _local4[_local6] = ((_local10[_local6][_local5] + _local10[_local5][_local6]) * _local3); _local4[_local7] = ((_local10[_local7][_local5] + _local10[_local5][_local7]) * _local3); _local2.x = _local4[0]; _local2.y = _local4[1]; _local2.z = _local4[2]; _local2.w = _local4[3]; }; return (_local2); } public static function dot(_arg1:Quaternion, _arg2:Quaternion):Number{ return (((((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)) + (_arg1.z * _arg2.z)) + (_arg1.w * _arg2.w))); } public static function multiply(_arg1:Quaternion, _arg2:Quaternion):Quaternion{ var _local3:Quaternion; _local3 = new (Quaternion); _local3.x = ((((_arg1.w * _arg2.x) + (_arg1.x * _arg2.w)) + (_arg1.y * _arg2.z)) - (_arg1.z * _arg2.y)); _local3.y = ((((_arg1.w * _arg2.y) - (_arg1.x * _arg2.z)) + (_arg1.y * _arg2.w)) + (_arg1.z * _arg2.x)); _local3.z = ((((_arg1.w * _arg2.z) + (_arg1.x * _arg2.y)) - (_arg1.y * _arg2.x)) + (_arg1.z * _arg2.w)); _local3.w = ((((_arg1.w * _arg2.w) - (_arg1.x * _arg2.x)) - (_arg1.y * _arg2.y)) - (_arg1.z * _arg2.z)); return (_local3); } public static function createFromAxisAngle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Quaternion{ var _local5:Quaternion; _local5 = new (Quaternion); _local5.setFromAxisAngle(_arg1, _arg2, _arg3, _arg4); return (_local5); } public static function slerp(_arg1:Quaternion, _arg2:Quaternion, _arg3:Number):Quaternion{ var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; _local4 = ((((_arg1.w * _arg2.w) + (_arg1.x * _arg2.x)) + (_arg1.y * _arg2.y)) + (_arg1.z * _arg2.z)); if (_local4 < 0){ _arg1.x = (_arg1.x * -1); _arg1.y = (_arg1.y * -1); _arg1.z = (_arg1.z * -1); _arg1.w = (_arg1.w * -1); _local4 = (_local4 * -1); }; if ((_local4 + 1) > EPSILON){ if ((1 - _local4) >= EPSILON){ _local7 = Math.acos(_local4); _local8 = (1 / Math.sin(_local7)); _local5 = (Math.sin((_local7 * (1 - _arg3))) * _local8); _local6 = (Math.sin((_local7 * _arg3)) * _local8); } else { _local5 = (1 - _arg3); _local6 = _arg3; }; } else { _arg2.y = -(_arg1.y); _arg2.x = _arg1.x; _arg2.w = -(_arg1.w); _arg2.z = _arg1.z; _local5 = Math.sin((Math.PI * (0.5 - _arg3))); _local6 = Math.sin((Math.PI * _arg3)); }; return (new Quaternion(((_local5 * _arg1.x) + (_local6 * _arg2.x)), ((_local5 * _arg1.y) + (_local6 * _arg2.y)), ((_local5 * _arg1.z) + (_local6 * _arg2.z)), ((_local5 * _arg1.w) + (_local6 * _arg2.w)))); } public static function createFromOrthoMatrix(_arg1:Matrix3D):Quaternion{ var _local2:Quaternion; _local2 = new (Quaternion); _local2.w = (Math.sqrt(Math.max(0, (((1 + _arg1.n11) + _arg1.n22) + _arg1.n33))) / 2); _local2.x = (Math.sqrt(Math.max(0, (((1 + _arg1.n11) - _arg1.n22) - _arg1.n33))) / 2); _local2.y = (Math.sqrt(Math.max(0, (((1 - _arg1.n11) + _arg1.n22) - _arg1.n33))) / 2); _local2.z = (Math.sqrt(Math.max(0, (((1 - _arg1.n11) - _arg1.n22) + _arg1.n33))) / 2); _local2.x = (((_arg1.n32 - _arg1.n23) < 0)) ? ((_local2.x < 0)) ? _local2.x : -(_local2.x) : ((_local2.x < 0)) ? -(_local2.x) : _local2.x; _local2.y = (((_arg1.n13 - _arg1.n31) < 0)) ? ((_local2.y < 0)) ? _local2.y : -(_local2.y) : ((_local2.y < 0)) ? -(_local2.y) : _local2.y; _local2.z = (((_arg1.n21 - _arg1.n12) < 0)) ? ((_local2.z < 0)) ? _local2.z : -(_local2.z) : ((_local2.z < 0)) ? -(_local2.z) : _local2.z; return (_local2); } public static function conjugate(_arg1:Quaternion):Quaternion{ var _local2:Quaternion; _local2 = new (Quaternion); _local2.x = -(_arg1.x); _local2.y = -(_arg1.y); _local2.z = -(_arg1.z); _local2.w = _arg1.w; return (_local2); } public static function slerpOld(_arg1:Quaternion, _arg2:Quaternion, _arg3:Number):Quaternion{ var _local4:Quaternion; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; _local4 = new (Quaternion); _local5 = ((((_arg1.w * _arg2.w) + (_arg1.x * _arg2.x)) + (_arg1.y * _arg2.y)) + (_arg1.z * _arg2.z)); if (Math.abs(_local5) >= 1){ _local4.w = _arg1.w; _local4.x = _arg1.x; _local4.y = _arg1.y; _local4.z = _arg1.z; return (_local4); }; _local6 = Math.acos(_local5); _local7 = Math.sqrt((1 - (_local5 * _local5))); if (Math.abs(_local7) < 0.001){ _local4.w = ((_arg1.w * 0.5) + (_arg2.w * 0.5)); _local4.x = ((_arg1.x * 0.5) + (_arg2.x * 0.5)); _local4.y = ((_arg1.y * 0.5) + (_arg2.y * 0.5)); _local4.z = ((_arg1.z * 0.5) + (_arg2.z * 0.5)); return (_local4); }; _local8 = (Math.sin(((1 - _arg3) * _local6)) / _local7); _local9 = (Math.sin((_arg3 * _local6)) / _local7); _local4.w = ((_arg1.w * _local8) + (_arg2.w * _local9)); _local4.x = ((_arg1.x * _local8) + (_arg2.x * _local9)); _local4.y = ((_arg1.y * _local8) + (_arg2.y * _local9)); _local4.z = ((_arg1.z * _local8) + (_arg2.z * _local9)); return (_local4); } } }//package org.papervision3d.core.mathSection 50//pv3dview (org.papervision3d.core.ns.pv3dview) package org.papervision3d.core.ns { public namespace pv3dview; }//package org.papervision3d.core.nsSection 51//CameraObject3D (org.papervision3d.core.proto.CameraObject3D) package org.papervision3d.core.proto { import org.papervision3d.core.render.data.*; import flash.geom.*; import org.papervision3d.core.math.*; import org.papervision3d.objects.*; import org.papervision3d.core.culling.*; import org.papervision3d.*; public class CameraObject3D extends DisplayObject3D { protected var _orthoScale:Number;// = 1 protected var _orthoScaleMatrix:Matrix3D; protected var _useCulling:Boolean; public var eye:Matrix3D; public var culler:IObjectCuller; public var sort:Boolean; public var viewport:Rectangle; protected var _far:Number; protected var _ortho:Boolean; public var zoom:Number; public var yUP:Boolean; protected var _target:DisplayObject3D; public var focus:Number; protected var _useProjectionMatrix:Boolean; public static var DEFAULT_VIEWPORT:Rectangle = new Rectangle(0, 0, 550, 400); public static var DEFAULT_POS:Number3D = new Number3D(0, 0, -1000); public static var DEFAULT_UP:Number3D = new Number3D(0, 1, 0); private static var _flipY:Matrix3D = Matrix3D.scaleMatrix(1, -1, 1); public function CameraObject3D(_arg1:Number=500, _arg2:Number=3){ _orthoScale = 1; super(); this.x = DEFAULT_POS.x; this.y = DEFAULT_POS.y; this.z = DEFAULT_POS.z; this.zoom = _arg2; this.focus = _arg1; this.eye = Matrix3D.IDENTITY; this.viewport = DEFAULT_VIEWPORT; this.sort = true; _ortho = false; _orthoScaleMatrix = Matrix3D.scaleMatrix(1, 1, 1); if (Papervision3D.useRIGHTHANDED){ DEFAULT_UP.y = -1; this.yUP = false; this.lookAt(DisplayObject3D.ZERO); } else { this.yUP = true; }; } public function get far():Number{ return (_far); } public function set target(_arg1:DisplayObject3D):void{ _target = _arg1; } public function set ortho(_arg1:Boolean):void{ _ortho = _arg1; } public function set far(_arg1:Number):void{ if (_arg1 > this.focus){ _far = _arg1; }; } public function get near():Number{ return (this.focus); } override public function lookAt(_arg1:DisplayObject3D, _arg2:Number3D=null):void{ if (this.yUP){ super.lookAt(_arg1, _arg2); } else { super.lookAt(_arg1, ((_arg2) || (DEFAULT_UP))); }; } public function projectVertices(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{ return (0); } public function set useProjectionMatrix(_arg1:Boolean):void{ _useProjectionMatrix = _arg1; } public function set useCulling(_arg1:Boolean):void{ _useCulling = _arg1; } public function set near(_arg1:Number):void{ if (_arg1 > 0){ this.focus = _arg1; }; } public function unproject(_arg1:Number, _arg2:Number):Number3D{ var _local3:Number; var _local4:Number3D; _local3 = ((focus * zoom) / focus); _local4 = new Number3D((_arg1 / _local3), (-(_arg2) / _local3), focus); Matrix3D.multiplyVector3x3(transform, _local4); return (_local4); } public function transformView(_arg1:Matrix3D=null):void{ if (this.yUP){ eye.calculateMultiply(((_arg1) || (this.transform)), _flipY); eye.invert(); } else { eye.calculateInverse(((_arg1) || (this.transform))); }; } public function get target():DisplayObject3D{ return (_target); } public function pan(_arg1:Number):void{ } public function set fov(_arg1:Number):void{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; if (((!(viewport)) || (viewport.isEmpty()))){ Papervision3D.log("[WARNING] CameraObject3D#viewport not set, can't set fov!"); return; }; _local2 = 0; _local3 = 0; _local4 = 0; if (_target){ _local2 = _target.world.n14; _local3 = _target.world.n24; _local4 = _target.world.n34; }; _local5 = (this.x - _local2); _local6 = (this.y - _local3); _local7 = (this.z - _local4); _local8 = (viewport.height / 2); _local9 = (Math.sqrt((((_local5 * _local5) + (_local6 * _local6)) + (_local7 * _local7))) + this.focus); _local10 = (180 / Math.PI); _local11 = ((_arg1 / 2) * (Math.PI / 180)); this.focus = ((_local8 / Math.tan(_local11)) / this.zoom); } public function get useProjectionMatrix():Boolean{ return (_useProjectionMatrix); } public function get ortho():Boolean{ return (_ortho); } public function get orthoScale():Number{ return (_orthoScale); } public function tilt(_arg1:Number):void{ } public function get fov():Number{ 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; var _local11:Number; if (((!(viewport)) || (viewport.isEmpty()))){ Papervision3D.log("[WARNING] CameraObject3D#viewport not set, can't calculate fov!"); return (NaN); }; _local1 = 0; _local2 = 0; _local3 = 0; if (_target){ _local1 = _target.world.n14; _local2 = _target.world.n24; _local3 = _target.world.n34; }; _local4 = (this.x - _local1); _local5 = (this.y - _local2); _local6 = (this.z - _local3); _local7 = this.focus; _local8 = this.zoom; _local9 = (Math.sqrt((((_local4 * _local4) + (_local5 * _local5)) + (_local6 * _local6))) + _local7); _local10 = (viewport.height / 2); _local11 = (180 / Math.PI); return (((Math.atan(((((_local9 / _local7) / _local8) * _local10) / _local9)) * _local11) * 2)); } public function orbit(_arg1:Number, _arg2:Number, _arg3:Boolean=true, _arg4:DisplayObject3D=null):void{ } public function get useCulling():Boolean{ return (_useCulling); } public function set orthoScale(_arg1:Number):void{ _orthoScale = ((_arg1 > 0)) ? _arg1 : 0.0001; _orthoScaleMatrix.n11 = _orthoScale; _orthoScaleMatrix.n22 = _orthoScale; _orthoScaleMatrix.n33 = _orthoScale; } } }//package org.papervision3d.core.protoSection 52//DisplayObjectContainer3D (org.papervision3d.core.proto.DisplayObjectContainer3D) package org.papervision3d.core.proto { import org.papervision3d.objects.*; import flash.events.*; import flash.utils.*; public class DisplayObjectContainer3D extends EventDispatcher { private var _childrenTotal:int; public var root:DisplayObjectContainer3D; protected var _children:Dictionary; protected var _childrenByName:Object; public function DisplayObjectContainer3D():void{ this._children = new Dictionary(false); this._childrenByName = new Dictionary(true); this._childrenTotal = 0; } public function addChild(_arg1:DisplayObject3D, _arg2:String=null):DisplayObject3D{ _arg2 = ((((_arg2) || (_arg1.name))) || (String(_arg1.id))); this._children[_arg1] = _arg2; this._childrenByName[_arg2] = _arg1; this._childrenTotal++; _arg1.parent = this; _arg1.root = this.root; return (_arg1); } private function findChildByName(_arg1:String, _arg2:DisplayObject3D=null):DisplayObject3D{ var _local3:DisplayObject3D; var _local4:DisplayObject3D; _arg2 = ((_arg2) || (DisplayObject3D(this))); if (!_arg2){ return (null); }; if (_arg2.name == _arg1){ return (_arg2); }; for each (_local3 in _arg2.children) { _local4 = findChildByName(_arg1, _local3); if (_local4){ return (_local4); }; }; return (null); } public function getChildByName(_arg1:String, _arg2:Boolean=false):DisplayObject3D{ if (_arg2){ return (findChildByName(_arg1)); }; return (this._childrenByName[_arg1]); } public function get numChildren():int{ return (this._childrenTotal); } public function addChildren(_arg1:DisplayObject3D):DisplayObjectContainer3D{ var _local2:DisplayObject3D; for each (_local2 in _arg1.children) { _arg1.removeChild(_local2); this.addChild(_local2); }; return (this); } public function removeChildByName(_arg1:String):DisplayObject3D{ return (removeChild(getChildByName(_arg1))); } override public function toString():String{ return (childrenList()); } public function removeChild(_arg1:DisplayObject3D):DisplayObject3D{ if (_arg1){ delete this._childrenByName[this._children[_arg1]]; delete this._children[_arg1]; _arg1.parent = null; _arg1.root = null; _childrenTotal--; return (_arg1); }; return (null); } public function childrenList():String{ var _local1:String; var _local2:String; _local1 = ""; for (_local2 in this._children) { _local1 = (_local1 + (_local2 + "\n")); }; return (_local1); } public function get children():Object{ return (this._childrenByName); } } }//package org.papervision3d.core.protoSection 53//GeometryObject3D (org.papervision3d.core.proto.GeometryObject3D) package org.papervision3d.core.proto { import org.papervision3d.core.geom.renderables.*; import org.papervision3d.core.math.*; import org.papervision3d.objects.*; import flash.events.*; import flash.utils.*; public class GeometryObject3D extends EventDispatcher { protected var _boundingSphereDirty:Boolean;// = true public var dirty:Boolean; protected var _aabbDirty:Boolean;// = true public var _ready:Boolean;// = false protected var _boundingSphere:BoundingSphere; public var faces:Array; private var _numInstances:uint;// = 0 public var vertices:Array; protected var _aabb:AxisAlignedBoundingBox; public function GeometryObject3D():void{ _boundingSphereDirty = true; _aabbDirty = true; _numInstances = 0; _ready = false; super(); dirty = true; } public function transformVertices(_arg1:Matrix3D):void{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:int; var _local15:Vertex3D; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; _local2 = _arg1.n11; _local3 = _arg1.n12; _local4 = _arg1.n13; _local5 = _arg1.n21; _local6 = _arg1.n22; _local7 = _arg1.n23; _local8 = _arg1.n31; _local9 = _arg1.n32; _local10 = _arg1.n33; _local11 = _arg1.n14; _local12 = _arg1.n24; _local13 = _arg1.n34; _local14 = vertices.length; while ((_local15 = vertices[--_local14])) { _local16 = _local15.x; _local17 = _local15.y; _local18 = _local15.z; _local19 = ((((_local16 * _local2) + (_local17 * _local3)) + (_local18 * _local4)) + _local11); _local20 = ((((_local16 * _local5) + (_local17 * _local6)) + (_local18 * _local7)) + _local12); _local21 = ((((_local16 * _local8) + (_local17 * _local9)) + (_local18 * _local10)) + _local13); _local15.x = _local19; _local15.y = _local20; _local15.z = _local21; }; } public function flipFaces():void{ var _local1:Triangle3D; var _local2:Vertex3D; for each (_local1 in this.faces) { _local2 = _local1.v0; _local1.v0 = _local1.v2; _local1.v2 = _local2; _local1.uv = [_local1.uv2, _local1.uv1, _local1.uv0]; _local1.createNormal(); }; this.ready = true; } private function createVertexNormals():void{ var _local1:Dictionary; var _local2:Triangle3D; var _local3:Vertex3D; _local1 = new Dictionary(true); for each (_local2 in faces) { _local2.v0.connectedFaces[_local2] = _local2; _local2.v1.connectedFaces[_local2] = _local2; _local2.v2.connectedFaces[_local2] = _local2; _local1[_local2.v0] = _local2.v0; _local1[_local2.v1] = _local2.v1; _local1[_local2.v2] = _local2.v2; }; for each (_local3 in _local1) { _local3.calculateNormal(); }; } public function get boundingSphere():BoundingSphere{ if (_boundingSphereDirty){ _boundingSphere = BoundingSphere.getFromVertices(vertices); _boundingSphereDirty = false; }; return (_boundingSphere); } public function transformUV(_arg1:MaterialObject3D):void{ var _local2:String; if (_arg1.bitmap){ for (_local2 in this.faces) { faces[_local2].transformUV(_arg1); }; }; } public function clone(_arg1:DisplayObject3D=null):GeometryObject3D{ var _local2:Dictionary; var _local3:Dictionary; var _local4:GeometryObject3D; var _local5:int; var _local6:MaterialObject3D; var _local7:Vertex3D; var _local8:Triangle3D; var _local9:Vertex3D; var _local10:Vertex3D; var _local11:Vertex3D; _local2 = new Dictionary(true); _local3 = new Dictionary(true); _local4 = new GeometryObject3D(); _local4.vertices = new Array(); _local4.faces = new Array(); _local5 = 0; while (_local5 < this.vertices.length) { _local7 = this.vertices[_local5]; _local3[_local7] = _local7.clone(); _local4.vertices.push(_local3[_local7]); _local5++; }; _local5 = 0; while (_local5 < this.faces.length) { _local8 = this.faces[_local5]; _local9 = _local3[_local8.v0]; _local10 = _local3[_local8.v1]; _local11 = _local3[_local8.v2]; _local4.faces.push(new Triangle3D(_arg1, [_local9, _local10, _local11], _local8.material, _local8.uv)); _local2[_local8.material] = _local8.material; _local5++; }; for each (_local6 in _local2) { _local6.registerObject(_arg1); }; return (_local4); } public function set ready(_arg1:Boolean):void{ if (_arg1){ createVertexNormals(); this.dirty = false; }; _ready = _arg1; } public function get ready():Boolean{ return (_ready); } public function get aabb():AxisAlignedBoundingBox{ if (_aabbDirty){ _aabb = AxisAlignedBoundingBox.createFromVertices(vertices); _aabbDirty = false; }; return (_aabb); } } }//package org.papervision3d.core.protoSection 54//MaterialObject3D (org.papervision3d.core.proto.MaterialObject3D) package org.papervision3d.core.proto { import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import flash.display.*; import flash.geom.*; import org.papervision3d.objects.*; import org.papervision3d.core.render.material.*; import flash.events.*; import flash.utils.*; import org.papervision3d.core.render.draw.*; import org.papervision3d.materials.*; public class MaterialObject3D extends EventDispatcher implements ITriangleDrawer { public var widthOffset:Number;// = 0 public var name:String; public var heightOffset:Number;// = 0 public var fillAlpha:Number;// = 0 public var fillColor:Number; public var id:Number; protected var objects:Dictionary; public var invisible:Boolean;// = false public var smooth:Boolean;// = false public var bitmap:BitmapData; public var lineColor:Number; public var lineAlpha:Number;// = 0 public var oneSide:Boolean;// = true public var lineThickness:Number;// = 1 public var interactive:Boolean;// = false public var opposite:Boolean;// = false public var maxU:Number; public var tiled:Boolean;// = false public var maxV:Number; public static var DEFAULT_COLOR:int = 0; public static var DEBUG_COLOR:int = 0xFF00FF; private static var _totalMaterialObjects:Number = 0; public function MaterialObject3D(){ smooth = false; tiled = false; lineColor = DEFAULT_COLOR; lineAlpha = 0; lineThickness = 1; fillColor = DEFAULT_COLOR; fillAlpha = 0; oneSide = true; invisible = false; opposite = false; widthOffset = 0; heightOffset = 0; interactive = false; super(); this.id = _totalMaterialObjects++; MaterialManager.registerMaterial(this); objects = new Dictionary(true); } public function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void{ } public function get doubleSided():Boolean{ return (!(this.oneSide)); } public function unregisterObject(_arg1:DisplayObject3D):void{ if (((objects) && (!((objects[_arg1] == null))))){ delete objects[_arg1]; }; } public function set doubleSided(_arg1:Boolean):void{ this.oneSide = !(_arg1); } public function registerObject(_arg1:DisplayObject3D):void{ objects[_arg1] = _arg1; } public function updateBitmap():void{ } override public function toString():String{ return (((((("[MaterialObject3D] bitmap:" + this.bitmap) + " lineColor:") + this.lineColor) + " fillColor:") + fillColor)); } public function copy(_arg1:MaterialObject3D):void{ this.bitmap = _arg1.bitmap; this.smooth = _arg1.smooth; this.lineColor = _arg1.lineColor; this.lineAlpha = _arg1.lineAlpha; this.fillColor = _arg1.fillColor; this.fillAlpha = _arg1.fillAlpha; this.oneSide = _arg1.oneSide; this.opposite = _arg1.opposite; this.invisible = _arg1.invisible; this.name = _arg1.name; this.maxU = _arg1.maxU; this.maxV = _arg1.maxV; } public function destroy():void{ objects = null; bitmap = null; MaterialManager.unRegisterMaterial(this); } public function clone():MaterialObject3D{ var _local1:MaterialObject3D; _local1 = new MaterialObject3D(); _local1.copy(this); return (_local1); } public static function get DEFAULT():MaterialObject3D{ var _local1:MaterialObject3D; _local1 = new WireframeMaterial(); _local1.lineColor = (0xFFFFFF * Math.random()); _local1.lineAlpha = 1; _local1.fillColor = DEFAULT_COLOR; _local1.fillAlpha = 1; _local1.doubleSided = false; return (_local1); } public static function get DEBUG():MaterialObject3D{ var _local1:MaterialObject3D; _local1 = new (MaterialObject3D); _local1.lineColor = (0xFFFFFF * Math.random()); _local1.lineAlpha = 1; _local1.fillColor = DEBUG_COLOR; _local1.fillAlpha = 0.37; _local1.doubleSided = true; return (_local1); } } }//package org.papervision3d.core.protoSection 55//SceneObject3D (org.papervision3d.core.proto.SceneObject3D) package org.papervision3d.core.proto { import org.papervision3d.materials.utils.*; import org.papervision3d.objects.*; import org.papervision3d.*; public class SceneObject3D extends DisplayObjectContainer3D { public var objects:Array; public var materials:MaterialsList; public function SceneObject3D(){ this.objects = new Array(); this.materials = new MaterialsList(); Papervision3D.log((((((Papervision3D.NAME + " ") + Papervision3D.VERSION) + " (") + Papervision3D.DATE) + ")\n")); this.root = this; } override public function removeChild(_arg1:DisplayObject3D):DisplayObject3D{ var _local2:int; super.removeChild(_arg1); _local2 = 0; while (_local2 < this.objects.length) { if (this.objects[_local2] === _arg1){ this.objects.splice(_local2, 1); return (_arg1); }; _local2++; }; return (_arg1); } override public function addChild(_arg1:DisplayObject3D, _arg2:String=null):DisplayObject3D{ var _local3:DisplayObject3D; _local3 = super.addChild(_arg1, (_arg2) ? _arg2 : _arg1.name); _arg1.scene = this; _arg1.parent = null; this.objects.push(_local3); return (_local3); } } }//package org.papervision3d.core.protoSection 56//AbstractRenderListItem (org.papervision3d.core.render.command.AbstractRenderListItem) package org.papervision3d.core.render.command { import org.papervision3d.core.render.data.*; import flash.display.*; public class AbstractRenderListItem implements IRenderListItem { public var screenDepth:Number; public function render(_arg1:RenderSessionData, _arg2:Graphics):void{ } } }//package org.papervision3d.core.render.commandSection 57//IRenderListItem (org.papervision3d.core.render.command.IRenderListItem) package org.papervision3d.core.render.command { import org.papervision3d.core.render.data.*; import flash.display.*; public interface IRenderListItem { function render(_arg1:RenderSessionData, _arg2:Graphics):void; } }//package org.papervision3d.core.render.commandSection 58//RenderableListItem (org.papervision3d.core.render.command.RenderableListItem) package org.papervision3d.core.render.command { import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import flash.geom.*; import org.papervision3d.objects.*; public class RenderableListItem extends AbstractRenderListItem { public var renderableInstance:AbstractRenderable; public var renderable:Class; public var instance:DisplayObject3D; public function hitTestPoint2D(_arg1:Point, _arg2:RenderHitData):RenderHitData{ return (_arg2); } } }//package org.papervision3d.core.render.commandSection 59//RenderLine (org.papervision3d.core.render.command.RenderLine) package org.papervision3d.core.render.command { import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import flash.display.*; import flash.geom.*; import org.papervision3d.core.math.*; import org.papervision3d.materials.special.*; public class RenderLine extends RenderableListItem implements IRenderListItem { public var renderer:LineMaterial; private var l1:Number2D; private var l2:Number2D; public var line:Line3D; private var v:Number2D; private var cp3d:Number3D; private var p:Number2D; private static var mouseVector:Number3D = Number3D.ZERO; private static var lineVector:Number3D = Number3D.ZERO; public function RenderLine(_arg1:Line3D){ this.renderable = Line3D; this.renderableInstance = _arg1; this.line = _arg1; p = new Number2D(); l1 = new Number2D(); l2 = new Number2D(); v = new Number2D(); cp3d = new Number3D(); } override public function render(_arg1:RenderSessionData, _arg2:Graphics):void{ renderer.drawLine(line, _arg2, _arg1); } override public function hitTestPoint2D(_arg1:Point, _arg2:RenderHitData):RenderHitData{ var _local3:Number; var _local4:Number; var _local5:Number; if (renderer.interactive){ _local3 = line.size; p.reset(_arg1.x, _arg1.y); l1.reset(line.v0.vertex3DInstance.x, line.v0.vertex3DInstance.y); l2.reset(line.v1.vertex3DInstance.x, line.v1.vertex3DInstance.y); v.copyFrom(l2); v.minusEq(l1); _local4 = ((((p.x - l1.x) * (l2.x - l1.x)) + ((p.y - l1.y) * (l2.y - l1.y))) / ((v.x * v.x) + (v.y * v.y))); if ((((_local4 > 0)) && ((_local4 < 1)))){ v.multiplyEq(_local4); v.plusEq(l1); v.minusEq(p); _local5 = ((v.x * v.x) + (v.y * v.y)); if (_local5 < (_local3 * _local3)){ _arg2.displayObject3D = line.instance; _arg2.material = renderer; _arg2.renderable = line; _arg2.hasHit = true; cp3d.reset((line.v1.x - line.v0.x), (line.v1.y - line.v0.y), (line.v1.x - line.v0.x)); cp3d.x = (cp3d.x * _local4); cp3d.y = (cp3d.y * _local4); cp3d.z = (cp3d.z * _local4); cp3d.x = (cp3d.x + line.v0.x); cp3d.y = (cp3d.y + line.v0.y); cp3d.z = (cp3d.z + line.v0.z); _arg2.x = cp3d.x; _arg2.y = cp3d.y; _arg2.z = cp3d.z; _arg2.u = 0; _arg2.v = 0; return (_arg2); }; }; }; return (_arg2); } } }//package org.papervision3d.core.render.commandSection 60//RenderParticle (org.papervision3d.core.render.command.RenderParticle) package org.papervision3d.core.render.command { import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import flash.display.*; import flash.geom.*; import org.papervision3d.materials.special.*; public class RenderParticle extends RenderableListItem implements IRenderListItem { public var particle:Particle; public var renderMat:ParticleMaterial; public function RenderParticle(_arg1:Particle){ this.particle = _arg1; this.renderableInstance = _arg1; this.renderable = Particle; } override public function render(_arg1:RenderSessionData, _arg2:Graphics):void{ particle.material.drawParticle(particle, _arg2, _arg1); } override public function hitTestPoint2D(_arg1:Point, _arg2:RenderHitData):RenderHitData{ renderMat = particle.material; if (renderMat.interactive){ if (particle.renderRect.contains(_arg1.x, _arg1.y)){ _arg2.displayObject3D = particle.instance; _arg2.material = renderMat; _arg2.renderable = particle; _arg2.hasHit = true; _arg2.x = particle.x; _arg2.y = particle.y; _arg2.z = particle.z; _arg2.u = 0; _arg2.v = 0; return (_arg2); }; }; return (_arg2); } } }//package org.papervision3d.core.render.commandSection 61//RenderTriangle (org.papervision3d.core.render.command.RenderTriangle) package org.papervision3d.core.render.command { import org.papervision3d.core.proto.*; import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import flash.display.*; import flash.geom.*; import org.papervision3d.core.math.*; import org.papervision3d.core.render.draw.*; import org.papervision3d.materials.*; public class RenderTriangle extends RenderableListItem implements IRenderListItem { public var renderer:ITriangleDrawer; public var triangle:Triangle3D; public var container:Sprite; private var position:Number3D; public var renderMat:MaterialObject3D; protected static var resPA:Vertex3DInstance = new Vertex3DInstance(); protected static var resBA:Vertex3DInstance = new Vertex3DInstance(); protected static var vPoint:Vertex3DInstance = new Vertex3DInstance(); protected static var resRA:Vertex3DInstance = new Vertex3DInstance(); public function RenderTriangle(_arg1:Triangle3D):void{ position = new Number3D(); super(); this.triangle = _arg1; renderableInstance = _arg1; renderable = Triangle3D; } override public function render(_arg1:RenderSessionData, _arg2:Graphics):void{ renderer.drawTriangle(triangle, _arg2, _arg1); } override public function hitTestPoint2D(_arg1:Point, _arg2:RenderHitData):RenderHitData{ var _local3:Vertex3DInstance; var _local4:Vertex3DInstance; var _local5:Vertex3DInstance; var _local6:Vertex3DInstance; renderMat = triangle.material; if (!renderMat){ renderMat = triangle.instance.material; }; if (renderMat.interactive){ _local3 = RenderTriangle.vPoint; _local3.x = _arg1.x; _local3.y = _arg1.y; _local4 = triangle.v0.vertex3DInstance; _local5 = triangle.v1.vertex3DInstance; _local6 = triangle.v2.vertex3DInstance; if (sameSide(_local3, _local4, _local5, _local6)){ if (sameSide(_local3, _local5, _local4, _local6)){ if (sameSide(_local3, _local6, _local4, _local5)){ return (deepHitTest(triangle, _local3, _arg2)); }; }; }; }; return (_arg2); } public function sameSide(_arg1:Vertex3DInstance, _arg2:Vertex3DInstance, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance):Boolean{ Vertex3DInstance.subTo(_arg4, _arg3, resBA); Vertex3DInstance.subTo(_arg1, _arg3, resPA); Vertex3DInstance.subTo(_arg2, _arg3, resRA); return (((Vertex3DInstance.cross(resBA, resPA) * Vertex3DInstance.cross(resBA, resRA)) >= 0)); } private function deepHitTest(_arg1:Triangle3D, _arg2:Vertex3DInstance, _arg3:RenderHitData):RenderHitData{ var _local4:Vertex3DInstance; var _local5:Vertex3DInstance; var _local6:Vertex3DInstance; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local23:Number; var _local24:Number; var _local25:Number; var _local26:Number; var _local27:Number; var _local28:Number; var _local29:Number; var _local30:Array; var _local31:Number; var _local32:Number; var _local33:Number; var _local34:Number; var _local35:Number; var _local36:Number; var _local37:Number; var _local38:Number; var _local39:BitmapData; var _local40:Number; var _local41:Number; var _local42:Number; var _local43:Number; var _local44:MovieMaterial; var _local45:Rectangle; _local4 = _arg1.v0.vertex3DInstance; _local5 = _arg1.v1.vertex3DInstance; _local6 = _arg1.v2.vertex3DInstance; _local7 = (_local6.x - _local4.x); _local8 = (_local6.y - _local4.y); _local9 = (_local5.x - _local4.x); _local10 = (_local5.y - _local4.y); _local11 = (_arg2.x - _local4.x); _local12 = (_arg2.y - _local4.y); _local13 = ((_local7 * _local7) + (_local8 * _local8)); _local14 = ((_local7 * _local9) + (_local8 * _local10)); _local15 = ((_local7 * _local11) + (_local8 * _local12)); _local16 = ((_local9 * _local9) + (_local10 * _local10)); _local17 = ((_local9 * _local11) + (_local10 * _local12)); _local18 = (1 / ((_local13 * _local16) - (_local14 * _local14))); _local19 = (((_local16 * _local15) - (_local14 * _local17)) * _local18); _local20 = (((_local13 * _local17) - (_local14 * _local15)) * _local18); _local21 = (_arg1.v2.x - _arg1.v0.x); _local22 = (_arg1.v2.y - _arg1.v0.y); _local23 = (_arg1.v2.z - _arg1.v0.z); _local24 = (_arg1.v1.x - _arg1.v0.x); _local25 = (_arg1.v1.y - _arg1.v0.y); _local26 = (_arg1.v1.z - _arg1.v0.z); _local27 = ((_arg1.v0.x + (_local21 * _local19)) + (_local24 * _local20)); _local28 = ((_arg1.v0.y + (_local22 * _local19)) + (_local25 * _local20)); _local29 = ((_arg1.v0.z + (_local23 * _local19)) + (_local26 * _local20)); _local30 = _arg1.uv; _local31 = _local30[0].u; _local32 = _local30[1].u; _local33 = _local30[2].u; _local34 = _local30[0].v; _local35 = _local30[1].v; _local36 = _local30[2].v; _local37 = ((((_local32 - _local31) * _local20) + ((_local33 - _local31) * _local19)) + _local31); _local38 = ((((_local35 - _local34) * _local20) + ((_local36 - _local34) * _local19)) + _local34); if (triangle.material){ renderMat = _arg1.material; } else { renderMat = _arg1.instance.material; }; _local39 = renderMat.bitmap; _local40 = 1; _local41 = 1; _local42 = 0; _local43 = 0; if ((renderMat is MovieMaterial)){ _local44 = (renderMat as MovieMaterial); _local45 = _local44.rect; if (_local45){ _local42 = _local45.x; _local43 = _local45.y; _local40 = _local45.width; _local41 = _local45.height; }; } else { if (_local39){ _local40 = (BitmapMaterial.AUTO_MIP_MAPPING) ? renderMat.widthOffset : _local39.width; _local41 = (BitmapMaterial.AUTO_MIP_MAPPING) ? renderMat.heightOffset : _local39.height; }; }; _arg3.displayObject3D = _arg1.instance; _arg3.material = renderMat; _arg3.renderable = _arg1; _arg3.hasHit = true; position.x = _local27; position.y = _local28; position.z = _local29; Matrix3D.multiplyVector(_arg1.instance.world, position); _arg3.x = position.x; _arg3.y = position.y; _arg3.z = position.z; _arg3.u = ((_local37 * _local40) + _local42); _arg3.v = ((_local41 - (_local38 * _local41)) + _local43); return (_arg3); } } }//package org.papervision3d.core.render.commandSection 62//RenderHitData (org.papervision3d.core.render.data.RenderHitData) package org.papervision3d.core.render.data { import org.papervision3d.core.proto.*; import org.papervision3d.core.geom.renderables.*; import org.papervision3d.objects.*; public class RenderHitData { public var y:Number; public var endTime:int;// = 0 public var displayObject3D:DisplayObject3D; public var startTime:int;// = 0 public var hasHit:Boolean;// = false public var material:MaterialObject3D; public var renderable:IRenderable; public var u:Number; public var v:Number; public var x:Number; public var z:Number; public function RenderHitData():void{ startTime = 0; endTime = 0; hasHit = false; super(); } public function clear():void{ startTime = 0; endTime = 0; hasHit = false; displayObject3D = null; material = null; renderable = null; u = 0; v = 0; x = 0; y = 0; z = 0; } public function clone():RenderHitData{ var _local1:RenderHitData; _local1 = new RenderHitData(); _local1.startTime = startTime; _local1.endTime = endTime; _local1.hasHit = hasHit; _local1.displayObject3D = displayObject3D; _local1.material = material; _local1.renderable = renderable; _local1.u = u; _local1.v = v; _local1.x = x; _local1.y = y; _local1.z = z; return (_local1); } public function toString():String{ return (((displayObject3D + " ") + renderable)); } } }//package org.papervision3d.core.render.dataSection 63//RenderSessionData (org.papervision3d.core.render.data.RenderSessionData) package org.papervision3d.core.render.data { import org.papervision3d.core.proto.*; import org.papervision3d.view.*; import flash.display.*; import org.papervision3d.core.culling.*; import org.papervision3d.core.render.*; public class RenderSessionData { public var renderer:IRenderEngine; public var particleCuller:IParticleCuller; public var viewPort:Viewport3D; public var triangleCuller:ITriangleCuller; public var container:Sprite; public var scene:SceneObject3D; public var renderStatistics:RenderStatistics; public var renderObjects:Array; public var camera:CameraObject3D; public var renderLayers:Array; public var sorted:Boolean; public function RenderSessionData():void{ this.renderStatistics = new RenderStatistics(); } public function destroy():void{ triangleCuller = null; particleCuller = null; viewPort = null; container = null; scene = null; camera = null; renderer = null; renderStatistics = null; renderObjects = null; renderLayers = null; } public function clone():RenderSessionData{ var _local1:RenderSessionData; _local1 = new RenderSessionData(); _local1.triangleCuller = triangleCuller; _local1.particleCuller = particleCuller; _local1.viewPort = viewPort; _local1.container = container; _local1.scene = scene; _local1.camera = camera; _local1.renderer = renderer; _local1.renderStatistics = renderStatistics.clone(); return (_local1); } } }//package org.papervision3d.core.render.dataSection 64//RenderStatistics (org.papervision3d.core.render.data.RenderStatistics) package org.papervision3d.core.render.data { public class RenderStatistics { public var renderTime:int;// = 0 public var culledObjects:int;// = 0 public var shadedTriangles:int;// = 0 public var culledParticles:int;// = 0 public var culledTriangles:int;// = 0 public var triangles:int;// = 0 public var particles:int;// = 0 public var rendered:int;// = 0 public var projectionTime:int;// = 0 public var filteredObjects:int;// = 0 public var lines:int;// = 0 public function RenderStatistics(){ projectionTime = 0; renderTime = 0; rendered = 0; triangles = 0; culledTriangles = 0; particles = 0; culledParticles = 0; lines = 0; shadedTriangles = 0; filteredObjects = 0; culledObjects = 0; super(); } public function clone():RenderStatistics{ var _local1:RenderStatistics; _local1 = new RenderStatistics(); _local1.projectionTime = projectionTime; _local1.renderTime = renderTime; _local1.rendered = rendered; _local1.particles = particles; _local1.triangles = triangles; _local1.culledTriangles = culledTriangles; _local1.lines = lines; _local1.shadedTriangles = shadedTriangles; _local1.filteredObjects = filteredObjects; _local1.culledObjects = culledObjects; return (_local1); } public function clear():void{ projectionTime = 0; renderTime = 0; rendered = 0; particles = 0; triangles = 0; culledTriangles = 0; culledParticles = 0; lines = 0; shadedTriangles = 0; filteredObjects = 0; culledObjects = 0; } public function toString():String{ return (new String((((((((((((((((((("ProjectionTime:" + projectionTime) + " RenderTime:") + renderTime) + " Particles:") + particles) + " CulledParticles :") + culledParticles) + " Triangles:") + triangles) + " ShadedTriangles :") + shadedTriangles) + " CulledTriangles:") + culledTriangles) + " FilteredObjects:") + filteredObjects) + " CulledObjects:") + culledObjects) + ""))); } } }//package org.papervision3d.core.render.dataSection 65//ILineDrawer (org.papervision3d.core.render.draw.ILineDrawer) package org.papervision3d.core.render.draw { import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import flash.display.*; public interface ILineDrawer { function drawLine(_arg1:Line3D, _arg2:Graphics, _arg3:RenderSessionData):void; } }//package org.papervision3d.core.render.drawSection 66//IParticleDrawer (org.papervision3d.core.render.draw.IParticleDrawer) package org.papervision3d.core.render.draw { import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import flash.display.*; public interface IParticleDrawer { function updateRenderRect(_arg1:Particle):void; function drawParticle(_arg1:Particle, _arg2:Graphics, _arg3:RenderSessionData):void; } }//package org.papervision3d.core.render.drawSection 67//ITriangleDrawer (org.papervision3d.core.render.draw.ITriangleDrawer) package org.papervision3d.core.render.draw { import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import flash.display.*; import flash.geom.*; public interface ITriangleDrawer { function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void; } }//package org.papervision3d.core.render.drawSection 68//BasicRenderFilter (org.papervision3d.core.render.filter.BasicRenderFilter) package org.papervision3d.core.render.filter { public class BasicRenderFilter implements IRenderFilter { public function filter(_arg1:Array):int{ return (0); } } }//package org.papervision3d.core.render.filterSection 69//IRenderFilter (org.papervision3d.core.render.filter.IRenderFilter) package org.papervision3d.core.render.filter { public interface IRenderFilter { function filter(_arg1:Array):int; } }//package org.papervision3d.core.render.filterSection 70//IUpdateAfterMaterial (org.papervision3d.core.render.material.IUpdateAfterMaterial) package org.papervision3d.core.render.material { import org.papervision3d.core.render.data.*; public interface IUpdateAfterMaterial { function updateAfterRender(_arg1:RenderSessionData):void; } }//package org.papervision3d.core.render.materialSection 71//IUpdateBeforeMaterial (org.papervision3d.core.render.material.IUpdateBeforeMaterial) package org.papervision3d.core.render.material { import org.papervision3d.core.render.data.*; public interface IUpdateBeforeMaterial { function updateBeforeRender(_arg1:RenderSessionData):void; } }//package org.papervision3d.core.render.materialSection 72//MaterialManager (org.papervision3d.core.render.material.MaterialManager) package org.papervision3d.core.render.material { import org.papervision3d.core.proto.*; import org.papervision3d.core.render.data.*; import flash.utils.*; public class MaterialManager { private var materials:Dictionary; private static var instance:MaterialManager; public function MaterialManager():void{ if (instance){ throw (new Error("Only 1 instance of materialmanager allowed")); }; init(); } private function init():void{ materials = new Dictionary(true); } private function _unRegisterMaterial(_arg1:MaterialObject3D):void{ delete materials[_arg1]; } public function updateMaterialsAfterRender(_arg1:RenderSessionData):void{ var _local2:IUpdateAfterMaterial; var _local3:MaterialObject3D; for each (_local3 in materials) { if ((_local3 is IUpdateAfterMaterial)){ _local2 = (_local3 as IUpdateAfterMaterial); _local2.updateAfterRender(_arg1); }; }; } private function _registerMaterial(_arg1:MaterialObject3D):void{ materials[_arg1] = _arg1; } public function updateMaterialsBeforeRender(_arg1:RenderSessionData):void{ var _local2:IUpdateBeforeMaterial; var _local3:MaterialObject3D; for each (_local3 in materials) { if ((_local3 is IUpdateBeforeMaterial)){ _local2 = (_local3 as IUpdateBeforeMaterial); _local2.updateBeforeRender(_arg1); }; }; } public static function getInstance():MaterialManager{ if (!instance){ instance = new (MaterialManager); }; return (instance); } public static function unRegisterMaterial(_arg1:MaterialObject3D):void{ getInstance()._unRegisterMaterial(_arg1); } public static function registerMaterial(_arg1:MaterialObject3D):void{ getInstance()._registerMaterial(_arg1); } } }//package org.papervision3d.core.render.materialSection 73//BasicProjectionPipeline (org.papervision3d.core.render.project.BasicProjectionPipeline) package org.papervision3d.core.render.project { import org.papervision3d.core.render.data.*; import org.papervision3d.objects.*; public class BasicProjectionPipeline extends ProjectionPipeline { public function BasicProjectionPipeline(){ init(); } protected function init():void{ } protected function projectObject(_arg1:DisplayObject3D, _arg2:RenderSessionData):void{ _arg1.project(_arg2.camera, _arg2); } override public function project(_arg1:RenderSessionData):void{ var _local2:Array; var _local3:DisplayObject3D; var _local4:Number; _arg1.camera.transformView(); _local2 = _arg1.renderObjects; _local4 = _local2.length; if (_arg1.camera.useProjectionMatrix){ for each (_local3 in _local2) { if (_local3.visible){ if (_arg1.viewPort.viewportObjectFilter){ if (_arg1.viewPort.viewportObjectFilter.testObject(_local3)){ projectObject(_local3, _arg1); } else { _arg1.renderStatistics.filteredObjects++; }; } else { projectObject(_local3, _arg1); }; }; }; } else { for each (_local3 in _local2) { if (_local3.visible){ if (_arg1.viewPort.viewportObjectFilter){ if (_arg1.viewPort.viewportObjectFilter.testObject(_local3)){ projectObject(_local3, _arg1); } else { _arg1.renderStatistics.filteredObjects++; }; } else { projectObject(_local3, _arg1); }; }; }; }; } } }//package org.papervision3d.core.render.projectSection 74//ProjectionPipeline (org.papervision3d.core.render.project.ProjectionPipeline) package org.papervision3d.core.render.project { import org.papervision3d.core.render.data.*; public class ProjectionPipeline { public function project(_arg1:RenderSessionData):void{ } } }//package org.papervision3d.core.render.projectSection 75//BasicRenderSorter (org.papervision3d.core.render.sort.BasicRenderSorter) package org.papervision3d.core.render.sort { public class BasicRenderSorter implements IRenderSorter { public function sort(_arg1:Array):void{ _arg1.sortOn("screenDepth", Array.NUMERIC); } } }//package org.papervision3d.core.render.sortSection 76//IRenderSorter (org.papervision3d.core.render.sort.IRenderSorter) package org.papervision3d.core.render.sort { public interface IRenderSorter { function sort(_arg1:Array):void; } }//package org.papervision3d.core.render.sortSection 77//AbstractRenderEngine (org.papervision3d.core.render.AbstractRenderEngine) package org.papervision3d.core.render { import org.papervision3d.core.proto.*; import org.papervision3d.core.render.data.*; import org.papervision3d.view.*; import org.papervision3d.core.render.command.*; import flash.events.*; public class AbstractRenderEngine extends EventDispatcher implements IRenderEngine { public function AbstractRenderEngine(_arg1:IEventDispatcher=null){ super(_arg1); } public function removeFromRenderList(_arg1:IRenderListItem):int{ return (0); } public function addToRenderList(_arg1:IRenderListItem):int{ return (0); } public function renderScene(_arg1:SceneObject3D, _arg2:CameraObject3D, _arg3:Viewport3D, _arg4:Boolean=true):RenderStatistics{ return (null); } } }//package org.papervision3d.core.renderSection 78//IRenderEngine (org.papervision3d.core.render.IRenderEngine) package org.papervision3d.core.render { import org.papervision3d.core.proto.*; import org.papervision3d.core.render.data.*; import org.papervision3d.view.*; import org.papervision3d.core.render.command.*; public interface IRenderEngine { function addToRenderList(_arg1:IRenderListItem):int; function removeFromRenderList(_arg1:IRenderListItem):int; function renderScene(_arg1:SceneObject3D, _arg2:CameraObject3D, _arg3:Viewport3D, _arg4:Boolean=true):RenderStatistics; } }//package org.papervision3d.core.renderSection 79//IVirtualMouseEvent (org.papervision3d.core.utils.virtualmouse.IVirtualMouseEvent) package org.papervision3d.core.utils.virtualmouse { public interface IVirtualMouseEvent { } }//package org.papervision3d.core.utils.virtualmouseSection 80//VirtualMouse (org.papervision3d.core.utils.virtualmouse.VirtualMouse) package org.papervision3d.core.utils.virtualmouse { import flash.display.*; import flash.geom.*; import com.blitzagency.xray.logger.*; import flash.events.*; import flash.utils.*; public class VirtualMouse extends EventDispatcher { private var _container:Sprite; private var lastDownTarget:DisplayObject; private var target:InteractiveObject; private var updateMouseDown:Boolean;// = false private var eventEvent:Class; private var _lastEvent:Event; private var mouseEventEvent:Class; private var location:Point; private var delta:int;// = 0 private var disabledEvents:Object; private var log:XrayLog; private var ignoredInstances:Dictionary; private var isLocked:Boolean;// = false private var lastWithinStage:Boolean;// = true private var lastLocation:Point; private var isDoubleClickEvent:Boolean;// = false private var lastMouseDown:Boolean;// = false private var altKey:Boolean;// = false private var _useNativeEvents:Boolean;// = false private var ctrlKey:Boolean;// = false private var shiftKey:Boolean;// = false private var _stage:Stage; public static const UPDATE:String = "update"; private static var _mouseIsDown:Boolean = false; public function VirtualMouse(_arg1:Stage=null, _arg2:Sprite=null, _arg3:Number=0, _arg4:Number=0){ altKey = false; ctrlKey = false; shiftKey = false; delta = 0; isLocked = false; isDoubleClickEvent = false; disabledEvents = new Object(); ignoredInstances = new Dictionary(true); lastMouseDown = false; updateMouseDown = false; lastWithinStage = true; _useNativeEvents = false; eventEvent = VirtualMouseEvent; mouseEventEvent = VirtualMouseMouseEvent; log = new XrayLog(); super(); this.stage = _arg1; this.container = _arg2; location = new Point(_arg3, _arg4); lastLocation = location.clone(); addEventListener(UPDATE, handleUpdate); update(); } public function get mouseIsDown():Boolean{ return (_mouseIsDown); } public function get stage():Stage{ return (_stage); } public function exitContainer():void{ var _local1:Point; if (!container){ return; }; _local1 = target.globalToLocal(location); if (!disabledEvents[MouseEvent.MOUSE_OUT]){ _lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta); container.dispatchEvent(new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta)); dispatchEvent(new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta)); }; if (!disabledEvents[MouseEvent.ROLL_OUT]){ _lastEvent = new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta); container.dispatchEvent(new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta)); dispatchEvent(new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta)); }; if (target != container){ if (!disabledEvents[MouseEvent.MOUSE_OUT]){ _lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta); target.dispatchEvent(new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta)); dispatchEvent(new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta)); }; if (!disabledEvents[MouseEvent.ROLL_OUT]){ _lastEvent = new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta); target.dispatchEvent(new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta)); dispatchEvent(new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta)); }; }; target = _stage; } public function release():void{ updateMouseDown = true; _mouseIsDown = false; if (!isLocked){ update(); }; } public function click():void{ press(); release(); } public function get container():Sprite{ return (_container); } public function set container(_arg1:Sprite):void{ _container = _arg1; } public function get y():Number{ return (location.y); } public function set x(_arg1:Number):void{ location.x = _arg1; if (!isLocked){ update(); }; } public function disableEvent(_arg1:String):void{ disabledEvents[_arg1] = true; } public function get lastEvent():Event{ return (_lastEvent); } private function handleUpdate(_arg1:Event):void{ var _local2:Point; var _local3:Array; var _local4:InteractiveObject; var _local5:DisplayObject; var _local6:int; var _local7:Point; var _local8:Point; var _local9:Boolean; if (!container){ return; }; if (container.scrollRect){ trace("********* VIRTUAL MOUSE UPDATE WARNING ********: The container that virtualMouse is trying to test against has a scrollRect defined, and may cause an issue with finding objects under a defined point. Use MovieMaterial.rect to set a rectangle area instead"); }; _local2 = new Point(); _local2.x = container.x; _local2.y = container.y; container.x = (container.y = 0); _local3 = container.getObjectsUnderPoint(location); container.x = _local2.x; container.y = _local2.y; _local6 = _local3.length; while (_local6--) { _local5 = _local3[_local6]; while (_local5) { if (ignoredInstances[_local5]){ _local4 = null; break; }; if (((_local4) && ((_local5 is SimpleButton)))){ _local4 = null; } else { if (((_local4) && (!(DisplayObjectContainer(_local5).mouseChildren)))){ _local4 = null; }; }; if (((((!(_local4)) && ((_local5 is InteractiveObject)))) && (InteractiveObject(_local5).mouseEnabled))){ _local4 = InteractiveObject(_local5); }; _local5 = _local5.parent; }; if (_local4){ break; }; }; if (!_local4){ _local4 = _stage; }; _local7 = target.globalToLocal(location); _local8 = _local4.globalToLocal(location); if (((!((lastLocation.x == location.x))) || (!((lastLocation.y == location.y))))){ _local9 = false; if (stage){ _local9 = (((((((location.x >= 0)) && ((location.y >= 0)))) && ((location.x <= stage.stageWidth)))) && ((location.y <= stage.stageHeight))); }; if (((((!(_local9)) && (lastWithinStage))) && (!(disabledEvents[Event.MOUSE_LEAVE])))){ _lastEvent = new eventEvent(Event.MOUSE_LEAVE, false, false); stage.dispatchEvent(_lastEvent); dispatchEvent(_lastEvent); }; if (((_local9) && (!(disabledEvents[MouseEvent.MOUSE_MOVE])))){ _lastEvent = new mouseEventEvent(MouseEvent.MOUSE_MOVE, true, false, _local8.x, _local8.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta); _local4.dispatchEvent(_lastEvent); dispatchEvent(_lastEvent); }; lastWithinStage = _local9; }; if (_local4 != target){ if (!disabledEvents[MouseEvent.MOUSE_OUT]){ _lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local7.x, _local7.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta); target.dispatchEvent(_lastEvent); dispatchEvent(_lastEvent); }; if (!disabledEvents[MouseEvent.ROLL_OUT]){ _lastEvent = new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local7.x, _local7.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta); target.dispatchEvent(_lastEvent); dispatchEvent(_lastEvent); }; if (!disabledEvents[MouseEvent.MOUSE_OVER]){ _lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OVER, true, false, _local8.x, _local8.y, target, ctrlKey, altKey, shiftKey, _mouseIsDown, delta); _local4.dispatchEvent(_lastEvent); dispatchEvent(_lastEvent); }; if (!disabledEvents[MouseEvent.ROLL_OVER]){ _lastEvent = new mouseEventEvent(MouseEvent.ROLL_OVER, false, false, _local8.x, _local8.y, target, ctrlKey, altKey, shiftKey, _mouseIsDown, delta); _local4.dispatchEvent(_lastEvent); dispatchEvent(_lastEvent); }; }; if (updateMouseDown){ if (_mouseIsDown){ if (!disabledEvents[MouseEvent.MOUSE_DOWN]){ _lastEvent = new mouseEventEvent(MouseEvent.MOUSE_DOWN, true, false, _local8.x, _local8.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta); _local4.dispatchEvent(_lastEvent); dispatchEvent(_lastEvent); }; lastDownTarget = _local4; updateMouseDown = false; } else { if (!disabledEvents[MouseEvent.MOUSE_UP]){ _lastEvent = new mouseEventEvent(MouseEvent.MOUSE_UP, true, false, _local8.x, _local8.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta); _local4.dispatchEvent(_lastEvent); dispatchEvent(_lastEvent); }; if (((!(disabledEvents[MouseEvent.CLICK])) && ((_local4 == lastDownTarget)))){ _lastEvent = new mouseEventEvent(MouseEvent.CLICK, true, false, _local8.x, _local8.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta); _local4.dispatchEvent(_lastEvent); dispatchEvent(_lastEvent); }; lastDownTarget = null; updateMouseDown = false; }; }; if (((((isDoubleClickEvent) && (!(disabledEvents[MouseEvent.DOUBLE_CLICK])))) && (_local4.doubleClickEnabled))){ _lastEvent = new mouseEventEvent(MouseEvent.DOUBLE_CLICK, true, false, _local8.x, _local8.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta); _local4.dispatchEvent(_lastEvent); dispatchEvent(_lastEvent); }; lastLocation = location.clone(); lastMouseDown = _mouseIsDown; target = _local4; } public function getLocation():Point{ return (location.clone()); } public function get x():Number{ return (location.x); } public function lock():void{ isLocked = true; } public function get useNativeEvents():Boolean{ return (_useNativeEvents); } public function setLocation(_arg1, _arg2=null):void{ var _local3:Point; if ((_arg1 is Point)){ _local3 = (_arg1 as Point); trace(_local3); location.x = _local3.x; location.y = _local3.y; } else { location.x = Number(_arg1); location.y = Number(_arg2); }; if (!isLocked){ update(); }; } private function keyHandler(_arg1:KeyboardEvent):void{ altKey = _arg1.altKey; ctrlKey = _arg1.ctrlKey; shiftKey = _arg1.shiftKey; } public function unignore(_arg1:DisplayObject):void{ if ((_arg1 in ignoredInstances)){ delete ignoredInstances[_arg1]; }; } public function doubleClick():void{ if (isLocked){ release(); } else { click(); press(); isDoubleClickEvent = true; release(); isDoubleClickEvent = false; }; } public function update():void{ dispatchEvent(new Event(UPDATE, false, false)); } public function ignore(_arg1:DisplayObject):void{ ignoredInstances[_arg1] = true; } public function unlock():void{ isLocked = false; update(); } public function enableEvent(_arg1:String):void{ if ((_arg1 in disabledEvents)){ delete disabledEvents[_arg1]; }; } public function press():void{ updateMouseDown = true; _mouseIsDown = true; if (!isLocked){ update(); }; } public function set useNativeEvents(_arg1:Boolean):void{ if (_arg1 == _useNativeEvents){ return; }; _useNativeEvents = _arg1; if (_useNativeEvents){ eventEvent = VirtualMouseEvent; mouseEventEvent = VirtualMouseMouseEvent; } else { eventEvent = Event; mouseEventEvent = MouseEvent; }; } public function set y(_arg1:Number):void{ location.y = _arg1; if (!isLocked){ update(); }; } public function set stage(_arg1:Stage):void{ var _local2:Boolean; if (_stage){ _local2 = true; _stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyHandler); _stage.removeEventListener(KeyboardEvent.KEY_UP, keyHandler); } else { _local2 = false; }; _stage = _arg1; if (_stage){ _stage.addEventListener(KeyboardEvent.KEY_DOWN, keyHandler); _stage.addEventListener(KeyboardEvent.KEY_UP, keyHandler); target = _stage; if (!_local2){ update(); }; }; } } }//package org.papervision3d.core.utils.virtualmouseSection 81//VirtualMouseEvent (org.papervision3d.core.utils.virtualmouse.VirtualMouseEvent) package org.papervision3d.core.utils.virtualmouse { import flash.events.*; public class VirtualMouseEvent extends Event implements IVirtualMouseEvent { public function VirtualMouseEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){ super(_arg1, _arg2, _arg3); } } }//package org.papervision3d.core.utils.virtualmouseSection 82//VirtualMouseMouseEvent (org.papervision3d.core.utils.virtualmouse.VirtualMouseMouseEvent) package org.papervision3d.core.utils.virtualmouse { import flash.display.*; import flash.events.*; public class VirtualMouseMouseEvent extends MouseEvent implements IVirtualMouseEvent { public function VirtualMouseMouseEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Number=NaN, _arg5:Number=NaN, _arg6:InteractiveObject=null, _arg7:Boolean=false, _arg8:Boolean=false, _arg9:Boolean=false, _arg10:Boolean=false, _arg11:int=0){ super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11); } } }//package org.papervision3d.core.utils.virtualmouseSection 83//InteractiveSceneManager (org.papervision3d.core.utils.InteractiveSceneManager) package org.papervision3d.core.utils { import org.papervision3d.core.proto.*; import org.papervision3d.core.render.data.*; import org.papervision3d.view.*; import org.papervision3d.core.geom.renderables.*; import flash.display.*; import flash.geom.*; import org.papervision3d.objects.*; import com.blitzagency.xray.logger.*; import flash.events.*; import org.papervision3d.core.utils.virtualmouse.*; import org.papervision3d.events.*; import org.papervision3d.materials.*; public class InteractiveSceneManager extends EventDispatcher { public var container:Sprite; public var currentDisplayObject3D:DisplayObject3D; public var viewport:Viewport3D; protected var log:XrayLog; public var currentMaterial:MaterialObject3D; public var debug:Boolean;// = false public var mouse3D:Mouse3D; public var enableOverOut:Boolean;// = true public var virtualMouse:VirtualMouse; public var renderHitData:RenderHitData; public var currentMouseDO3D:DisplayObject3D;// = null public static var MOUSE_IS_DOWN:Boolean = false; public function InteractiveSceneManager(_arg1:Viewport3D){ virtualMouse = new VirtualMouse(); mouse3D = new Mouse3D(); enableOverOut = true; currentMouseDO3D = null; debug = false; log = new XrayLog(); super(); this.viewport = _arg1; this.container = _arg1.containerSprite; init(); } protected function initVirtualMouse():void{ virtualMouse.stage = container.stage; virtualMouse.container = container; } public function init():void{ if (container){ if (container.stage){ initVirtualMouse(); initListeners(); } else { container.addEventListener(Event.ADDED_TO_STAGE, handleAddedToStage); }; }; } public function initListeners():void{ if (viewport.interactive){ container.addEventListener(MouseEvent.MOUSE_DOWN, handleMousePress); container.addEventListener(MouseEvent.MOUSE_UP, handleMouseRelease); container.addEventListener(MouseEvent.CLICK, handleMouseClick); container.stage.addEventListener(MouseEvent.MOUSE_MOVE, handleMouseMove); }; } public function updateRenderHitData():void{ resolveRenderHitData(); currentDisplayObject3D = renderHitData.displayObject3D; currentMaterial = renderHitData.material; manageOverOut(); } protected function handleMouseClick(_arg1:MouseEvent):void{ if ((_arg1 is IVirtualMouseEvent)){ return; }; if (((renderHitData) && (renderHitData.hasHit))){ dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_CLICK, currentDisplayObject3D); }; } protected function handleMouseOut(_arg1:DisplayObject3D):void{ var _local2:MovieMaterial; if (_arg1){ _local2 = (_arg1.material as MovieMaterial); if (_local2){ virtualMouse.exitContainer(); }; }; dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_OUT, _arg1); } protected function manageOverOut():void{ if (!enableOverOut){ return; }; if (((renderHitData) && (renderHitData.hasHit))){ if (((!(currentMouseDO3D)) && (currentDisplayObject3D))){ handleMouseOver(currentDisplayObject3D); currentMouseDO3D = currentDisplayObject3D; } else { if (((currentMouseDO3D) && (!((currentMouseDO3D == currentDisplayObject3D))))){ handleMouseOut(currentMouseDO3D); handleMouseOver(currentDisplayObject3D); currentMouseDO3D = currentDisplayObject3D; }; }; } else { if (currentMouseDO3D != null){ handleMouseOut(currentMouseDO3D); currentMouseDO3D = null; }; }; } protected function dispatchObjectEvent(_arg1:String, _arg2:DisplayObject3D):void{ var _local3:Number; var _local4:Number; if (debug){ log.debug(_arg1, _arg2.name); }; if (((renderHitData) && (renderHitData.hasHit))){ _local3 = (renderHitData.u) ? renderHitData.u : 0; _local4 = (renderHitData.v) ? renderHitData.v : 0; dispatchEvent(new InteractiveScene3DEvent(_arg1, _arg2, container, (renderHitData.renderable as Triangle3D), _local3, _local4)); _arg2.dispatchEvent(new InteractiveScene3DEvent(_arg1, _arg2, container, (renderHitData.renderable as Triangle3D), _local3, _local4)); } else { dispatchEvent(new InteractiveScene3DEvent(_arg1, _arg2, container)); if (_arg2){ _arg2.dispatchEvent(new InteractiveScene3DEvent(_arg1, _arg2, container)); }; }; } protected function handleMouseMove(_arg1:MouseEvent):void{ var _local2:MovieMaterial; updateRenderHitData(); if ((_arg1 is IVirtualMouseEvent)){ return; }; if (((virtualMouse) && (renderHitData))){ _local2 = (currentMaterial as MovieMaterial); if (_local2){ virtualMouse.container = (_local2.movie as Sprite); }; if (virtualMouse.container){ virtualMouse.setLocation(renderHitData.u, renderHitData.v); }; if (((((Mouse3D.enabled) && (renderHitData))) && (renderHitData.hasHit))){ mouse3D.updatePosition(renderHitData); }; dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_MOVE, currentDisplayObject3D); } else { if (((renderHitData) && (renderHitData.hasHit))){ dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_MOVE, currentDisplayObject3D); }; }; } protected function handleMouseOver(_arg1:DisplayObject3D):void{ dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_OVER, _arg1); } protected function resolveRenderHitData():void{ var _local1:Point; _local1 = new Point(); _local1.x = container.mouseX; _local1.y = container.mouseY; renderHitData = (viewport.hitTestPoint2D(_local1) as RenderHitData); } protected function handleMousePress(_arg1:MouseEvent):void{ if ((_arg1 is IVirtualMouseEvent)){ return; }; MOUSE_IS_DOWN = true; if (virtualMouse){ virtualMouse.press(); }; if (((((Mouse3D.enabled) && (renderHitData))) && (!((renderHitData.renderable == null))))){ mouse3D.updatePosition(renderHitData); }; if (((renderHitData) && (renderHitData.hasHit))){ dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_PRESS, currentDisplayObject3D); }; } protected function handleMouseRelease(_arg1:MouseEvent):void{ if ((_arg1 is IVirtualMouseEvent)){ return; }; MOUSE_IS_DOWN = false; if (virtualMouse){ virtualMouse.release(); }; if (((((Mouse3D.enabled) && (renderHitData))) && (!((renderHitData.renderable == null))))){ mouse3D.updatePosition(renderHitData); }; if (((renderHitData) && (renderHitData.hasHit))){ dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_RELEASE, currentDisplayObject3D); }; } protected function handleAddedToStage(_arg1:Event):void{ initVirtualMouse(); initListeners(); } public function destroy():void{ viewport = null; renderHitData = null; currentDisplayObject3D = null; currentMaterial = null; currentMouseDO3D = null; container.removeEventListener(MouseEvent.MOUSE_DOWN, handleMousePress); container.removeEventListener(MouseEvent.MOUSE_UP, handleMouseRelease); container.removeEventListener(MouseEvent.CLICK, handleMouseClick); if (container.stage){ container.stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleMouseMove); }; container = null; } } }//package org.papervision3d.core.utilsSection 84//Mouse3D (org.papervision3d.core.utils.Mouse3D) package org.papervision3d.core.utils { import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import org.papervision3d.core.math.*; import org.papervision3d.objects.*; public class Mouse3D extends DisplayObject3D { private var position:Number3D; private var target:Number3D; public static var enabled:Boolean = false; private static var UP:Number3D = new Number3D(0, 1, 0); public function Mouse3D():void{ position = new Number3D(0, 0, 0); target = new Number3D(); super(); } public function updatePosition(_arg1:RenderHitData):void{ var _local2:Triangle3D; var _local3:Number3D; var _local4:Matrix3D; var _local5:Number3D; var _local6:Number3D; var _local7:Matrix3D; _local2 = (_arg1.renderable as Triangle3D); target.x = _local2.faceNormal.x; target.y = _local2.faceNormal.y; target.z = _local2.faceNormal.z; _local3 = Number3D.sub(target, position); _local3.normalize(); if (_local3.modulo > 0.1){ _local5 = Number3D.cross(_local3, UP); _local5.normalize(); _local6 = Number3D.cross(_local3, _local5); _local6.normalize(); _local7 = this.transform; _local7.n11 = _local5.x; _local7.n21 = _local5.y; _local7.n31 = _local5.z; _local7.n12 = -(_local6.x); _local7.n22 = -(_local6.y); _local7.n32 = -(_local6.z); _local7.n13 = _local3.x; _local7.n23 = _local3.y; _local7.n33 = _local3.z; }; _local4 = Matrix3D.IDENTITY; this.transform = Matrix3D.multiply(_local2.instance.world, _local7); x = _arg1.x; y = _arg1.y; z = _arg1.z; } } }//package org.papervision3d.core.utilsSection 85//StopWatch (org.papervision3d.core.utils.StopWatch) package org.papervision3d.core.utils { import flash.events.*; import flash.utils.*; public class StopWatch extends EventDispatcher { private var startTime:int; private var elapsedTime:int; private var stopTime:int; private var isRunning:Boolean; public function stop():int{ if (isRunning){ stopTime = getTimer(); elapsedTime = (stopTime - startTime); isRunning = false; return (elapsedTime); }; return (0); } public function start():void{ if (!isRunning){ startTime = getTimer(); isRunning = true; }; } public function reset():void{ isRunning = false; } } }//package org.papervision3d.core.utilsSection 86//IViewport3D (org.papervision3d.core.view.IViewport3D) package org.papervision3d.core.view { import org.papervision3d.core.render.data.*; public interface IViewport3D { function updateAfterRender(_arg1:RenderSessionData):void; function updateBeforeRender(_arg1:RenderSessionData):void; } }//package org.papervision3d.core.viewSection 87//InteractiveScene3DEvent (org.papervision3d.events.InteractiveScene3DEvent) package org.papervision3d.events { import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import flash.display.*; import org.papervision3d.objects.*; import flash.events.*; public class InteractiveScene3DEvent extends Event { public var sprite:Sprite;// = null public var displayObject3D:DisplayObject3D;// = null public var face3d:Triangle3D;// = null public var renderHitData:RenderHitData; public var x:Number;// = 0 public var y:Number;// = 0 public static const OBJECT_ADDED:String = "objectAdded"; public static const OBJECT_PRESS:String = "mousePress"; public static const OBJECT_RELEASE:String = "mouseRelease"; public static const OBJECT_CLICK:String = "mouseClick"; public static const OBJECT_RELEASE_OUTSIDE:String = "mouseReleaseOutside"; public static const OBJECT_OUT:String = "mouseOut"; public static const OBJECT_MOVE:String = "mouseMove"; public static const OBJECT_OVER:String = "mouseOver"; public function InteractiveScene3DEvent(_arg1:String, _arg2:DisplayObject3D=null, _arg3:Sprite=null, _arg4:Triangle3D=null, _arg5:Number=0, _arg6:Number=0, _arg7:RenderHitData=null, _arg8:Boolean=false, _arg9:Boolean=false){ displayObject3D = null; sprite = null; face3d = null; x = 0; y = 0; super(_arg1, _arg8, _arg9); this.displayObject3D = _arg2; this.sprite = _arg3; this.face3d = _arg4; this.x = _arg5; this.y = _arg6; this.renderHitData = _arg7; } override public function toString():String{ return (((((((("Type : " + type) + ", DO3D : ") + displayObject3D) + " Sprite : ") + sprite) + " Face : ") + face3d)); } } }//package org.papervision3d.eventsSection 88//RendererEvent (org.papervision3d.events.RendererEvent) package org.papervision3d.events { import org.papervision3d.core.render.data.*; import flash.events.*; public class RendererEvent extends Event { public var renderSessionData:RenderSessionData; public static const PROJECTION_DONE:String = "projectionDone"; public static const RENDER_DONE:String = "renderDone"; public function RendererEvent(_arg1:String, _arg2:RenderSessionData){ super(_arg1); this.renderSessionData = _arg2; } public function clear():void{ renderSessionData = null; } override public function clone():Event{ return (new RendererEvent(type, renderSessionData)); } } }//package org.papervision3d.eventsSection 89//LineMaterial (org.papervision3d.materials.special.LineMaterial) package org.papervision3d.materials.special { import org.papervision3d.core.proto.*; import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import flash.display.*; import org.papervision3d.core.render.draw.*; public class LineMaterial extends MaterialObject3D implements ILineDrawer { public function LineMaterial(_arg1:Number=0xFF0000, _arg2:Number=1){ this.lineColor = _arg1; this.lineAlpha = _arg2; } public function drawLine(_arg1:Line3D, _arg2:Graphics, _arg3:RenderSessionData):void{ _arg2.lineStyle(_arg1.size, lineColor, lineAlpha); _arg2.moveTo(_arg1.v0.vertex3DInstance.x, _arg1.v0.vertex3DInstance.y); if (_arg1.cV){ _arg2.curveTo(_arg1.cV.vertex3DInstance.x, _arg1.cV.vertex3DInstance.y, _arg1.v1.vertex3DInstance.x, _arg1.v1.vertex3DInstance.y); } else { _arg2.lineTo(_arg1.v1.vertex3DInstance.x, _arg1.v1.vertex3DInstance.y); }; _arg2.moveTo(0, 0); _arg2.lineStyle(); } } }//package org.papervision3d.materials.specialSection 90//ParticleMaterial (org.papervision3d.materials.special.ParticleMaterial) package org.papervision3d.materials.special { import org.papervision3d.core.proto.*; import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import flash.display.*; import flash.geom.*; import org.papervision3d.core.render.draw.*; public class ParticleMaterial extends MaterialObject3D implements IParticleDrawer { public var shape:int; public static var SHAPE_SQUARE:int = 0; public static var SHAPE_CIRCLE:int = 1; public function ParticleMaterial(_arg1:Number, _arg2:Number, _arg3:int=0){ this.shape = _arg3; this.fillAlpha = _arg2; this.fillColor = _arg1; } public function updateRenderRect(_arg1:Particle):void{ var _local2:Rectangle; _local2 = _arg1.renderRect; if (_arg1.size == 0){ _local2.width = 1; _local2.height = 1; } else { _local2.width = (_arg1.renderScale * _arg1.size); _local2.height = (_arg1.renderScale * _arg1.size); }; _local2.x = (_arg1.vertex3D.vertex3DInstance.x - (_local2.width / 2)); _local2.y = (_arg1.vertex3D.vertex3DInstance.y - (_local2.width / 2)); } public function drawParticle(_arg1:Particle, _arg2:Graphics, _arg3:RenderSessionData):void{ var _local4:Rectangle; _arg2.beginFill(fillColor, fillAlpha); _local4 = _arg1.renderRect; if (shape == SHAPE_SQUARE){ _arg2.drawRect(_local4.x, _local4.y, _local4.width, _local4.height); } else { if (shape == SHAPE_CIRCLE){ _arg2.drawCircle((_local4.x + (_local4.width / 2)), (_local4.y + (_local4.width / 2)), (_local4.width / 2)); } else { trace("warning - Particle material has no valid shape - Must be ParticleMaterial.SHAPE_SQUARE or ParticleMaterial.SHAPE_CIRCLE"); }; }; _arg2.endFill(); _arg3.renderStatistics.particles++; } } }//package org.papervision3d.materials.specialSection 91//MaterialsList (org.papervision3d.materials.utils.MaterialsList) package org.papervision3d.materials.utils { import org.papervision3d.core.proto.*; import flash.utils.*; public class MaterialsList { protected var _materials:Dictionary; public var materialsByName:Dictionary; private var _materialsTotal:int; public function MaterialsList(_arg1=null):void{ var _local2:String; var _local3:String; super(); this.materialsByName = new Dictionary(true); this._materials = new Dictionary(false); this._materialsTotal = 0; if (_arg1){ if ((_arg1 is Array)){ for (_local2 in _arg1) { this.addMaterial(_arg1[_local2]); }; } else { if ((_arg1 is Object)){ for (_local3 in _arg1) { this.addMaterial(_arg1[_local3], _local3); }; }; }; }; } public function get numMaterials():int{ return (_materialsTotal); } public function addMaterial(_arg1:MaterialObject3D, _arg2:String=null):MaterialObject3D{ _arg2 = ((((_arg2) || (_arg1.name))) || (String(_arg1.id))); this._materials[_arg1] = _arg2; this.materialsByName[_arg2] = _arg1; this._materialsTotal++; return (_arg1); } public function removeMaterial(_arg1:MaterialObject3D):MaterialObject3D{ if (this._materials[_arg1]){ delete this.materialsByName[this._materials[_arg1]]; delete this._materials[_arg1]; _materialsTotal--; }; return (_arg1); } public function toString():String{ var _local1:String; var _local2:MaterialObject3D; _local1 = ""; for each (_local2 in this.materialsByName) { _local1 = (_local1 + (this._materials[_local2] + "\n")); }; return (_local1); } public function removeMaterialByName(_arg1:String):MaterialObject3D{ return (removeMaterial(getMaterialByName(_arg1))); } public function clone():MaterialsList{ var _local1:MaterialsList; var _local2:MaterialObject3D; _local1 = new MaterialsList(); for each (_local2 in this.materialsByName) { _local1.addMaterial(_local2.clone(), this._materials[_local2]); }; return (_local1); } public function getMaterialByName(_arg1:String):MaterialObject3D{ return ((this.materialsByName[_arg1]) ? this.materialsByName[_arg1] : this.materialsByName["all"]); } } }//package org.papervision3d.materials.utilsSection 92//RenderRecStorage (org.papervision3d.materials.utils.RenderRecStorage) package org.papervision3d.materials.utils { import org.papervision3d.core.geom.renderables.*; import flash.geom.*; public class RenderRecStorage { public var mat:Matrix; public var v0:Vertex3DInstance; public var v1:Vertex3DInstance; public var v2:Vertex3DInstance; public function RenderRecStorage(){ v0 = new Vertex3DInstance(); v1 = new Vertex3DInstance(); v2 = new Vertex3DInstance(); mat = new Matrix(); super(); } } }//package org.papervision3d.materials.utilsSection 93//BitmapMaterial (org.papervision3d.materials.BitmapMaterial) package org.papervision3d.materials { import org.papervision3d.core.proto.*; import org.papervision3d.materials.utils.*; import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import flash.display.*; import flash.geom.*; import flash.utils.*; import org.papervision3d.core.render.draw.*; import org.papervision3d.*; import org.papervision3d.core.math.util.*; import org.papervision3d.core.material.*; public class BitmapMaterial extends TriangleMaterial implements ITriangleDrawer { protected var renderRecStorage:Array; protected var mabz:Number; protected var dcay:Number; protected var dsab:Number; protected var tempTriangleMatrix:Matrix; protected var dsbc:Number; private var b2:Number; protected var _precise:Boolean; protected var faz:Number; public var uvMatrices:Dictionary; protected var dsca:Number; protected var ax:Number; protected var az:Number; protected var ay:Number; protected var mcay:Number; protected var bx:Number; protected var by:Number; protected var bz:Number; protected var fbz:Number; protected var fcz:Number; public var minimumRenderSize:Number;// = 4 protected var mcaz:Number; private var c2:Number; protected var mcax:Number; protected var dbcx:Number; protected var cx:Number; protected var cy:Number; protected var cz:Number; private var d2:Number; protected var dbcy:Number; protected var dabx:Number; protected var _perPixelPrecision:int;// = 8 protected var daby:Number; private var x0:Number; private var x1:Number; private var x2:Number; protected var mbcy:Number; protected var mbcz:Number; private var y0:Number; private var y1:Number; private var y2:Number; protected var _texture:Object; protected var focus:Number;// = 200 protected var maby:Number; protected var mabx:Number; protected var dcax:Number; protected var mbcx:Number; private var a2:Number; protected var _precision:int;// = 8 protected static const DEFAULT_FOCUS:Number = 200; protected static var _triMatrix:Matrix = new Matrix(); protected static var _triMap:Matrix; public static var AUTO_MIP_MAPPING:Boolean = false; public static var MIP_MAP_DEPTH:Number = 8; protected static var hitRect:Rectangle = new Rectangle(); protected static var _localMatrix:Matrix = new Matrix(); public function BitmapMaterial(_arg1:BitmapData=null, _arg2:Boolean=false){ focus = 200; _precision = 8; _perPixelPrecision = 8; minimumRenderSize = 4; uvMatrices = new Dictionary(); tempTriangleMatrix = new Matrix(); super(); if (_arg1){ texture = _arg1; }; this.precise = _arg2; createRenderRecStorage(); } public function transformUV(_arg1:Triangle3D):Matrix{ var _local2:Array; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Matrix; var _local16:Matrix; if (!_arg1.uv){ Papervision3D.log("MaterialObject3D: transformUV() uv not found!"); } else { if (bitmap){ _local2 = _arg1.uv; _local3 = (bitmap.width * maxU); _local4 = (bitmap.height * maxV); _local5 = (_local3 * _arg1.uv0.u); _local6 = (_local4 * (1 - _arg1.uv0.v)); _local7 = (_local3 * _arg1.uv1.u); _local8 = (_local4 * (1 - _arg1.uv1.v)); _local9 = (_local3 * _arg1.uv2.u); _local10 = (_local4 * (1 - _arg1.uv2.v)); if ((((((_local5 == _local7)) && ((_local6 == _local8)))) || ((((_local5 == _local9)) && ((_local6 == _local10)))))){ _local5 = (_local5 - ((_local5)>0.05) ? 0.05 : -0.05); _local6 = (_local6 - ((_local6)>0.07) ? 0.07 : -0.07); }; if ((((_local9 == _local7)) && ((_local10 == _local8)))){ _local9 = (_local9 - ((_local9)>0.05) ? 0.04 : -0.04); _local10 = (_local10 - ((_local10)>0.06) ? 0.06 : -0.06); }; _local11 = (_local7 - _local5); _local12 = (_local8 - _local6); _local13 = (_local9 - _local5); _local14 = (_local10 - _local6); _local15 = new Matrix(_local11, _local12, _local13, _local14, _local5, _local6); if (Papervision3D.useRIGHTHANDED){ _local15.scale(-1, 1); _local15.translate(_local3, 0); }; _local15.invert(); _local16 = (uvMatrices[_arg1]) ? uvMatrices[_arg1] : uvMatrices[_arg1] = _local15.clone(); _local16.a = _local15.a; _local16.b = _local15.b; _local16.c = _local15.c; _local16.d = _local15.d; _local16.tx = _local15.tx; _local16.ty = _local15.ty; } else { Papervision3D.log("MaterialObject3D: transformUV() material.bitmap not found!"); }; }; return (_local16); } protected function renderRec(_arg1:Graphics, _arg2:Matrix, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance, _arg5:Vertex3DInstance, _arg6:Number, _arg7:RenderSessionData, _arg8:BitmapData):void{ var _local9:int; var _local10:RenderRecStorage; var _local11:Matrix; var _local12:Number; az = _arg3.z; bz = _arg4.z; cz = _arg5.z; if ((((((az <= 0)) && ((bz <= 0)))) && ((cz <= 0)))){ return; }; cx = _arg5.x; cy = _arg5.y; bx = _arg4.x; by = _arg4.y; ax = _arg3.x; ay = _arg3.y; if (_arg7.viewPort.cullingRectangle){ hitRect.x = Math.min(cx, Math.min(bx, ax)); hitRect.width = (Math.max(cx, Math.max(bx, ax)) + Math.abs(hitRect.x)); hitRect.y = Math.min(cy, Math.min(by, ay)); hitRect.height = (Math.max(cy, Math.max(by, ay)) + Math.abs(hitRect.y)); if (!FastRectangleTools.intersects(hitRect, _arg7.viewPort.cullingRectangle)){ return; }; }; if ((((((((_arg6 >= 100)) || ((hitRect.width < minimumRenderSize)))) || ((hitRect.height < minimumRenderSize)))) || ((focus == Infinity)))){ renderTriangleBitmap(_arg1, _arg2, _arg3, _arg4, _arg5, smooth, tiled, _arg8); _arg7.renderStatistics.triangles++; return; }; faz = (focus + az); fbz = (focus + bz); fcz = (focus + cz); mabz = (2 / (faz + fbz)); mbcz = (2 / (fbz + fcz)); mcaz = (2 / (fcz + faz)); mabx = (((ax * faz) + (bx * fbz)) * mabz); maby = (((ay * faz) + (by * fbz)) * mabz); mbcx = (((bx * fbz) + (cx * fcz)) * mbcz); mbcy = (((by * fbz) + (cy * fcz)) * mbcz); mcax = (((cx * fcz) + (ax * faz)) * mcaz); mcay = (((cy * fcz) + (ay * faz)) * mcaz); dabx = ((ax + bx) - mabx); daby = ((ay + by) - maby); dbcx = ((bx + cx) - mbcx); dbcy = ((by + cy) - mbcy); dcax = ((cx + ax) - mcax); dcay = ((cy + ay) - mcay); dsab = ((dabx * dabx) + (daby * daby)); dsbc = ((dbcx * dbcx) + (dbcy * dbcy)); dsca = ((dcax * dcax) + (dcay * dcay)); _local9 = (_arg6 + 1); _local10 = RenderRecStorage(renderRecStorage[int(_arg6)]); _local11 = _local10.mat; if ((((((dsab <= _precision)) && ((dsca <= _precision)))) && ((dsbc <= _precision)))){ renderTriangleBitmap(_arg1, _arg2, _arg3, _arg4, _arg5, smooth, tiled, _arg8); _arg7.renderStatistics.triangles++; return; }; if ((((((dsab > _precision)) && ((dsca > _precision)))) && ((dsbc > _precision)))){ _local11.a = (_arg2.a * 2); _local11.b = (_arg2.b * 2); _local11.c = (_arg2.c * 2); _local11.d = (_arg2.d * 2); _local11.tx = (_arg2.tx * 2); _local11.ty = (_arg2.ty * 2); _local10.v0.x = (mabx * 0.5); _local10.v0.y = (maby * 0.5); _local10.v0.z = ((az + bz) * 0.5); _local10.v1.x = (mbcx * 0.5); _local10.v1.y = (mbcy * 0.5); _local10.v1.z = ((bz + cz) * 0.5); _local10.v2.x = (mcax * 0.5); _local10.v2.y = (mcay * 0.5); _local10.v2.z = ((cz + az) * 0.5); renderRec(_arg1, _local11, _arg3, _local10.v0, _local10.v2, _local9, _arg7, _arg8); _local11.tx = (_local11.tx - 1); renderRec(_arg1, _local11, _local10.v0, _arg4, _local10.v1, _local9, _arg7, _arg8); _local11.ty = (_local11.ty - 1); _local11.tx = (_arg2.tx * 2); renderRec(_arg1, _local11, _local10.v2, _local10.v1, _arg5, _local9, _arg7, _arg8); _local11.a = (-(_arg2.a) * 2); _local11.b = (-(_arg2.b) * 2); _local11.c = (-(_arg2.c) * 2); _local11.d = (-(_arg2.d) * 2); _local11.tx = ((-(_arg2.tx) * 2) + 1); _local11.ty = ((-(_arg2.ty) * 2) + 1); renderRec(_arg1, _local11, _local10.v1, _local10.v2, _local10.v0, _local9, _arg7, _arg8); return; }; _local12 = Math.max(dsab, Math.max(dsca, dsbc)); if (dsab == _local12){ _local11.a = (_arg2.a * 2); _local11.b = _arg2.b; _local11.c = (_arg2.c * 2); _local11.d = _arg2.d; _local11.tx = (_arg2.tx * 2); _local11.ty = _arg2.ty; _local10.v0.x = (mabx * 0.5); _local10.v0.y = (maby * 0.5); _local10.v0.z = ((az + bz) * 0.5); renderRec(_arg1, _local11, _arg3, _local10.v0, _arg5, _local9, _arg7, _arg8); _local11.a = ((_arg2.a * 2) + _arg2.b); _local11.c = ((2 * _arg2.c) + _arg2.d); _local11.tx = (((_arg2.tx * 2) + _arg2.ty) - 1); renderRec(_arg1, _local11, _local10.v0, _arg4, _arg5, _local9, _arg7, _arg8); return; }; if (dsca == _local12){ _local11.a = _arg2.a; _local11.b = (_arg2.b * 2); _local11.c = _arg2.c; _local11.d = (_arg2.d * 2); _local11.tx = _arg2.tx; _local11.ty = (_arg2.ty * 2); _local10.v2.x = (mcax * 0.5); _local10.v2.y = (mcay * 0.5); _local10.v2.z = ((cz + az) * 0.5); renderRec(_arg1, _local11, _arg3, _arg4, _local10.v2, _local9, _arg7, _arg8); _local11.b = (_local11.b + _arg2.a); _local11.d = (_local11.d + _arg2.c); _local11.ty = (_local11.ty + (_arg2.tx - 1)); renderRec(_arg1, _local11, _local10.v2, _arg4, _arg5, _local9, _arg7, _arg8); return; }; _local11.a = (_arg2.a - _arg2.b); _local11.b = (_arg2.b * 2); _local11.c = (_arg2.c - _arg2.d); _local11.d = (_arg2.d * 2); _local11.tx = (_arg2.tx - _arg2.ty); _local11.ty = (_arg2.ty * 2); _local10.v1.x = (mbcx * 0.5); _local10.v1.y = (mbcy * 0.5); _local10.v1.z = ((bz + cz) * 0.5); renderRec(_arg1, _local11, _arg3, _arg4, _local10.v1, _local9, _arg7, _arg8); _local11.a = (_arg2.a * 2); _local11.b = (_arg2.b - _arg2.a); _local11.c = (_arg2.c * 2); _local11.d = (_arg2.d - _arg2.c); _local11.tx = (_arg2.tx * 2); _local11.ty = (_arg2.ty - _arg2.tx); renderRec(_arg1, _local11, _arg3, _local10.v1, _arg5, _local9, _arg7, _arg8); } protected function createRenderRecStorage():void{ var _local1:int; this.renderRecStorage = new Array(); _local1 = 0; while (_local1 <= 100) { this.renderRecStorage[_local1] = new RenderRecStorage(); _local1++; }; } public function resetUVS():void{ uvMatrices = new Dictionary(false); } public function get texture():Object{ return (this._texture); } public function set pixelPrecision(_arg1:int):void{ _precision = ((_arg1 * _arg1) * 1.4); _perPixelPrecision = _arg1; } protected function correctBitmap(_arg1:BitmapData):BitmapData{ var _local2:BitmapData; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Boolean; _local3 = (1 << MIP_MAP_DEPTH); _local4 = (_arg1.width / _local3); _local4 = ((_local4 == uint(_local4))) ? _local4 : (uint(_local4) + 1); _local5 = (_arg1.height / _local3); _local5 = ((_local5 == uint(_local5))) ? _local5 : (uint(_local5) + 1); _local6 = (_local3 * _local4); _local7 = (_local3 * _local5); _local8 = true; if (_local6 > 2880){ _local6 = _arg1.width; _local8 = false; }; if (_local7 > 2880){ _local7 = _arg1.height; _local8 = false; }; if (!_local8){ Papervision3D.log((("Material " + this.name) + ": Texture too big for mip mapping. Resizing recommended for better performance and quality.")); }; if (((_arg1) && (((!(((_arg1.width % _local3) == 0))) || (!(((_arg1.height % _local3) == 0))))))){ _local2 = new BitmapData(_local6, _local7, _arg1.transparent, 0); widthOffset = _arg1.width; heightOffset = _arg1.height; this.maxU = (_arg1.width / _local6); this.maxV = (_arg1.height / _local7); _local2.draw(_arg1); extendBitmapEdges(_local2, _arg1.width, _arg1.height); } else { this.maxU = (this.maxV = 1); _local2 = _arg1; }; return (_local2); } protected function createBitmap(_arg1:BitmapData):BitmapData{ var _local2:BitmapData; resetMapping(); if (AUTO_MIP_MAPPING){ _local2 = correctBitmap(_arg1); } else { this.maxU = (this.maxV = 1); _local2 = _arg1; }; return (_local2); } public function get precise():Boolean{ return (_precise); } override public function clone():MaterialObject3D{ var _local1:MaterialObject3D; _local1 = super.clone(); _local1.maxU = this.maxU; _local1.maxV = this.maxV; return (_local1); } public function set texture(_arg1:Object):void{ if ((_arg1 is BitmapData) == false){ Papervision3D.log("Error: BitmapMaterial.texture requires a BitmapData object for the texture"); return; }; bitmap = createBitmap(BitmapData(_arg1)); _texture = _arg1; } override public function toString():String{ return (((((("Texture:" + this.texture) + " lineColor:") + this.lineColor) + " lineAlpha:") + this.lineAlpha)); } override public function copy(_arg1:MaterialObject3D):void{ super.copy(_arg1); this.maxU = _arg1.maxU; this.maxV = _arg1.maxV; } override public function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void{ if (!_precise){ if (lineAlpha){ _arg2.lineStyle(lineThickness, lineColor, lineAlpha); }; if (bitmap){ _triMap = (_arg5) ? _arg5 : ((uvMatrices[_arg1]) || (transformUV(_arg1))); x0 = _arg1.v0.vertex3DInstance.x; y0 = _arg1.v0.vertex3DInstance.y; x1 = _arg1.v1.vertex3DInstance.x; y1 = _arg1.v1.vertex3DInstance.y; x2 = _arg1.v2.vertex3DInstance.x; y2 = _arg1.v2.vertex3DInstance.y; _triMatrix.a = (x1 - x0); _triMatrix.b = (y1 - y0); _triMatrix.c = (x2 - x0); _triMatrix.d = (y2 - y0); _triMatrix.tx = x0; _triMatrix.ty = y0; _localMatrix.a = _triMap.a; _localMatrix.b = _triMap.b; _localMatrix.c = _triMap.c; _localMatrix.d = _triMap.d; _localMatrix.tx = _triMap.tx; _localMatrix.ty = _triMap.ty; _localMatrix.concat(_triMatrix); _arg2.beginBitmapFill((_arg4) ? _arg4 : bitmap, _localMatrix, tiled, smooth); }; _arg2.moveTo(x0, y0); _arg2.lineTo(x1, y1); _arg2.lineTo(x2, y2); _arg2.lineTo(x0, y0); if (bitmap){ _arg2.endFill(); }; if (lineAlpha){ _arg2.lineStyle(); }; _arg3.renderStatistics.triangles++; } else { if (bitmap){ _triMap = (_arg5) ? _arg5 : ((uvMatrices[_arg1]) || (transformUV(_arg1))); focus = _arg3.camera.focus; renderRec(_arg2, _triMap, _arg1.v0.vertex3DInstance, _arg1.v1.vertex3DInstance, _arg1.v2.vertex3DInstance, 0, _arg3, (_arg4) ? _arg4 : bitmap); }; }; } public function resetMapping():void{ uvMatrices = new Dictionary(); } public function get precision():int{ return (_precision); } public function get pixelPrecision():int{ return (_perPixelPrecision); } public function renderTriangleBitmap(_arg1:Graphics, _arg2:Matrix, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance, _arg5:Vertex3DInstance, _arg6:Boolean, _arg7:Boolean, _arg8:BitmapData):void{ a2 = (_arg4.x - _arg3.x); b2 = (_arg4.y - _arg3.y); c2 = (_arg5.x - _arg3.x); d2 = (_arg5.y - _arg3.y); tempTriangleMatrix.a = ((_arg2.a * a2) + (_arg2.b * c2)); tempTriangleMatrix.b = ((_arg2.a * b2) + (_arg2.b * d2)); tempTriangleMatrix.c = ((_arg2.c * a2) + (_arg2.d * c2)); tempTriangleMatrix.d = ((_arg2.c * b2) + (_arg2.d * d2)); tempTriangleMatrix.tx = (((_arg2.tx * a2) + (_arg2.ty * c2)) + _arg3.x); tempTriangleMatrix.ty = (((_arg2.tx * b2) + (_arg2.ty * d2)) + _arg3.y); _arg1.beginBitmapFill(_arg8, tempTriangleMatrix, _arg7, _arg6); _arg1.moveTo(_arg3.x, _arg3.y); _arg1.lineTo(_arg4.x, _arg4.y); _arg1.lineTo(_arg5.x, _arg5.y); _arg1.endFill(); } public function set precise(_arg1:Boolean):void{ _precise = _arg1; } protected function extendBitmapEdges(_arg1:BitmapData, _arg2:Number, _arg3:Number):void{ var _local4:Rectangle; var _local5:Point; var _local6:int; _local4 = new Rectangle(); _local5 = new Point(); if (_arg1.width > _arg2){ _local4.x = (_arg2 - 1); _local4.y = 0; _local4.width = 1; _local4.height = _arg3; _local5.y = 0; _local6 = _arg2; while (_local6 < _arg1.width) { _local5.x = _local6; _arg1.copyPixels(_arg1, _local4, _local5); _local6++; }; }; if (_arg1.height > _arg3){ _local4.x = 0; _local4.y = (_arg3 - 1); _local4.width = _arg1.width; _local4.height = 1; _local5.x = 0; _local6 = _arg3; while (_local6 < _arg1.height) { _local5.y = _local6; _arg1.copyPixels(_arg1, _local4, _local5); _local6++; }; }; } override public function destroy():void{ super.destroy(); if (uvMatrices){ uvMatrices = null; }; if (bitmap){ bitmap.dispose(); }; this.renderRecStorage = null; } public function set precision(_arg1:int):void{ _precision = _arg1; } } }//package org.papervision3d.materialsSection 94//MovieMaterial (org.papervision3d.materials.MovieMaterial) package org.papervision3d.materials { import org.papervision3d.core.render.data.*; import flash.display.*; import flash.geom.*; import org.papervision3d.core.render.material.*; import org.papervision3d.core.render.draw.*; import org.papervision3d.*; public class MovieMaterial extends BitmapMaterial implements ITriangleDrawer, IUpdateBeforeMaterial { public var movieTransparent:Boolean; private var quality:String; private var movieAnimated:Boolean; private var autoClipRect:Rectangle; private var stage:Stage; public var movie:DisplayObject; public var allowAutoResize:Boolean;// = true private var userClipRect:Rectangle; public function MovieMaterial(_arg1:DisplayObject=null, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Boolean=false, _arg5:Rectangle=null){ allowAutoResize = true; super(); movieTransparent = _arg2; this.animated = _arg3; this.precise = _arg4; userClipRect = _arg5; if (_arg1){ texture = _arg1; }; } public function get rect():Rectangle{ var _local1:Rectangle; _local1 = ((userClipRect) || (autoClipRect)); if (((!(_local1)) && (movie))){ _local1 = movie.getBounds(movie); }; return (_local1); } public function drawBitmap():void{ var _local1:Rectangle; var _local2:Matrix; var _local3:String; bitmap.fillRect(bitmap.rect, fillColor); if (((stage) && (quality))){ _local3 = stage.quality; stage.quality = quality; }; _local1 = rect; _local2 = new Matrix(1, 0, 0, 1, -(_local1.x), -(_local1.y)); bitmap.draw(movie, _local2, movie.transform.colorTransform, null); if (!userClipRect){ autoClipRect = movie.getBounds(movie); }; if (((stage) && (quality))){ stage.quality = _local3; }; } override public function get texture():Object{ return (this._texture); } public function set animated(_arg1:Boolean):void{ movieAnimated = _arg1; } public function setQuality(_arg1:String, _arg2:Stage, _arg3:Boolean=true):void{ this.quality = _arg1; this.stage = _arg2; if (_arg3){ createBitmapFromSprite(movie); }; } override public function set texture(_arg1:Object):void{ if ((_arg1 is DisplayObject) == false){ Papervision3D.log("Error: MovieMaterial.texture requires a Sprite to be passed as the object"); return; }; bitmap = createBitmapFromSprite(DisplayObject(_arg1)); _texture = _arg1; } protected function initBitmap(_arg1:DisplayObject):void{ if (bitmap){ bitmap.dispose(); }; if (userClipRect){ bitmap = new BitmapData(int((userClipRect.width + 0.5)), int((userClipRect.height + 0.5)), movieTransparent, fillColor); } else { if ((((_arg1.width == 0)) || ((_arg1.height == 0)))){ bitmap = new BitmapData(0x0100, 0x0100, movieTransparent, fillColor); } else { bitmap = new BitmapData(int((_arg1.width + 0.5)), int((_arg1.height + 0.5)), movieTransparent, fillColor); }; }; } public function updateBeforeRender(_arg1:RenderSessionData):void{ var _local2:int; var _local3:int; var _local4:Boolean; if (movieAnimated){ if (userClipRect){ _local2 = int((userClipRect.width + 0.5)); _local3 = int((userClipRect.height + 0.5)); } else { _local2 = int((movie.width + 0.5)); _local3 = int((movie.height + 0.5)); }; if (((allowAutoResize) && (((!((_local2 == bitmap.width))) || (!((_local3 == bitmap.height))))))){ initBitmap(movie); _local4 = true; }; drawBitmap(); if (_local4){ bitmap = super.createBitmap(bitmap); }; }; } public function get animated():Boolean{ return (movieAnimated); } public function set rect(_arg1:Rectangle):void{ userClipRect = _arg1; createBitmapFromSprite(movie); } protected function createBitmapFromSprite(_arg1:DisplayObject):BitmapData{ movie = _arg1; initBitmap(movie); drawBitmap(); bitmap = super.createBitmap(bitmap); return (bitmap); } } }//package org.papervision3d.materialsSection 95//WireframeMaterial (org.papervision3d.materials.WireframeMaterial) package org.papervision3d.materials { import org.papervision3d.core.render.data.*; import org.papervision3d.core.geom.renderables.*; import flash.display.*; import flash.geom.*; import org.papervision3d.core.render.draw.*; import org.papervision3d.core.material.*; public class WireframeMaterial extends TriangleMaterial implements ITriangleDrawer { public function WireframeMaterial(_arg1:Number=0xFF00FF, _arg2:Number=100, _arg3:Number=0){ this.lineColor = _arg1; this.lineAlpha = _arg2; this.lineThickness = _arg3; this.doubleSided = false; } override public function toString():String{ return (((("WireframeMaterial - color:" + this.lineColor) + " alpha:") + this.lineAlpha)); } override public function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void{ var _local6:Number; var _local7:Number; _local6 = _arg1.v0.vertex3DInstance.x; _local7 = _arg1.v0.vertex3DInstance.y; if (lineAlpha){ _arg2.lineStyle(lineThickness, lineColor, lineAlpha); _arg2.moveTo(_local6, _local7); _arg2.lineTo(_arg1.v1.vertex3DInstance.x, _arg1.v1.vertex3DInstance.y); _arg2.lineTo(_arg1.v2.vertex3DInstance.x, _arg1.v2.vertex3DInstance.y); _arg2.lineTo(_local6, _local7); _arg2.lineStyle(); _arg3.renderStatistics.triangles++; }; } } }//package org.papervision3d.materialsSection 96//Cube (org.papervision3d.objects.primitives.Cube) package org.papervision3d.objects.primitives { import org.papervision3d.core.proto.*; import org.papervision3d.materials.utils.*; import org.papervision3d.core.geom.renderables.*; import org.papervision3d.core.math.*; import org.papervision3d.core.geom.*; import org.papervision3d.*; public class Cube extends TriangleMesh3D { private var insideFaces:int; public var segments:Number3D; private var excludeFaces:int; public static var ALL:int = (((((FRONT + BACK) + RIGHT) + LEFT) + TOP) + BOTTOM); public static var LEFT:int = 8; public static var FRONT:int = 1; public static var BOTTOM:int = 32; public static var TOP:int = 16; public static var BACK:int = 2; public static var NONE:int = 0; public static var RIGHT:int = 4; public function Cube(_arg1:MaterialsList, _arg2:Number=500, _arg3:Number=500, _arg4:Number=500, _arg5:int=1, _arg6:int=1, _arg7:int=1, _arg8:int=0, _arg9:int=0){ super(_arg1.getMaterialByName("all"), new Array(), new Array(), null); this.materials = _arg1; this.insideFaces = _arg8; this.excludeFaces = _arg9; segments = new Number3D(_arg5, _arg6, _arg7); buildCube(_arg2, _arg4, _arg3); } private function buildPlane(_arg1:String, _arg2:String, _arg3:String, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false):void{ var _local8:MaterialObject3D; var _local9:String; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Array; var _local16:Array; var _local17:Array; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:int; var _local23:NumberUV; var _local24:NumberUV; var _local25:NumberUV; var _local26:int; var _local27:Vertex3D; var _local28:Vertex3D; var _local29:Vertex3D; var _local30:Vertex3D; _local8 = materials.getMaterialByName(_arg1); if (!_local8){ _local8 = materials.getMaterialByName("all"); if (!_local8){ Papervision3D.log("Cube: Required material not found in given materials list. Supported materials are: front, back, right, left, top, bottom & all."); return; }; }; _local8.registerObject(this); if ((((((_arg2 == "x")) && ((_arg3 == "y")))) || ((((_arg2 == "y")) && ((_arg3 == "x")))))){ _local9 = "z"; } else { if ((((((_arg2 == "x")) && ((_arg3 == "z")))) || ((((_arg2 == "z")) && ((_arg3 == "x")))))){ _local9 = "y"; } else { if ((((((_arg2 == "z")) && ((_arg3 == "y")))) || ((((_arg2 == "y")) && ((_arg3 == "z")))))){ _local9 = "x"; }; }; }; _local10 = (_arg7) ? -1 : 1; _local11 = this.segments[_arg2]; _local12 = this.segments[_arg3]; _local13 = (_local11 + 1); _local14 = (_local12 + 1); _local15 = this.geometry.vertices; _local16 = this.geometry.faces; _local17 = new Array(); _local18 = (_arg4 / 2); _local19 = (_arg5 / 2); _local20 = (_arg4 / _local11); _local21 = (_arg5 / _local12); _local22 = 0; while (_local22 < _local13) { _local26 = 0; while (_local26 < _local14) { _local27 = new Vertex3D(); _local27[_arg2] = (((_local22 * _local20) - _local18) * _local10); _local27[_arg3] = ((_local26 * _local21) - _local19); _local27[_local9] = _arg6; _local15.push(_local27); _local17.push(_local27); _local26++; }; _local22++; }; _local22 = 0; while (_local22 < _local11) { _local26 = 0; while (_local26 < _local12) { _local28 = _local17[((_local22 * _local14) + _local26)]; _local29 = _local17[((_local22 * _local14) + (_local26 + 1))]; _local30 = _local17[(((_local22 + 1) * _local14) + _local26)]; _local23 = new NumberUV((_local22 / _local11), (_local26 / _local12)); _local24 = new NumberUV((_local22 / _local11), ((_local26 + 1) / _local12)); _local25 = new NumberUV(((_local22 + 1) / _local11), (_local26 / _local12)); _local16.push(new Triangle3D(this, [_local28, _local30, _local29], _local8, [_local23, _local25, _local24])); _local28 = _local17[(((_local22 + 1) * _local14) + (_local26 + 1))]; _local29 = _local17[(((_local22 + 1) * _local14) + _local26)]; _local30 = _local17[((_local22 * _local14) + (_local26 + 1))]; _local23 = new NumberUV(((_local22 + 1) / _local11), ((_local26 + 1) / _local12)); _local24 = new NumberUV(((_local22 + 1) / _local11), (_local26 / _local12)); _local25 = new NumberUV((_local22 / _local11), ((_local26 + 1) / _local12)); _local16.push(new Triangle3D(this, [_local29, _local28, _local30], _local8, [_local24, _local23, _local25])); _local26++; }; _local22++; }; } private function buildCube(_arg1:Number, _arg2:Number, _arg3:Number):void{ var _local4:Number; var _local5:Number; var _local6:Number; _local4 = (_arg1 / 2); _local5 = (_arg2 / 2); _local6 = (_arg3 / 2); if (!(excludeFaces & FRONT)){ buildPlane("front", "x", "y", _arg1, _arg2, _local6, !(Boolean((insideFaces & FRONT)))); }; if (!(excludeFaces & BACK)){ buildPlane("back", "x", "y", _arg1, _arg2, -(_local6), Boolean((insideFaces & BACK))); }; if (!(excludeFaces & RIGHT)){ buildPlane("right", "z", "y", _arg3, _arg2, _local4, Boolean((insideFaces & RIGHT))); }; if (!(excludeFaces & LEFT)){ buildPlane("left", "z", "y", _arg3, _arg2, -(_local4), !(Boolean((insideFaces & LEFT)))); }; if (!(excludeFaces & TOP)){ buildPlane("top", "x", "z", _arg1, _arg3, _local5, Boolean((insideFaces & TOP))); }; if (!(excludeFaces & BOTTOM)){ buildPlane("bottom", "x", "z", _arg1, _arg3, -(_local5), !(Boolean((insideFaces & BOTTOM)))); }; mergeVertices(); this.geometry.ready = true; if (Papervision3D.useRIGHTHANDED){ this.geometry.flipFaces(); }; } public function destroy():void{ var _local1:MaterialObject3D; for each (_local1 in materials) { _local1.unregisterObject(this); }; } } }//package org.papervision3d.objects.primitivesSection 97//DisplayObject3D (org.papervision3d.objects.DisplayObject3D) package org.papervision3d.objects { import org.papervision3d.core.proto.*; import org.papervision3d.materials.utils.*; import org.papervision3d.core.render.data.*; import org.papervision3d.view.*; import flash.display.*; import org.papervision3d.core.math.*; import org.papervision3d.view.layer.*; import org.papervision3d.core.data.*; import org.papervision3d.core.culling.*; import org.papervision3d.*; public class DisplayObject3D extends DisplayObjectContainer3D { public var filters:Array; public var extra:Object; public var frustumTestMethod:int;// = 0 private var _rot:Quaternion; public var id:int; private var _rotationY:Number; private var _rotationZ:Number; public var meshSort:uint;// = 1 public var materials:MaterialsList; private var _rotationX:Number; private var _qYaw:Quaternion; private var _xAxis:Number3D; private var _zAxis:Number3D; private var _scaleDirty:Boolean;// = false private var _tempScale:Number3D; private var _autoCalcScreenCoords:Boolean;// = false private var _numClones:uint;// = 0 public var alpha:Number;// = 1 public var screen:Number3D; private var _scaleX:Number; public var screenZ:Number; private var _scaleZ:Number; public var geometry:GeometryObject3D; protected var _userData:UserData; private var _scaleY:Number; public var visible:Boolean; private var _qPitch:Quaternion; protected var _useOwnContainer:Boolean;// = false public var name:String; public var transform:Matrix3D; private var _position:Number3D; public var container:ViewportLayer; public var culled:Boolean; public var world:Matrix3D; public var blendMode:String;// = "normal" private var _qRoll:Quaternion; private var _localRotationZ:Number;// = 0 protected var _scene:SceneObject3D;// = null private var _localRotationX:Number;// = 0 private var _material:MaterialObject3D; public var view:Matrix3D; private var _localRotationY:Number;// = 0 public var parent:DisplayObjectContainer3D; private var _target:Number3D; public var faces:Array; private var _yAxis:Number3D; public var flipLightDirection:Boolean;// = false private var _rotation:Number3D; protected var _sorted:Array; protected var _transformDirty:Boolean;// = false private var _rotationDirty:Boolean;// = false public var parentContainer:DisplayObject3D; public static const MESH_SORT_CENTER:uint = 1; private static const LEFT:Number3D = new Number3D(-1, 0, 0); public static const MESH_SORT_CLOSE:uint = 3; private static const BACKWARD:Number3D = new Number3D(0, 0, -1); private static const FORWARD:Number3D = new Number3D(0, 0, 1); public static const MESH_SORT_FAR:uint = 2; private static const DOWN:Number3D = new Number3D(0, -1, 0); private static const UP:Number3D = new Number3D(0, 1, 0); private static const RIGHT:Number3D = new Number3D(1, 0, 0); private static var entry_count:uint = 0; private static var _newID:int = 0; private static var _tempMatrix:Matrix3D = Matrix3D.IDENTITY; public static var sortedArray:Array = new Array(); public static var faceLevelMode:Boolean; private static var _tempQuat:Quaternion = new Quaternion(); private static var toRADIANS:Number = 0.0174532925199433; private static var toDEGREES:Number = 57.2957795130823; public function DisplayObject3D(_arg1:String=null, _arg2:GeometryObject3D=null):void{ var _local3:Number; faces = new Array(); meshSort = MESH_SORT_CENTER; alpha = 1; blendMode = BlendMode.NORMAL; filters = []; flipLightDirection = false; frustumTestMethod = FrustumTestMethod.BOUNDING_SPHERE; screen = new Number3D(); _transformDirty = false; _useOwnContainer = false; _scene = null; _position = Number3D.ZERO; _target = Number3D.ZERO; _zAxis = Number3D.ZERO; _xAxis = Number3D.ZERO; _yAxis = Number3D.ZERO; _rotation = Number3D.ZERO; _rotationDirty = false; _scaleDirty = false; _numClones = 0; _rot = new Quaternion(); _qPitch = new Quaternion(); _qYaw = new Quaternion(); _qRoll = new Quaternion(); _localRotationX = 0; _localRotationY = 0; _localRotationZ = 0; _autoCalcScreenCoords = false; super(); if (_arg1 != null){ Papervision3D.log(("DisplayObject3D: " + _arg1)); }; this.culled = false; this.transform = Matrix3D.IDENTITY; this.world = Matrix3D.IDENTITY; this.view = Matrix3D.IDENTITY; this.x = 0; this.y = 0; this.z = 0; rotationX = 0; rotationY = 0; rotationZ = 0; _localRotationX = (_localRotationY = (_localRotationZ = 0)); _local3 = (Papervision3D.usePERCENT) ? 100 : 1; scaleX = _local3; scaleY = _local3; scaleZ = _local3; _tempScale = new Number3D(); this.visible = true; this.id = _newID++; this.name = ((_arg1) || (String(this.id))); _numClones = 0; if (_arg2){ addGeometry(_arg2); }; } public function moveDown(_arg1:Number):void{ translate(_arg1, DOWN); } public function project(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{ var _local3:Number; var _local4:Number; var _local5:DisplayObject3D; if (this._transformDirty){ updateTransform(); }; this.world.calculateMultiply(_arg1.world, this.transform); if (_arg2.camera.culler){ if (this === _arg2.camera){ this.culled = true; } else { this.culled = (_arg2.camera.culler.testObject(this) < 0); }; if (this.culled){ _arg2.renderStatistics.culledObjects++; return (0); }; }; if (_arg1 !== _arg2.camera){ if (_arg2.camera.useProjectionMatrix){ this.view.calculateMultiply4x4(_arg1.view, this.transform); } else { this.view.calculateMultiply(_arg1.view, this.transform); }; } else { if (_arg2.camera.useProjectionMatrix){ this.view.calculateMultiply4x4(_arg2.camera.eye, this.transform); } else { this.view.calculateMultiply(_arg2.camera.eye, this.transform); }; }; if (_autoCalcScreenCoords){ calculateScreenCoords(_arg2.camera); }; _local3 = 0; _local4 = 0; for each (_local5 in this._childrenByName) { if (_local5.visible){ _local3 = (_local3 + _local5.project(this, _arg2)); _local4++; }; }; return ((this.screenZ = (_local3 / _local4))); } public function set scene(_arg1:SceneObject3D):void{ var _local2:DisplayObject3D; _scene = _arg1; for each (_local2 in this._childrenByName) { if (_local2.scene == null){ _local2.scene = _scene; }; }; } public function set z(_arg1:Number):void{ this.transform.n34 = _arg1; } public function get userData():UserData{ return (_userData); } public function get material():MaterialObject3D{ return (_material); } public function set userData(_arg1:UserData):void{ _userData = _arg1; } public function lookAt(_arg1:DisplayObject3D, _arg2:Number3D=null):void{ var _local3:DisplayObject3D; var _local4:Matrix3D; if ((this is CameraObject3D)){ _position.reset(this.x, this.y, this.z); } else { _position.reset(world.n14, world.n24, world.n34); }; _local3 = (_arg1.parent as DisplayObject3D); if (_local3){ _arg1.world.calculateMultiply(_local3.world, _arg1.transform); } else { _arg1.world.copy(_arg1.transform); }; if ((_arg1 is CameraObject3D)){ _target.reset(_arg1.x, _arg1.y, _arg1.z); } else { _target.reset(_arg1.world.n14, _arg1.world.n24, _arg1.world.n34); }; _zAxis.copyFrom(_target); _zAxis.minusEq(_position); _zAxis.normalize(); if (_zAxis.modulo > 0.1){ _xAxis = Number3D.cross(_zAxis, ((_arg2) || (UP)), _xAxis); _xAxis.normalize(); _yAxis = Number3D.cross(_zAxis, _xAxis, _yAxis); _yAxis.normalize(); _local4 = this.transform; _local4.n11 = (_xAxis.x * _scaleX); _local4.n21 = (_xAxis.y * _scaleX); _local4.n31 = (_xAxis.z * _scaleX); _local4.n12 = (-(_yAxis.x) * _scaleY); _local4.n22 = (-(_yAxis.y) * _scaleY); _local4.n32 = (-(_yAxis.z) * _scaleY); _local4.n13 = (_zAxis.x * _scaleZ); _local4.n23 = (_zAxis.y * _scaleZ); _local4.n33 = (_zAxis.z * _scaleZ); _localRotationX = (_localRotationY = (_localRotationZ = 0)); this._transformDirty = false; this._rotationDirty = true; } else { trace("lookAt error"); }; } public function set rotationX(_arg1:Number):void{ this._rotationX = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1; this._transformDirty = true; } public function calculateScreenCoords(_arg1:CameraObject3D):void{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; if (_arg1.useProjectionMatrix){ _local2 = 0; _local3 = 0; _local4 = 0; _local5 = ((((_local2 * view.n41) + (_local3 * view.n42)) + (_local4 * view.n43)) + view.n44); _local6 = (_arg1.viewport.width / 2); _local7 = (_arg1.viewport.height / 2); screen.x = (((((_local2 * view.n11) + (_local3 * view.n12)) + (_local4 * view.n13)) + view.n14) / _local5); screen.y = (((((_local2 * view.n21) + (_local3 * view.n22)) + (_local4 * view.n23)) + view.n24) / _local5); screen.z = ((((_local2 * view.n31) + (_local3 * view.n32)) + (_local4 * view.n33)) + view.n34); screen.x = (screen.x * _local6); screen.y = (screen.y * _local7); } else { _local8 = ((_arg1.focus * _arg1.zoom) / (_arg1.focus + view.n34)); screen.x = (view.n14 * _local8); screen.y = (view.n24 * _local8); screen.z = view.n34; }; } public function set rotationZ(_arg1:Number):void{ this._rotationZ = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1; this._transformDirty = true; } protected function setParentContainer(_arg1:DisplayObject3D, _arg2:Boolean=true):void{ var _local3:DisplayObject3D; if (((_arg2) && (!((_arg1 == this))))){ parentContainer = _arg1; }; for each (_local3 in children) { _local3.setParentContainer(_arg1, _arg2); }; } public function addGeometry(_arg1:GeometryObject3D=null):void{ if (_arg1){ this.geometry = _arg1; }; } public function get sceneX():Number{ return (this.world.n14); } public function get scaleY():Number{ if (Papervision3D.usePERCENT){ return ((this._scaleY * 100)); }; return (this._scaleY); } public function get scaleZ():Number{ if (Papervision3D.usePERCENT){ return ((this._scaleZ * 100)); }; return (this._scaleZ); } public function moveUp(_arg1:Number):void{ translate(_arg1, UP); } public function get scaleX():Number{ if (Papervision3D.usePERCENT){ return ((this._scaleX * 100)); }; return (this._scaleX); } public function distanceTo(_arg1:DisplayObject3D):Number{ var _local2:Number; var _local3:Number; var _local4:Number; _local2 = (this.x - _arg1.x); _local3 = (this.y - _arg1.y); _local4 = (this.z - _arg1.z); return (Math.sqrt((((_local2 * _local2) + (_local3 * _local3)) + (_local4 * _local4)))); } public function get scale():Number{ if ((((this._scaleX == this._scaleY)) && ((this._scaleX == this._scaleZ)))){ if (Papervision3D.usePERCENT){ return ((this._scaleX * 100)); }; return (this._scaleX); //unresolved jump }; return (NaN); } public function set rotationY(_arg1:Number):void{ this._rotationY = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1; this._transformDirty = true; } public function clone():DisplayObject3D{ var _local1:String; var _local2:DisplayObject3D; var _local3:DisplayObject3D; _local1 = ((this.name + "_") + _numClones++); _local2 = new DisplayObject3D(_local1); if (this.material){ _local2.material = this.material; }; if (this.materials){ _local2.materials = this.materials.clone(); }; if (this.geometry){ _local2.geometry = this.geometry.clone(_local2); _local2.geometry.ready = true; }; _local2.copyTransform(this.transform); for each (_local3 in this.children) { _local2.addChild(_local3.clone()); }; return (_local2); } public function get sceneZ():Number{ return (this.world.n34); } private function updateRotation():void{ _tempScale.x = (Papervision3D.usePERCENT) ? (_scaleX * 100) : _scaleX; _tempScale.y = (Papervision3D.usePERCENT) ? (_scaleY * 100) : _scaleY; _tempScale.z = (Papervision3D.usePERCENT) ? (_scaleZ * 100) : _scaleZ; _rotation = Matrix3D.matrix2euler(this.transform, _rotation, _tempScale); this._rotationX = (_rotation.x * toRADIANS); this._rotationY = (_rotation.y * toRADIANS); this._rotationZ = (_rotation.z * toRADIANS); this._rotationDirty = false; } public function hitTestObject(_arg1:DisplayObject3D, _arg2:Number=1):Boolean{ var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; _local3 = (this.x - _arg1.x); _local4 = (this.y - _arg1.y); _local5 = (this.z - _arg1.z); _local6 = (((_local3 * _local3) + (_local4 * _local4)) + (_local5 * _local5)); _local7 = (this.geometry) ? this.geometry.boundingSphere.maxDistance : 0; _local8 = (_arg1.geometry) ? _arg1.geometry.boundingSphere.maxDistance : 0; _local7 = (_local7 * _arg2); return (((_local7 + _local8) > _local6)); } public function set material(_arg1:MaterialObject3D):void{ if (_material){ _material.unregisterObject(this); }; _material = _arg1; _material.registerObject(this); } public function get localRotationZ():Number{ return ((Papervision3D.useDEGREES) ? (_localRotationZ * toDEGREES) : _localRotationZ); } override public function toString():String{ return (((((((this.name + ": x:") + Math.round(this.x)) + " y:") + Math.round(this.y)) + " z:") + Math.round(this.z))); } public function get localRotationY():Number{ return ((Papervision3D.useDEGREES) ? (_localRotationY * toDEGREES) : _localRotationY); } public function get z():Number{ return (this.transform.n34); } public function get localRotationX():Number{ return ((Papervision3D.useDEGREES) ? (_localRotationX * toDEGREES) : _localRotationX); } public function get x():Number{ return (this.transform.n14); } public function set autoCalcScreenCoords(_arg1:Boolean):void{ _autoCalcScreenCoords = _arg1; } public function moveLeft(_arg1:Number):void{ translate(_arg1, LEFT); } public function get scene():SceneObject3D{ return (_scene); } public function set useOwnContainer(_arg1:Boolean):void{ _useOwnContainer = _arg1; setParentContainer(this, true); } public function copyTransform(_arg1):void{ var _local2:Matrix3D; var _local3:Matrix3D; if ((_arg1 is DisplayObject3D)){ DisplayObject3D(_arg1).updateTransform(); }; _local2 = this.transform; _local3 = ((_arg1 is DisplayObject3D)) ? _arg1.transform : _arg1; _local2.n11 = _local3.n11; _local2.n12 = _local3.n12; _local2.n13 = _local3.n13; _local2.n14 = _local3.n14; _local2.n21 = _local3.n21; _local2.n22 = _local3.n22; _local2.n23 = _local3.n23; _local2.n24 = _local3.n24; _local2.n31 = _local3.n31; _local2.n32 = _local3.n32; _local2.n33 = _local3.n33; _local2.n34 = _local3.n34; this._transformDirty = false; this._rotationDirty = true; } public function get y():Number{ return (this.transform.n24); } public function roll(_arg1:Number):void{ _arg1 = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1; if (_transformDirty){ updateTransform(); }; _qRoll.setFromAxisAngle(transform.n13, transform.n23, transform.n33, _arg1); transform.calculateMultiply3x3(_qRoll.matrix, transform); _localRotationZ = (_localRotationZ + _arg1); _rotationDirty = true; } public function set scaleZ(_arg1:Number):void{ if (Papervision3D.usePERCENT){ this._scaleZ = (_arg1 / 100); } else { this._scaleZ = _arg1; }; this._transformDirty = true; } public function get rotationY():Number{ if (this._rotationDirty){ updateRotation(); }; return ((Papervision3D.useDEGREES) ? (this._rotationY * toDEGREES) : this._rotationY); } public function get rotationZ():Number{ if (this._rotationDirty){ updateRotation(); }; return ((Papervision3D.useDEGREES) ? (this._rotationZ * toDEGREES) : this._rotationZ); } public function yaw(_arg1:Number):void{ _arg1 = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1; if (_transformDirty){ updateTransform(); }; _qYaw.setFromAxisAngle(transform.n12, transform.n22, transform.n32, _arg1); transform.calculateMultiply3x3(_qYaw.matrix, transform); _localRotationY = (_localRotationY + _arg1); _rotationDirty = true; } public function get rotationX():Number{ if (this._rotationDirty){ updateRotation(); }; return ((Papervision3D.useDEGREES) ? (this._rotationX * toDEGREES) : this._rotationX); } public function set scaleX(_arg1:Number):void{ if (Papervision3D.usePERCENT){ this._scaleX = (_arg1 / 100); } else { this._scaleX = _arg1; }; this._transformDirty = true; } public function set scaleY(_arg1:Number):void{ if (Papervision3D.usePERCENT){ this._scaleY = (_arg1 / 100); } else { this._scaleY = _arg1; }; this._transformDirty = true; } public function createViewportLayer(_arg1:Viewport3D, _arg2:Boolean=true):ViewportLayer{ var _local3:ViewportLayer; _local3 = _arg1.getChildLayer(this, true); if (_arg2){ addChildrenToLayer(this, _local3); }; return (_local3); } public function translate(_arg1:Number, _arg2:Number3D):void{ var _local3:Number3D; _local3 = _arg2.clone(); if (this._transformDirty){ updateTransform(); }; Matrix3D.rotateAxis(transform, _local3); this.x = (this.x + (_arg1 * _local3.x)); this.y = (this.y + (_arg1 * _local3.y)); this.z = (this.z + (_arg1 * _local3.z)); } public function updateTransform():void{ _rot.setFromEuler(_rotationY, _rotationZ, _rotationX); this.transform.copy3x3(_rot.matrix); _tempMatrix.reset(); _tempMatrix.n11 = this._scaleX; _tempMatrix.n22 = this._scaleY; _tempMatrix.n33 = this._scaleZ; this.transform.calculateMultiply(this.transform, _tempMatrix); _transformDirty = false; } public function get autoCalcScreenCoords():Boolean{ return (_autoCalcScreenCoords); } public function addChildrenToLayer(_arg1:DisplayObject3D, _arg2:ViewportLayer):void{ var _local3:DisplayObject3D; for each (_local3 in _arg1.children) { _arg2.addDisplayObject3D(_local3); _local3.addChildrenToLayer(_local3, _arg2); }; } public function copyPosition(_arg1):void{ var _local2:Matrix3D; var _local3:Matrix3D; _local2 = this.transform; _local3 = ((_arg1 is DisplayObject3D)) ? _arg1.transform : _arg1; _local2.n14 = _local3.n14; _local2.n24 = _local3.n24; _local2.n34 = _local3.n34; } public function get useOwnContainer():Boolean{ return (_useOwnContainer); } public function getMaterialByName(_arg1:String):MaterialObject3D{ var _local2:MaterialObject3D; var _local3:DisplayObject3D; _local2 = (this.materials) ? this.materials.getMaterialByName(_arg1) : null; if (_local2){ return (_local2); }; for each (_local3 in this._childrenByName) { _local2 = _local3.getMaterialByName(_arg1); if (_local2){ return (_local2); }; }; return (null); } public function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{ var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; _local4 = (this.x - _arg1); _local5 = (this.y - _arg2); _local6 = (this.z - _arg3); _local7 = (((_local4 * _local4) + (_local5 * _local5)) + (_local6 * _local6)); _local8 = (this.geometry) ? this.geometry.boundingSphere.maxDistance : 0; return ((_local8 > _local7)); } public function moveForward(_arg1:Number):void{ translate(_arg1, FORWARD); } public function set scale(_arg1:Number):void{ if (Papervision3D.usePERCENT){ _arg1 = (_arg1 / 100); }; this._scaleX = (this._scaleY = (this._scaleZ = _arg1)); this._transformDirty = true; } public function get sceneY():Number{ return (this.world.n24); } public function moveRight(_arg1:Number):void{ translate(_arg1, RIGHT); } public function moveBackward(_arg1:Number):void{ translate(_arg1, BACKWARD); } public function set localRotationY(_arg1:Number):void{ _arg1 = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1; if (_transformDirty){ updateTransform(); }; _qYaw.setFromAxisAngle(transform.n12, transform.n22, transform.n32, (_localRotationY - _arg1)); transform.calculateMultiply3x3(_qYaw.matrix, transform); _localRotationY = _arg1; _rotationDirty = true; } public function set localRotationZ(_arg1:Number):void{ _arg1 = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1; if (_transformDirty){ updateTransform(); }; _qRoll.setFromAxisAngle(transform.n13, transform.n23, transform.n33, (_localRotationZ - _arg1)); transform.calculateMultiply3x3(_qRoll.matrix, transform); _localRotationZ = _arg1; _rotationDirty = true; } public function set localRotationX(_arg1:Number):void{ _arg1 = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1; if (this._transformDirty){ updateTransform(); }; _qPitch.setFromAxisAngle(transform.n11, transform.n21, transform.n31, (_localRotationX - _arg1)); this.transform.calculateMultiply3x3(_qPitch.matrix, transform); _localRotationX = _arg1; _rotationDirty = true; } public function set x(_arg1:Number):void{ this.transform.n14 = _arg1; } public function materialsList():String{ var _local1:String; var _local2:String; var _local3:DisplayObject3D; _local1 = ""; for (_local2 in this.materials) { _local1 = (_local1 + (_local2 + "\n")); }; for each (_local3 in this._childrenByName) { for (_local2 in _local3.materials.materialsByName) { _local1 = (_local1 + (("+ " + _local2) + "\n")); }; }; return (_local1); } public function set y(_arg1:Number):void{ this.transform.n24 = _arg1; } override public function addChild(_arg1:DisplayObject3D, _arg2:String=null):DisplayObject3D{ _arg1 = super.addChild(_arg1, _arg2); if (_arg1.scene == null){ _arg1.scene = scene; }; if (this.useOwnContainer){ _arg1.parentContainer = this; }; return (_arg1); } public function pitch(_arg1:Number):void{ _arg1 = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1; if (this._transformDirty){ updateTransform(); }; _qPitch.setFromAxisAngle(transform.n11, transform.n21, transform.n31, _arg1); this.transform.calculateMultiply3x3(_qPitch.matrix, transform); _localRotationX = (_localRotationX + _arg1); _rotationDirty = true; } public static function get ZERO():DisplayObject3D{ return (new (DisplayObject3D)); } } }//package org.papervision3d.objectsSection 98//BasicRenderEngine (org.papervision3d.render.BasicRenderEngine) package org.papervision3d.render { import org.papervision3d.core.proto.*; import org.papervision3d.core.render.data.*; import org.papervision3d.view.*; import org.papervision3d.core.render.command.*; import flash.geom.*; import org.papervision3d.core.render.material.*; import org.papervision3d.view.layer.*; import org.papervision3d.core.render.*; import org.papervision3d.core.render.sort.*; import org.papervision3d.core.render.filter.*; import org.papervision3d.core.render.project.*; import org.papervision3d.events.*; import org.papervision3d.core.utils.*; public class BasicRenderEngine extends AbstractRenderEngine implements IRenderEngine { public var sorter:IRenderSorter; public var projectionPipeline:ProjectionPipeline; protected var renderStatistics:RenderStatistics; protected var renderDoneEvent:RendererEvent; protected var renderList:Array; protected var projectionDoneEvent:RendererEvent; protected var renderSessionData:RenderSessionData; protected var stopWatch:StopWatch; public var filter:IRenderFilter; protected var cleanRHD:RenderHitData; public function BasicRenderEngine():void{ cleanRHD = new RenderHitData(); super(); init(); } override public function removeFromRenderList(_arg1:IRenderListItem):int{ return (renderList.splice(renderList.indexOf(_arg1), 1)); } protected function doRender(_arg1:RenderSessionData, _arg2:Array=null):RenderStatistics{ var _local3:RenderableListItem; var _local4:Viewport3D; var _local5:ViewportLayer; stopWatch.reset(); stopWatch.start(); MaterialManager.getInstance().updateMaterialsBeforeRender(_arg1); filter.filter(renderList); sorter.sort(renderList); _local4 = _arg1.viewPort; while ((_local3 = renderList.pop())) { _local5 = _local4.accessLayerFor(_local3, true); _local3.render(_arg1, _local5.graphicsChannel); _local4.lastRenderList.push(_local3); _local5.processRenderItem(_local3); }; MaterialManager.getInstance().updateMaterialsAfterRender(_arg1); _arg1.renderStatistics.renderTime = stopWatch.stop(); _arg1.viewPort.updateAfterRender(_arg1); return (renderStatistics); } protected function init():void{ renderStatistics = new RenderStatistics(); projectionPipeline = new BasicProjectionPipeline(); stopWatch = new StopWatch(); sorter = new BasicRenderSorter(); filter = new BasicRenderFilter(); renderList = new Array(); renderSessionData = new RenderSessionData(); renderSessionData.renderer = this; projectionDoneEvent = new RendererEvent(RendererEvent.PROJECTION_DONE, renderSessionData); renderDoneEvent = new RendererEvent(RendererEvent.RENDER_DONE, renderSessionData); } override public function renderScene(_arg1:SceneObject3D, _arg2:CameraObject3D, _arg3:Viewport3D, _arg4:Boolean=true):RenderStatistics{ _arg2.viewport = _arg3.sizeRectangle; renderSessionData.scene = _arg1; renderSessionData.camera = _arg2; renderSessionData.viewPort = _arg3; renderSessionData.container = _arg3.containerSprite; renderSessionData.triangleCuller = _arg3.triangleCuller; renderSessionData.particleCuller = _arg3.particleCuller; renderSessionData.renderObjects = _arg1.objects; renderSessionData.renderLayers = null; renderSessionData.renderStatistics.clear(); _arg3.updateBeforeRender(renderSessionData); projectionPipeline.project(renderSessionData); if (hasEventListener(RendererEvent.PROJECTION_DONE)){ dispatchEvent(projectionDoneEvent); }; doRender(renderSessionData, null); if (hasEventListener(RendererEvent.RENDER_DONE)){ dispatchEvent(renderDoneEvent); }; return (renderSessionData.renderStatistics); } public function hitTestPoint2D(_arg1:Point, _arg2:Viewport3D):RenderHitData{ return (_arg2.hitTestPoint2D(_arg1)); } override public function addToRenderList(_arg1:IRenderListItem):int{ return (renderList.push(_arg1)); } public function renderLayers(_arg1:SceneObject3D, _arg2:CameraObject3D, _arg3:Viewport3D, _arg4:Array=null, _arg5:Boolean=true):RenderStatistics{ renderSessionData.scene = _arg1; renderSessionData.camera = _arg2; renderSessionData.viewPort = _arg3; renderSessionData.container = _arg3.containerSprite; renderSessionData.triangleCuller = _arg3.triangleCuller; renderSessionData.particleCuller = _arg3.particleCuller; renderSessionData.renderObjects = getLayerObjects(_arg4); renderSessionData.renderLayers = _arg4; renderSessionData.renderStatistics.clear(); _arg3.updateBeforeRender(renderSessionData); projectionPipeline.project(renderSessionData); if (hasEventListener(RendererEvent.PROJECTION_DONE)){ dispatchEvent(projectionDoneEvent); }; doRender(renderSessionData); if (hasEventListener(RendererEvent.RENDER_DONE)){ dispatchEvent(renderDoneEvent); }; return (renderSessionData.renderStatistics); } private function getLayerObjects(_arg1:Array):Array{ var _local2:Array; var _local3:ViewportLayer; _local2 = new Array(); for each (_local3 in _arg1) { _local2 = _local2.concat(_local3.getLayerObjects()); }; return (_local2); } public function destroy():void{ renderDoneEvent = null; projectionDoneEvent = null; projectionPipeline = null; sorter = null; filter = null; renderStatistics = null; renderList = null; renderSessionData.destroy(); renderSessionData = null; cleanRHD = null; stopWatch = null; } } }//package org.papervision3d.renderSection 99//Scene3D (org.papervision3d.scenes.Scene3D) package org.papervision3d.scenes { import org.papervision3d.core.proto.*; public class Scene3D extends SceneObject3D { } }//package org.papervision3d.scenesSection 100//ViewportLayerSortMode (org.papervision3d.view.layer.util.ViewportLayerSortMode) package org.papervision3d.view.layer.util { public class ViewportLayerSortMode { public static var Z_SORT:String = "z"; public static var INDEX_SORT:String = "index"; } }//package org.papervision3d.view.layer.utilSection 101//ViewportBaseLayer (org.papervision3d.view.layer.ViewportBaseLayer) package org.papervision3d.view.layer { import org.papervision3d.view.*; import org.papervision3d.objects.*; public class ViewportBaseLayer extends ViewportLayer { public function ViewportBaseLayer(_arg1:Viewport3D){ super(_arg1, null); } override public function updateBeforeRender():void{ var _local1:int; clear(); _local1 = (childLayers.length - 1); while (_local1 >= 0) { if (childLayers[_local1].dynamicLayer){ removeLayerAt(_local1); }; _local1--; }; super.updateBeforeRender(); } override public function getChildLayer(_arg1:DisplayObject3D, _arg2:Boolean=true, _arg3:Boolean=false):ViewportLayer{ if (layers[_arg1]){ return (layers[_arg1]); }; if (((_arg2) || (_arg1.useOwnContainer))){ return (getChildLayerFor(_arg1, _arg3)); }; return (this); } } }//package org.papervision3d.view.layerSection 102//ViewportLayer (org.papervision3d.view.layer.ViewportLayer) package org.papervision3d.view.layer { import org.papervision3d.view.*; import org.papervision3d.core.render.command.*; import flash.display.*; import org.papervision3d.objects.*; import flash.utils.*; import org.papervision3d.view.layer.util.*; public class ViewportLayer extends Sprite { public var layerIndex:Number; public var layers:Dictionary; public var dynamicLayer:Boolean;// = false public var sortMode:String; public var weight:Number;// = 0 public var childLayers:Array; public var forceDepth:Boolean;// = false protected var viewport:Viewport3D; public var screenDepth:Number;// = 0 public var displayObject3D:DisplayObject3D; public var displayObjects:Dictionary; public var graphicsChannel:Graphics; public function ViewportLayer(_arg1:Viewport3D, _arg2:DisplayObject3D, _arg3:Boolean=false){ layers = new Dictionary(true); displayObjects = new Dictionary(true); forceDepth = false; screenDepth = 0; weight = 0; sortMode = ViewportLayerSortMode.Z_SORT; dynamicLayer = false; super(); this.viewport = _arg1; this.displayObject3D = _arg2; this.dynamicLayer = _arg3; this.graphicsChannel = this.graphics; if (_arg3){ this.filters = _arg2.filters; this.blendMode = _arg2.blendMode; this.alpha = _arg2.alpha; }; if (_arg2){ addDisplayObject3D(_arg2); }; init(); } public function getLayerObjects(_arg1:Array=null):Array{ var _local2:DisplayObject3D; var _local3:ViewportLayer; if (!_arg1){ _arg1 = new Array(); }; for each (_local2 in this.displayObjects) { if (((_local2) && ((_local2.parent == null)))){ _arg1.push(_local2); }; }; for each (_local3 in childLayers) { _local3.getLayerObjects(_arg1); }; return (_arg1); } protected function init():void{ childLayers = new Array(); } public function updateInfo():void{ var _local1:ViewportLayer; for each (_local1 in childLayers) { _local1.updateInfo(); if (!forceDepth){ this.weight = (this.weight + _local1.weight); this.screenDepth = (this.screenDepth + (_local1.screenDepth * _local1.weight)); }; }; if (!forceDepth){ this.screenDepth = (this.screenDepth / this.weight); }; } public function sortChildLayers():void{ if (sortMode == ViewportLayerSortMode.Z_SORT){ childLayers.sortOn("screenDepth", (Array.DESCENDING | Array.NUMERIC)); } else { childLayers.sortOn("layerIndex", Array.NUMERIC); }; orderLayers(); } private function onChildRemoved(_arg1:ViewportLayerEvent):void{ if (_arg1.do3d){ unlinkChild(_arg1.do3d, _arg1); }; } public function removeAllLayers():void{ var _local1:int; _local1 = (childLayers.length - 1); while (_local1 >= 0) { removeLayerAt(_local1); _local1--; }; } public function updateAfterRender():void{ var _local1:ViewportLayer; for each (_local1 in childLayers) { _local1.updateAfterRender(); }; } public function removeLayer(_arg1:ViewportLayer):void{ var _local2:int; _local2 = getChildIndex(_arg1); if (_local2 > -1){ removeLayerAt(_local2); } else { trace("Layer not found for removal."); }; } protected function getChildLayerFor(_arg1:DisplayObject3D, _arg2:Boolean=false):ViewportLayer{ var _local3:ViewportLayer; if (_arg1){ _local3 = new ViewportLayer(viewport, _arg1, _arg1.useOwnContainer); addLayer(_local3); if (_arg2){ _arg1.addChildrenToLayer(_arg1, _local3); }; return (_local3); } else { trace("Needs to be a do3d"); }; return (null); } public function addLayer(_arg1:ViewportLayer):void{ var _local2:DisplayObject3D; var _local3:ViewportLayer; childLayers.push(_arg1); addChild(_arg1); _arg1.addEventListener(ViewportLayerEvent.CHILD_ADDED, onChildAdded); _arg1.addEventListener(ViewportLayerEvent.CHILD_REMOVED, onChildRemoved); for each (_local2 in _arg1.displayObjects) { linkChild(_local2, _arg1); }; for each (_local3 in _arg1.layers) { for each (_local2 in _local3.displayObjects) { linkChild(_local2, _local3); }; }; } public function childLayerIndex(_arg1:DisplayObject3D):Number{ var _local2:int; _arg1 = (_arg1.parentContainer) ? _arg1.parentContainer : _arg1; _local2 = 0; while (_local2 < childLayers.length) { if (childLayers[_local2].hasDisplayObject3D(_arg1)){ return (_local2); }; _local2++; }; return (-1); } protected function orderLayers():void{ var _local1:int; _local1 = 0; while (_local1 < childLayers.length) { this.setChildIndex(childLayers[_local1], _local1); childLayers[_local1].sortChildLayers(); _local1++; }; } public function removeLayerAt(_arg1:Number):void{ var _local2:DisplayObject3D; for each (_local2 in childLayers[_arg1].displayObjects) { unlinkChild(_local2); }; removeChild(childLayers[_arg1]); childLayers.splice(_arg1, 1); } protected function reset():void{ if (!forceDepth){ screenDepth = 0; }; this.weight = 0; } private function linkChild(_arg1:DisplayObject3D, _arg2:ViewportLayer, _arg3:ViewportLayerEvent=null):void{ layers[_arg1] = _arg2; dispatchEvent(new ViewportLayerEvent(ViewportLayerEvent.CHILD_ADDED, _arg1, _arg2)); } public function updateBeforeRender():void{ var _local1:ViewportLayer; clear(); for each (_local1 in childLayers) { _local1.updateBeforeRender(); }; } private function onChildAdded(_arg1:ViewportLayerEvent):void{ if (_arg1.do3d){ linkChild(_arg1.do3d, _arg1.layer, _arg1); }; } public function getChildLayer(_arg1:DisplayObject3D, _arg2:Boolean=true, _arg3:Boolean=false):ViewportLayer{ _arg1 = (_arg1.parentContainer) ? _arg1.parentContainer : _arg1; if (layers[_arg1]){ return (layers[_arg1]); }; if (_arg2){ return (getChildLayerFor(_arg1, _arg3)); }; return (null); } public function processRenderItem(_arg1:RenderableListItem):void{ if (!forceDepth){ this.screenDepth = (this.screenDepth + _arg1.screenDepth); this.weight++; }; } public function clear():void{ graphicsChannel.clear(); reset(); } public function removeDisplayObject3D(_arg1:DisplayObject3D):void{ displayObjects[_arg1] = null; dispatchEvent(new ViewportLayerEvent(ViewportLayerEvent.CHILD_REMOVED, _arg1, this)); } private function unlinkChild(_arg1:DisplayObject3D, _arg2:ViewportLayerEvent=null):void{ layers[_arg1] = null; dispatchEvent(new ViewportLayerEvent(ViewportLayerEvent.CHILD_REMOVED, _arg1)); } public function addDisplayObject3D(_arg1:DisplayObject3D, _arg2:Boolean=false):void{ if (!_arg1){ return; }; displayObjects[_arg1] = _arg1; dispatchEvent(new ViewportLayerEvent(ViewportLayerEvent.CHILD_ADDED, _arg1, this)); if (_arg2){ _arg1.addChildrenToLayer(_arg1, this); }; } public function hasDisplayObject3D(_arg1:DisplayObject3D):Boolean{ return (!((displayObjects[_arg1] == null))); } } }//package org.papervision3d.view.layerSection 103//ViewportLayerEvent (org.papervision3d.view.layer.ViewportLayerEvent) package org.papervision3d.view.layer { import org.papervision3d.objects.*; import flash.events.*; public class ViewportLayerEvent extends Event { public var layer:ViewportLayer; public var do3d:DisplayObject3D; public static const CHILD_REMOVED:String = "childRemoved"; public static const CHILD_ADDED:String = "childAdded"; public function ViewportLayerEvent(_arg1:String, _arg2:DisplayObject3D=null, _arg3:ViewportLayer=null){ super(_arg1, false, false); this.do3d = _arg2; this.layer = _arg3; } } }//package org.papervision3d.view.layerSection 104//Viewport3D (org.papervision3d.view.Viewport3D) package org.papervision3d.view { import org.papervision3d.core.render.data.*; import org.papervision3d.core.render.command.*; import flash.display.*; import flash.geom.*; import org.papervision3d.objects.*; import flash.events.*; import org.papervision3d.view.layer.*; import org.papervision3d.core.culling.*; import flash.utils.*; import org.papervision3d.core.view.*; import org.papervision3d.core.render.*; import org.papervision3d.core.utils.*; public class Viewport3D extends Sprite implements IViewport3D { protected var _interactive:Boolean; public var cullingRectangle:Rectangle; protected var _viewportObjectFilter:ViewportObjectFilter; protected var _layerInstances:Dictionary; protected var _hWidth:Number; protected var _autoScaleToStage:Boolean; protected var _lastRenderer:IRenderEngine; protected var _containerSprite:ViewportBaseLayer; protected var _hHeight:Number; public var sizeRectangle:Rectangle; protected var renderHitData:RenderHitData; protected var _autoClipping:Boolean; protected var _height:Number; public var interactiveSceneManager:InteractiveSceneManager; public var lastRenderList:Array; public var lineCuller:ILineCuller; protected var _autoCulling:Boolean; public var particleCuller:IParticleCuller; protected var _width:Number; public var triangleCuller:ITriangleCuller; public function Viewport3D(_arg1:Number=640, _arg2:Number=480, _arg3:Boolean=false, _arg4:Boolean=false, _arg5:Boolean=true, _arg6:Boolean=true){ init(); this.interactive = _arg4; this.viewportWidth = _arg1; this.viewportHeight = _arg2; this.autoClipping = _arg5; this.autoCulling = _arg6; this.autoScaleToStage = _arg3; this._layerInstances = new Dictionary(true); } public function set autoCulling(_arg1:Boolean):void{ if (_arg1){ triangleCuller = new RectangleTriangleCuller(cullingRectangle); particleCuller = new RectangleParticleCuller(cullingRectangle); lineCuller = new RectangleLineCuller(cullingRectangle); } else { if (!_arg1){ triangleCuller = new DefaultTriangleCuller(); particleCuller = new DefaultParticleCuller(); lineCuller = new DefaultLineCuller(); }; }; _autoCulling = _arg1; } protected function onRemovedFromStage(_arg1:Event):void{ stage.removeEventListener(Event.RESIZE, onStageResize); } public function hitTestMouse():RenderHitData{ var _local1:Point; _local1 = new Point(containerSprite.mouseX, containerSprite.mouseY); return (hitTestPoint2D(_local1)); } protected function init():void{ this.renderHitData = new RenderHitData(); lastRenderList = new Array(); sizeRectangle = new Rectangle(); cullingRectangle = new Rectangle(); _containerSprite = new ViewportBaseLayer(this); addChild(_containerSprite); addEventListener(Event.ADDED_TO_STAGE, onAddedToStage); addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); } protected function onStageResize(_arg1:Event=null):void{ if (_autoScaleToStage){ viewportWidth = stage.stageWidth; viewportHeight = stage.stageHeight; }; } public function set autoClipping(_arg1:Boolean):void{ if (_arg1){ scrollRect = sizeRectangle; } else { scrollRect = null; }; _autoClipping = _arg1; } public function updateAfterRender(_arg1:RenderSessionData):void{ var _local2:ViewportLayer; if (interactive){ interactiveSceneManager.updateRenderHitData(); }; if (_arg1.renderLayers){ for each (_local2 in _arg1.renderLayers) { _local2.updateInfo(); _local2.sortChildLayers(); _local2.updateAfterRender(); }; } else { containerSprite.updateInfo(); containerSprite.updateAfterRender(); }; containerSprite.sortChildLayers(); } public function accessLayerFor(_arg1:RenderableListItem, _arg2:Boolean=false):ViewportLayer{ var _local3:DisplayObject3D; if (_arg1.renderableInstance){ _local3 = _arg1.renderableInstance.instance; _local3 = (_local3.parentContainer) ? _local3.parentContainer : _local3; if (containerSprite.layers[_local3]){ if (_arg2){ _local3.container = containerSprite.layers[_local3]; }; return (containerSprite.layers[_local3]); } else { if (_local3.useOwnContainer){ return (containerSprite.getChildLayer(_local3, true, true)); }; }; }; return (containerSprite); } public function get viewportHeight():Number{ return (_height); } public function get autoCulling():Boolean{ return (_autoCulling); } public function hitTestPoint2D(_arg1:Point):RenderHitData{ var _local2:RenderableListItem; var _local3:RenderHitData; var _local4:IRenderListItem; var _local5:uint; renderHitData.clear(); if (interactive){ _local3 = renderHitData; _local5 = lastRenderList.length; while ((_local4 = lastRenderList[--_local5])) { if ((_local4 is RenderableListItem)){ _local2 = (_local4 as RenderableListItem); _local3 = _local2.hitTestPoint2D(_arg1, _local3); if (_local3.hasHit){ return (_local3); }; }; }; }; return (renderHitData); } public function updateBeforeRender(_arg1:RenderSessionData):void{ var _local2:ViewportLayer; lastRenderList.length = 0; if (_arg1.renderLayers){ for each (_local2 in _arg1.renderLayers) { _local2.updateBeforeRender(); }; } else { _containerSprite.updateBeforeRender(); }; _layerInstances = new Dictionary(true); } protected function onAddedToStage(_arg1:Event):void{ stage.addEventListener(Event.RESIZE, onStageResize); onStageResize(); } public function getChildLayer(_arg1:DisplayObject3D, _arg2:Boolean=true, _arg3:Boolean=true):ViewportLayer{ return (containerSprite.getChildLayer(_arg1, _arg2, _arg3)); } public function get viewportObjectFilter():ViewportObjectFilter{ return (_viewportObjectFilter); } public function get containerSprite():ViewportLayer{ return (_containerSprite); } public function set viewportWidth(_arg1:Number):void{ _width = _arg1; _hWidth = (_arg1 / 2); containerSprite.x = _hWidth; cullingRectangle.x = -(_hWidth); cullingRectangle.width = _arg1; sizeRectangle.width = _arg1; if (_autoClipping){ scrollRect = sizeRectangle; }; } public function get autoClipping():Boolean{ return (_autoClipping); } public function set viewportObjectFilter(_arg1:ViewportObjectFilter):void{ _viewportObjectFilter = _arg1; } public function get viewportWidth():Number{ return (_width); } public function set autoScaleToStage(_arg1:Boolean):void{ _autoScaleToStage = _arg1; if (((_arg1) && (!((stage == null))))){ onStageResize(); }; } public function set interactive(_arg1:Boolean):void{ if (_arg1 != _interactive){ if (((_interactive) && (interactiveSceneManager))){ interactiveSceneManager.destroy(); interactiveSceneManager = null; }; _interactive = _arg1; if (_arg1){ interactiveSceneManager = new InteractiveSceneManager(this); }; }; } public function set viewportHeight(_arg1:Number):void{ _height = _arg1; _hHeight = (_arg1 / 2); containerSprite.y = _hHeight; cullingRectangle.y = -(_hHeight); cullingRectangle.height = _arg1; sizeRectangle.height = _arg1; if (_autoClipping){ scrollRect = sizeRectangle; }; } public function get autoScaleToStage():Boolean{ return (_autoScaleToStage); } public function get interactive():Boolean{ return (_interactive); } public function destroy():void{ if (interactiveSceneManager){ interactiveSceneManager.destroy(); interactiveSceneManager = null; }; lastRenderList = null; } } }//package org.papervision3d.viewSection 105//Papervision3D (org.papervision3d.Papervision3D) package org.papervision3d { public class Papervision3D { public static var useDEGREES:Boolean = true; public static var useRIGHTHANDED:Boolean = false; public static var VERBOSE:Boolean = true; public static var NAME:String = "Papervision3D"; public static var DATE:String = "1.08.08"; public static var AUTHOR:String = "(c) 2006-2008 Copyright by Carlos Ulloa | John Grden | Ralph Hauwert | Tim Knip | Andy Zupko"; public static var VERSION:String = "Public Alpha 2.0 - Great White"; public static var usePERCENT:Boolean = false; public static function log(_arg1:String):void{ if (Papervision3D.VERBOSE){ trace(_arg1); }; } } }//package org.papervision3dSection 106//bg_mc_6 (PixelWallTest_fla.bg_mc_6) package PixelWallTest_fla { import flash.display.*; public dynamic class bg_mc_6 extends MovieClip { public function bg_mc_6(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package PixelWallTest_flaSection 107//Symbol2_8 (PixelWallTest_fla.Symbol2_8) package PixelWallTest_fla { import flash.display.*; import flash.text.*; public dynamic class Symbol2_8 extends MovieClip { public var text_txt:TextField; } }//package PixelWallTest_flaSection 108//IPixelWallSource (IPixelWallSource) package { import flash.display.*; import flash.events.*; public interface IPixelWallSource extends IBitmapDrawable { function dispatchEvent(_arg1:Event):Boolean; function get mouseChildren():Boolean; function set mouseEnabled(_arg1:Boolean):void; function resize(_arg1:Number, _arg2:Number):void; function get mouseEnabled():Boolean; function set mouseChildren(_arg1:Boolean):void; } }//packageSection 109//MiniSite (MiniSite) package { import org.papervision3d.materials.utils.*; import org.papervision3d.view.*; import flash.display.*; import flash.events.*; import flash.utils.*; import com.mckenzie.transition.easing.*; import com.mckenzie.utils.*; import com.mckenzie.transition.*; import org.papervision3d.render.*; import org.papervision3d.scenes.*; import org.papervision3d.materials.*; import org.papervision3d.cameras.*; import org.papervision3d.objects.primitives.*; import flash.text.*; import flash.filters.*; public class MiniSite extends Sprite implements IPixelWallSource { public var rxDest:Number;// = 0 public var squarey:Cube; public var camera:Camera3D; public var miniStageWidth:Number;// = 100 public var lookOdds:Number;// = 0 public var ry:Number;// = 0 public var float_mc:MovieClip; public var text_txt:TextField; public var rx:Number;// = 0 public var ryDest:Number;// = 0 public var scene:Scene3D; public var viewport:Viewport3D; public var mouse:PixelWallMouse; public var extraRot:Number;// = 0 public var renderer:BasicRenderEngine; public var bg_mc:MovieClip; public var rotTween:Tween; public var isHappy:Boolean;// = true public var lookInt:Number; public var extraRotDest:Number;// = 0 public var miniStageHeight:Number;// = 100 public function MiniSite(){ var _local1:MovieMaterial; var _local2:MovieMaterial; var _local3:MovieMaterial; var _local4:MovieMaterial; var _local5:MovieMaterial; var _local6:MovieMaterial; var _local7:MaterialsList; miniStageWidth = 100; miniStageHeight = 100; rotTween = new Tween(); extraRot = 0; extraRotDest = 0; isHappy = true; rx = 0; ry = 0; rxDest = 0; ryDest = 0; lookOdds = 0; super(); this.viewport = new Viewport3D(0, 0, false, true, false, false); this.viewport.x = 0; this.viewport.y = 0; this.viewport.mouseEnabled = false; this.viewport.mouseChildren = false; this.viewport.filters = [new GlowFilter(0, 0.8, 8, 8, 1, 3)]; this.addChild(this.viewport); this.renderer = new BasicRenderEngine(); this.scene = new Scene3D(); this.camera = new Camera3D(); this.camera.z = -400; this.camera.zoom = 37; _local1 = new MovieMaterial(new SquareySide()); _local1.smooth = true; _local1.interactive = true; _local1.animated = true; _local1.allowAutoResize = false; _local2 = new MovieMaterial(new SquareySide()); _local2.smooth = true; _local2.interactive = true; _local2.animated = true; _local2.allowAutoResize = false; _local3 = new MovieMaterial(new SquareySad()); _local3.smooth = true; _local3.interactive = true; _local3.animated = true; _local3.allowAutoResize = false; _local4 = new MovieMaterial(new SquareyHappy()); _local4.smooth = true; _local4.interactive = true; _local4.animated = true; _local4.allowAutoResize = false; _local5 = new MovieMaterial(new SquareySide()); _local5.smooth = true; _local5.interactive = true; _local5.animated = true; _local5.allowAutoResize = false; _local6 = new MovieMaterial(new SquareySide()); _local6.smooth = true; _local6.interactive = true; _local6.animated = true; _local6.allowAutoResize = false; _local7 = new MaterialsList({all:_local1, front:_local3, back:_local4, right:_local6, left:_local5, top:_local1, bottom:_local2}); this.squarey = new Cube(_local7, 30, 30, 30, 4, 4, 4); this.scene.addChild(this.squarey); this.addEventListener(Event.MOUSE_LEAVE, this.mouseLeave); this.addEventListener(PixelWallMouse.MOUSE_ENTER, this.mouseEnter); this.addEventListener(Event.ENTER_FRAME, this.updateMousePos); this.addEventListener(Event.ENTER_FRAME, this.loop); } public function mouseLeave(_arg1:Event):void{ if (this.isHappy){ this.extraRotDest = (this.extraRotDest + 180); this.rotTween.ease(this, {extraRot:this.extraRotDest}, 60, Elastic.easeOut, 2, 10); this.removeEventListener(Event.ENTER_FRAME, this.updateMousePos); this.lookOdds = 5; this.lookInt = setInterval(this.lookAround, 300); this.isHappy = false; }; } public function lookAround(_arg1:Event=null):void{ if (Math.floor((Math.random() * this.lookOdds)) == 0){ this.lookOdds = Math.min(10, (this.lookOdds + 0.5)); this.rxDest = (1 - (Math.random() * 2)); this.ryDest = (1 - (Math.random() * 2)); trace(("odds going down: " + this.lookOdds)); } else { this.lookOdds = Math.max(1, (this.lookOdds - 0.8)); trace(("odds going up: " + this.lookOdds)); }; } public function updateMousePos(_arg1:Event=null):void{ this.rxDest = (((StageReference.STAGE.stageWidth / 2) - this.mouseX) / (StageReference.STAGE.stageWidth / 2)); this.ryDest = (((StageReference.STAGE.stageHeight / 2) - this.mouseY) / (StageReference.STAGE.stageHeight / 2)); } public function mouseEnter(_arg1:Event):void{ if (!this.isHappy){ this.extraRotDest = (this.extraRotDest + 180); this.rotTween.ease(this, {extraRot:this.extraRotDest}, 60, Elastic.easeOut, 2, 10); this.addEventListener(Event.ENTER_FRAME, this.updateMousePos); if (this.lookInt){ clearInterval(this.lookInt); }; this.isHappy = true; }; } public function resize(_arg1:Number, _arg2:Number):void{ var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; this.miniStageWidth = _arg1; this.miniStageHeight = _arg2; _local3 = 165; _local4 = 165; _local5 = 165; _local6 = 165; _local7 = (_local4 / _local3); if ((this.miniStageWidth * _local7) > this.miniStageHeight){ _local5 = this.miniStageWidth; _local6 = (this.miniStageWidth * _local7); } else { _local5 = (this.miniStageHeight / _local7); _local6 = this.miniStageHeight; }; this.bg_mc.x = ((this.miniStageWidth - _local5) / 2); this.bg_mc.y = ((this.miniStageHeight - _local6) / 2); this.bg_mc.scaleX = (_local5 / _local3); this.bg_mc.scaleY = (_local6 / _local4); this.viewport.x = (this.miniStageWidth / 2); this.viewport.y = (this.miniStageHeight / 2); this.float_mc.x = (Math.floor(((this.miniStageWidth - this.float_mc.width) / 2)) - 2); this.float_mc.y = (Math.floor(((this.miniStageHeight - this.float_mc.height) / 2)) - 2); } public function loop(_arg1:Event):void{ this.rx = (this.rx + ((rxDest - this.rx) / 4)); this.ry = (this.ry + ((ryDest - this.ry) / 4)); this.squarey.transform.reset(); this.squarey.yaw((this.rx * 45)); this.squarey.pitch((this.ry * 45)); this.squarey.yaw(this.extraRot); this.renderer.renderScene(this.scene, this.camera, this.viewport); } } }//packageSection 110//PixelWall (PixelWall) package { import flash.display.*; import flash.geom.*; import flash.events.*; public class PixelWall extends Sprite { public var bitmapContainer:Sprite; public var source:IPixelWallSource; public var wallWidth:Number;// = 100 public var bitmap:Bitmap; public var captureMap:BitmapData; public var pixelHeight:Number;// = 5 public var wallHeight:Number;// = 100 public var mode:String; public var mouseProxy:PixelWallMouse; public var pixelWidth:Number;// = 5 public function PixelWall(_arg1:IPixelWallSource){ pixelHeight = 5; pixelWidth = 5; wallHeight = 100; wallWidth = 100; super(); this.source = _arg1; this.mode = PixelWallMode.FULL; this.bitmapContainer = new Sprite(); this.addChild(this.bitmapContainer); this.bitmap = new Bitmap(); this.bitmapContainer.addChild(this.bitmap); this.mouseProxy = new PixelWallMouse(this, _arg1, this.mouseX, this.mouseY); } public function getSourceBounds():Rectangle{ return (new Rectangle(0, 0, this.bitmap.width, this.bitmap.height)); } public function changeMode(_arg1:String):void{ switch (_arg1){ case PixelWallMode.FULL: this.mode = PixelWallMode.FULL; break; case PixelWallMode.MINI: this.mode = PixelWallMode.MINI; break; default: trace("not a valid mode"); }; this.snapshot(); } public function updateMouseTrans():void{ } public function resize(_arg1:Number, _arg2:Number):void{ var _local3:Number; var _local4:Number; this.wallWidth = _arg1; this.wallHeight = _arg2; _local3 = ((this.wallWidth / this.pixelWidth) + 1); _local4 = ((this.wallHeight / this.pixelHeight) + 1); this.captureMap = new BitmapData(_local3, _local4, false, 0); this.bitmap.bitmapData = this.captureMap; if (this.mode == PixelWallMode.FULL){ this.bitmapContainer.x = 0; this.bitmapContainer.y = 0; this.bitmapContainer.width = (Math.floor(_local3) * this.pixelWidth); this.bitmapContainer.height = (Math.floor(_local4) * this.pixelHeight); } else { this.bitmapContainer.x = Math.round(((this.wallWidth - this.bitmapContainer.width) / 2)); this.bitmapContainer.y = Math.round(((this.wallHeight - this.bitmapContainer.height) / 2)); this.bitmapContainer.width = Math.floor(_local3); this.bitmapContainer.height = Math.floor(_local4); }; this.source.resize(_local3, _local4); this.snapshot(); } public function snapshot(_arg1:Event=null):void{ this.captureMap.draw(this.source); } } }//packageSection 111//PixelWallMode (PixelWallMode) package { public class PixelWallMode { public static const MINI:String = "mini"; public static const FULL:String = "full"; } }//packageSection 112//PixelWallMouse (PixelWallMouse) package { import flash.display.*; import flash.geom.*; import flash.events.*; public class PixelWallMouse extends EventDispatcher { public var enterFrameContainer:Sprite; public var source:IPixelWallSource; public var position:Point; public var pixelWall:PixelWall; public static const MOUSE_ENTER:String = "mouseEnter"; public function PixelWallMouse(_arg1:PixelWall, _arg2:IPixelWallSource, _arg3:Number, _arg4:Number){ this.pixelWall = _arg1; this.source = _arg2; this.source.mouseEnabled = false; this.source.mouseChildren = false; this.position = new Point(_arg3, _arg4); this.pixelWall.addEventListener(MouseEvent.MOUSE_OUT, this.mouseLeave); this.pixelWall.addEventListener(MouseEvent.MOUSE_OVER, this.mouseEnter); this.pixelWall.addEventListener(MouseEvent.CLICK, this.click); this.pixelWall.addEventListener(MouseEvent.MOUSE_UP, this.mouseUp); this.pixelWall.addEventListener(MouseEvent.MOUSE_DOWN, this.mouseDown); this.pixelWall.addEventListener(MouseEvent.DOUBLE_CLICK, this.doubleClick); this.pixelWall.addEventListener(MouseEvent.MOUSE_WHEEL, this.mouseWheel); this.enterFrameContainer = new Sprite(); this.enterFrameContainer.addEventListener(Event.ENTER_FRAME, this.update); } private function click(_arg1:Event=null):void{ } private function update(_arg1:Event):void{ if (((!((this.pixelWall.mouseX == this.position.x))) || (!((this.pixelWall.mouseY == this.position.y))))){ this.position.x = this.pixelWall.mouseX; this.position.y = this.pixelWall.mouseY; this.mouseMove(); }; } private function mouseMove(_arg1:Event=null):void{ var _local2:MouseEvent; _local2 = new MouseEvent(MouseEvent.MOUSE_MOVE, false, false, this.position.x, this.position.y); this.source.dispatchEvent(_local2); } private function mouseLeave(_arg1:Event=null):void{ var _local2:MouseEvent; _local2 = new MouseEvent(Event.MOUSE_LEAVE, false, false, this.position.x, this.position.y); this.source.dispatchEvent(_local2); } private function mouseUp(_arg1:Event=null):void{ } private function mouseDown(_arg1:Event=null):void{ } private function mouseEnter(_arg1:Event=null):void{ var _local2:MouseEvent; _local2 = new MouseEvent(PixelWallMouse.MOUSE_ENTER, false, false, this.position.x, this.position.y); this.source.dispatchEvent(_local2); } private function doubleClick(_arg1:Event=null):void{ } private function mouseWheel(_arg1:Event=null):void{ } } }//packageSection 113//PixelWallTest (PixelWallTest) package { import flash.display.*; import flash.geom.*; import flash.events.*; import com.mckenzie.utils.*; public class PixelWallTest extends Sprite { public var miniSite:MiniSite; public var pixelWall:PixelWall; public var boundingBox:Shape; public function PixelWallTest(){ StageReference.STAGE = this.stage; this.stage.align = StageAlign.TOP_LEFT; this.stage.scaleMode = StageScaleMode.NO_SCALE; this.stage.quality = StageQuality.LOW; this.boundingBox = new Shape(); this.miniSite = new MiniSite(); this.pixelWall = new PixelWall(this.miniSite); this.addChild(this.pixelWall); this.resize(); this.stage.addEventListener(Event.RESIZE, this.resize); this.addEventListener(Event.ENTER_FRAME, this.loop); } public function loop(_arg1:Event):void{ this.pixelWall.snapshot(); } public function resize(_arg1:Event=null):void{ var _local2:Number; var _local3:Number; var _local4:Rectangle; _local2 = this.stage.stageWidth; _local3 = this.stage.stageHeight; this.pixelWall.resize(_local2, _local3); _local4 = this.pixelWall.getSourceBounds(); this.boundingBox.graphics.clear(); this.boundingBox.graphics.lineStyle(0, 0xFF0000); this.boundingBox.graphics.drawRect(_local4.x, _local4.y, _local4.width, _local4.height); } } }//packageSection 114//SquareyHappy (SquareyHappy) package { import flash.display.*; public class SquareyHappy extends MovieClip { } }//packageSection 115//SquareySad (SquareySad) package { import flash.display.*; public class SquareySad extends MovieClip { } }//packageSection 116//SquareySide (SquareySide) package { import flash.display.*; public class SquareySide extends MovieClip { } }//package
Library Items
Symbol 1 Graphic | Used by:4 | |
Symbol 2 Graphic | Used by:3 | |
Symbol 3 MovieClip | Uses:2 | Used by:4 |
Symbol 4 MovieClip {PixelWallTest_fla.bg_mc_6} | Uses:1 3 | Used by:9 |
Symbol 5 Font | Used by:6 | |
Symbol 6 EditableText | Uses:5 | Used by:8 |
Symbol 7 Graphic | Used by:8 | |
Symbol 8 MovieClip {PixelWallTest_fla.Symbol2_8} | Uses:6 7 | Used by:9 |
Symbol 9 MovieClip {MiniSite} | Uses:4 8 | |
Symbol 10 Graphic | Used by:11 | |
Symbol 11 MovieClip | Uses:10 | Used by:12 14 16 |
Symbol 12 MovieClip {SquareySide} | Uses:11 | |
Symbol 13 Graphic | Used by:14 | |
Symbol 14 MovieClip {SquareySad} | Uses:11 13 | |
Symbol 15 Graphic | Used by:16 | |
Symbol 16 MovieClip {SquareyHappy} | Uses:11 15 |
Instance Names
"text_txt" | Symbol 8 MovieClip {PixelWallTest_fla.Symbol2_8} Frame 1 | Symbol 6 EditableText |
"bg_mc" | Symbol 9 MovieClip {MiniSite} Frame 1 | Symbol 4 MovieClip {PixelWallTest_fla.bg_mc_6} |
"float_mc" | Symbol 9 MovieClip {MiniSite} Frame 1 | Symbol 8 MovieClip {PixelWallTest_fla.Symbol2_8} |
Special Tags
FileAttributes (69) | Timeline Frame 1 | Access local files only, Metadata not present, AS3. |
|