Section 1
//ObjectController (alternativa.engine3d.controllers.ObjectController)
package alternativa.engine3d.controllers {
import flash.events.*;
import flash.display.*;
import alternativa.types.*;
import alternativa.engine3d.core.*;
import alternativa.engine3d.physics.*;
import alternativa.utils.*;
import flash.utils.*;
import alternativa.engine3d.*;
public class ObjectController {
protected var _enabled:Boolean;// = true
protected var keyBindings:Map;
protected var _mouseSensitivity:Number;// = 1
protected var _keyboardEnabled:Boolean;
protected var _right:Boolean;
protected var _speedMultiplier:Number;// = 2
public var onStopMoving:Function;
protected var _up:Boolean;
protected var _coords:Point3D;
protected var _speed:Number;// = 100
protected var _yawRight:Boolean;
protected var _collider:EllipsoidCollider;
protected var _object:Object3D;
protected var _mouseSensitivityX:Number;
protected var _mouseSensitivityY:Number;
protected var startMouseCoords:Point3D;
protected var _eventsSource:DisplayObject;
protected var _yawSpeed:Number;// = 1
protected var _accelerate:Boolean;
protected var _down:Boolean;
protected var _pitchDown:Boolean;
protected var _forward:Boolean;
protected var _mouseCoefficientX:Number;
protected var _mouseCoefficientY:Number;
protected var _pitchSpeed:Number;// = 1
protected var _isMoving:Boolean;
public var checkCollisions:Boolean;
protected var _mouseEnabled:Boolean;
protected var _pitchUp:Boolean;
protected var _back:Boolean;
protected var _mouseLookActive:Boolean;
protected var _yawLeft:Boolean;
protected var actionBindings:Map;
protected var _left:Boolean;
protected var lastFrameTime:uint;
public var onStartMoving:Function;
private var _displacement:Point3D;
public static const ACTION_PITCH_UP:String = "ACTION_PITCH_UP";
public static const ACTION_UP:String = "ACTION_UP";
public static const ACTION_MOUSE_LOOK:String = "ACTION_MOUSE_LOOK";
public static const ACTION_PITCH_DOWN:String = "ACTION_PITCH_DOWN";
public static const ACTION_DOWN:String = "ACTION_DOWN";
public static const ACTION_YAW_LEFT:String = "ACTION_YAW_LEFT";
public static const ACTION_LEFT:String = "ACTION_LEFT";
public static const ACTION_YAW_RIGHT:String = "ACTION_YAW_RIGHT";
public static const ACTION_RIGHT:String = "ACTION_RIGHT";
public static const ACTION_BACK:String = "ACTION_BACK";
public static const ACTION_FORWARD:String = "ACTION_FORWARD";
public static const ACTION_ACCELERATE:String = "ACTION_ACCELERATE";
public function ObjectController(_arg1:DisplayObject){
startMouseCoords = new Point3D();
keyBindings = new Map();
actionBindings = new Map();
_mouseSensitivityY = (Math.PI / 360);
_mouseSensitivityX = (Math.PI / 360);
_mouseCoefficientY = (_mouseSensitivity * _mouseSensitivityY);
_mouseCoefficientX = (_mouseSensitivity * _mouseSensitivityX);
_coords = new Point3D();
_collider = new EllipsoidCollider();
_displacement = new Point3D();
super();
if (_arg1 == null){
throw (new ArgumentError((ObjectUtils.getClassName(this) + ": eventsSourceObject is null")));
};
_eventsSource = _arg1;
actionBindings[ACTION_FORWARD] = moveForward;
actionBindings[ACTION_BACK] = moveBack;
actionBindings[ACTION_LEFT] = moveLeft;
actionBindings[ACTION_RIGHT] = moveRight;
actionBindings[ACTION_UP] = moveUp;
actionBindings[ACTION_DOWN] = moveDown;
actionBindings[ACTION_PITCH_UP] = pitchUp;
actionBindings[ACTION_PITCH_DOWN] = pitchDown;
actionBindings[ACTION_YAW_LEFT] = yawLeft;
actionBindings[ACTION_YAW_RIGHT] = yawRight;
actionBindings[ACTION_ACCELERATE] = accelerate;
actionBindings[ACTION_MOUSE_LOOK] = setMouseLook;
keyboardEnabled = true;
mouseEnabled = true;
}
public function pitchDown(_arg1:Boolean):void{
_pitchDown = _arg1;
}
public function moveDown(_arg1:Boolean):void{
_down = _arg1;
}
public function yawLeft(_arg1:Boolean):void{
_yawLeft = _arg1;
}
public function get yawSpeed():Number{
return (_yawSpeed);
}
public function get coords():Point3D{
return (_coords.clone());
}
public function get accelerated():Boolean{
return (_accelerate);
}
public function setDefaultBindings():void{
}
public function set yawSpeed(_arg1:Number):void{
_yawSpeed = _arg1;
}
public function unbindKey(_arg1:uint):void{
keyBindings.remove(_arg1);
}
protected function stopMouseLook():void{
}
public function set coords(_arg1:Point3D):void{
_coords.copy(_arg1);
setObjectCoords();
}
public function get object():Object3D{
return (_object);
}
protected function unregisterKeyboardListeners():void{
_eventsSource.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyboardEvent);
_eventsSource.removeEventListener(KeyboardEvent.KEY_UP, onKeyboardEvent);
}
public function get speed():Number{
return (_speed);
}
public function get enabled():Boolean{
return (_enabled);
}
public function readCoords(_arg1:Point3D):void{
_arg1.copy(_coords);
}
public function moveBack(_arg1:Boolean):void{
_back = _arg1;
}
public function get keyboardEnabled():Boolean{
return (_keyboardEnabled);
}
public function moveUp(_arg1:Boolean):void{
_up = _arg1;
}
private function onKeyboardEvent(_arg1:KeyboardEvent):void{
var _local2:Function = keyBindings[_arg1.keyCode];
if (_local2 != null){
_local2.call(this, (_arg1.type == KeyboardEvent.KEY_DOWN));
};
}
public function get speedMultiplier():Number{
return (_speedMultiplier);
}
public function unbindAll():void{
keyBindings.clear();
}
private function onMouseUp(_arg1:MouseEvent):void{
setMouseLook(false);
_eventsSource.stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
public function moveLeft(_arg1:Boolean):void{
_left = _arg1;
}
public function set mouseSensitivity(_arg1:Number):void{
_mouseSensitivity = _arg1;
_mouseCoefficientY = (_mouseSensitivity * _mouseSensitivityY);
_mouseCoefficientX = (_mouseSensitivity * _mouseSensitivityX);
}
protected function unregisterMouseListeners():void{
_eventsSource.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
_eventsSource.stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
public function set object(_arg1:Object3D):void{
_object = _arg1;
_collider.scene = ((_object == null)) ? null : _object.scene;
setObjectCoords();
}
public function set enabled(_arg1:Boolean):void{
_enabled = _arg1;
}
public function set speed(_arg1:Number):void{
_speed = ((_arg1 < 0)) ? -(_arg1) : _arg1;
}
protected function rotateObject(_arg1:Number):void{
}
protected function getDisplacement(_arg1:Number, _arg2:Point3D):void{
}
public function processInput():void{
if (((!(_enabled)) || ((_object == null)))){
return;
};
var _local1:Number = (getTimer() - lastFrameTime);
if (_local1 == 0){
return;
};
lastFrameTime = (lastFrameTime + _local1);
if (_local1 > 100){
_local1 = 100;
};
_local1 = (_local1 / 1000);
rotateObject(_local1);
getDisplacement(_local1, _displacement);
applyDisplacement(_local1, _displacement);
if (((_object.changeRotationOrScaleOperation.queued) || (_object.changeCoordsOperation.queued))){
if (!_isMoving){
_isMoving = true;
if (onStartMoving != null){
onStartMoving.call(this);
};
};
} else {
if (_isMoving){
_isMoving = false;
if (onStopMoving != null){
onStopMoving.call(this);
};
};
};
}
protected function registerMouseListeners():void{
_eventsSource.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
}
public function setMouseLook(_arg1:Boolean):void{
if (_mouseLookActive != _arg1){
_mouseLookActive = _arg1;
if (_mouseLookActive){
startMouseLook();
} else {
stopMouseLook();
};
};
}
protected function applyDisplacement(_arg1:Number, _arg2:Point3D):void{
}
protected function startMouseLook():void{
startMouseCoords.x = _eventsSource.stage.mouseX;
startMouseCoords.y = _eventsSource.stage.mouseY;
}
public function moveForward(_arg1:Boolean):void{
_forward = _arg1;
}
protected function registerKeyboardListeners():void{
_eventsSource.addEventListener(KeyboardEvent.KEY_DOWN, onKeyboardEvent);
_eventsSource.addEventListener(KeyboardEvent.KEY_UP, onKeyboardEvent);
}
public function set mouseEnabled(_arg1:Boolean):void{
if (_mouseEnabled != _arg1){
_mouseEnabled = _arg1;
if (_mouseEnabled){
registerMouseListeners();
} else {
unregisterMouseListeners();
};
};
}
public function get mouseSensitivity():Number{
return (_mouseSensitivity);
}
protected function setObjectCoords():void{
if (_object != null){
_object.coords = _coords;
};
}
public function set mouseSensitivityY(_arg1:Number):void{
_mouseSensitivityY = _arg1;
_mouseCoefficientY = (_mouseSensitivity * _mouseSensitivityY);
}
public function set pitchSpeed(_arg1:Number):void{
_pitchSpeed = _arg1;
}
public function set speedMultiplier(_arg1:Number):void{
_speedMultiplier = _arg1;
}
public function moveRight(_arg1:Boolean):void{
_right = _arg1;
}
public function set mouseSensitivityX(_arg1:Number):void{
_mouseSensitivityX = _arg1;
_mouseCoefficientX = (_mouseSensitivity * _mouseSensitivityX);
}
public function set keyboardEnabled(_arg1:Boolean):void{
if (_keyboardEnabled != _arg1){
_keyboardEnabled = _arg1;
if (_keyboardEnabled){
registerKeyboardListeners();
} else {
unregisterKeyboardListeners();
};
};
}
public function get mouseEnabled():Boolean{
return (_mouseEnabled);
}
public function accelerate(_arg1:Boolean):void{
_accelerate = _arg1;
}
public function get mouseSensitivityX():Number{
return (_mouseSensitivityX);
}
public function get mouseSensitivityY():Number{
return (_mouseSensitivityY);
}
private function onMouseDown(_arg1:MouseEvent):void{
setMouseLook(true);
_eventsSource.stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
public function get pitchSpeed():Number{
return (_pitchSpeed);
}
public function bindKey(_arg1:uint, _arg2:String):void{
var _local3:Function = actionBindings[_arg2];
if (_local3 != null){
keyBindings[_arg1] = _local3;
};
}
public function yawRight(_arg1:Boolean):void{
_yawRight = _arg1;
}
public function get collider():EllipsoidCollider{
return (_collider);
}
public function pitchUp(_arg1:Boolean):void{
_pitchUp = _arg1;
}
}
}//package alternativa.engine3d.controllers
Section 2
//WalkController (alternativa.engine3d.controllers.WalkController)
package alternativa.engine3d.controllers {
import flash.display.*;
import alternativa.types.*;
import alternativa.engine3d.core.*;
import alternativa.engine3d.physics.*;
import alternativa.utils.*;
public class WalkController extends ObjectController {
private var _airControlCoefficient:Number;// = 1
private var _objectZPosition:Number;// = 0.5
private var destination:Point3D;
private var tmpVelocity:Point3D;
private var _onGround:Boolean;
private var _currentSpeed:Number;// = 0
public var jumpSpeed:Number;// = 0
private var _groundMesh:Mesh;
private var collision:Collision;
public var gravity:Number;// = 0
private var minGroundCos:Number;
private var controlsActive:Boolean;
private var velocity:Point3D;
private var startRotX:Number;
public var speedThreshold:Number;// = 1
private var startRotZ:Number;
private var currentMouseCoords:Point3D;
private var prevMouseCoords:Point3D;
private var inJump:Boolean;
private var _flyMode:Boolean;
public function WalkController(_arg1:DisplayObject){
minGroundCos = Math.cos(MathUtils.toRadian(70));
destination = new Point3D();
collision = new Collision();
velocity = new Point3D();
tmpVelocity = new Point3D();
prevMouseCoords = new Point3D();
currentMouseCoords = new Point3D();
super(_arg1);
}
public function get airControlCoefficient():Number{
return (_airControlCoefficient);
}
public function set airControlCoefficient(_arg1:Number):void{
_airControlCoefficient = ((_arg1 > 0)) ? _arg1 : -(_arg1);
}
public function get maxGroundAngle():Number{
return (Math.acos(minGroundCos));
}
override protected function getDisplacement(_arg1:Number, _arg2:Point3D):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local9:Matrix3D;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local3:Number = 0;
if (((checkCollisions) && (!(_flyMode)))){
_arg2.x = 0;
_arg2.y = 0;
_arg2.z = (((-0.5 * gravity) * _arg1) * _arg1);
if (_collider.getCollision(_coords, _arg2, collision)){
_local3 = collision.normal.z;
_groundMesh = collision.face._mesh;
} else {
_groundMesh = null;
};
};
_onGround = (_local3 > minGroundCos);
if (((_onGround) && (inJump))){
inJump = false;
};
controlsActive = ((((((((((_forward) || (_back))) || (_right))) || (_left))) || (_up))) || (_down));
if (controlsActive){
if (_flyMode){
tmpVelocity.x = 0;
tmpVelocity.y = 0;
tmpVelocity.z = 0;
if (_forward){
tmpVelocity.y = 1;
} else {
if (_back){
tmpVelocity.y = -1;
};
};
if (_right){
tmpVelocity.x = 1;
} else {
if (_left){
tmpVelocity.x = -1;
};
};
if (_up){
tmpVelocity.z = 1;
} else {
if (_down){
tmpVelocity.z = -1;
};
};
_local9 = _object.transformation;
_local5 = tmpVelocity.x;
if ((_object is Camera3D)){
_local6 = -(tmpVelocity.z);
_local7 = tmpVelocity.y;
} else {
_local6 = tmpVelocity.y;
_local7 = tmpVelocity.z;
};
velocity.x = (velocity.x + ((((_local5 * _local9.a) + (_local6 * _local9.b)) + (_local7 * _local9.c)) * _speed));
velocity.y = (velocity.y + ((((_local5 * _local9.e) + (_local6 * _local9.f)) + (_local7 * _local9.g)) * _speed));
velocity.z = (velocity.z + ((((_local5 * _local9.i) + (_local6 * _local9.j)) + (_local7 * _local9.k)) * _speed));
} else {
_local10 = _object.rotationZ;
_local11 = Math.cos(_local10);
_local12 = Math.sin(_local10);
_local13 = _speed;
if (((!((gravity == 0))) && (!(_onGround)))){
_local13 = (_local13 * _airControlCoefficient);
};
if (_forward){
velocity.x = (velocity.x - (_local13 * _local12));
velocity.y = (velocity.y + (_local13 * _local11));
} else {
if (_back){
velocity.x = (velocity.x + (_local13 * _local12));
velocity.y = (velocity.y - (_local13 * _local11));
};
};
if (_right){
velocity.x = (velocity.x + (_local13 * _local11));
velocity.y = (velocity.y + (_local13 * _local12));
} else {
if (_left){
velocity.x = (velocity.x - (_local13 * _local11));
velocity.y = (velocity.y - (_local13 * _local12));
};
};
if (gravity == 0){
if (_up){
velocity.z = (velocity.z + _speed);
} else {
if (_down){
velocity.z = (velocity.z - _speed);
};
};
};
};
} else {
_local4 = (1 / Math.pow(3, (_arg1 * 10)));
if (((_flyMode) || ((gravity == 0)))){
velocity.x = (velocity.x * _local4);
velocity.y = (velocity.y * _local4);
velocity.z = (velocity.z * _local4);
} else {
if (_onGround){
velocity.x = (velocity.x * _local4);
velocity.y = (velocity.y * _local4);
if (velocity.z < 0){
velocity.z = (velocity.z * _local4);
};
} else {
if ((((_local3 > 0)) && ((velocity.z > 0)))){
velocity.z = 0;
};
};
};
};
if (((((_onGround) && (_up))) && (!(inJump)))){
velocity.z = jumpSpeed;
inJump = true;
_onGround = false;
_local3 = 0;
};
if (!((_flyMode) || (_onGround))){
velocity.z = (velocity.z - (gravity * _arg1));
};
var _local8:Number = (_accelerate) ? (_speed * _speedMultiplier) : _speed;
if (((_flyMode) || ((gravity == 0)))){
_local4 = velocity.length;
if (_local4 > _local8){
velocity.length = _local8;
};
} else {
_local4 = Math.sqrt(((velocity.x * velocity.x) + (velocity.y * velocity.y)));
if (_local4 > _local8){
velocity.x = (velocity.x * (_local8 / _local4));
velocity.y = (velocity.y * (_local8 / _local4));
};
if ((((_local3 > 0)) && ((velocity.z > 0)))){
velocity.z = 0;
};
};
_arg2.x = (velocity.x * _arg1);
_arg2.y = (velocity.y * _arg1);
_arg2.z = (velocity.z * _arg1);
}
public function set objectZPosition(_arg1:Number):void{
_objectZPosition = _arg1;
setObjectCoords();
}
public function set maxGroundAngle(_arg1:Number):void{
minGroundCos = Math.cos(_arg1);
}
public function get groundMesh():Mesh{
return (_groundMesh);
}
override protected function startMouseLook():void{
super.startMouseLook();
startRotX = ((_object is Camera3D)) ? (_object.rotationX + MathUtils.DEG90) : _object.rotationX;
startRotZ = _object.rotationZ;
}
override protected function applyDisplacement(_arg1:Number, _arg2:Point3D):void{
if (checkCollisions){
_collider.calculateDestination(_coords, _arg2, destination);
_arg2.x = (destination.x - _coords.x);
_arg2.y = (destination.y - _coords.y);
_arg2.z = (destination.z - _coords.z);
} else {
destination.x = (_coords.x + _arg2.x);
destination.y = (_coords.y + _arg2.y);
destination.z = (_coords.z + _arg2.z);
};
velocity.x = (_arg2.x / _arg1);
velocity.y = (_arg2.y / _arg1);
velocity.z = (_arg2.z / _arg1);
_coords.x = destination.x;
_coords.y = destination.y;
_coords.z = destination.z;
setObjectCoords();
var _local3:Number = Math.sqrt((((velocity.x * velocity.x) + (velocity.y * velocity.y)) + (velocity.z * velocity.z)));
if (_local3 < speedThreshold){
velocity.x = 0;
velocity.y = 0;
velocity.z = 0;
_currentSpeed = 0;
} else {
_currentSpeed = _local3;
};
}
public function lookAt(_arg1:Point3D):void{
if (_object == null){
return;
};
var _local2:Number = (_arg1.x - _object.x);
var _local3:Number = (_arg1.y - _object.y);
var _local4:Number = (_arg1.z - _object.z);
_object.rotationX = (Math.atan2(_local4, Math.sqrt(((_local2 * _local2) + (_local3 * _local3)))) - ((_object is Camera3D)) ? MathUtils.DEG90 : 0);
_object.rotationY = 0;
_object.rotationZ = -(Math.atan2(_local2, _local3));
}
override public function setDefaultBindings():void{
unbindAll();
bindKey(KeyboardUtils.W, ACTION_FORWARD);
bindKey(KeyboardUtils.S, ACTION_BACK);
bindKey(KeyboardUtils.A, ACTION_LEFT);
bindKey(KeyboardUtils.D, ACTION_RIGHT);
bindKey(KeyboardUtils.SPACE, ACTION_UP);
bindKey(KeyboardUtils.CONTROL, ACTION_DOWN);
bindKey(KeyboardUtils.UP, ACTION_PITCH_UP);
bindKey(KeyboardUtils.DOWN, ACTION_PITCH_DOWN);
bindKey(KeyboardUtils.LEFT, ACTION_YAW_LEFT);
bindKey(KeyboardUtils.RIGHT, ACTION_YAW_RIGHT);
bindKey(KeyboardUtils.SHIFT, ACTION_ACCELERATE);
bindKey(KeyboardUtils.M, ACTION_MOUSE_LOOK);
}
public function get flyMode():Boolean{
return (_flyMode);
}
override protected function setObjectCoords():void{
if (_object != null){
_object.x = _coords.x;
_object.y = _coords.y;
_object.z = (_coords.z + (((2 * _objectZPosition) - 1) * _collider.radiusZ));
};
}
public function get objectZPosition():Number{
return (_objectZPosition);
}
public function get onGround():Boolean{
return (_onGround);
}
public function set flyMode(_arg1:Boolean):void{
_flyMode = _arg1;
}
override protected function rotateObject(_arg1:Number):void{
var _local2:Number;
if (_mouseLookActive){
prevMouseCoords.copy(currentMouseCoords);
currentMouseCoords.x = _eventsSource.stage.mouseX;
currentMouseCoords.y = _eventsSource.stage.mouseY;
if (!prevMouseCoords.equals(currentMouseCoords)){
_object.rotationZ = (startRotZ + ((startMouseCoords.x - currentMouseCoords.x) * _mouseCoefficientX));
_local2 = (startRotX + ((startMouseCoords.y - currentMouseCoords.y) * _mouseCoefficientY));
if ((_object is Camera3D)){
_object.rotationX = ((_local2)>MathUtils.DEG90) ? 0 : ((_local2)<-(MathUtils.DEG90)) ? -(Math.PI) : (_local2 - MathUtils.DEG90);
} else {
_object.rotationX = ((_local2)>MathUtils.DEG90) ? MathUtils.DEG90 : ((_local2)<-(MathUtils.DEG90)) ? -(MathUtils.DEG90) : _local2;
};
};
};
if (_yawLeft){
_object.rotationZ = (_object.rotationZ + (_yawSpeed * _arg1));
} else {
if (_yawRight){
_object.rotationZ = (_object.rotationZ - (_yawSpeed * _arg1));
};
};
_local2 = NaN;
if (_pitchUp){
_local2 = (_object.rotationX + (_pitchSpeed * _arg1));
} else {
if (_pitchDown){
_local2 = (_object.rotationX - (_pitchSpeed * _arg1));
};
};
if (!isNaN(_local2)){
if ((_object is Camera3D)){
_object.rotationX = ((_local2)>0) ? 0 : ((_local2)<-(Math.PI)) ? -(Math.PI) : _local2;
} else {
_object.rotationX = ((_local2)>MathUtils.DEG90) ? MathUtils.DEG90 : ((_local2)<-(MathUtils.DEG90)) ? -(MathUtils.DEG90) : _local2;
};
};
}
public function get currentSpeed():Number{
return (_currentSpeed);
}
}
}//package alternativa.engine3d.controllers
Section 3
//BSPNode (alternativa.engine3d.core.BSPNode)
package alternativa.engine3d.core {
import alternativa.types.*;
import alternativa.engine3d.*;
public final class BSPNode {
alternativa3d var normal:Point3D;
alternativa3d var front:BSPNode;
alternativa3d var parent:BSPNode;
alternativa3d var mobility:int;// = 2147483647
alternativa3d var offset:Number;
alternativa3d var back:BSPNode;
alternativa3d var backPrimitives:Set;
alternativa3d var frontPrimitives:Set;
alternativa3d var primitive:PolyPrimitive;
private static var collector:Array = new Array();
public function BSPNode(){
normal = new Point3D();
super();
}
alternativa3d static function createBSPNode(_arg1:PolyPrimitive):BSPNode{
var _local2:BSPNode;
_local2 = collector.pop();
if (_local2 == null){
_local2 = new (BSPNode);
};
_local2.primitive = _arg1;
_arg1.node = _local2;
_local2.normal.copy(_arg1.face.globalNormal);
_local2.offset = _arg1.face.globalOffset;
_local2.mobility = _arg1.mobility;
return (_local2);
}
alternativa3d static function destroyBSPNode(_arg1:BSPNode):void{
collector.push(_arg1);
}
}
}//package alternativa.engine3d.core
Section 4
//Camera3D (alternativa.engine3d.core.Camera3D)
package alternativa.engine3d.core {
import alternativa.types.*;
import alternativa.engine3d.materials.*;
import flash.geom.*;
import alternativa.engine3d.display.*;
import alternativa.engine3d.*;
public class Camera3D extends Object3D {
alternativa3d var _view:View;
private var textureA:Point3D;
private var textureB:Point3D;
private var textureC:Point3D;
alternativa3d var _fov:Number;// = 1.5707963267949
private var currentSkin:Skin;
private var topPlane:Point3D;
private var leftPlane:Point3D;
alternativa3d var _orthographic:Boolean;// = false
alternativa3d var focalLength:Number;
private var bottomOffset:Number;
private var viewAngle:Number;
private var rightPlane:Point3D;
private var _zoom:Number;// = 1
private var points1:Array;
private var points2:Array;
alternativa3d var uvMatricesCalculated:Set;
private var cameraMatrix:Matrix3D;
private var topOffset:Number;
alternativa3d var calculatePlanesOperation:Operation;
private var firstSkin:Skin;
private var rightOffset:Number;
private var prevSkin:Skin;
alternativa3d var calculateMatrixOperation:Operation;
alternativa3d var focalDistortion:Number;
private var bottomPlane:Point3D;
private var fullDraw:Boolean;
alternativa3d var renderOperation:Operation;
private var leftOffset:Number;
private var direction:Point3D;
private static var counter:uint = 0;
public function Camera3D(_arg1:String=null){
calculateMatrixOperation = new Operation("calculateMatrix", this, calculateMatrix, Operation.CAMERA_CALCULATE_MATRIX);
calculatePlanesOperation = new Operation("calculatePlanes", this, calculatePlanes, Operation.CAMERA_CALCULATE_PLANES);
renderOperation = new Operation("render", this, render, Operation.CAMERA_RENDER);
uvMatricesCalculated = new Set(true);
textureA = new Point3D();
textureB = new Point3D();
textureC = new Point3D();
direction = new Point3D(0, 0, 1);
cameraMatrix = new Matrix3D();
leftPlane = new Point3D();
rightPlane = new Point3D();
topPlane = new Point3D();
bottomPlane = new Point3D();
points1 = new Array();
points2 = new Array();
super(_arg1);
}
private function insertCurrentSkin():void{
var _local1:Skin = Skin.createSkin();
_view.canvas.addChildAt(_local1, _view.canvas.getChildIndex(currentSkin));
_local1.nextSkin = currentSkin;
if (prevSkin == null){
firstSkin = _local1;
} else {
prevSkin.nextSkin = _local1;
};
currentSkin = _local1;
}
public function set fov(_arg1:Number):void{
_arg1 = ((_arg1)<0) ? 0 : ((_arg1)>(Math.PI - 0.0001)) ? (Math.PI - 0.0001) : _arg1;
if (_fov != _arg1){
if (!_orthographic){
addOperationToScene(calculatePlanesOperation);
};
_fov = _arg1;
};
}
alternativa3d function removeFromView(_arg1:View):void{
firstSkin = null;
calculateTransformationOperation.removeSequel(calculateMatrixOperation);
calculateMatrixOperation.removeSequel(calculatePlanesOperation);
calculatePlanesOperation.removeSequel(renderOperation);
if (_scene != null){
_scene.removeOperation(calculateMatrixOperation);
_scene.removeOperation(calculatePlanesOperation);
_scene.removeOperation(renderOperation);
_scene.changePrimitivesOperation.removeSequel(renderOperation);
};
_view = null;
}
public function set zoom(_arg1:Number):void{
_arg1 = ((_arg1)<0) ? 0 : _arg1;
if (_zoom != _arg1){
if (_orthographic){
addOperationToScene(calculateMatrixOperation);
};
_zoom = _arg1;
};
}
alternativa3d function calculateUVMatrix(_arg1:Face, _arg2:uint, _arg3:uint):void{
var _local4:Point3D = _arg1.primitive.points[0];
textureA.x = (((cameraMatrix.a * _local4.x) + (cameraMatrix.b * _local4.y)) + (cameraMatrix.c * _local4.z));
textureA.y = (((cameraMatrix.e * _local4.x) + (cameraMatrix.f * _local4.y)) + (cameraMatrix.g * _local4.z));
_local4 = _arg1.primitive.points[1];
textureB.x = (((cameraMatrix.a * _local4.x) + (cameraMatrix.b * _local4.y)) + (cameraMatrix.c * _local4.z));
textureB.y = (((cameraMatrix.e * _local4.x) + (cameraMatrix.f * _local4.y)) + (cameraMatrix.g * _local4.z));
_local4 = _arg1.primitive.points[2];
textureC.x = (((cameraMatrix.a * _local4.x) + (cameraMatrix.b * _local4.y)) + (cameraMatrix.c * _local4.z));
textureC.y = (((cameraMatrix.e * _local4.x) + (cameraMatrix.f * _local4.y)) + (cameraMatrix.g * _local4.z));
var _local5:Number = (textureB.x - textureA.x);
var _local6:Number = (textureB.y - textureA.y);
var _local7:Number = (textureC.x - textureA.x);
var _local8:Number = (textureC.y - textureA.y);
var _local9:Matrix = _arg1.uvMatrixBase;
var _local10:Matrix = _arg1.uvMatrix;
_local10.a = (((_local9.a * _local5) + (_local9.b * _local7)) / _arg2);
_local10.b = (((_local9.a * _local6) + (_local9.b * _local8)) / _arg2);
_local10.c = (-(((_local9.c * _local5) + (_local9.d * _local7))) / _arg3);
_local10.d = (-(((_local9.c * _local6) + (_local9.d * _local8))) / _arg3);
_local10.tx = (((((_local9.tx + _local9.c) * _local5) + ((_local9.ty + _local9.d) * _local7)) + textureA.x) + cameraMatrix.d);
_local10.ty = (((((_local9.tx + _local9.c) * _local6) + ((_local9.ty + _local9.d) * _local8)) + textureA.y) + cameraMatrix.h);
uvMatricesCalculated[_arg1] = true;
}
public function get orthographic():Boolean{
return (_orthographic);
}
public function get view():View{
return (_view);
}
private function render():void{
fullDraw = ((calculateMatrixOperation.queued) || (calculatePlanesOperation.queued));
uvMatricesCalculated.clear();
prevSkin = null;
currentSkin = firstSkin;
renderBSPNode(_scene.bsp);
while (currentSkin != null) {
removeCurrentSkin();
};
}
override protected function clonePropertiesFrom(_arg1:Object3D):void{
super.clonePropertiesFrom(_arg1);
var _local2:Camera3D = Camera3D(_arg1);
orthographic = _local2._orthographic;
zoom = _local2._zoom;
fov = _local2._fov;
}
private function calculatePlanes():void{
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 _local1:Number = (_view._width * 0.5);
var _local2:Number = (_view._height * 0.5);
var _local3:Number = (transformation.a * _local1);
var _local4:Number = (transformation.e * _local1);
var _local5:Number = (transformation.i * _local1);
var _local6:Number = (transformation.b * _local2);
var _local7:Number = (transformation.f * _local2);
var _local8:Number = (transformation.j * _local2);
if (_orthographic){
_local3 = (_local3 / _zoom);
_local4 = (_local4 / _zoom);
_local5 = (_local5 / _zoom);
_local6 = (_local6 / _zoom);
_local7 = (_local7 / _zoom);
_local8 = (_local8 / _zoom);
leftPlane.x = ((transformation.f * transformation.k) - (transformation.j * transformation.g));
leftPlane.y = ((transformation.j * transformation.c) - (transformation.b * transformation.k));
leftPlane.z = ((transformation.b * transformation.g) - (transformation.f * transformation.c));
leftOffset = ((((transformation.d - _local3) * leftPlane.x) + ((transformation.h - _local4) * leftPlane.y)) + ((transformation.l - _local5) * leftPlane.z));
rightPlane.x = -(leftPlane.x);
rightPlane.y = -(leftPlane.y);
rightPlane.z = -(leftPlane.z);
rightOffset = ((((transformation.d + _local3) * rightPlane.x) + ((transformation.h + _local4) * rightPlane.y)) + ((transformation.l + _local5) * rightPlane.z));
topPlane.x = ((transformation.g * transformation.i) - (transformation.k * transformation.e));
topPlane.y = ((transformation.k * transformation.a) - (transformation.c * transformation.i));
topPlane.z = ((transformation.c * transformation.e) - (transformation.g * transformation.a));
topOffset = ((((transformation.d - _local6) * topPlane.x) + ((transformation.h - _local7) * topPlane.y)) + ((transformation.l - _local8) * topPlane.z));
bottomPlane.x = -(topPlane.x);
bottomPlane.y = -(topPlane.y);
bottomPlane.z = -(topPlane.z);
bottomOffset = ((((transformation.d + _local6) * bottomPlane.x) + ((transformation.h + _local7) * bottomPlane.y)) + ((transformation.l + _local8) * bottomPlane.z));
} else {
focalLength = ((Math.sqrt(((_view._width * _view._width) + (_view._height * _view._height))) * 0.5) / Math.tan((0.5 * _fov)));
focalDistortion = (1 / (focalLength * focalLength));
_local9 = (transformation.c * focalLength);
_local10 = (transformation.g * focalLength);
_local11 = (transformation.k * focalLength);
_local12 = ((-(_local3) - _local6) + _local9);
_local13 = ((-(_local4) - _local7) + _local10);
_local14 = ((-(_local5) - _local8) + _local11);
_local15 = ((_local3 - _local6) + _local9);
_local16 = ((_local4 - _local7) + _local10);
_local17 = ((_local5 - _local8) + _local11);
_local18 = ((-(_local3) + _local6) + _local9);
_local19 = ((-(_local4) + _local7) + _local10);
_local20 = ((-(_local5) + _local8) + _local11);
_local21 = ((_local3 + _local6) + _local9);
_local22 = ((_local4 + _local7) + _local10);
_local23 = ((_local5 + _local8) + _local11);
leftPlane.x = ((_local19 * _local14) - (_local20 * _local13));
leftPlane.y = ((_local20 * _local12) - (_local18 * _local14));
leftPlane.z = ((_local18 * _local13) - (_local19 * _local12));
leftOffset = (((transformation.d * leftPlane.x) + (transformation.h * leftPlane.y)) + (transformation.l * leftPlane.z));
rightPlane.x = ((_local16 * _local23) - (_local17 * _local22));
rightPlane.y = ((_local17 * _local21) - (_local15 * _local23));
rightPlane.z = ((_local15 * _local22) - (_local16 * _local21));
rightOffset = (((transformation.d * rightPlane.x) + (transformation.h * rightPlane.y)) + (transformation.l * rightPlane.z));
topPlane.x = ((_local13 * _local17) - (_local14 * _local16));
topPlane.y = ((_local14 * _local15) - (_local12 * _local17));
topPlane.z = ((_local12 * _local16) - (_local13 * _local15));
topOffset = (((transformation.d * topPlane.x) + (transformation.h * topPlane.y)) + (transformation.l * topPlane.z));
bottomPlane.x = ((_local22 * _local20) - (_local23 * _local19));
bottomPlane.y = ((_local23 * _local18) - (_local21 * _local20));
bottomPlane.z = ((_local21 * _local19) - (_local22 * _local18));
bottomOffset = (((transformation.d * bottomPlane.x) + (transformation.h * bottomPlane.y)) + (transformation.l * bottomPlane.z));
_local24 = Math.sqrt((((_local12 * _local12) + (_local13 * _local13)) + (_local14 * _local14)));
_local12 = (_local12 / _local24);
_local13 = (_local13 / _local24);
_local14 = (_local14 / _local24);
_local24 = Math.sqrt((((_local15 * _local15) + (_local16 * _local16)) + (_local17 * _local17)));
_local15 = (_local15 / _local24);
_local16 = (_local16 / _local24);
_local17 = (_local17 / _local24);
_local24 = Math.sqrt((((_local18 * _local18) + (_local19 * _local19)) + (_local20 * _local20)));
_local18 = (_local18 / _local24);
_local19 = (_local19 / _local24);
_local20 = (_local20 / _local24);
_local24 = Math.sqrt((((_local21 * _local21) + (_local22 * _local22)) + (_local23 * _local23)));
_local21 = (_local21 / _local24);
_local22 = (_local22 / _local24);
_local23 = (_local23 / _local24);
viewAngle = (((_local12 * direction.x) + (_local13 * direction.y)) + (_local14 * direction.z));
_local25 = (((_local15 * direction.x) + (_local16 * direction.y)) + (_local17 * direction.z));
viewAngle = ((_local25)<viewAngle) ? _local25 : viewAngle;
_local25 = (((_local18 * direction.x) + (_local19 * direction.y)) + (_local20 * direction.z));
viewAngle = ((_local25)<viewAngle) ? _local25 : viewAngle;
_local25 = (((_local21 * direction.x) + (_local22 * direction.y)) + (_local23 * direction.z));
viewAngle = ((_local25)<viewAngle) ? _local25 : viewAngle;
viewAngle = Math.sin(Math.acos(viewAngle));
};
}
alternativa3d function addToView(_arg1:View):void{
firstSkin = ((_arg1.canvas.numChildren)>0) ? Skin(_arg1.canvas.getChildAt(0)) : null;
calculateTransformationOperation.addSequel(calculateMatrixOperation);
calculateMatrixOperation.addSequel(calculatePlanesOperation);
calculatePlanesOperation.addSequel(renderOperation);
if (_scene != null){
_scene.addOperation(calculateMatrixOperation);
_scene.changePrimitivesOperation.addSequel(renderOperation);
};
_view = _arg1;
}
private function calculateMatrix():void{
cameraMatrix.copy(transformation);
cameraMatrix.invert();
if (_orthographic){
cameraMatrix.scale(_zoom, _zoom, _zoom);
};
direction.x = transformation.c;
direction.y = transformation.g;
direction.z = transformation.k;
direction.normalize();
}
public function set view(_arg1:View):void{
if (_arg1 != _view){
if (_view != null){
_view.camera = null;
};
if (_arg1 != null){
_arg1.camera = this;
};
};
}
public function get zoom():Number{
return (_zoom);
}
public function get fov():Number{
return (_fov);
}
private function clip(_arg1:uint, _arg2:Array, _arg3:Array, _arg4:Point3D, _arg5:Number, _arg6:Boolean):uint{
var _local7:uint;
var _local8:Number;
var _local10:DrawPoint;
var _local11:DrawPoint;
var _local12:DrawPoint;
var _local13:Number;
var _local14:Number;
var _local9:uint;
_local11 = _arg2[(_arg1 - 1)];
_local13 = ((((_arg4.x * _local11.x) + (_arg4.y * _local11.y)) + (_arg4.z * _local11.z)) - _arg5);
if (_arg6){
_local7 = 0;
while (_local7 < _arg1) {
_local12 = _arg2[_local7];
_local14 = ((((_arg4.x * _local12.x) + (_arg4.y * _local12.y)) + (_arg4.z * _local12.z)) - _arg5);
if (_local14 > 0){
if (_local13 <= 0){
_local8 = (_local14 / (_local14 - _local13));
_local10 = _arg3[_local9];
if (_local10 == null){
_local10 = new DrawPoint((_local12.x - ((_local12.x - _local11.x) * _local8)), (_local12.y - ((_local12.y - _local11.y) * _local8)), (_local12.z - ((_local12.z - _local11.z) * _local8)), (_local12.u - ((_local12.u - _local11.u) * _local8)), (_local12.v - ((_local12.v - _local11.v) * _local8)));
_arg3[_local9] = _local10;
} else {
_local10.x = (_local12.x - ((_local12.x - _local11.x) * _local8));
_local10.y = (_local12.y - ((_local12.y - _local11.y) * _local8));
_local10.z = (_local12.z - ((_local12.z - _local11.z) * _local8));
_local10.u = (_local12.u - ((_local12.u - _local11.u) * _local8));
_local10.v = (_local12.v - ((_local12.v - _local11.v) * _local8));
};
_local9++;
};
_local10 = _arg3[_local9];
if (_local10 == null){
_local10 = new DrawPoint(_local12.x, _local12.y, _local12.z, _local12.u, _local12.v);
_arg3[_local9] = _local10;
} else {
_local10.x = _local12.x;
_local10.y = _local12.y;
_local10.z = _local12.z;
_local10.u = _local12.u;
_local10.v = _local12.v;
};
_local9++;
} else {
if (_local13 > 0){
_local8 = (_local14 / (_local14 - _local13));
_local10 = _arg3[_local9];
if (_local10 == null){
_local10 = new DrawPoint((_local12.x - ((_local12.x - _local11.x) * _local8)), (_local12.y - ((_local12.y - _local11.y) * _local8)), (_local12.z - ((_local12.z - _local11.z) * _local8)), (_local12.u - ((_local12.u - _local11.u) * _local8)), (_local12.v - ((_local12.v - _local11.v) * _local8)));
_arg3[_local9] = _local10;
} else {
_local10.x = (_local12.x - ((_local12.x - _local11.x) * _local8));
_local10.y = (_local12.y - ((_local12.y - _local11.y) * _local8));
_local10.z = (_local12.z - ((_local12.z - _local11.z) * _local8));
_local10.u = (_local12.u - ((_local12.u - _local11.u) * _local8));
_local10.v = (_local12.v - ((_local12.v - _local11.v) * _local8));
};
_local9++;
};
};
_local13 = _local14;
_local11 = _local12;
_local7++;
};
} else {
_local7 = 0;
while (_local7 < _arg1) {
_local12 = _arg2[_local7];
_local14 = ((((_arg4.x * _local12.x) + (_arg4.y * _local12.y)) + (_arg4.z * _local12.z)) - _arg5);
if (_local14 > 0){
if (_local13 <= 0){
_local8 = (_local14 / (_local14 - _local13));
_local10 = _arg3[_local9];
if (_local10 == null){
_local10 = new DrawPoint((_local12.x - ((_local12.x - _local11.x) * _local8)), (_local12.y - ((_local12.y - _local11.y) * _local8)), (_local12.z - ((_local12.z - _local11.z) * _local8)));
_arg3[_local9] = _local10;
} else {
_local10.x = (_local12.x - ((_local12.x - _local11.x) * _local8));
_local10.y = (_local12.y - ((_local12.y - _local11.y) * _local8));
_local10.z = (_local12.z - ((_local12.z - _local11.z) * _local8));
};
_local9++;
};
_local10 = _arg3[_local9];
if (_local10 == null){
_local10 = new DrawPoint(_local12.x, _local12.y, _local12.z);
_arg3[_local9] = _local10;
} else {
_local10.x = _local12.x;
_local10.y = _local12.y;
_local10.z = _local12.z;
};
_local9++;
} else {
if (_local13 > 0){
_local8 = (_local14 / (_local14 - _local13));
_local10 = _arg3[_local9];
if (_local10 == null){
_local10 = new DrawPoint((_local12.x - ((_local12.x - _local11.x) * _local8)), (_local12.y - ((_local12.y - _local11.y) * _local8)), (_local12.z - ((_local12.z - _local11.z) * _local8)));
_arg3[_local9] = _local10;
} else {
_local10.x = (_local12.x - ((_local12.x - _local11.x) * _local8));
_local10.y = (_local12.y - ((_local12.y - _local11.y) * _local8));
_local10.z = (_local12.z - ((_local12.z - _local11.z) * _local8));
};
_local9++;
};
};
_local13 = _local14;
_local11 = _local12;
_local7++;
};
};
return (_local9);
}
override protected function createEmptyObject():Object3D{
return (new Camera3D());
}
private function drawSkin(_arg1:PolyPrimitive):void{
var _local2:Surface;
var _local3:SurfaceMaterial;
var _local4:uint;
var _local5:uint;
var _local6:Point3D;
var _local7:Point;
var _local8:DrawPoint;
var _local9:Boolean;
var _local10:Number;
var _local11:Number;
var _local12:Number;
if (((((((!(fullDraw)) && (!((currentSkin == null))))) && ((currentSkin.primitive == _arg1)))) && (!(_scene.changedPrimitives[_arg1])))){
prevSkin = currentSkin;
currentSkin = currentSkin.nextSkin;
} else {
_local2 = _arg1.face._surface;
if (_local2 == null){
return;
};
_local3 = _local2._material;
if ((((_local3 == null)) || (!(_local3.canDraw(_arg1))))){
return;
};
_local5 = _arg1.num;
_local9 = ((((!(_orthographic)) && (_local3.useUV))) && (_arg1.face.uvMatrixBase));
if (_local9){
_local4 = 0;
while (_local4 < _local5) {
_local6 = _arg1.points[_local4];
_local7 = _arg1.uvs[_local4];
_local8 = points1[_local4];
if (_local8 == null){
points1[_local4] = new DrawPoint(_local6.x, _local6.y, _local6.z, _local7.x, _local7.y);
} else {
_local8.x = _local6.x;
_local8.y = _local6.y;
_local8.z = _local6.z;
_local8.u = _local7.x;
_local8.v = _local7.y;
};
_local4++;
};
} else {
_local4 = 0;
while (_local4 < _local5) {
_local6 = _arg1.points[_local4];
_local8 = points1[_local4];
if (_local8 == null){
points1[_local4] = new DrawPoint(_local6.x, _local6.y, _local6.z);
} else {
_local8.x = _local6.x;
_local8.y = _local6.y;
_local8.z = _local6.z;
};
_local4++;
};
};
_local5 = clip(_local5, points1, points2, leftPlane, leftOffset, _local9);
if (_local5 < 3){
return;
};
_local5 = clip(_local5, points2, points1, rightPlane, rightOffset, _local9);
if (_local5 < 3){
return;
};
_local5 = clip(_local5, points1, points2, topPlane, topOffset, _local9);
if (_local5 < 3){
return;
};
_local5 = clip(_local5, points2, points1, bottomPlane, bottomOffset, _local9);
if (_local5 < 3){
return;
};
if (((fullDraw) || (_scene.changedPrimitives[_arg1]))){
if (currentSkin == null){
addCurrentSkin();
} else {
if (((fullDraw) || (_scene.changedPrimitives[currentSkin.primitive]))){
currentSkin.material.clear(currentSkin);
} else {
insertCurrentSkin();
};
};
_local4 = 0;
while (_local4 < _local5) {
_local8 = points1[_local4];
_local10 = _local8.x;
_local11 = _local8.y;
_local12 = _local8.z;
_local8.x = ((((cameraMatrix.a * _local10) + (cameraMatrix.b * _local11)) + (cameraMatrix.c * _local12)) + cameraMatrix.d);
_local8.y = ((((cameraMatrix.e * _local10) + (cameraMatrix.f * _local11)) + (cameraMatrix.g * _local12)) + cameraMatrix.h);
_local8.z = ((((cameraMatrix.i * _local10) + (cameraMatrix.j * _local11)) + (cameraMatrix.k * _local12)) + cameraMatrix.l);
_local4++;
};
currentSkin.primitive = _arg1;
currentSkin.material = _local3;
_local3.draw(this, currentSkin, _local5, points1);
prevSkin = currentSkin;
currentSkin = currentSkin.nextSkin;
} else {
while (((!((currentSkin == null))) && (_scene.changedPrimitives[currentSkin.primitive]))) {
removeCurrentSkin();
};
if (currentSkin != null){
prevSkin = currentSkin;
currentSkin = currentSkin.nextSkin;
};
};
};
}
override protected function removeFromScene(_arg1:Scene3D):void{
super.removeFromScene(_arg1);
_arg1.removeOperation(calculateMatrixOperation);
_arg1.removeOperation(calculatePlanesOperation);
_arg1.removeOperation(renderOperation);
if (_view != null){
_arg1.changePrimitivesOperation.removeSequel(renderOperation);
};
}
public function set orthographic(_arg1:Boolean):void{
if (_orthographic != _arg1){
addOperationToScene(calculateMatrixOperation);
_orthographic = _arg1;
};
}
private function renderBSPNode(_arg1:BSPNode):void{
var _local2:*;
var _local3:Point3D;
var _local4:Number;
var _local5:Number;
if (_arg1 != null){
_local3 = _arg1.normal;
_local4 = (((direction.x * _local3.x) + (direction.y * _local3.y)) + (direction.z * _local3.z));
if (!_orthographic){
_local5 = ((((globalCoords.x * _local3.x) + (globalCoords.y * _local3.y)) + (globalCoords.z * _local3.z)) - _arg1.offset);
};
if (_arg1.primitive != null){
if ((_orthographic) ? (_local4 < 0) : (_local5 > 0)){
if (((_orthographic) || ((_local4 < viewAngle)))){
renderBSPNode(_arg1.back);
drawSkin(_arg1.primitive);
};
renderBSPNode(_arg1.front);
} else {
if (((_orthographic) || ((_local4 > -(viewAngle))))){
renderBSPNode(_arg1.front);
};
renderBSPNode(_arg1.back);
};
} else {
if ((_orthographic) ? (_local4 < 0) : (_local5 > 0)){
if (((_orthographic) || ((_local4 < viewAngle)))){
renderBSPNode(_arg1.back);
for (_local2 in _arg1.frontPrimitives) {
drawSkin(_local2);
};
};
renderBSPNode(_arg1.front);
} else {
if (((_orthographic) || ((_local4 > -(viewAngle))))){
renderBSPNode(_arg1.front);
for (_local2 in _arg1.backPrimitives) {
drawSkin(_local2);
};
};
renderBSPNode(_arg1.back);
};
};
};
}
override protected function defaultName():String{
return (("camera" + ++counter));
}
private function addCurrentSkin():void{
currentSkin = Skin.createSkin();
_view.canvas.addChild(currentSkin);
if (prevSkin == null){
firstSkin = currentSkin;
} else {
prevSkin.nextSkin = currentSkin;
};
}
override protected function addToScene(_arg1:Scene3D):void{
super.addToScene(_arg1);
if (_view != null){
_arg1.addOperation(calculatePlanesOperation);
_arg1.changePrimitivesOperation.addSequel(renderOperation);
};
}
private function removeCurrentSkin():void{
var _local1:Skin = currentSkin.nextSkin;
_view.canvas.removeChild(currentSkin);
if (currentSkin.material != null){
currentSkin.material.clear(currentSkin);
};
currentSkin.nextSkin = null;
currentSkin.primitive = null;
currentSkin.material = null;
Skin.destroySkin(currentSkin);
currentSkin = _local1;
if (prevSkin == null){
firstSkin = currentSkin;
} else {
prevSkin.nextSkin = currentSkin;
};
}
}
}//package alternativa.engine3d.core
Section 5
//Face (alternativa.engine3d.core.Face)
package alternativa.engine3d.core {
import alternativa.types.*;
import flash.geom.*;
import alternativa.engine3d.*;
public final class Face {
alternativa3d var _aUV:Point;
alternativa3d var _cUV:Point;
alternativa3d var globalOffset:Number;
alternativa3d var _verticesCount:uint;
alternativa3d var calculateUVOperation:Operation;
alternativa3d var updateMaterialOperation:Operation;
alternativa3d var uvMatrixBase:Matrix;
alternativa3d var uvMatrix:Matrix;
alternativa3d var _bUV:Point;
alternativa3d var calculateFragmentsUVOperation:Operation;
alternativa3d var _mesh:Mesh;
alternativa3d var _vertices:Array;
alternativa3d var primitive:PolyPrimitive;
alternativa3d var updatePrimitiveOperation:Operation;
alternativa3d var globalNormal:Point3D;
alternativa3d var _surface:Surface;
alternativa3d var calculateNormalOperation:Operation;
public function Face(_arg1:Array){
var _local3:Vertex;
calculateNormalOperation = new Operation("calculateNormal", this, calculateNormal, Operation.FACE_CALCULATE_NORMAL);
calculateUVOperation = new Operation("calculateUV", this, calculateUV, Operation.FACE_CALCULATE_UV);
updatePrimitiveOperation = new Operation("updatePrimitive", this, updatePrimitive, Operation.FACE_UPDATE_PRIMITIVE);
updateMaterialOperation = new Operation("updateMaterial", this, updateMaterial, Operation.FACE_UPDATE_MATERIAL);
calculateFragmentsUVOperation = new Operation("calculateFragmentsUV", this, calculateFragmentsUV, Operation.FACE_CALCULATE_FRAGMENTS_UV);
globalNormal = new Point3D();
super();
_vertices = _arg1;
_verticesCount = _arg1.length;
primitive = PolyPrimitive.createPolyPrimitive();
primitive.face = this;
primitive.num = _verticesCount;
var _local2:uint;
while (_local2 < _verticesCount) {
_local3 = _arg1[_local2];
primitive.points.push(_local3.globalCoords);
primitive.uvs.push(null);
_local3.addToFace(this);
_local2++;
};
calculateNormalOperation.addSequel(updatePrimitiveOperation);
calculateUVOperation.addSequel(calculateFragmentsUVOperation);
calculateUVOperation.addSequel(updateMaterialOperation);
}
private function calculatePrimitiveUV(_arg1:PolyPrimitive):void{
var _local2:Array;
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:Array;
var _local7:Array;
var _local8:uint;
var _local9:uint;
var _local10:Point3D;
var _local11:Point;
var _local12:Point;
var _local13:Point;
var _local14:Number;
var _local15:Boolean;
var _local16:uint;
var _local17:Boolean;
if (_arg1.backFragment != null){
_local2 = _arg1.points;
_local3 = _arg1.backFragment.points;
_local4 = _arg1.frontFragment.points;
_local5 = _arg1.uvs;
_local6 = _arg1.backFragment.uvs;
_local7 = _arg1.frontFragment.uvs;
_local8 = 0;
_local9 = 0;
_local15 = true;
_local16 = 0;
while (_local16 < _arg1.num) {
_local17 = true;
_local10 = _local2[_local16];
if (_local10 == _local4[_local9]){
if (_local7[_local9] == null){
_local7[_local9] = _local5[_local16];
};
_local17 = false;
_local9++;
};
if (_local10 == _local3[_local8]){
if (_local6[_local8] == null){
_local6[_local8] = _local5[_local16];
};
_local17 = false;
_local8++;
};
if (_local17){
_local12 = _local5[((_local16)==0) ? (_arg1.num - 1) : (_local16 - 1)];
_local13 = _local5[_local16];
_local14 = (_local15) ? _arg1.splitTime1 : _arg1.splitTime2;
_local11 = _local7[_local9];
if (_local11 == null){
_local11 = new Point((_local12.x + ((_local13.x - _local12.x) * _local14)), (_local12.y + ((_local13.y - _local12.y) * _local14)));
_local7[_local9] = _local11;
_local6[_local8] = _local11;
} else {
_local11.x = (_local12.x + ((_local13.x - _local12.x) * _local14));
_local11.y = (_local12.y + ((_local13.y - _local12.y) * _local14));
};
_local15 = false;
_local9++;
_local8++;
if (_local10 == _local4[_local9]){
if (_local7[_local9] == null){
_local7[_local9] = _local5[_local16];
};
_local9++;
};
if (_local10 == _local3[_local8]){
if (_local6[_local8] == null){
_local6[_local8] = _local5[_local16];
};
_local8++;
};
};
_local16++;
};
if (_local9 < _arg1.frontFragment.num){
_local12 = _local5[(_arg1.num - 1)];
_local13 = _local5[0];
_local14 = (_local15) ? _arg1.splitTime1 : _arg1.splitTime2;
_local11 = _local7[_local9];
if (_local11 == null){
_local11 = new Point((_local12.x + ((_local13.x - _local12.x) * _local14)), (_local12.y + ((_local13.y - _local12.y) * _local14)));
_local7[_local9] = _local11;
_local6[_local8] = _local11;
} else {
_local11.x = (_local12.x + ((_local13.x - _local12.x) * _local14));
_local11.y = (_local12.y + ((_local13.y - _local12.y) * _local14));
};
};
calculatePrimitiveUV(_arg1.backFragment);
calculatePrimitiveUV(_arg1.frontFragment);
};
}
private function calculateUV():void{
var _local1:uint;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Point3D;
var _local8:Point3D;
var _local9:Point3D;
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:Point;
var _local19:Point3D;
if (((((!((_aUV == null))) && (!((_bUV == null))))) && (!((_cUV == null))))){
_local2 = (_bUV.x - _aUV.x);
_local3 = (_bUV.y - _aUV.y);
_local4 = (_cUV.x - _aUV.x);
_local5 = (_cUV.y - _aUV.y);
_local6 = ((_local2 * _local5) - (_local3 * _local4));
if (_local6 != 0){
if (uvMatrixBase == null){
uvMatrixBase = new Matrix();
uvMatrix = new Matrix();
};
uvMatrixBase.a = (_local5 / _local6);
uvMatrixBase.b = (-(_local3) / _local6);
uvMatrixBase.c = (-(_local4) / _local6);
uvMatrixBase.d = (_local2 / _local6);
uvMatrixBase.tx = -(((uvMatrixBase.a * _aUV.x) + (uvMatrixBase.c * _aUV.y)));
uvMatrixBase.ty = -(((uvMatrixBase.b * _aUV.x) + (uvMatrixBase.d * _aUV.y)));
primitive.uvs[0] = _aUV;
primitive.uvs[1] = _bUV;
primitive.uvs[2] = _cUV;
if (_verticesCount > 3){
_local7 = primitive.points[0];
_local8 = primitive.points[1];
_local9 = primitive.points[2];
if (((globalNormal.x)<0) ? -(globalNormal.x) : globalNormal.x > ((globalNormal.y)<0) ? -(globalNormal.y) : globalNormal.y){
if (((globalNormal.x)<0) ? -(globalNormal.x) : globalNormal.x > ((globalNormal.z)<0) ? -(globalNormal.z) : globalNormal.z){
_local10 = (_local8.y - _local7.y);
_local11 = (_local8.z - _local7.z);
_local12 = (_local9.y - _local7.y);
_local13 = (_local9.z - _local7.z);
_local6 = ((_local10 * _local13) - (_local12 * _local11));
_local1 = 3;
while (_local1 < _verticesCount) {
_local19 = primitive.points[_local1];
_local14 = (_local19.y - _local7.y);
_local15 = (_local19.z - _local7.z);
_local16 = (((_local14 * _local13) - (_local12 * _local15)) / _local6);
_local17 = (((_local10 * _local15) - (_local14 * _local11)) / _local6);
_local18 = primitive.uvs[_local1];
if (_local18 == null){
_local18 = new Point();
primitive.uvs[_local1] = _local18;
};
_local18.x = ((_aUV.x + (_local2 * _local16)) + (_local4 * _local17));
_local18.y = ((_aUV.y + (_local3 * _local16)) + (_local5 * _local17));
_local1++;
};
} else {
_local10 = (_local8.x - _local7.x);
_local11 = (_local8.y - _local7.y);
_local12 = (_local9.x - _local7.x);
_local13 = (_local9.y - _local7.y);
_local6 = ((_local10 * _local13) - (_local12 * _local11));
_local1 = 3;
while (_local1 < _verticesCount) {
_local19 = primitive.points[_local1];
_local14 = (_local19.x - _local7.x);
_local15 = (_local19.y - _local7.y);
_local16 = (((_local14 * _local13) - (_local12 * _local15)) / _local6);
_local17 = (((_local10 * _local15) - (_local14 * _local11)) / _local6);
_local18 = primitive.uvs[_local1];
if (_local18 == null){
_local18 = new Point();
primitive.uvs[_local1] = _local18;
};
_local18.x = ((_aUV.x + (_local2 * _local16)) + (_local4 * _local17));
_local18.y = ((_aUV.y + (_local3 * _local16)) + (_local5 * _local17));
_local1++;
};
};
} else {
if (((globalNormal.y)<0) ? -(globalNormal.y) : globalNormal.y > ((globalNormal.z)<0) ? -(globalNormal.z) : globalNormal.z){
_local10 = (_local8.x - _local7.x);
_local11 = (_local8.z - _local7.z);
_local12 = (_local9.x - _local7.x);
_local13 = (_local9.z - _local7.z);
_local6 = ((_local10 * _local13) - (_local12 * _local11));
_local1 = 3;
while (_local1 < _verticesCount) {
_local19 = primitive.points[_local1];
_local14 = (_local19.x - _local7.x);
_local15 = (_local19.z - _local7.z);
_local16 = (((_local14 * _local13) - (_local12 * _local15)) / _local6);
_local17 = (((_local10 * _local15) - (_local14 * _local11)) / _local6);
_local18 = primitive.uvs[_local1];
if (_local18 == null){
_local18 = new Point();
primitive.uvs[_local1] = _local18;
};
_local18.x = ((_aUV.x + (_local2 * _local16)) + (_local4 * _local17));
_local18.y = ((_aUV.y + (_local3 * _local16)) + (_local5 * _local17));
_local1++;
};
} else {
_local10 = (_local8.x - _local7.x);
_local11 = (_local8.y - _local7.y);
_local12 = (_local9.x - _local7.x);
_local13 = (_local9.y - _local7.y);
_local6 = ((_local10 * _local13) - (_local12 * _local11));
_local1 = 3;
while (_local1 < _verticesCount) {
_local19 = primitive.points[_local1];
_local14 = (_local19.x - _local7.x);
_local15 = (_local19.y - _local7.y);
_local16 = (((_local14 * _local13) - (_local12 * _local15)) / _local6);
_local17 = (((_local10 * _local15) - (_local14 * _local11)) / _local6);
_local18 = primitive.uvs[_local1];
if (_local18 == null){
_local18 = new Point();
primitive.uvs[_local1] = _local18;
};
_local18.x = ((_aUV.x + (_local2 * _local16)) + (_local4 * _local17));
_local18.y = ((_aUV.y + (_local3 * _local16)) + (_local5 * _local17));
_local1++;
};
};
};
};
} else {
uvMatrixBase = null;
uvMatrix = null;
_local1 = 0;
while (_local1 < _verticesCount) {
primitive.uvs[_local1] = null;
_local1++;
};
};
} else {
uvMatrixBase = null;
uvMatrix = null;
_local1 = 0;
while (_local1 < _verticesCount) {
primitive.uvs[_local1] = null;
_local1++;
};
};
}
alternativa3d function addToMesh(_arg1:Mesh):void{
_arg1.changeCoordsOperation.addSequel(updatePrimitiveOperation);
_arg1.changeRotationOrScaleOperation.addSequel(calculateNormalOperation);
_arg1.calculateMobilityOperation.addSequel(updatePrimitiveOperation);
_mesh = _arg1;
}
public function set aUV(_arg1:Point):void{
if (_aUV != null){
if (_arg1 != null){
if (!_aUV.equals(_arg1)){
_aUV.x = _arg1.x;
_aUV.y = _arg1.y;
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
} else {
_aUV = null;
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
} else {
if (_arg1 != null){
_aUV = _arg1.clone();
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
};
}
public function set bUV(_arg1:Point):void{
if (_bUV != null){
if (_arg1 != null){
if (!_bUV.equals(_arg1)){
_bUV.x = _arg1.x;
_bUV.y = _arg1.y;
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
} else {
_bUV = null;
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
} else {
if (_arg1 != null){
_bUV = _arg1.clone();
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
};
}
alternativa3d function removeFromSurface(_arg1:Surface):void{
_arg1.changeMaterialOperation.removeSequel(updateMaterialOperation);
if (_arg1._material != null){
_mesh.addOperationToScene(updateMaterialOperation);
};
_surface = null;
}
public function set cUV(_arg1:Point):void{
if (_cUV != null){
if (_arg1 != null){
if (!_cUV.equals(_arg1)){
_cUV.x = _arg1.x;
_cUV.y = _arg1.y;
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
} else {
_cUV = null;
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
} else {
if (_arg1 != null){
_cUV = _arg1.clone();
if (_mesh != null){
_mesh.addOperationToScene(calculateUVOperation);
};
};
};
}
private function updateMaterial():void{
if (!updatePrimitiveOperation.queued){
changePrimitive(primitive);
};
}
alternativa3d function addToSurface(_arg1:Surface):void{
_arg1.changeMaterialOperation.addSequel(updateMaterialOperation);
if (((!((_mesh == null))) && (((((!((_surface == null))) && (!((_surface._material == _arg1._material))))) || ((((_surface == null)) && (!((_arg1._material == null))))))))){
_mesh.addOperationToScene(updateMaterialOperation);
};
_surface = _arg1;
}
public function get id():Object{
return (((_mesh)!=null) ? _mesh.getFaceId(this) : null);
}
public function get verticesCount():uint{
return (_verticesCount);
}
private function updatePrimitive():void{
var _local1:Vertex = _vertices[0];
globalOffset = (((_local1.globalCoords.x * globalNormal.x) + (_local1.globalCoords.y * globalNormal.y)) + (_local1.globalCoords.z * globalNormal.z));
removePrimitive(primitive);
primitive.mobility = _mesh.inheritedMobility;
_mesh._scene.addPrimitives.push(primitive);
}
private function removePrimitiveUV(_arg1:PolyPrimitive):void{
var _local2:uint;
while (_local2 < _arg1.num) {
_arg1.uvs[_local2] = null;
_local2++;
};
if (_arg1.backFragment != null){
removePrimitiveUV(_arg1.backFragment);
removePrimitiveUV(_arg1.frontFragment);
};
}
public function get bUV():Point{
return (((_bUV)!=null) ? _bUV.clone() : null);
}
private function changePrimitive(_arg1:PolyPrimitive):void{
if (_arg1.backFragment != null){
changePrimitive(_arg1.backFragment);
changePrimitive(_arg1.frontFragment);
} else {
_mesh._scene.changedPrimitives[_arg1] = true;
};
}
public function get surface():Surface{
return (_surface);
}
alternativa3d function removeVertices():void{
var _local2:Vertex;
var _local1:uint;
while (_local1 < _verticesCount) {
_local2 = _vertices.pop();
primitive.points.pop();
_local2.removeFromFace(this);
_local1++;
};
_verticesCount = 0;
}
private function calculateFragmentsUV():void{
if (!updatePrimitiveOperation.queued){
if (uvMatrixBase != null){
calculatePrimitiveUV(primitive);
} else {
removePrimitiveUV(primitive);
};
};
}
private function removePrimitive(_arg1:PolyPrimitive):void{
if (_arg1.backFragment != null){
removePrimitive(_arg1.backFragment);
removePrimitive(_arg1.frontFragment);
_arg1.backFragment = null;
_arg1.frontFragment = null;
if (_arg1 != this.primitive){
_arg1.parent = null;
_arg1.sibling = null;
PolyPrimitive.destroyPolyPrimitive(_arg1);
};
} else {
if (_arg1.node != null){
_mesh._scene.removeBSPPrimitive(_arg1);
};
};
}
public function get cUV():Point{
return (((_cUV)!=null) ? _cUV.clone() : null);
}
public function get aUV():Point{
return (((_aUV)!=null) ? _aUV.clone() : null);
}
alternativa3d function removeFromMesh(_arg1:Mesh):void{
_arg1.changeCoordsOperation.removeSequel(updatePrimitiveOperation);
_arg1.changeRotationOrScaleOperation.removeSequel(calculateNormalOperation);
_arg1.calculateMobilityOperation.removeSequel(updatePrimitiveOperation);
_mesh = null;
}
alternativa3d function removeFromScene(_arg1:Scene3D):void{
_arg1.removeOperation(calculateUVOperation);
_arg1.removeOperation(calculateFragmentsUVOperation);
_arg1.removeOperation(calculateNormalOperation);
_arg1.removeOperation(updatePrimitiveOperation);
_arg1.removeOperation(updateMaterialOperation);
removePrimitive(primitive);
_arg1.addOperation(_arg1.calculateBSPOperation);
updatePrimitiveOperation.removeSequel(_arg1.calculateBSPOperation);
updateMaterialOperation.removeSequel(_arg1.changePrimitivesOperation);
}
public function toString():String{
var _local3:Vertex;
var _local1:String = (("[Face ID:" + id) + ((_verticesCount)>0) ? " vertices:" : "");
var _local2:uint;
while (_local2 < _verticesCount) {
_local3 = _vertices[_local2];
_local1 = (_local1 + (_local3.id + ((_local2)<(_verticesCount - 1)) ? ", " : ""));
_local2++;
};
_local1 = (_local1 + "]");
return (_local1);
}
private function calculateNormal():void{
var _local1:Vertex = _vertices[0];
var _local2:Point3D = _local1.globalCoords;
_local1 = _vertices[1];
var _local3:Point3D = _local1.globalCoords;
var _local4:Number = (_local3.x - _local2.x);
var _local5:Number = (_local3.y - _local2.y);
var _local6:Number = (_local3.z - _local2.z);
_local1 = _vertices[2];
var _local7:Point3D = _local1.globalCoords;
var _local8:Number = (_local7.x - _local2.x);
var _local9:Number = (_local7.y - _local2.y);
var _local10:Number = (_local7.z - _local2.z);
globalNormal.x = ((_local10 * _local5) - (_local9 * _local6));
globalNormal.y = ((_local8 * _local6) - (_local10 * _local4));
globalNormal.z = ((_local9 * _local4) - (_local8 * _local5));
globalNormal.normalize();
}
public function get edgeJoinedFaces():Set{
var _local3:Vertex;
var _local4:Vertex;
var _local5:*;
var _local6:Face;
var _local1:Set = new Set(true);
var _local2:uint;
while (_local2 < _verticesCount) {
_local3 = _vertices[_local2];
_local4 = _vertices[((_local2)<(_verticesCount - 1)) ? (_local2 + 1) : 0];
for (_local5 in _local3._faces) {
_local6 = _local5;
if (((!((_local6 == this))) && ((_local6._vertices.indexOf(_local4) >= 0)))){
_local1[_local6] = true;
};
};
_local2++;
};
return (_local1);
}
alternativa3d function getUVFast(_arg1:Point3D, _arg2:Point3D):Point{
var _local3:uint;
if ((((((_aUV == null)) || ((_bUV == null)))) || ((_cUV == null)))){
return (null);
};
if (((_arg2.x)<0) ? -(_arg2.x) : _arg2.x > ((_arg2.y)<0) ? -(_arg2.y) : _arg2.y){
if (((_arg2.x)<0) ? -(_arg2.x) : _arg2.x > ((_arg2.z)<0) ? -(_arg2.z) : _arg2.z){
_local3 = 0;
} else {
_local3 = 2;
};
} else {
if (((_arg2.y)<0) ? -(_arg2.y) : _arg2.y > ((_arg2.z)<0) ? -(_arg2.z) : _arg2.z){
_local3 = 1;
} else {
_local3 = 2;
};
};
var _local4:Vertex = _vertices[0];
var _local5:Point3D = _local4._coords;
_local4 = _vertices[1];
var _local6:Point3D = _local4._coords;
_local4 = _vertices[2];
var _local7:Point3D = _local4._coords;
var _local8:Number = ((_local3)==0) ? (_local6.y - _local5.y) : (_local6.x - _local5.x);
var _local9:Number = ((_local3)==2) ? (_local6.y - _local5.y) : (_local6.z - _local5.z);
var _local10:Number = ((_local3)==0) ? (_local7.y - _local5.y) : (_local7.x - _local5.x);
var _local11:Number = ((_local3)==2) ? (_local7.y - _local5.y) : (_local7.z - _local5.z);
var _local12:Number = ((_local8 * _local11) - (_local10 * _local9));
var _local13:Number = ((_local3)==0) ? (_arg1.y - _local5.y) : (_arg1.x - _local5.x);
var _local14:Number = ((_local3)==2) ? (_arg1.y - _local5.y) : (_arg1.z - _local5.z);
var _local15:Number = (((_local13 * _local11) - (_local10 * _local14)) / _local12);
var _local16:Number = (((_local8 * _local14) - (_local13 * _local9)) / _local12);
var _local17:Number = (_bUV.x - _aUV.x);
var _local18:Number = (_bUV.y - _aUV.y);
var _local19:Number = (_cUV.x - _aUV.x);
var _local20:Number = (_cUV.y - _aUV.y);
return (new Point(((_aUV.x + (_local17 * _local15)) + (_local19 * _local16)), ((_aUV.y + (_local18 * _local15)) + (_local20 * _local16))));
}
public function get normal():Point3D{
var _local12:Number;
var _local1:Point3D = new Point3D();
var _local2:Vertex = _vertices[0];
var _local3:Point3D = _local2.coords;
_local2 = _vertices[1];
var _local4:Point3D = _local2.coords;
var _local5:Number = (_local4.x - _local3.x);
var _local6:Number = (_local4.y - _local3.y);
var _local7:Number = (_local4.z - _local3.z);
_local2 = _vertices[2];
var _local8:Point3D = _local2.coords;
var _local9:Number = (_local8.x - _local3.x);
var _local10:Number = (_local8.y - _local3.y);
var _local11:Number = (_local8.z - _local3.z);
_local1.x = ((_local11 * _local6) - (_local10 * _local7));
_local1.y = ((_local9 * _local7) - (_local11 * _local5));
_local1.z = ((_local10 * _local5) - (_local9 * _local6));
if (((((!((_local1.x == 0))) || (!((_local1.y == 0))))) || (!((_local1.z == 0))))){
_local12 = Math.sqrt((((_local1.x * _local1.x) + (_local1.y * _local1.y)) + (_local1.z * _local1.z)));
_local1.x = (_local1.x / _local12);
_local1.y = (_local1.y / _local12);
_local1.z = (_local1.z / _local12);
};
return (_local1);
}
public function getUV(_arg1:Point3D):Point{
return (getUVFast(_arg1, normal));
}
public function get vertices():Array{
return (new Array().concat(_vertices));
}
public function get mesh():Mesh{
return (_mesh);
}
alternativa3d function addToScene(_arg1:Scene3D):void{
_arg1.addOperation(calculateNormalOperation);
_arg1.addOperation(calculateUVOperation);
updatePrimitiveOperation.addSequel(_arg1.calculateBSPOperation);
updateMaterialOperation.addSequel(_arg1.changePrimitivesOperation);
}
}
}//package alternativa.engine3d.core
Section 6
//Mesh (alternativa.engine3d.core.Mesh)
package alternativa.engine3d.core {
import alternativa.types.*;
import alternativa.engine3d.materials.*;
import flash.geom.*;
import alternativa.utils.*;
import alternativa.engine3d.errors.*;
import alternativa.engine3d.*;
public class Mesh extends Object3D {
alternativa3d var _surfaces:Map;
private var surfaceIDCounter:uint;// = 0
alternativa3d var _vertices:Map;
private var faceIDCounter:uint;// = 0
alternativa3d var _faces:Map;
private var vertexIDCounter:uint;// = 0
private static var counter:uint = 0;
public function Mesh(_arg1:String=null){
_vertices = new Map();
_faces = new Map();
_surfaces = new Map();
super(_arg1);
}
public function createVertex(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Object=null):Vertex{
if (_arg4 != null){
if (_vertices[_arg4] != undefined){
if ((_vertices[_arg4] is Vertex)){
throw (new VertexExistsError(_arg4, this));
};
throw (new InvalidIDError(_arg4, this));
};
} else {
while (_vertices[vertexIDCounter] != undefined) {
vertexIDCounter++;
};
_arg4 = vertexIDCounter;
};
var _local5:Vertex = new Vertex(_arg1, _arg2, _arg3);
if (_scene != null){
_local5.addToScene(_scene);
};
_local5.addToMesh(this);
_vertices[_arg4] = _local5;
return (_local5);
}
public function removeFace(_arg1:Object):Face{
var _local2 = (_arg1 is Face);
if (_arg1 == null){
throw (new FaceNotFoundError(null, this));
};
if (_local2){
if (Face(_arg1)._mesh != this){
throw (new FaceNotFoundError(_arg1, this));
};
} else {
if (_faces[_arg1] == undefined){
throw (new FaceNotFoundError(_arg1, this));
};
if (!(_faces[_arg1] is Face)){
throw (new InvalidIDError(_arg1, this));
};
};
var _local3:Face = (_local2) ? Face(_arg1) : _faces[_arg1];
var _local4:Object = (_local2) ? getFaceId(Face(_arg1)) : _arg1;
_local3.removeVertices();
if (_local3._surface != null){
_local3._surface._faces.remove(_local3);
_local3.removeFromSurface(_local3._surface);
};
if (_scene != null){
_local3.removeFromScene(_scene);
};
_local3.removeFromMesh(this);
delete _faces[_local4];
return (_local3);
}
public function hasSurface(_arg1:Object):Boolean{
if (_arg1 == null){
throw (new SurfaceNotFoundError(null, this));
};
if ((_arg1 is Surface)){
return ((_arg1._mesh == this));
};
if (_surfaces[_arg1] != undefined){
if ((_surfaces[_arg1] is Surface)){
return (true);
};
throw (new InvalidIDError(_arg1, this));
//unresolved jump
};
return (false);
}
public function removeSurface(_arg1:Object):Surface{
var _local2 = (_arg1 is Surface);
if (_arg1 == null){
throw (new SurfaceNotFoundError(null, this));
};
if (_local2){
if (Surface(_arg1)._mesh != this){
throw (new SurfaceNotFoundError(_arg1, this));
};
} else {
if (_surfaces[_arg1] == undefined){
throw (new SurfaceNotFoundError(_arg1, this));
};
if (!(_surfaces[_arg1] is Surface)){
throw (new InvalidIDError(_arg1, this));
};
};
var _local3:Surface = (_local2) ? Surface(_arg1) : _surfaces[_arg1];
var _local4:Object = (_local2) ? getSurfaceId(Surface(_arg1)) : _arg1;
if (_scene != null){
_local3.removeFromScene(_scene);
};
_local3.removeFaces();
_local3.removeFromMesh(this);
delete _surfaces[_local4];
return (_local3);
}
public function moveAllFacesToSurface(_arg1:Object=null, _arg2:Boolean=false):Surface{
var _local3:Surface;
var _local4:Object;
var _local5:Face;
var _local6:Map;
var _local7:*;
var _local8:Surface;
if ((_arg1 is Surface)){
if (_arg1._mesh == this){
_local3 = Surface(_arg1);
} else {
throw (new SurfaceNotFoundError(_arg1, this));
};
} else {
if (_surfaces[_arg1] == undefined){
_local3 = createSurface(null, _arg1);
_local4 = _arg1;
} else {
if ((_surfaces[_arg1] is Surface)){
_local3 = _surfaces[_arg1];
} else {
throw (new InvalidIDError(_arg1, this));
};
};
};
for each (_local5 in _faces) {
if (_local5._surface != _local3){
_local3.addFace(_local5);
};
};
if (_arg2){
if (_local4 == null){
_local4 = getSurfaceId(_local3);
};
_local6 = new Map();
_local6[_local4] = _local3;
delete _surfaces[_local4];
for (_local7 in _surfaces) {
_local8 = _surfaces[_local7];
if (_scene != null){
_local8.removeFromScene(_scene);
};
_local8.removeFromMesh(this);
delete _surfaces[_local7];
};
_surfaces = _local6;
};
return (_local3);
}
public function getFaceId(_arg1:Face):Object{
var _local2:Object;
if (_arg1 == null){
throw (new FaceNotFoundError(null, this));
};
if (_arg1._mesh != this){
throw (new FaceNotFoundError(_arg1, this));
};
for (_local2 in _faces) {
if (_faces[_local2] == _arg1){
return (_local2);
};
};
throw (new FaceNotFoundError(_arg1, this));
}
public function removeVertex(_arg1:Object):Vertex{
var _local2 = (_arg1 is Vertex);
if (_arg1 == null){
throw (new VertexNotFoundError(null, this));
};
if (_local2){
if (Vertex(_arg1)._mesh != this){
throw (new VertexNotFoundError(_arg1, this));
};
} else {
if (_vertices[_arg1] == undefined){
throw (new VertexNotFoundError(_arg1, this));
};
if (!(_vertices[_arg1] is Vertex)){
throw (new InvalidIDError(_arg1, this));
};
};
var _local3:Vertex = (_local2) ? Vertex(_arg1) : _vertices[_arg1];
var _local4:Object = (_local2) ? getVertexId(Vertex(_arg1)) : _arg1;
if (_scene != null){
_local3.removeFromScene(_scene);
};
_local3.removeFromMesh(this);
delete _vertices[_local4];
return (_local3);
}
public function setMaterialToSurface(_arg1:SurfaceMaterial, _arg2:Object):void{
var _local3 = (_arg2 is Surface);
if (_arg2 == null){
throw (new SurfaceNotFoundError(null, this));
};
if (_local3){
if (Surface(_arg2)._mesh != this){
throw (new SurfaceNotFoundError(_arg2, this));
};
} else {
if (_surfaces[_arg2] == undefined){
throw (new SurfaceNotFoundError(_arg2, this));
};
if (!(_surfaces[_arg2] is Surface)){
throw (new InvalidIDError(_arg2, this));
};
};
var _local4:Surface = (_local3) ? Surface(_arg2) : _surfaces[_arg2];
_local4.material = _arg1;
}
public function createSurface(_arg1:Array=null, _arg2:Object=null):Surface{
var _local4:uint;
var _local5:uint;
if (_arg2 != null){
if (_surfaces[_arg2] != undefined){
if ((_surfaces[_arg2] is Surface)){
throw (new SurfaceExistsError(_arg2, this));
};
throw (new InvalidIDError(_arg2, this));
};
} else {
while (_surfaces[surfaceIDCounter] != undefined) {
surfaceIDCounter++;
};
_arg2 = surfaceIDCounter;
};
var _local3:Surface = new Surface();
if (_scene != null){
_local3.addToScene(_scene);
};
_local3.addToMesh(this);
_surfaces[_arg2] = _local3;
if (_arg1 != null){
_local4 = _arg1.length;
_local5 = 0;
while (_local5 < _local4) {
_local3.addFace(_arg1[_local5]);
_local5++;
};
};
return (_local3);
}
override protected function clonePropertiesFrom(_arg1:Object3D):void{
var _local3:*;
var _local4:int;
var _local5:int;
var _local7:Map;
var _local8:Vertex;
var _local9:Face;
var _local10:Array;
var _local11:Face;
var _local12:Surface;
var _local13:Array;
var _local14:Surface;
var _local15:SurfaceMaterial;
super.clonePropertiesFrom(_arg1);
var _local2:Mesh = Mesh(_arg1);
var _local6:Map = new Map(true);
for (_local3 in _local2._vertices) {
_local8 = _local2._vertices[_local3];
_local6[_local8] = createVertex(_local8.x, _local8.y, _local8.z, _local3);
};
_local7 = new Map(true);
for (_local3 in _local2._faces) {
_local9 = _local2._faces[_local3];
_local4 = _local9._vertices.length;
_local10 = new Array(_local4);
_local5 = 0;
while (_local5 < _local4) {
_local10[_local5] = _local6[_local9._vertices[_local5]];
_local5++;
};
_local11 = createFace(_local10, _local3);
_local11.aUV = _local9._aUV;
_local11.bUV = _local9._bUV;
_local11.cUV = _local9._cUV;
_local7[_local9] = _local11;
};
for (_local3 in _local2._surfaces) {
_local12 = _local2._surfaces[_local3];
_local13 = _local12._faces.toArray();
_local4 = _local13.length;
_local5 = 0;
while (_local5 < _local4) {
_local13[_local5] = _local7[_local13[_local5]];
_local5++;
};
_local14 = createSurface(_local13, _local3);
_local15 = _local12.material;
if (_local15 != null){
_local14.material = SurfaceMaterial(_local15.clone());
};
};
}
public function getVertexById(_arg1:Object):Vertex{
if (_arg1 == null){
throw (new VertexNotFoundError(null, this));
};
if (_vertices[_arg1] == undefined){
throw (new VertexNotFoundError(_arg1, this));
};
if ((_vertices[_arg1] is Vertex)){
return (_vertices[_arg1]);
};
throw (new InvalidIDError(_arg1, this));
}
public function cloneMaterialToAllSurfaces(_arg1:SurfaceMaterial):void{
var _local2:Surface;
for each (_local2 in _surfaces) {
_local2.material = ((_arg1)!=null) ? SurfaceMaterial(_arg1.clone()) : null;
};
}
public function hasFace(_arg1:Object):Boolean{
if (_arg1 == null){
throw (new FaceNotFoundError(null, this));
};
if ((_arg1 is Face)){
return ((_arg1._mesh == this));
};
if (_faces[_arg1] != undefined){
if ((_faces[_arg1] is Face)){
return (true);
};
throw (new InvalidIDError(_arg1, this));
//unresolved jump
};
return (false);
}
override alternativa3d function setScene(_arg1:Scene3D):void{
var _local2:Vertex;
var _local3:Face;
var _local4:Surface;
if (_scene != _arg1){
if (_arg1 != null){
for each (_local2 in _vertices) {
_local2.addToScene(_arg1);
};
for each (_local3 in _faces) {
_local3.addToScene(_arg1);
};
for each (_local4 in _surfaces) {
_local4.addToScene(_arg1);
};
} else {
for each (_local2 in _vertices) {
_local2.removeFromScene(_scene);
};
for each (_local3 in _faces) {
_local3.removeFromScene(_scene);
};
for each (_local4 in _surfaces) {
_local4.removeFromScene(_scene);
};
};
};
super.setScene(_arg1);
}
public function createFace(_arg1:Array, _arg2:Object=null):Face{
var _local5:Vertex;
if (_arg1 == null){
throw (new FaceNeedMoreVerticesError(this));
};
if (_arg2 != null){
if (_faces[_arg2] != undefined){
if ((_faces[_arg2] is Face)){
throw (new FaceExistsError(_arg2, this));
};
throw (new InvalidIDError(_arg2, this));
};
} else {
while (_faces[faceIDCounter] != undefined) {
faceIDCounter++;
};
_arg2 = faceIDCounter;
};
var _local3:uint = _arg1.length;
if (_local3 < 3){
throw (new FaceNeedMoreVerticesError(this, _local3));
};
var _local4:Array = new Array();
var _local6:uint;
while (_local6 < _local3) {
if ((_arg1[_local6] is Vertex)){
_local5 = _arg1[_local6];
if (_local5._mesh != this){
throw (new VertexNotFoundError(_arg1[_local6], this));
};
} else {
if (_vertices[_arg1[_local6]] == null){
throw (new VertexNotFoundError(_arg1[_local6], this));
};
if (!(_vertices[_arg1[_local6]] is Vertex)){
throw (new InvalidIDError(_arg1[_local6], this));
};
_local5 = _vertices[_arg1[_local6]];
};
_local4.push(_local5);
_local6++;
};
var _local7:Face = new Face(_local4);
if (_scene != null){
_local7.addToScene(_scene);
};
_local7.addToMesh(this);
_faces[_arg2] = _local7;
return (_local7);
}
public function getVertexId(_arg1:Vertex):Object{
var _local2:Object;
if (_arg1 == null){
throw (new VertexNotFoundError(null, this));
};
if (_arg1._mesh != this){
throw (new VertexNotFoundError(_arg1, this));
};
for (_local2 in _vertices) {
if (_vertices[_local2] == _arg1){
return (_local2);
};
};
throw (new VertexNotFoundError(_arg1, this));
}
public function getFaceById(_arg1:Object):Face{
if (_arg1 == null){
throw (new FaceNotFoundError(null, this));
};
if (_faces[_arg1] == undefined){
throw (new FaceNotFoundError(_arg1, this));
};
if ((_faces[_arg1] is Face)){
return (_faces[_arg1]);
};
throw (new InvalidIDError(_arg1, this));
}
public function hasVertex(_arg1:Object):Boolean{
if (_arg1 == null){
throw (new VertexNotFoundError(null, this));
};
if ((_arg1 is Vertex)){
return ((_arg1._mesh == this));
};
if (_vertices[_arg1] != undefined){
if ((_vertices[_arg1] is Vertex)){
return (true);
};
throw (new InvalidIDError(_arg1, this));
//unresolved jump
};
return (false);
}
override protected function createEmptyObject():Object3D{
return (new Mesh());
}
public function get surfaces():Map{
return (_surfaces.clone());
}
public function getSurfaceById(_arg1:Object):Surface{
if (_arg1 == null){
throw (new SurfaceNotFoundError(null, this));
};
if (_surfaces[_arg1] == undefined){
throw (new SurfaceNotFoundError(_arg1, this));
};
if ((_surfaces[_arg1] is Surface)){
return (_surfaces[_arg1]);
};
throw (new InvalidIDError(_arg1, this));
}
override protected function defaultName():String{
return (("mesh" + ++counter));
}
public function setUVsToFace(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Object):void{
var _local5 = (_arg4 is Face);
if (_arg4 == null){
throw (new FaceNotFoundError(null, this));
};
if (_local5){
if (Face(_arg4)._mesh != this){
throw (new FaceNotFoundError(_arg4, this));
};
} else {
if (_faces[_arg4] == undefined){
throw (new FaceNotFoundError(_arg4, this));
};
if (!(_faces[_arg4] is Face)){
throw (new InvalidIDError(_arg4, this));
};
};
var _local6:Face = (_local5) ? Face(_arg4) : _faces[_arg4];
_local6.aUV = _arg1;
_local6.bUV = _arg2;
_local6.cUV = _arg3;
}
public function getSurfaceId(_arg1:Surface):Object{
var _local2:Object;
if (_arg1 == null){
throw (new SurfaceNotFoundError(null, this));
};
if (_arg1._mesh != this){
throw (new SurfaceNotFoundError(_arg1, this));
};
for (_local2 in _surfaces) {
if (_surfaces[_local2] == _arg1){
return (_local2);
};
};
return (null);
}
public function get faces():Map{
return (_faces.clone());
}
public function get vertices():Map{
return (_vertices.clone());
}
override public function toString():String{
return ((((((((("[" + ObjectUtils.getClassName(this)) + " ") + _name) + " vertices: ") + _vertices.length) + " faces: ") + _faces.length) + "]"));
}
}
}//package alternativa.engine3d.core
Section 7
//Object3D (alternativa.engine3d.core.Object3D)
package alternativa.engine3d.core {
import alternativa.types.*;
import alternativa.utils.*;
import alternativa.engine3d.errors.*;
import alternativa.engine3d.*;
public class Object3D {
alternativa3d var transformation:Matrix3D;
alternativa3d var _mobility:int;// = 0
alternativa3d var _scene:Scene3D;
alternativa3d var calculateTransformationOperation:Operation;
alternativa3d var changeCoordsOperation:Operation;
alternativa3d var _rotationX:Number;// = 0
alternativa3d var _rotationY:Number;// = 0
alternativa3d var _rotationZ:Number;// = 0
alternativa3d var globalCoords:Point3D;
alternativa3d var inheritedMobility:int;
alternativa3d var _coords:Point3D;
alternativa3d var calculateMobilityOperation:Operation;
alternativa3d var _parent:Object3D;
alternativa3d var _name:String;
alternativa3d var _children:Set;
alternativa3d var changeRotationOrScaleOperation:Operation;
alternativa3d var _scaleZ:Number;// = 1
alternativa3d var _scaleX:Number;// = 1
alternativa3d var _scaleY:Number;// = 1
private static var counter:uint = 0;
public function Object3D(_arg1:String=null){
changeRotationOrScaleOperation = new Operation("changeRotationOrScale", this);
changeCoordsOperation = new Operation("changeCoords", this);
calculateTransformationOperation = new Operation("calculateTransformation", this, calculateTransformation, Operation.OBJECT_CALCULATE_TRANSFORMATION);
calculateMobilityOperation = new Operation("calculateMobility", this, calculateMobility, Operation.OBJECT_CALCULATE_MOBILITY);
_children = new Set();
_coords = new Point3D();
transformation = new Matrix3D();
globalCoords = new Point3D();
super();
_name = ((_arg1)!=null) ? _arg1 : defaultName();
changeRotationOrScaleOperation.addSequel(calculateTransformationOperation);
changeCoordsOperation.addSequel(calculateTransformationOperation);
}
public function get z():Number{
return (_coords.z);
}
public function set z(_arg1:Number):void{
if (_coords.z != _arg1){
_coords.z = _arg1;
addOperationToScene(changeCoordsOperation);
};
}
protected function defaultName():String{
return (("object" + ++counter));
}
alternativa3d function removeOperationFromScene(_arg1:Operation):void{
if (_scene != null){
_scene.removeOperation(_arg1);
};
}
public function get x():Number{
return (_coords.x);
}
public function getChildByName(_arg1:String):Object3D{
var _local2:*;
var _local3:Object3D;
for (_local2 in _children) {
_local3 = _local2;
if (_local3._name == _arg1){
return (_local3);
};
};
return (null);
}
public function get name():String{
return (_name);
}
public function get scene():Scene3D{
return (_scene);
}
private function calculateTransformation():void{
if (changeRotationOrScaleOperation.queued){
transformation.toTransform(_coords.x, _coords.y, _coords.z, _rotationX, _rotationY, _rotationZ, _scaleX, _scaleY, _scaleZ);
if (_parent != null){
transformation.combine(_parent.transformation);
};
globalCoords.x = transformation.d;
globalCoords.y = transformation.h;
globalCoords.z = transformation.l;
} else {
globalCoords.copy(_coords);
if (_parent != null){
globalCoords.transform(_parent.transformation);
};
transformation.offset(globalCoords.x, globalCoords.y, globalCoords.z);
};
}
public function set name(_arg1:String):void{
_name = _arg1;
}
public function get coords():Point3D{
return (_coords.clone());
}
public function set scaleZ(_arg1:Number):void{
if (_scaleZ != _arg1){
_scaleZ = _arg1;
addOperationToScene(changeRotationOrScaleOperation);
};
}
public function get rotationY():Number{
return (_rotationY);
}
public function get rotationZ():Number{
return (_rotationZ);
}
public function get rotationX():Number{
return (_rotationX);
}
public function get mobility():int{
return (_mobility);
}
alternativa3d function setParent(_arg1:Object3D):void{
if (_parent != null){
removeParentSequels();
};
_parent = _arg1;
if (_arg1 != null){
addParentSequels();
};
}
public function set scaleY(_arg1:Number):void{
if (_scaleY != _arg1){
_scaleY = _arg1;
addOperationToScene(changeRotationOrScaleOperation);
};
}
private function calculateMobility():void{
inheritedMobility = (((_parent)!=null) ? _parent.inheritedMobility : 0 + _mobility);
}
public function set rotationX(_arg1:Number):void{
if (_rotationX != _arg1){
_rotationX = _arg1;
addOperationToScene(changeRotationOrScaleOperation);
};
}
public function get parent():Object3D{
return (_parent);
}
public function set scaleX(_arg1:Number):void{
if (_scaleX != _arg1){
_scaleX = _arg1;
addOperationToScene(changeRotationOrScaleOperation);
};
}
public function set rotationZ(_arg1:Number):void{
if (_rotationZ != _arg1){
_rotationZ = _arg1;
addOperationToScene(changeRotationOrScaleOperation);
};
}
protected function clonePropertiesFrom(_arg1:Object3D):void{
_name = _arg1._name;
_mobility = _arg1._mobility;
_coords.x = _arg1._coords.x;
_coords.y = _arg1._coords.y;
_coords.z = _arg1._coords.z;
_rotationX = _arg1._rotationX;
_rotationY = _arg1._rotationY;
_rotationZ = _arg1._rotationZ;
_scaleX = _arg1._scaleX;
_scaleY = _arg1._scaleY;
_scaleZ = _arg1._scaleZ;
}
public function set coords(_arg1:Point3D):void{
if (!_coords.equals(_arg1)){
_coords.copy(_arg1);
addOperationToScene(changeCoordsOperation);
};
}
private function removeParentSequels():void{
_parent.changeCoordsOperation.removeSequel(changeCoordsOperation);
_parent.changeRotationOrScaleOperation.removeSequel(changeRotationOrScaleOperation);
_parent.calculateMobilityOperation.removeSequel(calculateMobilityOperation);
}
private function addParentSequels():void{
_parent.changeCoordsOperation.addSequel(changeCoordsOperation);
_parent.changeRotationOrScaleOperation.addSequel(changeRotationOrScaleOperation);
_parent.calculateMobilityOperation.addSequel(calculateMobilityOperation);
}
alternativa3d function addOperationToScene(_arg1:Operation):void{
if (_scene != null){
_scene.addOperation(_arg1);
};
}
public function set rotationY(_arg1:Number):void{
if (_rotationY != _arg1){
_rotationY = _arg1;
addOperationToScene(changeRotationOrScaleOperation);
};
}
public function get scaleY():Number{
return (_scaleY);
}
public function get scaleZ():Number{
return (_scaleZ);
}
alternativa3d function setScene(_arg1:Scene3D):void{
var _local2:*;
var _local3:Object3D;
if (_scene != _arg1){
if (_scene != null){
removeFromScene(_scene);
};
if (_arg1 != null){
addToScene(_arg1);
};
_scene = _arg1;
} else {
addOperationToScene(changeRotationOrScaleOperation);
addOperationToScene(calculateMobilityOperation);
};
for (_local2 in _children) {
_local3 = _local2;
_local3.setScene(_scene);
};
}
public function get scaleX():Number{
return (_scaleX);
}
public function set mobility(_arg1:int):void{
if (_mobility != _arg1){
_mobility = _arg1;
addOperationToScene(calculateMobilityOperation);
};
}
protected function createEmptyObject():Object3D{
return (new Object3D());
}
public function clone():Object3D{
var _local2:*;
var _local3:Object3D;
var _local1:Object3D = createEmptyObject();
_local1.clonePropertiesFrom(this);
for (_local2 in _children) {
_local3 = _local2;
_local1.addChild(_local3.clone());
};
return (_local1);
}
alternativa3d function setLevel(_arg1:uint):void{
var _local2:*;
var _local3:Object3D;
calculateTransformationOperation.priority = ((calculateTransformationOperation.priority & 4278190080) | _arg1);
calculateMobilityOperation.priority = ((calculateMobilityOperation.priority & 4278190080) | _arg1);
for (_local2 in _children) {
_local3 = _local2;
_local3.setLevel((_arg1 + 1));
};
}
protected function removeFromScene(_arg1:Scene3D):void{
_arg1.removeOperation(changeRotationOrScaleOperation);
_arg1.removeOperation(changeCoordsOperation);
_arg1.removeOperation(calculateMobilityOperation);
}
protected function addToScene(_arg1:Scene3D):void{
_arg1.addOperation(changeRotationOrScaleOperation);
_arg1.addOperation(calculateMobilityOperation);
}
public function set y(_arg1:Number):void{
if (_coords.y != _arg1){
_coords.y = _arg1;
addOperationToScene(changeCoordsOperation);
};
}
public function toString():String{
return ((((("[" + ObjectUtils.getClassName(this)) + " ") + _name) + "]"));
}
public function set x(_arg1:Number):void{
if (_coords.x != _arg1){
_coords.x = _arg1;
addOperationToScene(changeCoordsOperation);
};
}
public function removeChild(_arg1:Object3D):void{
if (_arg1 == null){
throw (new Object3DNotFoundError(null, this));
};
if (_arg1._parent != this){
throw (new Object3DNotFoundError(_arg1, this));
};
_children.remove(_arg1);
_arg1.setParent(null);
_arg1.setScene(null);
}
public function get y():Number{
return (_coords.y);
}
public function addChild(_arg1:Object3D):void{
var _local2:Object3D;
if (_arg1 == null){
throw (new Object3DHierarchyError(null, this));
};
if (_arg1._parent == this){
return;
};
if (_arg1 == this){
throw (new Object3DHierarchyError(this, this));
};
if (_arg1._scene == _scene){
_local2 = _parent;
while (_local2 != null) {
if (_arg1 == _local2){
throw (new Object3DHierarchyError(_arg1, this));
};
_local2 = _local2._parent;
};
};
if (_arg1._parent != null){
_arg1._parent._children.remove(_arg1);
} else {
if (((!((_arg1._scene == null))) && ((_arg1._scene._root == _arg1)))){
_arg1._scene.root = null;
};
};
_children.add(_arg1);
_arg1.setParent(this);
_arg1.setLevel(((calculateTransformationOperation.priority & 0xFFFFFF) + 1));
_arg1.setScene(_scene);
}
public function get children():Set{
return (_children.clone());
}
}
}//package alternativa.engine3d.core
Section 8
//Operation (alternativa.engine3d.core.Operation)
package alternativa.engine3d.core {
import alternativa.types.*;
import alternativa.engine3d.*;
public class Operation {
alternativa3d var method:Function;
alternativa3d var priority:uint;
alternativa3d var name:String;
alternativa3d var queued:Boolean;// = false
private var sequel:Operation;
private var sequels:Set;
alternativa3d var object:Object;
alternativa3d static const SCENE_CLEAR_PRIMITIVES:uint = 218103808;
alternativa3d static const CAMERA_CALCULATE_PLANES:uint = 184549376;
alternativa3d static const OBJECT_CALCULATE_MOBILITY:uint = 33554432;
alternativa3d static const SCENE_CALCULATE_BSP:uint = 117440512;
alternativa3d static const FACE_CALCULATE_FRAGMENTS_UV:uint = 150994944;
alternativa3d static const FACE_CALCULATE_UV:uint = 83886080;
alternativa3d static const OBJECT_CALCULATE_TRANSFORMATION:uint = 16777216;
alternativa3d static const FACE_CALCULATE_NORMAL:uint = 67108864;
alternativa3d static const VERTEX_CALCULATE_COORDS:uint = 50331648;
alternativa3d static const FACE_UPDATE_PRIMITIVE:uint = 100663296;
alternativa3d static const CAMERA_CALCULATE_MATRIX:uint = 167772160;
alternativa3d static const CAMERA_RENDER:uint = 201326592;
alternativa3d static const FACE_UPDATE_MATERIAL:uint = 134217728;
public function Operation(_arg1:String, _arg2:Object=null, _arg3:Function=null, _arg4:uint=0){
this.object = _arg2;
this.method = _arg3;
this.name = _arg1;
this.priority = _arg4;
}
alternativa3d function addSequel(_arg1:Operation):void{
if (sequel == null){
if (sequels == null){
sequel = _arg1;
} else {
sequels[_arg1] = true;
};
} else {
if (sequel != _arg1){
sequels = new Set(true);
sequels[sequel] = true;
sequels[_arg1] = true;
sequel = null;
};
};
}
public function toString():String{
return ((((((((("[Operation " + (priority >>> 24)) + "/") + (priority & 0xFFFFFF)) + " ") + object) + ".") + name) + "]"));
}
alternativa3d function removeSequel(_arg1:Operation):void{
var _local2:*;
var _local3:Boolean;
if (sequel == null){
if (sequels != null){
delete sequels[_arg1];
_local3 = false;
for (_local2 in sequels) {
if (_local3){
_local3 = false;
break;
};
_local3 = true;
};
if (_local3){
sequel = _local2;
sequels = null;
};
};
} else {
if (sequel == _arg1){
sequel = null;
};
};
}
alternativa3d function collectSequels(_arg1:Array):void{
var _local2:*;
var _local3:Operation;
if (sequel == null){
for (_local2 in sequels) {
_local3 = _local2;
if (!_local3.queued){
_arg1.push(_local3);
_local3.queued = true;
_local3.collectSequels(_arg1);
};
};
} else {
if (!sequel.queued){
_arg1.push(sequel);
sequel.queued = true;
sequel.collectSequels(_arg1);
};
};
}
}
}//package alternativa.engine3d.core
Section 9
//PolyPrimitive (alternativa.engine3d.core.PolyPrimitive)
package alternativa.engine3d.core {
import alternativa.engine3d.*;
public class PolyPrimitive {
alternativa3d var sibling:PolyPrimitive;
public var splitQuality:Number;
alternativa3d var node:BSPNode;
alternativa3d var splitTime1:Number;
alternativa3d var num:uint;
alternativa3d var disbalance:int;
alternativa3d var splitTime2:Number;
alternativa3d var backFragment:PolyPrimitive;
alternativa3d var splits:uint;
alternativa3d var face:Face;
alternativa3d var frontFragment:PolyPrimitive;
alternativa3d var points:Array;
alternativa3d var parent:PolyPrimitive;
public var mobility:int;
alternativa3d var uvs:Array;
private static var collector:Array = new Array();
public function PolyPrimitive(){
points = new Array();
uvs = new Array();
super();
}
public function toString():String{
return ((("[Primitive " + face._mesh._name) + "]"));
}
alternativa3d static function destroyPolyPrimitive(_arg1:PolyPrimitive):void{
_arg1.face = null;
var _local2:uint;
while (_local2 < _arg1.num) {
_arg1.points.pop();
_arg1.uvs.pop();
_local2++;
};
collector.push(_arg1);
}
alternativa3d static function createPolyPrimitive():PolyPrimitive{
var _local1:PolyPrimitive;
_local1 = collector.pop();
if (_local1 != null){
return (_local1);
};
return (new (PolyPrimitive));
}
}
}//package alternativa.engine3d.core
Section 10
//Scene3D (alternativa.engine3d.core.Scene3D)
package alternativa.engine3d.core {
import flash.display.*;
import alternativa.types.*;
import alternativa.engine3d.materials.*;
import flash.geom.*;
import alternativa.engine3d.*;
public class Scene3D {
alternativa3d var changePrimitivesOperation:Operation;
alternativa3d var removeNodes:Set;
alternativa3d var _splitAnalysis:Boolean;// = true
alternativa3d var dummyOperation:Operation;
private var childPrimitives:Set;
alternativa3d var bsp:BSPNode;
alternativa3d var changedPrimitives:Set;
alternativa3d var _root:Object3D;
alternativa3d var _splitBalance:Number;// = 0
alternativa3d var dummyNode:BSPNode;
alternativa3d var clearPrimitivesOperation:Operation;
alternativa3d var updateBSPOperation:Operation;
alternativa3d var addPrimitives:Array;
alternativa3d var calculateBSPOperation:Operation;
alternativa3d var operations:Array;
private var _planeOffsetThreshold:Number;// = 0.01
public function Scene3D(){
updateBSPOperation = new Operation("updateBSP", this);
changePrimitivesOperation = new Operation("changePrimitives", this);
calculateBSPOperation = new Operation("calculateBSP", this, calculateBSP, Operation.SCENE_CALCULATE_BSP);
clearPrimitivesOperation = new Operation("clearPrimitives", this, clearPrimitives, Operation.SCENE_CLEAR_PRIMITIVES);
operations = new Array();
dummyOperation = new Operation("removed", this);
changedPrimitives = new Set();
childPrimitives = new Set();
addPrimitives = new Array();
removeNodes = new Set();
dummyNode = new BSPNode();
super();
updateBSPOperation.addSequel(calculateBSPOperation);
calculateBSPOperation.addSequel(changePrimitivesOperation);
changePrimitivesOperation.addSequel(clearPrimitivesOperation);
}
protected function childBSP(_arg1:BSPNode):void{
var _local2:PolyPrimitive;
var _local3:*;
if (((!((_arg1 == null))) && (!((_arg1 == dummyNode))))){
_local2 = _arg1.primitive;
if (_local2 != null){
childPrimitives[_local2] = true;
changedPrimitives[_local2] = true;
_arg1.primitive = null;
_local2.node = null;
} else {
for (_local3 in _arg1.backPrimitives) {
_local2 = _local3;
childPrimitives[_local2] = true;
changedPrimitives[_local2] = true;
_local2.node = null;
};
for (_local3 in _arg1.frontPrimitives) {
_local2 = _local3;
childPrimitives[_local2] = true;
changedPrimitives[_local2] = true;
_local2.node = null;
};
_arg1.backPrimitives = null;
_arg1.frontPrimitives = null;
};
childBSP(_arg1.back);
childBSP(_arg1.front);
_arg1.parent = null;
_arg1.back = null;
_arg1.front = null;
BSPNode.destroyBSPNode(_arg1);
};
}
private function drawBSPNode(_arg1:BSPNode, _arg2:Sprite, _arg3:Number, _arg4:Number, _arg5:Number):void{
var _local8:PolyPrimitive;
var _local6:Shape = new Shape();
_arg2.addChild(_local6);
_local6.x = _arg3;
_local6.y = _arg4;
var _local7:uint = 0xFF0000;
if (_arg1.primitive != null){
_local8 = _arg1.primitive;
} else {
if (_arg1.frontPrimitives != null){
_local8 = _arg1.frontPrimitives.peek();
};
};
if (_local8 != null){
if (((!((_local8.face._surface == null))) && (!((_local8.face._surface._material == null))))){
if ((_local8.face._surface._material is FillMaterial)){
_local7 = FillMaterial(_local8.face._surface._material)._color;
};
if ((_local8.face._surface._material is WireMaterial)){
_local7 = WireMaterial(_local8.face._surface._material)._color;
};
if ((_local8.face._surface._material is TextureMaterial)){
_local7 = TextureMaterial(_local8.face._surface._material).texture._bitmapData.getPixel(0, 0);
};
};
};
if (_arg1 == dummyNode){
_local7 = 0xFF00FF;
};
_local6.graphics.beginFill(_local7);
_local6.graphics.drawCircle(0, 0, 3);
_local6.graphics.endFill();
var _local9:Number = 100;
var _local10:Number = 20;
if (_arg1.back != null){
_arg2.graphics.lineStyle(0, 0x660000);
_arg2.graphics.moveTo(_arg3, _arg4);
_arg2.graphics.lineTo((_arg3 - (_local9 * _arg5)), (_arg4 + _local10));
drawBSPNode(_arg1.back, _arg2, (_arg3 - (_local9 * _arg5)), (_arg4 + _local10), (_arg5 * 0.8));
};
if (_arg1.front != null){
_arg2.graphics.lineStyle(0, 0x6600);
_arg2.graphics.moveTo(_arg3, _arg4);
_arg2.graphics.lineTo((_arg3 + (_local9 * _arg5)), (_arg4 + _local10));
drawBSPNode(_arg1.front, _arg2, (_arg3 + (_local9 * _arg5)), (_arg4 + _local10), (_arg5 * 0.8));
};
}
alternativa3d function removeBSPPrimitive(_arg1:PolyPrimitive):void{
var _local4:*;
var _local5:BSPNode;
var _local2:BSPNode = _arg1.node;
_arg1.node = null;
var _local3:Boolean;
changedPrimitives[_arg1] = true;
if (_local2.primitive == _arg1){
removeNodes[_local2] = true;
_local2.primitive = null;
} else {
if (_local2.frontPrimitives[_arg1]){
delete _local2.frontPrimitives[_arg1];
for (_local4 in _local2.frontPrimitives) {
if (_local3){
_local3 = false;
break;
};
_local3 = true;
};
if (_local4 == null){
_local5 = _local2.back;
_local2.back = _local2.front;
_local2.front = _local5;
_local2.normal.invert();
_local2.offset = -(_local2.offset);
for (_local4 in _local2.backPrimitives) {
if (_local3){
_local3 = false;
break;
};
_local3 = true;
};
if (_local3){
_local2.primitive = _local4;
_local2.mobility = _local2.primitive.mobility;
_local2.frontPrimitives = null;
} else {
_local2.frontPrimitives = _local2.backPrimitives;
if (_arg1.mobility == _local2.mobility){
_local2.mobility = int.MAX_VALUE;
for (_local4 in _local2.frontPrimitives) {
_arg1 = _local4;
_local2.mobility = ((_local2.mobility)>_arg1.mobility) ? _arg1.mobility : _local2.mobility;
};
};
};
_local2.backPrimitives = null;
} else {
if (((_local3) && ((_local2.backPrimitives == null)))){
_local2.primitive = _local4;
_local2.mobility = _local2.primitive.mobility;
_local2.frontPrimitives = null;
} else {
if (_arg1.mobility == _local2.mobility){
_local2.mobility = int.MAX_VALUE;
for (_local4 in _local2.backPrimitives) {
_arg1 = _local4;
_local2.mobility = ((_local2.mobility)>_arg1.mobility) ? _arg1.mobility : _local2.mobility;
};
for (_local4 in _local2.frontPrimitives) {
_arg1 = _local4;
_local2.mobility = ((_local2.mobility)>_arg1.mobility) ? _arg1.mobility : _local2.mobility;
};
};
};
};
} else {
delete _local2.backPrimitives[_arg1];
for (_local4 in _local2.backPrimitives) {
break;
};
if (_local4 == null){
for (_local4 in _local2.frontPrimitives) {
if (_local3){
_local3 = false;
break;
};
_local3 = true;
};
if (_local3){
_local2.primitive = _local4;
_local2.mobility = _local2.primitive.mobility;
_local2.frontPrimitives = null;
} else {
if (_arg1.mobility == _local2.mobility){
_local2.mobility = int.MAX_VALUE;
for (_local4 in _local2.frontPrimitives) {
_arg1 = _local4;
_local2.mobility = ((_local2.mobility)>_arg1.mobility) ? _arg1.mobility : _local2.mobility;
};
};
};
_local2.backPrimitives = null;
} else {
if (_arg1.mobility == _local2.mobility){
_local2.mobility = int.MAX_VALUE;
for (_local4 in _local2.backPrimitives) {
_arg1 = _local4;
_local2.mobility = ((_local2.mobility)>_arg1.mobility) ? _arg1.mobility : _local2.mobility;
};
for (_local4 in _local2.frontPrimitives) {
_arg1 = _local4;
_local2.mobility = ((_local2.mobility)>_arg1.mobility) ? _arg1.mobility : _local2.mobility;
};
};
};
};
};
}
private function analyseSplitQuality():void{
var _local1:uint;
var _local5:PolyPrimitive;
var _local6:Point3D;
var _local7:Number;
var _local8:uint;
var _local9:PolyPrimitive;
var _local10:Boolean;
var _local11:Boolean;
var _local12:uint;
var _local13:Point3D;
var _local14:Number;
var _local2:uint = addPrimitives.length;
var _local3:uint;
var _local4:uint;
_local1 = 0;
while (_local1 < _local2) {
_local5 = addPrimitives[_local1];
_local5.splits = 0;
_local5.disbalance = 0;
_local6 = _local5.face.globalNormal;
_local7 = _local5.face.globalOffset;
_local8 = 0;
while (_local8 < _local2) {
if (_local1 != _local8){
_local9 = addPrimitives[_local8];
if (_local5.mobility <= _local9.mobility){
_local10 = false;
_local11 = false;
_local12 = 0;
while (_local12 < _local9.num) {
_local13 = _local9.points[_local12];
_local14 = ((((_local13.x * _local6.x) + (_local13.y * _local6.y)) + (_local13.z * _local6.z)) - _local7);
if (_local14 > _planeOffsetThreshold){
if (!_local10){
_local5.disbalance++;
_local10 = true;
};
if (_local11){
_local5.splits++;
break;
};
} else {
if (_local14 < -(_planeOffsetThreshold)){
if (!_local11){
_local5.disbalance--;
_local11 = true;
};
if (_local10){
_local5.splits++;
break;
};
};
};
_local12++;
};
};
};
_local8++;
};
_local5.disbalance = ((_local5.disbalance)>0) ? _local5.disbalance : -(_local5.disbalance);
_local3 = ((_local3)>_local5.splits) ? _local3 : _local5.splits;
_local4 = ((_local4)>_local5.disbalance) ? _local4 : _local5.disbalance;
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
_local5 = addPrimitives[_local1];
_local5.splitQuality = ((((1 - _splitBalance) * _local5.splits) / _local3) + ((_splitBalance * _local5.disbalance) / _local4));
_local1++;
};
}
private function clearPrimitives():void{
changedPrimitives.clear();
}
public function get splitAnalysis():Boolean{
return (_splitAnalysis);
}
public function get planeOffsetThreshold():Number{
return (_planeOffsetThreshold);
}
alternativa3d function sortOperations(_arg1:int, _arg2:int):void{
var _local5:Operation;
var _local7:Operation;
var _local3:int = _arg1;
var _local4:int = _arg2;
var _local6:uint = operations[((_arg2 + _arg1) >>> 1)].priority;
do {
while ((_local5 = operations[_local3]).priority < _local6) {
_local3++;
};
while (_local6 < (_local7 = operations[_local4]).priority) {
_local4--;
};
if (_local3 <= _local4){
var _temp1 = _local3;
_local3 = (_local3 + 1);
var _local8 = _temp1;
operations[_local8] = _local7;
var _temp2 = _local4;
_local4 = (_local4 - 1);
var _local9 = _temp2;
operations[_local9] = _local5;
};
} while (_local3 <= _local4);
if (_arg1 < _local4){
sortOperations(_arg1, _local4);
};
if (_local3 < _arg2){
sortOperations(_local3, _arg2);
};
}
public function set splitAnalysis(_arg1:Boolean):void{
if (_splitAnalysis != _arg1){
_splitAnalysis = _arg1;
addOperation(updateBSPOperation);
};
}
alternativa3d function sortPrimitives(_arg1:int, _arg2:int):void{
var _local5:PolyPrimitive;
var _local9:PolyPrimitive;
var _local3:int = _arg1;
var _local4:int = _arg2;
var _local6:PolyPrimitive = addPrimitives[((_arg2 + _arg1) >>> 1)];
var _local7:Number = _local6.mobility;
var _local8:Number = _local6.splitQuality;
do {
while (((((_local5 = addPrimitives[_local3]).mobility > _local7)) || ((((_local5.mobility == _local7)) && ((_local5.splitQuality > _local8)))))) {
_local3++;
};
while ((((_local7 > (_local9 = addPrimitives[_local4]).mobility)) || ((((_local7 == _local9.mobility)) && ((_local8 > _local9.splitQuality)))))) {
_local4--;
};
if (_local3 <= _local4){
var _temp1 = _local3;
_local3 = (_local3 + 1);
var _local10 = _temp1;
addPrimitives[_local10] = _local9;
var _temp2 = _local4;
_local4 = (_local4 - 1);
var _local11 = _temp2;
addPrimitives[_local11] = _local5;
};
} while (_local3 <= _local4);
if (_arg1 < _local4){
sortPrimitives(_arg1, _local4);
};
if (_local3 < _arg2){
sortPrimitives(_local3, _arg2);
};
}
private function assemblePrimitive(_arg1:PolyPrimitive):void{
if (((!((_arg1.sibling == null))) && (canAssemble(_arg1.sibling)))){
assemblePrimitive(_arg1.parent);
_arg1.sibling.sibling = null;
_arg1.sibling.parent = null;
PolyPrimitive.destroyPolyPrimitive(_arg1.sibling);
_arg1.sibling = null;
_arg1.parent.backFragment = null;
_arg1.parent.frontFragment = null;
_arg1.parent = null;
PolyPrimitive.destroyPolyPrimitive(_arg1);
} else {
addPrimitives.push(_arg1);
};
}
public function set planeOffsetThreshold(_arg1:Number):void{
_arg1 = ((_arg1)<0) ? 0 : _arg1;
if (_planeOffsetThreshold != _arg1){
_planeOffsetThreshold = _arg1;
addOperation(updateBSPOperation);
};
}
protected function removeBSPNode(_arg1:BSPNode):BSPNode{
var _local2:BSPNode;
if (_arg1 != null){
_arg1.back = removeBSPNode(_arg1.back);
_arg1.front = removeBSPNode(_arg1.front);
if (!removeNodes[_arg1]){
_local2 = _arg1;
if (_arg1.back != null){
if (_arg1.back != dummyNode){
_arg1.back.parent = _arg1;
} else {
_arg1.back = null;
};
};
if (_arg1.front != null){
if (_arg1.front != dummyNode){
_arg1.front.parent = _arg1;
} else {
_arg1.front = null;
};
};
} else {
if (_arg1.back == null){
if (_arg1.front != null){
_local2 = _arg1.front;
_arg1.front = null;
};
} else {
if (_arg1.front == null){
_local2 = _arg1.back;
_arg1.back = null;
} else {
childBSP(_arg1.back);
childBSP(_arg1.front);
_local2 = dummyNode;
_arg1.back = null;
_arg1.front = null;
};
};
delete removeNodes[_arg1];
_arg1.parent = null;
BSPNode.destroyBSPNode(_arg1);
};
};
return (_local2);
}
private function canAssemble(_arg1:PolyPrimitive):Boolean{
var _local2:PolyPrimitive;
var _local3:PolyPrimitive;
var _local4:Boolean;
var _local5:Boolean;
if (childPrimitives[_arg1]){
delete childPrimitives[_arg1];
return (true);
};
_local2 = _arg1.backFragment;
_local3 = _arg1.frontFragment;
if (_local2 != null){
_local4 = canAssemble(_local2);
_local5 = canAssemble(_local3);
if (((_local4) && (_local5))){
_local2.parent = null;
_local3.parent = null;
_local2.sibling = null;
_local3.sibling = null;
_arg1.backFragment = null;
_arg1.frontFragment = null;
PolyPrimitive.destroyPolyPrimitive(_local2);
PolyPrimitive.destroyPolyPrimitive(_local3);
return (true);
};
if (_local4){
addPrimitives.push(_local2);
};
if (_local5){
addPrimitives.push(_local3);
};
};
return (false);
}
alternativa3d function removeOperation(_arg1:Operation):void{
if (_arg1.queued){
operations[operations.indexOf(_arg1)] = dummyOperation;
_arg1.queued = false;
};
}
public function set root(_arg1:Object3D):void{
if (_root != _arg1){
if (_arg1 != null){
if (_arg1._parent != null){
_arg1._parent._children.remove(_arg1);
} else {
if (((!((_arg1._scene == null))) && ((_arg1._scene._root == _arg1)))){
_arg1._scene.root = null;
};
};
_arg1.setParent(null);
_arg1.setScene(this);
_arg1.setLevel(0);
};
if (_root != null){
_root.setParent(null);
_root.setScene(null);
};
_root = _arg1;
};
}
alternativa3d function addOperation(_arg1:Operation):void{
if (!_arg1.queued){
operations.push(_arg1);
_arg1.queued = true;
};
}
public function hasChanges():Boolean{
var _local1:int = operations.length;
var _local2:int;
while (_local2 < _local1) {
if (operations[_local2] != dummyOperation){
return (true);
};
_local2++;
};
return (false);
}
public function set splitBalance(_arg1:Number):void{
_arg1 = ((_arg1)<0) ? 0 : ((_arg1)>1) ? 1 : _arg1;
if (_splitBalance != _arg1){
_splitBalance = _arg1;
if (_splitAnalysis){
addOperation(updateBSPOperation);
};
};
}
public function drawBSP(_arg1:Sprite):void{
_arg1.graphics.clear();
while (_arg1.numChildren > 0) {
_arg1.removeChildAt(0);
};
if (bsp != null){
drawBSPNode(bsp, _arg1, 0, 0, 1);
};
}
protected function addBSP(_arg1:BSPNode, _arg2:PolyPrimitive):void{
var _local3:Point3D;
var _local4:Point3D;
var _local5:*;
var _local6:PolyPrimitive;
var _local7:Array;
var _local8:Array;
var _local9:Boolean;
var _local10:Boolean;
var _local11:uint;
var _local12:Number;
var _local13:PolyPrimitive;
var _local14:PolyPrimitive;
var _local15:Boolean;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:uint;
var _local20:Number;
var _local21:Point;
if (_arg2.mobility < _arg1.mobility){
if (_arg1.primitive != null){
childPrimitives[_arg1.primitive] = true;
changedPrimitives[_arg1.primitive] = true;
_arg1.primitive.node = null;
} else {
for (_local5 in _arg1.backPrimitives) {
_local6 = _local5;
childPrimitives[_local6] = true;
changedPrimitives[_local6] = true;
_local6.node = null;
};
for (_local5 in _arg1.frontPrimitives) {
_local6 = _local5;
childPrimitives[_local6] = true;
changedPrimitives[_local6] = true;
_local6.node = null;
};
};
childBSP(_arg1.back);
childBSP(_arg1.front);
assembleChildPrimitives();
if (_splitAnalysis){
analyseSplitQuality();
sortPrimitives(0, (addPrimitives.length - 1));
} else {
sortPrimitivesByMobility(0, (addPrimitives.length - 1));
};
_arg1.primitive = _arg2;
changedPrimitives[_arg2] = true;
_arg2.node = _arg1;
_arg1.normal.copy(_arg2.face.globalNormal);
_arg1.offset = _arg2.face.globalOffset;
_arg1.mobility = _arg2.mobility;
_arg1.backPrimitives = null;
_arg1.frontPrimitives = null;
_arg1.back = null;
_arg1.front = null;
} else {
_local4 = _arg1.normal;
_local7 = _arg2.points;
_local8 = _arg2.uvs;
_local9 = false;
_local10 = false;
_local11 = 0;
while (_local11 < _arg2.num) {
_local3 = _local7[_local11];
_local12 = ((((_local3.x * _local4.x) + (_local3.y * _local4.y)) + (_local3.z * _local4.z)) - _arg1.offset);
if (_local12 > _planeOffsetThreshold){
_local9 = true;
if (_local10){
break;
};
} else {
if (_local12 < -(_planeOffsetThreshold)){
_local10 = true;
if (_local9){
break;
};
};
};
_local11++;
};
if (((!(_local9)) && (!(_local10)))){
_arg2.node = _arg1;
if (_arg1.primitive != null){
_arg1.frontPrimitives = new Set(true);
_arg1.frontPrimitives[_arg1.primitive] = true;
_arg1.primitive = null;
};
if (Point3D.dot(_arg2.face.globalNormal, _local4) > 0){
_arg1.frontPrimitives[_arg2] = true;
} else {
if (_arg1.backPrimitives == null){
_arg1.backPrimitives = new Set(true);
};
_arg1.backPrimitives[_arg2] = true;
};
changedPrimitives[_arg2] = true;
} else {
if (!_local10){
if (_arg1.front == null){
_arg1.front = BSPNode.createBSPNode(_arg2);
_arg1.front.parent = _arg1;
changedPrimitives[_arg2] = true;
} else {
addBSP(_arg1.front, _arg2);
};
} else {
if (!_local9){
if (_arg1.back == null){
_arg1.back = BSPNode.createBSPNode(_arg2);
_arg1.back.parent = _arg1;
changedPrimitives[_arg2] = true;
} else {
addBSP(_arg1.back, _arg2);
};
} else {
_local13 = PolyPrimitive.createPolyPrimitive();
_local14 = PolyPrimitive.createPolyPrimitive();
_local15 = true;
_local3 = _local7[0];
_local16 = ((((_local3.x * _local4.x) + (_local3.y * _local4.y)) + (_local3.z * _local4.z)) - _arg1.offset);
_local17 = _local16;
_local11 = 0;
while (_local11 < _arg2.num) {
if (_local11 < (_arg2.num - 1)){
_local19 = (_local11 + 1);
_local3 = _local7[_local19];
_local18 = ((((_local3.x * _local4.x) + (_local3.y * _local4.y)) + (_local3.z * _local4.z)) - _arg1.offset);
} else {
_local19 = 0;
_local18 = _local16;
};
if (_local17 > _planeOffsetThreshold){
_local14.points.push(_local7[_local11]);
_local14.uvs.push(_arg2.uvs[_local11]);
} else {
if (_local17 < -(_planeOffsetThreshold)){
_local13.points.push(_local7[_local11]);
_local13.uvs.push(_arg2.uvs[_local11]);
} else {
_local13.points.push(_local7[_local11]);
_local13.uvs.push(_arg2.uvs[_local11]);
_local14.points.push(_local7[_local11]);
_local14.uvs.push(_arg2.uvs[_local11]);
};
};
if ((((((_local17 > _planeOffsetThreshold)) && ((_local18 < -(_planeOffsetThreshold))))) || ((((_local17 < -(_planeOffsetThreshold))) && ((_local18 > _planeOffsetThreshold)))))){
_local20 = (_local17 / (_local17 - _local18));
_local3 = Point3D.interpolate(_local7[_local11], _local7[_local19], _local20);
_local13.points.push(_local3);
_local14.points.push(_local3);
if (_arg2.face.uvMatrixBase != null){
_local21 = Point.interpolate(_local8[_local19], _local8[_local11], _local20);
} else {
_local21 = null;
};
_local13.uvs.push(_local21);
_local14.uvs.push(_local21);
if (_local15){
_arg2.splitTime1 = _local20;
_local15 = false;
} else {
_arg2.splitTime2 = _local20;
};
};
_local17 = _local18;
_local11++;
};
_local13.num = _local13.points.length;
_local14.num = _local14.points.length;
_local13.mobility = _arg2.mobility;
_local14.mobility = _arg2.mobility;
_local13.face = _arg2.face;
_local14.face = _arg2.face;
_local13.parent = _arg2;
_local14.parent = _arg2;
_local13.sibling = _local14;
_local14.sibling = _local13;
_arg2.backFragment = _local13;
_arg2.frontFragment = _local14;
if (_arg1.back == null){
_arg1.back = BSPNode.createBSPNode(_local13);
_arg1.back.parent = _arg1;
changedPrimitives[_local13] = true;
} else {
addBSP(_arg1.back, _local13);
};
if (_arg1.front == null){
_arg1.front = BSPNode.createBSPNode(_local14);
_arg1.front.parent = _arg1;
changedPrimitives[_local14] = true;
} else {
addBSP(_arg1.front, _local14);
};
};
};
};
};
}
public function get root():Object3D{
return (_root);
}
public function calculate():void{
var _local1:Operation;
var _local2:uint;
var _local3:uint;
if (operations[0] != undefined){
_local2 = operations.length;
_local3 = 0;
while (_local3 < _local2) {
_local1 = operations[_local3];
_local1.collectSequels(operations);
_local3++;
};
_local2 = operations.length;
sortOperations(0, (_local2 - 1));
_local3 = 0;
while (_local3 < _local2) {
_local1 = operations[_local3];
if (_local1.method != null){
_local1.method();
};
_local3++;
};
_local3 = 0;
while (_local3 < _local2) {
_local1 = operations.pop();
_local1.queued = false;
_local3++;
};
};
}
public function get splitBalance():Number{
return (_splitBalance);
}
alternativa3d function sortPrimitivesByMobility(_arg1:int, _arg2:int):void{
var _local5:PolyPrimitive;
var _local7:PolyPrimitive;
var _local3:int = _arg1;
var _local4:int = _arg2;
var _local6:int = addPrimitives[((_arg2 + _arg1) >>> 1)].mobility;
do {
while ((_local5 = addPrimitives[_local3]).mobility > _local6) {
_local3++;
};
while (_local6 > (_local7 = addPrimitives[_local4]).mobility) {
_local4--;
};
if (_local3 <= _local4){
var _temp1 = _local3;
_local3 = (_local3 + 1);
var _local8 = _temp1;
addPrimitives[_local8] = _local7;
var _temp2 = _local4;
_local4 = (_local4 - 1);
var _local9 = _temp2;
addPrimitives[_local9] = _local5;
};
} while (_local3 <= _local4);
if (_arg1 < _local4){
sortPrimitivesByMobility(_arg1, _local4);
};
if (_local3 < _arg2){
sortPrimitivesByMobility(_local3, _arg2);
};
}
protected function assembleChildPrimitives():void{
var _local1:PolyPrimitive;
while ((_local1 = childPrimitives.take()) != null) {
assemblePrimitive(_local1);
};
}
protected function calculateBSP():void{
var _local1:*;
var _local2:PolyPrimitive;
var _local3:BSPNode;
var _local4:BSPNode;
var _local5:BSPNode;
var _local6:BSPNode;
if (updateBSPOperation.queued){
removeNodes.clear();
childBSP(bsp);
bsp = null;
assembleChildPrimitives();
} else {
if (!removeNodes.isEmpty()){
while ((_local3 = removeNodes.peek()) != null) {
_local4 = _local3;
while ((_local3 = _local3.parent) != null) {
if (removeNodes[_local3]){
_local4 = _local3;
};
};
_local5 = _local4.parent;
_local6 = removeBSPNode(_local4);
if (_local6 == dummyNode){
_local6 = null;
};
if (_local5 != null){
if (_local5.front == _local4){
_local5.front = _local6;
} else {
_local5.back = _local6;
};
} else {
bsp = _local6;
};
if (_local6 != null){
_local6.parent = _local5;
};
};
assembleChildPrimitives();
};
};
if (addPrimitives[0] != undefined){
if (_splitAnalysis){
analyseSplitQuality();
sortPrimitives(0, (addPrimitives.length - 1));
} else {
sortPrimitivesByMobility(0, (addPrimitives.length - 1));
};
if (bsp == null){
_local2 = addPrimitives.pop();
bsp = BSPNode.createBSPNode(_local2);
changedPrimitives[_local2] = true;
};
while ((_local2 = addPrimitives.pop()) != null) {
addBSP(bsp, _local2);
};
};
}
}
}//package alternativa.engine3d.core
Section 11
//Surface (alternativa.engine3d.core.Surface)
package alternativa.engine3d.core {
import alternativa.types.*;
import alternativa.engine3d.materials.*;
import alternativa.engine3d.errors.*;
import alternativa.engine3d.*;
public class Surface {
alternativa3d var changeFacesOperation:Operation;
alternativa3d var _material:SurfaceMaterial;
alternativa3d var changeMaterialOperation:Operation;
alternativa3d var _faces:Set;
alternativa3d var _mesh:Mesh;
public function Surface(){
changeFacesOperation = new Operation("changeFaces", this);
changeMaterialOperation = new Operation("changeMaterial", this);
_faces = new Set();
super();
}
alternativa3d function addMaterialChangedOperationToScene():void{
if (_mesh != null){
_mesh.addOperationToScene(changeMaterialOperation);
};
}
public function toString():String{
var _local4:*;
var _local5:Face;
var _local1:uint = _faces.length;
var _local2:String = (("[Surface ID:" + id) + ((_local1)>0) ? " faces:" : "");
var _local3:uint;
for (_local4 in _faces) {
_local5 = _local4;
_local2 = (_local2 + (_local5.id + ((_local3)<(_local1 - 1)) ? ", " : ""));
_local3++;
};
_local2 = (_local2 + "]");
return (_local2);
}
alternativa3d function removeFromScene(_arg1:Scene3D):void{
_arg1.removeOperation(changeFacesOperation);
_arg1.removeOperation(changeMaterialOperation);
if (_material != null){
_material.removeFromScene(_arg1);
};
}
public function get material():SurfaceMaterial{
return (_material);
}
public function removeFace(_arg1:Object):void{
var _local2 = (_arg1 is Face);
if (_mesh == null){
throw (new FaceNotFoundError(_arg1, this));
};
if (_arg1 == null){
throw (new FaceNotFoundError(null, this));
};
if (_local2){
if (Face(_arg1)._mesh != _mesh){
throw (new FaceNotFoundError(_arg1, this));
};
} else {
if (_mesh._faces[_arg1] == undefined){
throw (new FaceNotFoundError(_arg1, this));
};
if (!(_mesh._faces[_arg1] is Face)){
throw (new InvalidIDError(_arg1, this));
};
};
var _local3:Face = (_local2) ? Face(_arg1) : _mesh._faces[_arg1];
if (!_faces.has(_local3)){
throw (new FaceNotFoundError(_local3, this));
};
_faces.remove(_local3);
_local3.removeFromSurface(this);
_mesh.addOperationToScene(changeFacesOperation);
}
alternativa3d function addToMesh(_arg1:Mesh):void{
if (_material != null){
_material.addToMesh(_arg1);
};
_mesh = _arg1;
}
public function get id():Object{
return (((_mesh)!=null) ? _mesh.getSurfaceId(this) : null);
}
public function get mesh():Mesh{
return (_mesh);
}
alternativa3d function removeFaces():void{
var _local1:*;
var _local2:Face;
for (_local1 in _faces) {
_local2 = _local1;
_faces.remove(_local2);
_local2.removeFromSurface(this);
};
}
public function set material(_arg1:SurfaceMaterial):void{
if (_material != _arg1){
if (_material != null){
_material.removeFromSurface(this);
if (_mesh != null){
_material.removeFromMesh(_mesh);
if (_mesh._scene != null){
_material.removeFromScene(_mesh._scene);
};
};
};
if (_arg1 != null){
if (_arg1._surface != null){
_arg1._surface.material = null;
};
_arg1.addToSurface(this);
if (_mesh != null){
_arg1.addToMesh(_mesh);
if (_mesh._scene != null){
_arg1.addToScene(_mesh._scene);
};
};
};
_material = _arg1;
addMaterialChangedOperationToScene();
};
}
public function get faces():Set{
return (_faces.clone());
}
alternativa3d function removeFromMesh(_arg1:Mesh):void{
if (_material != null){
_material.removeFromMesh(_arg1);
};
_mesh = null;
}
public function addFace(_arg1:Object):void{
var _local2 = (_arg1 is Face);
if (_mesh == null){
throw (new FaceNotFoundError(_arg1, this));
};
if (_arg1 == null){
throw (new FaceNotFoundError(null, this));
};
if (_local2){
if (Face(_arg1)._mesh != _mesh){
throw (new FaceNotFoundError(_arg1, this));
};
} else {
if (_mesh._faces[_arg1] == undefined){
throw (new FaceNotFoundError(_arg1, this));
};
if (!(_mesh._faces[_arg1] is Face)){
throw (new InvalidIDError(_arg1, this));
};
};
var _local3:Face = (_local2) ? Face(_arg1) : _mesh._faces[_arg1];
if (_faces.has(_local3)){
throw (new FaceExistsError(_local3, this));
};
if (_local3._surface != null){
_local3._surface._faces.remove(_local3);
_local3.removeFromSurface(_local3._surface);
};
_faces.add(_local3);
_local3.addToSurface(this);
_mesh.addOperationToScene(changeFacesOperation);
}
alternativa3d function addToScene(_arg1:Scene3D):void{
if (_material != null){
_material.addToScene(_arg1);
};
}
}
}//package alternativa.engine3d.core
Section 12
//Vertex (alternativa.engine3d.core.Vertex)
package alternativa.engine3d.core {
import alternativa.types.*;
import alternativa.engine3d.*;
public final class Vertex {
alternativa3d var _mesh:Mesh;
alternativa3d var changeCoordsOperation:Operation;
alternativa3d var globalCoords:Point3D;
alternativa3d var calculateCoordsOperation:Operation;
alternativa3d var _faces:Set;
alternativa3d var _coords:Point3D;
public function Vertex(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
changeCoordsOperation = new Operation("changeCoords", this);
calculateCoordsOperation = new Operation("calculateCoords", this, calculateCoords, Operation.VERTEX_CALCULATE_COORDS);
_faces = new Set();
globalCoords = new Point3D();
super();
_coords = new Point3D(_arg1, _arg2, _arg3);
changeCoordsOperation.addSequel(calculateCoordsOperation);
}
alternativa3d function addToFace(_arg1:Face):void{
changeCoordsOperation.addSequel(_arg1.calculateUVOperation);
changeCoordsOperation.addSequel(_arg1.calculateNormalOperation);
_faces.add(_arg1);
}
alternativa3d function removeFromFace(_arg1:Face):void{
changeCoordsOperation.removeSequel(_arg1.calculateUVOperation);
changeCoordsOperation.removeSequel(_arg1.calculateNormalOperation);
_faces.remove(_arg1);
}
alternativa3d function addToMesh(_arg1:Mesh):void{
_arg1.changeCoordsOperation.addSequel(calculateCoordsOperation);
_arg1.changeRotationOrScaleOperation.addSequel(calculateCoordsOperation);
_mesh = _arg1;
}
public function get id():Object{
return (((_mesh)!=null) ? _mesh.getVertexId(this) : null);
}
public function get coords():Point3D{
return (_coords.clone());
}
alternativa3d function removeFromMesh(_arg1:Mesh):void{
var _local2:*;
var _local3:Face;
_arg1.changeCoordsOperation.removeSequel(calculateCoordsOperation);
_arg1.changeRotationOrScaleOperation.removeSequel(calculateCoordsOperation);
for (_local2 in _faces) {
_local3 = _local2;
_arg1.removeFace(_local3);
};
_mesh = null;
}
private function calculateCoords():void{
globalCoords.copy(_coords);
globalCoords.transform(_mesh.transformation);
}
alternativa3d function removeFromScene(_arg1:Scene3D):void{
_arg1.removeOperation(calculateCoordsOperation);
_arg1.removeOperation(changeCoordsOperation);
}
public function toString():String{
return ((((((((("[Vertex ID:" + id) + " ") + _coords.x.toFixed(2)) + ", ") + _coords.y.toFixed(2)) + ", ") + _coords.z.toFixed(2)) + "]"));
}
public function get mesh():Mesh{
return (_mesh);
}
public function set x(_arg1:Number):void{
if (_coords.x != _arg1){
_coords.x = _arg1;
if (_mesh != null){
_mesh.addOperationToScene(changeCoordsOperation);
};
};
}
public function set y(_arg1:Number):void{
if (_coords.y != _arg1){
_coords.y = _arg1;
if (_mesh != null){
_mesh.addOperationToScene(changeCoordsOperation);
};
};
}
public function set z(_arg1:Number):void{
if (_coords.z != _arg1){
_coords.z = _arg1;
if (_mesh != null){
_mesh.addOperationToScene(changeCoordsOperation);
};
};
}
public function get faces():Set{
return (_faces.clone());
}
public function get x():Number{
return (_coords.x);
}
public function get y():Number{
return (_coords.y);
}
public function get z():Number{
return (_coords.z);
}
public function set coords(_arg1:Point3D):void{
if (!_coords.equals(_arg1)){
_coords.copy(_arg1);
if (_mesh != null){
_mesh.addOperationToScene(changeCoordsOperation);
};
};
}
alternativa3d function addToScene(_arg1:Scene3D):void{
_arg1.addOperation(calculateCoordsOperation);
}
}
}//package alternativa.engine3d.core
Section 13
//Skin (alternativa.engine3d.display.Skin)
package alternativa.engine3d.display {
import flash.display.*;
import alternativa.engine3d.core.*;
import alternativa.engine3d.materials.*;
import alternativa.engine3d.*;
public class Skin extends Sprite {
alternativa3d var nextSkin:Skin;
alternativa3d var material:SurfaceMaterial;
alternativa3d var primitive:PolyPrimitive;
alternativa3d var gfx:Graphics;
private static var collector:Array = new Array();
public function Skin(){
gfx = graphics;
super();
}
alternativa3d static function createSkin():Skin{
var _local1:Skin;
_local1 = collector.pop();
if (_local1 != null){
return (_local1);
};
return (new (Skin));
}
alternativa3d static function destroySkin(_arg1:Skin):void{
collector.push(_arg1);
}
}
}//package alternativa.engine3d.display
Section 14
//View (alternativa.engine3d.display.View)
package alternativa.engine3d.display {
import flash.display.*;
import alternativa.engine3d.core.*;
import flash.geom.*;
import alternativa.engine3d.*;
public class View extends Sprite {
private var _camera:Camera3D;
alternativa3d var _height:Number;
alternativa3d var _width:Number;
alternativa3d var canvas:Sprite;
public function View(_arg1:Camera3D=null, _arg2:Number=0, _arg3:Number=0){
canvas = new Sprite();
canvas.mouseEnabled = false;
canvas.mouseChildren = false;
canvas.tabEnabled = false;
canvas.tabChildren = false;
addChild(canvas);
this.camera = _arg1;
this.width = _arg2;
this.height = _arg3;
}
public function get camera():Camera3D{
return (_camera);
}
public function set camera(_arg1:Camera3D):void{
var _local2:Skin;
var _local3:Skin;
if (_camera != _arg1){
if (_camera != null){
_camera.removeFromView(this);
};
if (_arg1 != null){
if (_arg1._view != null){
_arg1._view.camera = null;
};
_arg1.addToView(this);
} else {
if (canvas.numChildren > 0){
_local2 = Skin(canvas.getChildAt(0));
while (_local2 != null) {
_local3 = _local2.nextSkin;
canvas.removeChild(_local2);
if (_local2.material != null){
_local2.material.clear(_local2);
};
_local2.nextSkin = null;
_local2.primitive = null;
_local2.material = null;
Skin.destroySkin(_local2);
_local2 = _local3;
};
};
};
_camera = _arg1;
};
}
public function getFaceUnderPoint(_arg1:Point):Face{
var _local2:Point = localToGlobal(_arg1);
var _local3:Array = canvas.getObjectsUnderPoint(_local2);
var _local4:Skin = (_local3.pop() as Skin);
if (_local4 != null){
return (_local4.primitive.face);
};
return (null);
}
override public function get width():Number{
return (_width);
}
override public function set height(_arg1:Number):void{
if (_height != _arg1){
_height = _arg1;
canvas.y = (_height * 0.5);
if (_camera != null){
camera.addOperationToScene(camera.calculatePlanesOperation);
};
};
}
override public function get height():Number{
return (_height);
}
override public function set width(_arg1:Number):void{
if (_width != _arg1){
_width = _arg1;
canvas.x = (_width * 0.5);
if (_camera != null){
camera.addOperationToScene(camera.calculatePlanesOperation);
};
};
}
public function getFacesUnderPoint(_arg1:Point):Array{
var _local7:Skin;
var _local2:Point = localToGlobal(_arg1);
var _local3:Array = canvas.getObjectsUnderPoint(_local2);
var _local4:Array = new Array();
var _local5:uint = _local3.length;
var _local6:uint;
while (_local6 < _local5) {
_local7 = _local3[_local6];
_local4.push(_local7.primitive.face);
_local6++;
};
return (_local4);
}
}
}//package alternativa.engine3d.display
Section 15
//Engine3DError (alternativa.engine3d.errors.Engine3DError)
package alternativa.engine3d.errors {
public class Engine3DError extends Error {
public var source:Object;
public function Engine3DError(_arg1:String="", _arg2:Object=null){
super(_arg1);
this.source = _arg2;
this.name = "Engine3DError";
}
}
}//package alternativa.engine3d.errors
Section 16
//FaceExistsError (alternativa.engine3d.errors.FaceExistsError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class FaceExistsError extends ObjectExistsError {
public function FaceExistsError(_arg1:Object=null, _arg2:Object=null){
var _local3:String;
if ((_arg2 is Mesh)){
_local3 = "Mesh ";
} else {
if ((_arg2 is Surface)){
_local3 = "Surface ";
};
};
if ((_arg1 is Face)){
_local3 = (_local3 + "%1. Face %2 already exists.");
} else {
_local3 = (_local3 + "%1. Face with ID '%2' already exists.");
};
super(TextUtils.insertVars(_local3, _arg2, _arg1), _arg1, _arg2);
this.name = "FaceExistsError";
}
}
}//package alternativa.engine3d.errors
Section 17
//FaceNeedMoreVerticesError (alternativa.engine3d.errors.FaceNeedMoreVerticesError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class FaceNeedMoreVerticesError extends Engine3DError {
public var count:uint;
public function FaceNeedMoreVerticesError(_arg1:Mesh=null, _arg2:uint=0){
super(TextUtils.insertVars("Mesh %1. %2 vertices not enough for face creation.", _arg1, _arg2), _arg1);
this.count = _arg2;
this.name = "FaceNeedMoreVerticesError";
}
}
}//package alternativa.engine3d.errors
Section 18
//FaceNotFoundError (alternativa.engine3d.errors.FaceNotFoundError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class FaceNotFoundError extends ObjectNotFoundError {
public function FaceNotFoundError(_arg1:Object=null, _arg2:Object=null){
var _local3:String;
if ((_arg2 is Mesh)){
_local3 = "Mesh ";
} else {
_local3 = "Surface ";
};
if ((_arg1 is Face)){
_local3 = (_local3 + "%1. Face %2 not found.");
} else {
_local3 = (_local3 + "%1. Face with ID '%2' not found.");
};
super(TextUtils.insertVars(_local3, _arg2, _arg1), _arg1, _arg2);
this.name = "FaceNotFoundError";
}
}
}//package alternativa.engine3d.errors
Section 19
//InvalidIDError (alternativa.engine3d.errors.InvalidIDError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class InvalidIDError extends Engine3DError {
public var id:Object;
public function InvalidIDError(_arg1:Object=null, _arg2:Object=null){
var _local3:String;
if ((_arg2 is Mesh)){
_local3 = "Mesh %2. ";
} else {
if ((_arg2 is Surface)){
_local3 = "Surface %2. ";
};
};
super(TextUtils.insertVars((_local3 + "ID %1 is reserved and cannot be used"), [_arg1, _arg2]), _arg2);
this.id = _arg1;
this.name = "InvalidIDError";
}
}
}//package alternativa.engine3d.errors
Section 20
//Object3DHierarchyError (alternativa.engine3d.errors.Object3DHierarchyError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class Object3DHierarchyError extends Engine3DError {
public var object:Object3D;
public function Object3DHierarchyError(_arg1:Object3D=null, _arg2:Object3D=null){
super(TextUtils.insertVars("Object3D %1. Object %2 cannot be added", _arg2, _arg1), _arg2);
this.object = _arg1;
this.name = "Object3DHierarchyError";
}
}
}//package alternativa.engine3d.errors
Section 21
//Object3DNotFoundError (alternativa.engine3d.errors.Object3DNotFoundError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class Object3DNotFoundError extends ObjectNotFoundError {
public function Object3DNotFoundError(_arg1:Object3D=null, _arg2:Object3D=null){
super(TextUtils.insertVars("Object3D %1. Object %2 not in child list", _arg2, _arg1), _arg1, _arg2);
this.name = "Object3DNotFoundError";
}
}
}//package alternativa.engine3d.errors
Section 22
//ObjectExistsError (alternativa.engine3d.errors.ObjectExistsError)
package alternativa.engine3d.errors {
public class ObjectExistsError extends Engine3DError {
public var object:Object;
public function ObjectExistsError(_arg1:String="", _arg2:Object=null, _arg3:Object=null){
super(_arg1, _arg3);
this.object = _arg2;
this.name = "ObjectExistsError";
}
}
}//package alternativa.engine3d.errors
Section 23
//ObjectNotFoundError (alternativa.engine3d.errors.ObjectNotFoundError)
package alternativa.engine3d.errors {
public class ObjectNotFoundError extends Engine3DError {
public var object:Object;
public function ObjectNotFoundError(_arg1:String="", _arg2:Object=null, _arg3:Object=null){
super(_arg1, _arg3);
this.object = _arg2;
this.name = "ObjectNotFoundError";
}
}
}//package alternativa.engine3d.errors
Section 24
//SurfaceExistsError (alternativa.engine3d.errors.SurfaceExistsError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class SurfaceExistsError extends ObjectExistsError {
public function SurfaceExistsError(_arg1:Object=null, _arg2:Mesh=null){
super(TextUtils.insertVars("Mesh %1. Surface with ID '%2' already exists.", _arg2, _arg1), _arg1, _arg2);
this.name = "SurfaceExistsError";
}
}
}//package alternativa.engine3d.errors
Section 25
//SurfaceNotFoundError (alternativa.engine3d.errors.SurfaceNotFoundError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class SurfaceNotFoundError extends ObjectNotFoundError {
public function SurfaceNotFoundError(_arg1:Object=null, _arg2:Mesh=null){
if (_arg2 == null){
};
if ((_arg1 is Surface)){
message = "Mesh %1. Surface %2 not found.";
} else {
message = "Mesh %1. Surface with ID '%2' not found.";
};
super(TextUtils.insertVars(message, _arg2, _arg1), _arg1, _arg2);
this.name = "SurfaceNotFoundError";
}
}
}//package alternativa.engine3d.errors
Section 26
//VertexExistsError (alternativa.engine3d.errors.VertexExistsError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class VertexExistsError extends ObjectExistsError {
public function VertexExistsError(_arg1:Object=null, _arg2:Mesh=null){
super(TextUtils.insertVars("Mesh %1. Vertex with ID '%2' already exists.", _arg2, _arg1), _arg1, _arg2);
this.name = "VertexExistsError";
}
}
}//package alternativa.engine3d.errors
Section 27
//VertexNotFoundError (alternativa.engine3d.errors.VertexNotFoundError)
package alternativa.engine3d.errors {
import alternativa.engine3d.core.*;
import alternativa.utils.*;
public class VertexNotFoundError extends ObjectNotFoundError {
public function VertexNotFoundError(_arg1:Object=null, _arg2:Mesh=null){
if ((_arg1 is Vertex)){
message = "Mesh %1. Vertex %2 not found.";
} else {
message = "Mesh %1. Vertex with ID '%2' not found.";
};
super(TextUtils.insertVars(message, _arg2, _arg1), _arg1, _arg2);
this.name = "VertexNotFoundError";
}
}
}//package alternativa.engine3d.errors
Section 28
//DrawPoint (alternativa.engine3d.materials.DrawPoint)
package alternativa.engine3d.materials {
public final class DrawPoint {
public var u:Number;
public var v:Number;
public var x:Number;
public var y:Number;
public var z:Number;
public function DrawPoint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0, _arg5:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.u = _arg4;
this.v = _arg5;
}
}
}//package alternativa.engine3d.materials
Section 29
//FillMaterial (alternativa.engine3d.materials.FillMaterial)
package alternativa.engine3d.materials {
import flash.display.*;
import alternativa.engine3d.core.*;
import alternativa.engine3d.display.*;
import alternativa.engine3d.*;
public class FillMaterial extends SurfaceMaterial {
alternativa3d var _color:uint;
alternativa3d var _wireThickness:Number;
alternativa3d var _wireColor:uint;
public function FillMaterial(_arg1:uint, _arg2:Number=1, _arg3:String="normal", _arg4:Number=-1, _arg5:uint=0){
super(_arg2, _arg3);
_color = _arg1;
_wireThickness = _arg4;
_wireColor = _arg5;
}
public function get color():uint{
return (_color);
}
public function set color(_arg1:uint):void{
if (_color != _arg1){
_color = _arg1;
if (_surface != null){
_surface.addMaterialChangedOperationToScene();
};
};
}
override alternativa3d function draw(_arg1:Camera3D, _arg2:Skin, _arg3:uint, _arg4:Array):void{
var _local5:uint;
var _local6:DrawPoint;
var _local8:Number;
_arg2.alpha = _alpha;
_arg2.blendMode = _blendMode;
var _local7:Graphics = _arg2.gfx;
if (_arg1._orthographic){
_local7.beginFill(_color);
if (_wireThickness >= 0){
_local7.lineStyle(_wireThickness, _wireColor);
};
_local6 = _arg4[0];
_local7.moveTo(_local6.x, _local6.y);
_local5 = 1;
while (_local5 < _arg3) {
_local6 = _arg4[_local5];
_local7.lineTo(_local6.x, _local6.y);
_local5++;
};
if (_wireThickness >= 0){
_local6 = _arg4[0];
_local7.lineTo(_local6.x, _local6.y);
};
} else {
_local7.beginFill(_color);
if (_wireThickness >= 0){
_local7.lineStyle(_wireThickness, _wireColor);
};
_local6 = _arg4[0];
_local8 = (_arg1.focalLength / _local6.z);
_local7.moveTo((_local6.x * _local8), (_local6.y * _local8));
_local5 = 1;
while (_local5 < _arg3) {
_local6 = _arg4[_local5];
_local8 = (_arg1.focalLength / _local6.z);
_local7.lineTo((_local6.x * _local8), (_local6.y * _local8));
_local5++;
};
if (_wireThickness >= 0){
_local6 = _arg4[0];
_local8 = (_arg1.focalLength / _local6.z);
_local7.lineTo((_local6.x * _local8), (_local6.y * _local8));
};
};
}
public function get wireColor():uint{
return (_wireColor);
}
public function get wireThickness():Number{
return (_wireThickness);
}
public function set wireColor(_arg1:uint):void{
if (_wireColor != _arg1){
_wireColor = _arg1;
if (_surface != null){
_surface.addMaterialChangedOperationToScene();
};
};
}
override public function clone():Material{
var _local1:FillMaterial = new FillMaterial(_color, _alpha, _blendMode, _wireThickness, _wireColor);
return (_local1);
}
public function set wireThickness(_arg1:Number):void{
if (_wireThickness != _arg1){
_wireThickness = _arg1;
if (_surface != null){
_surface.addMaterialChangedOperationToScene();
};
};
}
}
}//package alternativa.engine3d.materials
Section 30
//Material (alternativa.engine3d.materials.Material)
package alternativa.engine3d.materials {
public class Material {
public function clone():Material{
return (new Material());
}
}
}//package alternativa.engine3d.materials
Section 31
//SurfaceMaterial (alternativa.engine3d.materials.SurfaceMaterial)
package alternativa.engine3d.materials {
import alternativa.engine3d.core.*;
import alternativa.engine3d.display.*;
import alternativa.engine3d.*;
public class SurfaceMaterial extends Material {
alternativa3d var useUV:Boolean;// = false
alternativa3d var _surface:Surface;
alternativa3d var _blendMode:String;// = "normal"
alternativa3d var _alpha:Number;
public function SurfaceMaterial(_arg1:Number=1, _arg2:String="normal"){
_alpha = _arg1;
_blendMode = _arg2;
}
public function set alpha(_arg1:Number):void{
if (_alpha != _arg1){
_alpha = _arg1;
if (_surface != null){
_surface.addMaterialChangedOperationToScene();
};
};
}
alternativa3d function draw(_arg1:Camera3D, _arg2:Skin, _arg3:uint, _arg4:Array):void{
_arg2.alpha = _alpha;
_arg2.blendMode = _blendMode;
}
alternativa3d function removeFromSurface(_arg1:Surface):void{
_surface = null;
}
alternativa3d function addToMesh(_arg1:Mesh):void{
}
alternativa3d function canDraw(_arg1:PolyPrimitive):Boolean{
return (true);
}
public function get surface():Surface{
return (_surface);
}
public function set blendMode(_arg1:String):void{
if (_blendMode != _arg1){
_blendMode = _arg1;
if (_surface != null){
_surface.addMaterialChangedOperationToScene();
};
};
}
alternativa3d function addToSurface(_arg1:Surface):void{
_surface = _arg1;
}
public function get blendMode():String{
return (_blendMode);
}
public function get alpha():Number{
return (_alpha);
}
alternativa3d function addToScene(_arg1:Scene3D):void{
}
alternativa3d function clear(_arg1:Skin):void{
_arg1.gfx.clear();
}
alternativa3d function removeFromMesh(_arg1:Mesh):void{
}
override public function clone():Material{
return (new SurfaceMaterial(_alpha, _blendMode));
}
alternativa3d function removeFromScene(_arg1:Scene3D):void{
}
}
}//package alternativa.engine3d.materials
Section 32
//TextureMaterial (alternativa.engine3d.materials.TextureMaterial)
package alternativa.engine3d.materials {
import flash.display.*;
import alternativa.types.*;
import alternativa.engine3d.core.*;
import flash.geom.*;
import alternativa.engine3d.display.*;
import alternativa.engine3d.*;
public class TextureMaterial extends SurfaceMaterial {
alternativa3d var _repeat:Boolean;
alternativa3d var _smooth:Boolean;
alternativa3d var _texture:Texture;
private var distortion:Number;
alternativa3d var _wireColor:uint;
private var focalLength:Number;
alternativa3d var _wireThickness:Number;
private var gfx:Graphics;
private var textureMatrix:Matrix;
alternativa3d var _precision:Number;
private static var stubMatrix:Matrix;
private static var stubBitmapData:BitmapData;
public function TextureMaterial(_arg1:Texture, _arg2:Number=1, _arg3:Boolean=true, _arg4:Boolean=false, _arg5:String="normal", _arg6:Number=-1, _arg7:uint=0, _arg8:Number=10){
textureMatrix = new Matrix();
super(_arg2, _arg5);
_texture = _arg1;
_repeat = _arg3;
_smooth = _arg4;
_wireThickness = _arg6;
_wireColor = _arg7;
_precision = _arg8;
useUV = true;
}
public function set wireColor(_arg1:uint):void{
if (_wireColor != _arg1){
_wireColor = _arg1;
if (_surface != null){
_surface.addMaterialChangedOperationToScene();
};
};
}
override alternativa3d function draw(_arg1:Camera3D, _arg2:Skin, _arg3:uint, _arg4:Array):void{
var _local5:uint;
var _local6:DrawPoint;
var _local7:Number;
var _local8:Face;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:Boolean;
var _local14:DrawPoint;
var _local15:DrawPoint;
var _local16:DrawPoint;
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;
_arg2.alpha = _alpha;
_arg2.blendMode = _blendMode;
gfx = _arg2.gfx;
if (_arg2.primitive.face.uvMatrixBase == null){
if (stubBitmapData == null){
stubBitmapData = new BitmapData(2, 2, false, 0);
stubBitmapData.setPixel(0, 0, 0xFF00FF);
stubBitmapData.setPixel(1, 1, 0xFF00FF);
stubMatrix = new Matrix(10, 0, 0, 10, 0, 0);
};
gfx.beginBitmapFill(stubBitmapData, stubMatrix);
if (_arg1._orthographic){
if (_wireThickness >= 0){
gfx.lineStyle(_wireThickness, _wireColor);
};
_local6 = _arg4[0];
gfx.moveTo(_local6.x, _local6.y);
_local5 = 1;
while (_local5 < _arg3) {
_local6 = _arg4[_local5];
gfx.lineTo(_local6.x, _local6.y);
_local5++;
};
if (_wireThickness >= 0){
_local6 = _arg4[0];
gfx.lineTo(_local6.x, _local6.y);
};
} else {
if (_wireThickness >= 0){
gfx.lineStyle(_wireThickness, _wireColor);
};
_local6 = _arg4[0];
_local7 = (_arg1.focalLength / _local6.z);
gfx.moveTo((_local6.x * _local7), (_local6.y * _local7));
_local5 = 1;
while (_local5 < _arg3) {
_local6 = _arg4[_local5];
_local7 = (_arg1.focalLength / _local6.z);
gfx.lineTo((_local6.x * _local7), (_local6.y * _local7));
_local5++;
};
if (_wireThickness >= 0){
_local6 = _arg4[0];
_local7 = (_arg1.focalLength / _local6.z);
gfx.lineTo((_local6.x * _local7), (_local6.y * _local7));
};
};
return;
};
if (_arg1._orthographic){
_local8 = _arg2.primitive.face;
if (!_arg1.uvMatricesCalculated[_local8]){
_arg1.calculateUVMatrix(_local8, _texture._width, _texture._height);
};
gfx.beginBitmapFill(_texture._bitmapData, _local8.uvMatrix, _repeat, _smooth);
if (_wireThickness >= 0){
gfx.lineStyle(_wireThickness, _wireColor);
};
_local6 = _arg4[0];
gfx.moveTo(_local6.x, _local6.y);
_local5 = 1;
while (_local5 < _arg3) {
_local6 = _arg4[_local5];
gfx.lineTo(_local6.x, _local6.y);
_local5++;
};
if (_wireThickness >= 0){
_local6 = _arg4[0];
gfx.lineTo(_local6.x, _local6.y);
};
} else {
focalLength = _arg1.focalLength;
distortion = (_arg1.focalDistortion * _precision);
_local9 = 0;
_local10 = (_arg3 - 1);
_local11 = 1;
_local12 = ((_local10)>0) ? (_local10 - 1) : (_arg3 - 1);
_local13 = true;
_local14 = _arg4[_local10];
_local16 = _arg4[_local9];
if (_precision > 0){
_local17 = (_local14.x / _local14.z);
_local18 = (_local14.y / _local14.z);
_local21 = (_local16.x / _local16.z);
_local22 = (_local16.y / _local16.z);
_local23 = (((_local16.x + _local14.x) / (_local16.z + _local14.z)) - (0.5 * (_local21 + _local17)));
_local24 = (((_local16.y + _local14.y) / (_local16.z + _local14.z)) - (0.5 * (_local22 + _local18)));
_local27 = ((_local23 * _local23) + (_local24 * _local24));
while (_local9 != _local12) {
if (_local13){
_local14 = _arg4[_local9];
_local15 = _arg4[_local11];
_local16 = _arg4[_local10];
_local19 = _local17;
_local20 = _local18;
_local17 = _local21;
_local18 = _local22;
_local21 = _local19;
_local22 = _local20;
_local19 = (_local15.x / _local15.z);
_local20 = (_local15.y / _local15.z);
_local23 = (((_local15.x + _local16.x) / (_local15.z + _local16.z)) - (0.5 * (_local19 + _local21)));
_local24 = (((_local15.y + _local16.y) / (_local15.z + _local16.z)) - (0.5 * (_local20 + _local22)));
_local26 = ((_local23 * _local23) + (_local24 * _local24));
_local9 = _local11;
_local11 = ((_local9)<(_arg3 - 1)) ? (_local9 + 1) : 0;
} else {
_local14 = _arg4[_local12];
_local15 = _arg4[_local10];
_local16 = _arg4[_local9];
_local17 = _local19;
_local18 = _local20;
_local19 = _local21;
_local20 = _local22;
_local21 = _local17;
_local22 = _local18;
_local17 = (_local14.x / _local14.z);
_local18 = (_local14.y / _local14.z);
_local23 = (((_local16.x + _local14.x) / (_local16.z + _local14.z)) - (0.5 * (_local21 + _local17)));
_local24 = (((_local16.y + _local14.y) / (_local16.z + _local14.z)) - (0.5 * (_local22 + _local18)));
_local27 = ((_local23 * _local23) + (_local24 * _local24));
_local10 = _local12;
_local12 = ((_local10)>0) ? (_local10 - 1) : (_arg3 - 1);
};
if ((((_local19 - _local17) * (_local22 - _local18)) - ((_local20 - _local18) * (_local21 - _local17))) < -(_arg1.focalDistortion)){
_local23 = (((_local14.x + _local15.x) / (_local14.z + _local15.z)) - (0.5 * (_local17 + _local19)));
_local24 = (((_local14.y + _local15.y) / (_local14.z + _local15.z)) - (0.5 * (_local18 + _local20)));
_local25 = ((_local23 * _local23) + (_local24 * _local24));
bisection(_local14.x, _local14.y, _local14.z, _local14.u, _local14.v, _local15.x, _local15.y, _local15.z, _local15.u, _local15.v, _local16.x, _local16.y, _local16.z, _local16.u, _local16.v, _local25, _local26, _local27);
};
_local13 = !(_local13);
};
} else {
_local17 = ((focalLength * _local14.x) / _local14.z);
_local18 = ((focalLength * _local14.y) / _local14.z);
_local21 = ((focalLength * _local16.x) / _local16.z);
_local22 = ((focalLength * _local16.y) / _local16.z);
while (_local9 != _local12) {
if (_local13){
_local14 = _arg4[_local9];
_local15 = _arg4[_local11];
_local16 = _arg4[_local10];
_local19 = _local17;
_local20 = _local18;
_local17 = _local21;
_local18 = _local22;
_local21 = _local19;
_local22 = _local20;
_local19 = ((focalLength * _local15.x) / _local15.z);
_local20 = ((focalLength * _local15.y) / _local15.z);
_local9 = _local11;
_local11 = ((_local9)<(_arg3 - 1)) ? (_local9 + 1) : 0;
} else {
_local14 = _arg4[_local12];
_local15 = _arg4[_local10];
_local16 = _arg4[_local9];
_local17 = _local19;
_local18 = _local20;
_local19 = _local21;
_local20 = _local22;
_local21 = _local17;
_local22 = _local18;
_local17 = ((focalLength * _local14.x) / _local14.z);
_local18 = ((focalLength * _local14.y) / _local14.z);
_local10 = _local12;
_local12 = ((_local10)>0) ? (_local10 - 1) : (_arg3 - 1);
};
drawTriangle(_local17, _local18, _local14.u, _local14.v, _local19, _local20, _local15.u, _local15.v, _local21, _local22, _local16.u, _local16.v);
_local13 = !(_local13);
};
};
};
}
private function bisection(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:Number, _arg13:Number, _arg14:Number, _arg15:Number, _arg16:Number, _arg17:Number, _arg18:Number):void{
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;
if (_arg16 > _arg17){
if (_arg16 > _arg18){
if (_arg16 > distortion){
_local19 = (0.5 * (_arg1 + _arg6));
_local20 = (0.5 * (_arg2 + _arg7));
_local21 = (0.5 * (_arg3 + _arg8));
_local22 = (0.5 * (_arg4 + _arg9));
_local23 = (0.5 * (_arg5 + _arg10));
_local24 = (((_arg1 + _local19) / (_arg3 + _local21)) - (0.5 * ((_arg1 / _arg3) + (_local19 / _local21))));
_local25 = (((_arg2 + _local20) / (_arg3 + _local21)) - (0.5 * ((_arg2 / _arg3) + (_local20 / _local21))));
_local26 = ((_local24 * _local24) + (_local25 * _local25));
_local24 = (((_arg6 + _local19) / (_arg8 + _local21)) - (0.5 * ((_arg6 / _arg8) + (_local19 / _local21))));
_local25 = (((_arg7 + _local20) / (_arg8 + _local21)) - (0.5 * ((_arg7 / _arg8) + (_local20 / _local21))));
_local27 = ((_local24 * _local24) + (_local25 * _local25));
_local24 = (((_arg11 + _local19) / (_arg13 + _local21)) - (0.5 * ((_arg11 / _arg13) + (_local19 / _local21))));
_local25 = (((_arg12 + _local20) / (_arg13 + _local21)) - (0.5 * ((_arg12 / _arg13) + (_local20 / _local21))));
_local28 = ((_local24 * _local24) + (_local25 * _local25));
bisection(_local19, _local20, _local21, _local22, _local23, _arg11, _arg12, _arg13, _arg14, _arg15, _arg1, _arg2, _arg3, _arg4, _arg5, _local28, _arg18, _local26);
bisection(_local19, _local20, _local21, _local22, _local23, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _local27, _arg17, _local28);
return;
};
} else {
if (_arg18 > distortion){
_local19 = (0.5 * (_arg11 + _arg1));
_local20 = (0.5 * (_arg12 + _arg2));
_local21 = (0.5 * (_arg13 + _arg3));
_local22 = (0.5 * (_arg14 + _arg4));
_local23 = (0.5 * (_arg15 + _arg5));
_local24 = (((_arg1 + _local19) / (_arg3 + _local21)) - (0.5 * ((_arg1 / _arg3) + (_local19 / _local21))));
_local25 = (((_arg2 + _local20) / (_arg3 + _local21)) - (0.5 * ((_arg2 / _arg3) + (_local20 / _local21))));
_local26 = ((_local24 * _local24) + (_local25 * _local25));
_local24 = (((_arg6 + _local19) / (_arg8 + _local21)) - (0.5 * ((_arg6 / _arg8) + (_local19 / _local21))));
_local25 = (((_arg7 + _local20) / (_arg8 + _local21)) - (0.5 * ((_arg7 / _arg8) + (_local20 / _local21))));
_local27 = ((_local24 * _local24) + (_local25 * _local25));
_local24 = (((_arg11 + _local19) / (_arg13 + _local21)) - (0.5 * ((_arg11 / _arg13) + (_local19 / _local21))));
_local25 = (((_arg12 + _local20) / (_arg13 + _local21)) - (0.5 * ((_arg12 / _arg13) + (_local20 / _local21))));
_local28 = ((_local24 * _local24) + (_local25 * _local25));
bisection(_local19, _local20, _local21, _local22, _local23, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _local27, _arg17, _local28);
bisection(_local19, _local20, _local21, _local22, _local23, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _local26, _arg16, _local27);
return;
};
};
} else {
if (_arg17 > _arg18){
if (_arg17 > distortion){
_local19 = (0.5 * (_arg6 + _arg11));
_local20 = (0.5 * (_arg7 + _arg12));
_local21 = (0.5 * (_arg8 + _arg13));
_local22 = (0.5 * (_arg9 + _arg14));
_local23 = (0.5 * (_arg10 + _arg15));
_local24 = (((_arg1 + _local19) / (_arg3 + _local21)) - (0.5 * ((_arg1 / _arg3) + (_local19 / _local21))));
_local25 = (((_arg2 + _local20) / (_arg3 + _local21)) - (0.5 * ((_arg2 / _arg3) + (_local20 / _local21))));
_local26 = ((_local24 * _local24) + (_local25 * _local25));
_local24 = (((_arg6 + _local19) / (_arg8 + _local21)) - (0.5 * ((_arg6 / _arg8) + (_local19 / _local21))));
_local25 = (((_arg7 + _local20) / (_arg8 + _local21)) - (0.5 * ((_arg7 / _arg8) + (_local20 / _local21))));
_local27 = ((_local24 * _local24) + (_local25 * _local25));
_local24 = (((_arg11 + _local19) / (_arg13 + _local21)) - (0.5 * ((_arg11 / _arg13) + (_local19 / _local21))));
_local25 = (((_arg12 + _local20) / (_arg13 + _local21)) - (0.5 * ((_arg12 / _arg13) + (_local20 / _local21))));
_local28 = ((_local24 * _local24) + (_local25 * _local25));
bisection(_local19, _local20, _local21, _local22, _local23, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _local26, _arg16, _local27);
bisection(_local19, _local20, _local21, _local22, _local23, _arg11, _arg12, _arg13, _arg14, _arg15, _arg1, _arg2, _arg3, _arg4, _arg5, _local28, _arg18, _local26);
return;
};
} else {
if (_arg18 > distortion){
_local19 = (0.5 * (_arg11 + _arg1));
_local20 = (0.5 * (_arg12 + _arg2));
_local21 = (0.5 * (_arg13 + _arg3));
_local22 = (0.5 * (_arg14 + _arg4));
_local23 = (0.5 * (_arg15 + _arg5));
_local24 = (((_arg1 + _local19) / (_arg3 + _local21)) - (0.5 * ((_arg1 / _arg3) + (_local19 / _local21))));
_local25 = (((_arg2 + _local20) / (_arg3 + _local21)) - (0.5 * ((_arg2 / _arg3) + (_local20 / _local21))));
_local26 = ((_local24 * _local24) + (_local25 * _local25));
_local24 = (((_arg6 + _local19) / (_arg8 + _local21)) - (0.5 * ((_arg6 / _arg8) + (_local19 / _local21))));
_local25 = (((_arg7 + _local20) / (_arg8 + _local21)) - (0.5 * ((_arg7 / _arg8) + (_local20 / _local21))));
_local27 = ((_local24 * _local24) + (_local25 * _local25));
_local24 = (((_arg11 + _local19) / (_arg13 + _local21)) - (0.5 * ((_arg11 / _arg13) + (_local19 / _local21))));
_local25 = (((_arg12 + _local20) / (_arg13 + _local21)) - (0.5 * ((_arg12 / _arg13) + (_local20 / _local21))));
_local28 = ((_local24 * _local24) + (_local25 * _local25));
bisection(_local19, _local20, _local21, _local22, _local23, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _local27, _arg17, _local28);
bisection(_local19, _local20, _local21, _local22, _local23, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _local26, _arg16, _local27);
return;
};
};
};
var _local29:Number = (focalLength / _arg3);
var _local30:Number = (focalLength / _arg8);
var _local31:Number = (focalLength / _arg13);
drawTriangle((_arg1 * _local29), (_arg2 * _local29), _arg4, _arg5, (_arg6 * _local30), (_arg7 * _local30), _arg9, _arg10, (_arg11 * _local31), (_arg12 * _local31), _arg14, _arg15);
}
public function set precision(_arg1:Number):void{
if (_precision != _arg1){
_precision = _arg1;
if (_surface != null){
_surface.addMaterialChangedOperationToScene();
};
};
}
public function get precision():Number{
return (_precision);
}
public function get texture():Texture{
return (_texture);
}
public function set wireThickness(_arg1:Number):void{
if (_wireThickness != _arg1){
_wireThickness = _arg1;
if (_surface != null){
_surface.addMaterialChangedOperationToScene();
};
};
}
public function get repeat():Boolean{
return (_repeat);
}
public function set smooth(_arg1:Boolean):void{
if (_smooth != _arg1){
_smooth = _arg1;
if (_surface != null){
_surface.addMaterialChangedOperationToScene();
};
};
}
override public function clone():Material{
var _local1:TextureMaterial = new TextureMaterial(_texture, _alpha, _repeat, _smooth, _blendMode, _wireThickness, _wireColor, _precision);
return (_local1);
}
public function get wireColor():uint{
return (_wireColor);
}
private function drawTriangle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number, _arg12:Number):void{
var _local13:Number = (_arg5 - _arg1);
var _local14:Number = (_arg6 - _arg2);
var _local15:Number = (_arg9 - _arg1);
var _local16:Number = (_arg10 - _arg2);
var _local17:Number = (_arg7 - _arg3);
var _local18:Number = (_arg8 - _arg4);
var _local19:Number = (_arg11 - _arg3);
var _local20:Number = (_arg12 - _arg4);
var _local21:Number = ((_local17 * _local20) - (_local18 * _local19));
var _local22:Number = _texture._width;
var _local23:Number = _texture._height;
textureMatrix.a = (((_local20 * _local13) - (_local18 * _local15)) / _local21);
textureMatrix.b = (((_local20 * _local14) - (_local18 * _local16)) / _local21);
textureMatrix.c = (((_local19 * _local13) - (_local17 * _local15)) / _local21);
textureMatrix.d = (((_local19 * _local14) - (_local17 * _local16)) / _local21);
textureMatrix.tx = ((((_arg4 - 1) * textureMatrix.c) - (_arg3 * textureMatrix.a)) + _arg1);
textureMatrix.ty = ((((_arg4 - 1) * textureMatrix.d) - (_arg3 * textureMatrix.b)) + _arg2);
textureMatrix.a = (textureMatrix.a / _local22);
textureMatrix.b = (textureMatrix.b / _local22);
textureMatrix.c = (textureMatrix.c / _local23);
textureMatrix.d = (textureMatrix.d / _local23);
gfx.beginBitmapFill(_texture._bitmapData, textureMatrix, _repeat, _smooth);
if (_wireThickness >= 0){
gfx.lineStyle(_wireThickness, _wireColor);
};
gfx.moveTo(_arg1, _arg2);
gfx.lineTo(_arg5, _arg6);
gfx.lineTo(_arg9, _arg10);
if (_wireThickness >= 0){
gfx.lineTo(_arg1, _arg2);
};
}
public function get smooth():Boolean{
return (_smooth);
}
public function get wireThickness():Number{
return (_wireThickness);
}
public function set texture(_arg1:Texture):void{
if (_texture != _arg1){
_texture = _arg1;
if (_surface != null){
_surface.addMaterialChangedOperationToScene();
};
};
}
override alternativa3d function canDraw(_arg1:PolyPrimitive):Boolean{
return (!((_texture == null)));
}
public function set repeat(_arg1:Boolean):void{
if (_repeat != _arg1){
_repeat = _arg1;
if (_surface != null){
_surface.addMaterialChangedOperationToScene();
};
};
}
}
}//package alternativa.engine3d.materials
Section 33
//TextureMaterialPrecision (alternativa.engine3d.materials.TextureMaterialPrecision)
package alternativa.engine3d.materials {
public class TextureMaterialPrecision {
public static const HIGH:Number = 6;
public static const VERY_LOW:Number = 50;
public static const VERY_HIGH:Number = 3;
public static const BEST:Number = 1;
public static const LOW:Number = 25;
public static const MEDIUM:Number = 10;
public static const NONE:Number = -1;
}
}//package alternativa.engine3d.materials
Section 34
//WireMaterial (alternativa.engine3d.materials.WireMaterial)
package alternativa.engine3d.materials {
import flash.display.*;
import alternativa.engine3d.core.*;
import alternativa.engine3d.display.*;
import alternativa.engine3d.*;
public class WireMaterial extends SurfaceMaterial {
alternativa3d var _color:uint;
alternativa3d var _thickness:Number;
public function WireMaterial(_arg1:Number=0, _arg2:uint=0, _arg3:Number=1, _arg4:String="normal"){
super(_arg3, _arg4);
_color = _arg2;
_thickness = _arg1;
}
public function get thickness():Number{
return (_thickness);
}
public function get color():uint{
return (_color);
}
public function set color(_arg1:uint):void{
if (_color != _arg1){
_color = _arg1;
if (_surface != null){
_surface.addMaterialChangedOperationToScene();
};
};
}
override alternativa3d function canDraw(_arg1:PolyPrimitive):Boolean{
return ((_thickness >= 0));
}
override alternativa3d function draw(_arg1:Camera3D, _arg2:Skin, _arg3:uint, _arg4:Array):void{
var _local5:uint;
var _local6:DrawPoint;
var _local8:Number;
_arg2.alpha = _alpha;
_arg2.blendMode = _blendMode;
var _local7:Graphics = _arg2.gfx;
if (_arg1._orthographic){
_local7.lineStyle(_thickness, _color);
_local6 = _arg4[(_arg3 - 1)];
_local7.moveTo(_local6.x, _local6.y);
_local5 = 0;
while (_local5 < _arg3) {
_local6 = _arg4[_local5];
_local7.lineTo(_local6.x, _local6.y);
_local5++;
};
} else {
_local7.lineStyle(_thickness, _color);
_local6 = _arg4[(_arg3 - 1)];
_local8 = (_arg1.focalLength / _local6.z);
_local7.moveTo((_local6.x * _local8), (_local6.y * _local8));
_local5 = 0;
while (_local5 < _arg3) {
_local6 = _arg4[_local5];
_local8 = (_arg1.focalLength / _local6.z);
_local7.lineTo((_local6.x * _local8), (_local6.y * _local8));
_local5++;
};
};
}
override public function clone():Material{
return (new WireMaterial(_thickness, _color, _alpha, _blendMode));
}
public function set thickness(_arg1:Number):void{
if (_thickness != _arg1){
_thickness = _arg1;
if (_surface != null){
_surface.addMaterialChangedOperationToScene();
};
};
}
}
}//package alternativa.engine3d.materials
Section 35
//Collision (alternativa.engine3d.physics.Collision)
package alternativa.engine3d.physics {
import alternativa.types.*;
import alternativa.engine3d.core.*;
public class Collision {
public var point:Point3D;
public var offset:Number;
public var normal:Point3D;
public var face:Face;
}
}//package alternativa.engine3d.physics
Section 36
//CollisionPlane (alternativa.engine3d.physics.CollisionPlane)
package alternativa.engine3d.physics {
import alternativa.engine3d.core.*;
import alternativa.engine3d.*;
public class CollisionPlane {
public var destinationOffset:Number;
public var node:BSPNode;
public var infront:Boolean;
public var sourceOffset:Number;
private static var collector:Array = new Array();
alternativa3d static function destroyCollisionPlane(_arg1:CollisionPlane):void{
_arg1.node = null;
collector.push(_arg1);
}
alternativa3d static function createCollisionPlane(_arg1:BSPNode, _arg2:Boolean, _arg3:Number, _arg4:Number):CollisionPlane{
var _local5:CollisionPlane = collector.pop();
if (_local5 == null){
_local5 = new (CollisionPlane);
};
_local5.node = _arg1;
_local5.infront = _arg2;
_local5.sourceOffset = _arg3;
_local5.destinationOffset = _arg4;
return (_local5);
}
}
}//package alternativa.engine3d.physics
Section 37
//CollisionSetMode (alternativa.engine3d.physics.CollisionSetMode)
package alternativa.engine3d.physics {
public class CollisionSetMode {
public static const INCLUDE:int = 2;
public static const EXCLUDE:int = 1;
}
}//package alternativa.engine3d.physics
Section 38
//EllipsoidCollider (alternativa.engine3d.physics.EllipsoidCollider)
package alternativa.engine3d.physics {
import alternativa.types.*;
import alternativa.engine3d.core.*;
import alternativa.utils.*;
import alternativa.engine3d.*;
public class EllipsoidCollider {
private var collisionDestination:Point3D;
private var _scaleY2:Number;// = 1
private var _radiusZ2:Number;
public var scene:Scene3D;
private var radiusVector:Point3D;
private var localCollisionPlanePoint:Point3D;
public var offsetThreshold:Number;// = 0.01
private var _radius2:Number;
private var _scaleZ2:Number;// = 1
private var currentDisplacement:Point3D;
private var _radius:Number;// = 100
private var collision:Collision;
private var collisionNormal:Point3D;
private var collisionPrimitivePoint:Point3D;
private var p1:Point3D;
private var collisionPrimitiveNearestLengthSqr:Number;
private var _radiusX:Number;
private var _radiusY:Number;
private var _radiusZ:Number;
private var _radiusX2:Number;
private var collisionPrimitiveNearest:PolyPrimitive;
private var collisionPrimitive:PolyPrimitive;
private var useSimpleAlgorithm:Boolean;// = true
public var collisionSet:Set;
private var _scaleX2:Number;// = 1
private var collisionPlanePoint:Point3D;
private var collisionPlanes:Array;
private var _radiusY2:Number;
private var collisionRadius:Number;
private var collisionOffset:Number;
private var _scaleX:Number;// = 1
private var _scaleY:Number;// = 1
private var _scaleZ:Number;// = 1
private var collisionSource:Point3D;
private var currentCoords:Point3D;
private var _collisionSetMode:int;// = 1
private var p2:Point3D;
private var collisionPoint:Point3D;
private static const MAX_COLLISIONS:uint = 50;
public function EllipsoidCollider(_arg1:Scene3D=null, _arg2:Number=100, _arg3:Number=100, _arg4:Number=100){
_radius2 = (_radius * _radius);
_radiusX = _radius;
_radiusY = _radius;
_radiusZ = _radius;
_radiusX2 = (_radiusX * _radiusX);
_radiusY2 = (_radiusY * _radiusY);
_radiusZ2 = (_radiusZ * _radiusZ);
currentDisplacement = new Point3D();
collisionDestination = new Point3D();
collisionPlanes = new Array();
collisionPlanePoint = new Point3D();
collisionPrimitivePoint = new Point3D();
collisionNormal = new Point3D();
collisionPoint = new Point3D();
currentCoords = new Point3D();
collision = new Collision();
radiusVector = new Point3D();
p1 = new Point3D();
p2 = new Point3D();
localCollisionPlanePoint = new Point3D();
super();
this.scene = _arg1;
this.radiusX = _arg2;
this.radiusY = _arg3;
this.radiusZ = _arg4;
}
public function calculateDestination(_arg1:Point3D, _arg2:Point3D, _arg3:Point3D):void{
if ((((((((((((_arg2.x < offsetThreshold)) && ((_arg2.x > -(offsetThreshold))))) && ((_arg2.y < offsetThreshold)))) && ((_arg2.y > -(offsetThreshold))))) && ((_arg2.z < offsetThreshold)))) && ((_arg2.z > -(offsetThreshold))))){
_arg3.x = _arg1.x;
_arg3.y = _arg1.y;
_arg3.z = _arg1.z;
return;
};
currentCoords.x = _arg1.x;
currentCoords.y = _arg1.y;
currentCoords.z = _arg1.z;
currentDisplacement.x = _arg2.x;
currentDisplacement.y = _arg2.y;
currentDisplacement.z = _arg2.z;
_arg3.x = (_arg1.x + currentDisplacement.x);
_arg3.y = (_arg1.y + currentDisplacement.y);
_arg3.z = (_arg1.z + currentDisplacement.z);
if (useSimpleAlgorithm){
calculateDestinationS(_arg1, _arg3);
} else {
calculateDestinationE(_arg1, _arg3);
};
}
public function get radiusX():Number{
return (_radiusX);
}
public function get radiusY():Number{
return (_radiusY);
}
public function get radiusZ():Number{
return (_radiusZ);
}
private function calculateScales():void{
_radius = _radiusX;
if (_radiusY > _radius){
_radius = _radiusY;
};
if (_radiusZ > _radius){
_radius = _radiusZ;
};
_radius2 = (_radius * _radius);
_scaleX = (_radiusX / _radius);
_scaleY = (_radiusY / _radius);
_scaleZ = (_radiusZ / _radius);
_scaleX2 = (_scaleX * _scaleX);
_scaleY2 = (_scaleY * _scaleY);
_scaleZ2 = (_scaleZ * _scaleZ);
useSimpleAlgorithm = (((_radiusX == _radiusY)) && ((_radiusX == _radiusZ)));
}
public function getCollision(_arg1:Point3D, _arg2:Point3D, _arg3:Collision):Boolean{
var _local4:CollisionPlane;
if (scene == null){
return (false);
};
collisionSource = _arg1;
currentDisplacement.x = _arg2.x;
currentDisplacement.y = _arg2.y;
currentDisplacement.z = _arg2.z;
collisionDestination.x = (collisionSource.x + currentDisplacement.x);
collisionDestination.y = (collisionSource.y + currentDisplacement.y);
collisionDestination.z = (collisionSource.z + currentDisplacement.z);
collectPotentialCollisionPlanes(scene.bsp);
collisionPlanes.sortOn("sourceOffset", (Array.NUMERIC | Array.DESCENDING));
if (useSimpleAlgorithm){
while ((_local4 = collisionPlanes.pop()) != null) {
if (collisionPrimitive == null){
calculateCollisionWithPlaneS(_local4);
};
CollisionPlane.destroyCollisionPlane(_local4);
};
} else {
while ((_local4 = collisionPlanes.pop()) != null) {
if (collisionPrimitive == null){
calculateCollisionWithPlaneE(_local4);
};
CollisionPlane.destroyCollisionPlane(_local4);
};
};
var _local5 = !((collisionPrimitive == null));
if (_local5){
_arg3.face = collisionPrimitive.face;
_arg3.normal = collisionNormal;
_arg3.offset = collisionOffset;
_arg3.point = collisionPoint;
};
collisionPrimitive = null;
collisionSource = null;
return (_local5);
}
public function set radiusY(_arg1:Number):void{
_radiusY = ((_arg1 >= 0)) ? _arg1 : -(_arg1);
_radiusY2 = (_radiusY * _radiusY);
calculateScales();
}
public function set radiusZ(_arg1:Number):void{
_radiusZ = ((_arg1 >= 0)) ? _arg1 : -(_arg1);
_radiusZ2 = (_radiusZ * _radiusZ);
calculateScales();
}
public function get collisionSetMode():int{
return (_collisionSetMode);
}
public function set radiusX(_arg1:Number):void{
_radiusX = ((_arg1 >= 0)) ? _arg1 : -(_arg1);
_radiusX2 = (_radiusX * _radiusX);
calculateScales();
}
public function set collisionSetMode(_arg1:int):void{
if (((!((_arg1 == CollisionSetMode.EXCLUDE))) && (!((_arg1 == CollisionSetMode.INCLUDE))))){
throw (ArgumentError((ObjectUtils.getClassName(this) + ".collisionSetMode invalid value")));
};
_collisionSetMode = _arg1;
}
private function calculateDestinationS(_arg1:Point3D, _arg2:Point3D):void{
var _local4:Boolean;
var _local5:*;
var _local3:uint;
do {
_local4 = getCollision(currentCoords, currentDisplacement, collision);
} while (!(_local4));
if (_local3 == MAX_COLLISIONS){
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
_arg2.z = _arg1.z;
};
}
private function collectPotentialCollisionPlanes(_arg1:BSPNode):void{
var _local4:CollisionPlane;
if (_arg1 == null){
return;
};
var _local2:Number = ((((collisionSource.x * _arg1.normal.x) + (collisionSource.y * _arg1.normal.y)) + (collisionSource.z * _arg1.normal.z)) - _arg1.offset);
var _local3:Number = ((((collisionDestination.x * _arg1.normal.x) + (collisionDestination.y * _arg1.normal.y)) + (collisionDestination.z * _arg1.normal.z)) - _arg1.offset);
if (_local2 >= 0){
collectPotentialCollisionPlanes(_arg1.front);
if (_local3 < _radius){
_local4 = CollisionPlane.createCollisionPlane(_arg1, true, _local2, _local3);
collisionPlanes.push(_local4);
collectPotentialCollisionPlanes(_arg1.back);
};
} else {
collectPotentialCollisionPlanes(_arg1.back);
if (_local3 > -(_radius)){
if (_arg1.backPrimitives != null){
_local4 = CollisionPlane.createCollisionPlane(_arg1, false, -(_local2), -(_local3));
collisionPlanes.push(_local4);
};
collectPotentialCollisionPlanes(_arg1.front);
};
};
}
private function calculateDestinationE(_arg1:Point3D, _arg2:Point3D):void{
var _local4:Boolean;
var _local5:*;
var _local3:uint;
do {
_local4 = getCollision(currentCoords, currentDisplacement, collision);
} while (!(_local4));
if (_local3 == MAX_COLLISIONS){
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
_arg2.z = _arg1.z;
};
}
private function calculateCollisionWithPrimitiveS(_arg1:PolyPrimitive):void{
var _local7:Point3D;
var _local8:Point3D;
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 _local2:uint = _arg1.num;
var _local3:Array = _arg1.points;
var _local4:Point3D = _arg1.face.globalNormal;
var _local5:Boolean;
var _local6:uint;
while (_local6 < _local2) {
_local7 = _local3[_local6];
_local8 = _local3[((_local6)<(_local2 - 1)) ? (_local6 + 1) : 0];
_local9 = (_local8.x - _local7.x);
_local10 = (_local8.y - _local7.y);
_local11 = (_local8.z - _local7.z);
_local12 = (collisionPlanePoint.x - _local7.x);
_local13 = (collisionPlanePoint.y - _local7.y);
_local14 = (collisionPlanePoint.z - _local7.z);
_local15 = ((_local13 * _local11) - (_local14 * _local10));
_local16 = ((_local14 * _local9) - (_local12 * _local11));
_local17 = ((_local12 * _local10) - (_local13 * _local9));
if ((((_local15 * _local4.x) + (_local16 * _local4.y)) + (_local17 * _local4.z)) > 0){
_local5 = false;
_local18 = (((_local9 * _local9) + (_local10 * _local10)) + (_local11 * _local11));
_local19 = ((((_local15 * _local15) + (_local16 * _local16)) + (_local17 * _local17)) / _local18);
if (_local19 < collisionPrimitiveNearestLengthSqr){
_local20 = Math.sqrt(_local18);
_local21 = (_local9 / _local20);
_local22 = (_local10 / _local20);
_local23 = (_local11 / _local20);
_local24 = (((_local21 * _local12) + (_local22 * _local13)) + (_local23 * _local14));
if (_local24 < 0){
_local25 = (((_local12 * _local12) + (_local13 * _local13)) + (_local14 * _local14));
if (_local25 < collisionPrimitiveNearestLengthSqr){
collisionPrimitiveNearestLengthSqr = _local25;
collisionPrimitivePoint.x = _local7.x;
collisionPrimitivePoint.y = _local7.y;
collisionPrimitivePoint.z = _local7.z;
collisionPrimitiveNearest = _arg1;
};
} else {
if (_local24 > _local20){
_local12 = (collisionPlanePoint.x - _local8.x);
_local13 = (collisionPlanePoint.y - _local8.y);
_local14 = (collisionPlanePoint.z - _local8.z);
_local25 = (((_local12 * _local12) + (_local13 * _local13)) + (_local14 * _local14));
if (_local25 < collisionPrimitiveNearestLengthSqr){
collisionPrimitiveNearestLengthSqr = _local25;
collisionPrimitivePoint.x = _local8.x;
collisionPrimitivePoint.y = _local8.y;
collisionPrimitivePoint.z = _local8.z;
collisionPrimitiveNearest = _arg1;
};
} else {
collisionPrimitiveNearestLengthSqr = _local19;
collisionPrimitivePoint.x = (_local7.x + (_local21 * _local24));
collisionPrimitivePoint.y = (_local7.y + (_local22 * _local24));
collisionPrimitivePoint.z = (_local7.z + (_local23 * _local24));
collisionPrimitiveNearest = _arg1;
};
};
};
};
_local6++;
};
if (_local5){
collisionPrimitive = _arg1;
};
}
private function calculateCollisionWithPrimitiveE(_arg1:PolyPrimitive):void{
var _local6:Point3D;
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 _local2:uint = _arg1.num;
var _local3:Array = _arg1.points;
var _local4:Point3D = _arg1.face.globalNormal;
var _local5:Boolean;
var _local7:Point3D = _local3[(_local2 - 1)];
p2.x = ((_local7.x - currentCoords.x) / _scaleX);
p2.y = ((_local7.y - currentCoords.y) / _scaleY);
p2.z = ((_local7.z - currentCoords.z) / _scaleZ);
localCollisionPlanePoint.x = ((collisionPlanePoint.x - currentCoords.x) / _scaleX);
localCollisionPlanePoint.y = ((collisionPlanePoint.y - currentCoords.y) / _scaleY);
localCollisionPlanePoint.z = ((collisionPlanePoint.z - currentCoords.z) / _scaleZ);
var _local8:uint;
while (_local8 < _local2) {
_local6 = _local7;
_local7 = _local3[_local8];
p1.x = p2.x;
p1.y = p2.y;
p1.z = p2.z;
p2.x = ((_local7.x - currentCoords.x) / _scaleX);
p2.y = ((_local7.y - currentCoords.y) / _scaleY);
p2.z = ((_local7.z - currentCoords.z) / _scaleZ);
_local9 = (p2.x - p1.x);
_local10 = (p2.y - p1.y);
_local11 = (p2.z - p1.z);
_local12 = (localCollisionPlanePoint.x - p1.x);
_local13 = (localCollisionPlanePoint.y - p1.y);
_local14 = (localCollisionPlanePoint.z - p1.z);
_local15 = ((_local13 * _local11) - (_local14 * _local10));
_local16 = ((_local14 * _local9) - (_local12 * _local11));
_local17 = ((_local12 * _local10) - (_local13 * _local9));
if ((((_local15 * _local4.x) + (_local16 * _local4.y)) + (_local17 * _local4.z)) > 0){
_local5 = false;
_local18 = (((_local9 * _local9) + (_local10 * _local10)) + (_local11 * _local11));
_local19 = ((((_local15 * _local15) + (_local16 * _local16)) + (_local17 * _local17)) / _local18);
if (_local19 < collisionPrimitiveNearestLengthSqr){
_local20 = Math.sqrt(_local18);
_local21 = (_local9 / _local20);
_local22 = (_local10 / _local20);
_local23 = (_local11 / _local20);
_local24 = (((_local21 * _local12) + (_local22 * _local13)) + (_local23 * _local14));
if (_local24 < 0){
_local25 = (((_local12 * _local12) + (_local13 * _local13)) + (_local14 * _local14));
if (_local25 < collisionPrimitiveNearestLengthSqr){
collisionPrimitiveNearestLengthSqr = _local25;
collisionPrimitivePoint.x = p1.x;
collisionPrimitivePoint.y = p1.y;
collisionPrimitivePoint.z = p1.z;
collisionPrimitiveNearest = _arg1;
};
} else {
if (_local24 > _local20){
_local12 = (localCollisionPlanePoint.x - p2.x);
_local13 = (localCollisionPlanePoint.y - p2.y);
_local14 = (localCollisionPlanePoint.z - p2.z);
_local25 = (((_local12 * _local12) + (_local13 * _local13)) + (_local14 * _local14));
if (_local25 < collisionPrimitiveNearestLengthSqr){
collisionPrimitiveNearestLengthSqr = _local25;
collisionPrimitivePoint.x = p2.x;
collisionPrimitivePoint.y = p2.y;
collisionPrimitivePoint.z = p2.z;
collisionPrimitiveNearest = _arg1;
};
} else {
collisionPrimitiveNearestLengthSqr = _local19;
collisionPrimitivePoint.x = (p1.x + (_local21 * _local24));
collisionPrimitivePoint.y = (p1.y + (_local22 * _local24));
collisionPrimitivePoint.z = (p1.z + (_local23 * _local24));
collisionPrimitiveNearest = _arg1;
};
};
};
};
_local8++;
};
if (_local5){
collisionPrimitive = _arg1;
};
}
private function calculateCollisionWithPlaneE(_arg1:CollisionPlane):void{
var _local14:*;
var _local15:Number;
var _local16:Boolean;
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 _local2:Number = _arg1.node.normal.x;
var _local3:Number = _arg1.node.normal.y;
var _local4:Number = _arg1.node.normal.z;
var _local5:Number = (((currentDisplacement.x * _local2) + (currentDisplacement.y * _local3)) + (currentDisplacement.z * _local4));
if (_arg1.infront){
_local5 = -(_local5);
};
if (_local5 < 0){
return;
};
var _local6:Number = (_radius / Math.sqrt(((((_local2 * _local2) * _scaleX2) + ((_local3 * _local3) * _scaleY2)) + ((_local4 * _local4) * _scaleZ2))));
var _local7:Number = ((_local6 * _local2) * _scaleX2);
var _local8:Number = ((_local6 * _local3) * _scaleY2);
var _local9:Number = ((_local6 * _local4) * _scaleZ2);
var _local10:Number = (collisionSource.x + _local7);
var _local11:Number = (collisionSource.y + _local8);
var _local12:Number = (collisionSource.z + _local9);
var _local13:Number = ((((_local10 * _local2) + (_local11 * _local3)) + (_local12 * _local4)) - _arg1.node.offset);
if (!_arg1.infront){
_local13 = -(_local13);
};
if (_local13 > _arg1.sourceOffset){
_local10 = (collisionSource.x - _local7);
_local11 = (collisionSource.y - _local8);
_local12 = (collisionSource.z - _local9);
_local13 = ((((_local10 * _local2) + (_local11 * _local3)) + (_local12 * _local4)) - _arg1.node.offset);
if (!_arg1.infront){
_local13 = -(_local13);
};
};
if (_local13 > _local5){
return;
};
if (_local13 <= 0){
if (_arg1.infront){
collisionPlanePoint.x = (_local10 - (_local2 * _local13));
collisionPlanePoint.y = (_local11 - (_local3 * _local13));
collisionPlanePoint.z = (_local12 - (_local4 * _local13));
} else {
collisionPlanePoint.x = (_local10 + (_local2 * _local13));
collisionPlanePoint.y = (_local11 + (_local3 * _local13));
collisionPlanePoint.z = (_local12 + (_local4 * _local13));
};
} else {
_local15 = (_local13 / _local5);
collisionPlanePoint.x = (_local10 + (currentDisplacement.x * _local15));
collisionPlanePoint.y = (_local11 + (currentDisplacement.y * _local15));
collisionPlanePoint.z = (_local12 + (currentDisplacement.z * _local15));
};
collisionPrimitiveNearestLengthSqr = Number.MAX_VALUE;
collisionPrimitiveNearest = null;
if (_arg1.infront){
_local14 = _arg1.node.primitive;
if (_local14 != null){
if ((((((_collisionSetMode == CollisionSetMode.EXCLUDE)) && ((((collisionSet == null)) || (!(((collisionSet[_local14.face._mesh]) || (collisionSet[_local14.face._surface])))))))) || ((((((_collisionSetMode == CollisionSetMode.INCLUDE)) && (!((collisionSet == null))))) && (((collisionSet[_local14.face._mesh]) || (collisionSet[_local14.face._surface]))))))){
calculateCollisionWithPrimitiveE(_local14);
};
} else {
for (_local14 in _arg1.node.frontPrimitives) {
if ((((((_collisionSetMode == CollisionSetMode.EXCLUDE)) && ((((collisionSet == null)) || (!(((collisionSet[_local14.face._mesh]) || (collisionSet[_local14.face._surface])))))))) || ((((((_collisionSetMode == CollisionSetMode.INCLUDE)) && (!((collisionSet == null))))) && (((collisionSet[_local14.face._mesh]) || (collisionSet[_local14.face._surface]))))))){
calculateCollisionWithPrimitiveE(_local14);
if (collisionPrimitive != null){
break;
};
};
};
};
} else {
for (_local14 in _arg1.node.backPrimitives) {
if ((((((_collisionSetMode == CollisionSetMode.EXCLUDE)) && ((((collisionSet == null)) || (!(((collisionSet[_local14.face._mesh]) || (collisionSet[_local14.face._surface])))))))) || ((((((_collisionSetMode == CollisionSetMode.INCLUDE)) && (!((collisionSet == null))))) && (((collisionSet[_local14.face._mesh]) || (collisionSet[_local14.face._surface]))))))){
calculateCollisionWithPrimitiveE(_local14);
if (collisionPrimitive != null){
break;
};
};
};
};
if (collisionPrimitive != null){
if (_arg1.infront){
collisionNormal.x = _local2;
collisionNormal.y = _local3;
collisionNormal.z = _local4;
collisionOffset = _arg1.node.offset;
} else {
collisionNormal.x = -(_local2);
collisionNormal.y = -(_local3);
collisionNormal.z = -(_local4);
collisionOffset = -(_arg1.node.offset);
};
collisionRadius = (((_local7 * collisionNormal.x) + (_local8 * collisionNormal.y)) + (_local9 * collisionNormal.z));
if (collisionRadius < 0){
collisionRadius = -(collisionRadius);
};
radiusVector.x = (_local10 - collisionSource.x);
radiusVector.y = (_local11 - collisionSource.y);
radiusVector.z = (_local12 - collisionSource.z);
collisionPoint.x = collisionPlanePoint.x;
collisionPoint.y = collisionPlanePoint.y;
collisionPoint.z = collisionPlanePoint.z;
} else {
_local10 = collisionPrimitivePoint.x;
_local11 = collisionPrimitivePoint.y;
_local12 = collisionPrimitivePoint.z;
_local17 = (((_local10 * _local10) + (_local11 * _local11)) + (_local12 * _local12));
if (_local17 < _radius2){
_local6 = (_radius / Math.sqrt(_local17));
_local10 = (_local10 * (_local6 * _scaleX));
_local11 = (_local11 * (_local6 * _scaleY));
_local12 = (_local12 * (_local6 * _scaleZ));
_local16 = true;
} else {
_local18 = (-(currentDisplacement.x) / _scaleX);
_local19 = (-(currentDisplacement.y) / _scaleY);
_local20 = (-(currentDisplacement.z) / _scaleZ);
_local21 = (((_local18 * _local18) + (_local19 * _local19)) + (_local20 * _local20));
_local22 = (2 * (((_local10 * _local18) + (_local11 * _local19)) + (_local12 * _local20)));
_local23 = (_local17 - _radius2);
_local24 = ((_local22 * _local22) - ((4 * _local21) * _local23));
if (_local24 >= 0){
_local15 = ((-0.5 * (_local22 + Math.sqrt(_local24))) / _local21);
if ((((_local15 >= 0)) && ((_local15 <= 1)))){
_local10 = ((_local10 + (_local15 * _local18)) * _scaleX);
_local11 = ((_local11 + (_local15 * _local19)) * _scaleY);
_local12 = ((_local12 + (_local15 * _local20)) * _scaleZ);
_local16 = true;
};
};
};
if (_local16){
collisionNormal.x = (-(_local10) / _scaleX2);
collisionNormal.y = (-(_local11) / _scaleY2);
collisionNormal.z = (-(_local12) / _scaleZ2);
collisionNormal.normalize();
collisionRadius = (((_local10 * collisionNormal.x) + (_local11 * collisionNormal.y)) + (_local12 * collisionNormal.z));
if (collisionRadius < 0){
collisionRadius = -(collisionRadius);
};
radiusVector.x = _local10;
radiusVector.y = _local11;
radiusVector.z = _local12;
collisionPoint.x = ((collisionPrimitivePoint.x * _scaleX) + currentCoords.x);
collisionPoint.y = ((collisionPrimitivePoint.y * _scaleY) + currentCoords.y);
collisionPoint.z = ((collisionPrimitivePoint.z * _scaleZ) + currentCoords.z);
collisionOffset = (((collisionPoint.x * collisionNormal.x) + (collisionPoint.y * collisionNormal.y)) + (collisionPoint.z * collisionNormal.z));
collisionPrimitive = collisionPrimitiveNearest;
};
};
}
private function calculateCollisionWithPlaneS(_arg1:CollisionPlane):void{
var _local3:*;
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;
collisionPlanePoint.copy(collisionSource);
var _local2:Point3D = _arg1.node.normal;
if (_arg1.sourceOffset <= _radius){
if (_arg1.infront){
collisionPlanePoint.x = (collisionPlanePoint.x - (_local2.x * _arg1.sourceOffset));
collisionPlanePoint.y = (collisionPlanePoint.y - (_local2.y * _arg1.sourceOffset));
collisionPlanePoint.z = (collisionPlanePoint.z - (_local2.z * _arg1.sourceOffset));
} else {
collisionPlanePoint.x = (collisionPlanePoint.x + (_local2.x * _arg1.sourceOffset));
collisionPlanePoint.y = (collisionPlanePoint.y + (_local2.y * _arg1.sourceOffset));
collisionPlanePoint.z = (collisionPlanePoint.z + (_local2.z * _arg1.sourceOffset));
};
} else {
_local4 = ((_arg1.sourceOffset - _radius) / (_arg1.sourceOffset - _arg1.destinationOffset));
collisionPlanePoint.x = (collisionSource.x + (currentDisplacement.x * _local4));
collisionPlanePoint.y = (collisionSource.y + (currentDisplacement.y * _local4));
collisionPlanePoint.z = (collisionSource.z + (currentDisplacement.z * _local4));
if (_arg1.infront){
collisionPlanePoint.x = (collisionPlanePoint.x - (_local2.x * _radius));
collisionPlanePoint.y = (collisionPlanePoint.y - (_local2.y * _radius));
collisionPlanePoint.z = (collisionPlanePoint.z - (_local2.z * _radius));
} else {
collisionPlanePoint.x = (collisionPlanePoint.x + (_local2.x * _radius));
collisionPlanePoint.y = (collisionPlanePoint.y + (_local2.y * _radius));
collisionPlanePoint.z = (collisionPlanePoint.z + (_local2.z * _radius));
};
};
collisionPrimitiveNearestLengthSqr = Number.MAX_VALUE;
collisionPrimitiveNearest = null;
if (_arg1.infront){
_local3 = _arg1.node.primitive;
if (_local3 != null){
if ((((((_collisionSetMode == CollisionSetMode.EXCLUDE)) && ((((collisionSet == null)) || (!(((collisionSet[_local3.face._mesh]) || (collisionSet[_local3.face._surface])))))))) || ((((((_collisionSetMode == CollisionSetMode.INCLUDE)) && (!((collisionSet == null))))) && (((collisionSet[_local3.face._mesh]) || (collisionSet[_local3.face._surface]))))))){
calculateCollisionWithPrimitiveS(_arg1.node.primitive);
};
} else {
for (_local3 in _arg1.node.frontPrimitives) {
if ((((((_collisionSetMode == CollisionSetMode.EXCLUDE)) && ((((collisionSet == null)) || (!(((collisionSet[_local3.face._mesh]) || (collisionSet[_local3.face._surface])))))))) || ((((((_collisionSetMode == CollisionSetMode.INCLUDE)) && (!((collisionSet == null))))) && (((collisionSet[_local3.face._mesh]) || (collisionSet[_local3.face._surface]))))))){
calculateCollisionWithPrimitiveS(_local3);
if (collisionPrimitive != null){
break;
};
};
};
};
} else {
for (_local3 in _arg1.node.backPrimitives) {
if ((((((_collisionSetMode == CollisionSetMode.EXCLUDE)) && ((((collisionSet == null)) || (!(((collisionSet[_local3.face._mesh]) || (collisionSet[_local3.face._surface])))))))) || ((((((_collisionSetMode == CollisionSetMode.INCLUDE)) && (!((collisionSet == null))))) && (((collisionSet[_local3.face._mesh]) || (collisionSet[_local3.face._surface]))))))){
calculateCollisionWithPrimitiveS(_local3);
if (collisionPrimitive != null){
break;
};
};
};
};
if (collisionPrimitive != null){
if (_arg1.infront){
collisionNormal.x = _local2.x;
collisionNormal.y = _local2.y;
collisionNormal.z = _local2.z;
collisionOffset = _arg1.node.offset;
} else {
collisionNormal.x = -(_local2.x);
collisionNormal.y = -(_local2.y);
collisionNormal.z = -(_local2.z);
collisionOffset = -(_arg1.node.offset);
};
collisionPoint.x = collisionPlanePoint.x;
collisionPoint.y = collisionPlanePoint.y;
collisionPoint.z = collisionPlanePoint.z;
} else {
_local5 = (collisionSource.x - collisionPrimitivePoint.x);
_local6 = (collisionSource.y - collisionPrimitivePoint.y);
_local7 = (collisionSource.z - collisionPrimitivePoint.z);
if ((((_local5 * currentDisplacement.x) + (_local6 * currentDisplacement.y)) + (_local7 * currentDisplacement.z)) <= 0){
_local8 = Math.sqrt((((currentDisplacement.x * currentDisplacement.x) + (currentDisplacement.y * currentDisplacement.y)) + (currentDisplacement.z * currentDisplacement.z)));
_local9 = (-(currentDisplacement.x) / _local8);
_local10 = (-(currentDisplacement.y) / _local8);
_local11 = (-(currentDisplacement.z) / _local8);
_local12 = (((_local5 * _local5) + (_local6 * _local6)) + (_local7 * _local7));
_local13 = (((_local5 * _local9) + (_local6 * _local10)) + (_local7 * _local11));
_local14 = ((_radius2 - _local12) + (_local13 * _local13));
if (_local14 > 0){
_local15 = (_local13 - Math.sqrt(_local14));
if (_local15 < _local8){
collisionPoint.x = collisionPrimitivePoint.x;
collisionPoint.y = collisionPrimitivePoint.y;
collisionPoint.z = collisionPrimitivePoint.z;
_local16 = Math.sqrt(_local12);
collisionNormal.x = (_local5 / _local16);
collisionNormal.y = (_local6 / _local16);
collisionNormal.z = (_local7 / _local16);
collisionOffset = (((collisionPoint.x * collisionNormal.x) + (collisionPoint.y * collisionNormal.y)) + (collisionPoint.z * collisionNormal.z));
collisionPrimitive = collisionPrimitiveNearest;
};
};
};
};
}
}
}//package alternativa.engine3d.physics
Section 39
//Box (alternativa.engine3d.primitives.Box)
package alternativa.engine3d.primitives {
import alternativa.engine3d.core.*;
import flash.geom.*;
public class Box extends Mesh {
public function Box(_arg1:Number=100, _arg2:Number=100, _arg3:Number=100, _arg4:uint=1, _arg5:uint=1, _arg6:uint=1, _arg7:Boolean=false, _arg8:Boolean=false){
var _local15:int;
var _local16:int;
var _local17:int;
var _local27:String;
var _local28:Point;
var _local29:Point;
super();
if ((((((_arg4 == 0)) || ((_arg5 == 0)))) || ((_arg6 == 0)))){
return;
};
_arg1 = ((_arg1)<0) ? 0 : _arg1;
_arg2 = ((_arg2)<0) ? 0 : _arg2;
_arg3 = ((_arg3)<0) ? 0 : _arg3;
var _local9:Number = (_arg1 / 2);
var _local10:Number = (_arg2 / 2);
var _local11:Number = (_arg3 / 2);
var _local12:Number = (_arg1 / _arg4);
var _local13:Number = (_arg2 / _arg5);
var _local14:Number = (_arg3 / _arg6);
_local15 = 0;
while (_local15 <= _arg4) {
_local16 = 0;
while (_local16 <= _arg5) {
_local17 = 0;
while (_local17 <= _arg6) {
if ((((((((((((_local15 == 0)) || ((_local15 == _arg4)))) || ((_local16 == 0)))) || ((_local16 == _arg5)))) || ((_local17 == 0)))) || ((_local17 == _arg6)))){
createVertex(((_local15 * _local12) - _local9), ((_local16 * _local13) - _local10), ((_local17 * _local14) - _local11), ((((_local15 + "_") + _local16) + "_") + _local17));
};
_local17++;
};
_local16++;
};
_local15++;
};
var _local18:Surface = createSurface(null, "front");
var _local19:Surface = createSurface(null, "back");
var _local20:Surface = createSurface(null, "left");
var _local21:Surface = createSurface(null, "right");
var _local22:Surface = createSurface(null, "top");
var _local23:Surface = createSurface(null, "bottom");
var _local24:Number = (1 / _arg4);
var _local25:Number = (1 / _arg5);
var _local26:Number = (1 / _arg6);
_local16 = 0;
while (_local16 < _arg5) {
_local15 = 0;
while (_local15 < _arg4) {
_local27 = ((("top_" + _local15) + "_") + _local16);
if (_arg7){
if (_arg8){
_local28 = new Point((_local15 * _local24), ((_arg5 - _local16) * _local25));
_local29 = new Point(((_local15 + 1) * _local24), (((_arg5 - _local16) - 1) * _local25));
createFace([((((_local15 + "_") + _local16) + "_") + _arg6), ((((_local15 + "_") + (_local16 + 1)) + "_") + _arg6), (((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + _arg6)], (_local27 + ":1"));
setUVsToFace(_local28, new Point((_local15 * _local24), (((_arg5 - _local16) - 1) * _local25)), _local29, (_local27 + ":1"));
createFace([(((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + _arg6), (((((_local15 + 1) + "_") + _local16) + "_") + _arg6), ((((_local15 + "_") + _local16) + "_") + _arg6)], (_local27 + ":0"));
setUVsToFace(_local29, new Point(((_local15 + 1) * _local24), ((_arg5 - _local16) * _local25)), _local28, (_local27 + ":0"));
} else {
createFace([((((_local15 + "_") + _local16) + "_") + _arg6), ((((_local15 + "_") + (_local16 + 1)) + "_") + _arg6), (((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + _arg6), (((((_local15 + 1) + "_") + _local16) + "_") + _arg6)], _local27);
setUVsToFace(new Point((_local15 * _local24), ((_arg5 - _local16) * _local25)), new Point((_local15 * _local24), (((_arg5 - _local16) - 1) * _local25)), new Point(((_local15 + 1) * _local24), (((_arg5 - _local16) - 1) * _local25)), _local27);
};
} else {
if (_arg8){
_local28 = new Point((_local15 * _local24), (_local16 * _local25));
_local29 = new Point(((_local15 + 1) * _local24), ((_local16 + 1) * _local25));
createFace([((((_local15 + "_") + _local16) + "_") + _arg6), (((((_local15 + 1) + "_") + _local16) + "_") + _arg6), (((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + _arg6)], (_local27 + ":0"));
setUVsToFace(_local28, new Point(((_local15 + 1) * _local24), (_local16 * _local25)), _local29, (_local27 + ":0"));
createFace([(((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + _arg6), ((((_local15 + "_") + (_local16 + 1)) + "_") + _arg6), ((((_local15 + "_") + _local16) + "_") + _arg6)], (_local27 + ":1"));
setUVsToFace(_local29, new Point((_local15 * _local24), ((_local16 + 1) * _local25)), _local28, (_local27 + ":1"));
} else {
createFace([((((_local15 + "_") + _local16) + "_") + _arg6), (((((_local15 + 1) + "_") + _local16) + "_") + _arg6), (((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + _arg6), ((((_local15 + "_") + (_local16 + 1)) + "_") + _arg6)], _local27);
setUVsToFace(new Point((_local15 * _local24), (_local16 * _local25)), new Point(((_local15 + 1) * _local24), (_local16 * _local25)), new Point(((_local15 + 1) * _local24), ((_local16 + 1) * _local25)), _local27);
};
};
if (_arg8){
_local22.addFace((_local27 + ":0"));
_local22.addFace((_local27 + ":1"));
} else {
_local22.addFace(_local27);
};
_local15++;
};
_local16++;
};
_local16 = 0;
while (_local16 < _arg5) {
_local15 = 0;
while (_local15 < _arg4) {
_local27 = ((("bottom_" + _local15) + "_") + _local16);
if (_arg7){
if (_arg8){
_local28 = new Point(((_arg4 - _local15) * _local24), ((_arg5 - _local16) * _local25));
_local29 = new Point((((_arg4 - _local15) - 1) * _local24), (((_arg5 - _local16) - 1) * _local25));
createFace([((((_local15 + "_") + _local16) + "_") + 0), (((((_local15 + 1) + "_") + _local16) + "_") + 0), (((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + 0)], (_local27 + ":0"));
setUVsToFace(_local28, new Point((((_arg4 - _local15) - 1) * _local24), ((_arg5 - _local16) * _local25)), _local29, (_local27 + ":0"));
createFace([(((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + 0), ((((_local15 + "_") + (_local16 + 1)) + "_") + 0), ((((_local15 + "_") + _local16) + "_") + 0)], (_local27 + ":1"));
setUVsToFace(_local29, new Point(((_arg4 - _local15) * _local24), (((_arg5 - _local16) - 1) * _local25)), _local28, (_local27 + ":1"));
} else {
createFace([((((_local15 + "_") + _local16) + "_") + 0), (((((_local15 + 1) + "_") + _local16) + "_") + 0), (((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + 0), ((((_local15 + "_") + (_local16 + 1)) + "_") + 0)], _local27);
setUVsToFace(new Point(((_arg4 - _local15) * _local24), ((_arg5 - _local16) * _local25)), new Point((((_arg4 - _local15) - 1) * _local24), ((_arg5 - _local16) * _local25)), new Point((((_arg4 - _local15) - 1) * _local24), (((_arg5 - _local16) - 1) * _local25)), _local27);
};
} else {
if (_arg8){
_local28 = new Point(((_arg4 - _local15) * _local24), (_local16 * _local25));
_local29 = new Point((((_arg4 - _local15) - 1) * _local24), ((_local16 + 1) * _local25));
createFace([((((_local15 + "_") + _local16) + "_") + 0), ((((_local15 + "_") + (_local16 + 1)) + "_") + 0), (((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + 0)], (_local27 + ":1"));
setUVsToFace(_local28, new Point(((_arg4 - _local15) * _local24), ((_local16 + 1) * _local25)), _local29, (_local27 + ":1"));
createFace([(((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + 0), (((((_local15 + 1) + "_") + _local16) + "_") + 0), ((((_local15 + "_") + _local16) + "_") + 0)], (_local27 + ":0"));
setUVsToFace(_local29, new Point((((_arg4 - _local15) - 1) * _local24), (_local16 * _local25)), _local28, (_local27 + ":0"));
} else {
createFace([((((_local15 + "_") + _local16) + "_") + 0), ((((_local15 + "_") + (_local16 + 1)) + "_") + 0), (((((_local15 + 1) + "_") + (_local16 + 1)) + "_") + 0), (((((_local15 + 1) + "_") + _local16) + "_") + 0)], _local27);
setUVsToFace(new Point(((_arg4 - _local15) * _local24), (_local16 * _local25)), new Point(((_arg4 - _local15) * _local24), ((_local16 + 1) * _local25)), new Point((((_arg4 - _local15) - 1) * _local24), ((_local16 + 1) * _local25)), _local27);
};
};
if (_arg8){
_local23.addFace((_local27 + ":0"));
_local23.addFace((_local27 + ":1"));
} else {
_local23.addFace(_local27);
};
_local15++;
};
_local16++;
};
_local17 = 0;
while (_local17 < _arg6) {
_local15 = 0;
while (_local15 < _arg4) {
_local27 = ((("front_" + _local15) + "_") + _local17);
if (_arg7){
if (_arg8){
_local28 = new Point(((_arg4 - _local15) * _local24), (_local17 * _local26));
_local29 = new Point((((_arg4 - _local15) - 1) * _local24), ((_local17 + 1) * _local26));
createFace([((((_local15 + "_") + 0) + "_") + _local17), ((((_local15 + "_") + 0) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + 0) + "_") + (_local17 + 1))], (_local27 + ":1"));
setUVsToFace(_local28, new Point(((_arg4 - _local15) * _local24), ((_local17 + 1) * _local26)), _local29, (_local27 + ":1"));
createFace([(((((_local15 + 1) + "_") + 0) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + 0) + "_") + _local17), ((((_local15 + "_") + 0) + "_") + _local17)], (_local27 + ":0"));
setUVsToFace(_local29, new Point((((_arg4 - _local15) - 1) * _local24), (_local17 * _local26)), _local28, (_local27 + ":0"));
} else {
createFace([((((_local15 + "_") + 0) + "_") + _local17), ((((_local15 + "_") + 0) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + 0) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + 0) + "_") + _local17)], _local27);
setUVsToFace(new Point(((_arg4 - _local15) * _local24), (_local17 * _local26)), new Point(((_arg4 - _local15) * _local24), ((_local17 + 1) * _local26)), new Point((((_arg4 - _local15) - 1) * _local24), ((_local17 + 1) * _local26)), _local27);
};
} else {
if (_arg8){
_local28 = new Point((_local15 * _local24), (_local17 * _local26));
_local29 = new Point(((_local15 + 1) * _local24), ((_local17 + 1) * _local26));
createFace([((((_local15 + "_") + 0) + "_") + _local17), (((((_local15 + 1) + "_") + 0) + "_") + _local17), (((((_local15 + 1) + "_") + 0) + "_") + (_local17 + 1))], (_local27 + ":0"));
setUVsToFace(_local28, new Point(((_local15 + 1) * _local24), (_local17 * _local26)), _local29, (_local27 + ":0"));
createFace([(((((_local15 + 1) + "_") + 0) + "_") + (_local17 + 1)), ((((_local15 + "_") + 0) + "_") + (_local17 + 1)), ((((_local15 + "_") + 0) + "_") + _local17)], (_local27 + ":1"));
setUVsToFace(_local29, new Point((_local15 * _local24), ((_local17 + 1) * _local26)), _local28, (_local27 + ":1"));
} else {
createFace([((((_local15 + "_") + 0) + "_") + _local17), (((((_local15 + 1) + "_") + 0) + "_") + _local17), (((((_local15 + 1) + "_") + 0) + "_") + (_local17 + 1)), ((((_local15 + "_") + 0) + "_") + (_local17 + 1))], _local27);
setUVsToFace(new Point((_local15 * _local24), (_local17 * _local26)), new Point(((_local15 + 1) * _local24), (_local17 * _local26)), new Point(((_local15 + 1) * _local24), ((_local17 + 1) * _local26)), _local27);
};
};
if (_arg8){
_local18.addFace((_local27 + ":0"));
_local18.addFace((_local27 + ":1"));
} else {
_local18.addFace(_local27);
};
_local15++;
};
_local17++;
};
_local17 = 0;
while (_local17 < _arg6) {
_local15 = 0;
while (_local15 < _arg4) {
_local27 = ((("back_" + _local15) + "_") + _local17);
if (_arg7){
if (_arg8){
_local28 = new Point((_local15 * _local24), ((_local17 + 1) * _local26));
_local29 = new Point(((_local15 + 1) * _local24), (_local17 * _local26));
createFace([((((_local15 + "_") + _arg5) + "_") + (_local17 + 1)), ((((_local15 + "_") + _arg5) + "_") + _local17), (((((_local15 + 1) + "_") + _arg5) + "_") + _local17)], (_local27 + ":0"));
setUVsToFace(_local28, new Point((_local15 * _local24), (_local17 * _local26)), _local29, (_local27 + ":0"));
createFace([(((((_local15 + 1) + "_") + _arg5) + "_") + _local17), (((((_local15 + 1) + "_") + _arg5) + "_") + (_local17 + 1)), ((((_local15 + "_") + _arg5) + "_") + (_local17 + 1))], (_local27 + ":1"));
setUVsToFace(_local29, new Point(((_local15 + 1) * _local24), ((_local17 + 1) * _local26)), _local28, (_local27 + ":1"));
} else {
createFace([((((_local15 + "_") + _arg5) + "_") + _local17), (((((_local15 + 1) + "_") + _arg5) + "_") + _local17), (((((_local15 + 1) + "_") + _arg5) + "_") + (_local17 + 1)), ((((_local15 + "_") + _arg5) + "_") + (_local17 + 1))], _local27);
setUVsToFace(new Point((_local15 * _local24), (_local17 * _local26)), new Point(((_local15 + 1) * _local24), (_local17 * _local26)), new Point(((_local15 + 1) * _local24), ((_local17 + 1) * _local26)), _local27);
};
} else {
if (_arg8){
_local28 = new Point(((_arg4 - _local15) * _local24), ((_local17 + 1) * _local26));
_local29 = new Point((((_arg4 - _local15) - 1) * _local24), (_local17 * _local26));
createFace([((((_local15 + "_") + _arg5) + "_") + _local17), ((((_local15 + "_") + _arg5) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + _arg5) + "_") + _local17)], (_local27 + ":0"));
setUVsToFace(new Point(((_arg4 - _local15) * _local24), (_local17 * _local26)), _local28, _local29, (_local27 + ":0"));
createFace([((((_local15 + "_") + _arg5) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + _arg5) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + _arg5) + "_") + _local17)], (_local27 + ":1"));
setUVsToFace(_local28, new Point((((_arg4 - _local15) - 1) * _local24), ((_local17 + 1) * _local26)), _local29, (_local27 + ":1"));
} else {
createFace([((((_local15 + "_") + _arg5) + "_") + _local17), ((((_local15 + "_") + _arg5) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + _arg5) + "_") + (_local17 + 1)), (((((_local15 + 1) + "_") + _arg5) + "_") + _local17)], _local27);
setUVsToFace(new Point(((_arg4 - _local15) * _local24), (_local17 * _local26)), new Point(((_arg4 - _local15) * _local24), ((_local17 + 1) * _local26)), new Point((((_arg4 - _local15) - 1) * _local24), ((_local17 + 1) * _local26)), _local27);
};
};
if (_arg8){
_local19.addFace((_local27 + ":0"));
_local19.addFace((_local27 + ":1"));
} else {
_local19.addFace(_local27);
};
_local15++;
};
_local17++;
};
_local16 = 0;
while (_local16 < _arg5) {
_local17 = 0;
while (_local17 < _arg6) {
_local27 = ((("left_" + _local16) + "_") + _local17);
if (_arg7){
if (_arg8){
_local28 = new Point((_local16 * _local25), ((_local17 + 1) * _local26));
_local29 = new Point(((_local16 + 1) * _local25), (_local17 * _local26));
createFace([((((0 + "_") + _local16) + "_") + (_local17 + 1)), ((((0 + "_") + _local16) + "_") + _local17), ((((0 + "_") + (_local16 + 1)) + "_") + _local17)], (_local27 + ":0"));
setUVsToFace(_local28, new Point((_local16 * _local25), (_local17 * _local26)), _local29, (_local27 + ":0"));
createFace([((((0 + "_") + (_local16 + 1)) + "_") + _local17), ((((0 + "_") + (_local16 + 1)) + "_") + (_local17 + 1)), ((((0 + "_") + _local16) + "_") + (_local17 + 1))], (_local27 + ":1"));
setUVsToFace(_local29, new Point(((_local16 + 1) * _local25), ((_local17 + 1) * _local26)), _local28, (_local27 + ":1"));
} else {
createFace([((((0 + "_") + _local16) + "_") + _local17), ((((0 + "_") + (_local16 + 1)) + "_") + _local17), ((((0 + "_") + (_local16 + 1)) + "_") + (_local17 + 1)), ((((0 + "_") + _local16) + "_") + (_local17 + 1))], _local27);
setUVsToFace(new Point((_local16 * _local25), (_local17 * _local26)), new Point(((_local16 + 1) * _local25), (_local17 * _local26)), new Point(((_local16 + 1) * _local25), ((_local17 + 1) * _local26)), _local27);
};
} else {
if (_arg8){
_local28 = new Point((((_arg5 - _local16) - 1) * _local25), (_local17 * _local26));
_local29 = new Point(((_arg5 - _local16) * _local25), ((_local17 + 1) * _local26));
createFace([((((0 + "_") + (_local16 + 1)) + "_") + _local17), ((((0 + "_") + _local16) + "_") + _local17), ((((0 + "_") + _local16) + "_") + (_local17 + 1))], (_local27 + ":0"));
setUVsToFace(_local28, new Point(((_arg5 - _local16) * _local25), (_local17 * _local26)), _local29, (_local27 + ":0"));
createFace([((((0 + "_") + _local16) + "_") + (_local17 + 1)), ((((0 + "_") + (_local16 + 1)) + "_") + (_local17 + 1)), ((((0 + "_") + (_local16 + 1)) + "_") + _local17)], (_local27 + ":1"));
setUVsToFace(_local29, new Point((((_arg5 - _local16) - 1) * _local25), ((_local17 + 1) * _local26)), _local28, (_local27 + ":1"));
} else {
createFace([((((0 + "_") + _local16) + "_") + _local17), ((((0 + "_") + _local16) + "_") + (_local17 + 1)), ((((0 + "_") + (_local16 + 1)) + "_") + (_local17 + 1)), ((((0 + "_") + (_local16 + 1)) + "_") + _local17)], _local27);
setUVsToFace(new Point(((_arg5 - _local16) * _local25), (_local17 * _local26)), new Point(((_arg5 - _local16) * _local25), ((_local17 + 1) * _local26)), new Point((((_arg5 - _local16) - 1) * _local25), ((_local17 + 1) * _local26)), _local27);
};
};
if (_arg8){
_local20.addFace((_local27 + ":0"));
_local20.addFace((_local27 + ":1"));
} else {
_local20.addFace(_local27);
};
_local17++;
};
_local16++;
};
_local16 = 0;
while (_local16 < _arg5) {
_local17 = 0;
while (_local17 < _arg6) {
_local27 = ((("right_" + _local16) + "_") + _local17);
if (_arg7){
if (_arg8){
_local28 = new Point(((_arg5 - _local16) * _local25), (_local17 * _local26));
_local29 = new Point((((_arg5 - _local16) - 1) * _local25), ((_local17 + 1) * _local26));
createFace([((((_arg4 + "_") + _local16) + "_") + _local17), ((((_arg4 + "_") + _local16) + "_") + (_local17 + 1)), ((((_arg4 + "_") + (_local16 + 1)) + "_") + (_local17 + 1))], (_local27 + ":1"));
setUVsToFace(_local28, new Point(((_arg5 - _local16) * _local25), ((_local17 + 1) * _local26)), _local29, (_local27 + ":1"));
createFace([((((_arg4 + "_") + (_local16 + 1)) + "_") + (_local17 + 1)), ((((_arg4 + "_") + (_local16 + 1)) + "_") + _local17), ((((_arg4 + "_") + _local16) + "_") + _local17)], (_local27 + ":0"));
setUVsToFace(_local29, new Point((((_arg5 - _local16) - 1) * _local25), (_local17 * _local26)), _local28, (_local27 + ":0"));
} else {
createFace([((((_arg4 + "_") + _local16) + "_") + _local17), ((((_arg4 + "_") + _local16) + "_") + (_local17 + 1)), ((((_arg4 + "_") + (_local16 + 1)) + "_") + (_local17 + 1)), ((((_arg4 + "_") + (_local16 + 1)) + "_") + _local17)], _local27);
setUVsToFace(new Point(((_arg5 - _local16) * _local25), (_local17 * _local26)), new Point(((_arg5 - _local16) * _local25), ((_local17 + 1) * _local26)), new Point((((_arg5 - _local16) - 1) * _local25), ((_local17 + 1) * _local26)), _local27);
};
} else {
if (_arg8){
_local28 = new Point((_local16 * _local25), (_local17 * _local26));
_local29 = new Point(((_local16 + 1) * _local25), ((_local17 + 1) * _local26));
createFace([((((_arg4 + "_") + _local16) + "_") + _local17), ((((_arg4 + "_") + (_local16 + 1)) + "_") + _local17), ((((_arg4 + "_") + (_local16 + 1)) + "_") + (_local17 + 1))], (_local27 + ":0"));
setUVsToFace(_local28, new Point(((_local16 + 1) * _local25), (_local17 * _local26)), _local29, (_local27 + ":0"));
createFace([((((_arg4 + "_") + (_local16 + 1)) + "_") + (_local17 + 1)), ((((_arg4 + "_") + _local16) + "_") + (_local17 + 1)), ((((_arg4 + "_") + _local16) + "_") + _local17)], (_local27 + ":1"));
setUVsToFace(_local29, new Point((_local16 * _local25), ((_local17 + 1) * _local26)), _local28, (_local27 + ":1"));
} else {
createFace([((((_arg4 + "_") + _local16) + "_") + _local17), ((((_arg4 + "_") + (_local16 + 1)) + "_") + _local17), ((((_arg4 + "_") + (_local16 + 1)) + "_") + (_local17 + 1)), ((((_arg4 + "_") + _local16) + "_") + (_local17 + 1))], _local27);
setUVsToFace(new Point((_local16 * _local25), (_local17 * _local26)), new Point(((_local16 + 1) * _local25), (_local17 * _local26)), new Point(((_local16 + 1) * _local25), ((_local17 + 1) * _local26)), _local27);
};
};
if (_arg8){
_local21.addFace((_local27 + ":0"));
_local21.addFace((_local27 + ":1"));
} else {
_local21.addFace(_local27);
};
_local17++;
};
_local16++;
};
}
override protected function createEmptyObject():Object3D{
return (new Box(0, 0, 0, 0));
}
}
}//package alternativa.engine3d.primitives
Section 40
//alternativa3d (alternativa.engine3d.alternativa3d)
package alternativa.engine3d {
public namespace alternativa3d = "http://alternativaplatform.com/en/alternativa3d";
}//package alternativa.engine3d
Section 41
//alternativatypes (alternativa.types.alternativatypes)
package alternativa.types {
public namespace alternativatypes = "http://alternativaplatform.com/en/alternativatypes";
}//package alternativa.types
Section 42
//Map (alternativa.types.Map)
package alternativa.types {
import flash.utils.*;
public dynamic class Map extends Dictionary {
private var weakKeys:Boolean;
public function Map(_arg1:Boolean=false){
this.weakKeys = _arg1;
super(_arg1);
}
public function add(_arg1, _arg2):void{
this[_arg1] = _arg2;
}
public function isEmpty():Boolean{
var _local1:*;
for (_local1 in this) {
return (false);
};
return (true);
}
public function remove(_arg1):void{
delete this[_arg1];
}
public function hasKey(_arg1):Boolean{
return (!((this[_arg1] === undefined)));
}
public function get length():uint{
var _local2:*;
var _local1:uint;
for (_local2 in this) {
_local1++;
};
return (_local1);
}
public function take(){
var _local1:*;
var _local2:*;
for (_local1 in this) {
_local2 = this[_local1];
delete this[_local1];
return (_local2);
};
return (null);
}
public function clear():void{
var _local1:*;
for (_local1 in this) {
delete this[_local1];
};
}
public function any(){
var _local3:*;
var _local1:uint;
var _local2:uint = (Math.random() * length);
for (_local3 in this) {
if (_local1 == _local2){
return (this[_local3]);
};
_local1++;
};
return (null);
}
public function isSingle():Boolean{
var _local2:*;
var _local1:Boolean;
for (_local2 in this) {
if (_local1){
return (false);
};
_local1 = true;
};
return (_local1);
}
public function concat(_arg1:Map):void{
var _local2:*;
for (_local2 in _arg1) {
this[_local2] = _arg1[_local2];
};
}
public function toSet(_arg1:Boolean=false):Set{
var _local3:*;
var _local2:Set = new Set(_arg1);
for each (_local3 in this) {
_local2[_local3] = true;
};
return (_local2);
}
public function hasValue(_arg1):Boolean{
var _local2:*;
for (_local2 in this) {
if (this[_local2] === _arg1){
return (true);
};
};
return (false);
}
public function toString():String{
var _local2:*;
var _local1 = "";
for (_local2 in this) {
_local1 = (_local1 + ((("," + _local2) + ":") + this[_local2]));
};
return (_local1.substring(1));
}
public function peek(){
var _local1:*;
for (_local1 in this) {
return (this[_local1]);
};
return (null);
}
public function clone():Map{
var _local2:*;
var _local1:Map = new Map(weakKeys);
for (_local2 in this) {
_local1[_local2] = this[_local2];
};
return (_local1);
}
public function toArray(_arg1:Boolean=false):Array{
var _local3:*;
var _local2:Array = new Array();
if (_arg1){
for (_local3 in this) {
_local2.push(this[_local3]);
};
} else {
for (_local3 in this) {
_local2[_local3] = this[_local3];
};
};
return (_local2);
}
}
}//package alternativa.types
Section 43
//Matrix3D (alternativa.types.Matrix3D)
package alternativa.types {
public final class Matrix3D {
public var a:Number;
public var b:Number;
public var c:Number;
public var d:Number;
public var e:Number;
public var f:Number;
public var g:Number;
public var h:Number;
public var i:Number;
public var j:Number;
public var k:Number;
public var l:Number;
public function Matrix3D(_arg1:Number=1, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=1, _arg7:Number=0, _arg8:Number=0, _arg9:Number=0, _arg10:Number=0, _arg11:Number=1, _arg12:Number=0){
this.a = _arg1;
this.b = _arg2;
this.c = _arg3;
this.d = _arg4;
this.e = _arg5;
this.f = _arg6;
this.g = _arg7;
this.h = _arg8;
this.i = _arg9;
this.j = _arg10;
this.k = _arg11;
this.l = _arg12;
}
public function clone():Matrix3D{
return (new Matrix3D(a, b, c, d, e, f, g, h, i, j, k, l));
}
public function toString():String{
return (((((((((((((((((((((((("Matrix:\r" + a.toFixed(3)) + "\t") + b.toFixed(3)) + "\t") + c.toFixed(3)) + "\t") + d.toFixed(3)) + "\r") + e.toFixed(3)) + "\t") + f.toFixed(3)) + "\t") + g.toFixed(3)) + "\t") + h.toFixed(3)) + "\r") + i.toFixed(3)) + "\t") + j.toFixed(3)) + "\t") + k.toFixed(3)) + "\t") + l.toFixed(3)));
}
public function scale(_arg1:Number, _arg2:Number, _arg3:Number):void{
a = (a * _arg1);
b = (b * _arg1);
c = (c * _arg1);
d = (d * _arg1);
e = (e * _arg2);
f = (f * _arg2);
g = (g * _arg2);
h = (h * _arg2);
i = (i * _arg3);
j = (j * _arg3);
k = (k * _arg3);
l = (l * _arg3);
}
public function offset(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):void{
d = _arg1;
h = _arg2;
l = _arg3;
}
public function translate(_arg1:Number, _arg2:Number, _arg3:Number):void{
d = (d + _arg1);
h = (h + _arg2);
l = (l + _arg3);
}
public function equals(_arg1:Matrix3D, _arg2:Number=0):Boolean{
var _local3:Number = (a - _arg1.a);
var _local4:Number = (b - _arg1.b);
var _local5:Number = (c - _arg1.c);
var _local6:Number = (d - _arg1.d);
var _local7:Number = (e - _arg1.e);
var _local8:Number = (f - _arg1.f);
var _local9:Number = (g - _arg1.g);
var _local10:Number = (h - _arg1.h);
var _local11:Number = (i - _arg1.i);
var _local12:Number = (j - _arg1.j);
var _local13:Number = (k - _arg1.k);
var _local14:Number = (l - _arg1.l);
_local3 = ((_local3)<0) ? -(_local3) : _local3;
_local4 = ((_local4)<0) ? -(_local4) : _local4;
_local5 = ((_local5)<0) ? -(_local5) : _local5;
_local6 = ((_local6)<0) ? -(_local6) : _local6;
_local7 = ((_local7)<0) ? -(_local7) : _local7;
_local8 = ((_local8)<0) ? -(_local8) : _local8;
_local9 = ((_local9)<0) ? -(_local9) : _local9;
_local10 = ((_local10)<0) ? -(_local10) : _local10;
_local11 = ((_local11)<0) ? -(_local11) : _local11;
_local12 = ((_local12)<0) ? -(_local12) : _local12;
_local13 = ((_local13)<0) ? -(_local13) : _local13;
_local14 = ((_local14)<0) ? -(_local14) : _local14;
return ((((((((((((((((((((((((_local3 <= _arg2)) && ((_local4 <= _arg2)))) && ((_local5 <= _arg2)))) && ((_local6 <= _arg2)))) && ((_local7 <= _arg2)))) && ((_local8 <= _arg2)))) && ((_local9 <= _arg2)))) && ((_local10 <= _arg2)))) && ((_local11 <= _arg2)))) && ((_local12 <= _arg2)))) && ((_local13 <= _arg2)))) && ((_local14 <= _arg2))));
}
public function toIdentity():void{
a = (f = (k = 1));
b = (c = (d = (e = (g = (h = (i = (j = (l = 0))))))));
}
public function rotate(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Number = Math.cos(_arg1);
var _local5:Number = Math.sin(_arg1);
var _local6:Number = Math.cos(_arg2);
var _local7:Number = Math.sin(_arg2);
var _local8:Number = Math.cos(_arg3);
var _local9:Number = Math.sin(_arg3);
var _local10:Number = (_local8 * _local7);
var _local11:Number = (_local9 * _local7);
var _local12:Number = (_local8 * _local6);
var _local13:Number = ((_local10 * _local5) - (_local9 * _local4));
var _local14:Number = ((_local10 * _local4) + (_local9 * _local5));
var _local15:Number = (_local9 * _local6);
var _local16:Number = ((_local11 * _local5) + (_local8 * _local4));
var _local17:Number = ((_local11 * _local4) - (_local8 * _local5));
var _local18:Number = -(_local7);
var _local19:Number = (_local6 * _local5);
var _local20:Number = (_local6 * _local4);
var _local21:Number = a;
var _local22:Number = b;
var _local23:Number = c;
var _local24:Number = d;
var _local25:Number = e;
var _local26:Number = f;
var _local27:Number = g;
var _local28:Number = h;
var _local29:Number = i;
var _local30:Number = j;
var _local31:Number = k;
var _local32:Number = l;
a = (((_local12 * _local21) + (_local13 * _local25)) + (_local14 * _local29));
b = (((_local12 * _local22) + (_local13 * _local26)) + (_local14 * _local30));
c = (((_local12 * _local23) + (_local13 * _local27)) + (_local14 * _local31));
d = (((_local12 * _local24) + (_local13 * _local28)) + (_local14 * _local32));
e = (((_local15 * _local21) + (_local16 * _local25)) + (_local17 * _local29));
f = (((_local15 * _local22) + (_local16 * _local26)) + (_local17 * _local30));
g = (((_local15 * _local23) + (_local16 * _local27)) + (_local17 * _local31));
h = (((_local15 * _local24) + (_local16 * _local28)) + (_local17 * _local32));
i = (((_local18 * _local21) + (_local19 * _local25)) + (_local20 * _local29));
j = (((_local18 * _local22) + (_local19 * _local26)) + (_local20 * _local30));
k = (((_local18 * _local23) + (_local19 * _local27)) + (_local20 * _local31));
l = (((_local18 * _local24) + (_local19 * _local28)) + (_local20 * _local32));
}
public function inverseTransform(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7:Number=1, _arg8:Number=1, _arg9:Number=1):void{
var _local10:Number = Math.cos(_arg4);
var _local11:Number = Math.sin(-(_arg4));
var _local12:Number = Math.cos(_arg5);
var _local13:Number = Math.sin(-(_arg5));
var _local14:Number = Math.cos(_arg6);
var _local15:Number = Math.sin(-(_arg6));
var _local16:Number = (_local11 * _local13);
var _local17:Number = (1 / _arg7);
var _local18:Number = (1 / _arg8);
var _local19:Number = (1 / _arg9);
var _local20:Number = (_local12 * _local17);
var _local21:Number = (_local10 * _local18);
var _local22:Number = (_local11 * _local19);
var _local23:Number = (_local10 * _local19);
var _local24:Number = (_local14 * _local20);
var _local25:Number = (-(_local15) * _local20);
var _local26:Number = (_local13 * _local17);
var _local27:Number = -((((_local24 * _arg1) + (_local25 * _arg2)) + (_local26 * _arg3)));
var _local28:Number = ((_local15 * _local21) + ((_local16 * _local14) * _local18));
var _local29:Number = ((_local14 * _local21) - ((_local16 * _local15) * _local18));
var _local30:Number = ((-(_local11) * _local12) * _local18);
var _local31:Number = -((((_local28 * _arg1) + (_local29 * _arg2)) + (_local30 * _arg3)));
var _local32:Number = ((_local15 * _local22) - ((_local14 * _local13) * _local23));
var _local33:Number = ((_local14 * _local22) + ((_local13 * _local15) * _local23));
var _local34:Number = (_local12 * _local23);
var _local35:Number = -((((_local32 * _arg1) + (_local33 * _arg2)) + (_local34 * _arg3)));
var _local36:Number = a;
var _local37:Number = b;
var _local38:Number = c;
var _local39:Number = d;
var _local40:Number = e;
var _local41:Number = f;
var _local42:Number = g;
var _local43:Number = h;
var _local44:Number = i;
var _local45:Number = j;
var _local46:Number = k;
var _local47:Number = l;
a = (((_local24 * _local36) + (_local25 * _local40)) + (_local26 * _local44));
b = (((_local24 * _local37) + (_local25 * _local41)) + (_local26 * _local45));
c = (((_local24 * _local38) + (_local25 * _local42)) + (_local26 * _local46));
d = ((((_local24 * _local39) + (_local25 * _local43)) + (_local26 * _local47)) + _local27);
e = (((_local28 * _local36) + (_local29 * _local40)) + (_local30 * _local44));
f = (((_local28 * _local37) + (_local29 * _local41)) + (_local30 * _local45));
g = (((_local28 * _local38) + (_local29 * _local42)) + (_local30 * _local46));
h = ((((_local28 * _local39) + (_local29 * _local43)) + (_local30 * _local47)) + _local31);
i = (((_local32 * _local36) + (_local33 * _local40)) + (_local34 * _local44));
j = (((_local32 * _local37) + (_local33 * _local41)) + (_local34 * _local45));
k = (((_local32 * _local38) + (_local33 * _local42)) + (_local34 * _local46));
l = ((((_local32 * _local39) + (_local33 * _local43)) + (_local34 * _local47)) + _local35);
}
public function invert():void{
var _local1:Number = a;
var _local2:Number = b;
var _local3:Number = c;
var _local4:Number = d;
var _local5:Number = e;
var _local6:Number = f;
var _local7:Number = g;
var _local8:Number = h;
var _local9:Number = i;
var _local10:Number = j;
var _local11:Number = k;
var _local12:Number = l;
var _local13:Number = (((((((-(_local3) * _local6) * _local9) + ((_local2 * _local7) * _local9)) + ((_local3 * _local5) * _local10)) - ((_local1 * _local7) * _local10)) - ((_local2 * _local5) * _local11)) + ((_local1 * _local6) * _local11));
a = (((-(_local7) * _local10) + (_local6 * _local11)) / _local13);
b = (((_local3 * _local10) - (_local2 * _local11)) / _local13);
c = (((-(_local3) * _local6) + (_local2 * _local7)) / _local13);
d = ((((((((_local4 * _local7) * _local10) - ((_local3 * _local8) * _local10)) - ((_local4 * _local6) * _local11)) + ((_local2 * _local8) * _local11)) + ((_local3 * _local6) * _local12)) - ((_local2 * _local7) * _local12)) / _local13);
e = (((_local7 * _local9) - (_local5 * _local11)) / _local13);
f = (((-(_local3) * _local9) + (_local1 * _local11)) / _local13);
g = (((_local3 * _local5) - (_local1 * _local7)) / _local13);
h = ((((((((_local3 * _local8) * _local9) - ((_local4 * _local7) * _local9)) + ((_local4 * _local5) * _local11)) - ((_local1 * _local8) * _local11)) - ((_local3 * _local5) * _local12)) + ((_local1 * _local7) * _local12)) / _local13);
i = (((-(_local6) * _local9) + (_local5 * _local10)) / _local13);
j = (((_local2 * _local9) - (_local1 * _local10)) / _local13);
k = (((-(_local2) * _local5) + (_local1 * _local6)) / _local13);
l = ((((((((_local4 * _local6) * _local9) - ((_local2 * _local8) * _local9)) - ((_local4 * _local5) * _local10)) + ((_local1 * _local8) * _local10)) + ((_local2 * _local5) * _local12)) - ((_local1 * _local6) * _local12)) / _local13);
}
public function inverseCombine(_arg1:Matrix3D):void{
var _local2:Number = a;
var _local3:Number = b;
var _local4:Number = c;
var _local5:Number = d;
var _local6:Number = e;
var _local7:Number = f;
var _local8:Number = g;
var _local9:Number = h;
var _local10:Number = i;
var _local11:Number = j;
var _local12:Number = k;
var _local13:Number = l;
a = (((_local2 * _arg1.a) + (_local3 * _arg1.e)) + (_local4 * _arg1.i));
b = (((_local2 * _arg1.b) + (_local3 * _arg1.f)) + (_local4 * _arg1.j));
c = (((_local2 * _arg1.c) + (_local3 * _arg1.g)) + (_local4 * _arg1.k));
d = ((((_local2 * _arg1.d) + (_local3 * _arg1.h)) + (_local4 * _arg1.l)) + _local5);
e = (((_local6 * _arg1.a) + (_local7 * _arg1.e)) + (_local8 * _arg1.i));
f = (((_local6 * _arg1.b) + (_local7 * _arg1.f)) + (_local8 * _arg1.j));
g = (((_local6 * _arg1.c) + (_local7 * _arg1.g)) + (_local8 * _arg1.k));
h = ((((_local6 * _arg1.d) + (_local7 * _arg1.h)) + (_local8 * _arg1.l)) + _local9);
i = (((_local10 * _arg1.a) + (_local11 * _arg1.e)) + (_local12 * _arg1.i));
j = (((_local10 * _arg1.b) + (_local11 * _arg1.f)) + (_local12 * _arg1.j));
k = (((_local10 * _arg1.c) + (_local11 * _arg1.g)) + (_local12 * _arg1.k));
l = ((((_local10 * _arg1.d) + (_local11 * _arg1.h)) + (_local12 * _arg1.l)) + _local13);
}
public function toTransform(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7:Number=1, _arg8:Number=1, _arg9:Number=1):void{
var _local10:Number = Math.cos(_arg4);
var _local11:Number = Math.sin(_arg4);
var _local12:Number = Math.cos(_arg5);
var _local13:Number = Math.sin(_arg5);
var _local14:Number = Math.cos(_arg6);
var _local15:Number = Math.sin(_arg6);
var _local16:Number = (_local14 * _local13);
var _local17:Number = (_local15 * _local13);
var _local18:Number = (_local12 * _arg7);
var _local19:Number = (_local11 * _arg8);
var _local20:Number = (_local10 * _arg8);
var _local21:Number = (_local10 * _arg9);
var _local22:Number = (_local11 * _arg9);
a = (_local14 * _local18);
b = ((_local16 * _local19) - (_local15 * _local20));
c = ((_local16 * _local21) + (_local15 * _local22));
d = _arg1;
e = (_local15 * _local18);
f = ((_local17 * _local19) + (_local14 * _local20));
g = ((_local17 * _local21) - (_local14 * _local22));
h = _arg2;
i = (-(_local13) * _arg7);
j = (_local12 * _local19);
k = (_local12 * _local21);
l = _arg3;
}
public function inverseRotate(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Number = Math.cos(_arg1);
var _local5:Number = Math.sin(-(_arg1));
var _local6:Number = Math.cos(_arg2);
var _local7:Number = Math.sin(-(_arg2));
var _local8:Number = Math.cos(_arg3);
var _local9:Number = Math.sin(-(_arg3));
var _local10:Number = (_local5 * _local7);
var _local11:Number = (_local6 * _local8);
var _local12:Number = (-(_local6) * _local9);
var _local13:Number = _local7;
var _local14:Number = ((_local4 * _local9) + (_local10 * _local8));
var _local15:Number = ((_local4 * _local8) - (_local10 * _local9));
var _local16:Number = (-(_local5) * _local6);
var _local17:Number = ((_local5 * _local9) - ((_local4 * _local8) * _local7));
var _local18:Number = ((_local5 * _local8) + ((_local4 * _local7) * _local9));
var _local19:Number = (_local4 * _local6);
var _local20:Number = a;
var _local21:Number = b;
var _local22:Number = c;
var _local23:Number = d;
var _local24:Number = e;
var _local25:Number = f;
var _local26:Number = g;
var _local27:Number = h;
var _local28:Number = i;
var _local29:Number = j;
var _local30:Number = k;
var _local31:Number = l;
a = (((_local11 * _local20) + (_local12 * _local24)) + (_local13 * _local28));
b = (((_local11 * _local21) + (_local12 * _local25)) + (_local13 * _local29));
c = (((_local11 * _local22) + (_local12 * _local26)) + (_local13 * _local30));
d = (((_local11 * _local23) + (_local12 * _local27)) + (_local13 * _local31));
e = (((_local14 * _local20) + (_local15 * _local24)) + (_local16 * _local28));
f = (((_local14 * _local21) + (_local15 * _local25)) + (_local16 * _local29));
g = (((_local14 * _local22) + (_local15 * _local26)) + (_local16 * _local30));
h = (((_local14 * _local23) + (_local15 * _local27)) + (_local16 * _local31));
i = (((_local17 * _local20) + (_local18 * _local24)) + (_local19 * _local28));
j = (((_local17 * _local21) + (_local18 * _local25)) + (_local19 * _local29));
k = (((_local17 * _local22) + (_local18 * _local26)) + (_local19 * _local30));
l = (((_local17 * _local23) + (_local18 * _local27)) + (_local19 * _local31));
}
public function copy(_arg1:Matrix3D):void{
a = _arg1.a;
b = _arg1.b;
c = _arg1.c;
d = _arg1.d;
e = _arg1.e;
f = _arg1.f;
g = _arg1.g;
h = _arg1.h;
i = _arg1.i;
j = _arg1.j;
k = _arg1.k;
l = _arg1.l;
}
public function fromAxisAngle(_arg1:Point3D, _arg2:Number):void{
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Number = (1 - _local3);
var _local6:Number = _arg1.x;
var _local7:Number = _arg1.y;
var _local8:Number = _arg1.z;
a = (((_local5 * _local6) * _local6) + _local3);
b = (((_local5 * _local6) * _local7) - (_local8 * _local4));
c = (((_local5 * _local6) * _local8) + (_local7 * _local4));
d = 0;
e = (((_local5 * _local6) * _local7) + (_local8 * _local4));
f = (((_local5 * _local7) * _local7) + _local3);
g = (((_local5 * _local7) * _local8) - (_local6 * _local4));
h = 0;
i = (((_local5 * _local6) * _local8) - (_local7 * _local4));
j = (((_local5 * _local7) * _local8) + (_local6 * _local4));
k = (((_local5 * _local8) * _local8) + _local3);
l = 0;
}
public function getRotations(_arg1:Point3D=null):Point3D{
if (_arg1 == null){
_arg1 = new Point3D();
};
_arg1.y = -(Math.asin(i));
if ((((-0.999 <= i)) && ((i <= 0.999)))){
_arg1.x = Math.atan2(j, k);
_arg1.z = Math.atan2(e, a);
} else {
_arg1.x = 0;
_arg1.z = Math.atan2(-(b), f);
};
return (_arg1);
}
public function inverseScale(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Number = (1 / _arg1);
var _local5:Number = (1 / _arg2);
var _local6:Number = (1 / _arg3);
a = (a * _local4);
b = (b * _local4);
c = (c * _local4);
d = (d * _local4);
e = (e * _local5);
f = (f * _local5);
g = (g * _local5);
h = (h * _local5);
i = (i * _local6);
j = (j * _local6);
k = (k * _local6);
l = (l * _local6);
}
public function transform(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7:Number=1, _arg8:Number=1, _arg9:Number=1):void{
var _local10:Number = Math.cos(_arg4);
var _local11:Number = Math.sin(_arg4);
var _local12:Number = Math.cos(_arg5);
var _local13:Number = Math.sin(_arg5);
var _local14:Number = Math.cos(_arg6);
var _local15:Number = Math.sin(_arg6);
var _local16:Number = (_local14 * _local13);
var _local17:Number = (_local15 * _local13);
var _local18:Number = (_local12 * _arg7);
var _local19:Number = (_local11 * _arg8);
var _local20:Number = (_local10 * _arg8);
var _local21:Number = (_local10 * _arg9);
var _local22:Number = (_local11 * _arg9);
var _local23:Number = (_local14 * _local18);
var _local24:Number = ((_local16 * _local19) - (_local15 * _local20));
var _local25:Number = ((_local16 * _local21) + (_local15 * _local22));
var _local26:Number = _arg1;
var _local27:Number = (_local15 * _local18);
var _local28:Number = ((_local17 * _local19) + (_local14 * _local20));
var _local29:Number = ((_local17 * _local21) - (_local14 * _local22));
var _local30:Number = _arg2;
var _local31:Number = (-(_local13) * _arg7);
var _local32:Number = (_local12 * _local19);
var _local33:Number = (_local12 * _local21);
var _local34:Number = _arg3;
var _local35:Number = a;
var _local36:Number = b;
var _local37:Number = c;
var _local38:Number = d;
var _local39:Number = e;
var _local40:Number = f;
var _local41:Number = g;
var _local42:Number = h;
var _local43:Number = i;
var _local44:Number = j;
var _local45:Number = k;
var _local46:Number = l;
a = (((_local23 * _local35) + (_local24 * _local39)) + (_local25 * _local43));
b = (((_local23 * _local36) + (_local24 * _local40)) + (_local25 * _local44));
c = (((_local23 * _local37) + (_local24 * _local41)) + (_local25 * _local45));
d = ((((_local23 * _local38) + (_local24 * _local42)) + (_local25 * _local46)) + _local26);
e = (((_local27 * _local35) + (_local28 * _local39)) + (_local29 * _local43));
f = (((_local27 * _local36) + (_local28 * _local40)) + (_local29 * _local44));
g = (((_local27 * _local37) + (_local28 * _local41)) + (_local29 * _local45));
h = ((((_local27 * _local38) + (_local28 * _local42)) + (_local29 * _local46)) + _local30);
i = (((_local31 * _local35) + (_local32 * _local39)) + (_local33 * _local43));
j = (((_local31 * _local36) + (_local32 * _local40)) + (_local33 * _local44));
k = (((_local31 * _local37) + (_local32 * _local41)) + (_local33 * _local45));
l = ((((_local31 * _local38) + (_local32 * _local42)) + (_local33 * _local46)) + _local34);
}
public function translateLocal(_arg1:Number, _arg2:Number, _arg3:Number):void{
d = (d + (((a * _arg1) + (b * _arg2)) + (c * _arg3)));
h = (h + (((e * _arg1) + (f * _arg2)) + (g * _arg3)));
l = (l + (((i * _arg1) + (j * _arg2)) + (k * _arg3)));
}
public function inverseTranslate(_arg1:Number, _arg2:Number, _arg3:Number):void{
d = (d - _arg1);
h = (h - _arg2);
l = (l - _arg3);
}
public function combine(_arg1:Matrix3D):void{
var _local2:Number = a;
var _local3:Number = b;
var _local4:Number = c;
var _local5:Number = d;
var _local6:Number = e;
var _local7:Number = f;
var _local8:Number = g;
var _local9:Number = h;
var _local10:Number = i;
var _local11:Number = j;
var _local12:Number = k;
var _local13:Number = l;
a = (((_arg1.a * _local2) + (_arg1.b * _local6)) + (_arg1.c * _local10));
b = (((_arg1.a * _local3) + (_arg1.b * _local7)) + (_arg1.c * _local11));
c = (((_arg1.a * _local4) + (_arg1.b * _local8)) + (_arg1.c * _local12));
d = ((((_arg1.a * _local5) + (_arg1.b * _local9)) + (_arg1.c * _local13)) + _arg1.d);
e = (((_arg1.e * _local2) + (_arg1.f * _local6)) + (_arg1.g * _local10));
f = (((_arg1.e * _local3) + (_arg1.f * _local7)) + (_arg1.g * _local11));
g = (((_arg1.e * _local4) + (_arg1.f * _local8)) + (_arg1.g * _local12));
h = ((((_arg1.e * _local5) + (_arg1.f * _local9)) + (_arg1.g * _local13)) + _arg1.h);
i = (((_arg1.i * _local2) + (_arg1.j * _local6)) + (_arg1.k * _local10));
j = (((_arg1.i * _local3) + (_arg1.j * _local7)) + (_arg1.k * _local11));
k = (((_arg1.i * _local4) + (_arg1.j * _local8)) + (_arg1.k * _local12));
l = ((((_arg1.i * _local5) + (_arg1.j * _local9)) + (_arg1.k * _local13)) + _arg1.l);
}
public static function inverseTranslationMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
return (new Matrix3D(1, 0, 0, -(_arg1), 0, 1, 0, -(_arg2), 0, 0, 1, -(_arg3)));
}
public static function translationMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
return (new Matrix3D(1, 0, 0, _arg1, 0, 1, 0, _arg2, 0, 0, 1, _arg3));
}
public static function axisAngleToMatrix(_arg1:Point3D, _arg2:Number):Matrix3D{
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Number = (1 - _local3);
var _local6:Number = _arg1.x;
var _local7:Number = _arg1.y;
var _local8:Number = _arg1.z;
var _local9:Matrix3D = new Matrix3D((((_local5 * _local6) * _local6) + _local3), (((_local5 * _local6) * _local7) - (_local8 * _local4)), (((_local5 * _local6) * _local8) + (_local7 * _local4)), 0, (((_local5 * _local6) * _local7) + (_local8 * _local4)), (((_local5 * _local7) * _local7) + _local3), (((_local5 * _local7) * _local8) - (_local6 * _local4)), 0, (((_local5 * _local6) * _local8) - (_local7 * _local4)), (((_local5 * _local7) * _local8) + (_local6 * _local4)), (((_local5 * _local8) * _local8) + _local3), 0);
return (_local9);
}
public static function inverseRotationMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
var _local4:Number = Math.cos(_arg1);
var _local5:Number = Math.sin(-(_arg1));
var _local6:Number = Math.cos(_arg2);
var _local7:Number = Math.sin(-(_arg2));
var _local8:Number = Math.cos(_arg3);
var _local9:Number = Math.sin(-(_arg3));
var _local10:Number = (_local5 * _local7);
return (new Matrix3D((_local6 * _local8), (-(_local6) * _local9), _local7, 0, ((_local4 * _local9) + (_local10 * _local8)), ((_local4 * _local8) - (_local10 * _local9)), (-(_local5) * _local6), 0, ((_local5 * _local9) - ((_local4 * _local8) * _local7)), ((_local5 * _local8) + ((_local4 * _local7) * _local9)), (_local4 * _local6), 0));
}
public static function inverseTransformationMatrix(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7:Number=1, _arg8:Number=1, _arg9:Number=1):Matrix3D{
var _local10:Number = Math.cos(-(_arg4));
var _local11:Number = Math.sin(-(_arg4));
var _local12:Number = Math.cos(-(_arg5));
var _local13:Number = Math.sin(-(_arg5));
var _local14:Number = Math.cos(-(_arg6));
var _local15:Number = Math.sin(-(_arg6));
var _local16:Number = (_local11 * _local13);
var _local17:Number = (1 / _arg7);
var _local18:Number = (1 / _arg8);
var _local19:Number = (1 / _arg9);
var _local20:Number = (_local12 * _local17);
var _local21:Number = (_local10 * _local18);
var _local22:Number = (_local11 * _local19);
var _local23:Number = (_local10 * _local19);
var _local24:Number = (_local14 * _local20);
var _local25:Number = (-(_local15) * _local20);
var _local26:Number = (_local13 * _local17);
var _local27:Number = ((_local15 * _local21) + ((_local16 * _local14) * _local18));
var _local28:Number = ((_local14 * _local21) - ((_local16 * _local15) * _local18));
var _local29:Number = ((-(_local11) * _local12) * _local18);
var _local30:Number = ((_local15 * _local22) - ((_local14 * _local13) * _local23));
var _local31:Number = ((_local14 * _local22) + ((_local13 * _local15) * _local23));
var _local32:Number = (_local12 * _local23);
return (new Matrix3D(_local24, _local25, _local26, -((((_local24 * _arg1) + (_local25 * _arg2)) + (_local26 * _arg3))), _local27, _local28, _local29, -((((_local27 * _arg1) + (_local28 * _arg2)) + (_local29 * _arg3))), _local30, _local31, _local32, -((((_local30 * _arg1) + (_local31 * _arg2)) + (_local32 * _arg3)))));
}
public static function inverseMatrix(_arg1:Matrix3D):Matrix3D{
var _local2:Number = (((((((-(_arg1.c) * _arg1.f) * _arg1.i) + ((_arg1.b * _arg1.g) * _arg1.i)) + ((_arg1.c * _arg1.e) * _arg1.j)) - ((_arg1.a * _arg1.g) * _arg1.j)) - ((_arg1.b * _arg1.e) * _arg1.k)) + ((_arg1.a * _arg1.f) * _arg1.k));
var _local3:Number = (((-(_arg1.g) * _arg1.j) + (_arg1.f * _arg1.k)) / _local2);
var _local4:Number = (((_arg1.c * _arg1.j) - (_arg1.b * _arg1.k)) / _local2);
var _local5:Number = (((-(_arg1.c) * _arg1.f) + (_arg1.b * _arg1.g)) / _local2);
var _local6:Number = ((((((((_arg1.d * _arg1.g) * _arg1.j) - ((_arg1.c * _arg1.h) * _arg1.j)) - ((_arg1.d * _arg1.f) * _arg1.k)) + ((_arg1.b * _arg1.h) * _arg1.k)) + ((_arg1.c * _arg1.f) * _arg1.l)) - ((_arg1.b * _arg1.g) * _arg1.l)) / _local2);
var _local7:Number = (((_arg1.g * _arg1.i) - (_arg1.e * _arg1.k)) / _local2);
var _local8:Number = (((-(_arg1.c) * _arg1.i) + (_arg1.a * _arg1.k)) / _local2);
var _local9:Number = (((_arg1.c * _arg1.e) - (_arg1.a * _arg1.g)) / _local2);
var _local10:Number = ((((((((_arg1.c * _arg1.h) * _arg1.i) - ((_arg1.d * _arg1.g) * _arg1.i)) + ((_arg1.d * _arg1.e) * _arg1.k)) - ((_arg1.a * _arg1.h) * _arg1.k)) - ((_arg1.c * _arg1.e) * _arg1.l)) + ((_arg1.a * _arg1.g) * _arg1.l)) / _local2);
var _local11:Number = (((-(_arg1.f) * _arg1.i) + (_arg1.e * _arg1.j)) / _local2);
var _local12:Number = (((_arg1.b * _arg1.i) - (_arg1.a * _arg1.j)) / _local2);
var _local13:Number = (((-(_arg1.b) * _arg1.e) + (_arg1.a * _arg1.f)) / _local2);
var _local14:Number = ((((((((_arg1.d * _arg1.f) * _arg1.i) - ((_arg1.b * _arg1.h) * _arg1.i)) - ((_arg1.d * _arg1.e) * _arg1.j)) + ((_arg1.a * _arg1.h) * _arg1.j)) + ((_arg1.b * _arg1.e) * _arg1.l)) - ((_arg1.a * _arg1.f) * _arg1.l)) / _local2);
return (new Matrix3D(_local3, _local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11, _local12, _local13, _local14));
}
public static function inverseScaleMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
return (new Matrix3D((1 / _arg1), 0, 0, 0, 0, (1 / _arg2), 0, 0, 0, 0, (1 / _arg3), 0));
}
public static function scaleMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
return (new Matrix3D(_arg1, 0, 0, 0, 0, _arg2, 0, 0, 0, 0, _arg3, 0));
}
public static function transformationMatrix(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7:Number=1, _arg8:Number=1, _arg9:Number=1):Matrix3D{
var _local10:Number = Math.cos(_arg4);
var _local11:Number = Math.sin(_arg4);
var _local12:Number = Math.cos(_arg5);
var _local13:Number = Math.sin(_arg5);
var _local14:Number = Math.cos(_arg6);
var _local15:Number = Math.sin(_arg6);
var _local16:Number = (_local14 * _local13);
var _local17:Number = (_local15 * _local13);
var _local18:Number = (_local12 * _arg7);
var _local19:Number = (_local11 * _arg8);
var _local20:Number = (_local10 * _arg8);
var _local21:Number = (_local10 * _arg9);
var _local22:Number = (_local11 * _arg9);
return (new Matrix3D((_local14 * _local18), ((_local16 * _local19) - (_local15 * _local20)), ((_local16 * _local21) + (_local15 * _local22)), _arg1, (_local15 * _local18), ((_local17 * _local19) + (_local14 * _local20)), ((_local17 * _local21) - (_local14 * _local22)), _arg2, (-(_local13) * _arg7), (_local12 * _local19), (_local12 * _local21), _arg3));
}
public static function product(_arg1:Matrix3D, _arg2:Matrix3D):Matrix3D{
return (new Matrix3D((((_arg1.a * _arg2.a) + (_arg1.b * _arg2.e)) + (_arg1.c * _arg2.i)), (((_arg1.a * _arg2.b) + (_arg1.b * _arg2.f)) + (_arg1.c * _arg2.j)), (((_arg1.a * _arg2.c) + (_arg1.b * _arg2.g)) + (_arg1.c * _arg2.k)), ((((_arg1.a * _arg2.d) + (_arg1.b * _arg2.h)) + (_arg1.c * _arg2.l)) + _arg1.d), (((_arg1.e * _arg2.a) + (_arg1.f * _arg2.e)) + (_arg1.g * _arg2.i)), (((_arg1.e * _arg2.b) + (_arg1.f * _arg2.f)) + (_arg1.g * _arg2.j)), (((_arg1.e * _arg2.c) + (_arg1.f * _arg2.g)) + (_arg1.g * _arg2.k)), ((((_arg1.e * _arg2.d) + (_arg1.f * _arg2.h)) + (_arg1.g * _arg2.l)) + _arg1.h), (((_arg1.i * _arg2.a) + (_arg1.j * _arg2.e)) + (_arg1.k * _arg2.i)), (((_arg1.i * _arg2.b) + (_arg1.j * _arg2.f)) + (_arg1.k * _arg2.j)), (((_arg1.i * _arg2.c) + (_arg1.j * _arg2.g)) + (_arg1.k * _arg2.k)), ((((_arg1.i * _arg2.d) + (_arg1.j * _arg2.h)) + (_arg1.k * _arg2.l)) + _arg1.l)));
}
public static function rotationMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
var _local4:Number = Math.cos(_arg1);
var _local5:Number = Math.sin(_arg1);
var _local6:Number = Math.cos(_arg2);
var _local7:Number = Math.sin(_arg2);
var _local8:Number = Math.cos(_arg3);
var _local9:Number = Math.sin(_arg3);
var _local10:Number = (_local8 * _local7);
var _local11:Number = (_local9 * _local7);
return (new Matrix3D((_local8 * _local6), ((_local10 * _local5) - (_local9 * _local4)), ((_local10 * _local4) + (_local9 * _local5)), 0, (_local9 * _local6), ((_local11 * _local5) + (_local8 * _local4)), ((_local11 * _local4) - (_local8 * _local5)), 0, -(_local7), (_local6 * _local5), (_local6 * _local4), 0));
}
}
}//package alternativa.types
Section 44
//Point3D (alternativa.types.Point3D)
package alternativa.types {
import flash.geom.*;
public final class Point3D {
public var x:Number;
public var y:Number;
public var z:Number;
public function Point3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function floor():void{
x = Math.floor(x);
y = Math.floor(y);
z = Math.floor(z);
}
public function add(_arg1:Point3D):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
}
public function toString():String{
return (((((("X: " + x.toFixed(3)) + " Y:") + y.toFixed(3)) + " Z:") + z.toFixed(3)));
}
public function multiply(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
}
public function transform(_arg1:Matrix3D):void{
var _local2:Number = x;
var _local3:Number = y;
var _local4:Number = z;
x = ((((_arg1.a * _local2) + (_arg1.b * _local3)) + (_arg1.c * _local4)) + _arg1.d);
y = ((((_arg1.e * _local2) + (_arg1.f * _local3)) + (_arg1.g * _local4)) + _arg1.h);
z = ((((_arg1.i * _local2) + (_arg1.j * _local3)) + (_arg1.k * _local4)) + _arg1.l);
}
public function get length():Number{
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
public function clone():Point3D{
return (new Point3D(x, y, z));
}
public function set length(_arg1:Number):void{
var _local2:Number;
if (((((!((x == 0))) || (!((y == 0))))) || (!((z == 0))))){
_local2 = (_arg1 / length);
x = (x * _local2);
y = (y * _local2);
z = (z * _local2);
} else {
z = _arg1;
};
}
public function normalize():void{
var _local1:Number;
if (((((!((x == 0))) || (!((y == 0))))) || (!((z == 0))))){
_local1 = Math.sqrt((((x * x) + (y * y)) + (z * z)));
x = (x / _local1);
y = (y / _local1);
z = (z / _local1);
} else {
z = 1;
};
}
public function get lengthSqr():Number{
return ((((x * x) + (y * y)) + (z * z)));
}
public function reset():void{
x = 0;
y = 0;
z = 0;
}
public function copy(_arg1:Point3D):void{
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
}
public function invert():void{
x = -(x);
y = -(y);
z = -(z);
}
public function subtract(_arg1:Point3D):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
z = (z - _arg1.z);
}
public function toPoint():Point{
return (new Point(x, y));
}
public function round():void{
x = Math.round(x);
y = Math.round(y);
z = Math.round(z);
}
public function equals(_arg1:Point3D, _arg2:Number=0):Boolean{
return (((((((((((((x - _arg1.x) <= _arg2)) && (((x - _arg1.x) >= -(_arg2))))) && (((y - _arg1.y) <= _arg2)))) && (((y - _arg1.y) >= -(_arg2))))) && (((z - _arg1.z) <= _arg2)))) && (((z - _arg1.z) >= -(_arg2)))));
}
public static function cross(_arg1:Point3D, _arg2:Point3D):Point3D{
return (new Point3D(((_arg1.y * _arg2.z) - (_arg1.z * _arg2.y)), ((_arg1.z * _arg2.x) - (_arg1.x * _arg2.z)), ((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x))));
}
public static function cross2D(_arg1:Point3D, _arg2:Point3D):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function angle(_arg1:Point3D, _arg2:Point3D):Number{
var _local3:Number = Math.sqrt(((((_arg1.x * _arg1.x) + (_arg1.y * _arg1.y)) + (_arg1.z * _arg1.z)) * (((_arg2.x * _arg2.x) + (_arg2.y * _arg2.y)) + (_arg2.z * _arg2.z))));
var _local4:Number = ((_local3)!=0) ? (dot(_arg1, _arg2) / _local3) : 1;
return (Math.acos(_local4));
}
public static function average(_arg1:Point3D, _arg2:Point3D=null, _arg3:Point3D=null, _arg4:Point3D=null):Point3D{
if (_arg2 == null){
return (_arg1.clone());
};
if (_arg3 == null){
return (new Point3D(((_arg1.x + _arg2.x) * 0.5), ((_arg1.y + _arg2.y) * 0.5), ((_arg1.z + _arg2.z) * 0.5)));
};
if (_arg4 == null){
return (new Point3D((((_arg1.x + _arg2.x) + _arg3.x) / 3), (((_arg1.y + _arg2.y) + _arg3.y) / 3), (((_arg1.z + _arg2.z) + _arg3.z) / 3)));
};
return (new Point3D(((((_arg1.x + _arg2.x) + _arg3.x) + _arg4.x) * 0.25), ((((_arg1.y + _arg2.y) + _arg3.y) + _arg4.y) * 0.25), ((((_arg1.z + _arg2.z) + _arg3.z) + _arg4.z) / 0.25)));
}
public static function random(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Point3D{
return (new Point3D((_arg1 + (Math.random() * (_arg2 - _arg1))), (_arg3 + (Math.random() * (_arg4 - _arg3))), (_arg5 + (Math.random() * (_arg6 - _arg5)))));
}
public static function interpolate(_arg1:Point3D, _arg2:Point3D, _arg3:Number=0.5):Point3D{
return (new Point3D((_arg1.x + ((_arg2.x - _arg1.x) * _arg3)), (_arg1.y + ((_arg2.y - _arg1.y) * _arg3)), (_arg1.z + ((_arg2.z - _arg1.z) * _arg3))));
}
public static function dot(_arg1:Point3D, _arg2:Point3D):Number{
return ((((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)) + (_arg1.z * _arg2.z)));
}
public static function sum(_arg1:Point3D, _arg2:Point3D):Point3D{
return (new Point3D((_arg1.x + _arg2.x), (_arg1.y + _arg2.y), (_arg1.z + _arg2.z)));
}
public static function dot2D(_arg1:Point3D, _arg2:Point3D):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function difference(_arg1:Point3D, _arg2:Point3D):Point3D{
return (new Point3D((_arg1.x - _arg2.x), (_arg1.y - _arg2.y), (_arg1.z - _arg2.z)));
}
public static function angleFast(_arg1:Point3D, _arg2:Point3D):Number{
var _local3:Number = dot(_arg1, _arg2);
if (Math.abs(_local3) > 1){
_local3 = ((_local3)>0) ? 1 : -1;
};
return (Math.acos(_local3));
}
}
}//package alternativa.types
Section 45
//Set (alternativa.types.Set)
package alternativa.types {
import flash.utils.*;
public dynamic final class Set extends Dictionary {
private var weakKeys:Boolean;
public function Set(_arg1:Boolean=false){
this.weakKeys = _arg1;
super(_arg1);
}
public function add(_arg1):void{
this[_arg1] = true;
}
public function isEmpty():Boolean{
var _local1:*;
for (_local1 in this) {
return (false);
};
return (true);
}
public function remove(_arg1):void{
delete this[_arg1];
}
public function get length():uint{
var _local2:*;
var _local1:uint;
for (_local2 in this) {
_local1++;
};
return (_local1);
}
public function take(){
var _local1:*;
for (_local1 in this) {
delete this[_local1];
return (_local1);
};
return (null);
}
public function clear():void{
var _local1:*;
for (_local1 in this) {
delete this[_local1];
};
}
public function any(){
var _local3:*;
var _local1:uint;
var _local2:uint = (Math.random() * length);
for (_local3 in this) {
if (_local1 == _local2){
return (_local3);
};
_local1++;
};
return (null);
}
public function isSingle():Boolean{
var _local2:*;
var _local1:Boolean;
for (_local2 in this) {
if (_local1){
return (false);
};
_local1 = true;
};
return (_local1);
}
public function concat(_arg1:Set):void{
var _local2:*;
for (_local2 in _arg1) {
this[_local2] = true;
};
}
public function subtract(_arg1:Set):void{
var _local2:*;
for (_local2 in _arg1) {
delete this[_local2];
};
}
public function toString():String{
var _local2:*;
var _local1 = "";
for (_local2 in this) {
_local1 = (_local1 + ("," + _local2));
};
return (_local1.substring(1));
}
public function has(_arg1):Boolean{
return (this[_arg1]);
}
public function peek(){
var _local1:*;
for (_local1 in this) {
return (_local1);
};
return (null);
}
public function clone():Set{
var _local2:*;
var _local1:Set = new Set(weakKeys);
for (_local2 in this) {
_local1[_local2] = true;
};
return (_local1);
}
public function toArray():Array{
var _local2:*;
var _local1:Array = new Array();
for (_local2 in this) {
_local1.push(_local2);
};
return (_local1);
}
public function intersect(_arg1:Set):void{
var _local3:*;
var _local2:Set = new Set(true);
for (_local3 in this) {
if (_arg1[_local3]){
_local2[_local3] = true;
};
delete this[_local3];
};
concat(_local2);
}
public static function intersection(_arg1:Set, _arg2:Set, _arg3:Boolean=false):Set{
var _local5:*;
var _local4:Set = new Set(_arg3);
for (_local5 in _arg1) {
if (_arg2[_local5]){
_local4[_local5] = true;
};
};
return (_local4);
}
public static function createFromArray(_arg1:Array, _arg2:Boolean=false):Set{
var _local4:*;
var _local3:Set = new Set(_arg2);
for each (_local4 in _arg1) {
_local3[_local4] = true;
};
return (_local3);
}
public static function difference(_arg1:Set, _arg2:Set, _arg3:Boolean=false):Set{
var _local5:*;
var _local4:Set = new Set(_arg3);
for (_local5 in _arg1) {
if (!_arg2[_local5]){
_local4[_local5] = true;
};
};
return (_local4);
}
public static function union(_arg1:Set, _arg2:Set, _arg3:Boolean=false):Set{
var _local5:*;
var _local4:Set = new Set(_arg3);
for (_local5 in _arg1) {
_local4[_local5] = true;
};
for (_local5 in _arg2) {
_local4[_local5] = true;
};
return (_local4);
}
}
}//package alternativa.types
Section 46
//Texture (alternativa.types.Texture)
package alternativa.types {
import flash.display.*;
public class Texture {
alternativatypes var _height:uint;
alternativatypes var _width:uint;
alternativatypes var _name:String;
alternativatypes var _bitmapData:BitmapData;
public function Texture(_arg1:BitmapData, _arg2:String=null){
if (_arg1 == null){
throw (new Error("Cannot create texture from null bitmapData"));
};
_bitmapData = _arg1;
_width = _arg1.width;
_height = _arg1.height;
_name = _arg2;
}
public function get name():String{
return (_name);
}
public function get width():uint{
return (_width);
}
public function get height():uint{
return (_height);
}
public function get bitmapData():BitmapData{
return (_bitmapData);
}
public function toString():String{
return ((((((("[TextureData " + ((_name)!=null) ? _name : "") + " ") + _width) + "x") + _height) + "]"));
}
}
}//package alternativa.types
Section 47
//BitmapUtils (alternativa.utils.BitmapUtils)
package alternativa.utils {
import flash.display.*;
import flash.geom.*;
public class BitmapUtils {
public static function getNonTransparentRect(_arg1:BitmapData):Rectangle{
return ((_arg1.transparent) ? _arg1.getColorBoundsRect(4278190080, 0, false) : _arg1.rect);
}
public static function getFragment(_arg1:BitmapData, _arg2:Rectangle):BitmapData{
var _local3:BitmapData = new BitmapData(_arg2.width, _arg2.height, _arg1.transparent, 0);
_local3.copyPixels(_arg1, _arg2, new Point());
return (_local3);
}
public static function mergeBitmapAlpha(_arg1:BitmapData, _arg2:BitmapData, _arg3:Boolean=false):BitmapData{
var _local4:BitmapData = new BitmapData(_arg1.width, _arg1.height);
_local4.copyPixels(_arg1, _arg1.rect, new Point());
_local4.copyChannel(_arg2, _arg2.rect, new Point(), BitmapDataChannel.RED, BitmapDataChannel.ALPHA);
if (_arg3){
_arg1.dispose();
_arg2.dispose();
};
return (_local4);
}
}
}//package alternativa.utils
Section 48
//FPS (alternativa.utils.FPS)
package alternativa.utils {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.text.*;
import flash.system.*;
import flash.utils.*;
public final class FPS extends Sprite {
private var currentY:int;
private var diagramTimer:int;
private var tfTimer:int;
private var downloadedBytes:uint;// = 0
private var maxMemory:uint;// = 0
private var socketOutBytes:uint;// = 0
private var socketOutLast:uint;// = 0
private var socketInBytes:uint;// = 0
private var mem:TextField;
private var skn:TextField;
private var diagram:BitmapData;
private var socketOut:TextField;
private var skins:int;// = -1
private var fps:TextField;
private var socketInLast:uint;// = 0
private var tfDelay:int;// = 0
private var socketIn:TextField;
private var dwl:TextField;
private var skinsChanged:int;// = 0
private static const diagramWidth:uint = 60;
private static const tfDelayMax:int = 10;
private static const maxSocket:uint = 4200;
private static const diagramHeight:uint = 40;
private static var instance:FPS;
public function FPS(_arg1:DisplayObjectContainer){
var _local2:Bitmap;
fps = new TextField();
mem = new TextField();
skn = new TextField();
dwl = new TextField();
socketIn = new TextField();
socketOut = new TextField();
super();
if (instance == null){
mouseEnabled = false;
mouseChildren = false;
_arg1.addChild(this);
fps.defaultTextFormat = new TextFormat("Tahoma", 10, 0xCCCCCC);
fps.autoSize = TextFieldAutoSize.LEFT;
fps.text = ("FPS: " + Number(stage.frameRate).toFixed(2));
fps.selectable = false;
fps.x = (-(diagramWidth) - 2);
addChild(fps);
mem.defaultTextFormat = new TextFormat("Tahoma", 10, 0xCCCC00);
mem.autoSize = TextFieldAutoSize.LEFT;
mem.text = ("MEM: " + bytesToString(System.totalMemory));
mem.selectable = false;
mem.x = (-(diagramWidth) - 2);
mem.y = 10;
addChild(mem);
currentY = 20;
skn.defaultTextFormat = new TextFormat("Tahoma", 10, 0xFF6600);
skn.autoSize = TextFieldAutoSize.LEFT;
skn.text = ("MEM: " + bytesToString(System.totalMemory));
skn.selectable = false;
skn.x = (-(diagramWidth) - 2);
dwl.defaultTextFormat = new TextFormat("Tahoma", 10, 0xCC00CC);
dwl.autoSize = TextFieldAutoSize.LEFT;
dwl.selectable = false;
dwl.x = (-(diagramWidth) - 2);
socketIn.defaultTextFormat = new TextFormat("Tahoma", 10, 0xFF00);
socketIn.autoSize = TextFieldAutoSize.LEFT;
socketIn.selectable = false;
socketIn.x = (-(diagramWidth) - 2);
socketOut.defaultTextFormat = new TextFormat("Tahoma", 10, 26367);
socketOut.autoSize = TextFieldAutoSize.LEFT;
socketOut.selectable = false;
socketOut.x = (-(diagramWidth) - 2);
diagram = new BitmapData(diagramWidth, diagramHeight, true, 553648127);
_local2 = new Bitmap(diagram);
_local2.y = (currentY + 4);
_local2.x = -(diagramWidth);
addChildAt(_local2, 0);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
stage.addEventListener(Event.RESIZE, onResize);
onResize();
diagramTimer = getTimer();
tfTimer = getTimer();
} else {
throw (new Error("FPS is a Singleton. Use FPS.init to create FPS instance"));
};
}
private function bytesToString(_arg1:uint):String{
var _local2:String;
if (_arg1 < 0x0400){
_local2 = (String(_arg1) + "b");
} else {
if (_arg1 < 0x2800){
_local2 = (Number((_arg1 / 0x0400)).toFixed(2) + "kb");
} else {
if (_arg1 < 102400){
_local2 = (Number((_arg1 / 0x0400)).toFixed(1) + "kb");
} else {
if (_arg1 < 0x100000){
_local2 = ((_arg1 >> 10) + "kb");
} else {
if (_arg1 < 0xA00000){
_local2 = (Number((_arg1 / 0x100000)).toFixed(2) + "mb");
} else {
if (_arg1 < 104857600){
_local2 = (Number((_arg1 / 0x100000)).toFixed(1) + "mb");
} else {
_local2 = ((_arg1 >> 20) + "mb");
};
};
};
};
};
};
return (_local2);
}
private function onEnterFrame(_arg1:Event):void{
tfDelay++;
if (tfDelay >= tfDelayMax){
tfDelay = 0;
fps.text = ("FPS: " + Number(((1000 * tfDelayMax) / (getTimer() - tfTimer))).toFixed(2));
tfTimer = getTimer();
};
var _local2:Number = (1000 / (getTimer() - diagramTimer));
var _local3:Number = ((_local2)>stage.frameRate) ? 1 : (_local2 / stage.frameRate);
diagramTimer = getTimer();
diagram.scroll(1, 0);
diagram.fillRect(new Rectangle(0, 0, 1, diagram.height), 553648127);
diagram.setPixel32(0, (diagramHeight * (1 - _local3)), 4291611852);
var _local4:uint = System.totalMemory;
mem.text = ("MEM: " + bytesToString(_local4));
var _local5:Number = ((skins)==0) ? 0 : (skinsChanged / skins);
diagram.setPixel32(0, (diagramHeight * (1 - _local5)), 4294927872);
if (_local4 > maxMemory){
maxMemory = _local4;
};
var _local6:Number = (_local4 / maxMemory);
diagram.setPixel32(0, (diagramHeight * (1 - _local6)), 4291611648);
var _local7:Number = ((socketInBytes - socketInLast) / maxSocket);
socketInLast = socketInBytes;
diagram.setPixel32(0, (diagramHeight * (1 - _local7)), 4278255360);
var _local8:Number = ((socketOutBytes - socketOutLast) / maxSocket);
socketOutLast = socketOutBytes;
diagram.setPixel32(0, (diagramHeight * (1 - _local8)), 4278216447);
}
private function onResize(_arg1:Event=null):void{
var _local2:Point = parent.globalToLocal(new Point((stage.stageWidth - 2), -3));
x = _local2.x;
y = _local2.y;
}
public static function addDownloadBytes(_arg1:uint):void{
if (instance.downloadedBytes == 0){
instance.dwl.y = instance.currentY;
instance.currentY = (instance.currentY + 10);
instance.addChild(instance.dwl);
instance.getChildAt(0).y = (instance.currentY + 4);
};
instance.downloadedBytes = (instance.downloadedBytes + _arg1);
instance.dwl.text = ("DWL: " + instance.bytesToString(instance.downloadedBytes));
}
public static function init(_arg1:DisplayObjectContainer):void{
instance = new FPS(_arg1);
}
public static function addSocketOutBytes(_arg1:uint):void{
if (instance.socketOutBytes == 0){
instance.socketOut.y = instance.currentY;
instance.currentY = (instance.currentY + 10);
instance.addChild(instance.socketOut);
instance.getChildAt(0).y = (instance.currentY + 4);
};
instance.socketOutBytes = (instance.socketOutBytes + _arg1);
instance.socketOut.text = ("OUT: " + instance.bytesToString(instance.socketOutBytes));
}
public static function addSocketInBytes(_arg1:uint):void{
if (instance.socketInBytes == 0){
instance.socketIn.y = instance.currentY;
instance.currentY = (instance.currentY + 10);
instance.addChild(instance.socketIn);
instance.getChildAt(0).y = (instance.currentY + 4);
};
instance.socketInBytes = (instance.socketInBytes + _arg1);
instance.socketIn.text = ("IN: " + instance.bytesToString(instance.socketInBytes));
}
public static function addSkins(_arg1:uint, _arg2:uint):void{
if (instance.skins < 0){
instance.skn.y = instance.currentY;
instance.currentY = (instance.currentY + 10);
instance.addChild(instance.skn);
instance.getChildAt(0).y = (instance.currentY + 4);
};
instance.skins = _arg1;
instance.skinsChanged = _arg2;
instance.skn.text = ("SKN: " + ((_arg2)>0) ? ((_arg1.toString() + "-") + _arg2.toString()) : _arg1.toString());
}
}
}//package alternativa.utils
Section 49
//KeyboardUtils (alternativa.utils.KeyboardUtils)
package alternativa.utils {
import flash.utils.*;
public class KeyboardUtils {
public static const F13:uint = 124;
public static const F14:uint = 125;
public static const LEFT:uint = 37;
public static const RIGHTBRACKET:uint = 221;
public static const EQUAL:uint = 187;
public static const F15:uint = 126;
public static const COMMAND:uint = 15;
public static const CONTROL:uint = 17;
public static const NUMPAD_DECIMAL:uint = 110;
public static const A:uint = 65;
public static const B:uint = 66;
public static const C:uint = 67;
public static const D:uint = 68;
public static const E:uint = 69;
public static const F:uint = 70;
public static const G:uint = 71;
public static const H:uint = 72;
public static const I:uint = 73;
public static const J:uint = 74;
public static const K:uint = 75;
public static const L:uint = 76;
public static const M:uint = 77;
public static const N:uint = 78;
public static const O:uint = 79;
public static const P:uint = 80;
public static const Q:uint = 81;
public static const R:uint = 82;
public static const S:uint = 83;
public static const T:uint = 84;
public static const U:uint = 85;
public static const V:uint = 86;
public static const W:uint = 87;
public static const X:uint = 88;
public static const Y:uint = 89;
public static const Z:uint = 90;
public static const QUOTE:uint = 222;
public static const SLASH:uint = 191;
public static const NUMPAD_ENTER:uint = 108;
public static const BACKSPACE:uint = 8;
public static const PAGE_DOWN:uint = 34;
public static const SHIFT:uint = 16;
public static const PAGE_UP:uint = 33;
public static const MINUS:uint = 189;
public static const NUMPAD:uint = 21;
public static const TAB:uint = 9;
public static const SEMICOLON:uint = 186;
public static const LEFTBRACKET:uint = 219;
public static const ESCAPE:uint = 27;
public static const F3:uint = 114;
public static const COMMA:uint = 188;
public static const F5:uint = 116;
public static const INSERT:uint = 45;
public static const END:uint = 35;
public static const NUMBER_2:uint = 50;
public static const NUMBER_3:uint = 51;
public static const NUMBER_5:uint = 53;
public static const NUMBER_6:uint = 54;
public static const PERIOD:uint = 190;
public static const NUMBER_1:uint = 49;
public static const DELETE:uint = 46;
public static const NUMPAD_6:uint = 102;
public static const NUMPAD_1:uint = 97;
public static const NUMPAD_2:uint = 98;
public static const NUMBER_7:uint = 55;
public static const NUMBER_0:uint = 48;
public static const NUMBER_9:uint = 57;
public static const NUMBER_4:uint = 52;
public static const NUMPAD_9:uint = 105;
public static const DOWN:uint = 40;
public static const NUMPAD_3:uint = 99;
public static const NUMBER_8:uint = 56;
public static const NUMPAD_5:uint = 101;
public static const F7:uint = 118;
public static const NUMPAD_7:uint = 103;
public static const BACKQUOTE:uint = 192;
public static const BACKSLASH:uint = 220;
public static const NUMPAD_DIVIDE:uint = 111;
public static const NUMPAD_4:uint = 100;
public static const F4:uint = 115;
public static const NUMPAD_MULTIPLY:uint = 106;
public static const NUMPAD_8:uint = 104;
public static const HOME:uint = 36;
public static const NUMPAD_0:uint = 96;
public static const CAPS_LOCK:uint = 20;
public static const NUMPAD_ADD:uint = 107;
public static const F1:uint = 112;
public static const SPACE:uint = 32;
public static const F12:uint = 123;
public static const NUMPAD_SUBTRACT:uint = 109;
public static const F6:uint = 117;
public static const F8:uint = 119;
public static const F11:uint = 122;
public static const ENTER:uint = 13;
public static const F2:uint = 113;
public static const F10:uint = 121;
public static const F9:uint = 120;
public static const RIGHT:uint = 39;
public static const UP:uint = 38;
private static var keyCodeStringRepresentation:Dictionary;
private static function fillKeyCodes():void{
keyCodeStringRepresentation = new Dictionary(true);
keyCodeStringRepresentation[A] = "A";
keyCodeStringRepresentation[B] = "B";
keyCodeStringRepresentation[C] = "C";
keyCodeStringRepresentation[D] = "D";
keyCodeStringRepresentation[E] = "E";
keyCodeStringRepresentation[F] = "F";
keyCodeStringRepresentation[G] = "G";
keyCodeStringRepresentation[H] = "H";
keyCodeStringRepresentation[I] = "I";
keyCodeStringRepresentation[J] = "J";
keyCodeStringRepresentation[K] = "K";
keyCodeStringRepresentation[L] = "L";
keyCodeStringRepresentation[M] = "M";
keyCodeStringRepresentation[N] = "N";
keyCodeStringRepresentation[O] = "O";
keyCodeStringRepresentation[P] = "P";
keyCodeStringRepresentation[Q] = "Q";
keyCodeStringRepresentation[R] = "R";
keyCodeStringRepresentation[S] = "S";
keyCodeStringRepresentation[T] = "T";
keyCodeStringRepresentation[U] = "U";
keyCodeStringRepresentation[V] = "V";
keyCodeStringRepresentation[W] = "W";
keyCodeStringRepresentation[X] = "X";
keyCodeStringRepresentation[Y] = "Y";
keyCodeStringRepresentation[Z] = "Z";
keyCodeStringRepresentation[SPACE] = "SPACE";
keyCodeStringRepresentation[SEMICOLON] = "SEMICOLON";
keyCodeStringRepresentation[COMMA] = "COMMA";
keyCodeStringRepresentation[PERIOD] = "PERIOD";
keyCodeStringRepresentation[SLASH] = "SLASH";
keyCodeStringRepresentation[BACKQUOTE] = "BACK QUOTE";
keyCodeStringRepresentation[LEFTBRACKET] = "LEFT BRACKET";
keyCodeStringRepresentation[BACKSLASH] = "BACK SLASH";
keyCodeStringRepresentation[RIGHTBRACKET] = "RIGHT BRACKET";
keyCodeStringRepresentation[QUOTE] = "'";
keyCodeStringRepresentation[BACKSPACE] = "BACKSPACE";
keyCodeStringRepresentation[TAB] = "TAB";
keyCodeStringRepresentation[PAGE_UP] = "PAGE UP";
keyCodeStringRepresentation[PAGE_DOWN] = "PAGE DOWN";
keyCodeStringRepresentation[END] = "END";
keyCodeStringRepresentation[HOME] = "HOME";
keyCodeStringRepresentation[INSERT] = "INSERT";
keyCodeStringRepresentation[DELETE] = "DELETE";
keyCodeStringRepresentation[NUMBER_0] = "0";
keyCodeStringRepresentation[NUMBER_1] = "1";
keyCodeStringRepresentation[NUMBER_2] = "2";
keyCodeStringRepresentation[NUMBER_3] = "3";
keyCodeStringRepresentation[NUMBER_4] = "4";
keyCodeStringRepresentation[NUMBER_5] = "5";
keyCodeStringRepresentation[NUMBER_6] = "6";
keyCodeStringRepresentation[NUMBER_7] = "7";
keyCodeStringRepresentation[NUMBER_8] = "8";
keyCodeStringRepresentation[NUMBER_9] = "9";
keyCodeStringRepresentation[EQUAL] = "EQUAL";
keyCodeStringRepresentation[MINUS] = "MINUS";
keyCodeStringRepresentation[NUMPAD] = "NUM LOCK";
keyCodeStringRepresentation[NUMPAD_0] = "0";
keyCodeStringRepresentation[NUMPAD_1] = "1";
keyCodeStringRepresentation[NUMPAD_2] = "2";
keyCodeStringRepresentation[NUMPAD_3] = "3";
keyCodeStringRepresentation[NUMPAD_4] = "4";
keyCodeStringRepresentation[NUMPAD_5] = "5";
keyCodeStringRepresentation[NUMPAD_6] = "6";
keyCodeStringRepresentation[NUMPAD_7] = "7";
keyCodeStringRepresentation[NUMPAD_8] = "8";
keyCodeStringRepresentation[NUMPAD_9] = "9";
keyCodeStringRepresentation[NUMPAD_ADD] = "NUM+";
keyCodeStringRepresentation[NUMPAD_DECIMAL] = "NUM DECIMAL";
keyCodeStringRepresentation[NUMPAD_DIVIDE] = "NUM DIVIDE";
keyCodeStringRepresentation[NUMPAD_ENTER] = "NUMPAD ENTER";
keyCodeStringRepresentation[NUMPAD_MULTIPLY] = "NUM MULTIPLY";
keyCodeStringRepresentation[NUMPAD_SUBTRACT] = "NUM SUBTRACT";
keyCodeStringRepresentation[ENTER] = "ENTER";
keyCodeStringRepresentation[COMMAND] = "COMMAND";
keyCodeStringRepresentation[SHIFT] = "SHIFT";
keyCodeStringRepresentation[CONTROL] = "CONTROL";
keyCodeStringRepresentation[CAPS_LOCK] = "CAPS LOCK";
keyCodeStringRepresentation[ESCAPE] = "ESCAPE";
keyCodeStringRepresentation[LEFT] = "LEFT";
keyCodeStringRepresentation[UP] = "UP";
keyCodeStringRepresentation[RIGHT] = "RIGHT";
keyCodeStringRepresentation[DOWN] = "DOWN";
keyCodeStringRepresentation[F1] = "F1";
keyCodeStringRepresentation[F2] = "F2";
keyCodeStringRepresentation[F3] = "F3";
keyCodeStringRepresentation[F4] = "F4";
keyCodeStringRepresentation[F5] = "F5";
keyCodeStringRepresentation[F6] = "F6";
keyCodeStringRepresentation[F7] = "F7";
keyCodeStringRepresentation[F8] = "F8";
keyCodeStringRepresentation[F9] = "F9";
keyCodeStringRepresentation[F10] = "F10";
keyCodeStringRepresentation[F11] = "F11";
keyCodeStringRepresentation[F12] = "F12";
keyCodeStringRepresentation[F13] = "F13";
keyCodeStringRepresentation[F14] = "F14";
keyCodeStringRepresentation[F15] = "F15";
}
public static function getKeyCodeStringRepresentation(_arg1:uint):String{
if (keyCodeStringRepresentation == null){
fillKeyCodes();
};
return (keyCodeStringRepresentation[_arg1]);
}
}
}//package alternativa.utils
Section 50
//MathUtils (alternativa.utils.MathUtils)
package alternativa.utils {
import flash.geom.*;
public final class MathUtils {
public static const DEG30:Number = (Math.PI / 6);
public static const DEG10:Number = (Math.PI / 18);
public static const DEG360:Number = (Math.PI + Math.PI);
public static const DEG1:Number = toRad;
public static const DEG5:Number = (Math.PI / 36);
private static const toDeg:Number = (180 / Math.PI);
private static const toRad:Number = (Math.PI / 180);
public static const DEG180:Number = Math.PI;
public static const DEG60:Number = (Math.PI / 3);
public static const DEG45:Number = (Math.PI / 4);
public static const DEG90:Number = (Math.PI / 2);
public static function vectorCross(_arg1:Point, _arg2:Point):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function segmentDistance(_arg1:Point, _arg2:Point, _arg3:Point):Number{
var _local4:Number = (_arg2.x - _arg1.x);
var _local5:Number = (_arg2.y - _arg1.y);
var _local6:Number = (_arg3.x - _arg1.x);
var _local7:Number = (_arg3.y - _arg1.y);
return ((((_local4 * _local7) - (_local5 * _local6)) / Math.sqrt(((_local4 * _local4) + (_local5 * _local5)))));
}
public static function vectorAngleFast(_arg1:Point, _arg2:Point):Number{
var _local3:Number = vectorDot(_arg1, _arg2);
if (Math.abs(_local3) > 1){
_local3 = ((_local3)>0) ? 1 : -1;
};
return (Math.acos(_local3));
}
public static function randomAngle():Number{
return ((Math.random() * DEG360));
}
public static function vectorAngle(_arg1:Point, _arg2:Point):Number{
var _local3:Number = (_arg1.length * _arg2.length);
var _local4:Number = ((_local3)!=0) ? (vectorDot(_arg1, _arg2) / _local3) : 1;
return (Math.acos(_local4));
}
public static function limitAngle(_arg1:Number):Number{
var _local2:Number = (_arg1 % DEG360);
_local2 = ((_local2)>0) ? ((_local2)>DEG180) ? (_local2 - DEG360) : _local2 : ((_local2)<-(DEG180)) ? (_local2 + DEG360) : _local2;
return (_local2);
}
public static function random(_arg1:Number=NaN, _arg2:Number=NaN):Number{
if (isNaN(_arg1)){
return (Math.random());
};
if (isNaN(_arg2)){
return ((Math.random() * _arg1));
};
return (((Math.random() * (_arg2 - _arg1)) + _arg1));
}
public static function vectorDot(_arg1:Point, _arg2:Point):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function toDegree(_arg1:Number):Number{
return ((_arg1 * toDeg));
}
public static function deltaAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number = (_arg2 - _arg1);
if (_local3 > DEG180){
return ((_local3 - DEG360));
};
if (_local3 < -(DEG180)){
return ((_local3 + DEG360));
};
return (_local3);
}
public static function toRadian(_arg1:Number):Number{
return ((_arg1 * toRad));
}
public static function triangleHasPoint(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Point):Boolean{
if (vectorCross(_arg3.subtract(_arg1), _arg4.subtract(_arg1)) <= 0){
if (vectorCross(_arg2.subtract(_arg3), _arg4.subtract(_arg3)) <= 0){
if (vectorCross(_arg1.subtract(_arg2), _arg4.subtract(_arg2)) <= 0){
return (true);
};
return (false);
} else {
return (false);
};
//unresolved jump
};
return (false);
}
public static function equals(_arg1:Number, _arg2:Number, _arg3:Number=0):Boolean{
return (((((_arg2 - _arg1) <= _arg3)) && (((_arg2 - _arg1) >= -(_arg3)))));
}
}
}//package alternativa.utils
Section 51
//ObjectUtils (alternativa.utils.ObjectUtils)
package alternativa.utils {
import flash.utils.*;
public class ObjectUtils {
public static function getClassTree(_arg1, _arg2:Class=null):Array{
var _local3:Array = new Array();
var _local4:Class = Class(getDefinitionByName(getQualifiedClassName(_arg1)));
_arg2 = ((_arg2)==null) ? Object : _arg2;
while (_local4 != _arg2) {
_local3.push(_local4);
_local4 = Class(getDefinitionByName(getQualifiedSuperclassName(_local4)));
};
_local3.push(_local4);
return (_local3);
}
public static function getClass(_arg1):Class{
return (Class(getDefinitionByName(getQualifiedClassName(_arg1))));
}
public static function getClassName(_arg1):String{
var _local2:String = getQualifiedClassName(_arg1);
return (_local2.substring((_local2.indexOf("::") + 2)));
}
}
}//package alternativa.utils
Section 52
//TextUtils (alternativa.utils.TextUtils)
package alternativa.utils {
public final class TextUtils {
public static function insertVars(_arg1:String, ... _args):String{
var _local3:String = _arg1;
var _local4 = 1;
while (_local4 <= _args.length) {
_local3 = _local3.replace(("%" + _local4.toString()), _args[(_local4 - 1)]);
_local4++;
};
return (_local3);
}
}
}//package alternativa.utils
Section 53
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.0.0.0";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
}
}//package mx.core
Section 54
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 55
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 56
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(_arg1:Point):Point;
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(_arg1:String):void;
function set scaleX(_arg1:Number):void;
function set scaleY(_arg1:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(_arg1:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(_arg1:Point):Point;
function get height():Number;
function set blendMode(_arg1:String):void;
function get parent():DisplayObjectContainer;
function getBounds(_arg1:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(_arg1:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(_arg1:Number):void;
function set accessibilityProperties(_arg1:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(_arg1:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(_arg1:Number):void;
function set mask(_arg1:DisplayObject):void;
function getRect(_arg1:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(_arg1:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(_arg1:DisplayObject):Boolean;
function set opaqueBackground(_arg1:Object):void;
function set visible(_arg1:Boolean):void;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function get transform():Transform;
function set filters(_arg1:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(_arg1:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 57
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 58
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 59
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.0.0.0";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var _local2:String;
var _local4:String;
var _local5:Array;
var _local3:DisplayObject = _arg1;
while (_local3 != null) {
if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){
break;
};
_local4 = _local3.name;
if ((_local3 is IRepeaterClient)){
_local5 = IRepeaterClient(_local3).instanceIndices;
if (_local5){
_local4 = (_local4 + (("[" + _local5.join("][")) + "]"));
};
};
_local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2);
_local3 = _local3.parent;
};
return (_local2);
}
public static function createUniqueName(_arg1:Object):String{
if (!_arg1){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
var _local4:int = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 60
//Columns (temple.Columns)
package temple {
import flash.display.*;
import alternativa.types.*;
import alternativa.engine3d.materials.*;
import flash.geom.*;
public class Columns extends TextureLoader {
public var material:TextureMaterial;
private static const texture:Texture = new Texture(new Bmp().bitmapData);
private static const Bmp:Class = Columns_Bmp;
public function Columns(){
material = new TextureMaterial(texture, 1, false, true, BlendMode.NORMAL, -1, 0xFFFFFF);
super("Columns");
bindings = [new TextureMaterialBinding([material], "columns.jpg")];
loadingMessage = "Loading columns texture";
x = 218.616180419922;
y = 200.534332275391;
createVertex(14.7983093261719, -5.38613891601563, 0, "0");
createVertex(14.2725677490234, 6.65541076660156, 0, "1");
createVertex(-6.65541076660156, 14.2725677490234, 0, "3");
createVertex(-14.2725677490234, -6.65541076660156, 0, "5");
createVertex(14.2725677490234, 6.65541076660156, 231.719818115234, "9");
createVertex(20.2745056152344, -117.581253051758, 235.863433837891, "522");
createVertex(9.17008972167969, -129.699600219727, 235.863433837891, "523");
createVertex(19.4633941650391, 9.075927734375, 235.863433837891, "17");
createVertex(7.34504699707031, 20.1803588867188, 235.863433837891, "18");
createVertex(-9.075927734375, 19.4633941650391, 235.863433837891, "19");
createVertex(-20.1803588867188, 7.34504699707031, 235.863433837891, "20");
createVertex(-7.34504699707031, -20.1803588867188, 235.863433837891, "22");
createVertex(-369.034881591797, -104.850028991699, 0, "536");
createVertex(-348.850402832031, -95.4378662109375, 231.719818115234, "529");
createVertex(-348.850402832031, -95.4378662109375, 0, "530");
createVertex(-360.891967773438, -95.963623046875, 0, "531");
createVertex(-19.3692321777344, -119.312133789063, 235.863433837891, "513");
createVertex(-359.622711181641, -125.034484863281, 231.719818115234, "541");
createVertex(-339.438232421875, -115.622329711914, 0, "544");
createVertex(-339.438232421875, -115.622329711914, 231.719818115234, "545");
createVertex(-368.509124755859, -116.891586303711, 0, "539");
createVertex(-369.034881591797, 5.38618469238281, 231.719818115234, "36");
createVertex(-359.622711181641, -14.7982788085938, 231.719818115234, "38");
createVertex(-334.773162841797, 9.07595825195313, 235.863433837891, "41");
createVertex(-346.891510009766, 20.1803894042969, 235.863433837891, "42");
createVertex(-363.3125, 19.4634246826172, 235.863433837891, "43");
createVertex(-374.416931152344, 7.34507751464844, 235.863433837891, "44");
createVertex(-373.699951171875, -9.07589721679688, 235.863433837891, "45");
createVertex(-345.16064453125, -19.4633636474609, 235.863433837891, "47");
createVertex(-221.853744506836, 6.65544128417969, 0, "49");
createVertex(-334.773162841797, -101.160247802734, 235.863433837891, "554");
createVertex(-339.964019775391, -103.580764770508, 231.719818115234, "555");
createVertex(-250.924621582031, 5.38616943359375, 0, "52");
createVertex(-250.398880004883, -6.65538024902344, 0, "53");
createVertex(-374.416931152344, -102.891128540039, 235.863433837891, "566");
createVertex(-359.622711181641, -125.034484863281, 0, "540");
createVertex(-369.034881591797, -104.850028991699, 231.719818115234, "561");
createVertex(-363.3125, -90.7727813720703, 235.863433837891, "562");
createVertex(-368.509124755859, -116.891586303711, 231.719818115234, "565");
createVertex(-241.512451171875, -14.7982788085938, 231.719818115234, "62");
createVertex(-229.470901489258, -14.2725372314453, 231.719818115234, "63");
createVertex(-216.66291809082, 9.07595825195313, 235.863433837891, "65");
createVertex(-228.781265258789, 20.1803894042969, 235.863433837891, "66");
createVertex(-345.16064453125, -129.699569702148, 235.863433837891, "580");
createVertex(-243.47135925293, -20.1803283691406, 235.863433837891, "70");
createVertex(-227.050384521484, -19.4633636474609, 235.863433837891, "71");
createVertex(14.3667449951172, -213.817031860352, 0, "584");
createVertex(-347.581176757813, -124.508735656738, 231.719818115234, "547");
createVertex(-334.056182861328, -117.581230163574, 235.863433837891, "578");
createVertex(-132.288650512695, -6.65541076660156, 0, "77");
createVertex(-111.360679626465, -14.2725677490234, 0, "79");
createVertex(-103.743530273438, 6.6553955078125, 231.719818115234, "81");
createVertex(-14.1783752441406, -227.127853393555, 0, "594");
createVertex(-360.891967773438, -95.963623046875, 231.719818115234, "557");
createVertex(-132.814407348633, 5.38613891601563, 231.719818115234, "84");
createVertex(-6.56121826171875, -206.19987487793, 231.719818115234, "589");
createVertex(-361.581604003906, -130.416534423828, 235.863433837891, "574");
createVertex(5.48033142089844, -205.674133300781, 0, "585");
createVertex(14.8925018310547, -225.858581542969, 231.719818115234, "603");
createVertex(-138.196441650391, 7.34504699707031, 235.863433837891, "92");
createVertex(-137.4794921875, -9.075927734375, 235.863433837891, "93");
createVertex(-125.361137390137, -20.1803588867188, 235.863433837891, "94");
createVertex(-108.940155029297, -19.4634094238281, 235.863433837891, "95");
createVertex(14.3667144775391, -103.58080291748, 0, "97");
createVertex(-6.56124877929688, -95.9636459350586, 0, "99");
createVertex(6.74958801269531, -234.745010375977, 231.719818115234, "604");
createVertex(-14.1784057617188, -116.891616821289, 0, "101");
createVertex(-5.29196166992188, -235.270751953125, 0, "597");
createVertex(7.43922424316406, -200.292098999023, 235.863433837891, "615");
createVertex(14.8924713134766, -115.622352600098, 231.719818115234, "104");
createVertex(14.3667449951172, -213.817031860352, 231.719818115234, "609");
createVertex(19.5575866699219, -211.396514892578, 235.863433837891, "611");
createVertex(5.48033142089844, -205.674133300781, 231.719818115234, "613");
createVertex(-14.1783752441406, -227.127853393555, 231.719818115234, "622");
createVertex(-20.0861663818359, -213.127395629883, 235.863433837891, "623");
createVertex(-14.7041168212891, -215.086303710938, 231.719818115234, "624");
createVertex(19.5575561523438, -101.160278320313, 235.863433837891, "113");
createVertex(7.439208984375, -90.0558624267578, 235.863433837891, "114");
createVertex(-20.0861968994141, -102.891159057617, 235.863433837891, "116");
createVertex(-5.29196166992188, -235.270751953125, 231.719818115234, "629");
createVertex(-7.25088500976563, -130.416564941406, 235.863433837891, "118");
createVertex(-7.2508544921875, -240.652786254883, 235.863433837891, "631");
createVertex(-339.964019775391, -103.580764770508, 0, "121");
createVertex(20.2745361328125, -227.817489624023, 235.863433837891, "636");
createVertex(9.17012023925781, -239.935836791992, 235.863433837891, "637");
createVertex(-347.581176757813, -124.508735656738, 0, "127");
createVertex(-339.963989257813, -213.817001342773, 0, "641");
createVertex(-369.034851074219, -215.086273193359, 231.719818115234, "649");
createVertex(-346.891510009766, -90.0558319091797, 235.863433837891, "138");
createVertex(-368.509094238281, -227.127838134766, 231.719818115234, "652");
createVertex(-373.699951171875, -119.312103271484, 235.863433837891, "141");
createVertex(-359.622680664063, -235.270721435547, 231.719818115234, "655");
createVertex(14.8925018310547, -225.858581542969, 0, "144");
createVertex(-369.034851074219, -215.086273193359, 0, "650");
createVertex(-6.56121826171875, -206.19987487793, 0, "147");
createVertex(-14.7041168212891, -215.086303710938, 0, "148");
createVertex(6.74958801269531, -234.745010375977, 0, "151");
createVertex(-359.622680664063, -235.270721435547, 0, "656");
createVertex(-339.438232421875, -225.85856628418, 231.719818115234, "665");
createVertex(-339.963989257813, -213.817001342773, 231.719818115234, "666");
createVertex(-348.850402832031, -205.674118041992, 231.719818115234, "670");
createVertex(-360.891937255859, -206.199859619141, 231.719818115234, "674");
createVertex(-8.98175048828125, -201.009048461914, 235.863433837891, "163");
createVertex(-363.312469482422, -201.009033203125, 235.863433837891, "676");
createVertex(-19.3692016601563, -229.548370361328, 235.863433837891, "165");
createVertex(-339.438232421875, -225.85856628418, 0, "168");
createVertex(-348.850402832031, -205.674118041992, 0, "170");
createVertex(-360.891937255859, -206.199859619141, 0, "171");
createVertex(-368.509094238281, -227.127838134766, 0, "173");
createVertex(-347.581146240234, -234.744979858398, 0, "175");
createVertex(-334.056182861328, -227.817474365234, 235.863433837891, "692");
createVertex(-347.581146240234, -234.744979858398, 231.719818115234, "687");
createVertex(-334.773162841797, -211.396484375, 235.863433837891, "185");
createVertex(-346.891479492188, -200.292068481445, 235.863433837891, "186");
createVertex(5.48030090332031, -315.910369873047, 0, "699");
createVertex(-374.416900634766, -213.127365112305, 235.863433837891, "188");
createVertex(-373.699920654297, -229.548355102539, 235.863433837891, "189");
createVertex(-361.581573486328, -240.652770996094, 235.863433837891, "190");
createVertex(-345.160614013672, -239.935806274414, 235.863433837891, "191");
createVertex(14.8924713134766, -336.094818115234, 0, "192");
createVertex(14.3667297363281, -324.053253173828, 0, "193");
createVertex(-14.7041320800781, -325.322509765625, 0, "707");
createVertex(5.48030090332031, -315.910369873047, 231.719818115234, "700");
createVertex(-14.1783905029297, -337.364044189453, 0, "197");
createVertex(-5.29196166992188, -345.506958007813, 0, "198");
createVertex(-5.29196166992188, -345.506958007813, 231.719818115234, "206");
createVertex(-6.56124877929688, -316.436096191406, 0, "702");
createVertex(19.5575561523438, -321.632720947266, 235.863433837891, "209");
createVertex(7.43922424316406, -310.528289794922, 235.863433837891, "210");
createVertex(-19.3692321777344, -339.784576416016, 235.863433837891, "213");
createVertex(-7.25088500976563, -350.889038085938, 235.863433837891, "214");
createVertex(9.17010498046875, -350.172058105469, 235.863433837891, "215");
createVertex(-6.56124877929688, -316.436096191406, 231.719818115234, "728");
createVertex(-348.850402832031, -315.910308837891, 0, "218");
createVertex(-369.034851074219, -325.322479248047, 0, "220");
createVertex(-368.509094238281, -337.364013671875, 0, "221");
createVertex(14.3667297363281, -324.053253173828, 231.719818115234, "726");
createVertex(-339.438232421875, -336.094757080078, 231.719818115234, "224");
createVertex(-339.963989257813, -324.05322265625, 231.719818115234, "225");
createVertex(-360.891937255859, -316.436065673828, 231.719818115234, "227");
createVertex(-369.034851074219, -325.322479248047, 231.719818115234, "228");
createVertex(-8.98176574707031, -311.245269775391, 235.863433837891, "733");
createVertex(-359.622680664063, -345.506896972656, 231.719818115234, "230");
createVertex(-334.056182861328, -338.053680419922, 235.863433837891, "232");
createVertex(-20.086181640625, -323.363616943359, 235.863433837891, "737");
createVertex(-346.891479492188, -310.528259277344, 235.863433837891, "234");
createVertex(-363.312469482422, -311.245239257813, 235.863433837891, "235");
createVertex(14.8924713134766, -336.094818115234, 231.719818115234, "748");
createVertex(-14.7041320800781, -325.322509765625, 231.719818115234, "732");
createVertex(20.2745208740234, -338.0537109375, 235.863433837891, "750");
createVertex(-345.160614013672, -350.171997070313, 235.863433837891, "239");
createVertex(6.74957275390625, -344.981201171875, 231.719818115234, "744");
createVertex(-14.1783905029297, -337.364044189453, 231.719818115234, "736");
createVertex(-339.963989257813, -324.05322265625, 0, "755");
createVertex(5.38613891601563, 14.7983093261719, 231.719818115234, "244");
createVertex(5.38613891601563, 14.7983093261719, 0, "245");
createVertex(-6.65541076660156, 14.2725677490234, 231.719818115234, "247");
createVertex(-360.891937255859, -316.436065673828, 0, "761");
createVertex(-14.7983093261719, 5.38613891601563, 0, "251");
createVertex(-348.850402832031, -315.910308837891, 231.719818115234, "757");
createVertex(-5.38613891601563, -14.7983093261719, 0, "257");
createVertex(6.65541076660156, -14.2725677490234, 0, "258");
createVertex(14.7983093261719, -5.38613891601563, 231.719818115234, "260");
createVertex(-347.581146240234, -344.981170654297, 0, "776");
createVertex(-359.622680664063, -345.506896972656, 0, "770");
createVertex(-339.438232421875, -336.094757080078, 0, "772");
createVertex(6.74957275390625, -344.981201171875, 0, "719");
createVertex(-14.7983093261719, 5.38613891601563, 231.719818115234, "276");
createVertex(-334.773162841797, -321.632690429688, 235.863433837891, "782");
createVertex(-368.509094238281, -337.364013671875, 231.719818115234, "793");
createVertex(-374.416900634766, -323.363555908203, 235.863433837891, "794");
createVertex(-19.4633941650391, -9.075927734375, 235.863433837891, "285");
createVertex(-14.2725677490234, -6.65541076660156, 231.719818115234, "286");
createVertex(-5.38613891601563, -14.7983093261719, 231.719818115234, "290");
createVertex(6.65541076660156, -14.2725677490234, 231.719818115234, "291");
createVertex(20.1803588867188, -7.34504699707031, 235.863433837891, "293");
createVertex(-373.699920654297, -339.784545898438, 235.863433837891, "798");
createVertex(9.075927734375, -19.4633941650391, 235.863433837891, "295");
createVertex(-347.581146240234, -344.981170654297, 231.719818115234, "809");
createVertex(-361.581604003906, -350.888977050781, 235.863433837891, "802");
createVertex(-339.964019775391, 6.65544128417969, 0, "299");
createVertex(-348.850402832031, 14.79833984375, 0, "300");
createVertex(-360.891967773438, 14.2725982666016, 0, "303");
createVertex(-360.891967773438, 14.2725982666016, 231.719818115234, "304");
createVertex(-369.034881591797, 5.38618469238281, 0, "306");
createVertex(-368.509124755859, -6.65538024902344, 0, "311");
createVertex(-359.622711181641, -14.7982788085938, 0, "314");
createVertex(-339.438232421875, -5.3861083984375, 0, "316");
createVertex(-347.581176757813, -14.2725219726563, 0, "320");
createVertex(-339.438232421875, -5.3861083984375, 231.719818115234, "323");
createVertex(-339.964019775391, 6.65544128417969, 231.719818115234, "327");
createVertex(-348.850402832031, 14.79833984375, 231.719818115234, "331");
createVertex(-368.509124755859, -6.65538024902344, 231.719818115234, "337");
createVertex(-361.581604003906, -20.1803131103516, 235.863433837891, "346");
createVertex(-347.581176757813, -14.2725219726563, 231.719818115234, "348");
createVertex(-334.056182861328, -7.34501647949219, 235.863433837891, "350");
createVertex(-230.740173339844, 14.79833984375, 231.719818115234, "358");
createVertex(-230.740173339844, 14.79833984375, 0, "359");
createVertex(-242.781723022461, 14.2725982666016, 231.719818115234, "361");
createVertex(-242.781723022461, 14.2725982666016, 0, "362");
createVertex(-241.512451171875, -14.7982788085938, 0, "371");
createVertex(-221.328002929688, -5.3861083984375, 0, "373");
createVertex(-229.470901489258, -14.2725372314453, 0, "377");
createVertex(-221.328002929688, -5.3861083984375, 231.719818115234, "378");
createVertex(-221.853744506836, 6.65544128417969, 231.719818115234, "384");
createVertex(-245.202239990234, 19.4634246826172, 235.863433837891, "391");
createVertex(-256.306671142578, 7.34507751464844, 235.863433837891, "395");
createVertex(-250.924621582031, 5.38616943359375, 231.719818115234, "396");
createVertex(-250.398880004883, -6.65538024902344, 231.719818115234, "397");
createVertex(-255.589706420898, -9.07589721679688, 235.863433837891, "399");
createVertex(-215.945953369141, -7.34501647949219, 235.863433837891, "408");
createVertex(-103.743530273438, 6.6553955078125, 0, "413");
createVertex(-112.629943847656, 14.7983093261719, 0, "414");
createVertex(-124.671493530273, 14.2725524902344, 0, "417");
createVertex(-132.814407348633, 5.38613891601563, 0, "422");
createVertex(-123.402236938477, -14.7983093261719, 0, "426");
createVertex(-103.217781066895, -5.38615417480469, 0, "430");
createVertex(-111.360679626465, -14.2725677490234, 231.719818115234, "433");
createVertex(-103.217781066895, -5.38615417480469, 231.719818115234, "435");
createVertex(-112.629943847656, 14.7983093261719, 231.719818115234, "439");
createVertex(-98.5526962280273, 9.075927734375, 235.863433837891, "440");
createVertex(-110.671043395996, 20.1803436279297, 235.863433837891, "444");
createVertex(-127.092025756836, 19.4633941650391, 235.863433837891, "448");
createVertex(-124.671493530273, 14.2725524902344, 231.719818115234, "449");
createVertex(-132.288650512695, -6.65541076660156, 231.719818115234, "454");
createVertex(-123.402236938477, -14.7983093261719, 231.719818115234, "458");
createVertex(-97.8357391357422, -7.34504699707031, 235.863433837891, "464");
createVertex(5.48030090332031, -95.4378967285156, 0, "471");
createVertex(-14.7041473388672, -104.850067138672, 0, "477");
createVertex(-14.1784057617188, -116.891616821289, 231.719818115234, "481");
createVertex(-5.2919921875, -125.034515380859, 0, "483");
createVertex(-5.2919921875, -125.034515380859, 231.719818115234, "484");
createVertex(6.74955749511719, -124.508773803711, 0, "486");
createVertex(14.8924713134766, -115.622352600098, 0, "487");
createVertex(6.74955749511719, -124.508773803711, 231.719818115234, "490");
createVertex(14.3667144775391, -103.58080291748, 231.719818115234, "493");
createVertex(5.48030090332031, -95.4378967285156, 231.719818115234, "499");
createVertex(-6.56124877929688, -95.9636459350586, 231.719818115234, "503");
createVertex(-8.98178100585938, -90.7728118896484, 235.863433837891, "505");
createVertex(-14.7041473388672, -104.850067138672, 231.719818115234, "507");
createFace(["276", "20", "19", "247"], "0");
setUVsToFace(new Point(0.873783819549208, 0.188293687482537), new Point(0.869858741760254, 0.176257967948914), new Point(0.899293482303619, 0.176257967948914), "0");
createFace(["43", "42", "331", "304"], "1");
setUVsToFace(new Point(0.83783483505249, 0.576847195625305), new Point(0.8672696352005, 0.576847195625305), new Point(0.863344550132751, 0.588882982730865), "1");
createFace(["486", "490", "484", "483"], "2");
setUVsToFace(new Point(0.419417381286621, 0.351515769958496), new Point(0.834382593631744, 0.351515769958496), new Point(0.834382593631744, 0.373100370168686), "2");
createFace(["481", "101", "483", "484"], "3");
setUVsToFace(new Point(0.41596519947052, 0.598431944847107), new Point(0.00100000004749745, 0.598431944847107), new Point(0.00100000004749745, 0.576847195625305), "3");
createFace(["565", "539", "540", "541"], "4");
setUVsToFace(new Point(0.41596519947052, 0.798726379871368), new Point(0.00100000004749745, 0.798726379871368), new Point(0.00100000004749745, 0.777141749858856), "4");
createFace(["700", "210", "209", "726"], "5");
setUVsToFace(new Point(0.8417599165287, 0.113183186994546), new Point(0.83783483505249, 0.101147435605526), new Point(0.867269575595856, 0.101147450506687), "5");
createFace(["63", "377", "373", "378"], "6");
setUVsToFace(new Point(0.834382593631744, 0.69857919216156), new Point(0.419417381286621, 0.69857919216156), new Point(0.419417381286621, 0.676994562149048), "6");
createFace(["62", "70", "399", "397"], "7");
setUVsToFace(new Point(0.841759920120239, 0.939398229122162), new Point(0.83783483505249, 0.927362561225891), new Point(0.867269646952249, 0.92736261132254), "7");
createFace(["584", "609", "603", "144"], "8");
setUVsToFace(new Point(0.419417381286621, 0.376552611589432), new Point(0.834382593631744, 0.376552611589432), new Point(0.834382593631744, 0.398137241601944), "8");
createFace(["206", "214", "213", "736"], "9");
setUVsToFace(new Point(0.841759937351778, 0.0130357256072328), new Point(0.83783483505249, 0.00100000004749745), new Point(0.8672696352005, 0.00100001716054976), "9");
createFace(["798", "794", "228", "793"], "10");
setUVsToFace(new Point(0.83783483505249, 0.476699888706207), new Point(0.8672696352005, 0.476699888706207), new Point(0.863344490528107, 0.488735526800156), "10");
createFace(["193", "726", "748", "192"], "11");
setUVsToFace(new Point(0.00100000004749745, 0.101147435605526), new Point(0.41596519947052, 0.101147435605526), new Point(0.41596519947052, 0.12273208796978), "11");
createFace(["503", "99", "477", "507"], "12");
setUVsToFace(new Point(0.834382593631744, 0.448210865259171), new Point(0.419417381286621, 0.448210865259171), new Point(0.419417381286621, 0.426626235246658), "12");
createFace(["244", "18", "17", "9"], "13");
setUVsToFace(new Point(0.873783767223358, 0.388588279485703), new Point(0.869858741760254, 0.376552611589432), new Point(0.899293553659764, 0.376552661686081), "13");
createFace(["52", "396", "361", "362"], "14");
setUVsToFace(new Point(0.00100000004749745, 0.651957809925079), new Point(0.41596519947052, 0.651957809925079), new Point(0.41596519947052, 0.673542380332947), "14");
createFace(["523", "118", "484", "490"], "15");
setUVsToFace(new Point(0.83783483505249, 0.802178561687469), new Point(0.867269559688264, 0.802178528254594), new Point(0.863344490528107, 0.814214289188385), "15");
createFace(["391", "66", "358", "361"], "16");
setUVsToFace(new Point(0.869858801364899, 0.526773631572723), new Point(0.899293601512909, 0.526773631572723), new Point(0.895368456840515, 0.538809299468994), "16");
createFace(["439", "414", "417", "449"], "17");
setUVsToFace(new Point(0.41596519947052, 0.473247706890106), new Point(0.00100000004749745, 0.473247706890106), new Point(0.00100000004749745, 0.451663047075272), "17");
createFace(["224", "772", "755", "225"], "18");
setUVsToFace(new Point(0.834382593631744, 0.973963260650635), new Point(0.419417381286621, 0.973963260650635), new Point(0.419417381286621, 0.952399253845215), "18");
createFace(["384", "49", "359", "358"], "19");
setUVsToFace(new Point(0.41596519947052, 0.197842627763748), new Point(0.00100000004749745, 0.197842627763748), new Point(0.00100000004749745, 0.176257967948914), "19");
createFace(["81", "413", "414", "439"], "20");
setUVsToFace(new Point(0.41596519947052, 0.748652815818787), new Point(0.00100000004749745, 0.748652815818787), new Point(0.00100000004749745, 0.727068185806274), "20");
createFace(["77", "454", "84", "422"], "21");
setUVsToFace(new Point(0.419417381286621, 0.927362561225891), new Point(0.834382593631744, 0.927362561225891), new Point(0.834382593631744, 0.948926508426666), "21");
createFace(["702", "728", "700", "699"], "22");
setUVsToFace(new Point(0.00100000004749745, 0.977436006069183), new Point(0.41596519947052, 0.977436006069183), new Point(0.41596519947052, 0.999000012874603), "22");
createFace(["175", "687", "655", "656"], "23");
setUVsToFace(new Point(0.00100000004749745, 0.827215373516083), new Point(0.41596519947052, 0.827215373516083), new Point(0.41596519947052, 0.848800003528595), "23");
createFace(["530", "529", "555", "121"], "24");
setUVsToFace(new Point(0.419417381286621, 0.902325749397278), new Point(0.834382593631744, 0.902325749397278), new Point(0.834382593631744, 0.923910319805145), "24");
createFace(["323", "316", "299", "327"], "25");
setUVsToFace(new Point(0.41596519947052, 0.147768929600716), new Point(0.00100000004749745, 0.147768929600716), new Point(0.00100000004749745, 0.126184299588203), "25");
createFace(["218", "757", "225", "755"], "26");
setUVsToFace(new Point(0.00100000004749745, 0.30144214630127), new Point(0.41596519947052, 0.30144214630127), new Point(0.41596519947052, 0.323026746511459), "26");
createFace(["350", "47", "348", "323"], "27");
setUVsToFace(new Point(0.83783483505249, 0.226331651210785), new Point(0.8672696352005, 0.226331636309624), new Point(0.863344609737396, 0.238367334008217), "27");
createFace(["458", "426", "79", "433"], "28");
setUVsToFace(new Point(0.834382593631744, 0.172805786132813), new Point(0.419417381286621, 0.172805786132813), new Point(0.419417381286621, 0.151221141219139), "28");
createFace(["371", "62", "397", "53"], "29");
setUVsToFace(new Point(0.00100000004749745, 0.201294809579849), new Point(0.41596519947052, 0.201294809579849), new Point(0.41596519947052, 0.222879439592361), "29");
createFace(["545", "544", "121", "555"], "30");
setUVsToFace(new Point(0.834382593631744, 0.0225846543908119), new Point(0.419417381286621, 0.0225846543908119), new Point(0.419417381286621, 0.00100000004749745), "30");
createFace(["71", "70", "62", "63"], "31");
setUVsToFace(new Point(0.869858801364899, 0.451663047075272), new Point(0.899293526000596, 0.451663013642475), new Point(0.895368456840515, 0.463698744773865), "31");
createFace(["168", "665", "687", "175"], "32");
setUVsToFace(new Point(0.00100000004749745, 0.326478958129883), new Point(0.41596519947052, 0.326478958129883), new Point(0.41596519947052, 0.348063588142395), "32");
createFace(["185", "692", "665", "666"], "33");
setUVsToFace(new Point(0.83783483505249, 0.426626265048981), new Point(0.8672696352005, 0.426626235246658), new Point(0.863344490528107, 0.438661932945251), "33");
createFace(["65", "408", "378", "384"], "34");
setUVsToFace(new Point(0.83783483505249, 0.852252244949341), new Point(0.867269575595856, 0.852252185344696), new Point(0.863344490528107, 0.864287853240967), "34");
createFace(["227", "761", "220", "228"], "35");
setUVsToFace(new Point(0.834382593631744, 0.297989934682846), new Point(0.419417381286621, 0.297989934682846), new Point(0.419417381286621, 0.276405304670334), "35");
createFace(["101", "481", "507", "477"], "36");
setUVsToFace(new Point(0.419417381286621, 0.476699888706207), new Point(0.834382593631744, 0.476699888706207), new Point(0.834382593631744, 0.498284548521042), "36");
createFace(["539", "565", "561", "536"], "37");
setUVsToFace(new Point(0.419417381286621, 0.101147435605526), new Point(0.834382593631744, 0.101147435605526), new Point(0.834382593631744, 0.122732080519199), "37");
createFace(["224", "232", "239", "809"], "38");
setUVsToFace(new Point(0.84175994458488, 0.764140643911145), new Point(0.83783483505249, 0.752104997634888), new Point(0.867269575595856, 0.752105057239532), "38");
createFace(["165", "623", "624", "622"], "39");
setUVsToFace(new Point(0.869858741760254, 0.626920938491821), new Point(0.899293466395951, 0.626920905059107), new Point(0.89536839723587, 0.638956606388092), "39");
createFace(["81", "440", "464", "435"], "40");
setUVsToFace(new Point(0.873783826828003, 0.0881462320685387), new Point(0.869858741760254, 0.0761105790734291), new Point(0.899293464987335, 0.0761105866197236), "40");
createFace(["493", "97", "471", "499"], "41");
setUVsToFace(new Point(0.834382593631744, 0.27295309305191), new Point(0.419417381286621, 0.27295309305191), new Point(0.419417381286621, 0.251368492841721), "41");
createFace(["649", "188", "676", "674"], "42");
setUVsToFace(new Point(0.873783826828003, 0.163256824016571), new Point(0.869858741760254, 0.151221141219139), new Point(0.899293454529835, 0.151221147893369), "42");
createFace(["547", "127", "544", "545"], "43");
setUVsToFace(new Point(0.41596519947052, 0.0726583749055862), new Point(0.00100000004749745, 0.0726583749055862), new Point(0.00100000004749745, 0.0510737150907516), "43");
createFace(["513", "116", "507", "481"], "44");
setUVsToFace(new Point(0.869858801364899, 0.576847195625305), new Point(0.899293541908264, 0.576847195625305), new Point(0.895368456840515, 0.588882982730865), "44");
createFace(["652", "173", "656", "655"], "45");
setUVsToFace(new Point(0.834382593631744, 0.898873507976532), new Point(0.419417381286621, 0.898873507976532), new Point(0.419417381286621, 0.877288937568665), "45");
createFace(["138", "554", "555", "529"], "46");
setUVsToFace(new Point(0.83783483505249, 0.601884186267853), new Point(0.867269575595856, 0.601884126663208), new Point(0.863344490528107, 0.613919794559479), "46");
createFace(["290", "22", "285", "286"], "47");
setUVsToFace(new Point(0.873783879153853, 0.438661969681488), new Point(0.869858801364899, 0.426626235246658), new Point(0.899293541908264, 0.426626235246658), "47");
createFace(["772", "224", "809", "776"], "48");
setUVsToFace(new Point(0.419417381286621, 0.226331666111946), new Point(0.834382593631744, 0.226331666111946), new Point(0.834382593631744, 0.247916281223297), "48");
createFace(["454", "93", "92", "84"], "49");
setUVsToFace(new Point(0.841759920120239, 0.689030289649963), new Point(0.83783483505249, 0.676994562149048), new Point(0.867269556870993, 0.67699461067447), "49");
createFace(["604", "151", "144", "603"], "50");
setUVsToFace(new Point(0.834382593631744, 0.147768929600716), new Point(0.419417381286621, 0.147768929600716), new Point(0.419417381286621, 0.126184299588203), "50");
createFace(["503", "505", "114", "499"], "51");
setUVsToFace(new Point(0.873783826828003, 0.0631093829870224), new Point(0.869858741760254, 0.0510737150907516), new Point(0.899293491690819, 0.0510737313274789), "51");
createFace(["422", "84", "449", "417"], "52");
setUVsToFace(new Point(0.00100000004749745, 0.226331651210785), new Point(0.41596519947052, 0.226331651210785), new Point(0.41596519947052, 0.247916281223297), "52");
createFace(["42", "41", "327", "331"], "53");
setUVsToFace(new Point(0.83783483505249, 0.301442176103592), new Point(0.867269648090844, 0.301442170916012), new Point(0.863344490528107, 0.31347781419754), "53");
createFace(["291", "258", "0", "260"], "54");
setUVsToFace(new Point(0.834382593631744, 0.222879439592361), new Point(0.419417381286621, 0.222879439592361), new Point(0.419417381286621, 0.201294809579849), "54");
createFace(["189", "188", "649", "652"], "55");
setUVsToFace(new Point(0.83783483505249, 0.401589423418045), new Point(0.867269630608626, 0.40158940204533), new Point(0.863344490528107, 0.413625091314316), "55");
createFace(["316", "323", "348", "320"], "56");
setUVsToFace(new Point(0.00100000004749745, 0.00100000004749745), new Point(0.41596519947052, 0.00100000004749745), new Point(0.41596519947052, 0.0225846581161022), "56");
createFace(["629", "597", "151", "604"], "57");
setUVsToFace(new Point(0.834382593631744, 0.62346875667572), new Point(0.419417381286621, 0.62346875667572), new Point(0.419417381286621, 0.601884126663208), "57");
createFace(["670", "186", "185", "666"], "58");
setUVsToFace(new Point(0.873783858780458, 0.0380725672973022), new Point(0.869858801364899, 0.0260368604212999), new Point(0.899293482303619, 0.0260368790477514), "58");
createFace(["257", "290", "286", "5"], "59");
setUVsToFace(new Point(0.419417381286621, 0.551810443401337), new Point(0.834382593631744, 0.551810443401337), new Point(0.834382593631744, 0.573395073413849), "59");
createFace(["300", "331", "327", "299"], "60");
setUVsToFace(new Point(0.00100000004749745, 0.927362561225891), new Point(0.41596519947052, 0.927362561225891), new Point(0.41596519947052, 0.948947072029114), "60");
createFace(["327", "41", "350", "323"], "61");
setUVsToFace(new Point(0.841759862044941, 0.163256856240823), new Point(0.83783483505249, 0.151221141219139), new Point(0.8672696352005, 0.151221171021461), "61");
createFace(["665", "168", "641", "666"], "62");
setUVsToFace(new Point(0.41596519947052, 0.0976952314376831), new Point(0.00100000004749745, 0.0976952314376831), new Point(0.00100000004749745, 0.0761105790734291), "62");
createFace(["228", "220", "221", "793"], "63");
setUVsToFace(new Point(0.41596519947052, 0.823763191699982), new Point(0.00100000004749745, 0.823763191699982), new Point(0.00100000004749745, 0.802178561687469), "63");
createFace(["490", "486", "487", "104"], "64");
setUVsToFace(new Point(0.41596519947052, 0.62346875667572), new Point(0.00100000004749745, 0.62346875667572), new Point(0.00100000004749745, 0.601884126663208), "64");
createFace(["230", "802", "798", "793"], "65");
setUVsToFace(new Point(0.841759965610286, 0.188293717058632), new Point(0.83783483505249, 0.176257967948914), new Point(0.867269515991211, 0.176257997751236), "65");
createFace(["5", "286", "276", "251"], "66");
setUVsToFace(new Point(0.00100000004749745, 0.351515769958496), new Point(0.41596519947052, 0.351515769958496), new Point(0.41596519947052, 0.373100370168686), "66");
createFace(["114", "113", "493", "499"], "67");
setUVsToFace(new Point(0.869858741760254, 0.727068185806274), new Point(0.899293482303619, 0.727068185806274), new Point(0.89536839723587, 0.7391037940979), "67");
createFace(["230", "770", "776", "809"], "68");
setUVsToFace(new Point(0.834382593631744, 0.998979687690735), new Point(0.419417381286621, 0.998979687690735), new Point(0.419417381286621, 0.977415680885315), "68");
createFace(["589", "163", "615", "613"], "69");
setUVsToFace(new Point(0.873783814288862, 0.8392510423224), new Point(0.869858741760254, 0.827215373516083), new Point(0.899293482303619, 0.827215373516083), "69");
createFace(["444", "440", "81", "439"], "70");
setUVsToFace(new Point(0.869858801364899, 0.476699888706207), new Point(0.899293515820062, 0.476699846344456), new Point(0.895368456840515, 0.488735526800156), "70");
createFace(["674", "171", "650", "649"], "71");
setUVsToFace(new Point(0.834382593631744, 0.323026746511459), new Point(0.419417381286621, 0.323026746511459), new Point(0.419417381286621, 0.30144214630127), "71");
createFace(["585", "613", "609", "584"], "320");
setUVsToFace(new Point(0.419417381286621, 0.626920938491821), new Point(0.834382593631744, 0.626920938491821), new Point(0.834382593631744, 0.648505568504333), "320");
createFace(["770", "230", "793", "221"], "73");
setUVsToFace(new Point(0.419417381286621, 0.852252185344696), new Point(0.834382593631744, 0.852252185344696), new Point(0.834382593631744, 0.873836696147919), "73");
createFace(["676", "186", "670", "674"], "74");
setUVsToFace(new Point(0.83783483505249, 0.351515769958496), new Point(0.867269542933105, 0.351515740104131), new Point(0.863344490528107, 0.363551437854767), "74");
createFace(["624", "623", "163", "589"], "75");
setUVsToFace(new Point(0.873783881512834, 0.0130356754229542), new Point(0.869858801364899, 0.00100000004749745), new Point(0.899293601512909, 0.00100000435486436), "75");
createFace(["732", "707", "197", "736"], "76");
setUVsToFace(new Point(0.41596519947052, 0.873836755752563), new Point(0.00100000004749745, 0.873836755752563), new Point(0.00100000004749745, 0.852252185344696), "76");
createFace(["750", "215", "744", "748"], "77");
setUVsToFace(new Point(0.83783483505249, 0.326478987932205), new Point(0.867269629630039, 0.326478957156094), new Point(0.863344490528107, 0.338514655828476), "77");
createFace(["464", "95", "433", "435"], "78");
setUVsToFace(new Point(0.869858801364899, 0.551810443401337), new Point(0.899293541908264, 0.551810443401337), new Point(0.895368456840515, 0.563846051692963), "78");
createFace(["141", "566", "561", "565"], "79");
setUVsToFace(new Point(0.869858801364899, 0.201294809579849), new Point(0.899293506953093, 0.201294808046102), new Point(0.895368456840515, 0.21333047747612), "79");
createFace(["493", "113", "522", "104"], "72");
setUVsToFace(new Point(0.873783826828003, 0.689030289649963), new Point(0.869858741760254, 0.676994562149048), new Point(0.899293463578702, 0.676994610674467), "72");
createFace(["449", "448", "444", "439"], "81");
setUVsToFace(new Point(0.841759920120239, 0.964434921741486), new Point(0.83783483505249, 0.952399253845215), new Point(0.86726957052061, 0.952399303127348), "81");
createFace(["99", "503", "499", "471"], "82");
setUVsToFace(new Point(0.00100000004749745, 0.276405304670334), new Point(0.41596519947052, 0.276405304670334), new Point(0.41596519947052, 0.297989964485168), "82");
createFace(["44", "43", "304", "36"], "83");
setUVsToFace(new Point(0.83783483505249, 0.376552611589432), new Point(0.8672696352005, 0.376552611589432), new Point(0.863344550132751, 0.388588279485703), "83");
createFace(["235", "234", "757", "227"], "84");
setUVsToFace(new Point(0.83783483505249, 0.551810443401337), new Point(0.867269623782376, 0.551810426157758), new Point(0.863344490528107, 0.563846051692963), "84");
createFace(["260", "293", "295", "291"], "85");
setUVsToFace(new Point(0.873783826828003, 0.363551437854767), new Point(0.869858801364899, 0.351515769958496), new Point(0.899293613264409, 0.351515820055145), "85");
createFace(["522", "523", "490", "104"], "86");
setUVsToFace(new Point(0.869858741760254, 0.752104997634888), new Point(0.899293482303619, 0.752104997634888), new Point(0.89536839723587, 0.764140605926514), "86");
createFace(["736", "197", "198", "206"], "87");
setUVsToFace(new Point(0.41596519947052, 0.172805786132813), new Point(0.00100000004749745, 0.172805786132813), new Point(0.00100000004749745, 0.151221141219139), "87");
createFace(["45", "44", "36", "337"], "80");
setUVsToFace(new Point(0.83783483505249, 0.902325749397278), new Point(0.867269522026678, 0.902325726510645), new Point(0.863344490528107, 0.914361417293549), "80");
createFace(["507", "116", "505", "503"], "89");
setUVsToFace(new Point(0.873783767223358, 0.288440972566605), new Point(0.869858741760254, 0.276405304670334), new Point(0.899293548935945, 0.276405313190969), "89");
createFace(["378", "373", "49", "384"], "90");
setUVsToFace(new Point(0.834382593631744, 0.548358261585236), new Point(0.419417381286621, 0.548358261585236), new Point(0.419417381286621, 0.526773631572723), "90");
createFace(["260", "0", "1", "9"], "91");
setUVsToFace(new Point(0.41596519947052, 0.548358261585236), new Point(0.00100000004749745, 0.548358261585236), new Point(0.00100000004749745, 0.526773631572723), "91");
createFace(["670", "170", "171", "674"], "92");
setUVsToFace(new Point(0.834382593631744, 0.823763191699982), new Point(0.419417381286621, 0.823763191699982), new Point(0.419417381286621, 0.802178561687469), "92");
createFace(["399", "395", "396", "397"], "93");
setUVsToFace(new Point(0.83783483505249, 0.626920998096466), new Point(0.867269559688188, 0.626920964663917), new Point(0.863344490528107, 0.638956606388092), "93");
createFace(["358", "359", "362", "361"], "94");
setUVsToFace(new Point(0.834382593631744, 0.473247706890106), new Point(0.419417381286621, 0.473247706890106), new Point(0.419417381286621, 0.451663047075272), "94");
createFace(["215", "214", "206", "744"], "95");
setUVsToFace(new Point(0.83783483505249, 0.0761105865240097), new Point(0.867269623782372, 0.0761105794407301), new Point(0.863344490528107, 0.0881462916731834), "95");
createFace(["580", "574", "541", "547"], "96");
setUVsToFace(new Point(0.869858741760254, 0.777141749858856), new Point(0.899293475511937, 0.777141740618917), new Point(0.89536839723587, 0.789177417755127), "96");
createFace(["557", "562", "138", "529"], "97");
setUVsToFace(new Point(0.841759979724884, 0.263404130935669), new Point(0.83783483505249, 0.251368492841721), new Point(0.86726954694254, 0.251368540816179), "97");
createFace(["782", "232", "224", "225"], "98");
setUVsToFace(new Point(0.83783483505249, 0.451663076877594), new Point(0.8672696352005, 0.451663047075272), new Point(0.863344490528107, 0.463698744773865), "98");
createFace(["396", "395", "391", "361"], "99");
setUVsToFace(new Point(0.841759920120239, 0.513772368431091), new Point(0.83783483505249, 0.501736760139465), new Point(0.867269646952249, 0.501736810235866), "99");
createFace(["578", "580", "547", "545"], "100");
setUVsToFace(new Point(0.83783483505249, 0.201294809579849), new Point(0.867269639486206, 0.201294769929975), new Point(0.863344609737396, 0.21333047747612), "100");
createFace(["622", "594", "597", "629"], "101");
setUVsToFace(new Point(0.41596519947052, 0.648505568504333), new Point(0.00100000004749745, 0.648505568504333), new Point(0.00100000004749745, 0.626920938491821), "101");
createFace(["589", "147", "148", "624"], "102");
setUVsToFace(new Point(0.834382593631744, 0.197842627763748), new Point(0.419417381286621, 0.197842627763748), new Point(0.419417381286621, 0.176257967948914), "102");
createFace(["358", "66", "65", "384"], "103");
setUVsToFace(new Point(0.873783835445624, 0.138219989319413), new Point(0.869858741760254, 0.126184299588203), new Point(0.899293541908264, 0.126184299588203), "103");
createFace(["285", "20", "276", "286"], "104");
setUVsToFace(new Point(0.869858801364899, 0.401589393615723), new Point(0.899293526000596, 0.401589360183008), new Point(0.895368456840515, 0.413625061511993), "104");
createFace(["665", "692", "191", "687"], "105");
setUVsToFace(new Point(0.873783806461387, 0.113183108396028), new Point(0.869858741760254, 0.101147435605526), new Point(0.899293482303619, 0.101147435605526), "105");
createFace(["594", "622", "624", "148"], "106");
setUVsToFace(new Point(0.00100000004749745, 0.476699888706207), new Point(0.41596519947052, 0.476699888706207), new Point(0.41596519947052, 0.498284488916397), "106");
createFace(["3", "247", "244", "245"], "107");
setUVsToFace(new Point(0.419417381286621, 0.326478958129883), new Point(0.834382593631744, 0.326478958129883), new Point(0.834382593631744, 0.348063558340073), "107");
createFace(["636", "637", "604", "603"], "108");
setUVsToFace(new Point(0.869858682155609, 0.326478958129883), new Point(0.899293450419606, 0.326478947743314), new Point(0.89536839723587, 0.338514626026154), "108");
createFace(["251", "276", "247", "3"], "109");
setUVsToFace(new Point(0.00100000004749745, 0.376552611589432), new Point(0.41596519947052, 0.376552611589432), new Point(0.41596519947052, 0.398137211799622), "109");
createFace(["604", "637", "631", "629"], "110");
setUVsToFace(new Point(0.873783826828003, 0.914361476898193), new Point(0.869858741760254, 0.902325749397278), new Point(0.899293465204085, 0.902325750638307), "110");
createFace(["228", "794", "235", "227"], "111");
setUVsToFace(new Point(0.84175994458488, 0.714067079858672), new Point(0.83783483505249, 0.702031373977661), new Point(0.867269575595856, 0.702031433582306), "111");
createFace(["655", "190", "189", "652"], "112");
setUVsToFace(new Point(0.873783886432648, 0.613919794559479), new Point(0.869858741760254, 0.601884126663208), new Point(0.899293425282855, 0.601884154091121), "112");
createFace(["728", "702", "707", "732"], "113");
setUVsToFace(new Point(0.834382593631744, 0.748652815818787), new Point(0.419417381286621, 0.748652815818787), new Point(0.419417381286621, 0.727068185806274), "113");
createFace(["413", "81", "435", "430"], "114");
setUVsToFace(new Point(0.00100000004749745, 0.251368463039398), new Point(0.41596519947052, 0.251368463039398), new Point(0.41596519947052, 0.27295309305191), "114");
createFace(["378", "408", "71", "63"], "115");
setUVsToFace(new Point(0.841759979724884, 0.889324605464935), new Point(0.83783483505249, 0.877288937568665), new Point(0.867269565670097, 0.877288987665313), "115");
createFace(["239", "802", "230", "809"], "116");
setUVsToFace(new Point(0.83783483505249, 0.0260368920862675), new Point(0.8672696352005, 0.0260368604212999), new Point(0.863344490528107, 0.0380725711584091), "116");
createFace(["433", "79", "430", "435"], "117");
setUVsToFace(new Point(0.41596519947052, 0.723616063594818), new Point(0.00100000004749745, 0.723616063594818), new Point(0.00100000004749745, 0.702031373977661), "117");
createFace(["484", "118", "513", "481"], "118");
setUVsToFace(new Point(0.841759920120239, 0.66399347782135), new Point(0.83783483505249, 0.651957809925079), new Point(0.867269593143387, 0.6519577467641), "118");
createFace(["454", "77", "426", "458"], "119");
setUVsToFace(new Point(0.41596519947052, 0.7736896276474), new Point(0.00100000004749745, 0.7736896276474), new Point(0.00100000004749745, 0.752104997634888), "119");
createFace(["17", "293", "260", "9"], "120");
setUVsToFace(new Point(0.869858741760254, 0.501736760139465), new Point(0.899293466395951, 0.501736726706751), new Point(0.89536839723587, 0.513772428035736), "120");
createFace(["529", "530", "531", "557"], "121");
setUVsToFace(new Point(0.41596519947052, 0.0476215109229088), new Point(0.00100000004749745, 0.0476215109229088), new Point(0.00100000004749745, 0.0260368604212999), "121");
createFace(["732", "737", "733", "728"], "122");
setUVsToFace(new Point(0.873783904223872, 0.889324685182662), new Point(0.869858741760254, 0.877288937568665), new Point(0.899293482303619, 0.877288937568665), "122");
createFace(["38", "314", "320", "348"], "123");
setUVsToFace(new Point(0.834382593631744, 0.848800003528595), new Point(0.419417381286621, 0.848800003528595), new Point(0.419417381286621, 0.827215373516083), "123");
createFace(["557", "531", "536", "561"], "124");
setUVsToFace(new Point(0.41596519947052, 0.69857919216156), new Point(0.00100000004749745, 0.69857919216156), new Point(0.00100000004749745, 0.676994562149048), "124");
createFace(["613", "585", "147", "589"], "125");
setUVsToFace(new Point(0.41596519947052, 0.523321390151978), new Point(0.00100000004749745, 0.523321390151978), new Point(0.00100000004749745, 0.501736760139465), "125");
createFace(["609", "611", "636", "603"], "126");
setUVsToFace(new Point(0.873783828993183, 0.663993513405137), new Point(0.869858801364899, 0.651957809925079), new Point(0.899293601512909, 0.651957809925079), "126");
createFace(["666", "641", "170", "670"], "127");
setUVsToFace(new Point(0.41596519947052, 0.923910319805145), new Point(0.00100000004749745, 0.923910319805145), new Point(0.00100000004749745, 0.902325749397278), "127");
createFace(["433", "95", "94", "458"], "130");
setUVsToFace(new Point(0.841759903940757, 0.989451230280467), new Point(0.83783483505249, 0.977415561676025), new Point(0.867269575595856, 0.977415561676025), "130");
createFace(["631", "165", "622", "629"], "131");
setUVsToFace(new Point(0.869858741760254, 0.927362561225891), new Point(0.899293482303619, 0.927362561225891), new Point(0.89536839723587, 0.939398229122162), "131");
createFace(["19", "18", "244", "247"], "132");
setUVsToFace(new Point(0.869858741760254, 0.30144214630127), new Point(0.899293482303619, 0.30144214630127), new Point(0.89536839723587, 0.313477784395218), "132");
createFace(["304", "303", "306", "36"], "133");
setUVsToFace(new Point(0.834382593631744, 0.423174053430557), new Point(0.419417381286621, 0.423174053430557), new Point(0.419417381286621, 0.401589393615723), "133");
createFace(["348", "47", "346", "38"], "134");
setUVsToFace(new Point(0.873783826828003, 0.989451229572296), new Point(0.869858741760254, 0.977415561676025), new Point(0.899293473507252, 0.977415610751801), "134");
createFace(["97", "493", "104", "487"], "135");
setUVsToFace(new Point(0.00100000004749745, 0.401589393615723), new Point(0.41596519947052, 0.401589393615723), new Point(0.41596519947052, 0.423174023628235), "135");
createFace(["757", "234", "782", "225"], "136");
setUVsToFace(new Point(0.84175992868853, 0.739103875790936), new Point(0.83783483505249, 0.727068185806274), new Point(0.867269515991211, 0.727068185806274), "136");
createFace(["127", "547", "541", "540"], "137");
setUVsToFace(new Point(0.00100000004749745, 0.877288937568665), new Point(0.41596519947052, 0.877288937568665), new Point(0.41596519947052, 0.898873567581177), "137");
createFace(["191", "190", "655", "687"], "138");
setUVsToFace(new Point(0.869858741760254, 0.702031433582306), new Point(0.899293482303619, 0.702031373977661), new Point(0.89536839723587, 0.714067101478577), "138");
createFace(["736", "213", "737", "732"], "139");
setUVsToFace(new Point(0.873783826828003, 0.964434921741486), new Point(0.869858741760254, 0.952399253845215), new Point(0.899293475132712, 0.95239925563682), "139");
createFace(["303", "304", "331", "300"], "140");
setUVsToFace(new Point(0.419417381286621, 0.0510737150907516), new Point(0.834382593631744, 0.0510737150907516), new Point(0.834382593631744, 0.0726583749055862), "140");
createFace(["761", "227", "757", "218"], "141");
setUVsToFace(new Point(0.419417381286621, 0.777141749858856), new Point(0.834382593631744, 0.777141749858856), new Point(0.834382593631744, 0.798726379871368), "141");
createFace(["346", "45", "337", "38"], "142");
setUVsToFace(new Point(0.869858741760254, 0.802178561687469), new Point(0.899293481390352, 0.80217855422049), new Point(0.89536839723587, 0.81421422958374), "142");
createFace(["209", "750", "748", "726"], "143");
setUVsToFace(new Point(0.83783483505249, 0.526773631572723), new Point(0.8672696352005, 0.526773631572723), new Point(0.863344550132751, 0.538809299468994), "143");
createFace(["615", "611", "609", "613"], "144");
setUVsToFace(new Point(0.869858741760254, 0.852252185344696), new Point(0.899293582819519, 0.852252154430288), new Point(0.89536839723587, 0.864287793636322), "144");
createFace(["192", "748", "744", "719"], "145");
setUVsToFace(new Point(0.00100000004749745, 0.952399253845215), new Point(0.41596519947052, 0.952399253845215), new Point(0.41596519947052, 0.973983764648438), "145");
createFace(["726", "193", "699", "700"], "148");
setUVsToFace(new Point(0.834382593631744, 0.77368950843811), new Point(0.419417381286621, 0.77368950843811), new Point(0.419417381286621, 0.752104997634888), "148");
createFace(["541", "574", "141", "565"], "149");
setUVsToFace(new Point(0.873783899300306, 0.263404114421851), new Point(0.869858801364899, 0.251368492841721), new Point(0.899293541908264, 0.251368492841721), "149");
createFace(["649", "650", "173", "652"], "88");
setUVsToFace(new Point(0.834382593631744, 0.0476215109229088), new Point(0.419417381286621, 0.0476215109229088), new Point(0.419417381286621, 0.0260368604212999), "88");
createFace(["9", "1", "245", "244"], "152");
setUVsToFace(new Point(0.41596519947052, 0.448210835456848), new Point(0.00100000004749745, 0.448210835456848), new Point(0.00100000004749745, 0.426626235246658), "152");
createFace(["396", "52", "53", "397"], "153");
setUVsToFace(new Point(0.41596519947052, 0.573395073413849), new Point(0.00100000004749745, 0.573395073413849), new Point(0.00100000004749745, 0.551810443401337), "153");
createFace(["314", "38", "337", "311"], "154");
setUVsToFace(new Point(0.419417381286621, 0.702031373977661), new Point(0.834382593631744, 0.702031373977661), new Point(0.834382593631744, 0.723616063594818), "154");
createFace(["555", "554", "578", "545"], "155");
setUVsToFace(new Point(0.841759888463302, 0.138220009676923), new Point(0.83783483505249, 0.126184299588203), new Point(0.867269575595856, 0.126184314489365), "155");
createFace(["36", "306", "311", "337"], "156");
setUVsToFace(new Point(0.834382593631744, 0.0976952165365219), new Point(0.419417381286621, 0.0976952165365219), new Point(0.419417381286621, 0.0761105790734291), "156");
createFace(["206", "198", "719", "744"], "157");
setUVsToFace(new Point(0.834382593631744, 0.598431944847107), new Point(0.419417381286621, 0.598431944847107), new Point(0.419417381286621, 0.576847195625305), "157");
createFace(["62", "371", "377", "63"], "158");
setUVsToFace(new Point(0.834382593631744, 0.523321330547333), new Point(0.419417381286621, 0.523321330547333), new Point(0.419417381286621, 0.501736760139465), "158");
createFace(["733", "210", "700", "728"], "159");
setUVsToFace(new Point(0.83783483505249, 0.051073744893074), new Point(0.867269589804851, 0.0510736716575111), new Point(0.863344490528107, 0.063109427690506), "159");
createFace(["458", "94", "93", "454"], "162");
setUVsToFace(new Point(0.841759940374621, 0.789177422446613), new Point(0.83783483505249, 0.777141749858856), new Point(0.867269575595856, 0.777141749858856), "162");
createFace(["92", "448", "449", "84"], "163");
setUVsToFace(new Point(0.83783483505249, 0.827215373516083), new Point(0.867269630790056, 0.827215331154268), new Point(0.863344550132751, 0.839251041412354), "163");
createFace(["290", "257", "258", "291"], "166");
setUVsToFace(new Point(0.834382593631744, 0.673542439937592), new Point(0.419417381286621, 0.673542439937592), new Point(0.419417381286621, 0.651957809925079), "166");
createFace(["295", "22", "290", "291"], "182");
setUVsToFace(new Point(0.869858801364899, 0.226331651210785), new Point(0.899293526000596, 0.226331617778112), new Point(0.895368456840515, 0.238367304205894), "182");
createFace(["566", "562", "557", "561"], "194");
setUVsToFace(new Point(0.83783483505249, 0.276405304670334), new Point(0.8672696352005, 0.276405304670334), new Point(0.863344550132751, 0.288440972566605), "194");
createSurface(["66", "40", "92", "182", "122", "28", "25", "27", "24", "8", "41", "93", "123", "145", "88", "163", "52", "50", "118", "53", "74", "44", "9", "75", "32", "57", "100", "68", "33", "62", "45", "105", "119", "89", "112", "101", "69", "51", "63", "152", "115", "102", "106", "3", "113", "103", "95", "133", "81", "2", "94", "38", "116", "138", "109", "34", "126", "121", "6", "67", "108", "82", "4", "139", "124", "35", "110", "39", "117", "134", "130", "36", "127", "135", "7", "54", "79", "83", "5", "60", "107", "61", "154", "142", "78", "136", "42", "37", "132", "140", "125", "48", "90", "58", "111", "49", "43", "14", "120", "131", "15", "64", "59", "20", "80", "65", "10", "16", "157", "11", "155", "137", "21", "56", "91", "55", "98", "158", "143", "166", "141", "17", "46", "12", "320", "99", "76", "194", "0", "70", "159", "149", "87", "148", "86", "77", "73", "13", "71", "162", "144", "104", "47", "30", "153", "84", "156", "18", "114", "1", "97", "19", "26", "31", "72", "85", "29", "23", "96", "22"], "Columns");
setMaterialToSurface(material, "Columns");
}
}
}//package temple
Section 61
//Columns_Bmp (temple.Columns_Bmp)
package temple {
import mx.core.*;
public class Columns_Bmp extends BitmapAsset {
}
}//package temple
Section 62
//Environment (temple.Environment)
package temple {
import flash.display.*;
import alternativa.types.*;
import alternativa.engine3d.materials.*;
import alternativa.engine3d.primitives.*;
public class Environment extends TextureLoader {
public var frontMaterial:TextureMaterial;
public var backMaterial:TextureMaterial;
public var rightMaterial:TextureMaterial;
public var topMaterial:TextureMaterial;
public var leftMaterial:TextureMaterial;
private static const bmpFront:Class = Environment_bmpFront;
private static const back:Texture = new Texture(new bmpBack().bitmapData);
private static const front:Texture = new Texture(new bmpFront().bitmapData);
private static const bmpLeft:Class = Environment_bmpLeft;
private static const top:Texture = new Texture(new bmpTop().bitmapData);
private static const bmpTop:Class = Environment_bmpTop;
private static const bmpBack:Class = Environment_bmpBack;
private static const left:Texture = new Texture(new bmpLeft().bitmapData);
private static const bmpRight:Class = Environment_bmpRight;
private static const right:Texture = new Texture(new bmpRight().bitmapData);
public function Environment(){
super("Environment");
clonePropertiesFrom(new Box(50000, 50000, 50000, 1, 1, 1, true));
frontMaterial = new TextureMaterial(front, 1, false, true, BlendMode.NORMAL, -1, 0xFFFFFF);
setMaterialToSurface(frontMaterial, "front");
backMaterial = new TextureMaterial(back, 1, false, true, BlendMode.NORMAL, -1, 0xFFFFFF);
setMaterialToSurface(backMaterial, "back");
leftMaterial = new TextureMaterial(left, 1, false, true, BlendMode.NORMAL, -1, 0xFFFFFF);
setMaterialToSurface(leftMaterial, "left");
rightMaterial = new TextureMaterial(right, 1, false, true, BlendMode.NORMAL, -1, 0xFFFFFF);
setMaterialToSurface(rightMaterial, "right");
topMaterial = new TextureMaterial(top, 1, false, true, BlendMode.NORMAL, -1, 0xFFFFFF);
setMaterialToSurface(topMaterial, "top");
bindings = [new TextureMaterialBinding([frontMaterial], "environmentfront.jpg"), new TextureMaterialBinding([backMaterial], "environmentback.jpg"), new TextureMaterialBinding([leftMaterial], "environmentleft.jpg"), new TextureMaterialBinding([rightMaterial], "environmentright.jpg"), new TextureMaterialBinding([topMaterial], "environmenttop.jpg")];
loadingMessage = "Loading environment texture";
}
}
}//package temple
Section 63
//Environment_bmpBack (temple.Environment_bmpBack)
package temple {
import mx.core.*;
public class Environment_bmpBack extends BitmapAsset {
}
}//package temple
Section 64
//Environment_bmpFront (temple.Environment_bmpFront)
package temple {
import mx.core.*;
public class Environment_bmpFront extends BitmapAsset {
}
}//package temple
Section 65
//Environment_bmpLeft (temple.Environment_bmpLeft)
package temple {
import mx.core.*;
public class Environment_bmpLeft extends BitmapAsset {
}
}//package temple
Section 66
//Environment_bmpRight (temple.Environment_bmpRight)
package temple {
import mx.core.*;
public class Environment_bmpRight extends BitmapAsset {
}
}//package temple
Section 67
//Environment_bmpTop (temple.Environment_bmpTop)
package temple {
import mx.core.*;
public class Environment_bmpTop extends BitmapAsset {
}
}//package temple
Section 68
//Ground (temple.Ground)
package temple {
import flash.display.*;
import alternativa.types.*;
import alternativa.engine3d.materials.*;
import flash.geom.*;
public class Ground extends TextureLoader {
public var material:TextureMaterial;
private static const texture:Texture = new Texture(new Bmp().bitmapData);
private static const Bmp:Class = Ground_Bmp;
public function Ground(){
material = new TextureMaterial(texture, 1, false, true, BlendMode.NORMAL, -1, 0xFFFFFF);
super("Ground");
bindings = [new TextureMaterialBinding([material], "ground.jpg", "groundalpha.gif")];
loadingMessage = "Loading ground texture";
coords = new Point3D(-1.25120162963867, -63.7402496337891, -39.4071769714355);
rotationZ = -0.610865354537964;
createVertex(-521.756046344476, 309.526991686318, 0, "0");
createVertex(-491.215361885546, 83.5631519486694, 0, "1");
createVertex(-518.829594503281, -28.8633749766739, 0, "2");
createVertex(-593.11325242586, -152.481711683424, 0, "3");
createVertex(-592.066927319612, -245.243275765086, 0, "4");
createVertex(-576.155886483801, -307.060274966088, 0, "5");
createVertex(-506.723863064041, -414.06305660306, 0, "6");
createVertex(-433.614522816095, -478.869963924137, 0, "7");
createVertex(-267.532794795941, -546.840820832786, 0, "8");
createVertex(-146.12879716163, -545.452670925965, 0, "9");
createVertex(-17.2213280315047, -520.987476063225, 0, "10");
createVertex(274.193472211673, -489.436960364667, 0, "11");
createVertex(373.069888038379, -448.086877493968, 0, "12");
createVertex(437.367119224298, -360.369942455703, 0, "13");
createVertex(464.36131121964, -253.395590656186, 0, "14");
createVertex(473.681328585714, -152.191579218144, 0, "15");
createVertex(513.337840541163, -20.7403477477848, 0, "16");
createVertex(560.39495448259, 131.925791776099, 0, "17");
createVertex(573.46322681827, 264.011970273575, 0, "18");
createVertex(541.747509302649, 379.815195834929, 0, "19");
createVertex(426.401960182823, 483.814597130094, 0, "20");
createVertex(253.024105940574, 521.606473717042, 0, "21");
createVertex(95.9238968094764, 553.957044136642, 0, "22");
createVertex(-89.7616721824535, 533.400808016234, 0, "23");
createVertex(-327.642025719448, 532.371280155141, 0, "24");
createVertex(-438.380072027443, 496.547437469935, 0, "25");
createVertex(-520.388435878339, 416.79102232026, 0, "26");
createVertex(-635.624307071979, 232.80458117011, 85.3412933349609, "27");
createVertex(-635.525408694391, 114.298119287724, 132.658702850342, "28");
createVertex(-650.425822885211, -9.28134552443252, 147.425258636475, "29");
createVertex(-652.995235814803, -155.335532777916, 124.267742156982, "30");
createVertex(-652.714258041183, -264.009588620368, 74.5269317626953, "31");
createVertex(-625.445392900083, -382.806368032894, 81.4308776855469, "32");
createVertex(-587.232906314805, -481.259304597931, 103.24821472168, "33");
createVertex(-484.572801659092, -558.195786544589, 88.5091094970703, "34");
createVertex(-328.057210032707, -617.511769268579, 57.0054244995117, "35");
createVertex(-172.039885722147, -649.762804215229, 66.5040588378906, "36");
createVertex(-12.8302765216779, -636.629810696343, 61.4377670288086, "37");
createVertex(130.83923132848, -630.972255341346, 54.3545150756836, "38");
createVertex(268.314418841913, -603.471669481838, 49.1603012084961, "39");
createVertex(431.878860093237, -550.991237296864, 59.8544616699219, "40");
createVertex(508.222907234299, -473.887405808659, 83.4327087402344, "41");
createVertex(563.898325637384, -291.26986682907, 88.5091094970703, "42");
createVertex(609.028281828678, -150.030266154252, 88.5091094970703, "43");
createVertex(651.352978142299, -14.5273799659342, 122.302745819092, "44");
createVertex(698.176902983969, 127.626164888834, 108.946666717529, "45");
createVertex(719.42431153445, 296.166053784797, 123.374950408936, "46");
createVertex(653.047381311471, 475.38243030976, 146.142345428467, "47");
createVertex(527.681363739893, 576.541662017215, 156.199382781982, "48");
createVertex(298.04351693431, 634.265492709329, 177.414318084717, "49");
createVertex(113.275067980055, 676.987736589677, 208.377178192139, "50");
createVertex(-83.7298977301904, 678.483771170393, 217.073650360107, "51");
createVertex(-271.957773718093, 676.175279375209, 196.380565643311, "52");
createVertex(-420.764559387242, 632.580538148194, 152.877758026123, "53");
createVertex(-541.938375915762, 622.400047995773, 127.653392791748, "54");
createVertex(-615.269351512936, 492.178456723491, 129.75931930542, "55");
createVertex(-655.067507774023, 396.8311962261, 102.465858459473, "56");
createVertex(-501.682799674685, 508.034301028583, 90.6932983398438, "57");
createVertex(-564.186058302167, 410.58848467086, 81.5132446289063, "58");
createVertex(-550.792594196749, 282.913798175707, 50.255126953125, "59");
createVertex(-526.606818866516, 145.977534727022, 51.8577919006348, "60");
createVertex(-551.300415397835, 30.0813195954894, 41.7520637512207, "61");
createVertex(-588.753197596258, -78.5156116472459, 48.9697036743164, "62");
createVertex(-618.945587154616, -178.176435376895, 40.8857116699219, "63");
createVertex(-603.837911603205, -302.58353315027, 34.7706146240234, "64");
createVertex(-553.959843904807, -378.810995432127, 43.54443359375, "65");
createVertex(-481.637809706524, -479.584424074109, 56.3982772827148, "66");
createVertex(-376.218067798843, -529.456734266852, 41.2078552246094, "67");
createVertex(-216.004546518532, -592.588832877113, 39.8419952392578, "68");
createVertex(-88.7148451163193, -570.493950829596, 41.2078590393066, "69");
createVertex(60.0635341688864, -564.404720453168, 41.2078590393066, "70");
createVertex(207.350875484399, -539.999995361214, 41.2078590393066, "71");
createVertex(369.999971579021, -516.137127203239, 41.2078590393066, "72");
createVertex(429.581469772647, -467.552338047181, 47.3474884033203, "73");
createVertex(486.906931319942, -369.297060449314, 68.7656860351563, "74");
createVertex(510.377933230436, -201.164096291202, 68.7656860351563, "75");
createVertex(560.899536563657, -65.1774714679016, 68.7656860351563, "76");
createVertex(563.910424219324, 45.5442529110826, 68.7656860351563, "77");
createVertex(616.174006971375, 193.593308058352, 68.7656860351563, "78");
createVertex(601.223973372869, 328.695647090623, 68.7656860351563, "79");
createVertex(541.470131153871, 468.759243305976, 75.5934371948242, "80");
createVertex(375.966170197986, 574.164592041536, 33.212287902832, "81");
createVertex(211.489115969312, 612.041489816894, 31.2691802978516, "82");
createVertex(16.4415452808267, 625.853204610001, 42.4033660888672, "83");
createVertex(-173.410112176938, 617.575743922904, 49.3540191650391, "84");
createVertex(-306.252126517028, 599.49265821882, 52.1259536743164, "85");
createVertex(-421.123270137217, 561.91069667549, 72.4084320068359, "86");
createVertex(-489.368771782404, 196.740324764577, 0, "87");
createVertex(129.29763072226, -518.845113107749, 0, "88");
createVertex(57.1746885063115, 458.218118302794, -0.0032958984375, "89");
createVertex(338.605273642633, 56.293716809881, -0.00329971313476563, "90");
createVertex(-221.873268245135, 513.991522418285, 0, "91");
createVertex(-376.999767868863, 154.205760189439, -0.0032958984375, "92");
createVertex(-95.5692677379433, -247.718626314736, -0.00329971313476563, "93");
createVertex(-347.904650997806, 709.992758620445, 206.415096282959, "94");
createVertex(-181.957142049799, 716.310996783356, 238.643215179443, "95");
createVertex(17.2001798101488, 727.715259866312, 237.093334197998, "96");
createVertex(249.97170097066, 716.340622084231, 231.19567489624, "97");
createVertex(415.946128901144, 655.65981431395, 197.917751312256, "98");
createFace(["21", "89", "90", "16", "17", "18", "19", "20"], "0");
setUVsToFace(new Point(0.776008129119873, 0.619814872741699), new Point(0.663155674934387, 0.65445613861084), new Point(0.663155674934387, 0.373069316148758), "0");
createFace(["83", "84", "91", "23"], "1");
setUVsToFace(new Point(0.70936123889149, 0.755715351373807), new Point(0.620059013366699, 0.816600680351257), new Point(0.550412893295288, 0.772447109222412), "1");
createFace(["93", "92", "2", "3", "4", "5", "6", "7", "8", "9", "10"], "2");
setUVsToFace(new Point(0.359190553426743, 0.373069316148758), new Point(0.359180837719799, 0.654464445800727), new Point(0.23233301498063, 0.615118948542788), "2");
createFace(["87", "92", "91", "24", "25", "26", "0"], "3");
setUVsToFace(new Point(0.320453056542705, 0.711414628854602), new Point(0.35919064283371, 0.65445601940155), new Point(0.550247603513955, 0.772404082524329), "3");
createFace(["91", "92", "89", "23"], "4");
setUVsToFace(new Point(0.550412893295288, 0.772447109222412), new Point(0.35919064283371, 0.65445601940155), new Point(0.663149934909653, 0.654457471153384), "4");
createFace(["90", "93", "10", "88", "11", "12", "13", "14", "15"], "5");
setUVsToFace(new Point(0.663155674934387, 0.373069316148758), new Point(0.359154341831529, 0.373133439278024), new Point(0.306076473129552, 0.219000759739078), "5");
createFace(["69", "36", "37", "70"], "6");
setUVsToFace(new Point(0.249071642756462, 0.208565235137939), new Point(0.180457382323153, 0.195368327225957), new Point(0.262137800455093, 0.148933291435242), "6");
createFace(["15", "16", "90"], "7");
setUVsToFace(new Point(0.658041834831238, 0.230699852108955), new Point(0.719875812530518, 0.279397785663605), new Point(0.663155674934387, 0.373069316148758), "7");
createFace(["62", "2", "1", "61"], "8");
setUVsToFace(new Point(0.169987872242928, 0.624359130859375), new Point(0.232345446944237, 0.615109443664551), new Point(0.282604456392093, 0.65846714058745), "8");
createFace(["66", "34", "35", "67"], "16");
setUVsToFace(new Point(0.0824346542358398, 0.387721985578537), new Point(0.0495466887950897, 0.34898054599762), new Point(0.111940339180578, 0.26744622755082), "16");
createFace(["86", "54", "55", "57"], "18");
setUVsToFace(new Point(0.476608262273489, 0.88553316889628), new Point(0.441773563623428, 0.962473511695862), new Point(0.349538713693619, 0.924630761146545), "18");
createFace(["84", "52", "53", "85"], "19");
setUVsToFace(new Point(0.625563826321988, 0.818395731912015), new Point(0.621113657951355, 0.928619265556335), new Point(0.517435908317566, 0.93955659866333), "19");
createFace(["26", "58", "59", "0"], "20");
setUVsToFace(new Point(0.378238946199417, 0.824984908103943), new Point(0.346208602190018, 0.857921600341797), new Point(0.314893216866219, 0.784734311232618), "20");
createFace(["88", "10", "69", "70"], "21");
setUVsToFace(new Point(0.375655591487885, 0.171732068061829), new Point(0.306111752986908, 0.218920037150383), new Point(0.250852755920996, 0.207068660014076), "21");
createFace(["33", "65", "64", "32"], "22");
setUVsToFace(new Point(0.0176386342842436, 0.428196147730716), new Point(0.0843737497925758, 0.462465018033981), new Point(0.0924478396773338, 0.516420245170593), "22");
createFace(["68", "69", "10", "9"], "23");
setUVsToFace(new Point(0.181954676126322, 0.24000106324918), new Point(0.249071642756462, 0.208565235137939), new Point(0.306111752986908, 0.218920037150383), "23");
createFace(["1", "2", "92"], "24");
setUVsToFace(new Point(0.282297134399414, 0.658839106559753), new Point(0.232345446944237, 0.615109443664551), new Point(0.35919064283371, 0.65445601940155), "24");
createFace(["87", "1", "92"], "25");
setUVsToFace(new Point(0.320393860340118, 0.711399674415588), new Point(0.282297134399414, 0.658839106559753), new Point(0.35919064283371, 0.65445601940155), "25");
createFace(["50", "96", "95", "51"], "26");
setUVsToFace(new Point(0.830545034073851, 0.801815008232933), new Point(0.800552725791931, 0.861453652381897), new Point(0.692751288414001, 0.929564356803894), "26");
createFace(["81", "82", "22", "21"], "28");
setUVsToFace(new Point(0.856223539940682, 0.6038879109099), new Point(0.791775584220886, 0.675992727279663), new Point(0.712934136390686, 0.686888694763184), "28");
createFace(["25", "86", "57"], "34");
setUVsToFace(new Point(0.442934095859528, 0.835460066795349), new Point(0.477365374565125, 0.882530689239502), new Point(0.413260132074356, 0.889125108718872), "34");
createFace(["24", "85", "86"], "35");
setUVsToFace(new Point(0.506202161312103, 0.817004561424255), new Point(0.548203110694885, 0.852527499198914), new Point(0.477365374565125, 0.882530689239502), "35");
createFace(["91", "84", "85"], "36");
setUVsToFace(new Point(0.550412893295288, 0.772447109222412), new Point(0.620059013366699, 0.816600680351257), new Point(0.548203110694885, 0.852527499198914), "36");
createFace(["22", "82", "83"], "38");
setUVsToFace(new Point(0.712934136390686, 0.686888694763184), new Point(0.791775584220886, 0.675992727279663), new Point(0.711131691932678, 0.753029704093933), "38");
createFace(["20", "80", "81"], "40");
setUVsToFace(new Point(0.84505569934845, 0.545050859451294), new Point(0.913927316665649, 0.502624452114105), new Point(0.853009104728699, 0.603320956230164), "40");
createFace(["19", "79", "80"], "41");
setUVsToFace(new Point(0.865001320838928, 0.458239674568176), new Point(0.897727847099304, 0.411706924438477), new Point(0.913927316665649, 0.502624452114105), "41");
createFace(["18", "78", "79"], "42");
setUVsToFace(new Point(0.841813206672668, 0.393398106098175), new Point(0.860153317451477, 0.337554842233658), new Point(0.897727847099304, 0.411706924438477), "42");
createFace(["17", "77", "78"], "43");
setUVsToFace(new Point(0.792212963104248, 0.335635125637054), new Point(0.788064122200012, 0.276841670274734), new Point(0.860153317451477, 0.337554842233658), "43");
createFace(["16", "76", "77"], "44");
setUVsToFace(new Point(0.719875812530518, 0.279397785663605), new Point(0.746709227561951, 0.226838320493698), new Point(0.788064122200012, 0.276841670274734), "44");
createFace(["15", "75", "76"], "45");
setUVsToFace(new Point(0.658041834831238, 0.230699852108955), new Point(0.676394939422607, 0.178198620676994), new Point(0.746709227561951, 0.226838320493698), "45");
createFace(["14", "74", "75"], "46");
setUVsToFace(new Point(0.620372414588928, 0.186231210827827), new Point(0.603773593902588, 0.108945652842522), new Point(0.676394939422607, 0.178198620676994), "46");
createFace(["13", "73", "74"], "47");
setUVsToFace(new Point(0.572496891021729, 0.144847840070724), new Point(0.538016796112061, 0.0870758295059204), new Point(0.603773593902588, 0.108945652842522), "47");
createFace(["12", "72", "73"], "48");
setUVsToFace(new Point(0.513436675071716, 0.124788455665112), new Point(0.491562575101852, 0.0849757418036461), new Point(0.538016796112061, 0.0870758295059204), "48");
createFace(["11", "71", "72"], "49");
setUVsToFace(new Point(0.453370124101639, 0.137893736362457), new Point(0.402509480714798, 0.124896414577961), new Point(0.491562575101852, 0.0849757418036461), "49");
createFace(["88", "70", "71"], "50");
setUVsToFace(new Point(0.375655591487885, 0.171732068061829), new Point(0.323191285133362, 0.161969736218452), new Point(0.402509480714798, 0.124896414577961), "50");
createFace(["76", "75", "42", "43"], "52");
setUVsToFace(new Point(0.746709227561951, 0.226838320493698), new Point(0.676394939422607, 0.178198620676994), new Point(0.673776350217405, 0.114043312328303), "52");
createFace(["7", "66", "67"], "54");
setUVsToFace(new Point(0.124351903796196, 0.375676363706589), new Point(0.0824346542358398, 0.387721985578537), new Point(0.120512492954731, 0.327794134616852), "54");
createFace(["6", "65", "66"], "55");
setUVsToFace(new Point(0.11132425814867, 0.430169761180878), new Point(0.0843737497925758, 0.462465018033981), new Point(0.0824346542358398, 0.387721985578537), "55");
createFace(["5", "64", "65"], "56");
setUVsToFace(new Point(0.113904014229774, 0.503275871276855), new Point(0.0924478396773338, 0.516420245170593), new Point(0.0843737497925758, 0.462465018033981), "56");
createFace(["4", "63", "64"], "57");
setUVsToFace(new Point(0.126763686537743, 0.537549376487732), new Point(0.126092717051506, 0.582740426063538), new Point(0.0924478396773338, 0.516420245170593), "57");
createFace(["3", "62", "63"], "58");
setUVsToFace(new Point(0.156784787774086, 0.581470727920532), new Point(0.169987872242928, 0.624359130859375), new Point(0.126092717051506, 0.582740426063538), "58");
createFace(["1", "60", "61"], "60");
setUVsToFace(new Point(0.282297134399414, 0.658839106559753), new Point(0.273077040910721, 0.711027264595032), new Point(0.226033926010132, 0.660937309265137), "60");
createFace(["87", "59", "60"], "61");
setUVsToFace(new Point(0.320393860340118, 0.711399674415588), new Point(0.311740815639496, 0.783913969993591), new Point(0.273077040910721, 0.711027264595032), "61");
createFace(["23", "89", "21", "22"], "62");
setUVsToFace(new Point(0.618985057417137, 0.738404456444883), new Point(0.663155674934387, 0.65445613861084), new Point(0.776008129119873, 0.619814872741699), "62");
createFace(["26", "57", "58"], "63");
setUVsToFace(new Point(0.378238946199417, 0.824984908103943), new Point(0.413260132074356, 0.889125108718872), new Point(0.346208602190018, 0.857921600341797), "63");
createFace(["5", "4", "64"], "64");
setUVsToFace(new Point(0.113904014229774, 0.503275871276855), new Point(0.126763686537743, 0.537549376487732), new Point(0.0924478396773338, 0.516420245170593), "64");
createFace(["65", "6", "5"], "65");
setUVsToFace(new Point(0.0843737497925758, 0.462465018033981), new Point(0.11132425814867, 0.430169761180878), new Point(0.113904014229774, 0.503275871276855), "65");
createFace(["66", "7", "6"], "66");
setUVsToFace(new Point(0.0824346542358398, 0.387721985578537), new Point(0.124351903796196, 0.375676363706589), new Point(0.11132425814867, 0.430169761180878), "66");
createFace(["68", "9", "8"], "68");
setUVsToFace(new Point(0.180570170283318, 0.243550479412079), new Point(0.237504348158836, 0.249832332134247), new Point(0.180013805627823, 0.289115756750107), "68");
createFace(["71", "11", "88"], "71");
setUVsToFace(new Point(0.402509480714798, 0.124896414577961), new Point(0.453370124101639, 0.137893736362457), new Point(0.375655591487885, 0.171732068061829), "71");
createFace(["72", "12", "11"], "72");
setUVsToFace(new Point(0.491562575101852, 0.0849757418036461), new Point(0.513436675071716, 0.124788455665112), new Point(0.453370124101639, 0.137893736362457), "72");
createFace(["73", "13", "12"], "73");
setUVsToFace(new Point(0.538016796112061, 0.0870758295059204), new Point(0.572496891021729, 0.144847840070724), new Point(0.513436675071716, 0.124788455665112), "73");
createFace(["74", "14", "13"], "74");
setUVsToFace(new Point(0.603773593902588, 0.108945652842522), new Point(0.620372414588928, 0.186231210827827), new Point(0.572496891021729, 0.144847840070724), "74");
createFace(["75", "15", "14"], "75");
setUVsToFace(new Point(0.676394939422607, 0.178198620676994), new Point(0.658041834831238, 0.230699852108955), new Point(0.620372414588928, 0.186231210827827), "75");
createFace(["76", "16", "15"], "76");
setUVsToFace(new Point(0.746709227561951, 0.226838320493698), new Point(0.719875812530518, 0.279397785663605), new Point(0.658041834831238, 0.230699852108955), "76");
createFace(["77", "17", "16"], "77");
setUVsToFace(new Point(0.788064122200012, 0.276841670274734), new Point(0.792212963104248, 0.335635125637054), new Point(0.719875812530518, 0.279397785663605), "77");
createFace(["78", "18", "17"], "78");
setUVsToFace(new Point(0.860153317451477, 0.337554842233658), new Point(0.841813206672668, 0.393398106098175), new Point(0.792212963104248, 0.335635125637054), "78");
createFace(["79", "19", "18"], "79");
setUVsToFace(new Point(0.897727847099304, 0.411706924438477), new Point(0.865001320838928, 0.458239674568176), new Point(0.841813206672668, 0.393398106098175), "79");
createFace(["80", "20", "19"], "80");
setUVsToFace(new Point(0.913927316665649, 0.502624452114105), new Point(0.84505569934845, 0.545050859451294), new Point(0.865001320838928, 0.458239674568176), "80");
createFace(["20", "81", "21"], "81");
setUVsToFace(new Point(0.84505569934845, 0.545050859451294), new Point(0.853009104728699, 0.603320956230164), new Point(0.776008129119873, 0.619814872741699), "81");
createFace(["22", "83", "23"], "83");
setUVsToFace(new Point(0.712934136390686, 0.686888694763184), new Point(0.711131691932678, 0.753029704093933), new Point(0.618857383728027, 0.73810887336731), "83");
createFace(["85", "24", "91"], "85");
setUVsToFace(new Point(0.548203110694885, 0.852527499198914), new Point(0.506202161312103, 0.817004561424255), new Point(0.550412893295288, 0.772447109222412), "85");
createFace(["24", "86", "25"], "86");
setUVsToFace(new Point(0.506202161312103, 0.817004561424255), new Point(0.477365374565125, 0.882530689239502), new Point(0.442934095859528, 0.835460066795349), "86");
createFace(["25", "57", "26"], "87");
setUVsToFace(new Point(0.442934095859528, 0.835460066795349), new Point(0.413260132074356, 0.889125108718872), new Point(0.378238946199417, 0.824984908103943), "87");
createFace(["87", "0", "59"], "89");
setUVsToFace(new Point(0.320393860340118, 0.711399674415588), new Point(0.342280477285385, 0.775039315223694), new Point(0.311740815639496, 0.783913969993591), "89");
createFace(["60", "1", "87"], "90");
setUVsToFace(new Point(0.273077040910721, 0.711027264595032), new Point(0.282297134399414, 0.658839106559753), new Point(0.320393860340118, 0.711399674415588), "90");
createFace(["62", "3", "2"], "92");
setUVsToFace(new Point(0.169987872242928, 0.624359130859375), new Point(0.156784787774086, 0.581470727920532), new Point(0.232345446944237, 0.615109443664551), "92");
createFace(["63", "4", "3"], "93");
setUVsToFace(new Point(0.126092717051506, 0.582740426063538), new Point(0.126763686537743, 0.537549376487732), new Point(0.156784787774086, 0.581470727920532), "93");
createFace(["67", "35", "68"], "94");
setUVsToFace(new Point(0.120512492954731, 0.327794134616852), new Point(0.113896213471889, 0.267325937747955), new Point(0.180570170283318, 0.243550479412079), "94");
createFace(["68", "36", "69"], "95");
setUVsToFace(new Point(0.180570170283318, 0.243550479412079), new Point(0.179441958665848, 0.196931272745132), new Point(0.249071642756462, 0.208565235137939), "95");
createFace(["70", "38", "71"], "97");
setUVsToFace(new Point(0.323191285133362, 0.161969736218452), new Point(0.334696888923645, 0.104322850704193), new Point(0.402509480714798, 0.124896414577961), "97");
createFace(["71", "39", "72"], "98");
setUVsToFace(new Point(0.402509480714798, 0.124896414577961), new Point(0.41200989484787, 0.0732671394944191), new Point(0.491562575101852, 0.0849757418036461), "98");
createFace(["72", "40", "73"], "99");
setUVsToFace(new Point(0.491562575101852, 0.0849757418036461), new Point(0.510659515857697, 0.0447706840932369), new Point(0.538016796112061, 0.0870758295059204), "99");
createFace(["73", "41", "74"], "100");
setUVsToFace(new Point(0.538016796112061, 0.0870758295059204), new Point(0.57656466960907, 0.0514241941273212), new Point(0.603773593902588, 0.108945652842522), "100");
createFace(["74", "42", "75"], "101");
setUVsToFace(new Point(0.603773593902588, 0.108945652842522), new Point(0.670536279678345, 0.115986734628677), new Point(0.676394939422607, 0.178198620676994), "101");
createFace(["76", "44", "77"], "103");
setUVsToFace(new Point(0.746709227561951, 0.226838320493698), new Point(0.817364931106567, 0.213490933179855), new Point(0.788064122200012, 0.276841670274734), "103");
createFace(["77", "45", "78"], "104");
setUVsToFace(new Point(0.788064122200012, 0.276841670274734), new Point(0.886005282402039, 0.274774491786957), new Point(0.860153317451477, 0.337554842233658), "104");
createFace(["78", "46", "79"], "105");
setUVsToFace(new Point(0.860153317451477, 0.337554842233658), new Point(0.953715920448303, 0.354809790849686), new Point(0.897727847099304, 0.411706924438477), "105");
createFace(["79", "47", "80"], "106");
setUVsToFace(new Point(0.897727847099304, 0.411706924438477), new Point(0.985737204551697, 0.470214933156967), new Point(0.913927316665649, 0.502624452114105), "106");
createFace(["80", "48", "81"], "107");
setUVsToFace(new Point(0.913927316665649, 0.502624452114105), new Point(0.961911201477051, 0.570052862167358), new Point(0.853009104728699, 0.603320956230164), "107");
createFace(["81", "49", "82"], "108");
setUVsToFace(new Point(0.853009104728699, 0.603320956230164), new Point(0.890356302261353, 0.698651909828186), new Point(0.791775584220886, 0.675992727279663), "108");
createFace(["82", "50", "83"], "109");
setUVsToFace(new Point(0.791775584220886, 0.675992727279663), new Point(0.824265241622925, 0.797465562820435), new Point(0.711131691932678, 0.753029704093933), "109");
createFace(["83", "51", "84"], "110");
setUVsToFace(new Point(0.711131691932678, 0.753029704093933), new Point(0.728910446166992, 0.875275254249573), new Point(0.620059013366699, 0.816600680351257), "110");
createFace(["85", "53", "86"], "112");
setUVsToFace(new Point(0.548203110694885, 0.852527499198914), new Point(0.517435908317566, 0.93955659866333), new Point(0.477365374565125, 0.882530689239502), "112");
createFace(["57", "55", "58"], "114");
setUVsToFace(new Point(0.413260132074356, 0.889125108718872), new Point(0.349538713693619, 0.924630761146545), new Point(0.346208602190018, 0.857921600341797), "114");
createFace(["58", "56", "59"], "115");
setUVsToFace(new Point(0.346208602190018, 0.857921600341797), new Point(0.295179098844528, 0.881911873817444), new Point(0.311740815639496, 0.783913969993591), "115");
createFace(["59", "27", "60"], "116");
setUVsToFace(new Point(0.311740815639496, 0.783913969993591), new Point(0.250682502985001, 0.793625354766846), new Point(0.273077040910721, 0.711027264595032), "116");
createFace(["60", "28", "61"], "117");
setUVsToFace(new Point(0.273077040910721, 0.711027264595032), new Point(0.197571039199829, 0.74489951133728), new Point(0.226033926010132, 0.660937309265137), "117");
createFace(["61", "29", "62"], "118");
setUVsToFace(new Point(0.226033926010132, 0.660937309265137), new Point(0.143400087952614, 0.698905348777771), new Point(0.169987872242928, 0.624359130859375), "118");
createFace(["62", "30", "63"], "119");
setUVsToFace(new Point(0.169987872242928, 0.624359130859375), new Point(0.0942364782094955, 0.626548647880554), new Point(0.126092717051506, 0.582740426063538), "119");
createFace(["63", "31", "64"], "120");
setUVsToFace(new Point(0.126092717051506, 0.582740426063538), new Point(0.0732166171073914, 0.556638836860657), new Point(0.0924478396773338, 0.516420245170593), "120");
createFace(["65", "33", "66"], "122");
setUVsToFace(new Point(0.0843737497925758, 0.462465018033981), new Point(0.0217416975647211, 0.423976421356201), new Point(0.0824346542358398, 0.387721985578537), "122");
createFace(["33", "34", "66"], "124");
setUVsToFace(new Point(0.0217416975647211, 0.423976421356201), new Point(0.0495466887950897, 0.34898054599762), new Point(0.0824346542358398, 0.387721985578537), "124");
createFace(["35", "36", "68"], "126");
setUVsToFace(new Point(0.113896213471889, 0.267325937747955), new Point(0.179441958665848, 0.196931272745132), new Point(0.180570170283318, 0.243550479412079), "126");
createFace(["37", "38", "70"], "128");
setUVsToFace(new Point(0.262137800455093, 0.148933291435242), new Point(0.334696888923645, 0.104322850704193), new Point(0.323191285133362, 0.161969736218452), "128");
createFace(["38", "39", "71"], "129");
setUVsToFace(new Point(0.334696888923645, 0.104322850704193), new Point(0.41200989484787, 0.0732671394944191), new Point(0.402509480714798, 0.124896414577961), "129");
createFace(["39", "40", "72"], "130");
setUVsToFace(new Point(0.41200989484787, 0.0732671394944191), new Point(0.510659515857697, 0.0447706840932369), new Point(0.491562575101852, 0.0849757418036461), "130");
createFace(["40", "41", "73"], "131");
setUVsToFace(new Point(0.510659515857697, 0.0447706840932369), new Point(0.57656466960907, 0.0514241941273212), new Point(0.538016796112061, 0.0870758295059204), "131");
createFace(["41", "42", "74"], "132");
setUVsToFace(new Point(0.57656466960907, 0.0514241941273212), new Point(0.670536279678345, 0.115986734628677), new Point(0.603773593902588, 0.108945652842522), "132");
createFace(["43", "44", "76"], "134");
setUVsToFace(new Point(0.74309515953064, 0.167256742715836), new Point(0.817364931106567, 0.213490933179855), new Point(0.746709227561951, 0.226838320493698), "134");
createFace(["44", "45", "77"], "135");
setUVsToFace(new Point(0.817364931106567, 0.213490933179855), new Point(0.886005282402039, 0.274774491786957), new Point(0.788064122200012, 0.276841670274734), "135");
createFace(["45", "46", "78"], "136");
setUVsToFace(new Point(0.886005282402039, 0.274774491786957), new Point(0.953715920448303, 0.354809790849686), new Point(0.860153317451477, 0.337554842233658), "136");
createFace(["46", "47", "79"], "137");
setUVsToFace(new Point(0.953715920448303, 0.354809790849686), new Point(0.985737204551697, 0.470214933156967), new Point(0.897727847099304, 0.411706924438477), "137");
createFace(["47", "48", "80"], "138");
setUVsToFace(new Point(0.985737204551697, 0.470214933156967), new Point(0.961911201477051, 0.570052862167358), new Point(0.913927316665649, 0.502624452114105), "138");
createFace(["48", "49", "81"], "139");
setUVsToFace(new Point(0.961911201477051, 0.570052862167358), new Point(0.890356302261353, 0.698651909828186), new Point(0.853009104728699, 0.603320956230164), "139");
createFace(["49", "50", "82"], "140");
setUVsToFace(new Point(0.890356302261353, 0.698651909828186), new Point(0.824265241622925, 0.797465562820435), new Point(0.791775584220886, 0.675992727279663), "140");
createFace(["50", "51", "83"], "141");
setUVsToFace(new Point(0.824265241622925, 0.797465562820435), new Point(0.728910446166992, 0.875275254249573), new Point(0.711131691932678, 0.753029704093933), "141");
createFace(["51", "52", "84"], "142");
setUVsToFace(new Point(0.728910446166992, 0.875275254249573), new Point(0.621113657951355, 0.928619265556335), new Point(0.620059013366699, 0.816600680351257), "142");
createFace(["53", "54", "86"], "144");
setUVsToFace(new Point(0.517435908317566, 0.93955659866333), new Point(0.441773563623428, 0.962473511695862), new Point(0.477365374565125, 0.882530689239502), "144");
createFace(["55", "56", "58"], "146");
setUVsToFace(new Point(0.349538713693619, 0.924630761146545), new Point(0.295179098844528, 0.881911873817444), new Point(0.346208602190018, 0.857921600341797), "146");
createFace(["56", "27", "59"], "147");
setUVsToFace(new Point(0.295179098844528, 0.881911873817444), new Point(0.250682502985001, 0.793625354766846), new Point(0.311740815639496, 0.783913969993591), "147");
createFace(["27", "28", "60"], "148");
setUVsToFace(new Point(0.250682502985001, 0.793625354766846), new Point(0.197571039199829, 0.74489951133728), new Point(0.273077040910721, 0.711027264595032), "148");
createFace(["28", "29", "61"], "149");
setUVsToFace(new Point(0.197571039199829, 0.74489951133728), new Point(0.143400087952614, 0.698905348777771), new Point(0.226033926010132, 0.660937309265137), "149");
createFace(["29", "30", "62"], "150");
setUVsToFace(new Point(0.143400087952614, 0.698905348777771), new Point(0.0942364782094955, 0.626548647880554), new Point(0.169987872242928, 0.624359130859375), "150");
createFace(["30", "31", "63"], "151");
setUVsToFace(new Point(0.0942364782094955, 0.626548647880554), new Point(0.0732166171073914, 0.556638836860657), new Point(0.126092717051506, 0.582740426063538), "151");
createFace(["31", "32", "64"], "152");
setUVsToFace(new Point(0.0732166171073914, 0.556638836860657), new Point(0.0426680892705917, 0.487890124320984), new Point(0.0924478396773338, 0.516420245170593), "152");
createFace(["53", "52", "94"], "154");
setUVsToFace(new Point(0.517435908317566, 0.93955659866333), new Point(0.621113657951355, 0.928619265556335), new Point(0.588735818862915, 0.968436598777771), "154");
createFace(["52", "51", "95"], "155");
setUVsToFace(new Point(0.621113657951355, 0.928619265556335), new Point(0.728910446166992, 0.875275254249573), new Point(0.692751288414001, 0.929564356803894), "155");
createFace(["50", "49", "97"], "157");
setUVsToFace(new Point(0.824265241622925, 0.797465562820435), new Point(0.890356302261353, 0.698651909828186), new Point(0.906573534011841, 0.76189661026001), "157");
createFace(["49", "48", "98"], "158");
setUVsToFace(new Point(0.890356302261353, 0.698651909828186), new Point(0.961911201477051, 0.570052862167358), new Point(0.952999353408813, 0.660169720649719), "158");
createFace(["97", "49", "98"], "159");
setUVsToFace(new Point(0.906573534011841, 0.76189661026001), new Point(0.890356302261353, 0.698651909828186), new Point(0.952999353408813, 0.660169720649719), "159");
createFace(["96", "50", "97"], "160");
setUVsToFace(new Point(0.800552725791931, 0.861453652381897), new Point(0.824265241622925, 0.797465562820435), new Point(0.906573534011841, 0.76189661026001), "160");
createFace(["94", "52", "95"], "162");
setUVsToFace(new Point(0.588735818862915, 0.968436598777771), new Point(0.621113657951355, 0.928619265556335), new Point(0.692751288414001, 0.929564356803894), "162");
createFace(["54", "53", "94"], "163");
setUVsToFace(new Point(0.441773563623428, 0.962473511695862), new Point(0.517435908317566, 0.93955659866333), new Point(0.588735818862915, 0.968436598777771), "163");
createFace(["8", "7", "67", "68"], "164");
setUVsToFace(new Point(0.180013805627823, 0.289115756750107), new Point(0.124351903796196, 0.375676363706589), new Point(0.120512492954731, 0.327794134616852), "164");
createSurface(["106", "122", "20", "139", "89", "72", "41", "90", "40", "56", "74", "24", "73", "141", "124", "107", "57", "75", "25", "140", "8", "109", "92", "42", "58", "21", "23", "158", "22", "157", "110", "93", "43", "44", "126", "76", "62", "61", "77", "60", "108", "45", "94", "52", "159", "46", "95", "78", "160", "142", "79", "128", "144", "47", "162", "112", "146", "7", "81", "64", "1", "63", "48", "97", "80", "129", "26", "65", "114", "130", "49", "98", "147", "163", "50", "132", "148", "131", "83", "99", "115", "164", "28", "100", "116", "0", "117", "34", "149", "66", "85", "3", "150", "16", "118", "35", "86", "18", "151", "68", "119", "36", "101", "4", "19", "152", "5", "54", "136", "135", "154", "38", "87", "2", "134", "55", "71", "120", "103", "6", "105", "104", "155", "138", "137"], "Ground");
setMaterialToSurface(material, "Ground");
}
}
}//package temple
Section 69
//Ground_Bmp (temple.Ground_Bmp)
package temple {
import mx.core.*;
public class Ground_Bmp extends BitmapAsset {
}
}//package temple
Section 70
//Limits (temple.Limits)
package temple {
import alternativa.types.*;
import alternativa.engine3d.core.*;
public class Limits extends Mesh {
public function Limits(){
super("Limits");
coords = new Point3D(-35.7909698486328, 7.15819311141968, -94.316047668457);
createVertex(66.1005630493164, 551.312143802643, 0, "0");
createVertex(-121.414672851563, 551.96485376358, 0, "1");
createVertex(-300.233932495117, 268.115854740143, 0, "2");
createVertex(-535.520919799805, 110.819689273834, 0, "3");
createVertex(-592.704696655273, -98.4427771568298, 0, "4");
createVertex(-482.757308959961, -356.268849849701, 0, "5");
createVertex(-4.0699462890625, -614.157887935638, 0, "6");
createVertex(162.509658813477, -614.157887935638, 0, "7");
createVertex(638.799697875977, -168.723332881927, 0, "8");
createVertex(660.941482543945, 70.8634819984436, 0, "9");
createVertex(472.579605102539, 332.85450220108, 0, "10");
createVertex(66.1005630493164, 551.312143802643, 393.700782775879, "11");
createVertex(-121.414672851563, 551.96485376358, 393.700782775879, "12");
createVertex(-300.233932495117, 268.115854740143, 393.700782775879, "13");
createVertex(-535.520919799805, 110.819689273834, 393.700782775879, "14");
createVertex(-592.704696655273, -98.4427771568298, 393.700782775879, "15");
createVertex(-482.757308959961, -356.268849849701, 393.700782775879, "16");
createVertex(-4.0699462890625, -614.157887935638, 393.700782775879, "17");
createVertex(162.509658813477, -614.157887935638, 393.700782775879, "18");
createVertex(638.799697875977, -168.723332881927, 393.700782775879, "19");
createVertex(660.941482543945, 70.8634819984436, 393.700782775879, "20");
createVertex(472.579605102539, 332.85450220108, 393.700782775879, "21");
createFace(["17", "18", "7", "6"], "2");
createFace(["21", "11", "0", "10"], "3");
createFace(["12", "13", "2", "1"], "4");
createFace(["14", "15", "4", "3"], "5");
createFace(["18", "19", "8", "7"], "22");
createFace(["11", "12", "1", "0"], "6");
createFace(["19", "20", "9", "8"], "8");
createFace(["3", "2", "13", "14"], "9");
createFace(["10", "9", "20", "21"], "10");
createFace(["15", "16", "5", "4"], "11");
createFace(["6", "5", "16", "17"], "14");
}
}
}//package temple
Section 71
//SoundManager (temple.SoundManager)
package temple {
import flash.events.*;
import flash.net.*;
import alternativa.utils.*;
import flash.media.*;
import flash.utils.*;
public class SoundManager {
private var sequence:Array;
private var counter:int;// = -1
private var stepsIntervalId:int;
private var currentStepsType:int;// = -1
private var stoneSounds:Array;
private var stepsLoaded:Boolean;// = false
private var sound:Sound;
private var environmentTransform:SoundTransform;
private var grassSounds:Array;
private var environmentLoaded:Boolean;// = false
private var onLoadMethod:Function;
private var environmentChannel:SoundChannel;
private var volumeIntervalId:int;
private var environmentSound:Sound;
public static const STONE_RUN:uint = 1;
public static const STONE_WALK:uint = 0;
public static const GRASS_WALK:uint = 2;
public static const GRASS_RUN:uint = 3;
public function SoundManager(){
sequence = ["stone1.mp3", "stone2.mp3", "stone3.mp3", "stone4.mp3", "grass1.mp3", "grass2.mp3", "grass3.mp3", "grass4.mp3", "environment.mp3"];
stoneSounds = new Array();
grassSounds = new Array();
super();
}
public function stopSteps():void{
if (currentStepsType > -1){
clearInterval(stepsIntervalId);
currentStepsType = -1;
};
}
private function playRandomStepSample():void{
var _local1:Sound;
if (stepsLoaded){
if ((((currentStepsType == STONE_WALK)) || ((currentStepsType == STONE_RUN)))){
_local1 = stoneSounds[Math.round(MathUtils.random(0, (stoneSounds.length - 1)))];
} else {
_local1 = grassSounds[Math.round(MathUtils.random(0, (grassSounds.length - 1)))];
};
if (_local1 != null){
_local1.play(0, 0, new SoundTransform(3));
};
};
}
private function addVolume():void{
environmentTransform.volume = (environmentTransform.volume + 0.02);
if (environmentTransform.volume >= 4){
environmentTransform.volume = 4;
clearInterval(volumeIntervalId);
};
environmentChannel.soundTransform = environmentTransform;
}
public function playSteps(_arg1:uint):void{
if (currentStepsType != _arg1){
stopSteps();
currentStepsType = _arg1;
playRandomStepSample();
stepsIntervalId = setInterval(playRandomStepSample, ((((_arg1 == STONE_WALK)) || ((_arg1 == GRASS_WALK)))) ? 500 : 300);
};
}
private function onLoadError(_arg1:IOErrorEvent):void{
loadNext();
}
public function load(_arg1:Function):String{
this.onLoadMethod = _arg1;
loadNext();
return ("Loading sound");
}
private function loadNext():void{
counter++;
if (sound != null){
sound.removeEventListener(Event.COMPLETE, onLoadComplete);
sound.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
sound.removeEventListener(IOErrorEvent.NETWORK_ERROR, onLoadError);
sound.removeEventListener(IOErrorEvent.VERIFY_ERROR, onLoadError);
};
if (counter < sequence.length){
sound = new Sound();
sound.addEventListener(Event.COMPLETE, onLoadComplete);
sound.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
sound.addEventListener(IOErrorEvent.NETWORK_ERROR, onLoadError);
sound.addEventListener(IOErrorEvent.VERIFY_ERROR, onLoadError);
sound.load(new URLRequest(sequence[counter]), new SoundLoaderContext());
} else {
onLoadMethod.call();
onLoadMethod = null;
sound = null;
};
}
private function onLoadComplete(_arg1:Event):void{
if (counter < 4){
stoneSounds.push(sound);
} else {
if (counter < 8){
grassSounds.push(sound);
if (counter == 7){
stepsLoaded = true;
};
} else {
environmentLoaded = true;
environmentSound = sound;
environmentTransform = new SoundTransform(0);
environmentChannel = environmentSound.play(0, 1000000, environmentTransform);
volumeIntervalId = setInterval(addVolume, 100);
};
};
loadNext();
}
}
}//package temple
Section 72
//Stairs (temple.Stairs)
package temple {
import flash.display.*;
import alternativa.types.*;
import alternativa.engine3d.materials.*;
import flash.geom.*;
public class Stairs extends TextureLoader {
public var material:TextureMaterial;
private static const texture:Texture = new Texture(new Bmp().bitmapData);
private static const Bmp:Class = Stairs_Bmp;
public function Stairs(){
material = new TextureMaterial(texture, 1, false, true, BlendMode.NORMAL, -1, 0xFFFFFF);
super("Stairs");
bindings = [new TextureMaterialBinding([material], "stairs.jpg")];
loadingMessage = "Loading stairs texture";
x = 43.3920822143555;
y = 33.4864082336426;
createVertex(220.472450256348, -200.787403106689, 0, "1");
createVertex(-265.014610290527, 245.329570770264, -39.410472869873, "194");
createVertex(220.472450256348, 200.787395477295, 0, "3");
createVertex(-265.014610290527, 245.329570770264, -31.4290885925293, "196");
createVertex(-242.743522644043, 223.058483123779, -23.6077156066895, "135");
createVertex(-220.472434997559, -200.787403106689, -7.8321647644043, "8");
createVertex(220.472450256348, -200.787403106689, -7.8321647644043, "9");
createVertex(-231.60799407959, -211.922946929932, -7.8321647644043, "75");
createVertex(-231.60799407959, 211.922939300537, -7.8321647644043, "76");
createVertex(-242.743522644043, 223.058483123779, -15.8264818191528, "14");
createVertex(242.743537902832, -223.058490753174, -23.6077175140381, "143");
createVertex(265.014625549316, 245.329570770264, -39.410472869873, "200");
createVertex(253.879066467285, 234.194042205811, -23.6077156066895, "145");
createVertex(253.879066467285, -234.194034576416, -23.6077175140381, "146");
createVertex(231.607978820801, 211.922939300537, -7.8321647644043, "83");
createVertex(231.607978820801, -211.922946929932, -7.8321647644043, "84");
createVertex(265.014625549316, -245.329578399658, -39.4104766845703, "206");
createVertex(-242.743522644043, -223.058490753174, -23.6077175140381, "24");
createVertex(-231.60799407959, 211.922939300537, -15.8264818191528, "81");
createVertex(-231.60799407959, -211.922946929932, -15.8264818191528, "90");
createVertex(-265.014610290527, -245.329578399658, -39.4104766845703, "204");
createVertex(-253.879081726074, 234.194042205811, -23.6077156066895, "154");
createVertex(231.607978820801, 211.922939300537, -15.8264818191528, "100");
createVertex(-253.879081726074, -234.194034576416, -31.4290904998779, "166");
createVertex(242.743537902832, 223.058483123779, -15.8264818191528, "103");
createVertex(231.607978820801, -211.922946929932, -15.8264818191528, "105");
createVertex(-220.472434997559, -200.787403106689, 0, "42");
createVertex(-253.879081726074, 234.194042205811, -31.4290885925293, "172");
createVertex(253.879066467285, -234.194034576416, -31.4290904998779, "167");
createVertex(253.879066467285, 234.194042205811, -31.4290885925293, "176");
createVertex(242.743537902832, -223.058490753174, -15.8264818191528, "113");
createVertex(-253.879081726074, -234.194034576416, -23.6077175140381, "170");
createVertex(220.472450256348, 200.787395477295, -7.8321647644043, "52");
createVertex(-220.472434997559, 200.787395477295, -7.8321647644043, "53");
createVertex(265.014625549316, 245.329570770264, -31.4290885925293, "183");
createVertex(-220.472434997559, 200.787395477295, 0, "49");
createVertex(242.743537902832, 223.058483123779, -23.6077156066895, "123");
createVertex(-265.014610290527, -245.329578399658, -31.4290904998779, "188");
createVertex(265.014625549316, -245.329578399658, -31.4290904998779, "189");
createVertex(-242.743522644043, -223.058490753174, -15.8264818191528, "127");
createFace(["103", "113", "143", "123"], "0");
setUVsToFace(new Point(0, 0.90618902683278), new Point(0.557688176631927, 0.906189024448395), new Point(0.557688176631927, 0.915916383266449), "0");
createFace(["135", "154", "170", "24"], "1");
setUVsToFace(new Point(0.0139205250889063, 0.64684009552002), new Point(0, 0.632919609546661), new Point(0.585529088973999, 0.632919609546661), "1");
createFace(["167", "176", "145", "146"], "2");
setUVsToFace(new Point(0.585529148578644, 0.9040167927742), new Point(0, 0.9040167927742), new Point(0, 0.894239366054535), "2");
createFace(["146", "170", "166", "167"], "3");
setUVsToFace(new Point(0, 0.797910153865814), new Point(0.634745419025421, 0.797910153865814), new Point(0.634745419025421, 0.807687640190125), "3");
createFace(["84", "83", "52", "9"], "4");
setUVsToFace(new Point(0.529847144726988, 0.743396162986755), new Point(0, 0.743396162986755), new Point(0.0139204645529389, 0.729475677013397), "4");
createFace(["113", "103", "100", "105"], "5");
setUVsToFace(new Point(0.557688243290996, 0.727303445339203), new Point(0, 0.727303445339203), new Point(0.0139204645529389, 0.713383138179779), "5");
createFace(["103", "14", "81", "100"], "6");
setUVsToFace(new Point(-1.9431282138882E-9, 0.600734412670135), new Point(0.606904447078705, 0.600734412670135), new Point(0.592983901500702, 0.614654839038849), "6");
createFace(["194", "204", "188", "196"], "7");
setUVsToFace(new Point(0.61337012052536, 0.819837388992107), new Point(0, 0.819837391376495), new Point(0, 0.809859812259674), "7");
createFace(["189", "188", "204", "206"], "8");
setUVsToFace(new Point(0, 0.773810803890228), new Point(0.662586331367493, 0.773810803890228), new Point(0.662586331367493, 0.783788323402405), "8");
createFace(["113", "127", "24", "143"], "9");
setUVsToFace(new Point(0, 0.834159195423126), new Point(0.60690450668335, 0.834159195423126), new Point(0.60690450668335, 0.843886435031891), "9");
createFace(["81", "90", "75", "76"], "74");
setUVsToFace(new Point(0.529847383499146, 0.976073741912842), new Point(0, 0.976073741912842), new Point(0, 0.966080069541931), "74");
createFace(["170", "154", "172", "166"], "11");
setUVsToFace(new Point(0, 0.882289588451385), new Point(0.585529088973999, 0.882289588451385), new Point(0.585529088973999, 0.892067193984985), "11");
createFace(["14", "103", "123", "135"], "12");
setUVsToFace(new Point(0, 0.84605860710144), new Point(0.606904447078705, 0.84605860710144), new Point(0.606904447078705, 0.855785846710205), "12");
createFace(["8", "75", "84", "9"], "13");
setUVsToFace(new Point(0.56514310836792, 0.681197643280029), new Point(0.579063534736633, 0.695118188858032), new Point(0, 0.695118188858032), "13");
createFace(["135", "24", "127", "14"], "14");
setUVsToFace(new Point(0.557688176631927, 0.927815792560407), new Point(0, 0.927815794944763), new Point(0, 0.918088555335999), "14");
createFace(["8", "42", "49", "53"], "15");
setUVsToFace(new Point(0, 1), new Point(0, 0.990209102630615), new Point(0.502006351947784, 0.990209102630615), "15");
createFace(["183", "189", "206", "200"], "16");
setUVsToFace(new Point(0, 0.82200956583039), new Point(0.613370060920715, 0.822009563446045), new Point(0.613370060920715, 0.831986963748932), "16");
createFace(["176", "172", "154", "145"], "17");
setUVsToFace(new Point(0.634745478630066, 0.795737981796265), new Point(0, 0.795737981796265), new Point(0, 0.785960555076599), "17");
createFace(["9", "1", "42", "8"], "18");
setUVsToFace(new Point(0, 0.951741993427277), new Point(0, 0.941951096057892), new Point(0.551222503185272, 0.941951096057892), "18");
createFace(["176", "183", "196", "172"], "19");
setUVsToFace(new Point(0.0139204645529389, 0.534191608428955), new Point(0, 0.520271182060242), new Point(0.662586271762848, 0.520271182060242), "19");
createFace(["167", "189", "183", "176"], "20");
setUVsToFace(new Point(0.599449574947357, 0.584641873836517), new Point(0.613370060920715, 0.598562240600586), new Point(0, 0.598562240600586), "20");
createFace(["1", "3", "49", "42"], "21");
setUVsToFace(new Point(0, 0.502006232738495), new Point(0, 0), new Point(0.551222503185272, 0), "21");
createFace(["14", "127", "90", "81"], "22");
setUVsToFace(new Point(-6.66590682651957E-8, 0.697290360927582), new Point(0.557688176631927, 0.697290360927582), new Point(0.543767750263214, 0.711210906505585), "22");
createFace(["84", "75", "90", "105"], "23");
setUVsToFace(new Point(0, 0.857958078384399), new Point(0.579063534736633, 0.857958078384399), new Point(0.579063534736633, 0.867951691150665), "23");
createFace(["127", "113", "105", "90"], "24");
setUVsToFace(new Point(0.606904449021833, 0.630747437477112), new Point(0, 0.630747437477112), new Point(0.0139204049482942, 0.616827011108398), "24");
createFace(["145", "154", "135", "123"], "25");
setUVsToFace(new Point(-6.79098394185118E-8, 0.552456557750702), new Point(0.634745478630066, 0.552456557750702), new Point(0.620825052261353, 0.566376984119415), "25");
createFace(["3", "52", "53", "49"], "26");
setUVsToFace(new Point(0.551222562789917, 0.929987967014313), new Point(0.551222562789917, 0.939778864383698), new Point(0, 0.939778864383698), "26");
createFace(["143", "146", "145", "123"], "10");
setUVsToFace(new Point(0.571608662605286, 0.649012267589569), new Point(0.585529088973999, 0.662932753562927), new Point(0, 0.662932753562927), "10");
createFace(["1", "9", "52", "3"], "28");
setUVsToFace(new Point(0.502006351947784, 0.978245913982391), new Point(0.502006351947784, 0.988036870956421), new Point(0, 0.988036870956421), "28");
createFace(["196", "183", "200", "194"], "29");
setUVsToFace(new Point(0, 0.761661052703857), new Point(0.662586450576782, 0.761661052703857), new Point(0.662586450576782, 0.771638572216034), "29");
createFace(["76", "83", "100", "81"], "34");
setUVsToFace(new Point(0, 0.870123863220215), new Point(0.579063475131989, 0.870123863220215), new Point(0.579063475131989, 0.880117416381836), "34");
createFace(["188", "189", "167", "166"], "35");
setUVsToFace(new Point(0.662586270185876, 0.518098950386047), new Point(0, 0.518098950386047), new Point(0.0139204645529389, 0.504178464412689), "35");
createFace(["24", "170", "146", "143"], "38");
setUVsToFace(new Point(0.620825052261353, 0.536363840103149), new Point(0.634745478630066, 0.550284326076508), new Point(0, 0.550284326076508), "38");
createFace(["172", "196", "188", "166"], "39");
setUVsToFace(new Point(0.0139205250889063, 0.582469701766968), new Point(0, 0.56854921579361), new Point(0.613370060920715, 0.56854921579361), "39");
createFace(["83", "84", "105", "100"], "40");
setUVsToFace(new Point(0, 0.953914165496826), new Point(0.529847383499146, 0.953914165496826), new Point(0.529847383499146, 0.963907897472382), "40");
createFace(["76", "75", "8", "53"], "27");
setUVsToFace(new Point(3.53578499812102E-10, 0.74556839466095), new Point(0.529847145080566, 0.74556839466095), new Point(0.515926659107208, 0.759488821029663), "27");
createFace(["52", "83", "76", "53"], "54");
setUVsToFace(new Point(0.0139205250889063, 0.67902547121048), new Point(0, 0.665104925632477), new Point(0.579063534736633, 0.665104925632477), "54");
createSurface(["29", "9", "74", "26", "17", "23", "0", "38", "3", "8", "21", "16", "5", "39", "35", "10", "14", "11", "27", "20", "18", "7", "22", "4", "25", "13", "54", "15", "1", "2", "34", "40", "6", "28", "24", "12", "19"], "Stairs");
setMaterialToSurface(material, "Stairs");
}
}
}//package temple
Section 73
//Stairs_Bmp (temple.Stairs_Bmp)
package temple {
import mx.core.*;
public class Stairs_Bmp extends BitmapAsset {
}
}//package temple
Section 74
//Stones (temple.Stones)
package temple {
import flash.display.*;
import alternativa.types.*;
import alternativa.engine3d.materials.*;
import flash.geom.*;
public class Stones extends TextureLoader {
public var material:TextureMaterial;
private static const texture:Texture = new Texture(new Bmp().bitmapData);
private static const Bmp:Class = Stones_Bmp;
public function Stones(){
material = new TextureMaterial(texture, 1, false, true, BlendMode.NORMAL, -1, 0xFFFFFF);
super("Stones");
bindings = [new TextureMaterialBinding([material], "stones.jpg")];
loadingMessage = "Loading stones texture";
coords = new Point3D(-135.620376586914, -130.174331665039, 235.888412475586);
createVertex(21.6535415649414, 88.5826644897461, 0, "128");
createVertex(21.6535415649414, -21.6535491943359, 0, "1");
createVertex(-21.6535491943359, 21.6535415649414, 0, "2");
createVertex(21.6535415649414, 21.6535415649414, 0, "3");
createVertex(-21.6535491943359, -21.6535491943359, 5.51181030273438, "4");
createVertex(21.6535415649414, 131.889755249023, 5.51181030273438, "133");
createVertex(-21.6535491943359, 21.6535415649414, 5.51181030273438, "6");
createVertex(20.1947021484375, -4.06436157226563, 5.55728149414063, "383");
createVertex(214.566909790039, 352.362182617188, 0, "256");
createVertex(-21.6535491943359, 131.889755249023, 0, "10");
createVertex(-21.6535491943359, 88.5826644897461, 5.51181030273438, "12");
createVertex(375.984222412109, 309.055114746094, 5.51181030273438, "271");
createVertex(-21.6535491943359, 198.818878173828, 0, "16");
createVertex(21.6535415649414, 198.818878173828, 0, "17");
createVertex(-21.6535491943359, 242.1259765625, 0, "18");
createVertex(21.6535415649414, 131.889755249023, 0, "130");
createVertex(21.6535415649414, 198.818878173828, 5.51181030273438, "21");
createVertex(375.984222412109, 352.362182617188, 0, "278");
createVertex(21.6535415649414, 242.1259765625, 5.51181030273438, "23");
createVertex(-21.6535491943359, 309.055114746094, 0, "24");
createVertex(375.984222412109, 309.055114746094, 0, "273");
createVertex(21.6535415649414, 242.1259765625, 0, "154");
createVertex(332.677154541016, 352.362182617188, 5.51181030273438, "283");
createVertex(-21.6535491943359, 309.055114746094, 5.51181030273438, "28");
createVertex(21.6535415649414, 309.055114746094, 5.51181030273438, "29");
createVertex(-21.6535491943359, 352.362182617188, 5.51181030273438, "30");
createVertex(21.6535415649414, 352.362182617188, 5.51181030273438, "31");
createVertex(342.129638671875, 311.401947021484, 5.55728149414063, "32");
createVertex(20.1947021484375, -4.06436157226563, 37.0533599853516, "379");
createVertex(342.129638671875, 311.401947021484, 37.0533599853516, "34");
createVertex(-21.6535491943359, 242.1259765625, 5.51181030273438, "163");
createVertex(332.677154541016, 352.362182617188, 0, "284");
createVertex(-19.5843811035156, 349.299560546875, 5.55728149414063, "37");
createVertex(-21.6535491943359, 198.818878173828, 5.51181030273438, "167");
createVertex(96.4566955566406, 309.055114746094, 0, "40");
createVertex(-21.6535491943359, 131.889755249023, 5.51181030273438, "132");
createVertex(139.763778686523, 352.362182617188, 0, "43");
createVertex(375.984222412109, 21.6535415649414, 0, "351");
createVertex(375.984222412109, 198.818878173828, 5.51181030273438, "293");
createVertex(139.763778686523, 352.362182617188, 5.51181030273438, "47");
createVertex(21.6535415649414, 309.055114746094, 0, "176");
createVertex(257.873992919922, 309.055114746094, 0, "49");
createVertex(332.677154541016, 198.818878173828, 5.51181030273438, "306");
createVertex(257.873992919922, 352.362182617188, 0, "51");
createVertex(214.566909790039, 309.055114746094, 5.51181030273438, "258");
createVertex(214.566909790039, 352.362182617188, 5.51181030273438, "54");
createVertex(21.6535415649414, 352.362182617188, 0, "183");
createVertex(332.677154541016, 309.055114746094, 0, "56");
createVertex(332.677154541016, 242.1259765625, 5.51181030273438, "307");
createVertex(332.677154541016, 309.055114746094, 5.51181030273438, "60");
createVertex(-21.6535491943359, 352.362182617188, 0, "189");
createVertex(332.677154541016, 198.818878173828, 0, "310");
createVertex(375.984222412109, 352.362182617188, 5.51181030273438, "63");
createVertex(375.984222412109, 242.1259765625, 0, "303");
createVertex(375.984222412109, 198.818878173828, 0, "65");
createVertex(332.677154541016, 242.1259765625, 0, "66");
createVertex(375.984222412109, 88.5826644897461, 0, "316");
createVertex(375.984222412109, 88.5826644897461, 5.51181030273438, "317");
createVertex(-19.5843811035156, 349.299560546875, 37.0533599853516, "198");
createVertex(-19.4427947998047, 310.096160888672, 5.55728149414063, "201");
createVertex(-19.4427947998047, 310.096160888672, 37.0533599853516, "202");
createVertex(332.677154541016, 131.889755249023, 5.51181030273438, "331");
createVertex(341.988037109375, 350.605346679688, 37.0533599853516, "204");
createVertex(332.677154541016, 131.889755249023, 0, "333");
createVertex(375.984222412109, 131.889755249023, 0, "326");
createVertex(375.984222412109, 131.889755249023, 5.51181030273438, "79");
createVertex(375.984222412109, -21.6535491943359, 0, "81");
createVertex(341.988037109375, 350.605346679688, 5.55728149414063, "210");
createVertex(332.677154541016, -21.6535491943359, 5.51181030273438, "84");
createVertex(332.677154541016, 88.5826644897461, 0, "334");
createVertex(332.677154541016, 88.5826644897461, 5.51181030273438, "335");
createVertex(139.763778686523, 309.055114746094, 5.51181030273438, "216");
createVertex(96.4566955566406, 309.055114746094, 5.51181030273438, "217");
createVertex(375.984222412109, 21.6535415649414, 5.51181030273438, "347");
createVertex(139.763778686523, 309.055114746094, 0, "220");
createVertex(18.9970550537109, 106.165351867676, 5.55728149414063, "93");
createVertex(18.9970626831055, 106.165351867676, 37.0533599853516, "95");
createVertex(-21.6535491943359, -21.6535491943359, 0, "99");
createVertex(332.677154541016, 21.6535415649414, 5.51181030273438, "348");
createVertex(332.677154541016, 21.6535415649414, 0, "357");
createVertex(332.677154541016, -21.6535491943359, 0, "358");
createVertex(21.6535415649414, -21.6535491943359, 5.51181030273438, "103");
createVertex(375.984222412109, -21.6535491943359, 5.51181030273438, "343");
createVertex(375.984222412109, 242.1259765625, 5.51181030273438, "299");
createVertex(96.4566955566406, 352.362182617188, 5.51181030273438, "235");
createVertex(21.6535415649414, 21.6535415649414, 5.51181030273438, "109");
createVertex(257.873992919922, 309.055114746094, 5.51181030273438, "240");
createVertex(-20.2042694091797, 105.73942565918, 5.55728149414063, "369");
createVertex(214.566909790039, 309.055114746094, 0, "242");
createVertex(96.4566955566406, 352.362182617188, 0, "237");
createVertex(-20.2042694091797, 105.73942565918, 37.0533599853516, "374");
createVertex(-19.0066375732422, -4.49028015136719, 37.0533599853516, "376");
createVertex(-21.6535491943359, 88.5826644897461, 0, "122");
createVertex(-19.0066375732422, -4.49028015136719, 5.55728149414063, "362");
createVertex(257.873992919922, 352.362182617188, 5.51181030273438, "253");
createVertex(21.6535415649414, 88.5826644897461, 5.51181030273438, "127");
createFace(["204", "34", "32", "210"], "0");
setUVsToFace(new Point(0.520313441753387, 0.415210008621216), new Point(0.520313441753387, 0.307044476270676), new Point(0.607213735580444, 0.307044476270676), "0");
createFace(["16", "167", "163", "18"], "1");
setUVsToFace(new Point(0.989486038684845, 0.120488002896309), new Point(0.974278390407562, 0.120488002896309), new Point(0.974278390407562, 0.00100000004749745), "1");
createFace(["343", "347", "348", "84"], "2");
setUVsToFace(new Point(0.731479823589325, 0.609907448291779), new Point(0.731479823589325, 0.490419447422028), new Point(0.850967764854431, 0.490419447422028), "2");
createFace(["362", "383", "379", "376"], "3");
setUVsToFace(new Point(0.817424654960632, 0.85461699962616), new Point(0.817424654960632, 0.962776899337769), new Point(0.730524241924286, 0.962776899337769), "3");
createFace(["220", "216", "217", "40"], "4");
setUVsToFace(new Point(0.586877465248108, 0.536609172821045), new Point(0.57166987657547, 0.536609172821045), new Point(0.57166987657547, 0.417121291160583), "4");
createFace(["18", "154", "17", "16"], "5");
setUVsToFace(new Point(0.728613078594208, 0.242842867970467), new Point(0.609125077724457, 0.242842867970467), new Point(0.609125077724457, 0.123354867100716), "5");
createFace(["2", "6", "109", "3"], "6");
setUVsToFace(new Point(0.510001540184021, 0.858237743377686), new Point(0.494793951511383, 0.858237743377686), new Point(0.494793951511383, 0.738749802112579), "6");
createFace(["357", "348", "347", "351"], "7");
setUVsToFace(new Point(0.552639842033386, 0.900806844234467), new Point(0.537432253360748, 0.900806844234467), new Point(0.537432253360748, 0.781318962574005), "7");
createFace(["271", "63", "283", "60"], "8");
setUVsToFace(new Point(0.850012123584747, 0.734173536300659), new Point(0.850012123584747, 0.853661358356476), new Point(0.730524241924286, 0.853661358356476), "8");
createFace(["316", "334", "333", "326"], "9");
setUVsToFace(new Point(0.609125077724457, 0.490419447422028), new Point(0.728612959384918, 0.490419447422028), new Point(0.728612959384918, 0.609907388687134), "9");
createFace(["204", "210", "37", "198"], "10");
setUVsToFace(new Point(0.317170739173889, 0.00100000004749745), new Point(0.404071062803268, 0.00100000004749745), new Point(0.404071062803268, 0.998609304428101), "10");
createFace(["65", "293", "306", "310"], "11");
setUVsToFace(new Point(0.951769530773163, 0.963732540607452), new Point(0.93656188249588, 0.963732540607452), new Point(0.93656188249588, 0.844244599342346), "11");
createFace(["316", "317", "335", "334"], "12");
setUVsToFace(new Point(0.986007213592529, 0.963732540607452), new Point(0.970799565315247, 0.963732540607452), new Point(0.970799565315247, 0.844244599342346), "12");
createFace(["383", "93", "95", "379"], "13");
setUVsToFace(new Point(0.607213735580444, 0.00100000004749745), new Point(0.607213735580444, 0.30513322353363), new Point(0.520313441753387, 0.30513322353363), "13");
createFace(["30", "28", "29", "31"], "14");
setUVsToFace(new Point(0.609125077724457, 0.612774312496185), new Point(0.728612959384918, 0.612774312496185), new Point(0.728612959384918, 0.732262313365936), "14");
createFace(["37", "201", "202", "198"], "15");
setUVsToFace(new Point(0.938823759555817, 0.612774312496185), new Point(0.938823759555817, 0.720939874649048), new Point(0.85192334651947, 0.720939874649048), "15");
createFace(["127", "128", "130", "133"], "16");
setUVsToFace(new Point(0.975233793258667, 0.490419447422028), new Point(0.99044144153595, 0.490419447422028), new Point(0.99044144153595, 0.609907388687134), "16");
createFace(["317", "79", "331", "335"], "17");
setUVsToFace(new Point(0.73147988319397, 0.365197718143463), new Point(0.73147988319397, 0.245709747076035), new Point(0.850967824459076, 0.245709747076035), "17");
createFace(["351", "347", "343", "81"], "18");
setUVsToFace(new Point(0.535521030426025, 0.658008575439453), new Point(0.520313441753387, 0.658008575439453), new Point(0.520313441753387, 0.538520514965057), "18");
createFace(["189", "30", "31", "183"], "19");
setUVsToFace(new Point(0.90041309595108, 0.963732540607452), new Point(0.885205388069153, 0.963732540607452), new Point(0.885205388069153, 0.844244599342346), "19");
createFace(["56", "60", "283", "284"], "20");
setUVsToFace(new Point(0.990180373191833, 0.732262253761292), new Point(0.974972724914551, 0.732262253761292), new Point(0.974972724914551, 0.612774312496185), "20");
createFace(["333", "331", "79", "326"], "21");
setUVsToFace(new Point(0.569758653640747, 0.779407680034637), new Point(0.554551124572754, 0.779407680034637), new Point(0.554551124572754, 0.659919738769531), "21");
createFace(["51", "253", "240", "49"], "22");
setUVsToFace(new Point(0.603996336460114, 0.900806844234467), new Point(0.588788747787476, 0.900806844234467), new Point(0.588788747787476, 0.781318962574005), "22");
createFace(["154", "23", "21", "17"], "23");
setUVsToFace(new Point(0.510001540184021, 0.736838579177856), new Point(0.494793951511383, 0.736838579177856), new Point(0.494793951511383, 0.617350578308105), "23");
createFace(["358", "84", "348", "357"], "24");
setUVsToFace(new Point(0.552639842033386, 0.536609292030334), new Point(0.537432253360748, 0.536609292030334), new Point(0.537432253360748, 0.417121291160583), "24");
createFace(["60", "56", "273", "271"], "25");
setUVsToFace(new Point(0.554551124572754, 0.781318962574005), new Point(0.569758653640747, 0.781318962574005), new Point(0.569758653640747, 0.900806844234467), "25");
createFace(["10", "130", "128", "122"], "26");
setUVsToFace(new Point(0.850967824459076, 0.120487980544567), new Point(0.73147988319397, 0.120487980544567), new Point(0.73147988319397, 0.00100000004749745), "26");
createFace(["240", "253", "54", "258"], "27");
setUVsToFace(new Point(0.973322510719299, 0.487552553415298), new Point(0.853834629058838, 0.487552553415298), new Point(0.853834629058838, 0.36806458234787), "27");
createFace(["293", "299", "307", "306"], "28");
setUVsToFace(new Point(0.609125077724457, 0.487552583217621), new Point(0.609125077724457, 0.36806458234787), new Point(0.728612959384918, 0.36806458234787), "28");
createFace(["1", "103", "4", "99"], "29");
setUVsToFace(new Point(0.883294224739075, 0.963732540607452), new Point(0.868086576461792, 0.963732540607452), new Point(0.868086576461792, 0.844244599342346), "29");
createFace(["10", "132", "133", "130"], "30");
setUVsToFace(new Point(0.510001540184021, 0.979636907577515), new Point(0.494793951511383, 0.979636907577515), new Point(0.494793951511383, 0.860148966312408), "30");
createFace(["81", "343", "84", "358"], "31");
setUVsToFace(new Point(0.586877465248108, 0.900806844234467), new Point(0.57166987657547, 0.900806844234467), new Point(0.57166987657547, 0.781318962574005), "31");
createFace(["24", "28", "30", "189"], "32");
setUVsToFace(new Point(0.586877465248108, 0.779407680034637), new Point(0.57166987657547, 0.779407680034637), new Point(0.57166987657547, 0.659919738769531), "32");
createFace(["12", "122", "128", "127"], "33");
setUVsToFace(new Point(0.520313441753387, 0.659919679164886), new Point(0.535521030426025, 0.659919679164886), new Point(0.535521030426025, 0.779407680034637), "33");
createFace(["357", "351", "81", "358"], "34");
setUVsToFace(new Point(0.850967764854431, 0.487552583217621), new Point(0.731479823589325, 0.487552583217621), new Point(0.731479823589325, 0.36806458234787), "34");
createFace(["216", "47", "235", "217"], "35");
setUVsToFace(new Point(0.728612959384918, 0.853661358356476), new Point(0.609125077724457, 0.853661358356476), new Point(0.609125077724457, 0.734173536300659), "35");
createFace(["369", "374", "95", "93"], "36");
setUVsToFace(new Point(0.937868058681488, 0.842333376407623), new Point(0.850967645645142, 0.842333376407623), new Point(0.850967645645142, 0.734173536300659), "36");
createFace(["65", "310", "66", "303"], "37");
setUVsToFace(new Point(0.851923525333405, 0.123354867100716), new Point(0.971411466598511, 0.123354867100716), new Point(0.971411466598511, 0.242842867970467), "37");
createFace(["307", "66", "310", "306"], "38");
setUVsToFace(new Point(0.975233912467957, 0.245709747076035), new Point(0.990441560745239, 0.245709747076035), new Point(0.990441560745239, 0.365197718143463), "38");
createFace(["1", "99", "2", "3"], "39");
setUVsToFace(new Point(0.973322689533234, 0.120487973093987), new Point(0.853834807872772, 0.120487973093987), new Point(0.853834807872772, 0.00100000004749745), "39");
createFace(["253", "51", "256", "54"], "40");
setUVsToFace(new Point(0.902324199676514, 0.844244599342346), new Point(0.917531847953796, 0.844244599342346), new Point(0.917531847953796, 0.963732540607452), "40");
createFace(["176", "24", "189", "183"], "41");
setUVsToFace(new Point(0.853834748268127, 0.365197718143463), new Point(0.853834748268127, 0.245709747076035), new Point(0.973322570323944, 0.245709747076035), "41");
createFace(["334", "335", "331", "333"], "42");
setUVsToFace(new Point(0.99044144153595, 0.487552583217621), new Point(0.975233793258667, 0.487552583217621), new Point(0.975233793258667, 0.36806458234787), "42");
createFace(["23", "154", "18", "163"], "144");
setUVsToFace(new Point(0.537432253360748, 0.538520514965057), new Point(0.552639842033386, 0.538520514965057), new Point(0.552639842033386, 0.658008575439453), "144");
createFace(["202", "34", "204", "198"], "44");
setUVsToFace(new Point(0.226447895169258, 0.00139064877294004), new Point(0.222845122218132, 0.998999995253851), new Point(0.114679574966431, 0.998609304428101), "44");
createFace(["63", "278", "284", "283"], "45");
setUVsToFace(new Point(0.953680753707886, 0.844244599342346), new Point(0.968888342380524, 0.844244599342346), new Point(0.968888342380524, 0.963732540607452), "45");
createFace(["201", "32", "34", "202"], "46");
setUVsToFace(new Point(0.315259456634521, 0.00100000004749745), new Point(0.315259456634521, 0.99860942363739), new Point(0.228359147906303, 0.99860942363739), "46");
createFace(["176", "29", "28", "24"], "47");
setUVsToFace(new Point(0.535521030426025, 0.900806844234467), new Point(0.520313441753387, 0.900806844234467), new Point(0.520313441753387, 0.781318962574005), "47");
createFace(["220", "40", "237", "43"], "48");
setUVsToFace(new Point(0.853834629058838, 0.609907388687134), new Point(0.853834629058838, 0.490419447422028), new Point(0.973322510719299, 0.490419447422028), "48");
createFace(["326", "79", "317", "316"], "49");
setUVsToFace(new Point(0.834543466567993, 0.974105000495911), new Point(0.819335877895355, 0.974105000495911), new Point(0.819335877895355, 0.85461699962616), "49");
createFace(["127", "133", "132", "12"], "50");
setUVsToFace(new Point(0.609125077724457, 0.365197718143463), new Point(0.609125077724457, 0.245709747076035), new Point(0.728613078594208, 0.245709747076035), "50");
createFace(["29", "176", "183", "31"], "51");
setUVsToFace(new Point(0.588788747787476, 0.538520514965057), new Point(0.603996336460114, 0.538520514965057), new Point(0.603996336460114, 0.658008456230164), "51");
createFace(["376", "379", "95", "374"], "52");
setUVsToFace(new Point(0.514142176697429, 0.614483633448902), new Point(0.405982345342636, 0.613308489322662), new Point(0.409286767244339, 0.309175282716751), "52");
createFace(["99", "4", "6", "2"], "53");
setUVsToFace(new Point(0.552639842033386, 0.779407680034637), new Point(0.537432253360748, 0.779407680034637), new Point(0.537432253360748, 0.659919679164886), "53");
createFace(["293", "65", "303", "299"], "56");
setUVsToFace(new Point(0.974278271198273, 0.123354867100716), new Point(0.989485919475555, 0.123354867100716), new Point(0.989485919475555, 0.242842867970467), "56");
createFace(["103", "109", "6", "4"], "57");
setUVsToFace(new Point(0.850967824459076, 0.123354889452457), new Point(0.850967824459076, 0.242842853069305), new Point(0.73147988319397, 0.242842853069305), "57");
createFace(["299", "303", "66", "307"], "60");
setUVsToFace(new Point(0.588788747787476, 0.659919738769531), new Point(0.603996336460114, 0.659919738769531), new Point(0.603996336460114, 0.779407680034637), "60");
createFace(["54", "256", "242", "258"], "61");
setUVsToFace(new Point(0.957853853702545, 0.612774312496185), new Point(0.973061501979828, 0.612774312496185), new Point(0.973061501979828, 0.732262253761292), "61");
createFace(["376", "374", "369", "362"], "64");
setUVsToFace(new Point(0.405982345342636, 0.921483814716339), new Point(0.405982345342636, 0.617350578308105), new Point(0.492882698774338, 0.617350578308105), "64");
createFace(["40", "217", "235", "237"], "65");
setUVsToFace(new Point(0.603996336460114, 0.536609172821045), new Point(0.588788747787476, 0.536609172821045), new Point(0.588788747787476, 0.417121291160583), "65");
createFace(["3", "109", "103", "1"], "66");
setUVsToFace(new Point(0.866175413131714, 0.963732540607452), new Point(0.850967764854431, 0.963732540607452), new Point(0.850967764854431, 0.844244599342346), "66");
createFace(["237", "235", "47", "43"], "67");
setUVsToFace(new Point(0.955942690372467, 0.732262253761292), new Point(0.940735042095184, 0.732262253761292), new Point(0.940735042095184, 0.612774312496185), "67");
createFace(["21", "23", "163", "167"], "68");
setUVsToFace(new Point(0.609125077724457, 0.120488002896309), new Point(0.609125077724457, 0.00100000004749745), new Point(0.728613078594208, 0.00100000004749745), "68");
createFace(["273", "56", "284", "278"], "69");
setUVsToFace(new Point(0.728612959384918, 0.97506058216095), new Point(0.609125077724457, 0.97506058216095), new Point(0.609125077724457, 0.855572700500488), "69");
createFace(["49", "242", "256", "51"], "70");
setUVsToFace(new Point(0.730524241924286, 0.732262313365936), new Point(0.730524241924286, 0.612774312496185), new Point(0.850012123584747, 0.612774312496185), "70");
createFace(["278", "63", "271", "273"], "71");
setUVsToFace(new Point(0.586877465248108, 0.658008456230164), new Point(0.57166987657547, 0.658008456230164), new Point(0.57166987657547, 0.538520514965057), "71");
createFace(["216", "220", "43", "47"], "72");
setUVsToFace(new Point(0.919443070888519, 0.844244599342346), new Point(0.934650719165802, 0.844244599342346), new Point(0.934650719165802, 0.963732540607452), "72");
createFace(["122", "12", "132", "10"], "73");
setUVsToFace(new Point(0.535521030426025, 0.536609292030334), new Point(0.520313441753387, 0.536609292030334), new Point(0.520313441753387, 0.417121291160583), "73");
createFace(["210", "32", "201", "37"], "74");
setUVsToFace(new Point(0.112768325139768, 0.998609322048853), new Point(0.0046027759090066, 0.999000012874603), new Point(0.00100000004749745, 0.00139064877294004), "74");
createFace(["93", "383", "362", "369"], "80");
setUVsToFace(new Point(0.409286767244339, 0.3063083589077), new Point(0.405982345342636, 0.00217514601536095), new Point(0.514142215251923, 0.00100000004749745), "80");
createFace(["17", "21", "167", "16"], "81");
setUVsToFace(new Point(0.569758653640747, 0.536609292030334), new Point(0.554551124572754, 0.536609292030334), new Point(0.554551124572754, 0.417121291160583), "81");
createFace(["258", "242", "49", "240"], "43");
setUVsToFace(new Point(0.554551124572754, 0.538520514965057), new Point(0.569758653640747, 0.538520514965057), new Point(0.569758653640747, 0.658008515834808), "43");
createSurface(["9", "64", "8", "22", "44", "48", "80", "49", "53", "56", "45", "81", "65", "68", "28", "67", "0", "30", "32", "10", "144", "57", "29", "46", "23", "70", "2", "26", "11", "34", "40", "4", "47", "71", "3", "51", "50", "33", "1", "13", "5", "12", "20", "72", "60", "41", "14", "16", "36", "42", "21", "66", "61", "43", "24", "17", "35", "37", "25", "27", "15", "31", "6", "52", "19", "38", "18", "73", "39", "69", "74", "7"], "Stones");
setMaterialToSurface(material, "Stones");
}
}
}//package temple
Section 75
//Stones_Bmp (temple.Stones_Bmp)
package temple {
import mx.core.*;
public class Stones_Bmp extends BitmapAsset {
}
}//package temple
Section 76
//TextInfo (temple.TextInfo)
package temple {
import flash.text.*;
public class TextInfo extends TextField {
public function TextInfo(){
autoSize = TextFieldAutoSize.LEFT;
selectable = false;
text = ("Alternativa3D 5.0\nDemo \"Temple\"" + "\n");
setTextFormat(new TextFormat("Tahoma", 10, 12281395));
defaultTextFormat = new TextFormat("Tahoma", 10, 0x333333);
}
public function write(_arg1:String):void{
appendText(("\n" + _arg1));
}
}
}//package temple
Section 77
//TextureLoader (temple.TextureLoader)
package temple {
import flash.events.*;
import flash.display.*;
import alternativa.types.*;
import alternativa.engine3d.core.*;
import alternativa.engine3d.materials.*;
import flash.system.*;
import flash.net.*;
import alternativa.utils.*;
public class TextureLoader extends Mesh {
private var loadingAlpha:Boolean;
private var loaderContext:LoaderContext;
protected var loadingMessage:String;
private var onLoadMethod:Function;
protected var bindings:Array;
private var request:URLRequest;
private var currentTextureIndex:int;
private var loader:Loader;
public function TextureLoader(_arg1:String=null){
super(_arg1);
}
private function onLoadComplete(_arg1:Event):void{
var _local3:BitmapData;
var _local4:TextureMaterial;
var _local2:TextureMaterialBinding = bindings[currentTextureIndex];
if (loadingAlpha){
_local2.alphaBitmapData = Bitmap(loader.content).bitmapData;
} else {
_local3 = Bitmap(loader.content).bitmapData;
if (_local2.alphaBitmapData != null){
_local3 = BitmapUtils.mergeBitmapAlpha(_local3, _local2.alphaBitmapData, true);
};
for each (_local4 in _local2.materials) {
_local4.texture = new Texture(_local3);
};
currentTextureIndex++;
};
loadNextTexture();
}
private function loadNextTexture():void{
var _local1:TextureMaterialBinding;
if (currentTextureIndex == bindings.length){
complete();
} else {
_local1 = bindings[currentTextureIndex];
if (((loadingAlpha) || ((_local1.alphaUrl == null)))){
request.url = _local1.textureUrl;
loadingAlpha = false;
} else {
request.url = _local1.alphaUrl;
loadingAlpha = true;
};
loader.load(request, loaderContext);
};
}
private function onLoadError(_arg1:ErrorEvent):void{
currentTextureIndex++;
loadingAlpha = false;
loadNextTexture();
}
public function load(_arg1:Function):String{
if (bindings == null){
_arg1.call();
} else {
this.onLoadMethod = _arg1;
request = new URLRequest();
loaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.NETWORK_ERROR, onLoadError);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.VERIFY_ERROR, onLoadError);
currentTextureIndex = 0;
loadNextTexture();
};
return (loadingMessage);
}
private function complete():void{
onLoadMethod.call();
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onLoadComplete);
loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
loader.contentLoaderInfo.removeEventListener(IOErrorEvent.NETWORK_ERROR, onLoadError);
loader.contentLoaderInfo.removeEventListener(IOErrorEvent.VERIFY_ERROR, onLoadError);
onLoadMethod = null;
loader = null;
bindings = null;
}
}
}//package temple
Section 78
//TextureMaterialBinding (temple.TextureMaterialBinding)
package temple {
import flash.display.*;
public class TextureMaterialBinding {
public var alphaUrl:String;
public var textureUrl:String;
public var alphaBitmapData:BitmapData;
public var materials:Array;
public function TextureMaterialBinding(_arg1:Array, _arg2:String, _arg3:String=null){
this.materials = _arg1;
this.textureUrl = _arg2;
this.alphaUrl = _arg3;
}
}
}//package temple
Section 79
//Wrecks (temple.Wrecks)
package temple {
import flash.display.*;
import alternativa.types.*;
import alternativa.engine3d.materials.*;
import flash.geom.*;
public class Wrecks extends TextureLoader {
public var material:TextureMaterial;
private static const texture:Texture = new Texture(new Bmp().bitmapData);
private static const Bmp:Class = Wrecks_Bmp;
public function Wrecks(){
material = new TextureMaterial(texture, 1, false, true, BlendMode.NORMAL, -1, 0xFFFFFF);
super("Wrecks");
bindings = [new TextureMaterialBinding([material], "wrecks.jpg")];
loadingMessage = "Loading wrecks texture";
coords = new Point3D(103.823928833008, -131.348449707031, 13.0508308410645);
rotationX = -1.5695738893527;
rotationY = -0.00174567664453053;
rotationZ = 0.959929971992082;
scaleX = 0.999999940395355;
scaleY = 0.99999988079071;
createVertex(30.9870354438522, -6.97446881868021, 232.749895679156, "0");
createVertex(-115.142091607374, 19.512000007837, 36.1684096047493, "513");
createVertex(31.0755017028127, -28.3374301628208, 53.968280444313, "514");
createVertex(31.0566121188095, -27.6894547095205, 41.9326977929853, "516");
createVertex(22.6564073617492, -62.0065627062191, 54.3638034283731, "501");
createVertex(25.1450713770116, -17.5112901065562, 233.099501018477, "263");
createVertex(13.7465438173521, -20.8740304708384, 235.109570851381, "264");
createVertex(19.0748151538194, 15.7095097145062, 241.11067629178, "10");
createVertex(3.53069206690347, 11.1237654715993, 243.851774272121, "11");
createVertex(-0.15834330222382, -18.9803045060293, 242.261665194865, "13");
createVertex(13.8191883693423, -24.7880757288684, 237.561453260909, "14");
createVertex(29.4018637248114, -22.2783294554172, 236.120822039929, "15");
createVertex(17.0037943060619, -2.44889091683077, 154.717028179165, "17");
createVertex(-9.0955595173244, 12.904032926956, 162.086927307749, "19");
createVertex(-16.1552380668166, 2.83944857703452, 156.32117042964, "20");
createVertex(-14.2361840220989, -8.22688953160129, 148.690101435939, "21");
createVertex(-4.46255524009408, -13.8124721992186, 143.664004359035, "22");
createVertex(16.1746966377303, -26.1805398411713, 238.453364845692, "24");
createVertex(11.7685391917183, -25.688942624668, 239.368684484537, "25");
createVertex(12.378348108361, 15.776452906615, 251.683659593851, "26");
createVertex(-5.02547981587867, 15.77916973833, 278.759460365304, "27");
createVertex(23.7342524522642, -47.9849100117898, 61.4571535792908, "523");
createVertex(-4.97048460382637, -15.7168264573417, 278.797971360015, "29");
createVertex(39.9339472526597, 15.8588974796884, 279.774577123609, "30");
createVertex(-106.585988169126, 14.6959033725838, 65.0363906696011, "526");
createVertex(27.615963374223, 15.8626960196891, 300.472463287724, "280");
createVertex(11.0057136865724, -14.3247020513529, 253.957131782418, "289");
createVertex(10.1846724352222, -15.7191685816244, 255.239883005585, "283");
createVertex(20.6745001426532, -55.4752005594544, 52.5235748292513, "532");
createVertex(39.9889174645662, -15.6370978273489, 279.81307061303, "294");
createVertex(112.569079482186, -15.5723731139804, 229.114099400234, "39");
createVertex(40.9814352626034, 15.8275679929543, 252.650247505751, "40");
createVertex(83.3214603632218, 15.8406746452783, 202.908670657084, "41");
createVertex(41.0364304729909, -15.6684272490452, 252.688758499296, "42");
createVertex(11.1355360257074, 11.1355394666243, 2.90725051854679E-6, "541");
createVertex(11.989726391601, -15.7163215142963, 254.991182989388, "295");
createVertex(1.85159772385646E-5, 15.748032412052, 155.898920404478, "543");
createVertex(83.3687767798303, -11.2663091794696, 202.941813806441, "49");
createVertex(27.996855419838, -35.1797376278065, 32.9991252832534, "512");
createVertex(42.4270079155091, -15.6729119883451, 247.034305795702, "51");
createVertex(104.185697370169, 16.2342397270016, 354.374478214018, "52");
createVertex(112.514113644657, 15.9236231467286, 229.075599660013, "303");
createVertex(60.4791132706868, -15.5912752993733, 288.038052151867, "313");
createVertex(-11.1355422753276, -11.1355394828838, -7.28328166132997E-6, "553");
createVertex(2.08472536868953E-5, -15.7480312397255, 138.211895925252, "554");
createVertex(27.6709498325267, -15.6332992223092, 300.510986780537, "278");
createVertex(58.0724043456487, 15.8751501682259, 126.479860772474, "61");
createVertex(79.3419241322315, 15.9251560772999, 137.012510117351, "63");
createVertex(84.0865184895024, -15.6533029516547, 203.583679125942, "320");
createVertex(60.4241305595398, 15.9047199751451, 287.999549910384, "321");
createVertex(39.5672796234593, 3.23001917015355, 250.054538330988, "322");
createVertex(-11.1355194400468, -11.1355395165708, 140.80209499097, "552");
createVertex(-5.46087630226566E-6, 15.7480319531462, -5.29051598618935E-6, "542");
createVertex(40.7916869805203, 10.3797377162341, 164.583655815576, "70");
createVertex(39.5911001614731, -10.4152074304571, 250.071218921809, "327");
createVertex(112.133658009075, 15.9924456497908, 145.229549144727, "74");
createVertex(105.486397359204, 16.0078714955845, 167.340910638949, "75");
createVertex(11.13554006586, -11.1355383340811, -1.50325092818093E-6, "561");
createVertex(41.4845344799965, -15.6720822310016, 249.058961676722, "335");
createVertex(41.5733432188367, 15.8227402023837, 247.855699783778, "339");
createVertex(96.4308068569753, 14.7460898872573, 172.154737978966, "85");
createVertex(82.7274474672267, -15.6555994396889, 203.645888655933, "342");
createVertex(36.0521113398992, 16.0184063200816, 247.764358357654, "87");
createVertex(36.1135836123341, 13.4478370985271, 247.686118012152, "88");
createVertex(38.0586991644641, 13.4528985814913, 249.048083925814, "89");
createVertex(37.0554052538465, 14.7356514971142, 248.4062211429, "91");
createVertex(44.6332687898653, 16.0544053556587, 261.228604812586, "92");
createVertex(87.6228401103349, 10.6445968960683, 314.370597230969, "351");
createVertex(41.2327691462475, -14.6523636091833, 248.316880609916, "345");
createVertex(104.195310592869, 10.7224403632276, 354.381228605779, "348");
createVertex(127.62386769683, 16.2059848468508, 297.791277249911, "358");
createVertex(7.44040276381109, -10.6453401086222, 144.187028756163, "105");
createVertex(15.7480231260256, 7.23296587068489E-7, 1.21342500278843E-5, "106");
createVertex(11.1355379026154, 11.1355375755399, 1.35352473193961E-5, "107");
createVertex(127.633480921195, 10.6941845294045, 297.798027642837, "356");
createVertex(-11.1355363170385, 11.1355374129289, 2.27557470395823E-5, "109");
createVertex(-15.7480343805729, -7.07034807589935E-7, 1.72403172769009E-5, "110");
createVertex(-11.1355385348302, -11.1355356356747, 1.39633853848409E-5, "111");
createVertex(1.07651030134548E-6, -15.7480271847843, 1.15343209188268E-5, "112");
createVertex(11.1355375567372, -11.1355345031314, 1.53673850320502E-5, "113");
createVertex(-57.5676592433779, -53.7051997334726, 89.5505453526329, "114");
createVertex(-68.6475183953372, -49.9558326636926, 84.7859580861235, "115");
createVertex(-53.0875947223364, -62.7961960986041, 100.757494279235, "116");
createVertex(-57.8317025176152, -71.9034449115596, 111.841925450242, "117");
createVertex(-69.0209249833, -75.6920449819399, 116.310724040945, "118");
createVertex(-80.1007815994992, -71.9426970018658, 111.546119922452, "119");
createVertex(-84.5808436447144, -62.8516853942387, 100.339154101898, "120");
createVertex(-79.8367402254775, -53.7444365812826, 89.2547291805249, "121");
createVertex(144.205938906153, 10.7720270103727, 337.808650266751, "361");
createVertex(-57.688712965333, 15.6374784287205, 89.4657668535588, "123");
createVertex(-53.2245605149673, 15.6589587779271, 100.661582493612, "124");
createVertex(-57.9845653775531, 15.6641857418957, 111.734872256, "125");
createVertex(79.610133904316, 15.9828348836036, 183.813298774493, "385");
createVertex(58.0820369477593, 10.3633498670373, 126.48659679253, "369");
createVertex(40.1745554833601, 15.8921129048158, 165.915507625457, "379");
createVertex(79.3515417326381, 10.4133557598531, 137.019254260643, "371");
createVertex(144.19631693137, 16.2838263741478, 337.801912374259, "362");
createVertex(87.6132056346459, 16.1563971809968, 314.363850585248, "353");
createVertex(87.6430570997316, 15.9752212397592, 166.113776208103, "392");
createVertex(86.7655561923034, 10.4580724343233, 163.010573847311, "393");
createVertex(41.5227524217809, 10.3833938858252, 166.529743755228, "386");
createVertex(23.6886250437609, -46.4205760539033, 32.4006986452962, "139");
createVertex(40.1815987778708, 11.8503106037847, 165.920439769709, "380");
createVertex(86.3161303754039, 10.4646886320249, 169.065403191666, "400");
createVertex(22.6306445293252, -61.1229446908149, 37.9509741989992, "146");
createVertex(79.6197558774348, 10.4710364735007, 183.82003666582, "387");
createVertex(87.6470209793339, 13.6974141179026, 166.116551958574, "389");
createVertex(32.7040776682968, -36.4630692430683, 67.3625093510253, "151");
createVertex(105.496019333987, 10.4960721318093, 167.347648531442, "410");
createVertex(112.143284359901, 10.480646286015, 145.236280787586, "404");
createVertex(91.0962255184932, 15.9486267228233, 139.427390215238, "413");
createVertex(91.1058371787277, 10.4368292338735, 139.43411622852, "414");
createVertex(98.9064581962241, 16.0407564740278, 172.558377940223, "415");
createVertex(-119.404707077518, 6.70682949867937, 64.6264291463928, "160");
createVertex(95.8827762903853, 16.0317116208242, 173.208741699499, "419");
createVertex(32.6418626122681, -34.3297834885047, 27.738434477903, "164");
createVertex(36.8144224830022, -24.1153407964229, 39.9210910092715, "165");
createVertex(97.3376603197716, 13.4616165052551, 171.527707676425, "424");
createVertex(-127.960809868567, 11.5229156110171, 35.7584205934007, "170");
createVertex(-134.518967217958, 4.46318146746275, 43.9237675780396, "171");
createVertex(95.8009855498185, 13.4609334296625, 173.16258277653, "420");
createVertex(-103.571868264622, 23.7505231422948, 44.9135482420735, "173");
createVertex(-100.027810202291, 21.7556404421934, 56.8710674352231, "174");
createVertex(-130.974930400292, 2.46829492015448, 55.8812905230585, "177");
createVertex(97.0606406600429, 16.0312482847154, 171.146901931133, "426");
createVertex(-11.1355400675249, 11.1355392877534, 1.5020850696601E-6, "181");
createVertex(37.9972268953588, 16.0234658957013, 249.126324273648, "439");
createVertex(11.1355569313642, 11.1355397189651, 153.308710714261, "186");
createVertex(43.0644540364657, 13.4752663080399, 260.197932045194, "444");
createVertex(41.6095743847861, 16.0453604699362, 261.878959819799, "445");
createVertex(34.7465331365583, 16.0254983010789, 251.698838984391, "429");
createVertex(11.135558525099, -11.1355383677676, 140.802107020635, "193");
createVertex(42.1576043191613, 14.7597406762344, 260.824983597899, "451");
createVertex(42.787425626318, 16.0448971338291, 259.817138800336, "452");
createVertex(41.5277830153341, 13.4745823112951, 261.832828397795, "446");
createVertex(11.1355506834088, 11.1355387490334, 153.308706339396, "203");
createVertex(15.7480449973268, 3.55787300065913E-7, 147.055417175464, "204");
createVertex(7.89197996198254E-6, 15.7480314421208, 155.898922279247, "205");
createVertex(-11.1355260387086, 11.135538602683, 153.308732435195, "206");
createVertex(-15.7480106356933, -1.05828405594366E-6, 147.055432907197, "207");
createVertex(-11.1355281921306, -11.1355395165697, 140.802107490238, "208");
createVertex(1.02215915802617E-5, -15.7480312559843, 138.211897798855, "209");
createVertex(11.1355522721491, -11.1355364766825, 140.802102642272, "210");
createVertex(-80.2536526076081, 15.624947924154, 111.439051709027, "467");
createVertex(33.0909078493521, 7.8257386148657, 237.710918620249, "212");
createVertex(17.5722233124975, 10.3453019213121, 236.758569672266, "214");
createVertex(-79.9577920771839, 15.598243504515, 89.1699613047844, "473");
createVertex(-69.1803701498444, 15.650098385132, 116.199033573229, "466");
createVertex(-4.43594938459903, -3.24522515811886, 244.328542466559, "221");
createVertex(-84.7177944356413, 15.6034694985508, 100.243234193039, "470");
createVertex(26.7667521897732, -49.6588418889518, 26.9223850959459, "480");
createVertex(-68.7619723015238, 15.6123299238647, 84.7057918654838, "474");
createVertex(37.3684964292246, -7.90934168671465, 235.644066348257, "233");
createVertex(28.0424834705451, -36.7440792475917, 62.0555527256101, "491");
createVertex(27.8502556700183, 4.56410899136661, 234.265538697937, "236");
createVertex(26.8289609895224, -51.7921238450858, 66.5464555883738, "495");
createVertex(36.8401872156418, -24.9989740543232, 56.3339308829636, "489");
createVertex(14.0100830746702, 9.532636016969, 162.390153260784, "242");
createVertex(2.8073984882456, 16.0711640638802, 162.609951706043, "245");
createVertex(6.17368325193265, 6.98256247818323, 238.768630751942, "247");
createVertex(0.331710434673184, -3.55425976336384, 239.118248591698, "248");
createVertex(20.6556043223484, -54.8272327517916, 40.4879878112191, "498");
createVertex(3.4684939556638, -15.0928375408906, 237.602626824247, "253");
createFace(["514", "516", "173", "174"], "0");
setUVsToFace(new Point(0.984497276406532, 0.138803396858903), new Point(0.985131978988647, 0.176889359951019), new Point(0.529630541801453, 0.184478536248207), "0");
createFace(["52", "348", "361", "362"], "1");
setUVsToFace(new Point(0.820484936237335, 0.786883890628815), new Point(0.820540547370911, 0.804302871227264), new Point(0.683677345378794, 0.804740309845241), "1");
createFace(["320", "39", "313", "42", "335", "51", "342"], "2");
setUVsToFace(new Point(0.245102316141129, 0.00395976379513742), new Point(0.249331846833229, 0.124767690896988), new Point(0.00100002096772524, 0.135172902466447), "2");
createFace(["206", "543", "542", "181"], "3");
setUVsToFace(new Point(0.989807486534119, 0.0969216078519821), new Point(0.997993350028992, 0.13501287996769), new Point(0.505304634571075, 0.135012820363045), "3");
createFace(["351", "353", "358", "356"], "4");
setUVsToFace(new Point(0.389881031537114, 0.10501071789436), new Point(0.389825373888016, 0.12242966145277), new Point(0.252962291240692, 0.121992126107216), "4");
createFace(["88", "87", "439", "91"], "5");
setUVsToFace(new Point(0.995973408222198, 0.146727606654167), new Point(0.987854957580566, 0.146297082304955), new Point(0.988252460956573, 0.138803347945213), "5");
createFace(["242", "245", "214", "236"], "6");
setUVsToFace(new Point(0.661093473154506, 0.739396622318071), new Point(0.669651508331299, 0.778978109359741), new Point(0.430090665817261, 0.784161031246185), "6");
createFace(["263", "15", "24", "14", "264"], "7");
setUVsToFace(new Point(0.651280625122334, 0.945930734459065), new Point(0.644906938076019, 0.924518465995789), new Point(0.689094071840932, 0.925665120349307), "7");
createFace(["207", "110", "553", "552"], "8");
setUVsToFace(new Point(0.982499480247498, 0.279193073511124), new Point(0.517758905887604, 0.279193103313446), new Point(0.51775879334189, 0.241101858697572), "8");
createFace(["280", "27", "29", "278"], "9");
setUVsToFace(new Point(0.268448412418365, 0.804005086421967), new Point(0.144553139805794, 0.803731560707092), new Point(0.144772965159853, 0.704194483129865), "9");
createFace(["207", "208", "209", "210", "204", "203", "205", "206"], "10");
setUVsToFace(new Point(0.605334937572479, 0.831060945987701), new Point(0.638373374938965, 0.858446419239044), new Point(0.64218407869339, 0.897220492362976), "10");
createFace(["52", "353", "351", "348"], "11");
setUVsToFace(new Point(0.781770586967468, 0.870101451873779), new Point(0.644906938076019, 0.869920313358307), new Point(0.644929945468903, 0.852501332759857), "11");
createFace(["414", "410", "75", "413"], "12");
setUVsToFace(new Point(0.288660615682602, 0.975479006767273), new Point(0.387908607721329, 0.975615501403809), new Point(0.387884706258774, 0.993034541606903), "12");
createFace(["233", "212", "10", "11", "221", "13", "25", "24", "15"], "13");
setUVsToFace(new Point(0.1275934278965, 0.669308066368103), new Point(0.091737374663353, 0.706892669200897), new Point(0.0398068644124589, 0.708114828776784), "13");
createFace(["29", "27", "26", "289", "283"], "14");
setUVsToFace(new Point(0.531142592430115, 0.831200063228607), new Point(0.531010653292938, 0.930737366627566), new Point(0.429266005754471, 0.930577397346497), "14");
createFace(["118", "466", "467", "119"], "15");
setUVsToFace(new Point(0.7043729539123, 0.334664576486451), new Point(0.993041515350342, 0.335558086633682), new Point(0.992923676967621, 0.373649209737778), "15");
createFace(["165", "164", "512", "516"], "16");
setUVsToFace(new Point(0.863516747951508, 0.895774602890015), new Point(0.811580240726471, 0.894844353199005), new Point(0.818886280059814, 0.873732030391693), "16");
createFace(["206", "181", "110", "207"], "17");
setUVsToFace(new Point(0.773139595985413, 0.476241946220398), new Point(0.288636714220047, 0.476241916418076), new Point(0.28863678224929, 0.438150644471662), "17");
createFace(["242", "236", "0"], "18");
setUVsToFace(new Point(0.449057459831238, 0.786883890628815), new Point(0.680898904800415, 0.788993895053864), new Point(0.680204451084137, 0.82706356048584), "18");
createFace(["0", "17", "242"], "19");
setUVsToFace(new Point(0.680204451084137, 0.82706356048584), new Point(0.429266005754471, 0.828338146209717), new Point(0.449057459831238, 0.786883890628815), "19");
createFace(["111", "110", "109", "542", "107", "106", "113", "112"], "20");
setUVsToFace(new Point(0.144926476046172, 0.933339760763415), new Point(0.172123818857644, 0.906670527660602), new Point(0.210213295595201, 0.90704400729948), "20");
createFace(["339", "41", "49", "342", "51", "345", "327", "322"], "21");
setUVsToFace(new Point(0.194866861737572, 0.434520169153861), new Point(0.000999701273964024, 0.434196739232082), new Point(0.00114288798320484, 0.348530177056179), "21");
createFace(["20", "21", "253", "248"], "22");
setUVsToFace(new Point(0.696811974048615, 0.608739674091339), new Point(0.717033505439758, 0.64658921957016), new Point(0.429726421833038, 0.650062561035156), "22");
createFace(["125", "117", "116", "124"], "23");
setUVsToFace(new Point(0.720664024353027, 0.609107911586761), new Point(0.997405167113014, 0.608739609789137), new Point(0.968657553195953, 0.64686918258667), "23");
createFace(["171", "498", "532", "177"], "24");
setUVsToFace(new Point(0.5259999115027, 0.186606073864685), new Point(0.00100000004749745, 0.17688812315464), new Point(0.00170496455393732, 0.138803362846375), "24");
createFace(["420", "419", "426", "85"], "25");
setUVsToFace(new Point(0.986130058765411, 0.241269737482071), new Point(0.994258165359497, 0.241101831197739), new Point(0.994412964094812, 0.248604504217828), "25");
createFace(["513", "170", "171", "177", "160", "526", "174", "173"], "26");
setUVsToFace(new Point(0.334475785493851, 0.864890217781067), new Point(0.295709055579827, 0.837007911761638), new Point(0.288636806722702, 0.797724131197278), "26");
createFace(["278", "29", "283", "295", "294"], "27");
setUVsToFace(new Point(0.00100000004749745, 0.818199098110199), new Point(0.124854572117329, 0.815021812915802), new Point(0.128480864976449, 0.903473468710884), "27");
createFace(["512", "164", "480", "139"], "28");
setUVsToFace(new Point(0.800539521597836, 0.873731877938388), new Point(0.807949721813202, 0.894807994365692), new Point(0.756018459796906, 0.89599484205246), "28");
createFace(["11", "10", "214", "247"], "29");
setUVsToFace(new Point(0.867147207260132, 0.873732030391693), new Point(0.919091701507568, 0.873914897441864), new Point(0.912090241909027, 0.895130097866058), "29");
createFace(["410", "404", "74", "75"], "30");
setUVsToFace(new Point(0.996767699718475, 0.756322085857391), new Point(0.923799514770508, 0.756415247917175), new Point(0.923777401447296, 0.738996267318726), "30");
createFace(["174", "526", "491", "514"], "31");
setUVsToFace(new Point(0.529777765274048, 0.231235653162003), new Point(0.517599500290247, 0.193223425811485), new Point(0.973154485225677, 0.190236583352089), "31");
createFace(["17", "0", "263"], "32");
setUVsToFace(new Point(0.680485188961029, 0.690816342830658), new Point(0.429591625928879, 0.694413542747498), new Point(0.429266005754471, 0.656486988067627), "32");
createFace(["263", "105", "17"], "33");
setUVsToFace(new Point(0.429266005754471, 0.656486988067627), new Point(0.716558814048767, 0.653693079948425), new Point(0.680485188961029, 0.690816342830658), "33");
createFace(["14", "24", "25"], "34");
setUVsToFace(new Point(0.278565138578415, 0.81331479549408), new Point(0.271460831165314, 0.807635486125946), new Point(0.285767048597336, 0.807759821414948), "34");
createFace(["70", "369", "371", "393", "400", "387", "386"], "35");
setUVsToFace(new Point(0.148971572518349, 0.570294916629791), new Point(0.144551858901406, 0.438149179979759), new Point(0.219560356486275, 0.438173584237531), "35");
createFace(["121", "120", "470", "473"], "36");
setUVsToFace(new Point(0.765992999076843, 0.518001973628998), new Point(0.737245448835755, 0.479872400171089), new Point(0.98518830537796, 0.480202347040176), "36");
createFace(["313", "321", "40", "322", "327", "42"], "37");
setUVsToFace(new Point(0.425635631052046, 0.563493981490221), new Point(0.42549666762352, 0.663031160831451), new Point(0.297998875379562, 0.662853240966797), "37");
createFace(["356", "358", "362", "361"], "38");
setUVsToFace(new Point(0.824194354855646, 0.80448407238152), new Point(0.82417106628418, 0.787065088748932), new Point(0.961034595966339, 0.786883890628815), "38");
createFace(["233", "15", "263", "0"], "39");
setUVsToFace(new Point(0.429266005754471, 0.956920444965363), new Point(0.481192331066231, 0.955538932751288), new Point(0.474833011627197, 0.976955413818359), "39");
createFace(["61", "63", "371", "369"], "40");
setUVsToFace(new Point(0.393511593341827, 0.104779899120331), new Point(0.468520098185103, 0.104573182675952), new Point(0.468568027019501, 0.121992148458958), "40");
createFace(["74", "404", "414", "413"], "41");
setUVsToFace(new Point(0.854418587191811, 0.831060999791752), new Point(0.854498624801636, 0.848479926586151), new Point(0.785532116889954, 0.848796606063843), "41");
createFace(["264", "22", "105", "263"], "43");
setUVsToFace(new Point(0.99161958694458, 0.42120948433876), new Point(0.696187070700422, 0.414275161372971), new Point(0.705264568328857, 0.376386344432831), "43");
createFace(["120", "119", "467", "470"], "44");
setUVsToFace(new Point(0.748029768466949, 0.691822230815887), new Point(0.719281613826752, 0.653693079948425), new Point(0.996022760868073, 0.654057204723358), "44");
createFace(["289", "26", "30"], "45");
setUVsToFace(new Point(0.123704560101032, 0.716122806072235), new Point(0.126066163182259, 0.811503469944), new Point(0.00178503198549151, 0.812298953533173), "45");
createFace(["289", "30", "294"], "46");
setUVsToFace(new Point(0.123704560101032, 0.716122806072235), new Point(0.00178503198549151, 0.812298953533173), new Point(0.00100000004749745, 0.71285742521286), "46");
createFace(["295", "289", "294"], "47");
setUVsToFace(new Point(0.119173616170883, 0.71174544095993), new Point(0.123704560101032, 0.716122806072235), new Point(0.00100000004749745, 0.71285742521286), "47");
createFace(["289", "295", "283"], "48");
setUVsToFace(new Point(0.420923173427582, 0.77532035112381), new Point(0.414623290300369, 0.775261521339417), new Point(0.417073905467987, 0.770050644874573), "48");
createFace(["123", "124", "116", "114"], "49");
setUVsToFace(new Point(0.737295559741048, 0.560011832162371), new Point(0.737245380878448, 0.521920561790466), new Point(0.985188186168671, 0.521594226360321), "49");
createFace(["526", "160", "523", "491"], "50");
setUVsToFace(new Point(0.960685789585114, 0.00100000004749745), new Point(0.990251150157092, 0.0384766352194594), new Point(0.506083250045776, 0.0478901825845242), "50");
createFace(["221", "11", "247", "248"], "51");
setUVsToFace(new Point(0.756018459796906, 0.925514459609985), new Point(0.807963296281238, 0.925540131826481), new Point(0.801026046276093, 0.946776509284973), "51");
createFace(["392", "385", "387", "400", "389"], "52");
setUVsToFace(new Point(0.82417111208461, 0.808196908848844), new Point(0.88559827932335, 0.808114400175599), new Point(0.885621607303619, 0.825533509254456), "52");
createFace(["387", "385", "379", "380", "386"], "53");
setUVsToFace(new Point(0.781821608543396, 0.831451952457428), new Point(0.78177011013031, 0.848870933055878), new Point(0.644906931665348, 0.848466188246432), "53");
createFace(["426", "424", "420", "85"], "55");
setUVsToFace(new Point(0.139849387315019, 0.711745348667325), new Point(0.133644133806229, 0.717191278934479), new Point(0.128789022564888, 0.712023377418518), "55");
createFace(["139", "498", "171", "170"], "56");
setUVsToFace(new Point(0.00100000004749745, 0.326720982789993), new Point(0.00132014916744083, 0.288631051778793), new Point(0.526391372075931, 0.293044426879208), "56");
createFace(["501", "495", "523", "532"], "58");
setUVsToFace(new Point(0.811580300331116, 0.899880051612854), new Point(0.863524359474019, 0.89962511764311), new Point(0.856702029705048, 0.920898795127869), "58");
createFace(["25", "13", "253", "264", "14"], "59");
setUVsToFace(new Point(0.705991387367249, 0.924185514450073), new Point(0.750178158283234, 0.925347864627838), new Point(0.742695212364197, 0.946398258209229), "59");
createFace(["41", "303", "39", "320", "49"], "60");
setUVsToFace(new Point(0.288636714220047, 0.666888535022736), new Point(0.412532150745392, 0.666661620140076), new Point(0.412714415803719, 0.766198738608965), "60");
createFace(["466", "118", "117", "125"], "61");
setUVsToFace(new Point(0.429266005754471, 0.698089122772217), new Point(0.717934548854828, 0.697136342525482), new Point(0.70613169670105, 0.735266804695129), "61");
createFace(["114", "116", "117", "118", "119", "120", "121", "115"], "62");
setUVsToFace(new Point(0.152571285092902, 0.834574380643916), new Point(0.191999521339049, 0.807635712073443), new Point(0.239741335523747, 0.808640354054062), "62");
createFace(["498", "146", "501", "532"], "63");
setUVsToFace(new Point(0.745203343222609, 0.899654979150284), new Point(0.752398192882538, 0.92080545425415), new Point(0.700457513332367, 0.921462595462799), "63");
createFace(["13", "221", "248", "253"], "64");
setUVsToFace(new Point(0.807949841022491, 0.921884059906006), new Point(0.756018459796906, 0.92070209980011), new Point(0.763426721096039, 0.899625360965729), "64");
createFace(["541", "186", "204", "106"], "66");
setUVsToFace(new Point(0.208053603768349, 0.376386344432831), new Point(0.692556471774093, 0.376386342259056), new Point(0.672794103622437, 0.414477616548538), "66");
createFace(["495", "151", "491", "523"], "68");
setUVsToFace(new Point(0.923777401447296, 0.761338472366333), new Point(0.975706160068512, 0.7600457072258), new Point(0.969310104846954, 0.781451284885406), "68");
createFace(["106", "204", "193", "561"], "69");
setUVsToFace(new Point(0.530022084712982, 0.288631081581116), new Point(0.994762611824063, 0.288631051592002), new Point(0.975000262260437, 0.326722323894501), "69");
createFace(["379", "61", "369", "70", "380"], "70");
setUVsToFace(new Point(0.820485415305924, 0.825973521826605), new Point(0.683621828776085, 0.825789785325523), new Point(0.683645188808441, 0.80837070941925), "70");
createFace(["40", "339", "322"], "71");
setUVsToFace(new Point(0.208053603768349, 0.433137804269791), new Point(0.210736498236656, 0.418108105659485), new Point(0.248944520950317, 0.432682782411575), "71");
createFace(["320", "342", "49"], "72");
setUVsToFace(new Point(0.964688181877136, 0.791147589683533), new Point(0.96524178981781, 0.786883890628815), new Point(0.978878736495972, 0.790822446346283), "72");
createFace(["335", "345", "51"], "73");
setUVsToFace(new Point(0.52387934923172, 0.233958527445793), new Point(0.523953199386597, 0.238022133708), new Point(0.517599642276764, 0.237180113792419), "73");
createFace(["245", "19", "247", "214"], "74");
setUVsToFace(new Point(0.912561893463135, 0.742676019668579), new Point(0.920146882534027, 0.780891418457031), new Point(0.672374486923218, 0.776989579200745), "74");
createFace(["20", "248", "247", "19"], "76");
setUVsToFace(new Point(0.728076270241635, 0.565379823623378), new Point(0.995633900165558, 0.563315987586975), new Point(0.995927751064301, 0.601406216621399), "76");
createFace(["139", "480", "146", "498"], "78");
setUVsToFace(new Point(0.856638133525848, 0.924787700176239), new Point(0.863525032997131, 0.946040570735931), new Point(0.811580402999369, 0.945943017620121), "78");
createFace(["39", "303", "321", "313"], "79");
setUVsToFace(new Point(0.253124713897705, 0.100942701101303), new Point(0.252962291240692, 0.00140553305391222), new Point(0.501511693000793, 0.00100000004749745), "79");
createFace(["371", "63", "392", "389", "393"], "80");
setUVsToFace(new Point(0.429288145770664, 0.95190835522007), new Point(0.429266005754471, 0.93448930978775), new Point(0.524903535842896, 0.934367716312408), "80");
createFace(["348", "351", "356", "361"], "81");
setUVsToFace(new Point(0.00100000004749745, 0.5749551653862), new Point(0.00502568795725383, 0.438150573090806), new Point(0.141830280423164, 0.44217637181282), "81");
createFace(["123", "114", "115", "474"], "82");
setUVsToFace(new Point(0.720657289028168, 0.697814643383026), new Point(0.939801087730411, 0.697136276178911), new Point(0.92799037694931, 0.735264360904694), "82");
createFace(["177", "532", "523", "160"], "83");
setUVsToFace(new Point(0.51412832736969, 0.285000562667847), new Point(0.00100000004749745, 0.27919065952301), new Point(0.00143128389467978, 0.2411017965308), "83");
createFace(["541", "542", "543", "186"], "84");
setUVsToFace(new Point(0.208053603768349, 0.372755795717239), new Point(0.208053603768349, 0.334664553403854), new Point(0.700742389466726, 0.334664623312937), "84");
createFace(["501", "146", "480", "164", "165", "489", "151", "495"], "87");
setUVsToFace(new Point(0.270334608760591, 0.665910790317015), new Point(0.233872988313946, 0.702908296442287), new Point(0.181929510648501, 0.703287092076655), "87");
createFace(["561", "193", "554", "112"], "92");
setUVsToFace(new Point(0.288636744022369, 0.479872465133667), new Point(0.733614967687088, 0.479872410165679), new Point(0.725429058074951, 0.517963707447052), "92");
createFace(["22", "264", "253", "21"], "93");
setUVsToFace(new Point(0.429266104087683, 0.568061967719566), new Point(0.724741756916046, 0.563315987586975), new Point(0.725353479385376, 0.601402401924133), "93");
createFace(["236", "212", "233", "0"], "95");
setUVsToFace(new Point(0.651175856590271, 0.895175218582153), new Point(0.644906938076019, 0.873732030391693), new Point(0.696827066027214, 0.875332783294812), "95");
createFace(["42", "327", "345", "335"], "100");
setUVsToFace(new Point(0.995228837600081, 0.201442085784306), new Point(0.976127207279205, 0.201601669192314), new Point(0.986510038375854, 0.190236568450928), "100");
createFace(["516", "512", "513", "173"], "101");
setUVsToFace(new Point(0.989285046741765, 0.0515206500913409), new Point(0.989645779132843, 0.0896102264523506), new Point(0.50530469417572, 0.0941986888647079), "101");
createFace(["380", "70", "386"], "103");
setUVsToFace(new Point(0.998938798904419, 0.0515516959130764), new Point(0.995626926422119, 0.0572258606553078), new Point(0.992368876934052, 0.0515206716954708), "103");
createFace(["400", "393", "389"], "104");
setUVsToFace(new Point(0.284219264984131, 0.591884076595306), new Point(0.271242022514343, 0.577750205993652), new Point(0.285693824291229, 0.577505528926849), "104");
createFace(["514", "489", "165", "516"], "105");
setUVsToFace(new Point(0.651560346300955, 0.92130642178877), new Point(0.644906938076019, 0.899979472160339), new Point(0.696847498416901, 0.900646507740021), "105");
createFace(["491", "151", "489", "514"], "107");
setUVsToFace(new Point(0.706882936843934, 0.895128732286008), new Point(0.700457513332367, 0.873732030391693), new Point(0.752388000488281, 0.874953389167786), "107");
createFace(["414", "404", "410"], "109");
setUVsToFace(new Point(0.537338376045227, 0.997399806976318), new Point(0.534773111343384, 0.928480327129364), new Point(0.60773378610611, 0.927438020706177), "109");
createFace(["552", "553", "112", "554"], "111");
setUVsToFace(new Point(0.733614802360535, 0.559685468673706), new Point(0.288636714220047, 0.559685528278351), new Point(0.288636798061403, 0.521594275822603), "111");
createFace(["415", "419", "420"], "112");
setUVsToFace(new Point(0.116263389587402, 0.910515427589417), new Point(0.108486376702785, 0.91643625497818), new Point(0.103368356823921, 0.910119593143463), "112");
createFace(["415", "420", "424"], "113");
setUVsToFace(new Point(0.265862286090851, 0.131683826446533), new Point(0.252962291240692, 0.131512582302094), new Point(0.257495582103729, 0.126060143113136), "113");
createFace(["415", "424", "426"], "114");
setUVsToFace(new Point(0.139073923230171, 0.822358250617981), new Point(0.131203755736351, 0.816058397293091), new Point(0.139394477009773, 0.815021812915802), "114");
createFace(["139", "170", "513", "512"], "116");
setUVsToFace(new Point(0.51396906375885, 0.228275448083878), new Point(0.000999886016805118, 0.237471385181663), new Point(0.0291446689516306, 0.198916435241699), "116");
createFace(["452", "444", "446", "451"], "117");
setUVsToFace(new Point(0.283359017174716, 0.704194491069847), new Point(0.277153789997101, 0.709640324115753), new Point(0.272298663854599, 0.704472362995148), "117");
createFace(["121", "473", "474", "115"], "118");
setUVsToFace(new Point(0.776770234107971, 0.438150614500046), new Point(0.995913803577423, 0.43887385725975), new Point(0.995788053522641, 0.476964951262113), "118");
createFace(["429", "87", "88"], "119");
setUVsToFace(new Point(0.237790197134018, 0.913293421268463), new Point(0.249093845486641, 0.90667051076889), new Point(0.253467977046967, 0.913523375988007), "119");
createFace(["429", "88", "89"], "120");
setUVsToFace(new Point(0.711422741413116, 0.427732288837433), new Point(0.696187078952789, 0.431436538696289), new Point(0.696210622787476, 0.423932313919067), "120");
createFace(["429", "89", "439"], "121");
setUVsToFace(new Point(0.411450773477554, 0.875059425830841), new Point(0.395780950784683, 0.875609040260315), new Point(0.400014489889145, 0.868668437004089), "121");
createFace(["88", "91", "89"], "123");
setUVsToFace(new Point(0.995973408222198, 0.146727606654167), new Point(0.992112934589386, 0.14276547729969), new Point(0.996370792388916, 0.139233887195587), "123");
createFace(["89", "91", "439"], "124");
setUVsToFace(new Point(0.996370792388916, 0.139233887195587), new Point(0.992112934589386, 0.14276547729969), new Point(0.988252341747284, 0.138803362846375), "124");
createFace(["92", "445", "446"], "126");
setUVsToFace(new Point(0.0138950413092971, 0.989499032497406), new Point(0.00611802702769637, 0.995419859886169), new Point(0.00100000004749745, 0.989103257656097), "126");
createFace(["92", "446", "444"], "127");
setUVsToFace(new Point(0.624264240264893, 0.93306165933609), new Point(0.611364245414734, 0.932890474796295), new Point(0.615897476673126, 0.927438020706177), "127");
createFace(["92", "444", "452"], "128");
setUVsToFace(new Point(0.424215078353882, 0.673998177051544), new Point(0.416344881057739, 0.667698264122009), new Point(0.424535602331161, 0.666661620140076), "128");
createFace(["445", "451", "446"], "129");
setUVsToFace(new Point(0.139352053403854, 0.581703722476959), new Point(0.135365471243858, 0.585539042949677), new Point(0.131223917007446, 0.581871628761292), "129");
createFace(["452", "451", "445"], "132");
setUVsToFace(new Point(0.139507055282593, 0.589206457138062), new Point(0.135365471243858, 0.585539042949677), new Point(0.139352053403854, 0.581703722476959), "132");
createFace(["245", "242", "17"], "133");
setUVsToFace(new Point(0.392150431871414, 0.94109708070755), new Point(0.367058038711548, 0.971848547458649), new Point(0.321142494678497, 0.970795929431915), "133");
createFace(["17", "105", "22"], "134");
setUVsToFace(new Point(0.321142494678497, 0.970795929431915), new Point(0.288964539766312, 0.931840360164642), new Point(0.288636714220047, 0.89324688911438), "134");
createFace(["22", "21", "20"], "135");
setUVsToFace(new Point(0.288636714220047, 0.89324688911438), new Point(0.318627297878265, 0.868668437004089), new Point(0.361368328332901, 0.872502684593201), "135");
createFace(["17", "22", "20"], "136");
setUVsToFace(new Point(0.321142494678497, 0.970795929431915), new Point(0.288636714220047, 0.89324688911438), new Point(0.361368328332901, 0.872502684593201), "136");
createFace(["245", "17", "20"], "137");
setUVsToFace(new Point(0.392150431871414, 0.94109708070755), new Point(0.321142494678497, 0.970795929431915), new Point(0.361368328332901, 0.872502684593201), "137");
createFace(["19", "245", "20"], "138");
setUVsToFace(new Point(0.39182260632515, 0.902503550052643), new Point(0.392150431871414, 0.94109708070755), new Point(0.361368328332901, 0.872502684593201), "138");
createFace(["214", "10", "212", "236"], "143");
setUVsToFace(new Point(0.948677775298035, 0.718612860001078), new Point(0.942523956298828, 0.697136342525482), new Point(0.994434773921967, 0.69901579618454), "143");
createFace(["278", "294", "30", "280"], "240");
setUVsToFace(new Point(0.100537203252316, 0.910119593143463), new Point(0.100645497441292, 0.986238777637482), new Point(0.00110829574987292, 0.986380457878113), "240");
createSurface(["9", "114", "56", "53", "1", "34", "40", "133", "12", "128", "70", "82", "116", "41", "137", "117", "118", "84", "92", "83", "46", "80", "59", "61", "93", "72", "87", "113", "33", "101", "28", "104", "120", "24", "48", "76", "105", "121", "58", "100", "25", "27", "19", "127", "62", "38", "29", "123", "5", "39", "4", "66", "37", "68", "43", "16", "132", "69", "240", "138", "136", "79", "17", "134", "143", "30", "60", "78", "52", "129", "111", "119", "49", "3", "135", "23", "51", "31", "112", "81", "50", "103", "124", "73", "47", "44", "35", "74", "107", "6", "18", "95", "109", "32", "26", "22", "45", "126", "21", "0", "55", "2", "15", "13", "7", "71", "63", "36", "8", "20", "64", "14", "11", "10"], "Wrecks");
setMaterialToSurface(material, "Wrecks");
}
}
}//package temple
Section 80
//Wrecks_Bmp (temple.Wrecks_Bmp)
package temple {
import mx.core.*;
public class Wrecks_Bmp extends BitmapAsset {
}
}//package temple
Section 81
//Temple (Temple)
package {
import flash.events.*;
import flash.display.*;
import alternativa.types.*;
import alternativa.engine3d.core.*;
import alternativa.engine3d.materials.*;
import alternativa.engine3d.display.*;
import temple.*;
import flash.text.*;
import alternativa.engine3d.controllers.*;
import alternativa.utils.*;
import flash.utils.*;
public class Temple extends Sprite {
private var qualitySwitchTime:uint;// = 500
private var ground:Ground;
private var loadingInfo:TextField;
private var scene:Scene3D;
private var environment:Environment;
private var limits:Limits;
private var prevOnGround:Boolean;
private var controller:WalkController;
private var loadingSequence:Array;
private var soundManager:SoundManager;
private var loadingCounter:int;// = -1
private var camera:Camera3D;
private var view:View;
private var stones:Stones;
private var qualityTimerId:int;// = -1
private var viewSize:uint;
private var columns:Columns;
private var wrecks:Wrecks;
private var stairs:Stairs;
private var drawWire:Boolean;// = false
private var maxViewSize:uint;// = 10
private static const bmpLogo:Class = Temple_bmpLogo;
private static const logoBmp:BitmapData = new bmpLogo().bitmapData;
public function Temple(){
environment = new Environment();
limits = new Limits();
stones = new Stones();
columns = new Columns();
stairs = new Stairs();
ground = new Ground();
wrecks = new Wrecks();
soundManager = new SoundManager();
viewSize = maxViewSize;
loadingSequence = [stairs, columns, stones, ground, wrecks, environment, soundManager];
super();
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.frameRate = 100;
initScene();
initUI();
loadNextResource();
addEventListener(Event.ENTER_FRAME, onEnterFrame);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
stage.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheel);
stage.addEventListener(Event.RESIZE, onResize);
onResize(null);
}
private function setLowQuality():void{
if (qualityTimerId > -1){
clearTimeout(qualityTimerId);
qualityTimerId = -1;
};
stage.quality = StageQuality.LOW;
environment.leftMaterial.precision = 20;
environment.rightMaterial.precision = 20;
environment.frontMaterial.precision = 20;
environment.backMaterial.precision = 20;
environment.topMaterial.precision = 20;
stones.material.precision = 20;
columns.material.precision = 20;
stairs.material.precision = 20;
ground.material.precision = 20;
wrecks.material.precision = 20;
}
private function loadNextResource():void{
loadingInfo.text = "";
loadingCounter++;
if (loadingCounter < loadingSequence.length){
loadingInfo.text = loadingSequence[loadingCounter].load(loadNextResource);
};
}
private function initUI():void{
var _local1:Bitmap = new Bitmap(logoBmp);
_local1.x = 3;
_local1.y = 3;
addChild(_local1);
var _local2:TextInfo = new TextInfo();
_local2.x = 3;
_local2.y = 46;
_local2.write("Drag — look");
_local2.write("WSAD or arrows — move");
_local2.write("Shift — run");
_local2.write("Space — jump");
_local2.write("Wheel or [ ] — change FOV");
_local2.write("+/- — change screen size");
_local2.write("T — show triangulation");
addChild(_local2);
loadingInfo = new TextField();
loadingInfo.x = 3;
loadingInfo.text = " ";
loadingInfo.autoSize = TextFieldAutoSize.LEFT;
loadingInfo.selectable = false;
loadingInfo.setTextFormat(new TextFormat("Tahoma", 10, 0xFF0000));
loadingInfo.defaultTextFormat = new TextFormat("Tahoma", 10, 0xFF0000);
addChild(loadingInfo);
}
private function onEnterFrame(_arg1:Event):void{
controller.processInput();
if (((!(controller.onGround)) || ((((controller.currentSpeed == 0)) && (prevOnGround))))){
soundManager.stopSteps();
} else {
soundManager.playSteps(((controller.groundMesh)==ground) ? (controller.accelerated) ? SoundManager.GRASS_RUN : SoundManager.GRASS_WALK : (controller.accelerated) ? SoundManager.STONE_RUN : SoundManager.STONE_WALK);
};
prevOnGround = controller.onGround;
scene.calculate();
}
private function setHighQuality():void{
qualityTimerId = -1;
stage.quality = StageQuality.HIGH;
TextureMaterial(environment.getSurfaceById("left").material).precision = 1;
TextureMaterial(environment.getSurfaceById("right").material).precision = 1;
TextureMaterial(environment.getSurfaceById("front").material).precision = 1;
TextureMaterial(environment.getSurfaceById("back").material).precision = 1;
TextureMaterial(environment.getSurfaceById("top").material).precision = 1;
stones.material.precision = 1;
columns.material.precision = 1;
stairs.material.precision = 1;
ground.material.precision = 1;
wrecks.material.precision = 1;
}
private function startHighQualityTimer():void{
qualityTimerId = setTimeout(setHighQuality, qualitySwitchTime);
}
private function onKeyDown(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case KeyboardUtils.T:
toggleWire();
break;
case KeyboardUtils.EQUAL:
case KeyboardUtils.NUMPAD_ADD:
if (viewSize < maxViewSize){
viewSize++;
onResize(null);
};
break;
case KeyboardUtils.MINUS:
case KeyboardUtils.NUMPAD_SUBTRACT:
if (viewSize > 1){
viewSize--;
onResize(null);
};
break;
case KeyboardUtils.LEFTBRACKET:
addFOV((3 / 20));
break;
case KeyboardUtils.RIGHTBRACKET:
addFOV((-3 / 20));
break;
};
}
private function initScene():void{
scene = new Scene3D();
scene.root = new Object3D("root");
environment.rotationZ = -0.34;
environment.mobility = 0;
scene.root.addChild(environment);
limits.mobility = 5;
scene.root.addChild(limits);
ground.mobility = 2;
scene.root.addChild(ground);
stairs.mobility = 3;
scene.root.addChild(stairs);
columns.mobility = 4;
scene.root.addChild(columns);
stones.mobility = 4;
scene.root.addChild(stones);
wrecks.mobility = 4;
scene.root.addChild(wrecks);
camera = new Camera3D("camera");
camera.rotationX = -1.5;
camera.rotationZ = 2.1;
scene.root.addChild(camera);
view = new View(camera);
addChild(view);
FPS.init(this);
controller = new WalkController(stage);
controller.setDefaultBindings();
controller.bindKey(KeyboardUtils.UP, ObjectController.ACTION_FORWARD);
controller.bindKey(KeyboardUtils.DOWN, ObjectController.ACTION_BACK);
controller.bindKey(KeyboardUtils.LEFT, ObjectController.ACTION_LEFT);
controller.bindKey(KeyboardUtils.RIGHT, ObjectController.ACTION_RIGHT);
controller.object = camera;
controller.checkCollisions = true;
controller.speed = 80;
controller.jumpSpeed = 160;
controller.gravity = 500;
controller.objectZPosition = 0.95;
controller.maxGroundAngle = MathUtils.toRadian(45);
controller.speedMultiplier = 2.5;
controller.onStartMoving = setLowQuality;
controller.onStopMoving = startHighQualityTimer;
controller.coords = new Point3D(150, 60, 25);
controller.collider.offsetThreshold = 0.0001;
controller.collider.radiusX = 25;
controller.collider.radiusY = 25;
controller.collider.radiusZ = 35;
scene.calculate();
}
private function addFOV(_arg1:Number):void{
var _local2:Number = (camera.fov + _arg1);
camera.fov = ((_local2)<MathUtils.DEG30) ? MathUtils.DEG30 : ((_local2)>MathUtils.toRadian(170)) ? MathUtils.toRadian(170) : _local2;
}
private function onMouseWheel(_arg1:MouseEvent):void{
addFOV((-(_arg1.delta) / 20));
}
private function toggleWire():void{
drawWire = !(drawWire);
var _local1:int = (drawWire) ? 0 : -1;
environment.leftMaterial.wireThickness = _local1;
environment.rightMaterial.wireThickness = _local1;
environment.frontMaterial.wireThickness = _local1;
environment.backMaterial.wireThickness = _local1;
environment.topMaterial.wireThickness = _local1;
stones.material.wireThickness = _local1;
columns.material.wireThickness = _local1;
stairs.material.wireThickness = _local1;
ground.material.wireThickness = _local1;
wrecks.material.wireThickness = _local1;
}
private function onResize(_arg1:Event):void{
var _local2:Number = ((stage.stageWidth * viewSize) / maxViewSize);
var _local3:Number = ((stage.stageHeight * viewSize) / maxViewSize);
view.x = ((stage.stageWidth - _local2) >> 1);
view.y = ((stage.stageHeight - _local3) >> 1);
view.width = _local2;
view.height = _local3;
loadingInfo.y = ((stage.stageHeight - loadingInfo.height) - 1);
}
}
}//package
Section 82
//Temple_bmpLogo (Temple_bmpLogo)
package {
import mx.core.*;
public class Temple_bmpLogo extends BitmapAsset {
}
}//package