Add mostly deobfuscated package, class and function name source
196
src/? var?/TankHullParser.as
Normal file
@@ -0,0 +1,196 @@
|
||||
package § var§
|
||||
{
|
||||
import alternativa.engine3d.core.Object3D;
|
||||
import alternativa.engine3d.objects.Mesh;
|
||||
import alternativa.engine3d.objects.Skin;
|
||||
import alternativa.math.Matrix4;
|
||||
import alternativa.math.Vector3;
|
||||
import alternativa.tanks.game.entities.tank.TankHull;
|
||||
import alternativa.tanks.game.entities.tank.TankPart;
|
||||
import alternativa.tanks.game.entities.tank.TankWheel;
|
||||
import alternativa.tanks.game.physics.BoxData;
|
||||
import alternativa.utils.ByteArrayMap;
|
||||
|
||||
public class TankHullParser extends TankPartParser
|
||||
{
|
||||
private static var leftSprings:Array;
|
||||
|
||||
private static var rightSprings:Array;
|
||||
|
||||
public static const KEY_TRACKS_DIFFUSE:String = "tracksDiffuseMap";
|
||||
|
||||
public static const KEY_TRACKS_NORMAL:String = "tracksNormalMap";
|
||||
|
||||
public static const KEY_TRACKS_OPACITY:String = "tracksOpacityMap";
|
||||
|
||||
public static const KEY_SHADOW:String = "tracksShadowMap";
|
||||
|
||||
public static const TRACKS_NORMALMAP_ATF:String = "tracks_normalmap.atf";
|
||||
|
||||
public static const TRACKS_DIFFUSEMAP_ATF:String = "tracks_diffuse.atf";
|
||||
|
||||
public static const TRACKS_OPACITYMAP_ATF:String = "tracks_opacity.atf";
|
||||
|
||||
public static const SHADOW_ATF:String = "shadow.atf";
|
||||
|
||||
public function TankHullParser()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override protected function doParse(objects:Vector.<Object3D>, tankPart:TankPart, files:ByteArrayMap) : void
|
||||
{
|
||||
super.doParse(objects,tankPart,files);
|
||||
this.parseTextureData(tankPart,files);
|
||||
}
|
||||
|
||||
private function parseTextureData(tankPart:TankPart, files:ByteArrayMap) : void
|
||||
{
|
||||
tankPart.textureData.putValue(KEY_TRACKS_NORMAL,files.getValue(TRACKS_NORMALMAP_ATF));
|
||||
tankPart.textureData.putValue(KEY_TRACKS_DIFFUSE,files.getValue(TRACKS_DIFFUSEMAP_ATF));
|
||||
tankPart.textureData.putValue(KEY_TRACKS_OPACITY,files.getValue(TRACKS_OPACITYMAP_ATF));
|
||||
if(files.getValue(SHADOW_ATF) != null)
|
||||
{
|
||||
tankPart.textureData.putValue(KEY_SHADOW,files.getValue(SHADOW_ATF));
|
||||
}
|
||||
}
|
||||
|
||||
override protected function createTankPart() : TankPart
|
||||
{
|
||||
return new TankHull();
|
||||
}
|
||||
|
||||
override protected function getParsingFunctions() : Object
|
||||
{
|
||||
return {
|
||||
"hull":this.parseSkin,
|
||||
"mount":this.parseMountPoint,
|
||||
"body":this.parseBody,
|
||||
"box":this.parseDetailedGeometry,
|
||||
"simp":this.parseSimpleGeometry,
|
||||
"sp":this.parseSuspensionRay,
|
||||
"wh":this.parseWheels,
|
||||
"track":this.parseTrack,
|
||||
"shadow":this.parseShadow
|
||||
};
|
||||
}
|
||||
|
||||
override protected function beginParsing(tankPart:TankPart) : void
|
||||
{
|
||||
leftSprings = [];
|
||||
rightSprings = [];
|
||||
}
|
||||
|
||||
override protected function endParsing(tankPart:TankPart) : void
|
||||
{
|
||||
this.prepareAll(TankHull(tankPart));
|
||||
}
|
||||
|
||||
private function parseSkin(mesh:Mesh, tankHull:TankHull) : void
|
||||
{
|
||||
tankHull.geometry = mesh.geometry;
|
||||
}
|
||||
|
||||
private function parseMountPoint(mesh:Mesh, tankHull:TankHull) : void
|
||||
{
|
||||
tankHull.§_-Rj§.reset(mesh.x,mesh.y,mesh.z);
|
||||
tankHull.§_-EN§.copy(tankHull.§_-Rj§);
|
||||
}
|
||||
|
||||
private function parseBody(mesh:Mesh, tankHull:TankHull) : void
|
||||
{
|
||||
tankHull.§_-eh§ = TankPartParsingUtils.parseCollisionBoxData(mesh);
|
||||
}
|
||||
|
||||
private function parseDetailedGeometry(mesh:Mesh, tankHull:TankHull) : void
|
||||
{
|
||||
var boxData:BoxData = TankPartParsingUtils.parseCollisionBoxData(mesh);
|
||||
tankHull.§_-AE§.push(boxData);
|
||||
}
|
||||
|
||||
private function parseSimpleGeometry(mesh:Mesh, tankHull:TankHull) : void
|
||||
{
|
||||
var boxData:BoxData = TankPartParsingUtils.parseCollisionBoxData(mesh);
|
||||
tankHull.§_-KR§.push(boxData);
|
||||
}
|
||||
|
||||
private function parseSuspensionRay(mesh:Mesh, tankHull:TankHull) : void
|
||||
{
|
||||
var name:String = mesh.name.toLowerCase();
|
||||
var type:String = name.substr(2,1);
|
||||
var index:int = int(int(name.substr(3,1)));
|
||||
var array:Array = type == "r" ? rightSprings : leftSprings;
|
||||
array[index] = new Vector3(mesh.x,mesh.y,mesh.z);
|
||||
}
|
||||
|
||||
private function parseWheels(mesh:Mesh, tankHull:TankHull) : void
|
||||
{
|
||||
var tankWheel:TankWheel = new TankWheel(mesh.name,mesh.geometry,new Vector3(mesh.x,mesh.y,mesh.z));
|
||||
if(mesh.name.charAt(2) == "l")
|
||||
{
|
||||
tankHull.§_-EY§.push(tankWheel);
|
||||
}
|
||||
else
|
||||
{
|
||||
tankHull.§_-M4§.push(tankWheel);
|
||||
}
|
||||
}
|
||||
|
||||
private function parseShadow(mesh:Mesh, tankHull:TankHull) : void
|
||||
{
|
||||
tankHull.shadow = mesh;
|
||||
}
|
||||
|
||||
private function parseTrack(skin:Skin, tankHull:TankHull) : void
|
||||
{
|
||||
var child:Object3D = null;
|
||||
for(var i:int = 0; i < skin.numChildren; i++)
|
||||
{
|
||||
child = skin.getChildAt(i);
|
||||
child.name = child.name.toLowerCase();
|
||||
}
|
||||
if(skin.name.toLowerCase().charAt(0) == "l")
|
||||
{
|
||||
tankHull.§_-Ei§ = skin;
|
||||
}
|
||||
else
|
||||
{
|
||||
tankHull.§_-iA§ = skin;
|
||||
}
|
||||
}
|
||||
|
||||
private function prepareAll(tankHull:TankHull) : void
|
||||
{
|
||||
var skinMatrix:Matrix4 = tankHull.§_-eh§.matrix.clone();
|
||||
skinMatrix.invert();
|
||||
skinMatrix.getAxis(3,tankHull.§_-Sh§);
|
||||
tankHull.§_-Rj§.transform4(skinMatrix);
|
||||
this.prepareCollisionGeometry(tankHull.§_-AE§,skinMatrix);
|
||||
this.prepareCollisionGeometry(tankHull.§_-KR§,skinMatrix);
|
||||
tankHull.§_-j9§ = this.prepareSuspensionPoints(leftSprings,skinMatrix);
|
||||
tankHull.§_-Hd§ = this.prepareSuspensionPoints(rightSprings,skinMatrix);
|
||||
leftSprings = null;
|
||||
rightSprings = null;
|
||||
}
|
||||
|
||||
private function prepareCollisionGeometry(geometry:Vector.<BoxData>, m:Matrix4) : void
|
||||
{
|
||||
var cbData:BoxData = null;
|
||||
for each(cbData in geometry)
|
||||
{
|
||||
cbData.matrix.append(m);
|
||||
}
|
||||
}
|
||||
|
||||
private function prepareSuspensionPoints(points:Array, matrix:Matrix4) : Vector.<Vector3>
|
||||
{
|
||||
var v:Vector3 = null;
|
||||
for each(v in points)
|
||||
{
|
||||
v.transform4(matrix);
|
||||
}
|
||||
return Vector.<Vector3>(points);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package package_78
|
||||
package § var§
|
||||
{
|
||||
import package_116.name_529;
|
||||
import package_116.name_530;
|
||||
import alternativa.engine3d.core.Object3D;
|
||||
import alternativa.engine3d.loaders.ParserA3D;
|
||||
import alternativa.engine3d.loaders.ParserCollada;
|
||||
import alternativa.engine3d.objects.Skin;
|
||||
import alternativa.tanks.game.entities.tank.TankPart;
|
||||
import alternativa.utils.ByteArrayMap;
|
||||
import package_19.name_528;
|
||||
import package_21.name_78;
|
||||
import package_71.name_333;
|
||||
|
||||
public class name_258
|
||||
public class TankPartParser
|
||||
{
|
||||
public static const KEY_DIFFUSE_MAP:String = "diffuseMap";
|
||||
|
||||
@@ -15,21 +15,21 @@ package package_78
|
||||
|
||||
public static const KEY_SURFACE_MAP:String = "surfaceMap";
|
||||
|
||||
public function name_258()
|
||||
public function TankPartParser()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function method_314(byteArrayMap:ByteArrayMap, mainFile:String) : name_333
|
||||
public function parse(byteArrayMap:ByteArrayMap, mainFile:String) : TankPart
|
||||
{
|
||||
var objects:Vector.<name_78> = null;
|
||||
var parserA3D:name_529 = null;
|
||||
var parserCollada:name_530 = null;
|
||||
var tankPart:name_333 = this.createTankPart();
|
||||
var objects:Vector.<Object3D> = null;
|
||||
var parserA3D:ParserA3D = null;
|
||||
var parserCollada:ParserCollada = null;
|
||||
var tankPart:TankPart = this.createTankPart();
|
||||
if(mainFile == "main.a3d")
|
||||
{
|
||||
parserA3D = new name_529();
|
||||
parserA3D.method_314(byteArrayMap.name_248(mainFile));
|
||||
parserA3D = new ParserA3D();
|
||||
parserA3D.parse(byteArrayMap.getValue(mainFile));
|
||||
objects = parserA3D.objects;
|
||||
}
|
||||
else
|
||||
@@ -38,31 +38,31 @@ package package_78
|
||||
{
|
||||
throw new Error("Unsupported type: " + mainFile);
|
||||
}
|
||||
parserCollada = new name_530();
|
||||
parserCollada.method_314(XML(byteArrayMap.name_248(mainFile).toString()));
|
||||
parserCollada = new ParserCollada();
|
||||
parserCollada.parse(XML(byteArrayMap.getValue(mainFile).toString()));
|
||||
objects = parserCollada.objects;
|
||||
}
|
||||
this.method_417(objects);
|
||||
this.traceSkins(objects);
|
||||
this.beginParsing(tankPart);
|
||||
this.doParse(objects,tankPart,byteArrayMap);
|
||||
this.endParsing(tankPart);
|
||||
tankPart.textureData.name_59(KEY_DIFFUSE_MAP,byteArrayMap.name_248("diffuse.atf"));
|
||||
tankPart.textureData.name_59(KEY_NORMAL_MAP,byteArrayMap.name_248("normalmap.atf"));
|
||||
tankPart.textureData.name_59(KEY_SURFACE_MAP,byteArrayMap.name_248("surface.atf"));
|
||||
tankPart.textureData.putValue(KEY_DIFFUSE_MAP,byteArrayMap.getValue("diffuse.atf"));
|
||||
tankPart.textureData.putValue(KEY_NORMAL_MAP,byteArrayMap.getValue("normalmap.atf"));
|
||||
tankPart.textureData.putValue(KEY_SURFACE_MAP,byteArrayMap.getValue("surface.atf"));
|
||||
return tankPart;
|
||||
}
|
||||
|
||||
private function method_417(objects:Vector.<name_78>) : void
|
||||
private function traceSkins(objects:Vector.<Object3D>) : void
|
||||
{
|
||||
var object3D:name_78 = null;
|
||||
var skin:name_528 = null;
|
||||
var object3D:Object3D = null;
|
||||
var skin:Skin = null;
|
||||
var i:int = 0;
|
||||
var childAt:name_78 = null;
|
||||
var childAt:Object3D = null;
|
||||
for each(object3D in objects)
|
||||
{
|
||||
if(object3D is name_528)
|
||||
if(object3D is Skin)
|
||||
{
|
||||
skin = name_528(object3D);
|
||||
skin = Skin(object3D);
|
||||
for(i = 0; i < skin.numChildren; i++)
|
||||
{
|
||||
childAt = skin.getChildAt(i);
|
||||
@@ -71,16 +71,16 @@ package package_78
|
||||
}
|
||||
}
|
||||
|
||||
protected function createTankPart() : name_333
|
||||
protected function createTankPart() : TankPart
|
||||
{
|
||||
throw new Error("Not implemented");
|
||||
}
|
||||
|
||||
protected function beginParsing(tankPart:name_333) : void
|
||||
protected function beginParsing(tankPart:TankPart) : void
|
||||
{
|
||||
}
|
||||
|
||||
protected function endParsing(tankPart:name_333) : void
|
||||
protected function endParsing(tankPart:TankPart) : void
|
||||
{
|
||||
}
|
||||
|
||||
@@ -89,9 +89,9 @@ package package_78
|
||||
return {};
|
||||
}
|
||||
|
||||
protected function doParse(objects:Vector.<name_78>, tankPart:name_333, byteArrayMap:ByteArrayMap) : void
|
||||
protected function doParse(objects:Vector.<Object3D>, tankPart:TankPart, byteArrayMap:ByteArrayMap) : void
|
||||
{
|
||||
var object:name_78 = null;
|
||||
var object:Object3D = null;
|
||||
var key:String = null;
|
||||
var func:Function = null;
|
||||
var parsingFunctions:Object = this.getParsingFunctions();
|
||||
31
src/? var?/TankPartParsingUtils.as
Normal file
@@ -0,0 +1,31 @@
|
||||
package § var§
|
||||
{
|
||||
import alternativa.engine3d.core.BoundBox;
|
||||
import alternativa.engine3d.objects.Mesh;
|
||||
import alternativa.math.Matrix4;
|
||||
import alternativa.math.Vector3;
|
||||
import alternativa.tanks.game.physics.BoxData;
|
||||
|
||||
public class TankPartParsingUtils
|
||||
{
|
||||
public function TankPartParsingUtils()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function parseCollisionBoxData(mesh:Mesh) : BoxData
|
||||
{
|
||||
mesh.calculateBoundBox();
|
||||
var bb:BoundBox = mesh.boundBox;
|
||||
var hs:Vector3 = new Vector3(0.5 * (bb.maxX - bb.minX),0.5 * (bb.maxY - bb.minY),0.5 * (bb.maxZ - bb.minZ));
|
||||
var midPoint:Vector3 = new Vector3(0.5 * (bb.minX + bb.maxX),0.5 * (bb.minY + bb.maxY),0.5 * (bb.minZ + bb.maxZ));
|
||||
var matrix:Matrix4 = new Matrix4();
|
||||
matrix.setRotationMatrix(mesh.rotationX,mesh.rotationY,mesh.rotationZ);
|
||||
matrix.setPositionXYZ(mesh.x,mesh.y,mesh.z);
|
||||
midPoint.transform4(matrix);
|
||||
matrix.setPosition(midPoint);
|
||||
return new BoxData(hs,matrix);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
51
src/? var?/TankTurretParser.as
Normal file
@@ -0,0 +1,51 @@
|
||||
package § var§
|
||||
{
|
||||
import alternativa.engine3d.objects.Mesh;
|
||||
import alternativa.math.Vector3;
|
||||
import alternativa.tanks.game.entities.tank.TankPart;
|
||||
import alternativa.tanks.game.entities.tank.TankTurret;
|
||||
|
||||
public class TankTurretParser extends TankPartParser
|
||||
{
|
||||
public function TankTurretParser()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override protected function createTankPart() : TankPart
|
||||
{
|
||||
return new TankTurret();
|
||||
}
|
||||
|
||||
override protected function getParsingFunctions() : Object
|
||||
{
|
||||
return {
|
||||
"turret":this.parseSkin,
|
||||
"fmnt":this.parseFlagMountPoint,
|
||||
"box":this.parseTurretBox,
|
||||
"muzzle":this.parseMuzzle
|
||||
};
|
||||
}
|
||||
|
||||
private function parseSkin(mesh:Mesh, tankTurret:TankTurret) : void
|
||||
{
|
||||
tankTurret.geometry = mesh.geometry;
|
||||
}
|
||||
|
||||
private function parseFlagMountPoint(mesh:Mesh, tankTurret:TankTurret) : void
|
||||
{
|
||||
tankTurret.§_-G3§.reset(mesh.x,mesh.y,mesh.z);
|
||||
}
|
||||
|
||||
private function parseTurretBox(mesh:Mesh, tankTurret:TankTurret) : void
|
||||
{
|
||||
tankTurret.§_-Of§.push(TankPartParsingUtils.parseCollisionBoxData(mesh));
|
||||
}
|
||||
|
||||
private function parseMuzzle(mesh:Mesh, tankTurret:TankTurret) : void
|
||||
{
|
||||
tankTurret.§_-O3§.push(new Vector3(mesh.x,mesh.y,mesh.z));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package package_76
|
||||
package §_-1e§
|
||||
{
|
||||
import package_90.name_386;
|
||||
import §_-KA§.§_-FW§;
|
||||
|
||||
public class name_663
|
||||
public class §_-D-§
|
||||
{
|
||||
private static const nodeBoundBoxThreshold:name_386 = new name_386();
|
||||
private static const nodeBoundBoxThreshold:§_-FW§ = new §_-FW§();
|
||||
|
||||
private static const splitCoordsX:Vector.<Number> = new Vector.<Number>();
|
||||
|
||||
@@ -18,59 +18,59 @@ package package_76
|
||||
|
||||
public var threshold:Number = 0.1;
|
||||
|
||||
public var var_681:int = 1;
|
||||
public var §_-eV§:int = 1;
|
||||
|
||||
public var name_659:name_656;
|
||||
public var §_-5H§:§_-oZ§;
|
||||
|
||||
public var name_661:Vector.<name_235>;
|
||||
public var §_-8A§:Vector.<§_-Nh§>;
|
||||
|
||||
public var var_679:int;
|
||||
public var §_-TO§:int;
|
||||
|
||||
public var staticBoundBoxes:Vector.<name_386> = new Vector.<name_386>();
|
||||
public var staticBoundBoxes:Vector.<§_-FW§> = new Vector.<§_-FW§>();
|
||||
|
||||
private var var_678:int;
|
||||
private var §_-94§:int;
|
||||
|
||||
private var var_677:Number;
|
||||
private var §_-P5§:Number;
|
||||
|
||||
private var var_680:Number;
|
||||
private var §_-ou§:Number;
|
||||
|
||||
public function name_663()
|
||||
public function §_-D-§()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function name_669(collisionPrimitives:Vector.<name_235>, boundBox:name_386 = null) : void
|
||||
public function §_-J9§(collisionPrimitives:Vector.<§_-Nh§>, boundBox:§_-FW§ = null) : void
|
||||
{
|
||||
var child:name_235 = null;
|
||||
var childBoundBox:name_386 = null;
|
||||
this.name_661 = collisionPrimitives.concat();
|
||||
this.var_679 = this.name_661.length;
|
||||
this.name_659 = new name_656();
|
||||
this.name_659.indices = new Vector.<int>();
|
||||
var rootNodeBoundBox:name_386 = this.name_659.boundBox = boundBox != null ? boundBox : new name_386();
|
||||
for(var i:int = 0; i < this.var_679; i++)
|
||||
var child:§_-Nh§ = null;
|
||||
var childBoundBox:§_-FW§ = null;
|
||||
this.§_-8A§ = collisionPrimitives.concat();
|
||||
this.§_-TO§ = this.§_-8A§.length;
|
||||
this.§_-5H§ = new §_-oZ§();
|
||||
this.§_-5H§.indices = new Vector.<int>();
|
||||
var rootNodeBoundBox:§_-FW§ = this.§_-5H§.boundBox = boundBox != null ? boundBox : new §_-FW§();
|
||||
for(var i:int = 0; i < this.§_-TO§; i++)
|
||||
{
|
||||
child = this.name_661[i];
|
||||
child = this.§_-8A§[i];
|
||||
childBoundBox = this.staticBoundBoxes[i] = child.calculateAABB();
|
||||
rootNodeBoundBox.name_583(childBoundBox);
|
||||
this.name_659.indices[i] = i;
|
||||
rootNodeBoundBox.§_-EH§(childBoundBox);
|
||||
this.§_-5H§.indices[i] = i;
|
||||
}
|
||||
this.staticBoundBoxes.length = this.var_679;
|
||||
this.splitNode(this.name_659);
|
||||
this.staticBoundBoxes.length = this.§_-TO§;
|
||||
this.splitNode(this.§_-5H§);
|
||||
splitCoordsX.length = splitCoordsY.length = splitCoordsZ.length = 0;
|
||||
}
|
||||
|
||||
private function splitNode(node:name_656) : void
|
||||
private function splitNode(node:§_-oZ§) : void
|
||||
{
|
||||
var nodeBoundBox:name_386 = null;
|
||||
var nodeBoundBox:§_-FW§ = null;
|
||||
var i:int = 0;
|
||||
var j:int = 0;
|
||||
var boundBox:name_386 = null;
|
||||
var boundBox:§_-FW§ = null;
|
||||
var min:Number = NaN;
|
||||
var max:Number = NaN;
|
||||
var indices:Vector.<int> = node.indices;
|
||||
var numPrimitives:int = int(indices.length);
|
||||
if(numPrimitives <= this.var_681)
|
||||
if(numPrimitives <= this.§_-eV§)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -183,45 +183,45 @@ package package_76
|
||||
}
|
||||
i++;
|
||||
}
|
||||
this.var_678 = -1;
|
||||
this.var_680 = 1e+308;
|
||||
this.§_-94§ = -1;
|
||||
this.§_-ou§ = 1e+308;
|
||||
_nodeBB[0] = nodeBoundBox.minX;
|
||||
_nodeBB[1] = nodeBoundBox.minY;
|
||||
_nodeBB[2] = nodeBoundBox.minZ;
|
||||
_nodeBB[3] = nodeBoundBox.maxX;
|
||||
_nodeBB[4] = nodeBoundBox.maxY;
|
||||
_nodeBB[5] = nodeBoundBox.maxZ;
|
||||
this.method_834(node,0,numSplitCoordsX,splitCoordsX,_nodeBB);
|
||||
this.method_834(node,1,numSplitCoordsY,splitCoordsY,_nodeBB);
|
||||
this.method_834(node,2,numSplitCoordsZ,splitCoordsZ,_nodeBB);
|
||||
if(this.var_678 < 0)
|
||||
this.§_-1k§(node,0,numSplitCoordsX,splitCoordsX,_nodeBB);
|
||||
this.§_-1k§(node,1,numSplitCoordsY,splitCoordsY,_nodeBB);
|
||||
this.§_-1k§(node,2,numSplitCoordsZ,splitCoordsZ,_nodeBB);
|
||||
if(this.§_-94§ < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var axisX:Boolean = this.var_678 == 0;
|
||||
var axisY:Boolean = this.var_678 == 1;
|
||||
node.axis = this.var_678;
|
||||
node.coord = this.var_677;
|
||||
node.name_657 = new name_656();
|
||||
node.name_657.parent = node;
|
||||
node.name_657.boundBox = nodeBoundBox.clone();
|
||||
node.name_658 = new name_656();
|
||||
node.name_658.parent = node;
|
||||
node.name_658.boundBox = nodeBoundBox.clone();
|
||||
var axisX:Boolean = this.§_-94§ == 0;
|
||||
var axisY:Boolean = this.§_-94§ == 1;
|
||||
node.axis = this.§_-94§;
|
||||
node.coord = this.§_-P5§;
|
||||
node.§_-Gm§ = new §_-oZ§();
|
||||
node.§_-Gm§.parent = node;
|
||||
node.§_-Gm§.boundBox = nodeBoundBox.clone();
|
||||
node.§_-75§ = new §_-oZ§();
|
||||
node.§_-75§.parent = node;
|
||||
node.§_-75§.boundBox = nodeBoundBox.clone();
|
||||
if(axisX)
|
||||
{
|
||||
node.name_657.boundBox.maxX = node.name_658.boundBox.minX = this.var_677;
|
||||
node.§_-Gm§.boundBox.maxX = node.§_-75§.boundBox.minX = this.§_-P5§;
|
||||
}
|
||||
else if(axisY)
|
||||
{
|
||||
node.name_657.boundBox.maxY = node.name_658.boundBox.minY = this.var_677;
|
||||
node.§_-Gm§.boundBox.maxY = node.§_-75§.boundBox.minY = this.§_-P5§;
|
||||
}
|
||||
else
|
||||
{
|
||||
node.name_657.boundBox.maxZ = node.name_658.boundBox.minZ = this.var_677;
|
||||
node.§_-Gm§.boundBox.maxZ = node.§_-75§.boundBox.minZ = this.§_-P5§;
|
||||
}
|
||||
var coordMin:Number = this.var_677 - this.threshold;
|
||||
var coordMax:Number = this.var_677 + this.threshold;
|
||||
var coordMin:Number = this.§_-P5§ - this.threshold;
|
||||
var coordMax:Number = this.§_-P5§ + this.threshold;
|
||||
for(i = 0; i < numPrimitives; )
|
||||
{
|
||||
boundBox = this.staticBoundBoxes[indices[i]];
|
||||
@@ -231,30 +231,30 @@ package package_76
|
||||
{
|
||||
if(min < coordMin)
|
||||
{
|
||||
if(node.name_657.indices == null)
|
||||
if(node.§_-Gm§.indices == null)
|
||||
{
|
||||
node.name_657.indices = new Vector.<int>();
|
||||
node.§_-Gm§.indices = new Vector.<int>();
|
||||
}
|
||||
node.name_657.indices.push(indices[i]);
|
||||
node.§_-Gm§.indices.push(indices[i]);
|
||||
indices[i] = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(node.var_674 == null)
|
||||
if(node.§_-Xt§ == null)
|
||||
{
|
||||
node.var_674 = new Vector.<int>();
|
||||
node.§_-Xt§ = new Vector.<int>();
|
||||
}
|
||||
node.var_674.push(indices[i]);
|
||||
node.§_-Xt§.push(indices[i]);
|
||||
indices[i] = -1;
|
||||
}
|
||||
}
|
||||
else if(min >= coordMin)
|
||||
{
|
||||
if(node.name_658.indices == null)
|
||||
if(node.§_-75§.indices == null)
|
||||
{
|
||||
node.name_658.indices = new Vector.<int>();
|
||||
node.§_-75§.indices = new Vector.<int>();
|
||||
}
|
||||
node.name_658.indices.push(indices[i]);
|
||||
node.§_-75§.indices.push(indices[i]);
|
||||
indices[i] = -1;
|
||||
}
|
||||
i++;
|
||||
@@ -276,22 +276,22 @@ package package_76
|
||||
{
|
||||
node.indices = null;
|
||||
}
|
||||
if(node.var_674 != null)
|
||||
if(node.§_-Xt§ != null)
|
||||
{
|
||||
node.name_660 = new CollisionKdTree2D(this,node);
|
||||
node.name_660.name_669();
|
||||
node.§_-da§ = new CollisionKdTree2D(this,node);
|
||||
node.§_-da§.§_-J9§();
|
||||
}
|
||||
if(node.name_657.indices != null)
|
||||
if(node.§_-Gm§.indices != null)
|
||||
{
|
||||
this.splitNode(node.name_657);
|
||||
this.splitNode(node.§_-Gm§);
|
||||
}
|
||||
if(node.name_658.indices != null)
|
||||
if(node.§_-75§.indices != null)
|
||||
{
|
||||
this.splitNode(node.name_658);
|
||||
this.splitNode(node.§_-75§);
|
||||
}
|
||||
}
|
||||
|
||||
private function method_834(node:name_656, axis:int, numSplitCoords:int, splitCoords:Vector.<Number>, bb:Vector.<Number>) : void
|
||||
private function §_-1k§(node:§_-oZ§, axis:int, numSplitCoords:int, splitCoords:Vector.<Number>, bb:Vector.<Number>) : void
|
||||
{
|
||||
var currSplitCoord:Number = NaN;
|
||||
var minCoord:Number = NaN;
|
||||
@@ -304,7 +304,7 @@ package package_76
|
||||
var numObjects:int = 0;
|
||||
var j:int = 0;
|
||||
var cost:Number = NaN;
|
||||
var boundBox:name_386 = null;
|
||||
var boundBox:§_-FW§ = null;
|
||||
var axis1:int = (axis + 1) % 3;
|
||||
var axis2:int = (axis + 2) % 3;
|
||||
var area:Number = (bb[axis1 + 3] - bb[axis1]) * (bb[axis2 + 3] - bb[axis2]);
|
||||
@@ -351,11 +351,11 @@ package package_76
|
||||
cost = areaNegative * numNegative + areaPositive * numPositive;
|
||||
if(!conflict)
|
||||
{
|
||||
if(cost < this.var_680 && numNegative > 0 && numPositive > 0)
|
||||
if(cost < this.§_-ou§ && numNegative > 0 && numPositive > 0)
|
||||
{
|
||||
this.var_678 = axis;
|
||||
this.var_680 = cost;
|
||||
this.var_677 = currSplitCoord;
|
||||
this.§_-94§ = axis;
|
||||
this.§_-ou§ = cost;
|
||||
this.§_-P5§ = currSplitCoord;
|
||||
}
|
||||
}
|
||||
for(j = i + 1; j < numSplitCoords; )
|
||||
@@ -370,20 +370,20 @@ package package_76
|
||||
}
|
||||
}
|
||||
|
||||
public function method_835() : void
|
||||
public function §_-YO§() : void
|
||||
{
|
||||
this.method_833("",this.name_659);
|
||||
this.§_-es§("",this.§_-5H§);
|
||||
}
|
||||
|
||||
private function method_833(str:String, node:name_656) : void
|
||||
private function §_-es§(str:String, node:§_-oZ§) : void
|
||||
{
|
||||
if(node == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
trace(str,node.axis == -1 ? "end" : (node.axis == 0 ? "X" : (node.axis == 1 ? "Y" : "Z")),"splitCoord=" + this.var_677,"bound",node.boundBox,"objs:",node.indices);
|
||||
this.method_833(str + "-",node.name_657);
|
||||
this.method_833(str + "+",node.name_658);
|
||||
trace(str,node.axis == -1 ? "end" : (node.axis == 0 ? "X" : (node.axis == 1 ? "Y" : "Z")),"splitCoord=" + this.§_-P5§,"bound",node.boundBox,"objs:",node.indices);
|
||||
this.§_-es§(str + "-",node.§_-Gm§);
|
||||
this.§_-es§(str + "+",node.§_-75§);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,71 +1,71 @@
|
||||
package package_76
|
||||
package §_-1e§
|
||||
{
|
||||
import package_121.name_666;
|
||||
import package_121.name_667;
|
||||
import package_121.name_668;
|
||||
import package_121.name_732;
|
||||
import package_121.name_733;
|
||||
import package_46.name_194;
|
||||
import package_90.name_273;
|
||||
import package_90.name_386;
|
||||
import package_92.name_271;
|
||||
import package_92.name_630;
|
||||
import §_-KA§.§_-FW§;
|
||||
import §_-KA§.§_-jr§;
|
||||
import §_-US§.§_-6h§;
|
||||
import §_-US§.§_-BV§;
|
||||
import §_-nl§.§_-bj§;
|
||||
import §while§.§_-6O§;
|
||||
import §while§.§_-GQ§;
|
||||
import §while§.§_-O8§;
|
||||
import §while§.§_-Ph§;
|
||||
import §while§.§_-hu§;
|
||||
|
||||
public class name_682 implements name_256
|
||||
public class §_-LG§ implements §_-fx§
|
||||
{
|
||||
private static var _rayAABB:name_386 = new name_386();
|
||||
private static var _rayAABB:§_-FW§ = new §_-FW§();
|
||||
|
||||
public var var_592:name_663;
|
||||
public var §_-bw§:§_-D-§;
|
||||
|
||||
public var var_684:Vector.<name_235>;
|
||||
public var §_-Fz§:Vector.<§_-Nh§>;
|
||||
|
||||
public var var_685:int;
|
||||
public var §_-iH§:int;
|
||||
|
||||
public var threshold:Number = 0.0001;
|
||||
|
||||
private var var_596:Object = {};
|
||||
private var §_-P6§:Object = {};
|
||||
|
||||
private var var_420:MinMax = new MinMax();
|
||||
private var §_-qC§:MinMax = new MinMax();
|
||||
|
||||
private var var_594:name_194 = new name_194();
|
||||
private var §_-k8§:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var var_590:name_194 = new name_194();
|
||||
private var §_-0q§:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var var_595:name_273 = new name_273();
|
||||
private var §_-2P§:§_-jr§ = new §_-jr§();
|
||||
|
||||
public function name_682()
|
||||
public function §_-LG§()
|
||||
{
|
||||
super();
|
||||
this.var_592 = new name_663();
|
||||
this.var_684 = new Vector.<name_235>();
|
||||
this.method_655(name_235.BOX,name_235.BOX,new name_666());
|
||||
this.method_655(name_235.BOX,name_235.SPHERE,new name_733());
|
||||
this.method_655(name_235.BOX,name_235.RECT,new name_667());
|
||||
this.method_655(name_235.BOX,name_235.TRIANGLE,new name_668());
|
||||
this.method_655(name_235.SPHERE,name_235.SPHERE,new name_732());
|
||||
this.§_-bw§ = new §_-D-§();
|
||||
this.§_-Fz§ = new Vector.<§_-Nh§>();
|
||||
this.§_-c2§(§_-Nh§.BOX,§_-Nh§.BOX,new §_-Ph§());
|
||||
this.§_-c2§(§_-Nh§.BOX,§_-Nh§.SPHERE,new §_-O8§());
|
||||
this.§_-c2§(§_-Nh§.BOX,§_-Nh§.RECT,new §_-GQ§());
|
||||
this.§_-c2§(§_-Nh§.BOX,§_-Nh§.TRIANGLE,new §_-hu§());
|
||||
this.§_-c2§(§_-Nh§.SPHERE,§_-Nh§.SPHERE,new §_-6O§());
|
||||
}
|
||||
|
||||
public function method_844(primitive:name_235, isStatic:Boolean = true) : Boolean
|
||||
public function §_-6v§(primitive:§_-Nh§, isStatic:Boolean = true) : Boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function method_843(primitive:name_235, isStatic:Boolean = true) : Boolean
|
||||
public function §_-2V§(primitive:§_-Nh§, isStatic:Boolean = true) : Boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function init(collisionPrimitives:Vector.<name_235>) : void
|
||||
public function init(collisionPrimitives:Vector.<§_-Nh§>) : void
|
||||
{
|
||||
this.var_592.name_669(collisionPrimitives);
|
||||
this.§_-bw§.§_-J9§(collisionPrimitives);
|
||||
}
|
||||
|
||||
public function method_553(contacts:name_630) : name_630
|
||||
public function §_-63§(contacts:§_-6h§) : §_-6h§
|
||||
{
|
||||
return contacts;
|
||||
}
|
||||
|
||||
public function getContact(prim1:name_235, prim2:name_235, contact:name_630) : Boolean
|
||||
public function getContact(prim1:§_-Nh§, prim2:§_-Nh§, contact:§_-6h§) : Boolean
|
||||
{
|
||||
if((prim1.collisionGroup & prim2.collisionGroup) == 0)
|
||||
{
|
||||
@@ -79,14 +79,14 @@ package package_76
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var collider:name_665 = this.var_596[prim1.type <= prim2.type ? prim1.type << 16 | prim2.type : prim2.type << 16 | prim1.type] as name_665;
|
||||
var collider:§_-hG§ = this.§_-P6§[prim1.type <= prim2.type ? prim1.type << 16 | prim2.type : prim2.type << 16 | prim1.type] as §_-hG§;
|
||||
if(collider != null && Boolean(collider.getContact(prim1,prim2,contact)))
|
||||
{
|
||||
if(prim1.postCollisionFilter != null && !prim1.postCollisionFilter.name_662(prim1,prim2))
|
||||
if(prim1.postCollisionFilter != null && !prim1.postCollisionFilter.§_-eZ§(prim1,prim2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(prim2.postCollisionFilter != null && !prim2.postCollisionFilter.name_662(prim2,prim1))
|
||||
if(prim2.postCollisionFilter != null && !prim2.postCollisionFilter.§_-eZ§(prim2,prim1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ package package_76
|
||||
return false;
|
||||
}
|
||||
|
||||
public function method_554(prim1:name_235, prim2:name_235) : Boolean
|
||||
public function §_-A5§(prim1:§_-Nh§, prim2:§_-Nh§) : Boolean
|
||||
{
|
||||
if((prim1.collisionGroup & prim2.collisionGroup) == 0)
|
||||
{
|
||||
@@ -109,14 +109,14 @@ package package_76
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var collider:name_665 = this.var_596[prim1.type <= prim2.type ? prim1.type << 16 | prim2.type : prim2.type << 16 | prim1.type] as name_665;
|
||||
var collider:§_-hG§ = this.§_-P6§[prim1.type <= prim2.type ? prim1.type << 16 | prim2.type : prim2.type << 16 | prim1.type] as §_-hG§;
|
||||
if(collider != null && Boolean(collider.haveCollision(prim1,prim2)))
|
||||
{
|
||||
if(prim1.postCollisionFilter != null && !prim1.postCollisionFilter.name_662(prim1,prim2))
|
||||
if(prim1.postCollisionFilter != null && !prim1.postCollisionFilter.§_-eZ§(prim1,prim2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(prim2.postCollisionFilter != null && !prim2.postCollisionFilter.name_662(prim2,prim1))
|
||||
if(prim2.postCollisionFilter != null && !prim2.postCollisionFilter.§_-eZ§(prim2,prim1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -125,19 +125,19 @@ package package_76
|
||||
return false;
|
||||
}
|
||||
|
||||
public function raycast(origin:name_194, dir:name_194, collisionGroup:int, maxTime:Number, predicate:name_631, result:name_273) : Boolean
|
||||
public function raycast(origin:§_-bj§, dir:§_-bj§, collisionGroup:int, maxTime:Number, predicate:§_-jn§, result:§_-jr§) : Boolean
|
||||
{
|
||||
var hasStaticIntersection:Boolean = this.name_324(origin,dir,collisionGroup,maxTime,predicate,result);
|
||||
var hasDynamicIntersection:Boolean = this.method_841(origin,dir,collisionGroup,maxTime,predicate,this.var_595);
|
||||
var hasStaticIntersection:Boolean = this.§_-cX§(origin,dir,collisionGroup,maxTime,predicate,result);
|
||||
var hasDynamicIntersection:Boolean = this.§_-Tm§(origin,dir,collisionGroup,maxTime,predicate,this.§_-2P§);
|
||||
if(!(hasDynamicIntersection || hasStaticIntersection))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(hasDynamicIntersection && hasStaticIntersection)
|
||||
{
|
||||
if(result.t > this.var_595.t)
|
||||
if(result.t > this.§_-2P§.t)
|
||||
{
|
||||
result.copy(this.var_595);
|
||||
result.copy(this.§_-2P§);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -145,62 +145,62 @@ package package_76
|
||||
{
|
||||
return true;
|
||||
}
|
||||
result.copy(this.var_595);
|
||||
result.copy(this.§_-2P§);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function name_324(origin:name_194, dir:name_194, collisionGroup:int, maxTime:Number, predicate:name_631, result:name_273) : Boolean
|
||||
public function §_-cX§(origin:§_-bj§, dir:§_-bj§, collisionGroup:int, maxTime:Number, predicate:§_-jn§, result:§_-jr§) : Boolean
|
||||
{
|
||||
if(!this.method_662(origin,dir,this.var_592.name_659.boundBox,this.var_420))
|
||||
if(!this.§_-oL§(origin,dir,this.§_-bw§.§_-5H§.boundBox,this.§_-qC§))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(this.var_420.max < 0 || this.var_420.min > maxTime)
|
||||
if(this.§_-qC§.max < 0 || this.§_-qC§.min > maxTime)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(this.var_420.min <= 0)
|
||||
if(this.§_-qC§.min <= 0)
|
||||
{
|
||||
this.var_420.min = 0;
|
||||
this.var_590.x = origin.x;
|
||||
this.var_590.y = origin.y;
|
||||
this.var_590.z = origin.z;
|
||||
this.§_-qC§.min = 0;
|
||||
this.§_-0q§.x = origin.x;
|
||||
this.§_-0q§.y = origin.y;
|
||||
this.§_-0q§.z = origin.z;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.var_590.x = origin.x + this.var_420.min * dir.x;
|
||||
this.var_590.y = origin.y + this.var_420.min * dir.y;
|
||||
this.var_590.z = origin.z + this.var_420.min * dir.z;
|
||||
this.§_-0q§.x = origin.x + this.§_-qC§.min * dir.x;
|
||||
this.§_-0q§.y = origin.y + this.§_-qC§.min * dir.y;
|
||||
this.§_-0q§.z = origin.z + this.§_-qC§.min * dir.z;
|
||||
}
|
||||
if(this.var_420.max > maxTime)
|
||||
if(this.§_-qC§.max > maxTime)
|
||||
{
|
||||
this.var_420.max = maxTime;
|
||||
this.§_-qC§.max = maxTime;
|
||||
}
|
||||
var hasIntersection:Boolean = this.method_652(this.var_592.name_659,origin,this.var_590,dir,collisionGroup,this.var_420.min,this.var_420.max,predicate,result);
|
||||
var hasIntersection:Boolean = this.§_-NC§(this.§_-bw§.§_-5H§,origin,this.§_-0q§,dir,collisionGroup,this.§_-qC§.min,this.§_-qC§.max,predicate,result);
|
||||
return hasIntersection ? result.t <= maxTime : false;
|
||||
}
|
||||
|
||||
public function method_842(body:name_271, primitive:name_235) : Boolean
|
||||
public function §_-9G§(body:§_-BV§, primitive:§_-Nh§) : Boolean
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
private function method_655(type1:int, type2:int, collider:name_665) : void
|
||||
private function §_-c2§(type1:int, type2:int, collider:§_-hG§) : void
|
||||
{
|
||||
this.var_596[type1 <= type2 ? type1 << 16 | type2 : type2 << 16 | type1] = collider;
|
||||
this.§_-P6§[type1 <= type2 ? type1 << 16 | type2 : type2 << 16 | type1] = collider;
|
||||
}
|
||||
|
||||
private function method_653(node:name_656, primitive:name_235, contacts:name_630) : name_630
|
||||
private function §_-m1§(node:§_-oZ§, primitive:§_-Nh§, contacts:§_-6h§) : §_-6h§
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
private function method_841(origin:name_194, dir:name_194, collisionGroup:int, maxTime:Number, filter:name_631, result:name_273) : Boolean
|
||||
private function §_-Tm§(origin:§_-bj§, dir:§_-bj§, collisionGroup:int, maxTime:Number, filter:§_-jn§, result:§_-jr§) : Boolean
|
||||
{
|
||||
var yy:Number = NaN;
|
||||
var minTime:Number = NaN;
|
||||
var primitive:name_235 = null;
|
||||
var paabb:name_386 = null;
|
||||
var primitive:§_-Nh§ = null;
|
||||
var paabb:§_-FW§ = null;
|
||||
var t:Number = NaN;
|
||||
var xx:Number = origin.x + dir.x * maxTime;
|
||||
yy = origin.y + dir.y * maxTime;
|
||||
@@ -236,24 +236,24 @@ package package_76
|
||||
_rayAABB.maxZ = zz;
|
||||
}
|
||||
minTime = maxTime + 1;
|
||||
for(var i:int = 0; i < this.var_685; )
|
||||
for(var i:int = 0; i < this.§_-iH§; )
|
||||
{
|
||||
primitive = this.var_684[i];
|
||||
primitive = this.§_-Fz§[i];
|
||||
if((primitive.collisionGroup & collisionGroup) != 0)
|
||||
{
|
||||
paabb = primitive.aabb;
|
||||
if(!(_rayAABB.maxX < paabb.minX || _rayAABB.minX > paabb.maxX || _rayAABB.maxY < paabb.minY || _rayAABB.minY > paabb.maxY || _rayAABB.maxZ < paabb.minZ || _rayAABB.minZ > paabb.maxZ))
|
||||
{
|
||||
if(!(filter != null && !filter.name_664(primitive)))
|
||||
if(!(filter != null && !filter.§_-0w§(primitive)))
|
||||
{
|
||||
t = primitive.raycast(origin,dir,this.threshold,this.var_594);
|
||||
t = Number(primitive.raycast(origin,dir,this.threshold,this.§_-k8§));
|
||||
if(t > 0 && t < minTime)
|
||||
{
|
||||
minTime = t;
|
||||
result.primitive = primitive;
|
||||
result.normal.x = this.var_594.x;
|
||||
result.normal.y = this.var_594.y;
|
||||
result.normal.z = this.var_594.z;
|
||||
result.normal.x = this.§_-k8§.x;
|
||||
result.normal.y = this.§_-k8§.y;
|
||||
result.normal.z = this.§_-k8§.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -271,7 +271,7 @@ package package_76
|
||||
return true;
|
||||
}
|
||||
|
||||
private function method_662(origin:name_194, dir:name_194, bb:name_386, time:MinMax) : Boolean
|
||||
private function §_-oL§(origin:§_-bj§, dir:§_-bj§, bb:§_-FW§, time:MinMax) : Boolean
|
||||
{
|
||||
var t1:Number = NaN;
|
||||
var t2:Number = NaN;
|
||||
@@ -348,12 +348,12 @@ package package_76
|
||||
return true;
|
||||
}
|
||||
|
||||
private function method_652(node:name_656, origin:name_194, localOrigin:name_194, dir:name_194, collisionGroup:int, t1:Number, t2:Number, predicate:name_631, result:name_273) : Boolean
|
||||
private function §_-NC§(node:§_-oZ§, origin:§_-bj§, localOrigin:§_-bj§, dir:§_-bj§, collisionGroup:int, t1:Number, t2:Number, predicate:§_-jn§, result:§_-jr§) : Boolean
|
||||
{
|
||||
var splitTime:Number = NaN;
|
||||
var currChildNode:name_656 = null;
|
||||
var currChildNode:§_-oZ§ = null;
|
||||
var intersects:Boolean = false;
|
||||
if(node.indices != null && this.method_660(origin,dir,collisionGroup,this.var_592.name_661,node.indices,predicate,result))
|
||||
if(node.indices != null && this.§_-FH§(origin,dir,collisionGroup,this.§_-bw§.§_-8A§,node.indices,predicate,result))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -372,7 +372,7 @@ package package_76
|
||||
{
|
||||
splitTime = (node.coord - origin.x) / dir.x;
|
||||
}
|
||||
currChildNode = localOrigin.x < node.coord ? node.name_657 : node.name_658;
|
||||
currChildNode = localOrigin.x < node.coord ? node.§_-Gm§ : node.§_-75§;
|
||||
break;
|
||||
case 1:
|
||||
if(dir.y > -this.threshold && dir.y < this.threshold)
|
||||
@@ -383,7 +383,7 @@ package package_76
|
||||
{
|
||||
splitTime = (node.coord - origin.y) / dir.y;
|
||||
}
|
||||
currChildNode = localOrigin.y < node.coord ? node.name_657 : node.name_658;
|
||||
currChildNode = localOrigin.y < node.coord ? node.§_-Gm§ : node.§_-75§;
|
||||
break;
|
||||
case 2:
|
||||
if(dir.z > -this.threshold && dir.z < this.threshold)
|
||||
@@ -394,26 +394,26 @@ package package_76
|
||||
{
|
||||
splitTime = (node.coord - origin.z) / dir.z;
|
||||
}
|
||||
currChildNode = localOrigin.z < node.coord ? node.name_657 : node.name_658;
|
||||
currChildNode = localOrigin.z < node.coord ? node.§_-Gm§ : node.§_-75§;
|
||||
}
|
||||
if(splitTime < t1 || splitTime > t2)
|
||||
{
|
||||
return this.method_652(currChildNode,origin,localOrigin,dir,collisionGroup,t1,t2,predicate,result);
|
||||
return this.§_-NC§(currChildNode,origin,localOrigin,dir,collisionGroup,t1,t2,predicate,result);
|
||||
}
|
||||
intersects = this.method_652(currChildNode,origin,localOrigin,dir,collisionGroup,t1,splitTime,predicate,result);
|
||||
intersects = this.§_-NC§(currChildNode,origin,localOrigin,dir,collisionGroup,t1,splitTime,predicate,result);
|
||||
if(intersects)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
this.var_590.x = origin.x + splitTime * dir.x;
|
||||
this.var_590.y = origin.y + splitTime * dir.y;
|
||||
this.var_590.z = origin.z + splitTime * dir.z;
|
||||
return this.method_652(currChildNode == node.name_657 ? node.name_658 : node.name_657,origin,this.var_590,dir,collisionGroup,splitTime,t2,predicate,result);
|
||||
this.§_-0q§.x = origin.x + splitTime * dir.x;
|
||||
this.§_-0q§.y = origin.y + splitTime * dir.y;
|
||||
this.§_-0q§.z = origin.z + splitTime * dir.z;
|
||||
return this.§_-NC§(currChildNode == node.§_-Gm§ ? node.§_-75§ : node.§_-Gm§,origin,this.§_-0q§,dir,collisionGroup,splitTime,t2,predicate,result);
|
||||
}
|
||||
|
||||
private function method_660(origin:name_194, dir:name_194, collisionGroup:int, primitives:Vector.<name_235>, indices:Vector.<int>, filter:name_631, intersection:name_273) : Boolean
|
||||
private function §_-FH§(origin:§_-bj§, dir:§_-bj§, collisionGroup:int, primitives:Vector.<§_-Nh§>, indices:Vector.<int>, filter:§_-jn§, intersection:§_-jr§) : Boolean
|
||||
{
|
||||
var primitive:name_235 = null;
|
||||
var primitive:§_-Nh§ = null;
|
||||
var t:Number = NaN;
|
||||
var pnum:int = int(indices.length);
|
||||
var minTime:Number = 1e+308;
|
||||
@@ -422,16 +422,16 @@ package package_76
|
||||
primitive = primitives[indices[i]];
|
||||
if((primitive.collisionGroup & collisionGroup) != 0)
|
||||
{
|
||||
if(!(filter != null && !filter.name_664(primitive)))
|
||||
if(!(filter != null && !filter.§_-0w§(primitive)))
|
||||
{
|
||||
t = primitive.raycast(origin,dir,this.threshold,this.var_594);
|
||||
t = Number(primitive.raycast(origin,dir,this.threshold,this.§_-k8§));
|
||||
if(t > 0 && t < minTime)
|
||||
{
|
||||
minTime = t;
|
||||
intersection.primitive = primitive;
|
||||
intersection.normal.x = this.var_594.x;
|
||||
intersection.normal.y = this.var_594.y;
|
||||
intersection.normal.z = this.var_594.z;
|
||||
intersection.normal.x = this.§_-k8§.x;
|
||||
intersection.normal.y = this.§_-k8§.y;
|
||||
intersection.normal.z = this.§_-k8§.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package package_76
|
||||
package §_-1e§
|
||||
{
|
||||
import package_90.name_386;
|
||||
import §_-KA§.§_-FW§;
|
||||
|
||||
public class CollisionKdTree2D
|
||||
{
|
||||
private static const nodeBoundBoxThreshold:name_386 = new name_386();
|
||||
private static const nodeBoundBoxThreshold:§_-FW§ = new §_-FW§();
|
||||
|
||||
private static const splitCoordsX:Vector.<Number> = new Vector.<Number>();
|
||||
|
||||
@@ -18,53 +18,53 @@ package package_76
|
||||
|
||||
public var threshold:Number = 0.1;
|
||||
|
||||
public var var_681:int = 1;
|
||||
public var §_-eV§:int = 1;
|
||||
|
||||
public var parentTree:name_663;
|
||||
public var parentTree:§_-D-§;
|
||||
|
||||
public var parentNode:name_656;
|
||||
public var parentNode:§_-oZ§;
|
||||
|
||||
public var name_659:name_656;
|
||||
public var §_-5H§:§_-oZ§;
|
||||
|
||||
private var var_678:int;
|
||||
private var §_-94§:int;
|
||||
|
||||
private var var_680:Number;
|
||||
private var §_-ou§:Number;
|
||||
|
||||
private var var_677:Number;
|
||||
private var §_-P5§:Number;
|
||||
|
||||
public function CollisionKdTree2D(parentTree:name_663, parentNode:name_656)
|
||||
public function CollisionKdTree2D(parentTree:§_-D-§, parentNode:§_-oZ§)
|
||||
{
|
||||
super();
|
||||
this.parentTree = parentTree;
|
||||
this.parentNode = parentNode;
|
||||
}
|
||||
|
||||
public function name_669() : void
|
||||
public function §_-J9§() : void
|
||||
{
|
||||
this.name_659 = new name_656();
|
||||
this.name_659.boundBox = this.parentNode.boundBox.clone();
|
||||
this.name_659.indices = new Vector.<int>();
|
||||
var numObjects:int = int(this.parentNode.var_674.length);
|
||||
for(var i:int = 0; i < numObjects; this.name_659.indices[i] = this.parentNode.var_674[i],i++)
|
||||
this.§_-5H§ = new §_-oZ§();
|
||||
this.§_-5H§.boundBox = this.parentNode.boundBox.clone();
|
||||
this.§_-5H§.indices = new Vector.<int>();
|
||||
var numObjects:int = int(this.parentNode.§_-Xt§.length);
|
||||
for(var i:int = 0; i < numObjects; this.§_-5H§.indices[i] = this.parentNode.§_-Xt§[i],i++)
|
||||
{
|
||||
}
|
||||
this.splitNode(this.name_659);
|
||||
this.splitNode(this.§_-5H§);
|
||||
splitCoordsX.length = splitCoordsY.length = splitCoordsZ.length = 0;
|
||||
}
|
||||
|
||||
private function splitNode(node:name_656) : void
|
||||
private function splitNode(node:§_-oZ§) : void
|
||||
{
|
||||
var objects:Vector.<int> = null;
|
||||
var i:int = 0;
|
||||
var j:int = 0;
|
||||
var nodeBoundBox:name_386 = null;
|
||||
var nodeBoundBox:§_-FW§ = null;
|
||||
var numSplitCoordsX:int = 0;
|
||||
var numSplitCoordsY:int = 0;
|
||||
var numSplitCoordsZ:int = 0;
|
||||
var bb:name_386 = null;
|
||||
var bb:§_-FW§ = null;
|
||||
var min:Number = NaN;
|
||||
var max:Number = NaN;
|
||||
if(node.indices.length <= this.var_681)
|
||||
if(node.indices.length <= this.§_-eV§)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -77,7 +77,7 @@ package package_76
|
||||
nodeBoundBoxThreshold.maxY = nodeBoundBox.maxY - this.threshold;
|
||||
nodeBoundBoxThreshold.maxZ = nodeBoundBox.maxZ - this.threshold;
|
||||
var doubleThreshold:Number = this.threshold * 2;
|
||||
var staticBoundBoxes:Vector.<name_386> = this.parentTree.staticBoundBoxes;
|
||||
var staticBoundBoxes:Vector.<§_-FW§> = this.parentTree.staticBoundBoxes;
|
||||
var numObjects:int = int(objects.length);
|
||||
for(i = 0; i < numObjects; )
|
||||
{
|
||||
@@ -123,8 +123,8 @@ package package_76
|
||||
}
|
||||
i++;
|
||||
}
|
||||
this.var_678 = -1;
|
||||
this.var_680 = 1e+308;
|
||||
this.§_-94§ = -1;
|
||||
this.§_-ou§ = 1e+308;
|
||||
_nodeBB[0] = nodeBoundBox.minX;
|
||||
_nodeBB[1] = nodeBoundBox.minY;
|
||||
_nodeBB[2] = nodeBoundBox.minZ;
|
||||
@@ -133,44 +133,44 @@ package package_76
|
||||
_nodeBB[5] = nodeBoundBox.maxZ;
|
||||
if(this.parentNode.axis != 0)
|
||||
{
|
||||
this.method_834(node,0,numSplitCoordsX,splitCoordsX,_nodeBB);
|
||||
this.§_-1k§(node,0,numSplitCoordsX,splitCoordsX,_nodeBB);
|
||||
}
|
||||
if(this.parentNode.axis != 1)
|
||||
{
|
||||
this.method_834(node,1,numSplitCoordsY,splitCoordsY,_nodeBB);
|
||||
this.§_-1k§(node,1,numSplitCoordsY,splitCoordsY,_nodeBB);
|
||||
}
|
||||
if(this.parentNode.axis != 2)
|
||||
{
|
||||
this.method_834(node,2,numSplitCoordsZ,splitCoordsZ,_nodeBB);
|
||||
this.§_-1k§(node,2,numSplitCoordsZ,splitCoordsZ,_nodeBB);
|
||||
}
|
||||
if(this.var_678 < 0)
|
||||
if(this.§_-94§ < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var axisX:Boolean = this.var_678 == 0;
|
||||
var axisY:Boolean = this.var_678 == 1;
|
||||
node.axis = this.var_678;
|
||||
node.coord = this.var_677;
|
||||
node.name_657 = new name_656();
|
||||
node.name_657.parent = node;
|
||||
node.name_657.boundBox = nodeBoundBox.clone();
|
||||
node.name_658 = new name_656();
|
||||
node.name_658.parent = node;
|
||||
node.name_658.boundBox = nodeBoundBox.clone();
|
||||
var axisX:Boolean = this.§_-94§ == 0;
|
||||
var axisY:Boolean = this.§_-94§ == 1;
|
||||
node.axis = this.§_-94§;
|
||||
node.coord = this.§_-P5§;
|
||||
node.§_-Gm§ = new §_-oZ§();
|
||||
node.§_-Gm§.parent = node;
|
||||
node.§_-Gm§.boundBox = nodeBoundBox.clone();
|
||||
node.§_-75§ = new §_-oZ§();
|
||||
node.§_-75§.parent = node;
|
||||
node.§_-75§.boundBox = nodeBoundBox.clone();
|
||||
if(axisX)
|
||||
{
|
||||
node.name_657.boundBox.maxX = node.name_658.boundBox.minX = this.var_677;
|
||||
node.§_-Gm§.boundBox.maxX = node.§_-75§.boundBox.minX = this.§_-P5§;
|
||||
}
|
||||
else if(axisY)
|
||||
{
|
||||
node.name_657.boundBox.maxY = node.name_658.boundBox.minY = this.var_677;
|
||||
node.§_-Gm§.boundBox.maxY = node.§_-75§.boundBox.minY = this.§_-P5§;
|
||||
}
|
||||
else
|
||||
{
|
||||
node.name_657.boundBox.maxZ = node.name_658.boundBox.minZ = this.var_677;
|
||||
node.§_-Gm§.boundBox.maxZ = node.§_-75§.boundBox.minZ = this.§_-P5§;
|
||||
}
|
||||
var coordMin:Number = this.var_677 - this.threshold;
|
||||
var coordMax:Number = this.var_677 + this.threshold;
|
||||
var coordMin:Number = this.§_-P5§ - this.threshold;
|
||||
var coordMax:Number = this.§_-P5§ + this.threshold;
|
||||
for(i = 0; i < numObjects; )
|
||||
{
|
||||
bb = staticBoundBoxes[objects[i]];
|
||||
@@ -180,11 +180,11 @@ package package_76
|
||||
{
|
||||
if(min < coordMin)
|
||||
{
|
||||
if(node.name_657.indices == null)
|
||||
if(node.§_-Gm§.indices == null)
|
||||
{
|
||||
node.name_657.indices = new Vector.<int>();
|
||||
node.§_-Gm§.indices = new Vector.<int>();
|
||||
}
|
||||
node.name_657.indices.push(objects[i]);
|
||||
node.§_-Gm§.indices.push(objects[i]);
|
||||
objects[i] = -1;
|
||||
}
|
||||
}
|
||||
@@ -192,11 +192,11 @@ package package_76
|
||||
{
|
||||
if(max > coordMax)
|
||||
{
|
||||
if(node.name_658.indices == null)
|
||||
if(node.§_-75§.indices == null)
|
||||
{
|
||||
node.name_658.indices = new Vector.<int>();
|
||||
node.§_-75§.indices = new Vector.<int>();
|
||||
}
|
||||
node.name_658.indices.push(objects[i]);
|
||||
node.§_-75§.indices.push(objects[i]);
|
||||
objects[i] = -1;
|
||||
}
|
||||
}
|
||||
@@ -219,17 +219,17 @@ package package_76
|
||||
{
|
||||
node.indices = null;
|
||||
}
|
||||
if(node.name_657.indices != null)
|
||||
if(node.§_-Gm§.indices != null)
|
||||
{
|
||||
this.splitNode(node.name_657);
|
||||
this.splitNode(node.§_-Gm§);
|
||||
}
|
||||
if(node.name_658.indices != null)
|
||||
if(node.§_-75§.indices != null)
|
||||
{
|
||||
this.splitNode(node.name_658);
|
||||
this.splitNode(node.§_-75§);
|
||||
}
|
||||
}
|
||||
|
||||
private function method_834(node:name_656, axis:int, numSplitCoords:int, splitCoords:Vector.<Number>, bb:Vector.<Number>) : void
|
||||
private function §_-1k§(node:§_-oZ§, axis:int, numSplitCoords:int, splitCoords:Vector.<Number>, bb:Vector.<Number>) : void
|
||||
{
|
||||
var currSplitCoord:Number = NaN;
|
||||
var minCoord:Number = NaN;
|
||||
@@ -242,11 +242,11 @@ package package_76
|
||||
var numObjects:int = 0;
|
||||
var j:int = 0;
|
||||
var cost:Number = NaN;
|
||||
var boundBox:name_386 = null;
|
||||
var boundBox:§_-FW§ = null;
|
||||
var axis1:int = (axis + 1) % 3;
|
||||
var axis2:int = (axis + 2) % 3;
|
||||
var area:Number = (bb[axis1 + 3] - bb[axis1]) * (bb[axis2 + 3] - bb[axis2]);
|
||||
var staticBoundBoxes:Vector.<name_386> = this.parentTree.staticBoundBoxes;
|
||||
var staticBoundBoxes:Vector.<§_-FW§> = this.parentTree.staticBoundBoxes;
|
||||
for(var i:int = 0; i < numSplitCoords; i++)
|
||||
{
|
||||
currSplitCoord = splitCoords[i];
|
||||
@@ -288,11 +288,11 @@ package package_76
|
||||
j++;
|
||||
}
|
||||
cost = areaNegative * numNegative + areaPositive * numPositive;
|
||||
if(!conflict && cost < this.var_680 && numNegative > 0 && numPositive > 0)
|
||||
if(!conflict && cost < this.§_-ou§ && numNegative > 0 && numPositive > 0)
|
||||
{
|
||||
this.var_678 = axis;
|
||||
this.var_680 = cost;
|
||||
this.var_677 = currSplitCoord;
|
||||
this.§_-94§ = axis;
|
||||
this.§_-ou§ = cost;
|
||||
this.§_-P5§ = currSplitCoord;
|
||||
}
|
||||
for(j = i + 1; j < numSplitCoords; )
|
||||
{
|
||||
209
src/?_-5U?/?_-Kr?.as
Normal file
@@ -0,0 +1,209 @@
|
||||
package §_-5U§
|
||||
{
|
||||
import §_-5g§.§_-OD§;
|
||||
import §_-5g§.§_-iB§;
|
||||
import §_-Ep§.§_-7§;
|
||||
import §_-Ep§.§_-pA§;
|
||||
import §_-GD§.§_-6A§;
|
||||
import §_-GD§.§_-X8§;
|
||||
import §_-GD§.§_-dX§;
|
||||
import §_-HW§.§_-pf§;
|
||||
import §_-MU§.§_-5-§;
|
||||
import §_-MU§.§_-du§;
|
||||
import §_-O5§.§_-c-§;
|
||||
import §_-Tt§.§_-Hi§;
|
||||
import §_-Tt§.§_-Ho§;
|
||||
import §_-Uy§.§_-oP§;
|
||||
import §_-XV§.§_-31§;
|
||||
import §_-XV§.§_-Yx§;
|
||||
import §_-aA§.§_-1O§;
|
||||
import §_-aA§.§_-6t§;
|
||||
import §_-aA§.§_-a-§;
|
||||
import §_-io§.§_-39§;
|
||||
import §_-io§.§_-Cs§;
|
||||
import §_-o8§.§_-Bh§;
|
||||
import §_-o8§.§_-Ut§;
|
||||
import flash.display.DisplayObjectContainer;
|
||||
import flash.display.Stage;
|
||||
import flash.events.KeyboardEvent;
|
||||
import flash.ui.Keyboard;
|
||||
|
||||
public class §_-Kr§ implements §_-6t§
|
||||
{
|
||||
private var osgi:§_-oP§;
|
||||
|
||||
private var clientLog:§_-5-§;
|
||||
|
||||
private var console:§_-dX§;
|
||||
|
||||
private var §_-UU§:KeyboardShortcut;
|
||||
|
||||
private var §_-jQ§:KeyboardShortcut;
|
||||
|
||||
public function §_-Kr§()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function start(rootContainer:DisplayObjectContainer, urlParams:§_-c-§, libraryInfos:Vector.<§_-a-§>, connectionParameters:§_-1O§, startupLogStrings:Vector.<String>) : void
|
||||
{
|
||||
var libraryInfo:§_-a-§ = null;
|
||||
this.osgi = §_-oP§.§_-nQ§();
|
||||
this.§_-SF§(urlParams,startupLogStrings);
|
||||
this.§_-33§(rootContainer.stage,urlParams);
|
||||
this.osgi.§_-g2§(§_-iB§,new §_-OD§(urlParams,libraryInfos));
|
||||
this.osgi.§_-g2§(§_-31§,new §_-Yx§(rootContainer));
|
||||
this.osgi.§_-g2§(§_-Ho§,new §_-Hi§(connectionParameters.serverAddress,connectionParameters.serverPorts,connectionParameters.resourcesRootURL));
|
||||
var language:String = urlParams.§_-aR§("lang","ru");
|
||||
this.osgi.§_-g2§(§_-7§,new §_-pA§(language,"en"));
|
||||
var dumpService:§_-39§ = new §_-Cs§(this.osgi);
|
||||
this.osgi.§_-g2§(§_-39§,dumpService);
|
||||
dumpService.§_-Wc§(new §_-Bh§(this.osgi));
|
||||
dumpService.§_-Wc§(new §_-Ut§(this.osgi));
|
||||
for each(libraryInfo in libraryInfos)
|
||||
{
|
||||
this.osgi.§_-XK§(new §_-pf§(libraryInfo.manifestProperties));
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-SF§(urlParams:§_-c-§, startupLogStrings:Vector.<String>) : void
|
||||
{
|
||||
var s:String = null;
|
||||
var logChannelBufferSize:int = int(int(urlParams.§_-aR§("log_channel_buffer_size","1000")));
|
||||
this.clientLog = new §_-du§(logChannelBufferSize);
|
||||
§_-oP§.clientLog = this.clientLog;
|
||||
this.osgi.§_-g2§(§_-5-§,this.clientLog);
|
||||
for each(s in startupLogStrings)
|
||||
{
|
||||
this.clientLog.log("startup",s);
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-33§(stage:Stage, urlParams:§_-c-§) : void
|
||||
{
|
||||
var channelName:String = null;
|
||||
this.console = new §_-dX§(stage,50,100,1,1);
|
||||
this.osgi.§_-g2§(§_-6A§,this.console);
|
||||
var consoleParams:String = urlParams.§_-PU§("console");
|
||||
if(Boolean(consoleParams))
|
||||
{
|
||||
this.§_-bC§(stage,this.console,consoleParams);
|
||||
}
|
||||
var clientLogConnector:§_-X8§ = new §_-X8§(this.clientLog,this.console);
|
||||
this.console.§_-0j§("log",clientLogConnector.§_-9Q§);
|
||||
var logChannels:String = urlParams.§_-PU§("showlog");
|
||||
if(Boolean(logChannels))
|
||||
{
|
||||
if(logChannels == "all")
|
||||
{
|
||||
this.clientLog.addLogListener(clientLogConnector);
|
||||
}
|
||||
else
|
||||
{
|
||||
for each(channelName in logChannels.split(","))
|
||||
{
|
||||
this.clientLog.addLogChannelListener(channelName,clientLogConnector);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-bC§(stage:Stage, console:§_-dX§, consoleParams:String) : void
|
||||
{
|
||||
var pair:String = null;
|
||||
var parts:Array = null;
|
||||
var pairs:Array = consoleParams.split(",");
|
||||
var params:Object = {};
|
||||
for each(pair in pairs)
|
||||
{
|
||||
parts = pair.split(":");
|
||||
params[parts[0]] = parts[1];
|
||||
}
|
||||
if(params["show"] != null)
|
||||
{
|
||||
console.show();
|
||||
}
|
||||
if(params["ha"] != null)
|
||||
{
|
||||
console.§_-TC§ = int(params["ha"]);
|
||||
}
|
||||
if(params["va"] != null)
|
||||
{
|
||||
console.§_-p2§ = int(params["va"]);
|
||||
}
|
||||
if(params["w"] != null)
|
||||
{
|
||||
console.width = int(params["w"]);
|
||||
}
|
||||
if(params["h"] != null)
|
||||
{
|
||||
console.height = int(params["h"]);
|
||||
}
|
||||
if(params["alpha"] != null)
|
||||
{
|
||||
console.§_-I1§("con_alpha " + params["alpha"]);
|
||||
}
|
||||
this.§_-UU§ = this.§ for§(params["hsw"],Keyboard.LEFT,false,true,true);
|
||||
this.§_-jQ§ = this.§ for§(params["vsw"],Keyboard.UP,false,true,true);
|
||||
stage.addEventListener(KeyboardEvent.KEY_DOWN,this.§_-bM§,true);
|
||||
}
|
||||
|
||||
private function § for§(s:String, defKey:int, defAlt:Boolean, defCtrl:Boolean, defShift:Boolean) : KeyboardShortcut
|
||||
{
|
||||
if(s == null)
|
||||
{
|
||||
return new KeyboardShortcut(defKey,defAlt,defCtrl,defShift);
|
||||
}
|
||||
return new KeyboardShortcut(parseInt(s),s.indexOf("a") > -1,s.indexOf("c") > -1,s.indexOf("s") > -1);
|
||||
}
|
||||
|
||||
private function §_-bM§(e:KeyboardEvent) : void
|
||||
{
|
||||
switch(e.keyCode)
|
||||
{
|
||||
case this.§_-UU§.keyCode:
|
||||
if(this.§_-UU§.altKey == e.altKey && this.§_-UU§.shiftKey == e.shiftKey && this.§_-UU§.ctrlKey == e.ctrlKey)
|
||||
{
|
||||
if(this.console.§_-TC§ == 1)
|
||||
{
|
||||
this.console.§_-TC§ = 2;
|
||||
break;
|
||||
}
|
||||
this.console.§_-TC§ = 1;
|
||||
}
|
||||
break;
|
||||
case this.§_-jQ§.keyCode:
|
||||
if(this.§_-jQ§.altKey == e.altKey && this.§_-jQ§.shiftKey == e.shiftKey && this.§_-jQ§.ctrlKey == e.ctrlKey)
|
||||
{
|
||||
if(this.console.§_-p2§ == 1)
|
||||
{
|
||||
this.console.§_-p2§ = 2;
|
||||
break;
|
||||
}
|
||||
this.console.§_-p2§ = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class KeyboardShortcut
|
||||
{
|
||||
public var keyCode:int;
|
||||
|
||||
public var altKey:Boolean;
|
||||
|
||||
public var ctrlKey:Boolean;
|
||||
|
||||
public var shiftKey:Boolean;
|
||||
|
||||
public function KeyboardShortcut(keyCode:int, altKey:Boolean, ctrlKey:Boolean, shiftKey:Boolean)
|
||||
{
|
||||
super();
|
||||
this.keyCode = keyCode;
|
||||
this.altKey = altKey;
|
||||
this.ctrlKey = ctrlKey;
|
||||
this.shiftKey = shiftKey;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package package_21
|
||||
package §_-8D§
|
||||
{
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import flash.display.Bitmap;
|
||||
@@ -24,9 +24,9 @@ package package_21
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class name_124 extends name_78
|
||||
public class §_-be§ extends §_-OX§
|
||||
{
|
||||
public var view:name_81;
|
||||
public var view:§_-JI§;
|
||||
|
||||
public var fov:Number = 1.5707963267948966;
|
||||
|
||||
@@ -50,15 +50,15 @@ package package_21
|
||||
|
||||
alternativa3d var correctionY:Number;
|
||||
|
||||
alternativa3d var lights:Vector.<name_116> = new Vector.<name_116>();
|
||||
alternativa3d var lights:Vector.<§_-Jo§> = new Vector.<§_-Jo§>();
|
||||
|
||||
alternativa3d var lightsLength:int = 0;
|
||||
|
||||
alternativa3d var ambient:Vector.<Number> = new Vector.<Number>(4);
|
||||
|
||||
alternativa3d var childLights:Vector.<name_116> = new Vector.<name_116>();
|
||||
alternativa3d var childLights:Vector.<§_-Jo§> = new Vector.<§_-Jo§>();
|
||||
|
||||
alternativa3d var frustum:name_429;
|
||||
alternativa3d var frustum:§_-Lg§;
|
||||
|
||||
alternativa3d var origins:Vector.<Vector3D> = new Vector.<Vector3D>();
|
||||
|
||||
@@ -66,13 +66,13 @@ package package_21
|
||||
|
||||
alternativa3d var raysLength:int = 0;
|
||||
|
||||
alternativa3d var occluders:Vector.<name_431> = new Vector.<name_431>();
|
||||
alternativa3d var occluders:Vector.<§_-PS§> = new Vector.<§_-PS§>();
|
||||
|
||||
alternativa3d var occludersLength:int = 0;
|
||||
|
||||
alternativa3d var context3D:Context3D;
|
||||
|
||||
alternativa3d var renderer:name_430;
|
||||
alternativa3d var renderer:§_-7p§;
|
||||
|
||||
alternativa3d var numDraws:int;
|
||||
|
||||
@@ -124,25 +124,25 @@ package package_21
|
||||
|
||||
private var timer:int;
|
||||
|
||||
public function name_124(nearClipping:Number, farClipping:Number)
|
||||
public function §_-be§(nearClipping:Number, farClipping:Number)
|
||||
{
|
||||
super();
|
||||
this.nearClipping = nearClipping;
|
||||
this.farClipping = farClipping;
|
||||
this.alternativa3d::renderer = new name_430();
|
||||
this.alternativa3d::frustum = new name_429();
|
||||
this.alternativa3d::frustum.next = new name_429();
|
||||
this.alternativa3d::frustum.next.next = new name_429();
|
||||
this.alternativa3d::frustum.next.next.next = new name_429();
|
||||
this.alternativa3d::frustum.next.next.next.next = new name_429();
|
||||
this.alternativa3d::frustum.next.next.next.next.next = new name_429();
|
||||
this.alternativa3d::renderer = new §_-7p§();
|
||||
this.alternativa3d::frustum = new §_-Lg§();
|
||||
this.alternativa3d::frustum.next = new §_-Lg§();
|
||||
this.alternativa3d::frustum.next.next = new §_-Lg§();
|
||||
this.alternativa3d::frustum.next.next.next = new §_-Lg§();
|
||||
this.alternativa3d::frustum.next.next.next.next = new §_-Lg§();
|
||||
this.alternativa3d::frustum.next.next.next.next.next = new §_-Lg§();
|
||||
}
|
||||
|
||||
public function render(stage3D:Stage3D) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var light:name_116 = null;
|
||||
var root:name_78 = null;
|
||||
var light:§_-Jo§ = null;
|
||||
var root:§_-OX§ = null;
|
||||
var childLightsLength:int = 0;
|
||||
if(stage3D == null)
|
||||
{
|
||||
@@ -157,11 +157,11 @@ package package_21
|
||||
this.alternativa3d::ambient[2] = 0;
|
||||
this.alternativa3d::ambient[3] = 1;
|
||||
this.alternativa3d::context3D = stage3D.context3D;
|
||||
if(this.alternativa3d::context3D != null && this.view != null && this.alternativa3d::renderer != null && (this.view.stage != null || this.view.alternativa3d::var_114 != null))
|
||||
if(this.alternativa3d::context3D != null && this.view != null && this.alternativa3d::renderer != null && (this.view.stage != null || this.view.alternativa3d::_-gJ != null))
|
||||
{
|
||||
this.alternativa3d::renderer.alternativa3d::camera = this;
|
||||
this.alternativa3d::calculateProjection(this.view.alternativa3d::var_110,this.view.alternativa3d::_height);
|
||||
this.view.alternativa3d::method_244(stage3D,this.alternativa3d::context3D);
|
||||
this.alternativa3d::calculateProjection(this.view.alternativa3d::_-qj,this.view.alternativa3d::_height);
|
||||
this.view.alternativa3d::_-jR(stage3D,this.alternativa3d::context3D);
|
||||
if(alternativa3d::transformChanged)
|
||||
{
|
||||
alternativa3d::composeTransforms();
|
||||
@@ -192,7 +192,7 @@ package package_21
|
||||
if(root.boundBox != null)
|
||||
{
|
||||
this.alternativa3d::calculateFrustum(root.alternativa3d::cameraToLocalTransform);
|
||||
root.alternativa3d::culling = root.boundBox.alternativa3d::name_393(this.alternativa3d::frustum,63);
|
||||
root.alternativa3d::culling = root.boundBox.alternativa3d::_-JT(this.alternativa3d::frustum,63);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -212,12 +212,12 @@ package package_21
|
||||
light.alternativa3d::blue = (light.color & 0xFF) * light.intensity / 255;
|
||||
}
|
||||
root.alternativa3d::localToCameraTransform.combine(alternativa3d::globalToLocalTransform,root.alternativa3d::transform);
|
||||
if(root.alternativa3d::culling >= 0 && (root.boundBox == null || this.alternativa3d::occludersLength == 0 || Boolean(root.boundBox.alternativa3d::name_392(this,root))))
|
||||
if(root.alternativa3d::culling >= 0 && (root.boundBox == null || this.alternativa3d::occludersLength == 0 || Boolean(root.boundBox.alternativa3d::_-RA(this,root))))
|
||||
{
|
||||
if(Boolean(root.alternativa3d::listening) && root.boundBox != null)
|
||||
{
|
||||
this.alternativa3d::calculateRays(root.alternativa3d::cameraToLocalTransform);
|
||||
root.alternativa3d::listening = root.boundBox.alternativa3d::name_391(this.alternativa3d::origins,this.alternativa3d::directions,this.alternativa3d::raysLength);
|
||||
root.alternativa3d::listening = root.boundBox.alternativa3d::_-Xu(this.alternativa3d::origins,this.alternativa3d::directions,this.alternativa3d::raysLength);
|
||||
}
|
||||
if(this.alternativa3d::lightsLength > 0 && Boolean(root.alternativa3d::useLights))
|
||||
{
|
||||
@@ -227,8 +227,8 @@ package package_21
|
||||
for(i = 0; i < this.alternativa3d::lightsLength; )
|
||||
{
|
||||
light = this.alternativa3d::lights[i];
|
||||
light.alternativa3d::name_141.combine(root.alternativa3d::cameraToLocalTransform,light.alternativa3d::localToCameraTransform);
|
||||
if(light.boundBox == null || light.alternativa3d::checkBound(root))
|
||||
light.alternativa3d::_-cl.combine(root.alternativa3d::cameraToLocalTransform,light.alternativa3d::localToCameraTransform);
|
||||
if(light.boundBox == null || Boolean(light.alternativa3d::checkBound(root)))
|
||||
{
|
||||
this.alternativa3d::childLights[childLightsLength] = light;
|
||||
childLightsLength++;
|
||||
@@ -242,7 +242,7 @@ package package_21
|
||||
for(i = 0; i < this.alternativa3d::lightsLength; )
|
||||
{
|
||||
light = this.alternativa3d::lights[i];
|
||||
light.alternativa3d::name_141.combine(root.alternativa3d::cameraToLocalTransform,light.alternativa3d::localToCameraTransform);
|
||||
light.alternativa3d::_-cl.combine(root.alternativa3d::cameraToLocalTransform,light.alternativa3d::localToCameraTransform);
|
||||
i++;
|
||||
}
|
||||
root.alternativa3d::collectDraws(this,this.alternativa3d::lights,this.alternativa3d::lightsLength);
|
||||
@@ -255,15 +255,15 @@ package package_21
|
||||
}
|
||||
root.alternativa3d::collectChildrenDraws(this,this.alternativa3d::lights,this.alternativa3d::lightsLength);
|
||||
}
|
||||
this.view.alternativa3d::method_243(this.alternativa3d::context3D,this);
|
||||
this.view.alternativa3d::_-7K(this.alternativa3d::context3D,this);
|
||||
this.alternativa3d::renderer.alternativa3d::render(this.alternativa3d::context3D);
|
||||
if(this.view.alternativa3d::var_114 == null)
|
||||
if(this.view.alternativa3d::_-gJ == null)
|
||||
{
|
||||
this.alternativa3d::context3D.present();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.alternativa3d::context3D.drawToBitmapData(this.view.alternativa3d::var_114);
|
||||
this.alternativa3d::context3D.drawToBitmapData(this.view.alternativa3d::_-gJ);
|
||||
this.alternativa3d::context3D.present();
|
||||
}
|
||||
}
|
||||
@@ -279,7 +279,7 @@ package package_21
|
||||
{
|
||||
throw new Error("It is necessary to have view set.");
|
||||
}
|
||||
var viewSizeX:Number = this.view.alternativa3d::var_110 * 0.5;
|
||||
var viewSizeX:Number = this.view.alternativa3d::_-qj * 0.5;
|
||||
var viewSizeY:Number = this.view.alternativa3d::_height * 0.5;
|
||||
var focalLength:Number = Math.sqrt(viewSizeX * viewSizeX + viewSizeY * viewSizeY) / Math.tan(this.fov * 0.5);
|
||||
var res:Vector3D = globalToLocal(point);
|
||||
@@ -294,7 +294,7 @@ package package_21
|
||||
{
|
||||
throw new Error("It is necessary to have view set.");
|
||||
}
|
||||
var viewSizeX:Number = this.view.alternativa3d::var_110 * 0.5;
|
||||
var viewSizeX:Number = this.view.alternativa3d::_-qj * 0.5;
|
||||
var viewSizeY:Number = this.view.alternativa3d::_height * 0.5;
|
||||
var focalLength:Number = Math.sqrt(viewSizeX * viewSizeX + viewSizeY * viewSizeY) / Math.tan(this.fov * 0.5);
|
||||
var dx:Number = viewX - viewSizeX;
|
||||
@@ -307,7 +307,7 @@ package package_21
|
||||
alternativa3d::composeTransforms();
|
||||
}
|
||||
trm.copy(alternativa3d::transform);
|
||||
for(var root:name_78 = this; root.parent != null; )
|
||||
for(var root:§_-OX§ = this; root.parent != null; )
|
||||
{
|
||||
root = root.parent;
|
||||
if(root.alternativa3d::transformChanged)
|
||||
@@ -328,17 +328,17 @@ package package_21
|
||||
direction.z *= directionL;
|
||||
}
|
||||
|
||||
override public function clone() : name_78
|
||||
override public function clone() : §_-OX§
|
||||
{
|
||||
var res:name_124 = new name_124(this.nearClipping,this.farClipping);
|
||||
var res:§_-be§ = new §_-be§(this.nearClipping,this.farClipping);
|
||||
res.clonePropertiesFrom(this);
|
||||
return res;
|
||||
}
|
||||
|
||||
override protected function clonePropertiesFrom(source:name_78) : void
|
||||
override protected function clonePropertiesFrom(source:§_-OX§) : void
|
||||
{
|
||||
super.clonePropertiesFrom(source);
|
||||
this.view = (source as name_124).view;
|
||||
this.view = (source as §_-be§).view;
|
||||
}
|
||||
|
||||
alternativa3d function calculateProjection(width:Number, height:Number) : void
|
||||
@@ -364,7 +364,7 @@ package package_21
|
||||
this.alternativa3d::correctionY = viewSizeY / this.alternativa3d::focalLength;
|
||||
}
|
||||
|
||||
alternativa3d function calculateFrustum(transform:name_139) : void
|
||||
alternativa3d function calculateFrustum(transform:§_-jw§) : void
|
||||
{
|
||||
var fa:Number = NaN;
|
||||
var fe:Number = NaN;
|
||||
@@ -380,12 +380,12 @@ package package_21
|
||||
var bz:Number = NaN;
|
||||
var viewSizeX:Number = NaN;
|
||||
var viewSizeY:Number = NaN;
|
||||
var nearPlane:name_429 = this.alternativa3d::frustum;
|
||||
var farPlane:name_429 = nearPlane.next;
|
||||
var leftPlane:name_429 = farPlane.next;
|
||||
var rightPlane:name_429 = leftPlane.next;
|
||||
var topPlane:name_429 = rightPlane.next;
|
||||
var bottomPlane:name_429 = topPlane.next;
|
||||
var nearPlane:§_-Lg§ = this.alternativa3d::frustum;
|
||||
var farPlane:§_-Lg§ = nearPlane.next;
|
||||
var leftPlane:§_-Lg§ = farPlane.next;
|
||||
var rightPlane:§_-Lg§ = leftPlane.next;
|
||||
var topPlane:§_-Lg§ = rightPlane.next;
|
||||
var bottomPlane:§_-Lg§ = topPlane.next;
|
||||
if(!this.orthographic)
|
||||
{
|
||||
fa = transform.a * this.alternativa3d::correctionX;
|
||||
@@ -445,7 +445,7 @@ package package_21
|
||||
}
|
||||
else
|
||||
{
|
||||
viewSizeX = this.view.alternativa3d::var_110 * 0.5;
|
||||
viewSizeX = this.view.alternativa3d::_-qj * 0.5;
|
||||
viewSizeY = this.view.alternativa3d::_height * 0.5;
|
||||
nearPlane.x = transform.j * transform.e - transform.f * transform.i;
|
||||
nearPlane.y = transform.b * transform.i - transform.j * transform.a;
|
||||
@@ -474,7 +474,7 @@ package package_21
|
||||
}
|
||||
}
|
||||
|
||||
alternativa3d function calculateRays(transform:name_139) : void
|
||||
alternativa3d function calculateRays(transform:§_-jw§) : void
|
||||
{
|
||||
var o:Vector3D = null;
|
||||
var d:Vector3D = null;
|
||||
@@ -482,8 +482,8 @@ package package_21
|
||||
var direction:Vector3D = null;
|
||||
for(var i:int = 0; i < this.alternativa3d::raysLength; i++)
|
||||
{
|
||||
o = this.view.alternativa3d::var_127[i];
|
||||
d = this.view.alternativa3d::var_133[i];
|
||||
o = this.view.alternativa3d::_-Cr[i];
|
||||
d = this.view.alternativa3d::_-g4[i];
|
||||
origin = this.alternativa3d::origins[i];
|
||||
direction = this.alternativa3d::directions[i];
|
||||
origin.x = transform.a * o.x + transform.b * o.y + transform.c * o.z + transform.d;
|
||||
@@ -522,7 +522,7 @@ package package_21
|
||||
}
|
||||
}
|
||||
|
||||
alternativa3d function checkInDebug(object:name_78) : int
|
||||
alternativa3d function checkInDebug(object:§_-OX§) : int
|
||||
{
|
||||
var objectClass:Class = null;
|
||||
var res:int = 0;
|
||||
@@ -530,13 +530,13 @@ package package_21
|
||||
{
|
||||
if(Boolean(this.debugSet[debug]))
|
||||
{
|
||||
if(Boolean(this.debugSet[debug][name_78]) || Boolean(this.debugSet[debug][object]))
|
||||
if(Boolean(this.debugSet[debug][§_-OX§]) || Boolean(this.debugSet[debug][object]))
|
||||
{
|
||||
res |= debug;
|
||||
}
|
||||
else
|
||||
{
|
||||
for(objectClass = getDefinitionByName(getQualifiedClassName(object)) as Class; objectClass != name_78; )
|
||||
for(objectClass = getDefinitionByName(getQualifiedClassName(object)) as Class; objectClass != §_-OX§; )
|
||||
{
|
||||
if(Boolean(this.debugSet[debug][objectClass]))
|
||||
{
|
||||
15
src/?_-9C?.as
Normal file
@@ -0,0 +1,15 @@
|
||||
package
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[ExcludeClass]
|
||||
[Embed(source="/_assets/13__-9C.jpg")]
|
||||
public class §_-9C§ extends BitmapAsset
|
||||
{
|
||||
public function §_-9C§()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
package package_81
|
||||
package §_-9Z§
|
||||
{
|
||||
import §_-1e§.§_-fx§;
|
||||
import §_-7A§.§_-3e§;
|
||||
import §_-7A§.§_-Is§;
|
||||
import §_-KA§.§_-jr§;
|
||||
import §_-KT§.§_-Ju§;
|
||||
import §_-RQ§.§_-HE§;
|
||||
import §_-RQ§.§_-Va§;
|
||||
import §_-aF§.§_-S8§;
|
||||
import §_-e6§.§_-1I§;
|
||||
import §_-e6§.§_-RE§;
|
||||
import §_-e6§.§_-fX§;
|
||||
import §_-fT§.§_-HM§;
|
||||
import §_-nl§.Matrix3;
|
||||
import §_-nl§.§_-bj§;
|
||||
import flash.geom.Vector3D;
|
||||
import alternativa.osgi.service.console.variables.ConsoleVarFloat;
|
||||
import alternativa.tanks.game.subsystems.rendersystem.RenderSystem;
|
||||
import alternativa.tanks.game.subsystems.rendersystem.IGraphicEffect;
|
||||
import alternativa.tanks.game.subsystems.rendersystem.GameCamera;
|
||||
import package_25.name_250;
|
||||
import alternativa.tanks.game.utils.objectpool.PooledObject;
|
||||
import alternativa.tanks.game.utils.objectpool.ObjectPool;
|
||||
import package_46.Matrix3;
|
||||
import package_46.name_194;
|
||||
import package_75.class_15;
|
||||
import package_75.name_236;
|
||||
import package_76.name_256;
|
||||
import package_86.name_257;
|
||||
import package_90.name_273;
|
||||
|
||||
public class name_544 extends PooledObject implements IGraphicEffect
|
||||
public class §_-q4§ extends §_-HE§ implements §_-fX§
|
||||
{
|
||||
private static const ANIMATION_FPS:Number = 30;
|
||||
|
||||
@@ -26,110 +26,110 @@ package package_81
|
||||
|
||||
private static const BARREL_INDEX:Number = 0;
|
||||
|
||||
private static var particleBaseSize:ConsoleVarFloat = new ConsoleVarFloat("flame_base_size",100,1,1000);
|
||||
private static var particleBaseSize:§_-Ju§ = new §_-Ju§("flame_base_size",100,1,1000);
|
||||
|
||||
private static var matrix:Matrix3 = new Matrix3();
|
||||
|
||||
private static var particlePosition:name_194 = new name_194();
|
||||
private static var particlePosition:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var barrelOrigin:name_194 = new name_194();
|
||||
private static var barrelOrigin:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var particleDirection:name_194 = new name_194();
|
||||
private static var particleDirection:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var xAxis:name_194 = new name_194();
|
||||
private static var xAxis:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var sourcePosition:name_194 = new name_194();
|
||||
private static var sourcePosition:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var rayHit:name_273 = new name_273();
|
||||
private static var rayHit:§_-jr§ = new §_-jr§();
|
||||
|
||||
private var range:Number;
|
||||
|
||||
private var var_641:Number;
|
||||
private var §_-n7§:Number;
|
||||
|
||||
private var var_639:Number;
|
||||
private var §_-er§:Number;
|
||||
|
||||
private var maxParticles:int;
|
||||
|
||||
private var particleSpeed:Number;
|
||||
|
||||
private var sfxData:name_262;
|
||||
private var sfxData:§_-Fj§;
|
||||
|
||||
private var var_637:Vector.<Particle> = new Vector.<Particle>();
|
||||
private var §_-lV§:Vector.<Particle> = new Vector.<Particle>();
|
||||
|
||||
private var var_638:int;
|
||||
private var §_-Jx§:int;
|
||||
|
||||
private var numFrames:int;
|
||||
|
||||
private var collisionDetector:name_256;
|
||||
private var collisionDetector:§_-fx§;
|
||||
|
||||
private var dead:Boolean;
|
||||
|
||||
private var var_640:int;
|
||||
private var §_-ny§:int;
|
||||
|
||||
private var var_642:int;
|
||||
private var §_-jJ§:int;
|
||||
|
||||
private var collisionGroup:int = name_257.WEAPON | name_257.STATIC;
|
||||
private var collisionGroup:int = §_-HM§.WEAPON | §_-HM§.STATIC;
|
||||
|
||||
private var origin:name_194 = new name_194();
|
||||
private var origin:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var direction:name_194 = new name_194();
|
||||
private var direction:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var sideAxis:name_194 = new name_194();
|
||||
private var sideAxis:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var var_636:Number;
|
||||
private var §_-6z§:Number;
|
||||
|
||||
private var renderSystem:RenderSystem;
|
||||
private var renderSystem:§_-1I§;
|
||||
|
||||
private var turret:class_15;
|
||||
private var turret:§_-3e§;
|
||||
|
||||
private var chassis:name_236;
|
||||
private var chassis:§_-Is§;
|
||||
|
||||
private var flame:name_717;
|
||||
private var flame:§_-7Z§;
|
||||
|
||||
private var position:Vector3D = new Vector3D();
|
||||
|
||||
private var dir:Vector3D = new Vector3D();
|
||||
|
||||
public function name_544(objectPool:ObjectPool)
|
||||
public function §_-q4§(objectPool:§_-Va§)
|
||||
{
|
||||
super(objectPool);
|
||||
}
|
||||
|
||||
public function addedToRenderSystem(system:RenderSystem) : void
|
||||
public function addedToRenderSystem(system:§_-1I§) : void
|
||||
{
|
||||
this.renderSystem = system;
|
||||
this.turret.getGunData(BARREL_INDEX,this.origin,this.direction,this.sideAxis);
|
||||
this.var_636 = this.turret.getBarrelLength(BARREL_INDEX);
|
||||
this.position.x = this.origin.x + this.direction.x * this.var_636;
|
||||
this.position.y = this.origin.y + this.direction.y * this.var_636;
|
||||
this.position.z = this.origin.z + this.direction.z * this.var_636;
|
||||
this.§_-6z§ = this.turret.getBarrelLength(BARREL_INDEX);
|
||||
this.position.x = this.origin.x + this.direction.x * this.§_-6z§;
|
||||
this.position.y = this.origin.y + this.direction.y * this.§_-6z§;
|
||||
this.position.z = this.origin.z + this.direction.z * this.§_-6z§;
|
||||
this.flame.position = this.position;
|
||||
this.dir.x = this.direction.x;
|
||||
this.dir.y = this.direction.y;
|
||||
this.dir.z = this.direction.z;
|
||||
this.flame.direction = this.dir;
|
||||
this.renderSystem.method_48(this.flame);
|
||||
this.renderSystem.§_-9p§(this.flame);
|
||||
}
|
||||
|
||||
public function init(turret:class_15, flamethrowerSmokeAtlas:name_250, flamethrowerFlashAtlas:name_250, flamethrowerFireAtlas:name_250) : void
|
||||
public function init(turret:§_-3e§, flamethrowerSmokeAtlas:§_-S8§, flamethrowerFlashAtlas:§_-S8§, flamethrowerFireAtlas:§_-S8§) : void
|
||||
{
|
||||
this.turret = turret;
|
||||
this.flame = new name_717(flamethrowerSmokeAtlas,flamethrowerFireAtlas,flamethrowerFlashAtlas,15);
|
||||
this.flame = new §_-7Z§(flamethrowerSmokeAtlas,flamethrowerFireAtlas,flamethrowerFlashAtlas,15);
|
||||
this.flame.scale = 5 * 1.4;
|
||||
this.flame.name = "firebird";
|
||||
}
|
||||
|
||||
public function play(camera:GameCamera) : Boolean
|
||||
public function play(camera:§_-RE§) : Boolean
|
||||
{
|
||||
if(this.flame == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.turret.getGunData(BARREL_INDEX,this.origin,this.direction,this.sideAxis);
|
||||
this.var_636 = this.turret.getBarrelLength(BARREL_INDEX);
|
||||
this.position.x = this.origin.x + this.direction.x * this.var_636;
|
||||
this.position.y = this.origin.y + this.direction.y * this.var_636;
|
||||
this.position.z = this.origin.z + this.direction.z * this.var_636;
|
||||
this.§_-6z§ = this.turret.getBarrelLength(BARREL_INDEX);
|
||||
this.position.x = this.origin.x + this.direction.x * this.§_-6z§;
|
||||
this.position.y = this.origin.y + this.direction.y * this.§_-6z§;
|
||||
this.position.z = this.origin.z + this.direction.z * this.§_-6z§;
|
||||
this.flame.position = this.position;
|
||||
this.dir.x = this.direction.x;
|
||||
this.dir.y = this.direction.y;
|
||||
@@ -142,39 +142,39 @@ package package_81
|
||||
{
|
||||
}
|
||||
|
||||
public function method_255() : void
|
||||
public function §_-Bz§() : void
|
||||
{
|
||||
this.flame.stop();
|
||||
this.flame = null;
|
||||
}
|
||||
|
||||
private function method_756() : void
|
||||
private function §_-XT§() : void
|
||||
{
|
||||
var offset:Number = Math.random() * 50;
|
||||
if(!this.collisionDetector.name_324(this.origin,this.direction,name_257.STATIC,this.var_636 + offset,null,rayHit))
|
||||
if(!this.collisionDetector.§_-cX§(this.origin,this.direction,§_-HM§.STATIC,this.§_-6z§ + offset,null,rayHit))
|
||||
{
|
||||
sourcePosition.x = this.origin.x + this.direction.x * this.var_636;
|
||||
sourcePosition.y = this.origin.y + this.direction.y * this.var_636;
|
||||
sourcePosition.z = this.origin.z + this.direction.z * this.var_636;
|
||||
sourcePosition.x = this.origin.x + this.direction.x * this.§_-6z§;
|
||||
sourcePosition.y = this.origin.y + this.direction.y * this.§_-6z§;
|
||||
sourcePosition.z = this.origin.z + this.direction.z * this.§_-6z§;
|
||||
particleDirection.copy(this.direction);
|
||||
xAxis.copy(this.sideAxis);
|
||||
this.method_755(sourcePosition,particleDirection,xAxis,offset);
|
||||
this.§_-0X§(sourcePosition,particleDirection,xAxis,offset);
|
||||
}
|
||||
}
|
||||
|
||||
private function method_755(sourcePosition:name_194, direction:name_194, sideAxis:name_194, offset:Number) : void
|
||||
private function §_-0X§(sourcePosition:§_-bj§, direction:§_-bj§, sideAxis:§_-bj§, offset:Number) : void
|
||||
{
|
||||
var particle:Particle = Particle.getParticle();
|
||||
particle.currFrame = Math.random() * this.numFrames;
|
||||
var angle:Number = 2 * Math.PI * Math.random();
|
||||
matrix.method_344(direction,angle);
|
||||
matrix.§_-OB§(direction,angle);
|
||||
sideAxis.transform3(matrix);
|
||||
var d:Number = this.range * this.var_639 * Math.random();
|
||||
var d:Number = this.range * this.§_-er§ * Math.random();
|
||||
direction.x = direction.x * this.range + sideAxis.x * d;
|
||||
direction.y = direction.y * this.range + sideAxis.y * d;
|
||||
direction.z = direction.z * this.range + sideAxis.z * d;
|
||||
direction.normalize();
|
||||
var bodyVelocity:name_194 = this.chassis.getBody().state.velocity;
|
||||
var bodyVelocity:§_-bj§ = this.chassis.getBody().state.velocity;
|
||||
particle.velocity.x = this.particleSpeed * direction.x + bodyVelocity.x;
|
||||
particle.velocity.y = this.particleSpeed * direction.y + bodyVelocity.y;
|
||||
particle.velocity.z = this.particleSpeed * direction.z + bodyVelocity.z;
|
||||
@@ -182,27 +182,27 @@ package package_81
|
||||
particle.x = sourcePosition.x + offset * direction.x;
|
||||
particle.y = sourcePosition.y + offset * direction.y;
|
||||
particle.z = sourcePosition.z + offset * direction.z;
|
||||
var _loc9_:* = this.var_638++;
|
||||
this.var_637[_loc9_] = particle;
|
||||
var _loc9_:* = this.§_-Jx§++;
|
||||
this.§_-lV§[_loc9_] = particle;
|
||||
}
|
||||
|
||||
private function method_757(index:int) : void
|
||||
private function §_-90§(index:int) : void
|
||||
{
|
||||
var particle:Particle = this.var_637[index];
|
||||
this.var_637[index] = this.var_637[--this.var_638];
|
||||
this.var_637[this.var_638] = null;
|
||||
var particle:Particle = this.§_-lV§[index];
|
||||
this.§_-lV§[index] = this.§_-lV§[--this.§_-Jx§];
|
||||
this.§_-lV§[this.§_-Jx§] = null;
|
||||
particle.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import §_-8D§.§_-OX§;
|
||||
import §_-Ex§.§_-hW§;
|
||||
import §_-nl§.§_-bj§;
|
||||
import flash.geom.ColorTransform;
|
||||
import package_19.name_494;
|
||||
import package_21.name_78;
|
||||
import package_46.name_194;
|
||||
import package_72.name_242;
|
||||
import §function§.§_-ok§;
|
||||
|
||||
class Particle extends name_494
|
||||
class Particle extends §_-hW§
|
||||
{
|
||||
private static var INITIAL_POOL_SIZE:int = 20;
|
||||
|
||||
@@ -210,7 +210,7 @@ class Particle extends name_494
|
||||
|
||||
private static var poolIndex:int = -1;
|
||||
|
||||
public var velocity:name_194 = new name_194();
|
||||
public var velocity:§_-bj§ = new §_-bj§();
|
||||
|
||||
public var distance:Number = 0;
|
||||
|
||||
@@ -240,10 +240,10 @@ class Particle extends name_494
|
||||
pool[_loc1_] = this;
|
||||
}
|
||||
|
||||
public function updateColorTransofrm(maxDistance:Number, points:Vector.<name_242>) : void
|
||||
public function updateColorTransofrm(maxDistance:Number, points:Vector.<§_-ok§>) : void
|
||||
{
|
||||
var point1:name_242 = null;
|
||||
var point2:name_242 = null;
|
||||
var point1:§_-ok§ = null;
|
||||
var point2:§_-ok§ = null;
|
||||
var i:int = 0;
|
||||
if(points == null)
|
||||
{
|
||||
@@ -1,12 +1,13 @@
|
||||
package package_123
|
||||
package §_-9j§
|
||||
{
|
||||
import §_-1z§.§_-gA§;
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import package_28.name_119;
|
||||
import alternativa.engine3d.loaders.collada.collada;
|
||||
|
||||
use namespace collada;
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class name_768 extends class_43
|
||||
public class §_-S6§ extends §_-6e§
|
||||
{
|
||||
internal static const NORMALS:int = 1;
|
||||
|
||||
@@ -14,33 +15,33 @@ package package_123
|
||||
|
||||
internal static const TEXCOORDS:Vector.<uint> = Vector.<uint>([8,16,32,64,128,256,512,1024]);
|
||||
|
||||
internal var var_740:name_784;
|
||||
internal var §_-2g§:§_-0M§;
|
||||
|
||||
internal var var_741:Vector.<name_784>;
|
||||
internal var §_-aL§:Vector.<§_-0M§>;
|
||||
|
||||
internal var var_743:name_784;
|
||||
internal var §_-Fl§:§_-0M§;
|
||||
|
||||
internal var var_742:Vector.<name_784>;
|
||||
internal var §_-jU§:Vector.<§_-0M§>;
|
||||
|
||||
internal var var_744:Vector.<name_784>;
|
||||
internal var §_-ly§:Vector.<§_-0M§>;
|
||||
|
||||
internal var indices:Vector.<uint>;
|
||||
|
||||
internal var var_729:int;
|
||||
internal var §_-5O§:int;
|
||||
|
||||
public var indexBegin:int;
|
||||
|
||||
public var numTriangles:int;
|
||||
|
||||
public function name_768(data:XML, document:name_707)
|
||||
public function §_-S6§(data:XML, document:§_-fr§)
|
||||
{
|
||||
super(data,document);
|
||||
}
|
||||
|
||||
override protected function parseImplementation() : Boolean
|
||||
{
|
||||
this.method_909();
|
||||
this.method_938();
|
||||
this.§_-7Q§();
|
||||
this.§_-WT§();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -49,19 +50,19 @@ package package_123
|
||||
return data.localName() as String;
|
||||
}
|
||||
|
||||
private function method_909() : void
|
||||
private function §_-7Q§() : void
|
||||
{
|
||||
var input:name_784 = null;
|
||||
var input:§_-0M§ = null;
|
||||
var semantic:String = null;
|
||||
var offset:int = 0;
|
||||
this.var_741 = new Vector.<name_784>();
|
||||
this.var_744 = new Vector.<name_784>();
|
||||
this.var_742 = new Vector.<name_784>();
|
||||
this.§_-aL§ = new Vector.<§_-0M§>();
|
||||
this.§_-ly§ = new Vector.<§_-0M§>();
|
||||
this.§_-jU§ = new Vector.<§_-0M§>();
|
||||
var inputsList:XMLList = data.input;
|
||||
var maxInputOffset:int = 0;
|
||||
for(var i:int = 0,var count:int = int(inputsList.length()); i < count; offset = input.offset,maxInputOffset = offset > maxInputOffset ? offset : maxInputOffset,i++)
|
||||
for(var i:int = 0,var count:int = int(inputsList.length()); i < count; offset = int(input.offset),maxInputOffset = offset > maxInputOffset ? offset : maxInputOffset,i++)
|
||||
{
|
||||
input = new name_784(inputsList[i],document);
|
||||
input = new §_-0M§(inputsList[i],document);
|
||||
semantic = input.semantic;
|
||||
if(semantic == null)
|
||||
{
|
||||
@@ -70,32 +71,32 @@ package package_123
|
||||
switch(semantic)
|
||||
{
|
||||
case "VERTEX":
|
||||
if(this.var_740 == null)
|
||||
if(this.§_-2g§ == null)
|
||||
{
|
||||
this.var_740 = input;
|
||||
this.§_-2g§ = input;
|
||||
}
|
||||
break;
|
||||
case "TEXCOORD":
|
||||
this.var_741.push(input);
|
||||
this.§_-aL§.push(input);
|
||||
break;
|
||||
case "NORMAL":
|
||||
if(this.var_743 == null)
|
||||
if(this.§_-Fl§ == null)
|
||||
{
|
||||
this.var_743 = input;
|
||||
this.§_-Fl§ = input;
|
||||
}
|
||||
break;
|
||||
case "TEXTANGENT":
|
||||
this.var_744.push(input);
|
||||
this.§_-ly§.push(input);
|
||||
break;
|
||||
case "TEXBINORMAL":
|
||||
this.var_742.push(input);
|
||||
this.§_-jU§.push(input);
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.var_729 = maxInputOffset + 1;
|
||||
this.§_-5O§ = maxInputOffset + 1;
|
||||
}
|
||||
|
||||
private function method_938() : void
|
||||
private function §_-WT§() : void
|
||||
{
|
||||
var array:Array = null;
|
||||
var vcountXML:XMLList = null;
|
||||
@@ -110,7 +111,7 @@ package package_123
|
||||
case "polylist":
|
||||
case "polygons":
|
||||
vcountXML = data.vcount;
|
||||
array = name_565(vcountXML[0]);
|
||||
array = §_-TM§(vcountXML[0]);
|
||||
i = 0;
|
||||
count = int(array.length);
|
||||
while(true)
|
||||
@@ -126,21 +127,21 @@ package package_123
|
||||
pList = data.p;
|
||||
for(i = 0,count = int(pList.length()); i < count; )
|
||||
{
|
||||
array = name_565(pList[i]);
|
||||
array = §_-TM§(pList[i]);
|
||||
for(j = 0; j < array.length; j++)
|
||||
{
|
||||
this.indices.push(parseInt(array[j],10));
|
||||
}
|
||||
if(vcount.length > 0)
|
||||
{
|
||||
this.indices = this.method_936(this.indices,vcount);
|
||||
this.indices = this.§_-aZ§(this.indices,vcount);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function method_936(input:Vector.<uint>, vcount:Vector.<int>) : Vector.<uint>
|
||||
private function §_-aZ§(input:Vector.<uint>, vcount:Vector.<int>) : Vector.<uint>
|
||||
{
|
||||
var indexIn:uint = 0;
|
||||
var i:int = 0;
|
||||
@@ -154,7 +155,7 @@ package package_123
|
||||
for(i = 0,count = int(vcount.length); i < count; i++)
|
||||
{
|
||||
verticesCount = vcount[i];
|
||||
attributesCount = verticesCount * this.var_729;
|
||||
attributesCount = verticesCount * this.§_-5O§;
|
||||
if(verticesCount == 3)
|
||||
{
|
||||
j = 0;
|
||||
@@ -170,124 +171,124 @@ package package_123
|
||||
{
|
||||
for(j = 1; j < verticesCount - 1; )
|
||||
{
|
||||
for(k = 0; k < this.var_729; k++,indexOut++)
|
||||
for(k = 0; k < this.§_-5O§; k++,indexOut++)
|
||||
{
|
||||
res[indexOut] = input[int(indexIn + k)];
|
||||
}
|
||||
for(k = 0; k < this.var_729; k++,indexOut++)
|
||||
for(k = 0; k < this.§_-5O§; k++,indexOut++)
|
||||
{
|
||||
res[indexOut] = input[int(indexIn + this.var_729 * j + k)];
|
||||
res[indexOut] = input[int(indexIn + this.§_-5O§ * j + k)];
|
||||
}
|
||||
for(k = 0; k < this.var_729; k++,indexOut++)
|
||||
for(k = 0; k < this.§_-5O§; k++,indexOut++)
|
||||
{
|
||||
res[indexOut] = input[int(indexIn + this.var_729 * (j + 1) + k)];
|
||||
res[indexOut] = input[int(indexIn + this.§_-5O§ * (j + 1) + k)];
|
||||
}
|
||||
j++;
|
||||
}
|
||||
indexIn += this.var_729 * verticesCount;
|
||||
indexIn += this.§_-5O§ * verticesCount;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public function name_773(geometry:name_119, vertices:Vector.<name_770>) : uint
|
||||
public function §_-eT§(geometry:§_-gA§, vertices:Vector.<§_-V0§>) : uint
|
||||
{
|
||||
var tangentSource:name_740 = null;
|
||||
var binormalSource:name_740 = null;
|
||||
var normalSource:name_740 = null;
|
||||
var tangentSource:§_-KP§ = null;
|
||||
var binormalSource:§_-KP§ = null;
|
||||
var normalSource:§_-KP§ = null;
|
||||
var index:uint = 0;
|
||||
var vertex:name_770 = null;
|
||||
var s:name_740 = null;
|
||||
var vertex:§_-V0§ = null;
|
||||
var s:§_-KP§ = null;
|
||||
var j:int = 0;
|
||||
if(this.var_740 == null)
|
||||
if(this.§_-2g§ == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
this.var_740.method_314();
|
||||
this.§_-2g§.§_-Om§();
|
||||
var numIndices:int = int(this.indices.length);
|
||||
var daeVertices:name_744 = document.findVertices(this.var_740.source);
|
||||
var daeVertices:§_-l§ = document.findVertices(this.§_-2g§.source);
|
||||
if(daeVertices == null)
|
||||
{
|
||||
document.logger.logNotFoundError(this.var_740.source);
|
||||
document.logger.logNotFoundError(this.§_-2g§.source);
|
||||
return 0;
|
||||
}
|
||||
daeVertices.method_314();
|
||||
var positionSource:name_740 = daeVertices.name_771;
|
||||
daeVertices.§_-Om§();
|
||||
var positionSource:§_-KP§ = daeVertices.§_-E6§;
|
||||
var vertexStride:int = 3;
|
||||
var mainSource:name_740 = positionSource;
|
||||
var mainInput:name_784 = this.var_740;
|
||||
var mainSource:§_-KP§ = positionSource;
|
||||
var mainInput:§_-0M§ = this.§_-2g§;
|
||||
var channels:uint = 0;
|
||||
var inputOffsets:Vector.<int> = new Vector.<int>();
|
||||
inputOffsets.push(this.var_740.offset);
|
||||
if(this.var_743 != null)
|
||||
inputOffsets.push(this.§_-2g§.offset);
|
||||
if(this.§_-Fl§ != null)
|
||||
{
|
||||
normalSource = this.var_743.prepareSource(3);
|
||||
inputOffsets.push(this.var_743.offset);
|
||||
normalSource = this.§_-Fl§.prepareSource(3);
|
||||
inputOffsets.push(this.§_-Fl§.offset);
|
||||
vertexStride += 3;
|
||||
channels |= NORMALS;
|
||||
if(this.var_744.length > 0 && this.var_742.length > 0)
|
||||
if(this.§_-ly§.length > 0 && this.§_-jU§.length > 0)
|
||||
{
|
||||
tangentSource = this.var_744[0].prepareSource(3);
|
||||
inputOffsets.push(this.var_744[0].offset);
|
||||
binormalSource = this.var_742[0].prepareSource(3);
|
||||
inputOffsets.push(this.var_742[0].offset);
|
||||
tangentSource = this.§_-ly§[0].prepareSource(3);
|
||||
inputOffsets.push(this.§_-ly§[0].offset);
|
||||
binormalSource = this.§_-jU§[0].prepareSource(3);
|
||||
inputOffsets.push(this.§_-jU§[0].offset);
|
||||
vertexStride += 4;
|
||||
channels |= TANGENT4;
|
||||
}
|
||||
}
|
||||
var textureSources:Vector.<name_740> = new Vector.<name_740>();
|
||||
var numTexCoordsInputs:int = int(this.var_741.length);
|
||||
var textureSources:Vector.<§_-KP§> = new Vector.<§_-KP§>();
|
||||
var numTexCoordsInputs:int = int(this.§_-aL§.length);
|
||||
if(numTexCoordsInputs > 8)
|
||||
{
|
||||
numTexCoordsInputs = 8;
|
||||
}
|
||||
for(var i:int = 0; i < numTexCoordsInputs; )
|
||||
{
|
||||
s = this.var_741[i].prepareSource(2);
|
||||
s = this.§_-aL§[i].prepareSource(2);
|
||||
textureSources.push(s);
|
||||
inputOffsets.push(this.var_741[i].offset);
|
||||
inputOffsets.push(this.§_-aL§[i].offset);
|
||||
vertexStride += 2;
|
||||
channels |= TEXCOORDS[i];
|
||||
i++;
|
||||
}
|
||||
var verticesLength:int = int(vertices.length);
|
||||
this.indexBegin = geometry.alternativa3d::_indices.length;
|
||||
for(i = 0; i < numIndices; i += this.var_729)
|
||||
for(i = 0; i < numIndices; i += this.§_-5O§)
|
||||
{
|
||||
index = this.indices[int(i + mainInput.offset)];
|
||||
vertex = vertices[index];
|
||||
if(vertex == null || !this.method_939(vertex,this.indices,i,inputOffsets))
|
||||
if(vertex == null || !this.§_-le§(vertex,this.indices,i,inputOffsets))
|
||||
{
|
||||
if(vertex != null)
|
||||
{
|
||||
index = uint(verticesLength++);
|
||||
}
|
||||
vertex = new name_770();
|
||||
vertex = new §_-V0§();
|
||||
vertices[index] = vertex;
|
||||
vertex.name_785 = this.indices[int(i + this.var_740.offset)];
|
||||
vertex.method_933(positionSource.numbers,vertex.name_785,positionSource.stride,document.unitScaleFactor);
|
||||
vertex.§_-Eq§ = this.indices[int(i + this.§_-2g§.offset)];
|
||||
vertex.§_-0l§(positionSource.numbers,vertex.§_-Eq§,positionSource.stride,document.unitScaleFactor);
|
||||
if(normalSource != null)
|
||||
{
|
||||
vertex.method_935(normalSource.numbers,this.indices[int(i + this.var_743.offset)],normalSource.stride);
|
||||
vertex.§_-1L§(normalSource.numbers,this.indices[int(i + this.§_-Fl§.offset)],normalSource.stride);
|
||||
}
|
||||
if(tangentSource != null)
|
||||
{
|
||||
vertex.method_932(tangentSource.numbers,this.indices[int(i + this.var_744[0].offset)],tangentSource.stride,binormalSource.numbers,this.indices[int(i + this.var_742[0].offset)],binormalSource.stride);
|
||||
vertex.§_-eQ§(tangentSource.numbers,this.indices[int(i + this.§_-ly§[0].offset)],tangentSource.stride,binormalSource.numbers,this.indices[int(i + this.§_-jU§[0].offset)],binormalSource.stride);
|
||||
}
|
||||
for(j = 0; j < textureSources.length; )
|
||||
{
|
||||
vertex.method_934(textureSources[j].numbers,this.indices[int(i + this.var_741[j].offset)],textureSources[j].stride);
|
||||
vertex.§_-SX§(textureSources[j].numbers,this.indices[int(i + this.§_-aL§[j].offset)],textureSources[j].stride);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
vertex.name_786 = index;
|
||||
vertex.§_-AR§ = index;
|
||||
geometry.alternativa3d::_indices.push(index);
|
||||
}
|
||||
this.numTriangles = (geometry.alternativa3d::_indices.length - this.indexBegin) / 3;
|
||||
return channels;
|
||||
}
|
||||
|
||||
private function method_939(vertex:name_770, indices:Vector.<uint>, index:int, offsets:Vector.<int>) : Boolean
|
||||
private function §_-le§(vertex:§_-V0§, indices:Vector.<uint>, index:int, offsets:Vector.<int>) : Boolean
|
||||
{
|
||||
var numOffsets:int = int(offsets.length);
|
||||
for(var j:int = 0; j < numOffsets; )
|
||||
@@ -301,9 +302,9 @@ package package_123
|
||||
return true;
|
||||
}
|
||||
|
||||
private function method_937(inputs:Vector.<name_784>, setNum:int) : name_784
|
||||
private function §_-0z§(inputs:Vector.<§_-0M§>, setNum:int) : §_-0M§
|
||||
{
|
||||
var input:name_784 = null;
|
||||
var input:§_-0M§ = null;
|
||||
for(var i:int = 0,var numInputs:int = int(inputs.length); i < numInputs; )
|
||||
{
|
||||
input = inputs[i];
|
||||
@@ -316,18 +317,18 @@ package package_123
|
||||
return null;
|
||||
}
|
||||
|
||||
private function method_940(mainSetNum:int) : Vector.<VertexChannelData>
|
||||
private function §_-Rs§(mainSetNum:int) : Vector.<VertexChannelData>
|
||||
{
|
||||
var i:int = 0;
|
||||
var texCoordsInput:name_784 = null;
|
||||
var texCoordsSource:name_740 = null;
|
||||
var texCoordsInput:§_-0M§ = null;
|
||||
var texCoordsSource:§_-KP§ = null;
|
||||
var data:VertexChannelData = null;
|
||||
var mainInput:name_784 = this.method_937(this.var_741,mainSetNum);
|
||||
var numInputs:int = int(this.var_741.length);
|
||||
var mainInput:§_-0M§ = this.§_-0z§(this.§_-aL§,mainSetNum);
|
||||
var numInputs:int = int(this.§_-aL§.length);
|
||||
var datas:Vector.<VertexChannelData> = new Vector.<VertexChannelData>();
|
||||
for(i = 0; i < numInputs; )
|
||||
{
|
||||
texCoordsInput = this.var_741[i];
|
||||
texCoordsInput = this.§_-aL§[i];
|
||||
texCoordsSource = texCoordsInput.prepareSource(2);
|
||||
if(texCoordsSource != null)
|
||||
{
|
||||
@@ -346,17 +347,17 @@ package package_123
|
||||
return datas.length > 0 ? datas : null;
|
||||
}
|
||||
|
||||
public function name_772(otherVertices:name_744) : Boolean
|
||||
public function §_-nY§(otherVertices:§_-l§) : Boolean
|
||||
{
|
||||
var vertices:name_744 = document.findVertices(this.var_740.source);
|
||||
var vertices:§_-l§ = document.findVertices(this.§_-2g§.source);
|
||||
if(vertices == null)
|
||||
{
|
||||
document.logger.logNotFoundError(this.var_740.source);
|
||||
document.logger.logNotFoundError(this.§_-2g§.source);
|
||||
}
|
||||
return vertices == otherVertices;
|
||||
}
|
||||
|
||||
public function get name_774() : String
|
||||
public function get §_-Ig§() : String
|
||||
{
|
||||
var attr:XML = data.@material[0];
|
||||
return attr == null ? null : attr.toString();
|
||||
@@ -1,60 +1,60 @@
|
||||
package package_125
|
||||
package §_-9n§
|
||||
{
|
||||
import §_-OZ§.§_-SK§;
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import package_124.name_749;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class name_709
|
||||
public class §_-Np§
|
||||
{
|
||||
public var object:String;
|
||||
|
||||
alternativa3d var var_693:Number = 0;
|
||||
alternativa3d var §_-YC§:Number = 0;
|
||||
|
||||
public function name_709()
|
||||
public function §_-Np§()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get length() : Number
|
||||
{
|
||||
return this.alternativa3d::var_693;
|
||||
return this.alternativa3d::_-YC;
|
||||
}
|
||||
|
||||
alternativa3d function get keyFramesList() : name_748
|
||||
alternativa3d function get keyFramesList() : §_-NS§
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
alternativa3d function set keyFramesList(value:name_748) : void
|
||||
alternativa3d function set keyFramesList(value:§_-NS§) : void
|
||||
{
|
||||
}
|
||||
|
||||
alternativa3d function method_849(key:name_748) : void
|
||||
alternativa3d function §_-K1§(key:§_-NS§) : void
|
||||
{
|
||||
var k:name_748 = null;
|
||||
var time:Number = Number(key.alternativa3d::var_420);
|
||||
var k:§_-NS§ = null;
|
||||
var time:Number = Number(key.alternativa3d::_-qC);
|
||||
if(this.alternativa3d::keyFramesList == null)
|
||||
{
|
||||
this.alternativa3d::keyFramesList = key;
|
||||
this.alternativa3d::var_693 = time <= 0 ? 0 : time;
|
||||
this.alternativa3d::_-YC = time <= 0 ? 0 : time;
|
||||
return;
|
||||
}
|
||||
if(this.alternativa3d::keyFramesList.alternativa3d::var_420 > time)
|
||||
if(this.alternativa3d::keyFramesList.alternativa3d::_-qC > time)
|
||||
{
|
||||
key.alternativa3d::nextKeyFrame = this.alternativa3d::keyFramesList;
|
||||
this.alternativa3d::keyFramesList = key;
|
||||
return;
|
||||
}
|
||||
k = this.alternativa3d::keyFramesList;
|
||||
while(k.alternativa3d::nextKeyFrame != null && k.alternativa3d::nextKeyFrame.alternativa3d::var_420 <= time)
|
||||
while(k.alternativa3d::nextKeyFrame != null && k.alternativa3d::nextKeyFrame.alternativa3d::_-qC <= time)
|
||||
{
|
||||
k = k.alternativa3d::nextKeyFrame;
|
||||
}
|
||||
if(k.alternativa3d::nextKeyFrame == null)
|
||||
{
|
||||
k.alternativa3d::nextKeyFrame = key;
|
||||
this.alternativa3d::var_693 = time <= 0 ? 0 : time;
|
||||
this.alternativa3d::_-YC = time <= 0 ? 0 : time;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -63,9 +63,9 @@ package package_125
|
||||
}
|
||||
}
|
||||
|
||||
public function method_850(key:name_748) : name_748
|
||||
public function §_-dg§(key:§_-NS§) : §_-NS§
|
||||
{
|
||||
var k:name_748 = null;
|
||||
var k:§_-NS§ = null;
|
||||
if(this.alternativa3d::keyFramesList != null)
|
||||
{
|
||||
if(this.alternativa3d::keyFramesList == key)
|
||||
@@ -73,7 +73,7 @@ package package_125
|
||||
this.alternativa3d::keyFramesList = this.alternativa3d::keyFramesList.alternativa3d::nextKeyFrame;
|
||||
if(this.alternativa3d::keyFramesList == null)
|
||||
{
|
||||
this.alternativa3d::var_693 = 0;
|
||||
this.alternativa3d::_-YC = 0;
|
||||
}
|
||||
return key;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ package package_125
|
||||
{
|
||||
if(key.alternativa3d::nextKeyFrame == null)
|
||||
{
|
||||
this.alternativa3d::var_693 = k.alternativa3d::var_420 <= 0 ? 0 : Number(k.alternativa3d::var_420);
|
||||
this.alternativa3d::_-YC = k.alternativa3d::_-qC <= 0 ? 0 : Number(k.alternativa3d::_-qC);
|
||||
}
|
||||
k.alternativa3d::nextKeyFrame = key.alternativa3d::nextKeyFrame;
|
||||
return key;
|
||||
@@ -95,11 +95,11 @@ package package_125
|
||||
throw new Error("Key not found");
|
||||
}
|
||||
|
||||
public function get keys() : Vector.<name_748>
|
||||
public function get keys() : Vector.<§_-NS§>
|
||||
{
|
||||
var result:Vector.<name_748> = new Vector.<name_748>();
|
||||
var result:Vector.<§_-NS§> = new Vector.<§_-NS§>();
|
||||
var i:int = 0;
|
||||
for(var key:name_748 = this.alternativa3d::keyFramesList; key != null; key = key.alternativa3d::nextKeyFrame)
|
||||
for(var key:§_-NS§ = this.alternativa3d::keyFramesList; key != null; key = key.alternativa3d::nextKeyFrame)
|
||||
{
|
||||
result[i] = key;
|
||||
i++;
|
||||
@@ -107,32 +107,32 @@ package package_125
|
||||
return result;
|
||||
}
|
||||
|
||||
alternativa3d function blend(time:Number, weight:Number, state:name_749) : void
|
||||
alternativa3d function blend(time:Number, weight:Number, state:§_-SK§) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function slice(start:Number, end:Number = 1.7976931348623157e+308) : name_709
|
||||
public function slice(start:Number, end:Number = 1.7976931348623157e+308) : §_-Np§
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
alternativa3d function createKeyFrame() : name_748
|
||||
alternativa3d function createKeyFrame() : §_-NS§
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
alternativa3d function interpolateKeyFrame(dest:name_748, a:name_748, b:name_748, value:Number) : void
|
||||
alternativa3d function interpolateKeyFrame(dest:§_-NS§, a:§_-NS§, b:§_-NS§, value:Number) : void
|
||||
{
|
||||
}
|
||||
|
||||
alternativa3d function method_851(dest:name_709, start:Number, end:Number) : void
|
||||
alternativa3d function §_-2Y§(dest:§_-Np§, start:Number, end:Number) : void
|
||||
{
|
||||
var prev:name_748 = null;
|
||||
var nextKey:name_748 = null;
|
||||
var prev:§_-NS§ = null;
|
||||
var nextKey:§_-NS§ = null;
|
||||
var shiftTime:Number = start > 0 ? start : 0;
|
||||
var next:name_748 = this.alternativa3d::keyFramesList;
|
||||
var key:name_748 = this.alternativa3d::createKeyFrame();
|
||||
while(next != null && next.alternativa3d::var_420 <= start)
|
||||
var next:§_-NS§ = this.alternativa3d::keyFramesList;
|
||||
var key:§_-NS§ = this.alternativa3d::createKeyFrame();
|
||||
while(next != null && next.alternativa3d::_-qC <= start)
|
||||
{
|
||||
prev = next;
|
||||
next = next.alternativa3d::nextKeyFrame;
|
||||
@@ -141,8 +141,8 @@ package package_125
|
||||
{
|
||||
if(next != null)
|
||||
{
|
||||
this.alternativa3d::interpolateKeyFrame(key,prev,next,(start - prev.alternativa3d::var_420) / (next.alternativa3d::var_420 - prev.alternativa3d::var_420));
|
||||
key.alternativa3d::var_420 = start - shiftTime;
|
||||
this.alternativa3d::interpolateKeyFrame(key,prev,next,(start - prev.alternativa3d::_-qC) / (next.alternativa3d::_-qC - prev.alternativa3d::_-qC));
|
||||
key.alternativa3d::_-qC = start - shiftTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -156,21 +156,21 @@ package package_125
|
||||
return;
|
||||
}
|
||||
this.alternativa3d::interpolateKeyFrame(key,key,next,1);
|
||||
key.alternativa3d::var_420 = next.alternativa3d::var_420 - shiftTime;
|
||||
key.alternativa3d::_-qC = next.alternativa3d::_-qC - shiftTime;
|
||||
prev = next;
|
||||
next = next.alternativa3d::nextKeyFrame;
|
||||
}
|
||||
dest.alternativa3d::keyFramesList = key;
|
||||
if(next == null || end <= start)
|
||||
{
|
||||
dest.alternativa3d::var_693 = key.alternativa3d::var_420 <= 0 ? 0 : Number(key.alternativa3d::var_420);
|
||||
dest.alternativa3d::_-YC = key.alternativa3d::_-qC <= 0 ? 0 : Number(key.alternativa3d::_-qC);
|
||||
return;
|
||||
}
|
||||
while(next != null && next.alternativa3d::var_420 <= end)
|
||||
while(next != null && next.alternativa3d::_-qC <= end)
|
||||
{
|
||||
nextKey = this.alternativa3d::createKeyFrame();
|
||||
this.alternativa3d::interpolateKeyFrame(nextKey,nextKey,next,1);
|
||||
nextKey.alternativa3d::var_420 = next.alternativa3d::var_420 - shiftTime;
|
||||
nextKey.alternativa3d::_-qC = next.alternativa3d::_-qC - shiftTime;
|
||||
key.alternativa3d::nextKeyFrame = nextKey;
|
||||
key = nextKey;
|
||||
prev = next;
|
||||
@@ -179,13 +179,13 @@ package package_125
|
||||
if(next != null)
|
||||
{
|
||||
nextKey = this.alternativa3d::createKeyFrame();
|
||||
this.alternativa3d::interpolateKeyFrame(nextKey,prev,next,(end - prev.alternativa3d::var_420) / (next.alternativa3d::var_420 - prev.alternativa3d::var_420));
|
||||
nextKey.alternativa3d::var_420 = end - shiftTime;
|
||||
this.alternativa3d::interpolateKeyFrame(nextKey,prev,next,(end - prev.alternativa3d::_-qC) / (next.alternativa3d::_-qC - prev.alternativa3d::_-qC));
|
||||
nextKey.alternativa3d::_-qC = end - shiftTime;
|
||||
key.alternativa3d::nextKeyFrame = nextKey;
|
||||
}
|
||||
if(nextKey != null)
|
||||
{
|
||||
dest.alternativa3d::var_693 = nextKey.alternativa3d::var_420 <= 0 ? 0 : Number(nextKey.alternativa3d::var_420);
|
||||
dest.alternativa3d::_-YC = nextKey.alternativa3d::_-qC <= 0 ? 0 : Number(nextKey.alternativa3d::_-qC);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,42 +1,42 @@
|
||||
package package_125
|
||||
package §_-9n§
|
||||
{
|
||||
import §_-OZ§.§_-SK§;
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import flash.geom.Matrix3D;
|
||||
import flash.geom.Orientation3D;
|
||||
import flash.geom.Vector3D;
|
||||
import package_124.name_749;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class name_759 extends name_709
|
||||
public class §_-ew§ extends §_-Np§
|
||||
{
|
||||
private static var tempQuat:Vector3D = new Vector3D();
|
||||
|
||||
private static var temp:name_787 = new name_787();
|
||||
private static var temp:§_-44§ = new §_-44§();
|
||||
|
||||
private var name_783:name_787;
|
||||
private var §_-ku§:§_-44§;
|
||||
|
||||
public function name_759(object:String)
|
||||
public function §_-ew§(object:String)
|
||||
{
|
||||
super();
|
||||
this.object = object;
|
||||
}
|
||||
|
||||
override alternativa3d function get keyFramesList() : name_748
|
||||
override alternativa3d function get keyFramesList() : §_-NS§
|
||||
{
|
||||
return this.name_783;
|
||||
return this.§_-ku§;
|
||||
}
|
||||
|
||||
override alternativa3d function set keyFramesList(value:name_748) : void
|
||||
override alternativa3d function set keyFramesList(value:§_-NS§) : void
|
||||
{
|
||||
this.name_783 = name_787(value);
|
||||
this.§_-ku§ = §_-44§(value);
|
||||
}
|
||||
|
||||
public function method_257(time:Number, matrix:Matrix3D) : name_787
|
||||
public function §_-Le§(time:Number, matrix:Matrix3D) : §_-44§
|
||||
{
|
||||
var key:name_787 = null;
|
||||
key = new name_787();
|
||||
key.alternativa3d::var_420 = time;
|
||||
var key:§_-44§ = null;
|
||||
key = new §_-44§();
|
||||
key.alternativa3d::_-qC = time;
|
||||
var components:Vector.<Vector3D> = matrix.decompose(Orientation3D.QUATERNION);
|
||||
key.alternativa3d::x = components[0].x;
|
||||
key.alternativa3d::y = components[0].y;
|
||||
@@ -45,26 +45,26 @@ package package_125
|
||||
key.alternativa3d::scaleX = components[2].x;
|
||||
key.alternativa3d::scaleY = components[2].y;
|
||||
key.alternativa3d::scaleZ = components[2].z;
|
||||
alternativa3d::method_849(key);
|
||||
alternativa3d::_-K1(key);
|
||||
return key;
|
||||
}
|
||||
|
||||
public function method_929(time:Number, x:Number = 0, y:Number = 0, z:Number = 0, rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0, scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1) : name_787
|
||||
public function §_-mr§(time:Number, x:Number = 0, y:Number = 0, z:Number = 0, rotationX:Number = 0, rotationY:Number = 0, rotationZ:Number = 0, scaleX:Number = 1, scaleY:Number = 1, scaleZ:Number = 1) : §_-44§
|
||||
{
|
||||
var key:name_787 = new name_787();
|
||||
key.alternativa3d::var_420 = time;
|
||||
var key:§_-44§ = new §_-44§();
|
||||
key.alternativa3d::_-qC = time;
|
||||
key.alternativa3d::x = x;
|
||||
key.alternativa3d::y = y;
|
||||
key.alternativa3d::z = z;
|
||||
key.alternativa3d::rotation = this.method_928(rotationX,rotationY,rotationZ);
|
||||
key.alternativa3d::rotation = this.§_-JN§(rotationX,rotationY,rotationZ);
|
||||
key.alternativa3d::scaleX = scaleX;
|
||||
key.alternativa3d::scaleY = scaleY;
|
||||
key.alternativa3d::scaleZ = scaleZ;
|
||||
alternativa3d::method_849(key);
|
||||
alternativa3d::_-K1(key);
|
||||
return key;
|
||||
}
|
||||
|
||||
private function method_926(quat:Vector3D, additive:Vector3D) : void
|
||||
private function §_-Qn§(quat:Vector3D, additive:Vector3D) : void
|
||||
{
|
||||
var ww:Number = additive.w * quat.w - additive.x * quat.x - additive.y * quat.y - additive.z * quat.z;
|
||||
var xx:Number = additive.w * quat.x + additive.x * quat.w + additive.y * quat.z - additive.z * quat.y;
|
||||
@@ -76,7 +76,7 @@ package package_125
|
||||
quat.z = zz;
|
||||
}
|
||||
|
||||
private function method_927(quat:Vector3D) : void
|
||||
private function §_-OW§(quat:Vector3D) : void
|
||||
{
|
||||
var d:Number = quat.w * quat.w + quat.x * quat.x + quat.y * quat.y + quat.z * quat.z;
|
||||
if(d == 0)
|
||||
@@ -93,7 +93,7 @@ package package_125
|
||||
}
|
||||
}
|
||||
|
||||
private function method_925(quat:Vector3D, x:Number, y:Number, z:Number, angle:Number) : void
|
||||
private function §_-3K§(quat:Vector3D, x:Number, y:Number, z:Number, angle:Number) : void
|
||||
{
|
||||
quat.w = Math.cos(0.5 * angle);
|
||||
var k:Number = Math.sin(0.5 * angle) / Math.sqrt(x * x + y * y + z * z);
|
||||
@@ -102,24 +102,24 @@ package package_125
|
||||
quat.z = z * k;
|
||||
}
|
||||
|
||||
private function method_928(x:Number, y:Number, z:Number) : Vector3D
|
||||
private function §_-JN§(x:Number, y:Number, z:Number) : Vector3D
|
||||
{
|
||||
var result:Vector3D = new Vector3D();
|
||||
this.method_925(result,1,0,0,x);
|
||||
this.method_925(tempQuat,0,1,0,y);
|
||||
this.method_926(result,tempQuat);
|
||||
this.method_927(result);
|
||||
this.method_925(tempQuat,0,0,1,z);
|
||||
this.method_926(result,tempQuat);
|
||||
this.method_927(result);
|
||||
this.§_-3K§(result,1,0,0,x);
|
||||
this.§_-3K§(tempQuat,0,1,0,y);
|
||||
this.§_-Qn§(result,tempQuat);
|
||||
this.§_-OW§(result);
|
||||
this.§_-3K§(tempQuat,0,0,1,z);
|
||||
this.§_-Qn§(result,tempQuat);
|
||||
this.§_-OW§(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
override alternativa3d function blend(time:Number, weight:Number, state:name_749) : void
|
||||
override alternativa3d function blend(time:Number, weight:Number, state:§_-SK§) : void
|
||||
{
|
||||
var prev:name_787 = null;
|
||||
var next:name_787 = this.name_783;
|
||||
while(next != null && next.alternativa3d::var_420 < time)
|
||||
var prev:§_-44§ = null;
|
||||
var next:§_-44§ = this.§_-ku§;
|
||||
while(next != null && next.alternativa3d::_-qC < time)
|
||||
{
|
||||
prev = next;
|
||||
next = next.alternativa3d::next;
|
||||
@@ -128,34 +128,34 @@ package package_125
|
||||
{
|
||||
if(next != null)
|
||||
{
|
||||
temp.interpolate(prev,next,(time - prev.alternativa3d::var_420) / (next.alternativa3d::var_420 - prev.alternativa3d::var_420));
|
||||
state.method_920(temp,weight);
|
||||
temp.interpolate(prev,next,(time - prev.alternativa3d::_-qC) / (next.alternativa3d::_-qC - prev.alternativa3d::_-qC));
|
||||
state.§_-nV§(temp,weight);
|
||||
}
|
||||
else
|
||||
{
|
||||
state.method_920(prev,weight);
|
||||
state.§_-nV§(prev,weight);
|
||||
}
|
||||
}
|
||||
else if(next != null)
|
||||
{
|
||||
state.method_920(next,weight);
|
||||
state.§_-nV§(next,weight);
|
||||
}
|
||||
}
|
||||
|
||||
override alternativa3d function createKeyFrame() : name_748
|
||||
override alternativa3d function createKeyFrame() : §_-NS§
|
||||
{
|
||||
return new name_787();
|
||||
return new §_-44§();
|
||||
}
|
||||
|
||||
override alternativa3d function interpolateKeyFrame(dest:name_748, a:name_748, b:name_748, value:Number) : void
|
||||
override alternativa3d function interpolateKeyFrame(dest:§_-NS§, a:§_-NS§, b:§_-NS§, value:Number) : void
|
||||
{
|
||||
name_787(dest).interpolate(name_787(a),name_787(b),value);
|
||||
§_-44§(dest).interpolate(§_-44§(a),§_-44§(b),value);
|
||||
}
|
||||
|
||||
override public function slice(start:Number, end:Number = 1.7976931348623157e+308) : name_709
|
||||
override public function slice(start:Number, end:Number = 1.7976931348623157e+308) : §_-Np§
|
||||
{
|
||||
var track:name_759 = new name_759(object);
|
||||
alternativa3d::method_851(track,start,end);
|
||||
var track:§_-ew§ = new §_-ew§(object);
|
||||
alternativa3d::_-2Y(track,start,end);
|
||||
return track;
|
||||
}
|
||||
}
|
||||
91
src/?_-9n?/?_-kB?.as
Normal file
@@ -0,0 +1,91 @@
|
||||
package §_-9n§
|
||||
{
|
||||
import §_-OZ§.§_-SK§;
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class §_-kB§ extends §_-Np§
|
||||
{
|
||||
private static var temp:§_-j3§ = new §_-j3§();
|
||||
|
||||
alternativa3d var §_-ku§:§_-j3§;
|
||||
|
||||
public var property:String;
|
||||
|
||||
public function §_-kB§(object:String, property:String)
|
||||
{
|
||||
super();
|
||||
this.property = property;
|
||||
this.object = object;
|
||||
}
|
||||
|
||||
override alternativa3d function get keyFramesList() : §_-NS§
|
||||
{
|
||||
return this.alternativa3d::_-ku;
|
||||
}
|
||||
|
||||
override alternativa3d function set keyFramesList(value:§_-NS§) : void
|
||||
{
|
||||
this.alternativa3d::_-ku = §_-j3§(value);
|
||||
}
|
||||
|
||||
public function §_-Le§(time:Number, value:Number = 0) : §_-NS§
|
||||
{
|
||||
var key:§_-j3§ = new §_-j3§();
|
||||
key.alternativa3d::_-qC = time;
|
||||
key.value = value;
|
||||
alternativa3d::_-K1(key);
|
||||
return key;
|
||||
}
|
||||
|
||||
override alternativa3d function blend(time:Number, weight:Number, state:§_-SK§) : void
|
||||
{
|
||||
var prev:§_-j3§ = null;
|
||||
if(this.property == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var next:§_-j3§ = this.alternativa3d::_-ku;
|
||||
while(next != null && next.alternativa3d::_-qC < time)
|
||||
{
|
||||
prev = next;
|
||||
next = next.alternativa3d::next;
|
||||
}
|
||||
if(prev != null)
|
||||
{
|
||||
if(next != null)
|
||||
{
|
||||
temp.interpolate(prev,next,(time - prev.alternativa3d::_-qC) / (next.alternativa3d::_-qC - prev.alternativa3d::_-qC));
|
||||
state.§_-B§(this.property,temp.alternativa3d::_-4O,weight);
|
||||
}
|
||||
else
|
||||
{
|
||||
state.§_-B§(this.property,prev.alternativa3d::_-4O,weight);
|
||||
}
|
||||
}
|
||||
else if(next != null)
|
||||
{
|
||||
state.§_-B§(this.property,next.alternativa3d::_-4O,weight);
|
||||
}
|
||||
}
|
||||
|
||||
override alternativa3d function createKeyFrame() : §_-NS§
|
||||
{
|
||||
return new §_-j3§();
|
||||
}
|
||||
|
||||
override alternativa3d function interpolateKeyFrame(dest:§_-NS§, a:§_-NS§, b:§_-NS§, value:Number) : void
|
||||
{
|
||||
§_-j3§(dest).interpolate(§_-j3§(a),§_-j3§(b),value);
|
||||
}
|
||||
|
||||
override public function slice(start:Number, end:Number = 1.7976931348623157e+308) : §_-Np§
|
||||
{
|
||||
var track:§_-kB§ = new §_-kB§(object,this.property);
|
||||
alternativa3d::_-2Y(track,start,end);
|
||||
return track;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
353
src/?_-Fc?/?_-8a?.as
Normal file
@@ -0,0 +1,353 @@
|
||||
package §_-Fc§
|
||||
{
|
||||
import §_-1e§.§_-Nh§;
|
||||
import §_-KA§.§_-FW§;
|
||||
import §_-RQ§.§_-Q9§;
|
||||
import §_-US§.§_-DB§;
|
||||
import §_-az§.§_-ps§;
|
||||
import §_-bJ§.§_-eG§;
|
||||
import §_-fT§.§_-ZI§;
|
||||
import §_-fT§.§_-Zm§;
|
||||
import §_-lS§.§_-h2§;
|
||||
import §_-nl§.§_-bj§;
|
||||
import flash.utils.getTimer;
|
||||
import §in §.§_-eF§;
|
||||
|
||||
public class §_-8a§ extends §_-ps§
|
||||
{
|
||||
private static var USE_GRID_COLLISION_DETECTOR:Boolean = true;
|
||||
|
||||
public var interpolationCoeff:Number;
|
||||
|
||||
private var physicsStep:int = 33;
|
||||
|
||||
private var physicsScene:§_-DB§;
|
||||
|
||||
private var §_-hl§:Vector.<§catch§>;
|
||||
|
||||
private var §_-g7§:int;
|
||||
|
||||
private var §_-b5§:Vector.<§catch§>;
|
||||
|
||||
private var §_-f5§:int;
|
||||
|
||||
private var §_-ST§:Vector.<§catch§>;
|
||||
|
||||
private var §_-7y§:int;
|
||||
|
||||
private var §_-jp§:§_-eG§;
|
||||
|
||||
private var §_-FE§:int;
|
||||
|
||||
private var running:Boolean;
|
||||
|
||||
private var §_-pR§:§_-eF§;
|
||||
|
||||
private var objectPoolManager:§_-Q9§;
|
||||
|
||||
public function §_-8a§(priority:int, objectPoolManager:§_-Q9§)
|
||||
{
|
||||
super(priority);
|
||||
this.objectPoolManager = objectPoolManager;
|
||||
this.§_-hl§ = new Vector.<§catch§>();
|
||||
this.§_-b5§ = new Vector.<§catch§>();
|
||||
this.§_-ST§ = new Vector.<§catch§>();
|
||||
this.physicsScene = new §_-DB§();
|
||||
this.physicsScene.§_-06§ = true;
|
||||
this.physicsScene.§_-YB§ = 5;
|
||||
this.physicsScene.dynamic = 100;
|
||||
this.physicsScene.gravity = new §_-bj§(0,0,-1000);
|
||||
if(USE_GRID_COLLISION_DETECTOR)
|
||||
{
|
||||
this.§_-jp§ = new §_-eG§();
|
||||
this.physicsScene.collisionDetector = this.§_-jp§;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.physicsScene.collisionDetector = new §_-ZI§();
|
||||
}
|
||||
}
|
||||
|
||||
override protected function onPause() : void
|
||||
{
|
||||
this.§_-FE§ = getTimer();
|
||||
}
|
||||
|
||||
override protected function onResume() : void
|
||||
{
|
||||
this.§_-FE§ = getTimer() - this.§_-FE§;
|
||||
this.physicsScene.time += this.§_-FE§;
|
||||
}
|
||||
|
||||
public function §_-Zo§() : §_-eG§
|
||||
{
|
||||
return this.§_-jp§;
|
||||
}
|
||||
|
||||
public function §_-Xh§() : int
|
||||
{
|
||||
return this.physicsStep;
|
||||
}
|
||||
|
||||
public function §_-d-§() : §_-DB§
|
||||
{
|
||||
return this.physicsScene;
|
||||
}
|
||||
|
||||
public function §_-kO§(collisionPrimitives:Vector.<§_-Nh§>) : void
|
||||
{
|
||||
var gridCellSize:Number = NaN;
|
||||
var collisionDetector:§_-ZI§ = null;
|
||||
var bb:§_-FW§ = null;
|
||||
var size:Number = NaN;
|
||||
if(USE_GRID_COLLISION_DETECTOR)
|
||||
{
|
||||
gridCellSize = 800;
|
||||
this.§_-jp§.§_-hS§(gridCellSize,collisionPrimitives);
|
||||
}
|
||||
else
|
||||
{
|
||||
collisionDetector = §_-ZI§(this.physicsScene.collisionDetector);
|
||||
bb = new §_-FW§();
|
||||
size = 20000;
|
||||
bb.§_-k2§(-size,-size,-size,size,size,size);
|
||||
collisionDetector.§_-Vy§(collisionPrimitives,bb);
|
||||
}
|
||||
}
|
||||
|
||||
public function addControllerBefore(controller:§catch§) : void
|
||||
{
|
||||
var deferredActionAddBefore:DeferredActionAddBefore = null;
|
||||
if(this.running)
|
||||
{
|
||||
deferredActionAddBefore = DeferredActionAddBefore(this.objectPoolManager.§_-kP§(DeferredActionAddBefore));
|
||||
this.§_-5W§(deferredActionAddBefore,controller);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(this.§_-hl§.indexOf(controller) >= 0)
|
||||
{
|
||||
throw new Error("Controller " + controller + " already exists");
|
||||
}
|
||||
var _loc3_:* = this.§_-g7§++;
|
||||
this.§_-hl§[_loc3_] = controller;
|
||||
}
|
||||
}
|
||||
|
||||
public function addControllerAfter(controller:§catch§) : void
|
||||
{
|
||||
var deferredActionAddAfter:DeferredActionAddAfter = null;
|
||||
if(this.running)
|
||||
{
|
||||
deferredActionAddAfter = DeferredActionAddAfter(this.objectPoolManager.§_-kP§(DeferredActionAddAfter));
|
||||
this.§_-5W§(deferredActionAddAfter,controller);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(this.§_-b5§.indexOf(controller) >= 0)
|
||||
{
|
||||
throw new Error("Controller " + controller + " already exists");
|
||||
}
|
||||
var _loc3_:* = this.§_-f5§++;
|
||||
this.§_-b5§[_loc3_] = controller;
|
||||
}
|
||||
}
|
||||
|
||||
public function §_-Ve§(controller:§catch§) : void
|
||||
{
|
||||
if(this.§_-ST§.indexOf(controller) >= 0)
|
||||
{
|
||||
throw new Error("Controller " + controller + " already exists");
|
||||
}
|
||||
var _loc2_:* = this.§_-7y§++;
|
||||
this.§_-ST§[_loc2_] = controller;
|
||||
}
|
||||
|
||||
public function removeControllerBefore(controller:§catch§) : void
|
||||
{
|
||||
var deferredActionRemoveBefore:DeferredActionRemoveBefore = null;
|
||||
var index:int = 0;
|
||||
if(this.running)
|
||||
{
|
||||
deferredActionRemoveBefore = DeferredActionRemoveBefore(this.objectPoolManager.§_-kP§(DeferredActionRemoveBefore));
|
||||
this.§_-5W§(deferredActionRemoveBefore,controller);
|
||||
}
|
||||
else
|
||||
{
|
||||
index = int(this.§_-hl§.indexOf(controller));
|
||||
if(index < 0)
|
||||
{
|
||||
throw new Error("Controller " + controller + " not found");
|
||||
}
|
||||
this.§_-hl§[index] = this.§_-hl§[--this.§_-g7§];
|
||||
this.§_-hl§[this.§_-g7§] = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function removeControllerAfter(controller:§catch§) : void
|
||||
{
|
||||
var deferredActionRemoveAfter:DeferredActionRemoveAfter = null;
|
||||
var index:int = 0;
|
||||
if(this.running)
|
||||
{
|
||||
deferredActionRemoveAfter = DeferredActionRemoveAfter(this.objectPoolManager.§_-kP§(DeferredActionRemoveAfter));
|
||||
this.§_-5W§(deferredActionRemoveAfter,controller);
|
||||
}
|
||||
else
|
||||
{
|
||||
index = int(this.§_-b5§.indexOf(controller));
|
||||
if(index < 0)
|
||||
{
|
||||
throw new Error("Controller " + controller + " not found");
|
||||
}
|
||||
this.§_-b5§[index] = this.§_-b5§[--this.§_-f5§];
|
||||
this.§_-b5§[this.§_-f5§] = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function §_-Fs§(controller:§catch§) : void
|
||||
{
|
||||
var index:int = int(this.§_-ST§.indexOf(controller));
|
||||
if(index < 0)
|
||||
{
|
||||
throw new Error("Controller " + controller + " not found");
|
||||
}
|
||||
this.§_-ST§[index] = this.§_-ST§[--this.§_-7y§];
|
||||
this.§_-ST§[this.§_-7y§] = null;
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
this.physicsScene.time = §_-h2§.time;
|
||||
}
|
||||
|
||||
override public function run() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var controller:§catch§ = null;
|
||||
var action:§_-eF§ = null;
|
||||
var currentTime:int = int(§_-h2§.time);
|
||||
if(this.physicsScene.time < currentTime)
|
||||
{
|
||||
while(this.physicsScene.time < currentTime)
|
||||
{
|
||||
this.running = true;
|
||||
§_-Zm§(this.physicsScene.collisionDetector).§_-9F§();
|
||||
for(i = 0; i < this.§_-g7§; i++)
|
||||
{
|
||||
controller = this.§_-hl§[i];
|
||||
controller.updateBeforeSimulation(this.physicsStep);
|
||||
}
|
||||
this.physicsScene.update(this.physicsStep);
|
||||
§_-Zm§(this.physicsScene.collisionDetector).§_-9F§();
|
||||
for(i = 0; i < this.§_-f5§; i++)
|
||||
{
|
||||
controller = this.§_-b5§[i];
|
||||
controller.updateAfterSimulation(this.physicsStep);
|
||||
}
|
||||
for(this.running = false; this.§_-pR§ != null; )
|
||||
{
|
||||
action = this.§_-pR§;
|
||||
this.§_-pR§ = this.§_-pR§.next;
|
||||
action.next = null;
|
||||
action.execute();
|
||||
action.§_-DQ§();
|
||||
}
|
||||
}
|
||||
}
|
||||
this.interpolationCoeff = 1 - (this.physicsScene.time - currentTime) / this.physicsStep;
|
||||
for(i = 0; i < this.§_-7y§; i++)
|
||||
{
|
||||
controller = this.§_-ST§[i];
|
||||
controller.interpolate(this.interpolationCoeff);
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-5W§(deferredAction:DeferredAction, controller:§catch§) : void
|
||||
{
|
||||
deferredAction.system = this;
|
||||
deferredAction.controller = controller;
|
||||
deferredAction.next = this.§_-pR§;
|
||||
this.§_-pR§ = deferredAction;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import §_-RQ§.§_-HE§;
|
||||
import §_-RQ§.§_-Va§;
|
||||
import §in §.§_-eF§;
|
||||
|
||||
class DeferredAction extends §_-eF§
|
||||
{
|
||||
public var system:§_-8a§;
|
||||
|
||||
public var controller:§catch§;
|
||||
|
||||
public function DeferredAction(objectPool:§_-Va§)
|
||||
{
|
||||
super(objectPool);
|
||||
}
|
||||
|
||||
override public function execute() : void
|
||||
{
|
||||
this.doExecute();
|
||||
this.system = null;
|
||||
this.controller = null;
|
||||
}
|
||||
|
||||
protected function doExecute() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
class DeferredActionAddBefore extends DeferredAction
|
||||
{
|
||||
public function DeferredActionAddBefore(objectPool:§_-Va§)
|
||||
{
|
||||
super(objectPool);
|
||||
}
|
||||
|
||||
override protected function doExecute() : void
|
||||
{
|
||||
system.addControllerBefore(controller);
|
||||
}
|
||||
}
|
||||
|
||||
class DeferredActionAddAfter extends DeferredAction
|
||||
{
|
||||
public function DeferredActionAddAfter(objectPool:§_-Va§)
|
||||
{
|
||||
super(objectPool);
|
||||
}
|
||||
|
||||
override protected function doExecute() : void
|
||||
{
|
||||
system.addControllerAfter(controller);
|
||||
}
|
||||
}
|
||||
|
||||
class DeferredActionRemoveBefore extends DeferredAction
|
||||
{
|
||||
public function DeferredActionRemoveBefore(objectPool:§_-Va§)
|
||||
{
|
||||
super(objectPool);
|
||||
}
|
||||
|
||||
override protected function doExecute() : void
|
||||
{
|
||||
system.removeControllerBefore(controller);
|
||||
}
|
||||
}
|
||||
|
||||
class DeferredActionRemoveAfter extends DeferredAction
|
||||
{
|
||||
public function DeferredActionRemoveAfter(objectPool:§_-Va§)
|
||||
{
|
||||
super(objectPool);
|
||||
}
|
||||
|
||||
override protected function doExecute() : void
|
||||
{
|
||||
system.removeControllerAfter(controller);
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,33 @@
|
||||
package alternativa.osgi.service.console
|
||||
package §_-GD§
|
||||
{
|
||||
import package_39.name_160;
|
||||
import package_39.name_450;
|
||||
import §_-MU§.§_-5-§;
|
||||
import §_-MU§.§_-XQ§;
|
||||
|
||||
public class ClientLogConnector implements name_450
|
||||
public class §_-X8§ implements §_-XQ§
|
||||
{
|
||||
private static const ALL_CHANNELS:String = "all";
|
||||
|
||||
private var clientLog:name_160;
|
||||
private var clientLog:§_-5-§;
|
||||
|
||||
private var console:IConsole;
|
||||
private var console:§_-6A§;
|
||||
|
||||
public function ClientLogConnector(clientLog:name_160, console:IConsole)
|
||||
public function §_-X8§(clientLog:§_-5-§, console:§_-6A§)
|
||||
{
|
||||
super();
|
||||
this.clientLog = clientLog;
|
||||
this.console = console;
|
||||
}
|
||||
|
||||
public function method_622(channelName:String, logText:String) : void
|
||||
public function §_-qU§(channelName:String, logText:String) : void
|
||||
{
|
||||
this.console.method_143(channelName + " ",logText);
|
||||
this.console.§_-H-§(channelName + " ",logText);
|
||||
}
|
||||
|
||||
public function name_371(console:IConsole, args:Array) : void
|
||||
public function §_-9Q§(console:§_-6A§, args:Array) : void
|
||||
{
|
||||
if(args.length < 1)
|
||||
{
|
||||
console.name_145("Usage: log action [arguments]");
|
||||
console.§_-MR§("Usage: log action [arguments]");
|
||||
return;
|
||||
}
|
||||
var action:String = args.shift();
|
||||
@@ -35,34 +35,34 @@ package alternativa.osgi.service.console
|
||||
{
|
||||
case "c":
|
||||
case "connect":
|
||||
this.connectChannels(args);
|
||||
this.§_-1g§(args);
|
||||
break;
|
||||
case "d":
|
||||
case "disconnect":
|
||||
this.disconnectChannels(args);
|
||||
this.§_-W4§(args);
|
||||
break;
|
||||
case "show":
|
||||
if(args.length == 0)
|
||||
{
|
||||
console.name_145("Usage: log show channel_name [filter_string]");
|
||||
console.§_-MR§("Usage: log show channel_name [filter_string]");
|
||||
break;
|
||||
}
|
||||
this.printFilteredLines(console,args[0],args[1]);
|
||||
this.§_-95§(console,args[0],args[1]);
|
||||
break;
|
||||
case "ls":
|
||||
case "list":
|
||||
console.name_145("Existing channels:");
|
||||
console.method_145(this.clientLog.getChannelNames());
|
||||
console.§_-MR§("Existing channels:");
|
||||
console.§_-3c§(this.clientLog.getChannelNames());
|
||||
}
|
||||
}
|
||||
|
||||
private function printFilteredLines(console:IConsole, channelName:String, filterString:String) : void
|
||||
private function §_-95§(console:§_-6A§, channelName:String, filterString:String) : void
|
||||
{
|
||||
var filteredStrings:Vector.<String> = null;
|
||||
var channelStrings:Vector.<String> = this.clientLog.getChannelStrings(channelName);
|
||||
if(channelStrings == null)
|
||||
{
|
||||
console.name_145("Channel not found");
|
||||
console.§_-MR§("Channel not found");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -78,22 +78,22 @@ package alternativa.osgi.service.console
|
||||
{
|
||||
filteredStrings = channelStrings;
|
||||
}
|
||||
console.method_142(channelName + " ",filteredStrings);
|
||||
console.§_-dU§(channelName + " ",filteredStrings);
|
||||
}
|
||||
}
|
||||
|
||||
private function connectChannels(channels:Array) : void
|
||||
private function §_-1g§(channels:Array) : void
|
||||
{
|
||||
var channelName:String = null;
|
||||
if(channels.length == 0)
|
||||
{
|
||||
this.console.name_145("Usage: log connect channel_name1 [channel_name2 ...]");
|
||||
this.console.§_-MR§("Usage: log connect channel_name1 [channel_name2 ...]");
|
||||
return;
|
||||
}
|
||||
if(channels[0] == ALL_CHANNELS)
|
||||
{
|
||||
this.clientLog.addLogListener(this);
|
||||
this.console.name_145("All log channels have been connected");
|
||||
this.console.§_-MR§("All log channels have been connected");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -102,24 +102,24 @@ package alternativa.osgi.service.console
|
||||
if(channelName != ALL_CHANNELS)
|
||||
{
|
||||
this.clientLog.addLogChannelListener(channelName,this);
|
||||
this.console.name_145("Log channel " + channelName + " has been connected");
|
||||
this.console.§_-MR§("Log channel " + channelName + " has been connected");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function disconnectChannels(channels:Array) : void
|
||||
private function §_-W4§(channels:Array) : void
|
||||
{
|
||||
var channelName:String = null;
|
||||
if(channels.length == 0)
|
||||
{
|
||||
this.console.name_145("Usage: log disconnect channel_name1 [channel_name2 ...]");
|
||||
this.console.§_-MR§("Usage: log disconnect channel_name1 [channel_name2 ...]");
|
||||
return;
|
||||
}
|
||||
if(channels[0] == ALL_CHANNELS)
|
||||
{
|
||||
this.clientLog.removeLogListener(this);
|
||||
this.console.name_145("All log channels have been disconnected");
|
||||
this.console.§_-MR§("All log channels have been disconnected");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -128,7 +128,7 @@ package alternativa.osgi.service.console
|
||||
if(channelName != ALL_CHANNELS)
|
||||
{
|
||||
this.clientLog.removeLogChannelListener(channelName,this);
|
||||
this.console.name_145("Log channel " + channelName + " has been disconnected");
|
||||
this.console.§_-MR§("Log channel " + channelName + " has been disconnected");
|
||||
}
|
||||
}
|
||||
}
|
||||
443
src/?_-I0?/?_-bt?.as
Normal file
@@ -0,0 +1,443 @@
|
||||
package §_-I0§
|
||||
{
|
||||
import §_-1e§.§_-fx§;
|
||||
import §_-8D§.§_-OX§;
|
||||
import §_-Ex§.§_-U2§;
|
||||
import §_-KA§.§_-jr§;
|
||||
import §_-KT§.§_-Ju§;
|
||||
import §_-KT§.§_-UT§;
|
||||
import §_-OR§.§_-om§;
|
||||
import §_-V-§.§_-aY§;
|
||||
import §_-aM§.§_-Lm§;
|
||||
import §_-az§.§_-gw§;
|
||||
import §_-e6§.§_-RE§;
|
||||
import §_-e6§.§_-gb§;
|
||||
import §_-lS§.§_-h2§;
|
||||
import §_-nl§.Matrix3;
|
||||
import §_-nl§.Matrix4;
|
||||
import §_-nl§.§_-bj§;
|
||||
import flash.ui.Keyboard;
|
||||
import flash.utils.getTimer;
|
||||
|
||||
public class §_-bt§ extends §_-Ww§ implements §_-gb§
|
||||
{
|
||||
private static var parentMatrix:Matrix4 = new Matrix4();
|
||||
|
||||
private static var matrix:Matrix4 = new Matrix4();
|
||||
|
||||
private static var maxPositionError:Number = 10;
|
||||
|
||||
private static var maxAngleError:Number = Math.PI / 180;
|
||||
|
||||
private static var camSpeedThreshold:Number = 10;
|
||||
|
||||
private static var fixedPitch:§_-Ju§ = new §_-Ju§("cam_fixedpitch",10 * Math.PI / 180,-1,1);
|
||||
|
||||
private static var noPitchCorrection:§_-UT§ = new §_-UT§("cam_nopitchcorrection",1,0,1);
|
||||
|
||||
private static var pitchCorrectionCoeff:§_-Ju§ = new §_-Ju§("cam_pitchcorrectioncoeff",1,0,10);
|
||||
|
||||
private static var reboundDelay:§_-UT§ = new §_-UT§("cam_rebound",1000,0,2000);
|
||||
|
||||
private static var elevationAngles:Vector.<Number> = new Vector.<Number>(1,true);
|
||||
|
||||
private static var rotationMatrix:Matrix3 = new Matrix3();
|
||||
|
||||
private static var axis:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var rayDirection:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static const MIN_CAMERA_ANGLE:Number = 5 * Math.PI / 180;
|
||||
|
||||
private static const KEY_CAMERA_UP:uint = Keyboard.PAGE_UP;
|
||||
|
||||
private static const KEY_CAMERA_DOWN:uint = Keyboard.PAGE_DOWN;
|
||||
|
||||
private static const HEIGHT_CHANGE_STEP:Number = 50;
|
||||
|
||||
private static const MIN_HEIGHT:Number = 150;
|
||||
|
||||
private static const MAX_HEIGHT:Number = 3100;
|
||||
|
||||
private static const MIN_DISTANCE:Number = 300;
|
||||
|
||||
private static const COLLISION_OFFSET:Number = 100;
|
||||
|
||||
private static const targetOffset:§_-bj§ = new §_-bj§(0,0,50);
|
||||
|
||||
private static var currentPosition:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var currentRotation:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var rayOrigin:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var flatDirection:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var positionDelta:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var rayHit:§_-jr§ = new §_-jr§();
|
||||
|
||||
private var collisionDetector:§_-fx§;
|
||||
|
||||
private var collisionMask:int;
|
||||
|
||||
private var §_-U1§:Number = 0;
|
||||
|
||||
private var §_-7h§:Number = 0;
|
||||
|
||||
private var locked:Boolean;
|
||||
|
||||
private var position:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var rotation:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var targetPosition:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var targetDirection:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var §_-Wq§:Number = 0;
|
||||
|
||||
private var §_-fq§:Number = 0;
|
||||
|
||||
private var §_-qF§:Number = 0;
|
||||
|
||||
private var §_-51§:Number = 10000000;
|
||||
|
||||
private var §_-kz§:int;
|
||||
|
||||
private var cameraPositionData:CameraPositionData = new CameraPositionData();
|
||||
|
||||
private var §_-4G§:Number;
|
||||
|
||||
private var input:§_-Lm§;
|
||||
|
||||
private var §_-fZ§:§_-U2§;
|
||||
|
||||
private var §_-LT§:Number = 0;
|
||||
|
||||
private var §_-mg§:Number = 0;
|
||||
|
||||
private var §_-R2§:Number = 1000;
|
||||
|
||||
private var §_-Rb§:Number = 0;
|
||||
|
||||
private var §_-NW§:Number = 0;
|
||||
|
||||
private var §_-1J§:Number = 1000;
|
||||
|
||||
public var smoothing:Number = 40;
|
||||
|
||||
private var angles:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var §_-n9§:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var rotationMatrix:Matrix4 = new Matrix4();
|
||||
|
||||
private var §_-Ys§:Matrix4 = new Matrix4();
|
||||
|
||||
private var §_-b4§:§_-bj§ = new §_-bj§();
|
||||
|
||||
public function §_-bt§(camera:§_-RE§, collisionDetector:§_-fx§, collisionMask:int, input:§_-Lm§)
|
||||
{
|
||||
super();
|
||||
this.camera = camera;
|
||||
if(collisionDetector == null)
|
||||
{
|
||||
throw new ArgumentError("Parameter collisionDetector cannot be null");
|
||||
}
|
||||
this.collisionDetector = collisionDetector;
|
||||
this.collisionMask = collisionMask;
|
||||
this.input = input;
|
||||
this.§_-Tq§ = 600;
|
||||
}
|
||||
|
||||
public function §_-eA§() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function §_-O-§(target:§_-gw§) : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
this.§_-fZ§ = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.§_-fZ§ = §_-om§(target.getComponentStrict(§_-om§)).§_-dW§;
|
||||
}
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
if(this.§_-fZ§ == null)
|
||||
{
|
||||
throw new Error("Target is not set");
|
||||
}
|
||||
if(camera == null)
|
||||
{
|
||||
throw new Error("Camera is not set");
|
||||
}
|
||||
var dt:Number = Number(§_-h2§.timeDeltaSeconds);
|
||||
if(dt > 0.1)
|
||||
{
|
||||
dt = 0.1;
|
||||
}
|
||||
this.§_-1E§();
|
||||
matrix.§_-eP§(targetOffset,this.§_-n9§);
|
||||
var distanceChangeDir:int = this.input.§_-OO§(KEY_CAMERA_UP) - this.input.§_-OO§(KEY_CAMERA_DOWN) - this.input.§_-i9§();
|
||||
if(distanceChangeDir != 0)
|
||||
{
|
||||
this.§_-1J§ *= Math.pow(10,distanceChangeDir * 0.02);
|
||||
}
|
||||
if(this.input.§_-an§())
|
||||
{
|
||||
this.§_-Rb§ -= this.input.§_-ac§() * 0.01;
|
||||
this.§_-NW§ -= this.input.§_-ow§() * 0.01;
|
||||
}
|
||||
var k:Number = 1;
|
||||
if(this.smoothing > 0)
|
||||
{
|
||||
k = 100 / this.smoothing * dt;
|
||||
k = k > 1 ? 1 : k;
|
||||
this.§_-LT§ += (this.§_-Rb§ - this.§_-LT§) * k;
|
||||
this.§_-mg§ += (this.§_-NW§ - this.§_-mg§) * k;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.§_-LT§ = this.§_-Rb§;
|
||||
this.§_-mg§ = this.§_-NW§;
|
||||
}
|
||||
this.rotationMatrix.§_-Wl§(this.§_-LT§,0,this.§_-mg§);
|
||||
this.rotationMatrix.§_-oa§(matrix.d,matrix.h,matrix.l);
|
||||
matrix.getAxis(3,rayOrigin);
|
||||
this.rotationMatrix.§_-Uz§(§_-bj§.Y_AXIS,rayDirection);
|
||||
rayDirection.reverse();
|
||||
var distance:Number = this.§_-1J§;
|
||||
if(this.collisionDetector.raycast(rayOrigin,rayDirection,this.collisionMask,distance,null,rayHit))
|
||||
{
|
||||
distance = rayHit.t - COLLISION_OFFSET;
|
||||
}
|
||||
if(distanceChangeDir != 0)
|
||||
{
|
||||
this.§_-1J§ = distance;
|
||||
}
|
||||
if(this.smoothing > 0)
|
||||
{
|
||||
this.§_-R2§ += (distance - this.§_-R2§) * k;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.§_-R2§ = distance;
|
||||
}
|
||||
this.position.x = 0;
|
||||
this.position.y = -this.§_-R2§;
|
||||
this.position.z = 0;
|
||||
this.rotationMatrix.§_-eP§(this.position,currentPosition);
|
||||
camera.x = currentPosition.x;
|
||||
camera.y = currentPosition.y;
|
||||
camera.z = currentPosition.z;
|
||||
var dx:Number = this.§_-n9§.x - camera.x;
|
||||
var dy:Number = this.§_-n9§.y - camera.y;
|
||||
var dz:Number = this.§_-n9§.z - camera.z;
|
||||
camera.rotationX = Math.atan2(dz,Math.sqrt(dx * dx + dy * dy)) - 0.5 * Math.PI;
|
||||
camera.rotationY = 0;
|
||||
camera.rotationZ = -Math.atan2(dx,dy);
|
||||
}
|
||||
|
||||
private function set §_-Tq§(value:Number) : void
|
||||
{
|
||||
this.§_-U1§ = §_-aY§.clamp(value,MIN_HEIGHT,MAX_HEIGHT);
|
||||
var d:Number = this.§_-pq§(this.§_-U1§);
|
||||
this.§_-4G§ = Math.atan2(this.§_-U1§,d);
|
||||
this.§_-7h§ = Math.sqrt(this.§_-U1§ * this.§_-U1§ + d * d);
|
||||
this.§_-kz§ = 0;
|
||||
}
|
||||
|
||||
private function §_-TS§(targetPosition:§_-bj§, targetDirection:§_-bj§, useReboundDelay:Boolean, dt:Number, result:CameraPositionData) : void
|
||||
{
|
||||
var angle:Number = NaN;
|
||||
var now:int = 0;
|
||||
var delta:Number = NaN;
|
||||
var actualElevation:Number = this.§_-4G§;
|
||||
var xyLength:Number = Number(Math.sqrt(targetDirection.x * targetDirection.x + targetDirection.y * targetDirection.y));
|
||||
if(xyLength < 0.00001)
|
||||
{
|
||||
flatDirection.x = 1;
|
||||
flatDirection.y = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
flatDirection.x = targetDirection.x / xyLength;
|
||||
flatDirection.y = targetDirection.y / xyLength;
|
||||
}
|
||||
result.extraPitch = 0;
|
||||
result.t = 1;
|
||||
var minCollisionDistance:Number = this.§_-7h§;
|
||||
rayOrigin.copy(targetPosition);
|
||||
elevationAngles[0] = actualElevation;
|
||||
axis.x = flatDirection.y;
|
||||
axis.y = -flatDirection.x;
|
||||
flatDirection.reverse();
|
||||
for each(angle in elevationAngles)
|
||||
{
|
||||
this.rotationMatrix.§_-OB§(axis,-angle);
|
||||
this.rotationMatrix.§_-Uz§(flatDirection,rayDirection);
|
||||
minCollisionDistance = this.§_-LI§(rayOrigin,rayDirection,this.§_-7h§,minCollisionDistance);
|
||||
}
|
||||
if(useReboundDelay)
|
||||
{
|
||||
now = int(getTimer());
|
||||
if(minCollisionDistance <= this.§_-51§ + 0.001)
|
||||
{
|
||||
this.§_-51§ = minCollisionDistance;
|
||||
this.§_-kz§ = now;
|
||||
}
|
||||
else if(now - this.§_-kz§ < reboundDelay.value)
|
||||
{
|
||||
minCollisionDistance = this.§_-51§;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.§_-51§ = minCollisionDistance;
|
||||
}
|
||||
}
|
||||
if(minCollisionDistance < this.§_-7h§)
|
||||
{
|
||||
result.t = minCollisionDistance / this.§_-7h§;
|
||||
if(minCollisionDistance < MIN_DISTANCE)
|
||||
{
|
||||
rayOrigin.§_-LQ§(minCollisionDistance,rayDirection);
|
||||
delta = MIN_DISTANCE - minCollisionDistance;
|
||||
if(this.collisionDetector.raycast(rayOrigin,§_-bj§.Z_AXIS,this.collisionMask,delta,null,rayHit))
|
||||
{
|
||||
delta = rayHit.t - 10;
|
||||
if(delta < 0)
|
||||
{
|
||||
delta = 0;
|
||||
}
|
||||
}
|
||||
result.position.copy(rayOrigin).§_-LQ§(delta,§_-bj§.Z_AXIS);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.position.copy(rayOrigin).§_-LQ§(minCollisionDistance,rayDirection);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result.position.copy(rayOrigin).§_-LQ§(this.§_-7h§,rayDirection);
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-LI§(rayOrigin:§_-bj§, rayDirection:§_-bj§, rayLength:Number, minCollisionDistance:Number) : Number
|
||||
{
|
||||
var distance:Number = NaN;
|
||||
if(this.collisionDetector.raycast(rayOrigin,rayDirection,this.collisionMask,rayLength,null,rayHit))
|
||||
{
|
||||
distance = Number(rayHit.t);
|
||||
if(distance < COLLISION_OFFSET)
|
||||
{
|
||||
distance = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
distance -= COLLISION_OFFSET;
|
||||
}
|
||||
if(distance < minCollisionDistance)
|
||||
{
|
||||
return distance;
|
||||
}
|
||||
}
|
||||
return minCollisionDistance;
|
||||
}
|
||||
|
||||
private function §_-1E§() : void
|
||||
{
|
||||
this.§_-U6§(this.§_-fZ§.parent,parentMatrix);
|
||||
this.§_-U6§(this.§_-fZ§,matrix);
|
||||
matrix.append(parentMatrix);
|
||||
matrix.getAxis(3,this.targetPosition);
|
||||
this.targetDirection.reset(matrix.b,matrix.f,matrix.j);
|
||||
}
|
||||
|
||||
private function §_-U6§(object:§_-OX§, matrix:Matrix4) : void
|
||||
{
|
||||
matrix.§_-Wl§(object.rotationX,object.rotationY,object.rotationZ);
|
||||
matrix.§_-oa§(object.x,object.y,object.z);
|
||||
}
|
||||
|
||||
private function §_-K4§() : void
|
||||
{
|
||||
var heightChangeDir:int = this.input.§_-OO§(KEY_CAMERA_UP) - this.input.§_-OO§(KEY_CAMERA_DOWN);
|
||||
if(heightChangeDir != 0)
|
||||
{
|
||||
this.§_-Tq§ = this.§_-U1§ + heightChangeDir * HEIGHT_CHANGE_STEP;
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-pq§(h:Number) : Number
|
||||
{
|
||||
var v:Number = 200 - 1750;
|
||||
var k:Number = (1300 - 600) / (v * v);
|
||||
return -k * (h - 1750) * (h - 1750) + 1300;
|
||||
}
|
||||
|
||||
private function §_-Tu§(positionError:Number) : Number
|
||||
{
|
||||
return 3 * positionError;
|
||||
}
|
||||
|
||||
private function §_-NP§(angleError:Number, currentSpeed:Number) : Number
|
||||
{
|
||||
if(angleError < -maxAngleError)
|
||||
{
|
||||
return 3 * (angleError + maxAngleError);
|
||||
}
|
||||
if(angleError > maxAngleError)
|
||||
{
|
||||
return 3 * (angleError - maxAngleError);
|
||||
}
|
||||
return currentSpeed;
|
||||
}
|
||||
|
||||
private function §each §(value:Number, snapValue:Number, epsilon:Number) : Number
|
||||
{
|
||||
if(value > snapValue - epsilon && value < snapValue + epsilon)
|
||||
{
|
||||
return snapValue;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
private function §_-Xv§(cameraPositionData:CameraPositionData) : Number
|
||||
{
|
||||
var angle:Number = this.§_-4G§ - fixedPitch.value;
|
||||
if(angle < 0)
|
||||
{
|
||||
angle = 0;
|
||||
}
|
||||
var t:Number = cameraPositionData.t;
|
||||
if(t >= 1 || angle < MIN_CAMERA_ANGLE || noPitchCorrection.value == 1)
|
||||
{
|
||||
return cameraPositionData.extraPitch - angle;
|
||||
}
|
||||
return cameraPositionData.extraPitch - Math.atan2(t * this.§_-U1§,pitchCorrectionCoeff.value * this.§_-U1§ * (1 / Math.tan(angle) - (1 - t) / Math.tan(this.§_-4G§)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import §_-nl§.§_-bj§;
|
||||
|
||||
class CameraPositionData
|
||||
{
|
||||
public var t:Number;
|
||||
|
||||
public var extraPitch:Number;
|
||||
|
||||
public var position:§_-bj§ = new §_-bj§();
|
||||
|
||||
public function CameraPositionData()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
473
src/?_-I0?/?_-hB?.as
Normal file
@@ -0,0 +1,473 @@
|
||||
package §_-I0§
|
||||
{
|
||||
import §_-1e§.§_-fx§;
|
||||
import §_-8D§.§_-OX§;
|
||||
import §_-Ex§.§_-U2§;
|
||||
import §_-KA§.§_-jr§;
|
||||
import §_-KT§.§_-Ju§;
|
||||
import §_-KT§.§_-UT§;
|
||||
import §_-OR§.§_-om§;
|
||||
import §_-V-§.§_-aY§;
|
||||
import §_-aM§.§_-Lm§;
|
||||
import §_-az§.§_-gw§;
|
||||
import §_-e6§.§_-RE§;
|
||||
import §_-e6§.§_-gb§;
|
||||
import §_-lS§.§_-h2§;
|
||||
import §_-nl§.Matrix3;
|
||||
import §_-nl§.Matrix4;
|
||||
import §_-nl§.§_-bj§;
|
||||
import flash.ui.Keyboard;
|
||||
import flash.utils.getTimer;
|
||||
|
||||
public class §_-hB§ extends §_-Ww§ implements §_-gb§
|
||||
{
|
||||
private static var parentMatrix:Matrix4 = new Matrix4();
|
||||
|
||||
private static var matrix:Matrix4 = new Matrix4();
|
||||
|
||||
public static var maxPositionError:Number = 10;
|
||||
|
||||
public static var maxAngleError:Number = Math.PI / 180;
|
||||
|
||||
public static var camSpeedThreshold:Number = 10;
|
||||
|
||||
private static var fixedPitch:§_-Ju§ = new §_-Ju§("cam_fixedpitch",10 * Math.PI / 180,-1,1);
|
||||
|
||||
private static var noPitchCorrection:§_-UT§ = new §_-UT§("cam_nopitchcorrection",1,0,1);
|
||||
|
||||
private static var pitchCorrectionCoeff:§_-Ju§ = new §_-Ju§("cam_pitchcorrectioncoeff",1,0,10);
|
||||
|
||||
private static var reboundDelay:§_-UT§ = new §_-UT§("cam_rebound",1000,0,2000);
|
||||
|
||||
private static var elevationAngles:Vector.<Number> = new Vector.<Number>(1,true);
|
||||
|
||||
private static var rotationMatrix:Matrix3 = new Matrix3();
|
||||
|
||||
private static var axis:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var rayDirection:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static const MIN_CAMERA_ANGLE:Number = 5 * Math.PI / 180;
|
||||
|
||||
private static const KEY_CAMERA_UP:uint = Keyboard.PAGE_UP;
|
||||
|
||||
private static const ALT_KEY_CAMERA_UP:uint = 221;
|
||||
|
||||
private static const KEY_CAMERA_DOWN:uint = Keyboard.PAGE_DOWN;
|
||||
|
||||
private static const ALT_KEY_CAMERA_DOWN:uint = 219;
|
||||
|
||||
private static const HEIGHT_CHANGE_STEP:Number = 50;
|
||||
|
||||
private static const MIN_HEIGHT:Number = 150;
|
||||
|
||||
private static const MAX_HEIGHT:Number = 3100;
|
||||
|
||||
private static const MIN_DISTANCE:Number = 300;
|
||||
|
||||
private static const COLLISION_OFFSET:Number = 50;
|
||||
|
||||
private static var currentPosition:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var currentRotation:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var rayOrigin:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var flatDirection:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var positionDelta:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var rayHit:§_-jr§ = new §_-jr§();
|
||||
|
||||
private var collisionDetector:§_-fx§;
|
||||
|
||||
private var collisionMask:int;
|
||||
|
||||
private var §_-U1§:Number = 0;
|
||||
|
||||
private var §_-7h§:Number = 0;
|
||||
|
||||
private var locked:Boolean;
|
||||
|
||||
private var position:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var rotation:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var targetPosition:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var targetDirection:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var §_-Wq§:Number = 0;
|
||||
|
||||
private var §_-fq§:Number = 0;
|
||||
|
||||
private var §_-qF§:Number = 0;
|
||||
|
||||
private var §_-51§:Number = 10000000;
|
||||
|
||||
private var §_-kz§:int;
|
||||
|
||||
private var cameraPositionData:CameraPositionData = new CameraPositionData();
|
||||
|
||||
private var §_-4G§:Number;
|
||||
|
||||
private var §_-d9§:Number = 0;
|
||||
|
||||
private var input:§_-Lm§;
|
||||
|
||||
private var §_-fZ§:§_-U2§;
|
||||
|
||||
public function §_-hB§(camera:§_-RE§, collisionDetector:§_-fx§, collisionMask:int, input:§_-Lm§)
|
||||
{
|
||||
super();
|
||||
this.camera = camera;
|
||||
if(collisionDetector == null)
|
||||
{
|
||||
throw new ArgumentError("Parameter collisionDetector cannot be null");
|
||||
}
|
||||
this.collisionDetector = collisionDetector;
|
||||
this.collisionMask = collisionMask;
|
||||
this.input = input;
|
||||
this.§_-Tq§ = 600;
|
||||
}
|
||||
|
||||
public function §_-eA§() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function §_-O-§(target:§_-gw§) : void
|
||||
{
|
||||
if(target == null)
|
||||
{
|
||||
this.§_-fZ§ = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.§_-fZ§ = §_-om§(target.getComponentStrict(§_-om§)).§_-dW§;
|
||||
}
|
||||
}
|
||||
|
||||
public function §_-7o§() : void
|
||||
{
|
||||
noPitchCorrection.value = 1;
|
||||
}
|
||||
|
||||
public function §_-hI§() : void
|
||||
{
|
||||
noPitchCorrection.value = 0;
|
||||
}
|
||||
|
||||
public function §_-WF§(targetPosition:§_-bj§, targetDirection:§_-bj§) : void
|
||||
{
|
||||
this.targetPosition.copy(targetPosition);
|
||||
this.targetDirection.copy(targetDirection);
|
||||
this.§_-kz§ = 0;
|
||||
this.§_-TS§(targetPosition,targetDirection,false,10000,this.cameraPositionData);
|
||||
this.position.copy(this.cameraPositionData.position);
|
||||
this.rotation.x = this.§_-Xv§(this.cameraPositionData) - 0.5 * Math.PI;
|
||||
this.rotation.z = Math.atan2(-targetDirection.x,targetDirection.y);
|
||||
§_-Vi§(this.position);
|
||||
§_-LV§(this.rotation);
|
||||
}
|
||||
|
||||
public function §_-5p§() : void
|
||||
{
|
||||
this.position.reset(camera.x,camera.y,camera.z);
|
||||
this.rotation.reset(camera.rotationX,camera.rotationY,camera.rotationZ);
|
||||
}
|
||||
|
||||
public function update() : void
|
||||
{
|
||||
if(this.§_-fZ§ == null)
|
||||
{
|
||||
throw new Error("Target is not set");
|
||||
}
|
||||
if(camera == null)
|
||||
{
|
||||
throw new Error("Camera is not set");
|
||||
}
|
||||
var dt:Number = Number(§_-h2§.timeDeltaSeconds);
|
||||
if(dt > 0.1)
|
||||
{
|
||||
dt = 0.1;
|
||||
}
|
||||
this.§_-K4§();
|
||||
if(!this.locked)
|
||||
{
|
||||
this.§_-1E§();
|
||||
}
|
||||
this.§_-TS§(this.targetPosition,this.targetDirection,true,dt,this.cameraPositionData);
|
||||
positionDelta.§_-hL§(this.cameraPositionData.position,this.position);
|
||||
var positionError:Number = Number(positionDelta.length());
|
||||
if(positionError > maxPositionError)
|
||||
{
|
||||
this.§_-Wq§ = this.§_-Tu§(positionError - maxPositionError);
|
||||
}
|
||||
var distance:Number = this.§_-Wq§ * dt;
|
||||
if(distance > positionError)
|
||||
{
|
||||
distance = positionError;
|
||||
}
|
||||
positionDelta.normalize().scale(distance);
|
||||
var targetPitchAngle:Number = this.§_-Xv§(this.cameraPositionData);
|
||||
var targetYawAngle:Number = Number(Math.atan2(-this.targetDirection.x,this.targetDirection.y));
|
||||
var currentPitchAngle:Number = Number(§_-aY§.§_-d§(this.rotation.x + 0.5 * Math.PI));
|
||||
var currentYawAngle:Number = Number(§_-aY§.§_-d§(this.rotation.z));
|
||||
var pitchError:Number = Number(§_-aY§.§_-Bu§(targetPitchAngle - currentPitchAngle));
|
||||
this.§_-fq§ = this.§_-NP§(pitchError,this.§_-fq§);
|
||||
var deltaPitch:Number = this.§_-fq§ * dt;
|
||||
if(pitchError > 0 && deltaPitch > pitchError || pitchError < 0 && deltaPitch < pitchError)
|
||||
{
|
||||
deltaPitch = pitchError;
|
||||
}
|
||||
var yawError:Number = Number(§_-aY§.§_-Bu§(targetYawAngle - currentYawAngle));
|
||||
this.§_-qF§ = this.§_-NP§(yawError,this.§_-qF§);
|
||||
var deltaYaw:Number = this.§_-qF§ * dt;
|
||||
if(yawError > 0 && deltaYaw > yawError || yawError < 0 && deltaYaw < yawError)
|
||||
{
|
||||
deltaYaw = yawError;
|
||||
}
|
||||
this.§_-Wq§ = this.§each §(this.§_-Wq§,0,camSpeedThreshold);
|
||||
this.§_-fq§ = this.§each §(this.§_-fq§,0,camSpeedThreshold);
|
||||
this.§_-qF§ = this.§each §(this.§_-qF§,0,camSpeedThreshold);
|
||||
this.position.add(positionDelta);
|
||||
this.rotation.x += deltaPitch;
|
||||
this.rotation.z += deltaYaw;
|
||||
currentPosition.copy(this.position);
|
||||
currentRotation.copy(this.rotation);
|
||||
§_-Vi§(currentPosition);
|
||||
§_-LV§(currentRotation);
|
||||
}
|
||||
|
||||
public function §_-qb§(locked:Boolean) : void
|
||||
{
|
||||
this.locked = locked;
|
||||
}
|
||||
|
||||
public function get §_-Tq§() : Number
|
||||
{
|
||||
return this.§_-U1§;
|
||||
}
|
||||
|
||||
public function set §_-Tq§(value:Number) : void
|
||||
{
|
||||
this.§_-U1§ = §_-aY§.clamp(value,MIN_HEIGHT,MAX_HEIGHT);
|
||||
var d:Number = this.§_-pq§(this.§_-U1§);
|
||||
this.§_-4G§ = Math.atan2(this.§_-U1§,d);
|
||||
this.§_-7h§ = Math.sqrt(this.§_-U1§ * this.§_-U1§ + d * d);
|
||||
this.§_-kz§ = 0;
|
||||
}
|
||||
|
||||
public function §_-Ls§(targetPosition:§_-bj§, targetDirection:§_-bj§, resultingPosition:§_-bj§, resultingAngles:§_-bj§) : void
|
||||
{
|
||||
this.§_-TS§(targetPosition,targetDirection,false,10000,this.cameraPositionData);
|
||||
resultingAngles.x = this.§_-Xv§(this.cameraPositionData) - 0.5 * Math.PI;
|
||||
resultingAngles.z = Math.atan2(-targetDirection.x,targetDirection.y);
|
||||
resultingPosition.copy(this.cameraPositionData.position);
|
||||
}
|
||||
|
||||
private function §_-TS§(targetPosition:§_-bj§, targetDirection:§_-bj§, useReboundDelay:Boolean, dt:Number, result:CameraPositionData) : void
|
||||
{
|
||||
var angle:Number = NaN;
|
||||
var now:int = 0;
|
||||
var delta:Number = NaN;
|
||||
var actualElevation:Number = this.§_-4G§;
|
||||
var xyLength:Number = Number(Math.sqrt(targetDirection.x * targetDirection.x + targetDirection.y * targetDirection.y));
|
||||
if(xyLength < 0.00001)
|
||||
{
|
||||
flatDirection.x = 1;
|
||||
flatDirection.y = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
flatDirection.x = targetDirection.x / xyLength;
|
||||
flatDirection.y = targetDirection.y / xyLength;
|
||||
}
|
||||
result.extraPitch = 0;
|
||||
result.t = 1;
|
||||
var minCollisionDistance:Number = this.§_-7h§;
|
||||
rayOrigin.copy(targetPosition);
|
||||
elevationAngles[0] = actualElevation;
|
||||
axis.x = flatDirection.y;
|
||||
axis.y = -flatDirection.x;
|
||||
flatDirection.reverse();
|
||||
for each(angle in elevationAngles)
|
||||
{
|
||||
rotationMatrix.§_-OB§(axis,-angle);
|
||||
rotationMatrix.§_-Uz§(flatDirection,rayDirection);
|
||||
minCollisionDistance = this.§_-5y§(rayOrigin,rayDirection,this.§_-7h§,minCollisionDistance);
|
||||
}
|
||||
if(useReboundDelay)
|
||||
{
|
||||
now = int(getTimer());
|
||||
if(minCollisionDistance <= this.§_-51§ + 0.001)
|
||||
{
|
||||
this.§_-51§ = minCollisionDistance;
|
||||
this.§_-kz§ = now;
|
||||
}
|
||||
else if(now - this.§_-kz§ < reboundDelay.value)
|
||||
{
|
||||
minCollisionDistance = this.§_-51§;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.§_-51§ = minCollisionDistance;
|
||||
}
|
||||
}
|
||||
if(minCollisionDistance < this.§_-7h§)
|
||||
{
|
||||
result.t = minCollisionDistance / this.§_-7h§;
|
||||
if(minCollisionDistance < MIN_DISTANCE)
|
||||
{
|
||||
rayOrigin.§_-LQ§(minCollisionDistance,rayDirection);
|
||||
delta = MIN_DISTANCE - minCollisionDistance;
|
||||
if(this.collisionDetector.raycast(rayOrigin,§_-bj§.Z_AXIS,this.collisionMask,delta,null,rayHit))
|
||||
{
|
||||
delta = rayHit.t - 10;
|
||||
if(delta < 0)
|
||||
{
|
||||
delta = 0;
|
||||
}
|
||||
}
|
||||
result.position.copy(rayOrigin).§_-LQ§(delta,§_-bj§.Z_AXIS);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.position.copy(rayOrigin).§_-LQ§(minCollisionDistance,rayDirection);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result.position.copy(rayOrigin).§_-LQ§(this.§_-7h§,rayDirection);
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-5y§(rayOrigin:§_-bj§, rayDirection:§_-bj§, rayLength:Number, minCollisionDistance:Number) : Number
|
||||
{
|
||||
var distance:Number = NaN;
|
||||
if(this.collisionDetector.raycast(rayOrigin,rayDirection,this.collisionMask,rayLength,null,rayHit))
|
||||
{
|
||||
distance = Number(rayHit.t);
|
||||
if(distance < COLLISION_OFFSET)
|
||||
{
|
||||
distance = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
distance -= COLLISION_OFFSET;
|
||||
}
|
||||
if(distance < minCollisionDistance)
|
||||
{
|
||||
return distance;
|
||||
}
|
||||
}
|
||||
return minCollisionDistance;
|
||||
}
|
||||
|
||||
private function §_-1E§() : void
|
||||
{
|
||||
this.setMatrix(this.§_-fZ§.parent,parentMatrix);
|
||||
this.setMatrix(this.§_-fZ§,matrix);
|
||||
matrix.append(parentMatrix);
|
||||
matrix.getAxis(3,this.targetPosition);
|
||||
this.targetDirection.reset(matrix.b,matrix.f,matrix.j);
|
||||
}
|
||||
|
||||
private function setMatrix(object:§_-OX§, matrix:Matrix4) : void
|
||||
{
|
||||
matrix.§_-Wl§(object.rotationX,object.rotationY,object.rotationZ);
|
||||
matrix.§_-oa§(object.x,object.y,object.z);
|
||||
}
|
||||
|
||||
private function §_-K4§() : void
|
||||
{
|
||||
var heightChangeDir:int = this.input.§_-OO§(KEY_CAMERA_UP) - this.input.§_-OO§(KEY_CAMERA_DOWN);
|
||||
if(heightChangeDir != 0)
|
||||
{
|
||||
this.§_-Tq§ = this.§_-U1§ + heightChangeDir * HEIGHT_CHANGE_STEP;
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-pq§(h:Number) : Number
|
||||
{
|
||||
var hMid:Number = 0.5 * (3300 + 200);
|
||||
var a:Number = hMid;
|
||||
var v:Number = 200 - hMid;
|
||||
var k:Number = (1300 - 600) / (v * v);
|
||||
return -k * (h - a) * (h - a) + 1300;
|
||||
}
|
||||
|
||||
private function §_-Tu§(positionError:Number) : Number
|
||||
{
|
||||
return 3 * positionError;
|
||||
}
|
||||
|
||||
private function §_-NP§(angleError:Number, currentSpeed:Number) : Number
|
||||
{
|
||||
if(angleError < -maxAngleError)
|
||||
{
|
||||
return 3 * (angleError + maxAngleError);
|
||||
}
|
||||
if(angleError > maxAngleError)
|
||||
{
|
||||
return 3 * (angleError - maxAngleError);
|
||||
}
|
||||
return currentSpeed;
|
||||
}
|
||||
|
||||
private function §each §(value:Number, snapValue:Number, epsilon:Number) : Number
|
||||
{
|
||||
if(value > snapValue - epsilon && value < snapValue + epsilon)
|
||||
{
|
||||
return snapValue;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
private function §_-Xv§(cameraPositionData:CameraPositionData) : Number
|
||||
{
|
||||
var angle:Number = this.§_-4G§ - fixedPitch.value;
|
||||
if(angle < 0)
|
||||
{
|
||||
angle = 0;
|
||||
}
|
||||
var t:Number = cameraPositionData.t;
|
||||
if(t >= 1 || angle < MIN_CAMERA_ANGLE || noPitchCorrection.value == 1)
|
||||
{
|
||||
return cameraPositionData.extraPitch - angle;
|
||||
}
|
||||
return cameraPositionData.extraPitch - Math.atan2(t * this.§_-U1§,pitchCorrectionCoeff.value * this.§_-U1§ * (1 / Math.tan(angle) - (1 - t) / Math.tan(this.§_-4G§)));
|
||||
}
|
||||
|
||||
private function §_-PD§(value:Number, targetValue:Number, delta:Number) : Number
|
||||
{
|
||||
if(value < targetValue)
|
||||
{
|
||||
value += delta;
|
||||
return value > targetValue ? targetValue : value;
|
||||
}
|
||||
if(value > targetValue)
|
||||
{
|
||||
value -= delta;
|
||||
return value < targetValue ? targetValue : value;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import §_-nl§.§_-bj§;
|
||||
|
||||
class CameraPositionData
|
||||
{
|
||||
public var t:Number;
|
||||
|
||||
public var extraPitch:Number;
|
||||
|
||||
public var position:§_-bj§ = new §_-bj§();
|
||||
|
||||
public function CameraPositionData()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,20 @@
|
||||
package package_88
|
||||
package §_-K8§
|
||||
{
|
||||
import §_-8D§.§_-OX§;
|
||||
import §_-RQ§.§_-HE§;
|
||||
import §_-RQ§.§_-Va§;
|
||||
import §_-e6§.§_-1I§;
|
||||
import §_-e6§.§_-RE§;
|
||||
import §_-e6§.§_-fX§;
|
||||
import §_-lS§.§_-h2§;
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import flash.display.DisplayObjectContainer;
|
||||
import flash.display.Sprite;
|
||||
import flash.geom.Vector3D;
|
||||
import alternativa.tanks.game.subsystems.rendersystem.RenderSystem;
|
||||
import alternativa.tanks.game.subsystems.rendersystem.IGraphicEffect;
|
||||
import alternativa.tanks.game.subsystems.rendersystem.GameCamera;
|
||||
import package_21.name_78;
|
||||
import alternativa.tanks.game.utils.objectpool.PooledObject;
|
||||
import alternativa.tanks.game.utils.objectpool.ObjectPool;
|
||||
import package_45.name_182;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class name_268 extends PooledObject implements IGraphicEffect
|
||||
public class §_-e5§ extends §_-HE§ implements §_-fX§
|
||||
{
|
||||
private static var vector1:Vector3D = new Vector3D();
|
||||
|
||||
@@ -22,61 +22,61 @@ package package_88
|
||||
|
||||
private var messageLifeTime:int;
|
||||
|
||||
private var var_435:Vector.<Message>;
|
||||
private var §_-cd§:Vector.<Message>;
|
||||
|
||||
private var anchor:name_78;
|
||||
private var anchor:§_-OX§;
|
||||
|
||||
private var var_466:DisplayObjectContainer;
|
||||
private var §_-1R§:DisplayObjectContainer;
|
||||
|
||||
private var var_467:Function;
|
||||
private var §_-Cx§:Function;
|
||||
|
||||
public function name_268(objectPool:ObjectPool)
|
||||
public function §_-e5§(objectPool:§_-Va§)
|
||||
{
|
||||
super(objectPool);
|
||||
this.var_435 = new Vector.<Message>();
|
||||
this.var_466 = new Sprite();
|
||||
this.§_-cd§ = new Vector.<Message>();
|
||||
this.§_-1R§ = new Sprite();
|
||||
}
|
||||
|
||||
public function init(messageLifeTime:int, anchor:name_78, destuctionCallback:Function) : void
|
||||
public function init(messageLifeTime:int, anchor:§_-OX§, destuctionCallback:Function) : void
|
||||
{
|
||||
this.messageLifeTime = messageLifeTime;
|
||||
this.anchor = anchor;
|
||||
this.var_467 = destuctionCallback;
|
||||
this.§_-Cx§ = destuctionCallback;
|
||||
}
|
||||
|
||||
public function name_305(text:String, color:uint) : void
|
||||
public function §_-U8§(text:String, color:uint) : void
|
||||
{
|
||||
var message:Message = Message.create();
|
||||
message.color = color;
|
||||
message.text = text;
|
||||
message.lifeTime = 0;
|
||||
this.var_435.push(message);
|
||||
this.var_466.addChild(message);
|
||||
this.§_-cd§.push(message);
|
||||
this.§_-1R§.addChild(message);
|
||||
}
|
||||
|
||||
public function addedToRenderSystem(system:RenderSystem) : void
|
||||
public function addedToRenderSystem(system:§_-1I§) : void
|
||||
{
|
||||
system.method_41("debug_messages").addChild(this.var_466);
|
||||
system.§_-S4§("debug_messages").addChild(this.§_-1R§);
|
||||
}
|
||||
|
||||
public function play(camera:GameCamera) : Boolean
|
||||
public function play(camera:§_-RE§) : Boolean
|
||||
{
|
||||
var i:int = 0;
|
||||
var message:Message = null;
|
||||
var timeDelta:int = name_182.timeDelta;
|
||||
for(i = 0; i < this.var_435.length; )
|
||||
var timeDelta:int = int(§_-h2§.timeDelta);
|
||||
for(i = 0; i < this.§_-cd§.length; )
|
||||
{
|
||||
message = this.var_435[i];
|
||||
message = this.§_-cd§[i];
|
||||
message.lifeTime += timeDelta;
|
||||
if(message.lifeTime >= this.messageLifeTime)
|
||||
{
|
||||
message.destroy();
|
||||
this.var_435.shift();
|
||||
this.§_-cd§.shift();
|
||||
i--;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(this.var_435.length == 0)
|
||||
if(this.§_-cd§.length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -88,18 +88,18 @@ package package_88
|
||||
vector2.y -= camera.view.height / 2;
|
||||
if(vector2.z > 0.01 && vector2.z > camera.nearClipping)
|
||||
{
|
||||
this.var_466.visible = true;
|
||||
this.var_466.x = int(vector2.x);
|
||||
this.var_466.y = int(vector2.y);
|
||||
this.§_-1R§.visible = true;
|
||||
this.§_-1R§.x = int(vector2.x);
|
||||
this.§_-1R§.y = int(vector2.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.var_466.visible = false;
|
||||
this.§_-1R§.visible = false;
|
||||
}
|
||||
var messageY:int = 0;
|
||||
for(i = this.var_435.length - 1; i >= 0; i--)
|
||||
for(i = this.§_-cd§.length - 1; i >= 0; i--)
|
||||
{
|
||||
message = this.var_435[i];
|
||||
message = this.§_-cd§[i];
|
||||
message.y = messageY;
|
||||
message.x = -int(message.textWidth / 2);
|
||||
messageY -= 20;
|
||||
@@ -111,19 +111,19 @@ package package_88
|
||||
{
|
||||
var message:Message = null;
|
||||
var func:Function = null;
|
||||
if(this.var_466.parent != null)
|
||||
if(this.§_-1R§.parent != null)
|
||||
{
|
||||
this.var_466.parent.removeChild(this.var_466);
|
||||
this.§_-1R§.parent.removeChild(this.§_-1R§);
|
||||
}
|
||||
for each(message in this.var_435)
|
||||
for each(message in this.§_-cd§)
|
||||
{
|
||||
message.destroy();
|
||||
}
|
||||
this.var_435.length = 0;
|
||||
if(this.var_467 != null)
|
||||
this.§_-cd§.length = 0;
|
||||
if(this.§_-Cx§ != null)
|
||||
{
|
||||
func = this.var_467;
|
||||
this.var_467 = null;
|
||||
func = this.§_-Cx§;
|
||||
this.§_-Cx§ = null;
|
||||
func.call();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package package_90
|
||||
package §_-KA§
|
||||
{
|
||||
import package_46.name_194;
|
||||
import §_-nl§.§_-bj§;
|
||||
|
||||
public class name_386
|
||||
public class §_-FW§
|
||||
{
|
||||
public var minX:Number = 1e+308;
|
||||
|
||||
@@ -16,12 +16,12 @@ package package_90
|
||||
|
||||
public var maxZ:Number = -1e+308;
|
||||
|
||||
public function name_386()
|
||||
public function §_-FW§()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function method_140(minX:Number, minY:Number, minZ:Number, maxX:Number, maxY:Number, maxZ:Number) : void
|
||||
public function §_-k2§(minX:Number, minY:Number, minZ:Number, maxX:Number, maxY:Number, maxZ:Number) : void
|
||||
{
|
||||
this.minX = minX;
|
||||
this.minY = minY;
|
||||
@@ -31,7 +31,7 @@ package package_90
|
||||
this.maxZ = maxZ;
|
||||
}
|
||||
|
||||
public function name_686(delta:Number) : void
|
||||
public function §_-Gd§(delta:Number) : void
|
||||
{
|
||||
this.minX -= delta;
|
||||
this.minY -= delta;
|
||||
@@ -41,7 +41,7 @@ package package_90
|
||||
this.maxZ += delta;
|
||||
}
|
||||
|
||||
public function name_583(boundBox:name_386) : void
|
||||
public function §_-EH§(boundBox:§_-FW§) : void
|
||||
{
|
||||
this.minX = boundBox.minX < this.minX ? boundBox.minX : this.minX;
|
||||
this.minY = boundBox.minY < this.minY ? boundBox.minY : this.minY;
|
||||
@@ -51,7 +51,7 @@ package package_90
|
||||
this.maxZ = boundBox.maxZ > this.maxZ ? boundBox.maxZ : this.maxZ;
|
||||
}
|
||||
|
||||
public function method_702(x:Number, y:Number, z:Number) : void
|
||||
public function §_-aW§(x:Number, y:Number, z:Number) : void
|
||||
{
|
||||
if(x < this.minX)
|
||||
{
|
||||
@@ -79,7 +79,7 @@ package package_90
|
||||
}
|
||||
}
|
||||
|
||||
public function name_584() : void
|
||||
public function §_-GT§() : void
|
||||
{
|
||||
this.minX = 1e+308;
|
||||
this.minY = 1e+308;
|
||||
@@ -89,32 +89,32 @@ package package_90
|
||||
this.maxZ = -1e+308;
|
||||
}
|
||||
|
||||
public function intersects(bb:name_386, epsilon:Number) : Boolean
|
||||
public function intersects(bb:§_-FW§, epsilon:Number) : Boolean
|
||||
{
|
||||
return !(this.minX > bb.maxX + epsilon || this.maxX < bb.minX - epsilon || this.minY > bb.maxY + epsilon || this.maxY < bb.minY - epsilon || this.minZ > bb.maxZ + epsilon || this.maxZ < bb.minZ - epsilon);
|
||||
}
|
||||
|
||||
public function name_687(point:name_194, epsilon:Number) : Boolean
|
||||
public function §_-Wu§(point:§_-bj§, epsilon:Number) : Boolean
|
||||
{
|
||||
return point.x > this.minX - epsilon && point.x < this.maxX + epsilon && point.y > this.minY - epsilon && point.y < this.maxY + epsilon && point.z > this.minZ - epsilon && point.z < this.maxZ + epsilon;
|
||||
}
|
||||
|
||||
public function name_689() : Number
|
||||
public function §_-ot§() : Number
|
||||
{
|
||||
return this.maxX - this.minX;
|
||||
}
|
||||
|
||||
public function name_688() : Number
|
||||
public function §_-jP§() : Number
|
||||
{
|
||||
return this.maxY - this.minY;
|
||||
}
|
||||
|
||||
public function name_690() : Number
|
||||
public function §_-Ix§() : Number
|
||||
{
|
||||
return this.maxZ - this.minZ;
|
||||
}
|
||||
|
||||
public function copyFrom(boundBox:name_386) : void
|
||||
public function copyFrom(boundBox:§_-FW§) : void
|
||||
{
|
||||
this.minX = boundBox.minX;
|
||||
this.minY = boundBox.minY;
|
||||
@@ -124,9 +124,9 @@ package package_90
|
||||
this.maxZ = boundBox.maxZ;
|
||||
}
|
||||
|
||||
public function clone() : name_386
|
||||
public function clone() : §_-FW§
|
||||
{
|
||||
var clone:name_386 = new name_386();
|
||||
var clone:§_-FW§ = new §_-FW§();
|
||||
clone.copyFrom(this);
|
||||
return clone;
|
||||
}
|
||||
@@ -1,26 +1,26 @@
|
||||
package package_89
|
||||
package §_-LL§
|
||||
{
|
||||
import §_-1z§.§_-pi§;
|
||||
import §_-7A§.§_-3e§;
|
||||
import §_-8D§.§_-OX§;
|
||||
import §_-Ex§.§_-U2§;
|
||||
import §_-Ex§.§_-hW§;
|
||||
import §_-RQ§.§_-HE§;
|
||||
import §_-RQ§.§_-Va§;
|
||||
import §_-Vh§.§_-YD§;
|
||||
import §_-e6§.§_-1I§;
|
||||
import §_-e6§.§_-9l§;
|
||||
import §_-e6§.§_-RE§;
|
||||
import §_-e6§.§_-fX§;
|
||||
import §_-lS§.§_-h2§;
|
||||
import §_-nl§.Matrix3;
|
||||
import §_-nl§.§_-bj§;
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import flash.display3D.Context3DBlendFactor;
|
||||
import alternativa.tanks.game.subsystems.rendersystem.RenderSystem;
|
||||
import alternativa.tanks.game.subsystems.rendersystem.BlendedMaterial;
|
||||
import alternativa.tanks.game.subsystems.rendersystem.IGraphicEffect;
|
||||
import alternativa.tanks.game.subsystems.rendersystem.GameCamera;
|
||||
import package_19.name_380;
|
||||
import package_19.name_494;
|
||||
import package_21.name_78;
|
||||
import alternativa.tanks.game.utils.objectpool.PooledObject;
|
||||
import alternativa.tanks.game.utils.objectpool.ObjectPool;
|
||||
import package_28.name_129;
|
||||
import package_4.name_313;
|
||||
import package_45.name_182;
|
||||
import package_46.Matrix3;
|
||||
import package_46.name_194;
|
||||
import package_75.class_15;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class name_266 extends PooledObject implements IGraphicEffect
|
||||
public class §_-nR§ extends §_-HE§ implements §_-fX§
|
||||
{
|
||||
private static const BARREL_INDEX:int = 0;
|
||||
|
||||
@@ -38,29 +38,29 @@ package package_89
|
||||
|
||||
private static const trailSpeed3:Number = 1300;
|
||||
|
||||
private static var muzzlePosition:name_194 = new name_194();
|
||||
private static var muzzlePosition:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var gunDirection:name_194 = new name_194();
|
||||
private static var gunDirection:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var axis:name_194 = new name_194();
|
||||
private static var axis:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var eulerAngles:name_194 = new name_194();
|
||||
private static var eulerAngles:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var trailMatrix:Matrix3 = new Matrix3();
|
||||
|
||||
private static var trailMatrix2:Matrix3 = new Matrix3();
|
||||
|
||||
private var turret:class_15;
|
||||
private var turret:§_-3e§;
|
||||
|
||||
private var sprite1:name_494;
|
||||
private var sprite1:§_-hW§;
|
||||
|
||||
private var sprite2:name_494;
|
||||
private var sprite2:§_-hW§;
|
||||
|
||||
private var sprite3:name_494;
|
||||
private var sprite3:§_-hW§;
|
||||
|
||||
private var var_427:BlendedMaterial;
|
||||
private var §_-kg§:§_-9l§;
|
||||
|
||||
private var var_428:name_313 = new name_313(16563726,0.1);
|
||||
private var §_-ld§:§_-YD§ = new §_-YD§(16563726,0.1);
|
||||
|
||||
private var trail1:Trail;
|
||||
|
||||
@@ -88,38 +88,38 @@ package package_89
|
||||
|
||||
private var timeToLive:int;
|
||||
|
||||
public function name_266(objectPool:ObjectPool)
|
||||
public function §_-nR§(objectPool:§_-Va§)
|
||||
{
|
||||
super(objectPool);
|
||||
this.var_427 = new BlendedMaterial();
|
||||
this.var_427.var_21 = true;
|
||||
this.var_427.blendModeSource = Context3DBlendFactor.ONE;
|
||||
this.var_427.blendModeDestination = Context3DBlendFactor.ONE;
|
||||
this.method_378();
|
||||
this.§_-kg§ = new §_-9l§();
|
||||
this.§_-kg§.§_-L4§ = true;
|
||||
this.§_-kg§.blendModeSource = Context3DBlendFactor.ONE;
|
||||
this.§_-kg§.blendModeDestination = Context3DBlendFactor.ONE;
|
||||
this.§_-5M§();
|
||||
}
|
||||
|
||||
public function init(turret:class_15, diffuse:name_129, opacity:name_129) : void
|
||||
public function init(turret:§_-3e§, diffuse:§_-pi§, opacity:§_-pi§) : void
|
||||
{
|
||||
this.turret = turret;
|
||||
}
|
||||
|
||||
public function addedToRenderSystem(system:RenderSystem) : void
|
||||
public function addedToRenderSystem(system:§_-1I§) : void
|
||||
{
|
||||
var container:name_78 = system.method_62();
|
||||
var container:§_-OX§ = system.§_-Hn§();
|
||||
container.addChild(this.sprite1);
|
||||
container.addChild(this.sprite2);
|
||||
container.addChild(this.sprite3);
|
||||
}
|
||||
|
||||
public function play(camera:GameCamera) : Boolean
|
||||
public function play(camera:§_-RE§) : Boolean
|
||||
{
|
||||
if(this.timeToLive <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.turret.getGunMuzzleData(BARREL_INDEX,muzzlePosition,gunDirection);
|
||||
var dt:Number = name_182.timeDeltaSeconds;
|
||||
this.timeToLive -= name_182.timeDelta;
|
||||
var dt:Number = Number(§_-h2§.timeDeltaSeconds);
|
||||
this.timeToLive -= §_-h2§.timeDelta;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -128,34 +128,34 @@ package package_89
|
||||
this.sprite1.alternativa3d::removeFromParent();
|
||||
this.sprite2.alternativa3d::removeFromParent();
|
||||
this.sprite3.alternativa3d::removeFromParent();
|
||||
method_254();
|
||||
§_-DQ§();
|
||||
}
|
||||
|
||||
private function method_378() : void
|
||||
private function §_-5M§() : void
|
||||
{
|
||||
this.sprite1 = this.method_377(120);
|
||||
this.sprite2 = this.method_377(99.75);
|
||||
this.sprite3 = this.method_377(79.5);
|
||||
this.sprite1 = this.§_-eJ§(120);
|
||||
this.sprite2 = this.§_-eJ§(99.75);
|
||||
this.sprite3 = this.§_-eJ§(79.5);
|
||||
}
|
||||
|
||||
private function method_377(size:Number) : name_494
|
||||
private function §_-eJ§(size:Number) : §_-hW§
|
||||
{
|
||||
var sprite:name_494 = new name_494(size,size);
|
||||
var sprite:§_-hW§ = new §_-hW§(size,size);
|
||||
sprite.rotation = 2 * Math.PI * Math.random();
|
||||
sprite.material = this.var_427;
|
||||
sprite.material = this.§_-kg§;
|
||||
return sprite;
|
||||
}
|
||||
|
||||
private function method_380(sprite:name_494, basePoint:name_194, direction:name_194, distance:Number) : void
|
||||
private function §_-ME§(sprite:§_-hW§, basePoint:§_-bj§, direction:§_-bj§, distance:Number) : void
|
||||
{
|
||||
sprite.x = basePoint.x + direction.x * distance;
|
||||
sprite.y = basePoint.y + direction.y * distance;
|
||||
sprite.z = basePoint.z + direction.z * distance;
|
||||
}
|
||||
|
||||
private function method_379(trail:name_380, angle:Number, basePoint:name_194, direction:name_194, distance:Number, dx:Number, dz:Number) : void
|
||||
private function §_-Qt§(trail:§_-U2§, angle:Number, basePoint:§_-bj§, direction:§_-bj§, distance:Number, dx:Number, dz:Number) : void
|
||||
{
|
||||
trailMatrix.method_344(name_194.Y_AXIS,angle);
|
||||
trailMatrix.§_-OB§(§_-bj§.Y_AXIS,angle);
|
||||
if(direction.y < -0.99999 || direction.y > 0.99999)
|
||||
{
|
||||
axis.x = 0;
|
||||
@@ -171,9 +171,9 @@ package package_89
|
||||
axis.normalize();
|
||||
angle = Number(Math.acos(direction.y));
|
||||
}
|
||||
trailMatrix2.method_344(axis,angle);
|
||||
trailMatrix2.§_-OB§(axis,angle);
|
||||
trailMatrix.append(trailMatrix2);
|
||||
trailMatrix.name_341(eulerAngles);
|
||||
trailMatrix.§_-fJ§(eulerAngles);
|
||||
trail.rotationX = eulerAngles.x;
|
||||
trail.rotationY = eulerAngles.y;
|
||||
trail.rotationZ = eulerAngles.z;
|
||||
@@ -184,28 +184,28 @@ package package_89
|
||||
}
|
||||
}
|
||||
|
||||
import package_19.name_380;
|
||||
import package_21.name_126;
|
||||
import package_21.name_78;
|
||||
import package_28.name_119;
|
||||
import package_4.class_4;
|
||||
import §_-1z§.§_-gA§;
|
||||
import §_-8D§.§_-OX§;
|
||||
import §_-8D§.§_-d6§;
|
||||
import §_-Ex§.§_-U2§;
|
||||
import §_-Vh§.§_-b9§;
|
||||
|
||||
class Trail extends name_380
|
||||
class Trail extends §_-U2§
|
||||
{
|
||||
private static var verts:Vector.<Number> = Vector.<Number>([0,0,0,0,0,0,0,0,0]);
|
||||
|
||||
public function Trail(scale:Number, material:class_4)
|
||||
public function Trail(scale:Number, material:§_-b9§)
|
||||
{
|
||||
super();
|
||||
var h:Number = 240 * scale;
|
||||
verts[0] = -4;
|
||||
verts[3] = 4;
|
||||
verts[7] = h;
|
||||
geometry = new name_119();
|
||||
geometry = new §_-gA§();
|
||||
var attributes:Array = [];
|
||||
attributes[0] = name_126.POSITION;
|
||||
attributes[1] = name_126.POSITION;
|
||||
attributes[2] = name_126.POSITION;
|
||||
attributes[0] = §_-d6§.POSITION;
|
||||
attributes[1] = §_-d6§.POSITION;
|
||||
attributes[2] = §_-d6§.POSITION;
|
||||
geometry.addVertexStream(attributes);
|
||||
geometry.numVertices = 3;
|
||||
var values:Vector.<Number> = new Vector.<Number>(9);
|
||||
@@ -213,7 +213,7 @@ class Trail extends name_380
|
||||
{
|
||||
values[i] = verts[i];
|
||||
}
|
||||
geometry.setAttributeValues(name_126.POSITION,values);
|
||||
geometry.setAttributeValues(§_-d6§.POSITION,values);
|
||||
geometry.indices = Vector.<uint>([0,1,2]);
|
||||
addSurface(material,0,1);
|
||||
calculateBoundBox();
|
||||
15
src/?_-Lz?.as
Normal file
@@ -0,0 +1,15 @@
|
||||
package
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[ExcludeClass]
|
||||
[Embed(source="/_assets/16__-Lz.jpg")]
|
||||
public class §_-Lz§ extends BitmapAsset
|
||||
{
|
||||
public function §_-Lz§()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
15
src/?_-M9?.as
Normal file
@@ -0,0 +1,15 @@
|
||||
package
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[ExcludeClass]
|
||||
[Embed(source="/_assets/14__-M9.jpg")]
|
||||
public class §_-M9§ extends BitmapAsset
|
||||
{
|
||||
public function §_-M9§()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
package alternativa.utils
|
||||
package §_-O5§
|
||||
{
|
||||
public class CircularStringBuffer implements ICircularStringBuffer
|
||||
public class §_-2n§ implements §_-c4§
|
||||
{
|
||||
public var strings:Vector.<String>;
|
||||
|
||||
public var var_665:int;
|
||||
public var §_-Uh§:int;
|
||||
|
||||
public var var_664:int;
|
||||
public var §_-1A§:int;
|
||||
|
||||
private var var_666:int;
|
||||
private var §_-9W§:int;
|
||||
|
||||
public function CircularStringBuffer(capacity:int)
|
||||
public function §_-2n§(capacity:int)
|
||||
{
|
||||
super();
|
||||
this.var_666 = capacity;
|
||||
this.strings = new Vector.<String>(this.var_666 + 1);
|
||||
this.§_-9W§ = capacity;
|
||||
this.strings = new Vector.<String>(this.§_-9W§ + 1);
|
||||
}
|
||||
|
||||
public function add(s:String) : void
|
||||
{
|
||||
this.strings[this.var_664] = s;
|
||||
this.var_664 = this.incIndex(this.var_664);
|
||||
if(this.var_664 == this.var_665)
|
||||
this.strings[this.§_-1A§] = s;
|
||||
this.§_-1A§ = this.incIndex(this.§_-1A§);
|
||||
if(this.§_-1A§ == this.§_-Uh§)
|
||||
{
|
||||
this.var_665 = this.incIndex(this.var_665);
|
||||
this.§_-Uh§ = this.incIndex(this.§_-Uh§);
|
||||
}
|
||||
}
|
||||
|
||||
public function clear() : void
|
||||
{
|
||||
this.var_665 = 0;
|
||||
this.var_664 = 0;
|
||||
this.§_-Uh§ = 0;
|
||||
this.§_-1A§ = 0;
|
||||
var len:int = int(this.strings.length);
|
||||
for(var i:int = 0; i < len; i++)
|
||||
{
|
||||
@@ -40,7 +40,7 @@ package alternativa.utils
|
||||
|
||||
public function get size() : int
|
||||
{
|
||||
var result:int = this.var_664 - this.var_665;
|
||||
var result:int = this.§_-1A§ - this.§_-Uh§;
|
||||
if(result < 0)
|
||||
{
|
||||
result += this.strings.length;
|
||||
@@ -50,13 +50,13 @@ package alternativa.utils
|
||||
|
||||
public function get capacity() : int
|
||||
{
|
||||
return this.var_666;
|
||||
return this.§_-9W§;
|
||||
}
|
||||
|
||||
public function name_638() : Vector.<String>
|
||||
public function §_-BS§() : Vector.<String>
|
||||
{
|
||||
var result:Vector.<String> = new Vector.<String>();
|
||||
for(var i:int = this.var_665; i != this.var_664; i = this.incIndex(i))
|
||||
for(var i:int = this.§_-Uh§; i != this.§_-1A§; i = this.incIndex(i))
|
||||
{
|
||||
result.push(this.strings[i]);
|
||||
}
|
||||
@@ -68,7 +68,7 @@ package alternativa.utils
|
||||
throw new Error("Unimplemented");
|
||||
}
|
||||
|
||||
public function name_633(startIndex:int) : IStringBufferIterator
|
||||
public function §_-Pj§(startIndex:int) : §_-fU§
|
||||
{
|
||||
return new Iterator(this,startIndex);
|
||||
}
|
||||
@@ -80,13 +80,13 @@ package alternativa.utils
|
||||
}
|
||||
}
|
||||
|
||||
class Iterator implements IStringBufferIterator
|
||||
class Iterator implements §_-fU§
|
||||
{
|
||||
private var buffer:CircularStringBuffer;
|
||||
private var buffer:§_-2n§;
|
||||
|
||||
private var index:int;
|
||||
|
||||
public function Iterator(buffer:CircularStringBuffer, startIndex:int)
|
||||
public function Iterator(buffer:§_-2n§, startIndex:int)
|
||||
{
|
||||
super();
|
||||
if(startIndex < 0 || startIndex > buffer.size)
|
||||
@@ -95,7 +95,7 @@ class Iterator implements IStringBufferIterator
|
||||
}
|
||||
this.buffer = buffer;
|
||||
var bufferLength:uint = uint(buffer.strings.length);
|
||||
this.index = buffer.var_665 + startIndex - 1;
|
||||
this.index = buffer.§_-Uh§ + startIndex - 1;
|
||||
if(this.index < 0)
|
||||
{
|
||||
this.index = bufferLength - 1;
|
||||
@@ -108,13 +108,13 @@ class Iterator implements IStringBufferIterator
|
||||
|
||||
public function hasNext() : Boolean
|
||||
{
|
||||
return this.incIndex(this.index) != this.buffer.var_664;
|
||||
return this.incIndex(this.index) != this.buffer.§_-1A§;
|
||||
}
|
||||
|
||||
public function getNext() : String
|
||||
{
|
||||
this.index = this.incIndex(this.index);
|
||||
if(this.index == this.buffer.var_664)
|
||||
if(this.index == this.buffer.§_-1A§)
|
||||
{
|
||||
throw new Error("End of buffer");
|
||||
}
|
||||
392
src/?_-OZ?/?_-FA?.as
Normal file
@@ -0,0 +1,392 @@
|
||||
package §_-OZ§
|
||||
{
|
||||
import §_-8D§.§_-OX§;
|
||||
import §_-9n§.§_-Np§;
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class §_-FA§ extends §_-CO§
|
||||
{
|
||||
alternativa3d var §_-Kq§:Array;
|
||||
|
||||
public var name:String;
|
||||
|
||||
public var loop:Boolean = true;
|
||||
|
||||
public var length:Number = 0;
|
||||
|
||||
public var animated:Boolean = true;
|
||||
|
||||
private var §_-qC§:Number = 0;
|
||||
|
||||
private var §_-Iv§:int = 0;
|
||||
|
||||
private var §_-cT§:Vector.<§_-Np§> = new Vector.<§_-Np§>();
|
||||
|
||||
private var §_-Ci§:§_-Re§;
|
||||
|
||||
public function §_-FA§(name:String = null)
|
||||
{
|
||||
super();
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public function get objects() : Array
|
||||
{
|
||||
return this.alternativa3d::_-Kq == null ? null : [].concat(this.alternativa3d::_-Kq);
|
||||
}
|
||||
|
||||
public function set objects(value:Array) : void
|
||||
{
|
||||
this.§_-R5§(this.alternativa3d::_-Kq,alternativa3d::controller,value,alternativa3d::controller);
|
||||
this.alternativa3d::_-Kq = value == null ? null : [].concat(value);
|
||||
}
|
||||
|
||||
override alternativa3d function setController(value:§_-cK§) : void
|
||||
{
|
||||
this.§_-R5§(this.alternativa3d::_-Kq,alternativa3d::controller,this.alternativa3d::_-Kq,value);
|
||||
this.alternativa3d::controller = value;
|
||||
}
|
||||
|
||||
private function addObject(object:Object) : void
|
||||
{
|
||||
if(this.alternativa3d::_-Kq == null)
|
||||
{
|
||||
this.alternativa3d::_-Kq = [object];
|
||||
}
|
||||
else
|
||||
{
|
||||
this.alternativa3d::_-Kq.push(object);
|
||||
}
|
||||
if(alternativa3d::controller != null)
|
||||
{
|
||||
alternativa3d::controller.alternativa3d::addObject(object);
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-R5§(oldObjects:Array, oldController:§_-cK§, newObjects:Array, newController:§_-cK§) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var count:int = 0;
|
||||
if(oldController != null && oldObjects != null)
|
||||
{
|
||||
for(i = 0,count = int(this.alternativa3d::_-Kq.length); i < count; i++)
|
||||
{
|
||||
oldController.alternativa3d::_-il(oldObjects[i]);
|
||||
}
|
||||
}
|
||||
if(newController != null && newObjects != null)
|
||||
{
|
||||
for(i = 0,count = int(newObjects.length); i < count; i++)
|
||||
{
|
||||
newController.alternativa3d::addObject(newObjects[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function §_-SR§() : void
|
||||
{
|
||||
var track:§_-Np§ = null;
|
||||
var len:Number = NaN;
|
||||
for(var i:int = 0; i < this.§_-Iv§; )
|
||||
{
|
||||
track = this.§_-cT§[i];
|
||||
len = track.length;
|
||||
if(len > this.length)
|
||||
{
|
||||
this.length = len;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function §_-nn§(track:§_-Np§) : §_-Np§
|
||||
{
|
||||
if(track == null)
|
||||
{
|
||||
throw new Error("Track can not be null");
|
||||
}
|
||||
var _loc2_:* = this.§_-Iv§++;
|
||||
this.§_-cT§[_loc2_] = track;
|
||||
if(track.length > this.length)
|
||||
{
|
||||
this.length = track.length;
|
||||
}
|
||||
return track;
|
||||
}
|
||||
|
||||
public function §_-kS§(track:§_-Np§) : §_-Np§
|
||||
{
|
||||
var t:§_-Np§ = null;
|
||||
var index:int = int(this.§_-cT§.indexOf(track));
|
||||
if(index < 0)
|
||||
{
|
||||
throw new ArgumentError("Track not found");
|
||||
}
|
||||
--this.§_-Iv§;
|
||||
for(var j:int = index + 1; index < this.§_-Iv§; )
|
||||
{
|
||||
this.§_-cT§[index] = this.§_-cT§[j];
|
||||
index++;
|
||||
j++;
|
||||
}
|
||||
this.§_-cT§.length = this.§_-Iv§;
|
||||
this.length = 0;
|
||||
for(var i:int = 0; i < this.§_-Iv§; )
|
||||
{
|
||||
t = this.§_-cT§[i];
|
||||
if(t.length > this.length)
|
||||
{
|
||||
this.length = t.length;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return track;
|
||||
}
|
||||
|
||||
public function §_-QA§(index:int) : §_-Np§
|
||||
{
|
||||
return this.§_-cT§[index];
|
||||
}
|
||||
|
||||
public function get numTracks() : int
|
||||
{
|
||||
return this.§_-Iv§;
|
||||
}
|
||||
|
||||
override alternativa3d function update(interval:Number, weight:Number) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var track:§_-Np§ = null;
|
||||
var state:§_-SK§ = null;
|
||||
var oldTime:Number = this.§_-qC§;
|
||||
if(this.animated)
|
||||
{
|
||||
this.§_-qC§ += interval * speed;
|
||||
if(this.loop)
|
||||
{
|
||||
if(this.§_-qC§ < 0)
|
||||
{
|
||||
this.§_-qC§ = 0;
|
||||
}
|
||||
else if(this.§_-qC§ >= this.length)
|
||||
{
|
||||
this.alternativa3d::_-D3(oldTime,this.length);
|
||||
this.§_-qC§ = this.length <= 0 ? 0 : this.§_-qC§ % this.length;
|
||||
this.alternativa3d::_-D3(0,this.§_-qC§);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.alternativa3d::_-D3(oldTime,this.§_-qC§);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(this.§_-qC§ < 0)
|
||||
{
|
||||
this.§_-qC§ = 0;
|
||||
}
|
||||
else if(this.§_-qC§ >= this.length)
|
||||
{
|
||||
this.§_-qC§ = this.length;
|
||||
}
|
||||
this.alternativa3d::_-D3(oldTime,this.§_-qC§);
|
||||
}
|
||||
}
|
||||
if(weight > 0)
|
||||
{
|
||||
for(i = 0; i < this.§_-Iv§; )
|
||||
{
|
||||
track = this.§_-cT§[i];
|
||||
if(track.object != null)
|
||||
{
|
||||
state = alternativa3d::controller.alternativa3d::getState(track.object);
|
||||
if(state != null)
|
||||
{
|
||||
track.alternativa3d::blend(this.§_-qC§,weight,state);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function get time() : Number
|
||||
{
|
||||
return this.§_-qC§;
|
||||
}
|
||||
|
||||
public function set time(value:Number) : void
|
||||
{
|
||||
this.§_-qC§ = value;
|
||||
}
|
||||
|
||||
public function get §_-SA§() : Number
|
||||
{
|
||||
return this.length == 0 ? 0 : this.§_-qC§ / this.length;
|
||||
}
|
||||
|
||||
public function set §_-SA§(value:Number) : void
|
||||
{
|
||||
this.§_-qC§ = value * this.length;
|
||||
}
|
||||
|
||||
private function §_-8I§(object:Object) : int
|
||||
{
|
||||
if(object is §_-OX§)
|
||||
{
|
||||
return §_-OX§(object).numChildren;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private function getChildAt(object:Object, index:int) : Object
|
||||
{
|
||||
if(object is §_-OX§)
|
||||
{
|
||||
return §_-OX§(object).getChildAt(index);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private function §_-Lo§(object:Object) : void
|
||||
{
|
||||
var child:Object = null;
|
||||
for(var i:int = 0,var numChildren:int = this.§_-8I§(object); i < numChildren; i++)
|
||||
{
|
||||
child = this.getChildAt(object,i);
|
||||
this.addObject(child);
|
||||
this.§_-Lo§(child);
|
||||
}
|
||||
}
|
||||
|
||||
public function §_-L6§(object:Object, includeDescendants:Boolean) : void
|
||||
{
|
||||
this.§_-R5§(this.alternativa3d::_-Kq,alternativa3d::controller,null,alternativa3d::controller);
|
||||
this.alternativa3d::_-Kq = null;
|
||||
this.addObject(object);
|
||||
if(includeDescendants)
|
||||
{
|
||||
this.§_-Lo§(object);
|
||||
}
|
||||
}
|
||||
|
||||
alternativa3d function §_-D3§(start:Number, end:Number) : void
|
||||
{
|
||||
for(var notify:§_-Re§ = this.§_-Ci§; notify != null; )
|
||||
{
|
||||
if(notify.alternativa3d::_-qC > start)
|
||||
{
|
||||
if(notify.alternativa3d::_-qC > end)
|
||||
{
|
||||
notify = notify.alternativa3d::next;
|
||||
continue;
|
||||
}
|
||||
notify.alternativa3d::_-XY = alternativa3d::controller.alternativa3d::nearestNotifyers;
|
||||
alternativa3d::controller.alternativa3d::nearestNotifyers = notify;
|
||||
}
|
||||
notify = notify.alternativa3d::next;
|
||||
}
|
||||
}
|
||||
|
||||
public function §_-Bn§(time:Number, name:String = null) : §_-Re§
|
||||
{
|
||||
var n:§_-Re§ = null;
|
||||
time = time <= 0 ? 0 : (time >= this.length ? this.length : time);
|
||||
var notify:§_-Re§ = new §_-Re§(name);
|
||||
notify.alternativa3d::_-qC = time;
|
||||
if(this.§_-Ci§ == null)
|
||||
{
|
||||
this.§_-Ci§ = notify;
|
||||
return notify;
|
||||
}
|
||||
if(this.§_-Ci§.alternativa3d::_-qC > time)
|
||||
{
|
||||
notify.alternativa3d::next = this.§_-Ci§;
|
||||
this.§_-Ci§ = notify;
|
||||
return notify;
|
||||
}
|
||||
n = this.§_-Ci§;
|
||||
while(n.alternativa3d::next != null && n.alternativa3d::next.alternativa3d::_-qC <= time)
|
||||
{
|
||||
n = n.alternativa3d::next;
|
||||
}
|
||||
if(n.alternativa3d::next == null)
|
||||
{
|
||||
n.alternativa3d::next = notify;
|
||||
}
|
||||
else
|
||||
{
|
||||
notify.alternativa3d::next = n.alternativa3d::next;
|
||||
n.alternativa3d::next = notify;
|
||||
}
|
||||
return notify;
|
||||
}
|
||||
|
||||
public function §_-VB§(offsetFromEnd:Number = 0, name:String = null) : §_-Re§
|
||||
{
|
||||
return this.§_-Bn§(this.length - offsetFromEnd,name);
|
||||
}
|
||||
|
||||
public function §_-LH§(notify:§_-Re§) : §_-Re§
|
||||
{
|
||||
var n:§_-Re§ = null;
|
||||
if(this.§_-Ci§ != null)
|
||||
{
|
||||
if(this.§_-Ci§ == notify)
|
||||
{
|
||||
this.§_-Ci§ = this.§_-Ci§.alternativa3d::next;
|
||||
return notify;
|
||||
}
|
||||
n = this.§_-Ci§;
|
||||
while(n.alternativa3d::next != null && n.alternativa3d::next != notify)
|
||||
{
|
||||
n = n.alternativa3d::next;
|
||||
}
|
||||
if(n.alternativa3d::next == notify)
|
||||
{
|
||||
n.alternativa3d::next = notify.alternativa3d::next;
|
||||
return notify;
|
||||
}
|
||||
}
|
||||
throw new Error("Notify not found");
|
||||
}
|
||||
|
||||
public function get §_-ZY§() : Vector.<§_-Re§>
|
||||
{
|
||||
var result:Vector.<§_-Re§> = new Vector.<§_-Re§>();
|
||||
var i:int = 0;
|
||||
for(var notify:§_-Re§ = this.§_-Ci§; notify != null; notify = notify.alternativa3d::next)
|
||||
{
|
||||
result[i] = notify;
|
||||
i++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function slice(start:Number, end:Number = 1.7976931348623157e+308) : §_-FA§
|
||||
{
|
||||
var sliced:§_-FA§ = new §_-FA§(this.name);
|
||||
sliced.alternativa3d::_-Kq = this.alternativa3d::_-Kq == null ? null : [].concat(this.alternativa3d::_-Kq);
|
||||
for(var i:int = 0; i < this.§_-Iv§; i++)
|
||||
{
|
||||
sliced.§_-nn§(this.§_-cT§[i].slice(start,end));
|
||||
}
|
||||
return sliced;
|
||||
}
|
||||
|
||||
public function clone() : §_-FA§
|
||||
{
|
||||
var cloned:§_-FA§ = new §_-FA§(this.name);
|
||||
cloned.alternativa3d::_-Kq = this.alternativa3d::_-Kq == null ? null : [].concat(this.alternativa3d::_-Kq);
|
||||
for(var i:int = 0; i < this.§_-Iv§; i++)
|
||||
{
|
||||
cloned.§_-nn§(this.§_-cT§[i]);
|
||||
}
|
||||
cloned.length = this.length;
|
||||
return cloned;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
package alternativa.tanks.game.entities.map
|
||||
package §_-RG§
|
||||
{
|
||||
import §_-1z§.§_-b1§;
|
||||
import §_-1z§.§_-gA§;
|
||||
import §_-1z§.§_-pi§;
|
||||
import §_-8D§.§_-Jo§;
|
||||
import §_-8D§.§_-OX§;
|
||||
import §_-8D§.§_-QF§;
|
||||
import §_-8D§.§_-WR§;
|
||||
import §_-8D§.§_-be§;
|
||||
import §_-8D§.§_-d6§;
|
||||
import §_-8D§.§_-jw§;
|
||||
import §_-Ex§.§_-a2§;
|
||||
import §_-M8§.§_-5§;
|
||||
import §_-M8§.§_-Xk§;
|
||||
import §_-M8§.§_-hR§;
|
||||
import §_-Vh§.§_-Pt§;
|
||||
import §_-Vh§.§_-b9§;
|
||||
import §_-Z2§.§_-ZC§;
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import avmplus.getQualifiedClassName;
|
||||
import flash.display.BitmapData;
|
||||
@@ -8,29 +25,12 @@ package alternativa.tanks.game.entities.map
|
||||
import flash.display3D.VertexBuffer3D;
|
||||
import flash.utils.Dictionary;
|
||||
import flash.utils.getDefinitionByName;
|
||||
import package_19.name_117;
|
||||
import package_21.name_116;
|
||||
import package_21.name_124;
|
||||
import package_21.name_126;
|
||||
import package_21.name_128;
|
||||
import package_21.name_135;
|
||||
import package_21.name_139;
|
||||
import package_21.name_78;
|
||||
import package_23.name_103;
|
||||
import package_28.name_119;
|
||||
import package_28.name_129;
|
||||
import package_28.name_93;
|
||||
import package_30.name_114;
|
||||
import package_30.name_115;
|
||||
import package_30.name_121;
|
||||
import package_4.class_4;
|
||||
import package_4.name_28;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class MapMaterial extends class_4
|
||||
public class §_-pE§ extends §_-b9§
|
||||
{
|
||||
private static var fogTexture:name_129;
|
||||
private static var fogTexture:§_-pi§;
|
||||
|
||||
public static const DISABLED:int = 0;
|
||||
|
||||
@@ -54,43 +54,43 @@ package alternativa.tanks.game.entities.map
|
||||
|
||||
private static var _programs:Dictionary = new Dictionary();
|
||||
|
||||
private static const getLightMapProcedure:name_114 = name_114.name_140(["#v0=vUV1","#s0=sLightMap","tex o0, v0, s0 <2d,repeat,linear,mipnone>"],"getLightMap");
|
||||
private static const getLightMapProcedure:§_-Xk§ = §_-Xk§.§_-En§(["#v0=vUV1","#s0=sLightMap","tex o0, v0, s0 <2d,repeat,linear,mipnone>"],"getLightMap");
|
||||
|
||||
private static const minShadowProcedure:name_114 = name_114.name_140(["min o0, o0, i0"],"minShadowProc");
|
||||
private static const minShadowProcedure:§_-Xk§ = §_-Xk§.§_-En§(["min o0, o0, i0"],"minShadowProc");
|
||||
|
||||
private static const mulShadowProcedure:name_114 = name_114.name_140(["mul o0, o0, i0"],"mulShadowProc");
|
||||
private static const mulShadowProcedure:§_-Xk§ = §_-Xk§.§_-En§(["mul o0, o0, i0"],"mulShadowProc");
|
||||
|
||||
private static const applyLightMapProcedure:name_114 = name_114.name_140(["add i1, i1, i1","mul i0.xyz, i0.xyz, i1.xyz","mov o0, i0"],"applyLightMap");
|
||||
private static const applyLightMapProcedure:§_-Xk§ = §_-Xk§.§_-En§(["add i1, i1, i1","mul i0.xyz, i0.xyz, i1.xyz","mov o0, i0"],"applyLightMap");
|
||||
|
||||
private static const _passLightMapUVProcedure:name_114 = new name_114(["#a0=aUV1","#v0=vUV1","mov v0, a0"],"passLightMapUV");
|
||||
private static const _passLightMapUVProcedure:§_-Xk§ = new §_-Xk§(["#a0=aUV1","#v0=vUV1","mov v0, a0"],"passLightMapUV");
|
||||
|
||||
private static const passSimpleFogConstProcedure:name_114 = new name_114(["#v0=vZDistance","#c0=cFogSpace","dp4 t0.z, i0, c0","mov v0, t0.zzzz","sub v0.y, i0.w, t0.z"],"passSimpleFogConst");
|
||||
private static const passSimpleFogConstProcedure:§_-Xk§ = new §_-Xk§(["#v0=vZDistance","#c0=cFogSpace","dp4 t0.z, i0, c0","mov v0, t0.zzzz","sub v0.y, i0.w, t0.z"],"passSimpleFogConst");
|
||||
|
||||
private static const applyLightMapAndSimpleFogProcedure:name_114 = new name_114(["#v0=vZDistance","#c0=cFogColor","#c1=cFogRange","add i1, i1, i1","mul i0.xyz, i0.xyz, i1.xyz","min t0.xy, v0.xy, c1.xy","max t0.xy, t0.xy, c1.zw","mul i0.xyz, i0.xyz, t0.y","mul t0.xyz, c0.xyz, t0.x","add i0.xyz, i0.xyz, t0.xyz","mov o0, i0"],"applyLightMapAndSimpleFog");
|
||||
private static const applyLightMapAndSimpleFogProcedure:§_-Xk§ = new §_-Xk§(["#v0=vZDistance","#c0=cFogColor","#c1=cFogRange","add i1, i1, i1","mul i0.xyz, i0.xyz, i1.xyz","min t0.xy, v0.xy, c1.xy","max t0.xy, t0.xy, c1.zw","mul i0.xyz, i0.xyz, t0.y","mul t0.xyz, c0.xyz, t0.x","add i0.xyz, i0.xyz, t0.xyz","mov o0, i0"],"applyLightMapAndSimpleFog");
|
||||
|
||||
private static const passAdvancedFogConstProcedure:name_114 = new name_114(["#v0=vZDistance","#c0=cFogSpace","dp4 t0.z, i0, c0","mov v0, t0.zzzz","sub v0.y, i0.w, t0.z","mov v0.zw, i1.xwxw","mov o0, i1"],"projAndPassAdvancedFogConst");
|
||||
private static const passAdvancedFogConstProcedure:§_-Xk§ = new §_-Xk§(["#v0=vZDistance","#c0=cFogSpace","dp4 t0.z, i0, c0","mov v0, t0.zzzz","sub v0.y, i0.w, t0.z","mov v0.zw, i1.xwxw","mov o0, i1"],"projAndPassAdvancedFogConst");
|
||||
|
||||
private static const applyLightMapAndAdvancedFogProcedure:name_114 = new name_114(["#v0=vZDistance","#c0=cFogConsts","#c1=cFogRange","#s0=sFogTexture","add i1, i1, i1","mul i0.xyz, i0.xyz, i1.xyz","min t0.xy, v0.xy, c1.xy","max t0.xy, t0.xy, c1.zw","mul i0.xyz, i0.xyz, t0.y","mov t1.xyzw, c0.yyzw","div t0.z, v0.z, v0.w","mul t0.z, t0.z, c0.x","add t1.x, t1.x, t0.z","tex t1, t1, s0 <2d, repeat, linear, miplinear>","mul t0.xyz, t1.xyz, t0.x","add i0.xyz, i0.xyz, t0.xyz","mov o0, i0"],"applyLightMapAndAdvancedFog");
|
||||
private static const applyLightMapAndAdvancedFogProcedure:§_-Xk§ = new §_-Xk§(["#v0=vZDistance","#c0=cFogConsts","#c1=cFogRange","#s0=sFogTexture","add i1, i1, i1","mul i0.xyz, i0.xyz, i1.xyz","min t0.xy, v0.xy, c1.xy","max t0.xy, t0.xy, c1.zw","mul i0.xyz, i0.xyz, t0.y","mov t1.xyzw, c0.yyzw","div t0.z, v0.z, v0.w","mul t0.z, t0.z, c0.x","add t1.x, t1.x, t0.z","tex t1, t1, s0 <2d, repeat, linear, miplinear>","mul t0.xyz, t1.xyz, t0.x","add i0.xyz, i0.xyz, t0.xyz","mov o0, i0"],"applyLightMapAndAdvancedFog");
|
||||
|
||||
alternativa3d static const outputOpacity:name_114 = new name_114(["#v0=vUV","#s0=sTexture","#s1=sOpacity","#c0=cAlpha","tex t0, v0, s0 <2d, linear,repeat, miplinear>","tex t1, v0, s1 <2d, linear,repeat, miplinear>","mov t0.w, t1.x","sub t1.x, t1.x, c0.w","kil t1.x","mov o0, t0"],"samplerSetProcedureOpacity");
|
||||
alternativa3d static const outputOpacity:§_-Xk§ = new §_-Xk§(["#v0=vUV","#s0=sTexture","#s1=sOpacity","#c0=cAlpha","tex t0, v0, s0 <2d, linear,repeat, miplinear>","tex t1, v0, s1 <2d, linear,repeat, miplinear>","mov t0.w, t1.x","sub t1.x, t1.x, c0.w","kil t1.x","mov o0, t0"],"samplerSetProcedureOpacity");
|
||||
|
||||
private static const passUVProcedure:name_114 = new name_114(["#v0=vUV","#a0=aUV","mov v0, a0"],"passUVProcedure");
|
||||
private static const passUVProcedure:§_-Xk§ = new §_-Xk§(["#v0=vUV","#a0=aUV","mov v0, a0"],"passUVProcedure");
|
||||
|
||||
private static const diffuseProcedure:name_114 = new name_114(["#v0=vUV","#s0=sTexture","#c0=cAlpha","tex t0, v0, s0 <2d, linear,repeat, miplinear>","mov t0.w, c0.w","mov o0, t0"],"diffuseProcedure");
|
||||
private static const diffuseProcedure:§_-Xk§ = new §_-Xk§(["#v0=vUV","#s0=sTexture","#c0=cAlpha","tex t0, v0, s0 <2d, linear,repeat, miplinear>","mov t0.w, c0.w","mov o0, t0"],"diffuseProcedure");
|
||||
|
||||
private static const diffuseOpacityProcedure:name_114 = new name_114(["#v0=vUV","#s0=sTexture","#s1=sOpacity","#c0=cAlpha","tex t0, v0, s0 <2d, linear,repeat, miplinear>","tex t1, v0, s1 <2d, linear,repeat, miplinear>","mov t0.w, t1.x","mul t0.w, t0.w, c0.w","mov o0, t0"],"diffuseOpacityProcedure");
|
||||
private static const diffuseOpacityProcedure:§_-Xk§ = new §_-Xk§(["#v0=vUV","#s0=sTexture","#s1=sOpacity","#c0=cAlpha","tex t0, v0, s0 <2d, linear,repeat, miplinear>","tex t1, v0, s1 <2d, linear,repeat, miplinear>","mov t0.w, t1.x","mul t0.w, t0.w, c0.w","mov o0, t0"],"diffuseOpacityProcedure");
|
||||
|
||||
public var diffuseMap:name_129;
|
||||
public var diffuseMap:§_-pi§;
|
||||
|
||||
public var lightMap:name_129;
|
||||
public var lightMap:§_-pi§;
|
||||
|
||||
public var lightMapChannel:uint = 0;
|
||||
|
||||
public var opacityMap:name_129;
|
||||
public var opacityMap:§_-pi§;
|
||||
|
||||
public var alpha:Number = 1;
|
||||
|
||||
public function MapMaterial(diffuseMap:name_129, lightMap:name_129, lightMapChannel:uint = 0, opacityMap:name_129 = null)
|
||||
public function §_-pE§(diffuseMap:§_-pi§, lightMap:§_-pi§, lightMapChannel:uint = 0, opacityMap:§_-pi§ = null)
|
||||
{
|
||||
super();
|
||||
this.diffuseMap = diffuseMap;
|
||||
@@ -99,7 +99,7 @@ package alternativa.tanks.game.entities.map
|
||||
this.opacityMap = opacityMap;
|
||||
}
|
||||
|
||||
public static function method_33(texture:name_129) : void
|
||||
public static function §_-RX§(texture:§_-pi§) : void
|
||||
{
|
||||
fogTexture = texture;
|
||||
}
|
||||
@@ -107,112 +107,112 @@ package alternativa.tanks.game.entities.map
|
||||
override alternativa3d function fillResources(resources:Dictionary, resourceType:Class) : void
|
||||
{
|
||||
super.alternativa3d::fillResources(resources,resourceType);
|
||||
if(this.diffuseMap != null && Boolean(name_28.alternativa3d::name_131(getDefinitionByName(getQualifiedClassName(this.diffuseMap)) as Class,resourceType)))
|
||||
if(this.diffuseMap != null && Boolean(§_-Pt§.alternativa3d::_-EU(getDefinitionByName(getQualifiedClassName(this.diffuseMap)) as Class,resourceType)))
|
||||
{
|
||||
resources[this.diffuseMap] = true;
|
||||
}
|
||||
if(this.lightMap != null && Boolean(name_28.alternativa3d::name_131(getDefinitionByName(getQualifiedClassName(this.lightMap)) as Class,resourceType)))
|
||||
if(this.lightMap != null && Boolean(§_-Pt§.alternativa3d::_-EU(getDefinitionByName(getQualifiedClassName(this.lightMap)) as Class,resourceType)))
|
||||
{
|
||||
resources[this.lightMap] = true;
|
||||
}
|
||||
if(this.opacityMap != null && Boolean(name_28.alternativa3d::name_131(getDefinitionByName(getQualifiedClassName(this.opacityMap)) as Class,resourceType)))
|
||||
if(this.opacityMap != null && Boolean(§_-Pt§.alternativa3d::_-EU(getDefinitionByName(getQualifiedClassName(this.opacityMap)) as Class,resourceType)))
|
||||
{
|
||||
resources[this.opacityMap] = true;
|
||||
}
|
||||
}
|
||||
|
||||
private function setupProgram(targetObject:name_78, shadows:Vector.<name_103>, numShadows:int) : MapMaterialProgram
|
||||
private function final(targetObject:§_-OX§, shadows:Vector.<§_-ZC§>, numShadows:int) : MapMaterialProgram
|
||||
{
|
||||
var i:int = 0;
|
||||
var renderer:name_103 = null;
|
||||
var sProc:name_114 = null;
|
||||
var vertexLinker:name_121 = new name_121(Context3DProgramType.VERTEX);
|
||||
var renderer:§_-ZC§ = null;
|
||||
var sProc:§_-Xk§ = null;
|
||||
var vertexLinker:§_-hR§ = new §_-hR§(Context3DProgramType.VERTEX);
|
||||
var positionVar:String = "aPosition";
|
||||
vertexLinker.name_120(positionVar,name_115.ATTRIBUTE);
|
||||
vertexLinker.§_-LU§(positionVar,§_-5§.ATTRIBUTE);
|
||||
if(targetObject.alternativa3d::transformProcedure != null)
|
||||
{
|
||||
positionVar = alternativa3d::method_74(targetObject.alternativa3d::transformProcedure,vertexLinker);
|
||||
positionVar = alternativa3d::_-di(targetObject.alternativa3d::transformProcedure,vertexLinker);
|
||||
}
|
||||
vertexLinker.name_123(alternativa3d::_projectProcedure);
|
||||
vertexLinker.name_118(alternativa3d::_projectProcedure,positionVar);
|
||||
vertexLinker.name_123(passUVProcedure);
|
||||
vertexLinker.name_123(_passLightMapUVProcedure);
|
||||
vertexLinker.§_-on§(alternativa3d::_projectProcedure);
|
||||
vertexLinker.§_-FS§(alternativa3d::_projectProcedure,positionVar);
|
||||
vertexLinker.§_-on§(passUVProcedure);
|
||||
vertexLinker.§_-on§(_passLightMapUVProcedure);
|
||||
if(fogMode == SIMPLE)
|
||||
{
|
||||
vertexLinker.name_123(passSimpleFogConstProcedure);
|
||||
vertexLinker.name_118(passSimpleFogConstProcedure,positionVar);
|
||||
vertexLinker.§_-on§(passSimpleFogConstProcedure);
|
||||
vertexLinker.§_-FS§(passSimpleFogConstProcedure,positionVar);
|
||||
}
|
||||
else if(fogMode == ADVANCED)
|
||||
{
|
||||
vertexLinker.name_120("tProjected");
|
||||
vertexLinker.name_125(alternativa3d::_projectProcedure,"tProjected");
|
||||
vertexLinker.name_123(passAdvancedFogConstProcedure);
|
||||
vertexLinker.name_118(passAdvancedFogConstProcedure,positionVar,"tProjected");
|
||||
vertexLinker.§_-LU§("tProjected");
|
||||
vertexLinker.§_-qd§(alternativa3d::_projectProcedure,"tProjected");
|
||||
vertexLinker.§_-on§(passAdvancedFogConstProcedure);
|
||||
vertexLinker.§_-FS§(passAdvancedFogConstProcedure,positionVar,"tProjected");
|
||||
}
|
||||
var fragmentLinker:name_121 = new name_121(Context3DProgramType.FRAGMENT);
|
||||
var procedure:name_114 = this.opacityMap == null ? diffuseProcedure : diffuseOpacityProcedure;
|
||||
fragmentLinker.name_120("tOutColor");
|
||||
fragmentLinker.name_123(procedure);
|
||||
fragmentLinker.name_125(procedure,"tOutColor");
|
||||
var fragmentLinker:§_-hR§ = new §_-hR§(Context3DProgramType.FRAGMENT);
|
||||
var procedure:§_-Xk§ = this.opacityMap == null ? diffuseProcedure : diffuseOpacityProcedure;
|
||||
fragmentLinker.§_-LU§("tOutColor");
|
||||
fragmentLinker.§_-on§(procedure);
|
||||
fragmentLinker.§_-qd§(procedure,"tOutColor");
|
||||
if(shadows != null)
|
||||
{
|
||||
fragmentLinker.name_120("tLight");
|
||||
fragmentLinker.name_123(getLightMapProcedure);
|
||||
fragmentLinker.name_125(getLightMapProcedure,"tLight");
|
||||
fragmentLinker.name_120("tShadow");
|
||||
fragmentLinker.§_-LU§("tLight");
|
||||
fragmentLinker.§_-on§(getLightMapProcedure);
|
||||
fragmentLinker.§_-qd§(getLightMapProcedure,"tLight");
|
||||
fragmentLinker.§_-LU§("tShadow");
|
||||
for(i = 0; i < numShadows; i++)
|
||||
{
|
||||
renderer = shadows[i];
|
||||
vertexLinker.name_123(renderer.getVShader(i));
|
||||
vertexLinker.§_-on§(renderer.getVShader(i));
|
||||
sProc = renderer.getFShader(i);
|
||||
fragmentLinker.name_123(sProc);
|
||||
fragmentLinker.name_125(sProc,"tShadow");
|
||||
if(renderer.alternativa3d::name_372)
|
||||
fragmentLinker.§_-on§(sProc);
|
||||
fragmentLinker.§_-qd§(sProc,"tShadow");
|
||||
if(renderer.alternativa3d::_-cu)
|
||||
{
|
||||
fragmentLinker.name_123(mulShadowProcedure);
|
||||
fragmentLinker.name_118(mulShadowProcedure,"tShadow");
|
||||
fragmentLinker.name_125(mulShadowProcedure,"tLight");
|
||||
fragmentLinker.§_-on§(mulShadowProcedure);
|
||||
fragmentLinker.§_-FS§(mulShadowProcedure,"tShadow");
|
||||
fragmentLinker.§_-qd§(mulShadowProcedure,"tLight");
|
||||
}
|
||||
else
|
||||
{
|
||||
fragmentLinker.name_123(minShadowProcedure);
|
||||
fragmentLinker.name_118(minShadowProcedure,"tShadow");
|
||||
fragmentLinker.name_125(minShadowProcedure,"tLight");
|
||||
fragmentLinker.§_-on§(minShadowProcedure);
|
||||
fragmentLinker.§_-FS§(minShadowProcedure,"tShadow");
|
||||
fragmentLinker.§_-qd§(minShadowProcedure,"tLight");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fragmentLinker.name_120("tLight");
|
||||
fragmentLinker.name_123(getLightMapProcedure);
|
||||
fragmentLinker.name_125(getLightMapProcedure,"tLight");
|
||||
fragmentLinker.§_-LU§("tLight");
|
||||
fragmentLinker.§_-on§(getLightMapProcedure);
|
||||
fragmentLinker.§_-qd§(getLightMapProcedure,"tLight");
|
||||
}
|
||||
if(fogMode == SIMPLE)
|
||||
{
|
||||
fragmentLinker.name_123(applyLightMapAndSimpleFogProcedure);
|
||||
fragmentLinker.name_118(applyLightMapAndSimpleFogProcedure,"tOutColor","tLight");
|
||||
fragmentLinker.§_-on§(applyLightMapAndSimpleFogProcedure);
|
||||
fragmentLinker.§_-FS§(applyLightMapAndSimpleFogProcedure,"tOutColor","tLight");
|
||||
}
|
||||
else if(fogMode == ADVANCED)
|
||||
{
|
||||
fragmentLinker.name_123(applyLightMapAndAdvancedFogProcedure);
|
||||
fragmentLinker.name_118(applyLightMapAndAdvancedFogProcedure,"tOutColor","tLight");
|
||||
fragmentLinker.§_-on§(applyLightMapAndAdvancedFogProcedure);
|
||||
fragmentLinker.§_-FS§(applyLightMapAndAdvancedFogProcedure,"tOutColor","tLight");
|
||||
}
|
||||
else
|
||||
{
|
||||
fragmentLinker.name_123(applyLightMapProcedure);
|
||||
fragmentLinker.name_118(applyLightMapProcedure,"tOutColor","tLight");
|
||||
fragmentLinker.§_-on§(applyLightMapProcedure);
|
||||
fragmentLinker.§_-FS§(applyLightMapProcedure,"tOutColor","tLight");
|
||||
}
|
||||
fragmentLinker.name_133(vertexLinker);
|
||||
fragmentLinker.§_-NA§(vertexLinker);
|
||||
return new MapMaterialProgram(vertexLinker,fragmentLinker);
|
||||
}
|
||||
|
||||
override alternativa3d function collectDraws(camera:name_124, surface:name_117, geometry:name_119, lights:Vector.<name_116>, lightsLength:int, objectRenderPriority:int = -1) : void
|
||||
override alternativa3d function collectDraws(camera:§_-be§, surface:§_-a2§, geometry:§_-gA§, lights:Vector.<§_-Jo§>, lightsLength:int, objectRenderPriority:int = -1) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var renderer:name_103 = null;
|
||||
var lm:name_139 = null;
|
||||
var renderer:§_-ZC§ = null;
|
||||
var lm:§_-jw§ = null;
|
||||
var dist:Number = NaN;
|
||||
var cLocal:name_139 = null;
|
||||
var cLocal:§_-jw§ = null;
|
||||
var halfW:Number = NaN;
|
||||
var leftX:Number = NaN;
|
||||
var leftY:Number = NaN;
|
||||
@@ -233,14 +233,14 @@ package alternativa.tanks.game.entities.map
|
||||
{
|
||||
return;
|
||||
}
|
||||
var positionBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(name_126.POSITION);
|
||||
var uvBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(name_126.TEXCOORDS[0]);
|
||||
var lightMapUVBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(name_126.TEXCOORDS[this.lightMapChannel]);
|
||||
var positionBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(§_-d6§.POSITION);
|
||||
var uvBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(§_-d6§.TEXCOORDS[0]);
|
||||
var lightMapUVBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(§_-d6§.TEXCOORDS[this.lightMapChannel]);
|
||||
if(positionBuffer == null || uvBuffer == null || lightMapUVBuffer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var object:name_78 = surface.alternativa3d::object;
|
||||
var object:§_-OX§ = surface.alternativa3d::object;
|
||||
var optionsPrograms:Vector.<MapMaterialProgram> = _programs[object.alternativa3d::transformProcedure];
|
||||
if(optionsPrograms == null)
|
||||
{
|
||||
@@ -257,17 +257,17 @@ package alternativa.tanks.game.entities.map
|
||||
var program:MapMaterialProgram = optionsPrograms[index];
|
||||
if(program == null)
|
||||
{
|
||||
program = this.setupProgram(object,object.alternativa3d::shadowRenderers,numShadows);
|
||||
program = this.final(object,object.alternativa3d::shadowRenderers,numShadows);
|
||||
program.upload(camera.alternativa3d::context3D);
|
||||
optionsPrograms[index] = program;
|
||||
}
|
||||
var drawUnit:name_135 = camera.alternativa3d::renderer.alternativa3d::name_137(object,program.program,geometry.alternativa3d::name_132,surface.indexBegin,surface.numTriangles,program);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.aPosition,positionBuffer,geometry.alternativa3d::_attributesOffsets[name_126.POSITION],name_126.alternativa3d::FORMATS[name_126.POSITION]);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.aUV,uvBuffer,geometry.alternativa3d::_attributesOffsets[name_126.TEXCOORDS[0]],name_126.alternativa3d::FORMATS[name_126.TEXCOORDS[0]]);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.aUV1,lightMapUVBuffer,geometry.alternativa3d::_attributesOffsets[name_126.TEXCOORDS[this.lightMapChannel]],name_126.alternativa3d::FORMATS[name_126.TEXCOORDS[this.lightMapChannel]]);
|
||||
var drawUnit:§_-QF§ = camera.alternativa3d::renderer.alternativa3d::_-2s(object,program.program,geometry.alternativa3d::_-EM,surface.indexBegin,surface.numTriangles,program);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.aPosition,positionBuffer,geometry.alternativa3d::_attributesOffsets[§_-d6§.POSITION],§_-d6§.alternativa3d::FORMATS[§_-d6§.POSITION]);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.aUV,uvBuffer,geometry.alternativa3d::_attributesOffsets[§_-d6§.TEXCOORDS[0]],§_-d6§.alternativa3d::FORMATS[§_-d6§.TEXCOORDS[0]]);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.aUV1,lightMapUVBuffer,geometry.alternativa3d::_attributesOffsets[§_-d6§.TEXCOORDS[this.lightMapChannel]],§_-d6§.alternativa3d::FORMATS[§_-d6§.TEXCOORDS[this.lightMapChannel]]);
|
||||
object.alternativa3d::setTransformConstants(drawUnit,surface,program.vertexShader,camera);
|
||||
drawUnit.alternativa3d::name_136(camera,program.cProjMatrix,object.alternativa3d::localToCameraTransform);
|
||||
drawUnit.alternativa3d::name_134(program.cAlpha,0,0,0,this.alpha);
|
||||
drawUnit.alternativa3d::_-mQ(camera,program.cProjMatrix,object.alternativa3d::localToCameraTransform);
|
||||
drawUnit.alternativa3d::_-Ry(program.cAlpha,0,0,0,this.alpha);
|
||||
drawUnit.alternativa3d::setTextureAt(program.sTexture,this.diffuseMap.alternativa3d::_texture);
|
||||
drawUnit.alternativa3d::setTextureAt(program.sLightMap,this.lightMap.alternativa3d::_texture);
|
||||
if(this.opacityMap != null)
|
||||
@@ -284,12 +284,12 @@ package alternativa.tanks.game.entities.map
|
||||
{
|
||||
lm = object.alternativa3d::localToCameraTransform;
|
||||
dist = fogFar - fogNear;
|
||||
drawUnit.alternativa3d::name_144(program.cFogSpace,lm.i / dist,lm.j / dist,lm.k / dist,(lm.l - fogNear) / dist);
|
||||
drawUnit.alternativa3d::name_134(program.cFogRange,fogMaxDensity,1,0,1 - fogMaxDensity);
|
||||
drawUnit.alternativa3d:: if(program.cFogSpace,lm.i / dist,lm.j / dist,lm.k / dist,(lm.l - fogNear) / dist);
|
||||
drawUnit.alternativa3d::_-Ry(program.cFogRange,fogMaxDensity,1,0,1 - fogMaxDensity);
|
||||
}
|
||||
if(fogMode == SIMPLE)
|
||||
{
|
||||
drawUnit.alternativa3d::name_134(program.cFogColor,fogColorR,fogColorG,fogColorB);
|
||||
drawUnit.alternativa3d::_-Ry(program.cFogColor,fogColorR,fogColorG,fogColorB);
|
||||
}
|
||||
if(fogMode == ADVANCED)
|
||||
{
|
||||
@@ -300,7 +300,7 @@ package alternativa.tanks.game.entities.map
|
||||
{
|
||||
bmd.setPixel(i,0,i / 32 * 255 << 16);
|
||||
}
|
||||
fogTexture = new name_93(bmd);
|
||||
fogTexture = new §_-b1§(bmd);
|
||||
fogTexture.upload(camera.alternativa3d::context3D);
|
||||
}
|
||||
cLocal = camera.alternativa3d::localToGlobalTransform;
|
||||
@@ -323,27 +323,27 @@ package alternativa.tanks.game.entities.map
|
||||
rightY /= len;
|
||||
uScale = Math.acos(leftX * rightX + leftY * rightY) / Math.PI / 2;
|
||||
uRight = angle / Math.PI / 2;
|
||||
drawUnit.alternativa3d::name_134(program.cFogConsts,0.5 * uScale,0.5 - uRight,0);
|
||||
drawUnit.alternativa3d::_-Ry(program.cFogConsts,0.5 * uScale,0.5 - uRight,0);
|
||||
drawUnit.alternativa3d::setTextureAt(program.sFogTexture,fogTexture.alternativa3d::_texture);
|
||||
}
|
||||
if(this.opacityMap != null || this.alpha < 1)
|
||||
{
|
||||
drawUnit.alternativa3d::blendSource = Context3DBlendFactor.SOURCE_ALPHA;
|
||||
drawUnit.alternativa3d::blendDestination = Context3DBlendFactor.ONE_MINUS_SOURCE_ALPHA;
|
||||
camera.alternativa3d::renderer.alternativa3d::name_130(drawUnit,objectRenderPriority >= 0 ? objectRenderPriority : name_128.TRANSPARENT_SORT);
|
||||
camera.alternativa3d::renderer.alternativa3d::_-SH(drawUnit,objectRenderPriority >= 0 ? objectRenderPriority : int(§_-WR§.TRANSPARENT_SORT));
|
||||
}
|
||||
else
|
||||
{
|
||||
camera.alternativa3d::renderer.alternativa3d::name_130(drawUnit,objectRenderPriority >= 0 ? objectRenderPriority : name_128.OPAQUE);
|
||||
camera.alternativa3d::renderer.alternativa3d::_-SH(drawUnit,objectRenderPriority >= 0 ? objectRenderPriority : int(§_-WR§.OPAQUE));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import package_30.name_121;
|
||||
import package_4.name_127;
|
||||
import §_-M8§.§_-hR§;
|
||||
import §_-Vh§.§_-RB§;
|
||||
|
||||
class MapMaterialProgram extends name_127
|
||||
class MapMaterialProgram extends §_-RB§
|
||||
{
|
||||
public var aPosition:int;
|
||||
|
||||
@@ -371,21 +371,21 @@ class MapMaterialProgram extends name_127
|
||||
|
||||
public var sFogTexture:int;
|
||||
|
||||
public function MapMaterialProgram(vertex:name_121, fragment:name_121)
|
||||
public function MapMaterialProgram(vertex:§_-hR§, fragment:§_-hR§)
|
||||
{
|
||||
super(vertex,fragment);
|
||||
this.aPosition = vertex.name_207("aPosition");
|
||||
this.aUV = vertex.name_207("aUV");
|
||||
this.aUV1 = vertex.name_207("aUV1");
|
||||
this.cProjMatrix = vertex.name_207("cProjMatrix");
|
||||
this.cAlpha = fragment.name_207("cAlpha");
|
||||
this.sTexture = fragment.name_207("sTexture");
|
||||
this.sLightMap = fragment.name_207("sLightMap");
|
||||
this.sOpacity = fragment.name_207("sOpacity");
|
||||
this.cFogSpace = vertex.name_207("cFogSpace");
|
||||
this.cFogRange = fragment.name_207("cFogRange");
|
||||
this.cFogColor = fragment.name_207("cFogColor");
|
||||
this.cFogConsts = fragment.name_207("cFogConsts");
|
||||
this.sFogTexture = fragment.name_207("sFogTexture");
|
||||
this.aPosition = vertex.§_-Dj§("aPosition");
|
||||
this.aUV = vertex.§_-Dj§("aUV");
|
||||
this.aUV1 = vertex.§_-Dj§("aUV1");
|
||||
this.cProjMatrix = vertex.§_-Dj§("cProjMatrix");
|
||||
this.cAlpha = fragment.§_-Dj§("cAlpha");
|
||||
this.sTexture = fragment.§_-Dj§("sTexture");
|
||||
this.sLightMap = fragment.§_-Dj§("sLightMap");
|
||||
this.sOpacity = fragment.§_-Dj§("sOpacity");
|
||||
this.cFogSpace = vertex.§_-Dj§("cFogSpace");
|
||||
this.cFogRange = fragment.§_-Dj§("cFogRange");
|
||||
this.cFogColor = fragment.§_-Dj§("cFogColor");
|
||||
this.cFogConsts = fragment.§_-Dj§("cFogConsts");
|
||||
this.sFogTexture = fragment.§_-Dj§("sFogTexture");
|
||||
}
|
||||
}
|
||||
444
src/?_-RG?/A3DMapBuilder.as
Normal file
@@ -0,0 +1,444 @@
|
||||
package §_-RG§
|
||||
{
|
||||
import §_-1e§.§_-Nh§;
|
||||
import §_-1z§.§_-KJ§;
|
||||
import §_-1z§.§_-VF§;
|
||||
import §_-1z§.§_-b1§;
|
||||
import §_-1z§.§_-n4§;
|
||||
import §_-1z§.§_-pi§;
|
||||
import §_-8D§.§_-Jo§;
|
||||
import §_-8D§.§_-OX§;
|
||||
import §_-Ex§.§_-8f§;
|
||||
import §_-Ex§.§_-U2§;
|
||||
import §_-Ex§.§_-a2§;
|
||||
import §_-O5§.§_-Hk§;
|
||||
import §_-V-§.§_-Q4§;
|
||||
import §_-V-§.§_-Ui§;
|
||||
import §_-Vh§.§_-18§;
|
||||
import §_-Yj§.§_-4X§;
|
||||
import §_-am§.§_-Fh§;
|
||||
import §_-am§.§_-Jd§;
|
||||
import §_-am§.§_-qn§;
|
||||
import §_-fT§.§_-HM§;
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import flash.display.BitmapData;
|
||||
import flash.events.Event;
|
||||
import flash.events.EventDispatcher;
|
||||
import flash.utils.ByteArray;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class A3DMapBuilder extends EventDispatcher
|
||||
{
|
||||
public static const MAIN_FILE:String = "main.a3d";
|
||||
|
||||
public static const ADDITIONAL_FILES_START:String = "part";
|
||||
|
||||
public static const TREES_FILE:String = "trees.a3d";
|
||||
|
||||
public static const MARKET_FILE:String = "market.a3d";
|
||||
|
||||
public static const PHYSICS_FILE:String = "physics.a3d";
|
||||
|
||||
public static const BEAMS_FILE:String = "beams.a3d";
|
||||
|
||||
public static const LIGHTS_FILE:String = "lights.dae";
|
||||
|
||||
private static const COLLISION_MASK:int = 255;
|
||||
|
||||
private static var fakeEmissionTextureResource:§_-b1§ = new §_-b1§(new BitmapData(1,1,false,8355711));
|
||||
|
||||
private static var fakeBumpTextureResource:§_-b1§ = new §_-b1§(new BitmapData(1,1,false,8355839));
|
||||
|
||||
private var §_-Kq§:Vector.<§_-OX§> = new Vector.<§_-OX§>();
|
||||
|
||||
private var §_-73§:Vector.<§_-Nh§>;
|
||||
|
||||
private var §_-9k§:Vector.<§_-Jo§>;
|
||||
|
||||
private var §_-Gv§:Vector.<§_-8f§> = new Vector.<§_-8f§>();
|
||||
|
||||
private var §_-ah§:§_-Ui§;
|
||||
|
||||
private var mapFiles:§_-Hk§;
|
||||
|
||||
private var collector:Vector.<§_-OX§>;
|
||||
|
||||
private var §_-TE§:§_-VF§ = new §_-VF§(new BitmapData(1,1,false,16711680),new BitmapData(1,1,false,16711680),new BitmapData(1,1,false,16711680),new BitmapData(1,1,false,16711680),new BitmapData(1,1,false,16711680),new BitmapData(1,1,false,16711680));
|
||||
|
||||
public function A3DMapBuilder()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get objects() : Vector.<§_-OX§>
|
||||
{
|
||||
return this.§_-Kq§;
|
||||
}
|
||||
|
||||
public function get collisionPrimitives() : Vector.<§_-Nh§>
|
||||
{
|
||||
return this.§_-73§;
|
||||
}
|
||||
|
||||
public function get lights() : Vector.<§_-Jo§>
|
||||
{
|
||||
return this.§_-9k§;
|
||||
}
|
||||
|
||||
public function get decals() : Vector.<§_-8f§>
|
||||
{
|
||||
return this.§_-Gv§;
|
||||
}
|
||||
|
||||
public function §_-Q7§(mapFiles:§_-Hk§) : void
|
||||
{
|
||||
var geometryFileName:String = null;
|
||||
this.mapFiles = mapFiles;
|
||||
var mapGeometryFiles:Vector.<String> = this.§_-VG§(mapFiles);
|
||||
this.collector = new Vector.<§_-OX§>();
|
||||
this.§_-ah§ = new §_-Ui§();
|
||||
for each(geometryFileName in mapGeometryFiles)
|
||||
{
|
||||
this.§_-ah§.addTask(new GeometryBuildTask(mapFiles.§_-HG§(geometryFileName),this.collector));
|
||||
}
|
||||
this.§_-ah§.addEventListener(Event.COMPLETE,this.§_-OY§);
|
||||
this.§_-ah§.run();
|
||||
}
|
||||
|
||||
private function §_-OY§(event:Event) : void
|
||||
{
|
||||
var surface:§_-a2§ = null;
|
||||
var object:§_-OX§ = null;
|
||||
var mesh:§_-U2§ = null;
|
||||
var meshName:String = null;
|
||||
var decal:§_-8f§ = null;
|
||||
var resourceCache:Object = {};
|
||||
for each(object in this.collector)
|
||||
{
|
||||
mesh = object as §_-U2§;
|
||||
if(mesh != null)
|
||||
{
|
||||
meshName = mesh.name.toLowerCase();
|
||||
if(meshName.indexOf("decal") >= 0)
|
||||
{
|
||||
decal = new §_-8f§(1.5);
|
||||
decal.name = meshName;
|
||||
decal.useShadow = true;
|
||||
decal.geometry = mesh.geometry;
|
||||
decal.alternativa3d::_-eW = mesh.alternativa3d::_-eW;
|
||||
decal.alternativa3d::_-Oy = mesh.alternativa3d::_-Oy;
|
||||
for each(surface in decal.alternativa3d::_-eW)
|
||||
{
|
||||
surface.alternativa3d::object = decal;
|
||||
}
|
||||
decal.boundBox = mesh.boundBox;
|
||||
decal.matrix = mesh.matrix;
|
||||
mesh = decal;
|
||||
this.§_-Gv§.push(decal);
|
||||
}
|
||||
mesh.calculateBoundBox();
|
||||
this.§_-Gj§(mesh,resourceCache);
|
||||
this.§_-Kq§.push(mesh);
|
||||
}
|
||||
}
|
||||
this.collector = null;
|
||||
this.§_-ah§ = null;
|
||||
this.§_-gU§(this.mapFiles.§_-HG§(TREES_FILE));
|
||||
this.§_-hj§(this.mapFiles.§_-HG§(MARKET_FILE));
|
||||
this.§_-1o§(this.mapFiles.§_-HG§(BEAMS_FILE));
|
||||
this.§_-F0§(this.mapFiles.§_-HG§(LIGHTS_FILE));
|
||||
this.§_-et§(this.mapFiles.§_-HG§(PHYSICS_FILE));
|
||||
dispatchEvent(new Event(Event.COMPLETE));
|
||||
}
|
||||
|
||||
private function §_-hj§(data:ByteArray) : void
|
||||
{
|
||||
var parser:§_-Fh§ = null;
|
||||
var resourceCache:Object = null;
|
||||
var object:§_-OX§ = null;
|
||||
var mesh:§_-U2§ = null;
|
||||
var i:int = 0;
|
||||
var surface:§_-a2§ = null;
|
||||
var material:§_-qn§ = null;
|
||||
var diffName:String = null;
|
||||
var diffuse:§_-pi§ = null;
|
||||
var bump:§_-pi§ = null;
|
||||
var opacity:§_-pi§ = null;
|
||||
var emission:§_-pi§ = null;
|
||||
var reflection:§_-pi§ = null;
|
||||
var envMaterial:§_-18§ = null;
|
||||
if(data != null)
|
||||
{
|
||||
parser = new §_-Fh§();
|
||||
parser.§_-Om§(data);
|
||||
resourceCache = {};
|
||||
for each(object in parser.objects)
|
||||
{
|
||||
mesh = object as §_-U2§;
|
||||
if(mesh != null)
|
||||
{
|
||||
for(i = 0; i < mesh.§_-hT§; )
|
||||
{
|
||||
surface = mesh.§_-Hq§(i);
|
||||
if(surface.material != null)
|
||||
{
|
||||
material = §_-qn§(surface.material);
|
||||
diffName = §_-n4§(material.textures["diffuse"]).url;
|
||||
diffuse = this.§_-kb§(material.textures["diffuse"],resourceCache,this.mapFiles);
|
||||
bump = this.§_-kb§(material.textures["bump"],resourceCache,this.mapFiles);
|
||||
opacity = this.§_-kb§(material.textures["transparent"],resourceCache,this.mapFiles);
|
||||
emission = this.§_-kb§(material.textures["emission"],resourceCache,this.mapFiles);
|
||||
if(diffName.indexOf("vetrino01") >= 0)
|
||||
{
|
||||
reflection = this.§_-kb§(new §_-n4§("vetrino_rfl.atf"),resourceCache,this.mapFiles);
|
||||
envMaterial = new §_-18§(diffuse,this.§_-TE§,null,reflection,emission,opacity);
|
||||
envMaterial.reflection = 0.4;
|
||||
surface.material = envMaterial;
|
||||
}
|
||||
else
|
||||
{
|
||||
surface.material = new §_-pE§(diffuse,emission,1,opacity);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
this.§_-Kq§.push(mesh);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-Gj§(mesh:§_-U2§, resourceCache:Object) : void
|
||||
{
|
||||
var surface:§_-a2§ = null;
|
||||
var parserMaterial:§_-qn§ = null;
|
||||
var diffuseTextureResource:§_-pi§ = null;
|
||||
var emissionTextureResource:§_-pi§ = null;
|
||||
var opacityTextureResource:§_-pi§ = null;
|
||||
var material:§_-pE§ = null;
|
||||
for each(surface in mesh.alternativa3d::_-eW)
|
||||
{
|
||||
parserMaterial = surface.material as §_-qn§;
|
||||
if(parserMaterial != null)
|
||||
{
|
||||
diffuseTextureResource = this.§_-kb§(parserMaterial.textures["diffuse"],resourceCache,this.mapFiles);
|
||||
emissionTextureResource = this.§_-kb§(parserMaterial.textures["emission"],resourceCache,this.mapFiles);
|
||||
opacityTextureResource = this.§_-kb§(parserMaterial.textures["transparent"],resourceCache,this.mapFiles);
|
||||
if(emissionTextureResource == null)
|
||||
{
|
||||
material = new §_-pE§(diffuseTextureResource,fakeEmissionTextureResource,0,opacityTextureResource);
|
||||
}
|
||||
else
|
||||
{
|
||||
material = new §_-pE§(diffuseTextureResource,emissionTextureResource,1,opacityTextureResource);
|
||||
}
|
||||
surface.material = material;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-VG§(mapFiles:§_-Hk§) : Vector.<String>
|
||||
{
|
||||
var name:String = null;
|
||||
var names:Vector.<String> = new Vector.<String>();
|
||||
names.push(MAIN_FILE);
|
||||
for(name in mapFiles.data)
|
||||
{
|
||||
if(name.indexOf(ADDITIONAL_FILES_START) == 0 && name.indexOf(".a3d") > 0)
|
||||
{
|
||||
names.push(name);
|
||||
}
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
private function §_-gU§(data:ByteArray) : void
|
||||
{
|
||||
var parser:§_-Fh§ = null;
|
||||
var resourceCache:Object = null;
|
||||
var object:§_-OX§ = null;
|
||||
var mesh:§_-U2§ = null;
|
||||
var i:int = 0;
|
||||
var surface:§_-a2§ = null;
|
||||
var material:§_-qn§ = null;
|
||||
var diffuse:§_-pi§ = null;
|
||||
var bump:§_-pi§ = null;
|
||||
var opacity:§_-pi§ = null;
|
||||
var trMaterial:§_-4X§ = null;
|
||||
if(data != null)
|
||||
{
|
||||
parser = new §_-Fh§();
|
||||
parser.§_-Om§(data);
|
||||
resourceCache = {};
|
||||
for each(object in parser.objects)
|
||||
{
|
||||
mesh = object as §_-U2§;
|
||||
if(mesh != null)
|
||||
{
|
||||
for(i = 0; i < mesh.§_-hT§; )
|
||||
{
|
||||
surface = mesh.§_-Hq§(i);
|
||||
if(surface.material != null)
|
||||
{
|
||||
material = §_-qn§(surface.material);
|
||||
diffuse = this.§_-kb§(material.textures["diffuse"],resourceCache,this.mapFiles);
|
||||
bump = this.§_-kb§(material.textures["bump"],resourceCache,this.mapFiles);
|
||||
opacity = this.§_-kb§(material.textures["transparent"],resourceCache,this.mapFiles);
|
||||
trMaterial = new §_-4X§(diffuse,fakeBumpTextureResource,null,null,opacity);
|
||||
trMaterial.§_-kj§ = 0;
|
||||
trMaterial.alphaThreshold = 0.2;
|
||||
surface.material = trMaterial;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
this.§_-Kq§.push(mesh);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-1o§(data:ByteArray) : void
|
||||
{
|
||||
var object:§_-OX§ = null;
|
||||
var mesh:§_-U2§ = null;
|
||||
var i:int = 0;
|
||||
var surface:§_-a2§ = null;
|
||||
var material:§_-qn§ = null;
|
||||
var diffuse:§_-pi§ = null;
|
||||
var opacity:§_-pi§ = null;
|
||||
if(data == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var parser:§_-Fh§ = new §_-Fh§();
|
||||
parser.§_-Om§(data);
|
||||
var resourceCache:Object = {};
|
||||
for each(object in parser.objects)
|
||||
{
|
||||
mesh = object as §_-U2§;
|
||||
if(mesh != null)
|
||||
{
|
||||
for(i = 0; i < mesh.§_-hT§; )
|
||||
{
|
||||
surface = mesh.§_-Hq§(i);
|
||||
if(surface.material != null)
|
||||
{
|
||||
material = §_-qn§(surface.material);
|
||||
diffuse = this.§_-kb§(material.textures["diffuse"],resourceCache,this.mapFiles);
|
||||
opacity = this.§_-kb§(material.textures["transparent"],resourceCache,this.mapFiles);
|
||||
surface.material = new §_-Au§(opacity);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
this.§_-Kq§.push(mesh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-F0§(lightsData:ByteArray) : void
|
||||
{
|
||||
var parserCollada:§_-Jd§ = null;
|
||||
var numLights:uint = 0;
|
||||
var i:int = 0;
|
||||
if(lightsData != null)
|
||||
{
|
||||
parserCollada = new §_-Jd§();
|
||||
parserCollada.§_-Om§(XML(lightsData.toString()));
|
||||
numLights = uint(parserCollada.lights.length);
|
||||
this.§_-9k§ = new Vector.<§_-Jo§>(numLights);
|
||||
for(i = 0; i < numLights; i++)
|
||||
{
|
||||
this.§_-9k§[i] = parserCollada.lights[i];
|
||||
§_-Jo§(this.§_-9k§[i]).alternativa3d::removeFromParent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-kb§(fileTextureResource:§_-n4§, resourceCache:Object, mapFiles:§_-Hk§) : §_-KJ§
|
||||
{
|
||||
var textureName:String = null;
|
||||
var resource:§_-KJ§ = null;
|
||||
var textureData:ByteArray = null;
|
||||
if(fileTextureResource != null && Boolean(fileTextureResource.url))
|
||||
{
|
||||
textureName = fileTextureResource.url.toLowerCase();
|
||||
textureName = textureName.replace(".png",".atf");
|
||||
textureName = textureName.replace(".jpg",".atf");
|
||||
if(mapFiles.§_-HG§(textureName) != null)
|
||||
{
|
||||
resource = resourceCache[textureName];
|
||||
if(resource == null)
|
||||
{
|
||||
textureData = mapFiles.§_-HG§(textureName);
|
||||
resource = new §_-KJ§(textureData);
|
||||
resourceCache[textureName] = resource;
|
||||
}
|
||||
return resource;
|
||||
}
|
||||
trace("[WARN] texture not found:",fileTextureResource.url.toLowerCase());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private function §_-et§(a3dData:ByteArray) : void
|
||||
{
|
||||
var object:§_-OX§ = null;
|
||||
var objectName:String = null;
|
||||
var parserA3D:§_-Fh§ = new §_-Fh§();
|
||||
parserA3D.§_-Om§(a3dData);
|
||||
this.§_-73§ = new Vector.<§_-Nh§>();
|
||||
for each(object in parserA3D.objects)
|
||||
{
|
||||
if(object is §_-U2§)
|
||||
{
|
||||
objectName = object.name.toLowerCase();
|
||||
if(objectName.indexOf("tri") == 0)
|
||||
{
|
||||
§_-Q4§.§_-eU§(§_-U2§(object),this.§_-73§,§_-HM§.STATIC,COLLISION_MASK);
|
||||
}
|
||||
else if(objectName.indexOf("box") == 0)
|
||||
{
|
||||
§_-Q4§.§_-MS§(§_-U2§(object),this.§_-73§,§_-HM§.STATIC,COLLISION_MASK);
|
||||
}
|
||||
else if(objectName.indexOf("plane") == 0)
|
||||
{
|
||||
§_-Q4§.§_-4D§(§_-U2§(object),this.§_-73§,§_-HM§.STATIC,COLLISION_MASK);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import §_-8D§.§_-OX§;
|
||||
import §_-V-§.§_-h5§;
|
||||
import §_-am§.§_-Fh§;
|
||||
import flash.utils.ByteArray;
|
||||
import flash.utils.setTimeout;
|
||||
|
||||
class GeometryBuildTask extends §_-h5§
|
||||
{
|
||||
private var data:ByteArray;
|
||||
|
||||
private var collector:Vector.<§_-OX§>;
|
||||
|
||||
public function GeometryBuildTask(data:ByteArray, collector:Vector.<§_-OX§>)
|
||||
{
|
||||
super();
|
||||
this.data = data;
|
||||
this.collector = collector;
|
||||
}
|
||||
|
||||
override public function run() : void
|
||||
{
|
||||
var object:§_-OX§ = null;
|
||||
var parser:§_-Fh§ = new §_-Fh§();
|
||||
parser.§_-Om§(this.data);
|
||||
for each(object in parser.objects)
|
||||
{
|
||||
this.collector.push(object);
|
||||
}
|
||||
setTimeout(§_-3Z§,0);
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,26 @@
|
||||
package alternativa.osgi
|
||||
package §_-Uy§
|
||||
{
|
||||
import §_-HW§.§_-C§;
|
||||
import §_-HW§.§_-pF§;
|
||||
import §_-MU§.§_-bV§;
|
||||
import flash.utils.Dictionary;
|
||||
import flash.utils.getQualifiedClassName;
|
||||
import package_31.class_6;
|
||||
import package_31.name_202;
|
||||
import package_39.name_203;
|
||||
|
||||
public class OSGi
|
||||
public class §_-oP§
|
||||
{
|
||||
public static var clientLog:name_203;
|
||||
public static var clientLog:§_-bV§;
|
||||
|
||||
private static var instance:OSGi;
|
||||
private static var instance:§_-oP§;
|
||||
|
||||
private static const LOG_CHANNEL:String = "osgi";
|
||||
|
||||
private var var_52:Object = {};
|
||||
private var §_-2M§:Object = {};
|
||||
|
||||
private var services:Dictionary = new Dictionary();
|
||||
|
||||
private var var_51:Dictionary = new Dictionary();
|
||||
private var §_-dp§:Dictionary = new Dictionary();
|
||||
|
||||
public function OSGi()
|
||||
public function §_-oP§()
|
||||
{
|
||||
super();
|
||||
if(instance == null)
|
||||
@@ -31,21 +31,21 @@ package alternativa.osgi
|
||||
throw new Error("Only one instance of OSGi class is allowed");
|
||||
}
|
||||
|
||||
public static function name_8() : OSGi
|
||||
public static function §_-nQ§() : §_-oP§
|
||||
{
|
||||
return instance;
|
||||
}
|
||||
|
||||
public function method_121(bundleDescriptor:name_202) : void
|
||||
public function §_-XK§(bundleDescriptor:§_-C§) : void
|
||||
{
|
||||
var activators:Vector.<class_6> = null;
|
||||
var activators:Vector.<§_-pF§> = null;
|
||||
var i:int = 0;
|
||||
var activator:class_6 = null;
|
||||
if(this.var_52[bundleDescriptor.name] == null)
|
||||
var activator:§_-pF§ = null;
|
||||
if(this.§_-2M§[bundleDescriptor.name] == null)
|
||||
{
|
||||
clientLog.log(LOG_CHANNEL,"Installing bundle %1",bundleDescriptor.name);
|
||||
clientLog.log(LOG_CHANNEL,"Bundle activators: %1",bundleDescriptor.activators);
|
||||
this.var_52[bundleDescriptor.name] = bundleDescriptor;
|
||||
this.§_-2M§[bundleDescriptor.name] = bundleDescriptor;
|
||||
activators = bundleDescriptor.activators;
|
||||
if(activators != null)
|
||||
{
|
||||
@@ -62,20 +62,20 @@ package alternativa.osgi
|
||||
throw new Error("Bundle " + bundleDescriptor.name + " is already installed");
|
||||
}
|
||||
|
||||
public function method_120(bundleName:String) : void
|
||||
public function §_-PX§(bundleName:String) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var activator:class_6 = null;
|
||||
var activator:§_-pF§ = null;
|
||||
if(bundleName == null)
|
||||
{
|
||||
throw new ArgumentError("Bundle name is null");
|
||||
}
|
||||
var bundleDescriptor:name_202 = this.var_52[bundleName];
|
||||
var bundleDescriptor:§_-C§ = this.§_-2M§[bundleName];
|
||||
if(bundleDescriptor == null)
|
||||
{
|
||||
throw new Error("Bundle " + bundleName + " not found");
|
||||
}
|
||||
var activators:Vector.<class_6> = bundleDescriptor.activators;
|
||||
var activators:Vector.<§_-pF§> = bundleDescriptor.activators;
|
||||
if(activators != null)
|
||||
{
|
||||
for(i = 0; i < activators.length; i++)
|
||||
@@ -85,20 +85,20 @@ package alternativa.osgi
|
||||
activator.stop(this);
|
||||
}
|
||||
}
|
||||
delete this.var_52[bundleName];
|
||||
delete this.§_-2M§[bundleName];
|
||||
clientLog.log(LOG_CHANNEL,"Bundle " + bundleName + " has been uninstalled");
|
||||
}
|
||||
|
||||
public function method_116(serviceInterface:Class, serviceImplementation:Object) : void
|
||||
public function §_-g2§(serviceInterface:Class, serviceImplementation:Object) : void
|
||||
{
|
||||
var injectPoints:Vector.<InjectPoint> = null;
|
||||
var ip:InjectPoint = null;
|
||||
if(this.services[serviceInterface] == null)
|
||||
{
|
||||
this.services[serviceInterface] = serviceImplementation;
|
||||
if(this.var_51[serviceInterface] != null)
|
||||
if(this.§_-dp§[serviceInterface] != null)
|
||||
{
|
||||
injectPoints = this.var_51[serviceInterface];
|
||||
injectPoints = this.§_-dp§[serviceInterface];
|
||||
for each(ip in injectPoints)
|
||||
{
|
||||
ip.injectOwner[ip.injectFieldName] = serviceImplementation;
|
||||
@@ -111,53 +111,53 @@ package alternativa.osgi
|
||||
throw new Error("Service " + serviceInterface + " is already registered");
|
||||
}
|
||||
|
||||
public function method_118(serviceInterfaces:Array, serviceImplementation:Object) : void
|
||||
public function §_-pC§(serviceInterfaces:Array, serviceImplementation:Object) : void
|
||||
{
|
||||
var serviceInterface:Class = null;
|
||||
for each(serviceInterface in serviceInterfaces)
|
||||
{
|
||||
this.method_116(serviceInterface,serviceImplementation);
|
||||
this.§_-g2§(serviceInterface,serviceImplementation);
|
||||
}
|
||||
}
|
||||
|
||||
public function method_117(serviceInterface:Class) : void
|
||||
public function §_-5n§(serviceInterface:Class) : void
|
||||
{
|
||||
if(this.services[serviceInterface] != null)
|
||||
{
|
||||
delete this.services[serviceInterface];
|
||||
delete this.var_51[serviceInterface];
|
||||
delete this.§_-dp§[serviceInterface];
|
||||
clientLog.log(LOG_CHANNEL,"Service has been unregistered: " + serviceInterface);
|
||||
}
|
||||
}
|
||||
|
||||
public function name_30(serviceInterface:Class) : Object
|
||||
public function §_-N6§(serviceInterface:Class) : Object
|
||||
{
|
||||
return this.services[serviceInterface];
|
||||
}
|
||||
|
||||
public function name_161(serviceInterface:Class, injectFieldOwner:Class, injectFieldName:String) : void
|
||||
public function §_-oK§(serviceInterface:Class, injectFieldOwner:Class, injectFieldName:String) : void
|
||||
{
|
||||
if(!this.var_51[serviceInterface])
|
||||
if(!this.§_-dp§[serviceInterface])
|
||||
{
|
||||
this.var_51[serviceInterface] = new Vector.<InjectPoint>();
|
||||
this.§_-dp§[serviceInterface] = new Vector.<InjectPoint>();
|
||||
}
|
||||
this.var_51[serviceInterface].push(new InjectPoint(injectFieldOwner,injectFieldName));
|
||||
this.§_-dp§[serviceInterface].push(new InjectPoint(injectFieldOwner,injectFieldName));
|
||||
injectFieldOwner[injectFieldName] = this.services[serviceInterface];
|
||||
clientLog.log(LOG_CHANNEL,"Inject %1 have been processed. Current value is %2",injectFieldOwner + "." + injectFieldName,this.services[serviceInterface]);
|
||||
}
|
||||
|
||||
public function get method_122() : Vector.<name_202>
|
||||
public function get §_-01§() : Vector.<§_-C§>
|
||||
{
|
||||
var bundleDescriptor:name_202 = null;
|
||||
var list:Vector.<name_202> = new Vector.<name_202>();
|
||||
for each(bundleDescriptor in this.var_52)
|
||||
var bundleDescriptor:§_-C§ = null;
|
||||
var list:Vector.<§_-C§> = new Vector.<§_-C§>();
|
||||
for each(bundleDescriptor in this.§_-2M§)
|
||||
{
|
||||
list.push(bundleDescriptor);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public function get method_119() : Vector.<Object>
|
||||
public function get §_-cA§() : Vector.<Object>
|
||||
{
|
||||
var service:Object = null;
|
||||
var list:Vector.<Object> = new Vector.<Object>();
|
||||
@@ -1,5 +1,19 @@
|
||||
package package_4
|
||||
package §_-Vh§
|
||||
{
|
||||
import §_-1z§.§_-b1§;
|
||||
import §_-1z§.§_-gA§;
|
||||
import §_-1z§.§_-pi§;
|
||||
import §_-8D§.§_-Jo§;
|
||||
import §_-8D§.§_-OX§;
|
||||
import §_-8D§.§_-QF§;
|
||||
import §_-8D§.§_-WR§;
|
||||
import §_-8D§.§_-be§;
|
||||
import §_-8D§.§_-d6§;
|
||||
import §_-8D§.§_-jw§;
|
||||
import §_-Ex§.§_-a2§;
|
||||
import §_-M8§.§_-5§;
|
||||
import §_-M8§.§_-Xk§;
|
||||
import §_-M8§.§_-hR§;
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import avmplus.getQualifiedClassName;
|
||||
import flash.display.BitmapData;
|
||||
@@ -8,26 +22,12 @@ package package_4
|
||||
import flash.display3D.VertexBuffer3D;
|
||||
import flash.utils.Dictionary;
|
||||
import flash.utils.getDefinitionByName;
|
||||
import package_19.name_117;
|
||||
import package_21.name_116;
|
||||
import package_21.name_124;
|
||||
import package_21.name_126;
|
||||
import package_21.name_128;
|
||||
import package_21.name_135;
|
||||
import package_21.name_139;
|
||||
import package_21.name_78;
|
||||
import package_28.name_119;
|
||||
import package_28.name_129;
|
||||
import package_28.name_93;
|
||||
import package_30.name_114;
|
||||
import package_30.name_115;
|
||||
import package_30.name_121;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class name_643 extends class_5
|
||||
public class §_-18§ extends §_-pZ§
|
||||
{
|
||||
alternativa3d static var fogTexture:name_129;
|
||||
alternativa3d static var fogTexture:§_-pi§;
|
||||
|
||||
private static var _programs:Dictionary = new Dictionary();
|
||||
|
||||
@@ -51,51 +51,51 @@ package package_4
|
||||
|
||||
alternativa3d static var fogColorB:Number = 200 / 255;
|
||||
|
||||
alternativa3d static const _passReflectionProcedure:name_114 = new name_114(["#v1=vNormal","#v0=vPosition","mov v0, i0","mov v1, i1"],"passReflectionProcedure");
|
||||
alternativa3d static const _passReflectionProcedure:§_-Xk§ = new §_-Xk§(["#v1=vNormal","#v0=vPosition","mov v0, i0","mov v1, i1"],"passReflectionProcedure");
|
||||
|
||||
alternativa3d static const _applyReflectionProcedure:name_114 = new name_114(["#v1=vNormal","#v0=vPosition","#s0=sCubeMap","#c0=cCamera","sub t0, v0, c0","dp3 t1.x, v1, t0","add t1.x, t1.x, t1.x","mul t1, v1, t1.x","sub t1, t0, t1","nrm t1.xyz, t1.xyz","tex o0, t1, s0 <cube,clamp,linear,nomip>"],"applyReflectionProcedure");
|
||||
alternativa3d static const _applyReflectionProcedure:§_-Xk§ = new §_-Xk§(["#v1=vNormal","#v0=vPosition","#s0=sCubeMap","#c0=cCamera","sub t0, v0, c0","dp3 t1.x, v1, t0","add t1.x, t1.x, t1.x","mul t1, v1, t1.x","sub t1, t0, t1","nrm t1.xyz, t1.xyz","tex o0, t1, s0 <cube,clamp,linear,nomip>"],"applyReflectionProcedure");
|
||||
|
||||
alternativa3d static const _applyReflectionNormalMapProcedure:name_114 = new name_114(["#s0=sCubeMap","#c0=cCamera","#v0=vPosition","sub t0, v0, c0","dp3 t1.x, i0.xyz, t0","add t1.x, t1.x, t1.x","mul t1, i0.xyz, t1.x","sub t1, t0, t1","nrm t1.xyz, t1.xyz","tex o0, t1, s0 <cube,clamp,linear,nomip>"],"applyReflectionNormalMapProcedure");
|
||||
alternativa3d static const _applyReflectionNormalMapProcedure:§_-Xk§ = new §_-Xk§(["#s0=sCubeMap","#c0=cCamera","#v0=vPosition","sub t0, v0, c0","dp3 t1.x, i0.xyz, t0","add t1.x, t1.x, t1.x","mul t1, i0.xyz, t1.x","sub t1, t0, t1","nrm t1.xyz, t1.xyz","tex o0, t1, s0 <cube,clamp,linear,nomip>"],"applyReflectionNormalMapProcedure");
|
||||
|
||||
alternativa3d static const _blendReflection:name_114 = new name_114(["#c0=cAlpha","mul t1, i0, c0.y","mul t0.xyz, i1, c0.z","add t0.xyz, t1, t0","mov t0.w, i0.w","mov o0, t0"],"blendReflection");
|
||||
alternativa3d static const _blendReflection:§_-Xk§ = new §_-Xk§(["#c0=cAlpha","mul t1, i0, c0.y","mul t0.xyz, i1, c0.z","add t0.xyz, t1, t0","mov t0.w, i0.w","mov o0, t0"],"blendReflection");
|
||||
|
||||
alternativa3d static const _blendReflectionMap:name_114 = new name_114(["#c0=cCamera","#c1=cAlpha","#s0=sReflection","#v0=vUV","tex t0, v0, s0 <2d,repeat,linear,miplinear>","mul t0, t0, c1.z","mul t1.xyz, i1, t0","sub t0, c0.www, t0","mul t2, i0, t0","add t0.xyz, t1, t2","mov t0.w, i0.w","mov o0, t0"],"blendReflectionMap");
|
||||
alternativa3d static const _blendReflectionMap:§_-Xk§ = new §_-Xk§(["#c0=cCamera","#c1=cAlpha","#s0=sReflection","#v0=vUV","tex t0, v0, s0 <2d,repeat,linear,miplinear>","mul t0, t0, c1.z","mul t1.xyz, i1, t0","sub t0, c0.www, t0","mul t2, i0, t0","add t0.xyz, t1, t2","mov t0.w, i0.w","mov o0, t0"],"blendReflectionMap");
|
||||
|
||||
private static const _passTBNRightProcedure:name_114 = method_123(true);
|
||||
private static const _passTBNRightProcedure:§_-Xk§ = §_-eg§(true);
|
||||
|
||||
private static const _passTBNLeftProcedure:name_114 = method_123(false);
|
||||
private static const _passTBNLeftProcedure:§_-Xk§ = §_-eg§(false);
|
||||
|
||||
private static const _getNormalTangentProcedure:name_114 = new name_114(["#v0=vTangent","#v1=vBinormal","#v2=vNormal","#v3=vUV","#c0=cCamera","#s0=sBump","tex t0, v3, s0 <2d,repeat,linear,miplinear>","add t0, t0, t0","sub t0.xyz, t0.xyz, c0.www","nrm t1.xyz, v0.xyz","dp3 o0.x, t0.xyz, t1.xyz","nrm t1.xyz, v1.xyz","dp3 o0.y, t0.xyz, t1.xyz","nrm t1.xyz, v2.xyz","dp3 o0.z, t0.xyz, t1.xyz","nrm o0.xyz, o0.xyz"],"getNormalTangentProcedure");
|
||||
private static const _getNormalTangentProcedure:§_-Xk§ = new §_-Xk§(["#v0=vTangent","#v1=vBinormal","#v2=vNormal","#v3=vUV","#c0=cCamera","#s0=sBump","tex t0, v3, s0 <2d,repeat,linear,miplinear>","add t0, t0, t0","sub t0.xyz, t0.xyz, c0.www","nrm t1.xyz, v0.xyz","dp3 o0.x, t0.xyz, t1.xyz","nrm t1.xyz, v1.xyz","dp3 o0.y, t0.xyz, t1.xyz","nrm t1.xyz, v2.xyz","dp3 o0.z, t0.xyz, t1.xyz","nrm o0.xyz, o0.xyz"],"getNormalTangentProcedure");
|
||||
|
||||
private static const _getNormalObjectProcedure:name_114 = new name_114(["#v3=vUV","#c0=cCamera","#s0=sBump","tex t0, v3, s0 <2d,repeat,linear,miplinear>","add t0, t0, t0","sub t0.xyz, t0.xyz, c0.www","nrm o0.xyz, t0.xyz"],"getNormalObjectProcedure");
|
||||
private static const _getNormalObjectProcedure:§_-Xk§ = new §_-Xk§(["#v3=vUV","#c0=cCamera","#s0=sBump","tex t0, v3, s0 <2d,repeat,linear,miplinear>","add t0, t0, t0","sub t0.xyz, t0.xyz, c0.www","nrm o0.xyz, t0.xyz"],"getNormalObjectProcedure");
|
||||
|
||||
private static const passSimpleFogConstProcedure:name_114 = new name_114(["#v0=vZDistance","#c0=cFogSpace","dp4 t0.z, i0, c0","mov v0, t0.zzzz","sub v0.y, i0.w, t0.z"],"passSimpleFogConst");
|
||||
private static const passSimpleFogConstProcedure:§_-Xk§ = new §_-Xk§(["#v0=vZDistance","#c0=cFogSpace","dp4 t0.z, i0, c0","mov v0, t0.zzzz","sub v0.y, i0.w, t0.z"],"passSimpleFogConst");
|
||||
|
||||
private static const outputWithSimpleFogProcedure:name_114 = new name_114(["#v0=vZDistance","#c0=cFogColor","#c1=cFogRange","min t0.xy, v0.xy, c1.xy","max t0.xy, t0.xy, c1.zw","mul i0.xyz, i0.xyz, t0.y","mul t0.xyz, c0.xyz, t0.x","add i0.xyz, i0.xyz, t0.xyz","mov o0, i0"],"outputWithSimpleFog");
|
||||
private static const outputWithSimpleFogProcedure:§_-Xk§ = new §_-Xk§(["#v0=vZDistance","#c0=cFogColor","#c1=cFogRange","min t0.xy, v0.xy, c1.xy","max t0.xy, t0.xy, c1.zw","mul i0.xyz, i0.xyz, t0.y","mul t0.xyz, c0.xyz, t0.x","add i0.xyz, i0.xyz, t0.xyz","mov o0, i0"],"outputWithSimpleFog");
|
||||
|
||||
private static const postPassAdvancedFogConstProcedure:name_114 = new name_114(["#v0=vZDistance","#c0=cFogSpace","dp4 t0.z, i0, c0","mov v0, t0.zzzz","sub v0.y, i0.w, t0.z","mov v0.zw, i1.xwxw","mov o0, i1"],"postPassAdvancedFogConst");
|
||||
private static const postPassAdvancedFogConstProcedure:§_-Xk§ = new §_-Xk§(["#v0=vZDistance","#c0=cFogSpace","dp4 t0.z, i0, c0","mov v0, t0.zzzz","sub v0.y, i0.w, t0.z","mov v0.zw, i1.xwxw","mov o0, i1"],"postPassAdvancedFogConst");
|
||||
|
||||
private static const outputWithAdvancedFogProcedure:name_114 = new name_114(["#v0=vZDistance","#c0=cFogConsts","#c1=cFogRange","#s0=sFogTexture","min t0.xy, v0.xy, c1.xy","max t0.xy, t0.xy, c1.zw","mul i0.xyz, i0.xyz, t0.y","mov t1.xyzw, c0.yyzw","div t0.z, v0.z, v0.w","mul t0.z, t0.z, c0.x","add t1.x, t1.x, t0.z","tex t1, t1, s0 <2d, repeat, linear, miplinear>","mul t0.xyz, t1.xyz, t0.x","add i0.xyz, i0.xyz, t0.xyz","mov o0, i0"],"outputWithAdvancedFog");
|
||||
private static const outputWithAdvancedFogProcedure:§_-Xk§ = new §_-Xk§(["#v0=vZDistance","#c0=cFogConsts","#c1=cFogRange","#s0=sFogTexture","min t0.xy, v0.xy, c1.xy","max t0.xy, t0.xy, c1.zw","mul i0.xyz, i0.xyz, t0.y","mov t1.xyzw, c0.yyzw","div t0.z, v0.z, v0.w","mul t0.z, t0.z, c0.x","add t1.x, t1.x, t0.z","tex t1, t1, s0 <2d, repeat, linear, miplinear>","mul t0.xyz, t1.xyz, t0.x","add i0.xyz, i0.xyz, t0.xyz","mov o0, i0"],"outputWithAdvancedFog");
|
||||
|
||||
private static const _applyLightMapProcedure:name_114 = new name_114(["#v0=vUV1","#s0=sLightMap","tex t0, v0, s0 <2d,repeat,linear,mipnone>","add t0, t0, t0","mul i0.xyz, i0.xyz, t0.xyz","mov o0, i0"],"applyLightMapProcedure");
|
||||
private static const _applyLightMapProcedure:§_-Xk§ = new §_-Xk§(["#v0=vUV1","#s0=sLightMap","tex t0, v0, s0 <2d,repeat,linear,mipnone>","add t0, t0, t0","mul i0.xyz, i0.xyz, t0.xyz","mov o0, i0"],"applyLightMapProcedure");
|
||||
|
||||
private static const _passLightMapUVProcedure:name_114 = new name_114(["#a0=aUV1","#v0=vUV1","mov v0, a0"],"passLightMapUVProcedure");
|
||||
private static const _passLightMapUVProcedure:§_-Xk§ = new §_-Xk§(["#a0=aUV1","#v0=vUV1","mov v0, a0"],"passLightMapUVProcedure");
|
||||
|
||||
private var var_53:int = 0;
|
||||
private var §_-NH§:int = 0;
|
||||
|
||||
public var normalMap:name_129;
|
||||
public var normalMap:§_-pi§;
|
||||
|
||||
public var environmentMap:name_129;
|
||||
public var environmentMap:§_-pi§;
|
||||
|
||||
public var reflection:Number = 1;
|
||||
|
||||
public var reflectionMap:name_129;
|
||||
public var reflectionMap:§_-pi§;
|
||||
|
||||
public var lightMap:name_129;
|
||||
public var lightMap:§_-pi§;
|
||||
|
||||
public var lightMapChannel:uint = 1;
|
||||
|
||||
public function name_643(diffuseMap:name_129 = null, environmentMap:name_129 = null, normalMap:name_129 = null, reflectionMap:name_129 = null, lightMap:name_129 = null, opacityMap:name_129 = null, alpha:Number = 1)
|
||||
public function §_-18§(diffuseMap:§_-pi§ = null, environmentMap:§_-pi§ = null, normalMap:§_-pi§ = null, reflectionMap:§_-pi§ = null, lightMap:§_-pi§ = null, opacityMap:§_-pi§ = null, alpha:Number = 1)
|
||||
{
|
||||
super(diffuseMap,opacityMap,alpha);
|
||||
this.environmentMap = environmentMap;
|
||||
@@ -104,186 +104,186 @@ package package_4
|
||||
this.lightMap = lightMap;
|
||||
}
|
||||
|
||||
private static function method_123(right:Boolean) : name_114
|
||||
private static function §_-eg§(right:Boolean) : §_-Xk§
|
||||
{
|
||||
var crsInSpace:String = right ? "crs t1.xyz, i0, i1" : "crs t1.xyz, i1, i0";
|
||||
return new name_114(["#v0=vTangent","#v1=vBinormal","#v2=vNormal",crsInSpace,"mul t1.xyz, t1.xyz, i0.w","mov v0.x, i0.x","mov v0.y, t1.x","mov v0.z, i1.x","mov v0.w, i1.w","mov v1.x, i0.y","mov v1.y, t1.y","mov v1.z, i1.y","mov v1.w, i1.w","mov v2.x, i0.z","mov v2.y, t1.z","mov v2.z, i1.z","mov v2.w, i1.w"],"passTBNProcedure");
|
||||
return new §_-Xk§(["#v0=vTangent","#v1=vBinormal","#v2=vNormal",crsInSpace,"mul t1.xyz, t1.xyz, i0.w","mov v0.x, i0.x","mov v0.y, t1.x","mov v0.z, i1.x","mov v0.w, i1.w","mov v1.x, i0.y","mov v1.y, t1.y","mov v1.z, i1.y","mov v1.w, i1.w","mov v2.x, i0.z","mov v2.y, t1.z","mov v2.z, i1.z","mov v2.w, i1.w"],"passTBNProcedure");
|
||||
}
|
||||
|
||||
public function get method_124() : int
|
||||
public function get §_-Q8§() : int
|
||||
{
|
||||
return this.var_53;
|
||||
return this.§_-NH§;
|
||||
}
|
||||
|
||||
public function set method_124(value:int) : void
|
||||
public function set §_-Q8§(value:int) : void
|
||||
{
|
||||
if(value != name_204.TANGENT_RIGHT_HANDED && value != name_204.TANGENT_LEFT_HANDED && value != name_204.OBJECT)
|
||||
if(value != §_-12§.TANGENT_RIGHT_HANDED && value != §_-12§.TANGENT_LEFT_HANDED && value != §_-12§.OBJECT)
|
||||
{
|
||||
throw new ArgumentError("Value must be a constant from the NormalMapSpace class");
|
||||
}
|
||||
this.var_53 = value;
|
||||
this.§_-NH§ = value;
|
||||
}
|
||||
|
||||
override alternativa3d function fillResources(resources:Dictionary, resourceType:Class) : void
|
||||
{
|
||||
super.alternativa3d::fillResources(resources,resourceType);
|
||||
if(this.environmentMap != null && Boolean(name_28.alternativa3d::name_131(getDefinitionByName(getQualifiedClassName(this.environmentMap)) as Class,resourceType)))
|
||||
if(this.environmentMap != null && Boolean(§_-Pt§.alternativa3d::_-EU(getDefinitionByName(getQualifiedClassName(this.environmentMap)) as Class,resourceType)))
|
||||
{
|
||||
resources[this.environmentMap] = true;
|
||||
}
|
||||
if(this.normalMap != null && Boolean(name_28.alternativa3d::name_131(getDefinitionByName(getQualifiedClassName(this.normalMap)) as Class,resourceType)))
|
||||
if(this.normalMap != null && Boolean(§_-Pt§.alternativa3d::_-EU(getDefinitionByName(getQualifiedClassName(this.normalMap)) as Class,resourceType)))
|
||||
{
|
||||
resources[this.normalMap] = true;
|
||||
}
|
||||
if(this.reflectionMap != null && Boolean(name_28.alternativa3d::name_131(getDefinitionByName(getQualifiedClassName(this.reflectionMap)) as Class,resourceType)))
|
||||
if(this.reflectionMap != null && Boolean(§_-Pt§.alternativa3d::_-EU(getDefinitionByName(getQualifiedClassName(this.reflectionMap)) as Class,resourceType)))
|
||||
{
|
||||
resources[this.reflectionMap] = true;
|
||||
}
|
||||
if(this.lightMap != null && Boolean(name_28.alternativa3d::name_131(getDefinitionByName(getQualifiedClassName(this.lightMap)) as Class,resourceType)))
|
||||
if(this.lightMap != null && Boolean(§_-Pt§.alternativa3d::_-EU(getDefinitionByName(getQualifiedClassName(this.lightMap)) as Class,resourceType)))
|
||||
{
|
||||
resources[this.lightMap] = true;
|
||||
}
|
||||
}
|
||||
|
||||
private function method_75(targetObject:name_78) : EnvironmentMaterialShaderProgram
|
||||
private function final(targetObject:§_-OX§) : EnvironmentMaterialShaderProgram
|
||||
{
|
||||
var procedure:name_114 = null;
|
||||
var outputProcedure:name_114 = null;
|
||||
var nrmProcedure:name_114 = null;
|
||||
var vertexLinker:name_121 = new name_121(Context3DProgramType.VERTEX);
|
||||
var fragmentLinker:name_121 = new name_121(Context3DProgramType.FRAGMENT);
|
||||
var procedure:§_-Xk§ = null;
|
||||
var outputProcedure:§_-Xk§ = null;
|
||||
var nrmProcedure:§_-Xk§ = null;
|
||||
var vertexLinker:§_-hR§ = new §_-hR§(Context3DProgramType.VERTEX);
|
||||
var fragmentLinker:§_-hR§ = new §_-hR§(Context3DProgramType.FRAGMENT);
|
||||
var positionVar:String = "aPosition";
|
||||
var normalVar:String = "aNormal";
|
||||
var tangentVar:String = "aTangent";
|
||||
vertexLinker.name_120(positionVar,name_115.ATTRIBUTE);
|
||||
vertexLinker.name_120(normalVar,name_115.ATTRIBUTE);
|
||||
vertexLinker.§_-LU§(positionVar,§_-5§.ATTRIBUTE);
|
||||
vertexLinker.§_-LU§(normalVar,§_-5§.ATTRIBUTE);
|
||||
if(targetObject.alternativa3d::transformProcedure != null)
|
||||
{
|
||||
positionVar = alternativa3d::method_74(targetObject.alternativa3d::transformProcedure,vertexLinker);
|
||||
positionVar = alternativa3d::_-di(targetObject.alternativa3d::transformProcedure,vertexLinker);
|
||||
}
|
||||
if(targetObject.alternativa3d::deltaTransformProcedure != null)
|
||||
{
|
||||
vertexLinker.name_120("tTransformedNormal");
|
||||
procedure = targetObject.alternativa3d::deltaTransformProcedure.name_143();
|
||||
vertexLinker.name_123(procedure);
|
||||
vertexLinker.name_118(procedure,normalVar);
|
||||
vertexLinker.name_125(procedure,"tTransformedNormal");
|
||||
vertexLinker.§_-LU§("tTransformedNormal");
|
||||
procedure = targetObject.alternativa3d::deltaTransformProcedure.§_-mY§();
|
||||
vertexLinker.§_-on§(procedure);
|
||||
vertexLinker.§_-FS§(procedure,normalVar);
|
||||
vertexLinker.§_-qd§(procedure,"tTransformedNormal");
|
||||
normalVar = "tTransformedNormal";
|
||||
if((this.var_53 == name_204.TANGENT_RIGHT_HANDED || this.var_53 == name_204.TANGENT_LEFT_HANDED) && this.normalMap != null)
|
||||
if((this.§_-NH§ == §_-12§.TANGENT_RIGHT_HANDED || this.§_-NH§ == §_-12§.TANGENT_LEFT_HANDED) && this.normalMap != null)
|
||||
{
|
||||
vertexLinker.name_120(tangentVar,name_115.ATTRIBUTE);
|
||||
vertexLinker.name_120("tTransformedTangent");
|
||||
procedure = targetObject.alternativa3d::deltaTransformProcedure.name_143();
|
||||
vertexLinker.name_123(procedure);
|
||||
vertexLinker.name_118(procedure,tangentVar);
|
||||
vertexLinker.name_125(procedure,"tTransformedTangent");
|
||||
vertexLinker.§_-LU§(tangentVar,§_-5§.ATTRIBUTE);
|
||||
vertexLinker.§_-LU§("tTransformedTangent");
|
||||
procedure = targetObject.alternativa3d::deltaTransformProcedure.§_-mY§();
|
||||
vertexLinker.§_-on§(procedure);
|
||||
vertexLinker.§_-FS§(procedure,tangentVar);
|
||||
vertexLinker.§_-qd§(procedure,"tTransformedTangent");
|
||||
tangentVar = "tTransformedTangent";
|
||||
}
|
||||
}
|
||||
else if((this.var_53 == name_204.TANGENT_RIGHT_HANDED || this.var_53 == name_204.TANGENT_LEFT_HANDED) && this.normalMap != null)
|
||||
else if((this.§_-NH§ == §_-12§.TANGENT_RIGHT_HANDED || this.§_-NH§ == §_-12§.TANGENT_LEFT_HANDED) && this.normalMap != null)
|
||||
{
|
||||
vertexLinker.name_120(tangentVar,name_115.ATTRIBUTE);
|
||||
vertexLinker.§_-LU§(tangentVar,§_-5§.ATTRIBUTE);
|
||||
}
|
||||
vertexLinker.name_123(_passLightMapUVProcedure);
|
||||
vertexLinker.name_123(alternativa3d::_passReflectionProcedure);
|
||||
vertexLinker.name_118(alternativa3d::_passReflectionProcedure,positionVar,normalVar);
|
||||
vertexLinker.name_123(alternativa3d::_projectProcedure);
|
||||
vertexLinker.name_118(alternativa3d::_projectProcedure,positionVar);
|
||||
vertexLinker.name_123(alternativa3d::_passUVProcedure);
|
||||
vertexLinker.§_-on§(_passLightMapUVProcedure);
|
||||
vertexLinker.§_-on§(alternativa3d::_passReflectionProcedure);
|
||||
vertexLinker.§_-FS§(alternativa3d::_passReflectionProcedure,positionVar,normalVar);
|
||||
vertexLinker.§_-on§(alternativa3d::_projectProcedure);
|
||||
vertexLinker.§_-FS§(alternativa3d::_projectProcedure,positionVar);
|
||||
vertexLinker.§_-on§(alternativa3d::_passUVProcedure);
|
||||
if(this.normalMap != null)
|
||||
{
|
||||
fragmentLinker.name_120("tNormal");
|
||||
if(this.var_53 == name_204.TANGENT_RIGHT_HANDED || this.var_53 == name_204.TANGENT_LEFT_HANDED)
|
||||
fragmentLinker.§_-LU§("tNormal");
|
||||
if(this.§_-NH§ == §_-12§.TANGENT_RIGHT_HANDED || this.§_-NH§ == §_-12§.TANGENT_LEFT_HANDED)
|
||||
{
|
||||
nrmProcedure = this.var_53 == name_204.TANGENT_RIGHT_HANDED ? _passTBNRightProcedure : _passTBNLeftProcedure;
|
||||
vertexLinker.name_123(nrmProcedure);
|
||||
vertexLinker.name_118(nrmProcedure,tangentVar,normalVar);
|
||||
fragmentLinker.name_123(_getNormalTangentProcedure);
|
||||
fragmentLinker.name_125(_getNormalTangentProcedure,"tNormal");
|
||||
nrmProcedure = this.§_-NH§ == §_-12§.TANGENT_RIGHT_HANDED ? _passTBNRightProcedure : _passTBNLeftProcedure;
|
||||
vertexLinker.§_-on§(nrmProcedure);
|
||||
vertexLinker.§_-FS§(nrmProcedure,tangentVar,normalVar);
|
||||
fragmentLinker.§_-on§(_getNormalTangentProcedure);
|
||||
fragmentLinker.§_-qd§(_getNormalTangentProcedure,"tNormal");
|
||||
}
|
||||
else
|
||||
{
|
||||
fragmentLinker.name_123(_getNormalObjectProcedure);
|
||||
fragmentLinker.name_125(_getNormalObjectProcedure,"tNormal");
|
||||
fragmentLinker.§_-on§(_getNormalObjectProcedure);
|
||||
fragmentLinker.§_-qd§(_getNormalObjectProcedure,"tNormal");
|
||||
}
|
||||
}
|
||||
vertexLinker.name_142();
|
||||
fragmentLinker.name_120("tColor");
|
||||
if(var_21)
|
||||
vertexLinker.§_-XI§();
|
||||
fragmentLinker.§_-LU§("tColor");
|
||||
if(§_-L4§)
|
||||
{
|
||||
fragmentLinker.name_123(alternativa3d::_samplerSetProcedureDiffuseAlpha);
|
||||
fragmentLinker.name_125(alternativa3d::_samplerSetProcedureDiffuseAlpha,"tColor");
|
||||
fragmentLinker.§_-on§(alternativa3d::_samplerSetProcedureDiffuseAlpha);
|
||||
fragmentLinker.§_-qd§(alternativa3d::_samplerSetProcedureDiffuseAlpha,"tColor");
|
||||
}
|
||||
else if(opacityMap != null)
|
||||
{
|
||||
fragmentLinker.name_123(alternativa3d::_samplerSetProcedureOpacity);
|
||||
fragmentLinker.name_125(alternativa3d::_samplerSetProcedureOpacity,"tColor");
|
||||
fragmentLinker.§_-on§(alternativa3d::_samplerSetProcedureOpacity);
|
||||
fragmentLinker.§_-qd§(alternativa3d::_samplerSetProcedureOpacity,"tColor");
|
||||
}
|
||||
else
|
||||
{
|
||||
fragmentLinker.name_123(alternativa3d::_samplerSetProcedure);
|
||||
fragmentLinker.name_125(alternativa3d::_samplerSetProcedure,"tColor");
|
||||
fragmentLinker.§_-on§(alternativa3d::_samplerSetProcedure);
|
||||
fragmentLinker.§_-qd§(alternativa3d::_samplerSetProcedure,"tColor");
|
||||
}
|
||||
fragmentLinker.name_120("tReflection");
|
||||
fragmentLinker.§_-LU§("tReflection");
|
||||
if(this.normalMap != null)
|
||||
{
|
||||
fragmentLinker.name_123(alternativa3d::_applyReflectionNormalMapProcedure);
|
||||
fragmentLinker.name_118(alternativa3d::_applyReflectionNormalMapProcedure,"tNormal");
|
||||
fragmentLinker.name_125(alternativa3d::_applyReflectionNormalMapProcedure,"tReflection");
|
||||
fragmentLinker.§_-on§(alternativa3d::_applyReflectionNormalMapProcedure);
|
||||
fragmentLinker.§_-FS§(alternativa3d::_applyReflectionNormalMapProcedure,"tNormal");
|
||||
fragmentLinker.§_-qd§(alternativa3d::_applyReflectionNormalMapProcedure,"tReflection");
|
||||
}
|
||||
else
|
||||
{
|
||||
fragmentLinker.name_123(alternativa3d::_applyReflectionProcedure);
|
||||
fragmentLinker.name_125(alternativa3d::_applyReflectionProcedure,"tReflection");
|
||||
fragmentLinker.§_-on§(alternativa3d::_applyReflectionProcedure);
|
||||
fragmentLinker.§_-qd§(alternativa3d::_applyReflectionProcedure,"tReflection");
|
||||
}
|
||||
fragmentLinker.name_123(_applyLightMapProcedure);
|
||||
fragmentLinker.name_118(_applyLightMapProcedure,"tColor");
|
||||
fragmentLinker.name_125(_applyLightMapProcedure,"tColor");
|
||||
fragmentLinker.§_-on§(_applyLightMapProcedure);
|
||||
fragmentLinker.§_-FS§(_applyLightMapProcedure,"tColor");
|
||||
fragmentLinker.§_-qd§(_applyLightMapProcedure,"tColor");
|
||||
if(this.reflectionMap != null)
|
||||
{
|
||||
fragmentLinker.name_123(alternativa3d::_blendReflectionMap);
|
||||
fragmentLinker.name_118(alternativa3d::_blendReflectionMap,"tColor","tReflection");
|
||||
fragmentLinker.§_-on§(alternativa3d::_blendReflectionMap);
|
||||
fragmentLinker.§_-FS§(alternativa3d::_blendReflectionMap,"tColor","tReflection");
|
||||
outputProcedure = alternativa3d::_blendReflectionMap;
|
||||
}
|
||||
else
|
||||
{
|
||||
fragmentLinker.name_123(alternativa3d::_blendReflection);
|
||||
fragmentLinker.name_118(alternativa3d::_blendReflection,"tColor","tReflection");
|
||||
fragmentLinker.§_-on§(alternativa3d::_blendReflection);
|
||||
fragmentLinker.§_-FS§(alternativa3d::_blendReflection,"tColor","tReflection");
|
||||
outputProcedure = alternativa3d::_blendReflection;
|
||||
}
|
||||
if(alternativa3d::fogMode == alternativa3d::SIMPLE || alternativa3d::fogMode == alternativa3d::ADVANCED)
|
||||
{
|
||||
fragmentLinker.name_120("outColor");
|
||||
fragmentLinker.name_125(outputProcedure,"outColor");
|
||||
fragmentLinker.§_-LU§("outColor");
|
||||
fragmentLinker.§_-qd§(outputProcedure,"outColor");
|
||||
}
|
||||
if(alternativa3d::fogMode == alternativa3d::SIMPLE)
|
||||
{
|
||||
vertexLinker.name_123(passSimpleFogConstProcedure);
|
||||
vertexLinker.name_118(passSimpleFogConstProcedure,positionVar);
|
||||
fragmentLinker.name_123(outputWithSimpleFogProcedure);
|
||||
fragmentLinker.name_118(outputWithSimpleFogProcedure,"outColor");
|
||||
vertexLinker.§_-on§(passSimpleFogConstProcedure);
|
||||
vertexLinker.§_-FS§(passSimpleFogConstProcedure,positionVar);
|
||||
fragmentLinker.§_-on§(outputWithSimpleFogProcedure);
|
||||
fragmentLinker.§_-FS§(outputWithSimpleFogProcedure,"outColor");
|
||||
}
|
||||
else if(alternativa3d::fogMode == alternativa3d::ADVANCED)
|
||||
{
|
||||
vertexLinker.name_120("tProjected");
|
||||
vertexLinker.name_125(alternativa3d::_projectProcedure,"tProjected");
|
||||
vertexLinker.name_123(postPassAdvancedFogConstProcedure);
|
||||
vertexLinker.name_118(postPassAdvancedFogConstProcedure,positionVar,"tProjected");
|
||||
fragmentLinker.name_123(outputWithAdvancedFogProcedure);
|
||||
fragmentLinker.name_118(outputWithAdvancedFogProcedure,"outColor");
|
||||
vertexLinker.§_-LU§("tProjected");
|
||||
vertexLinker.§_-qd§(alternativa3d::_projectProcedure,"tProjected");
|
||||
vertexLinker.§_-on§(postPassAdvancedFogConstProcedure);
|
||||
vertexLinker.§_-FS§(postPassAdvancedFogConstProcedure,positionVar,"tProjected");
|
||||
fragmentLinker.§_-on§(outputWithAdvancedFogProcedure);
|
||||
fragmentLinker.§_-FS§(outputWithAdvancedFogProcedure,"outColor");
|
||||
}
|
||||
fragmentLinker.name_142();
|
||||
fragmentLinker.name_133(vertexLinker);
|
||||
fragmentLinker.§_-XI§();
|
||||
fragmentLinker.§_-NA§(vertexLinker);
|
||||
return new EnvironmentMaterialShaderProgram(vertexLinker,fragmentLinker);
|
||||
}
|
||||
|
||||
override alternativa3d function collectDraws(camera:name_124, surface:name_117, geometry:name_119, lights:Vector.<name_116>, lightsLength:int, objectRenderPriority:int = -1) : void
|
||||
override alternativa3d function collectDraws(camera:§_-be§, surface:§_-a2§, geometry:§_-gA§, lights:Vector.<§_-Jo§>, lightsLength:int, objectRenderPriority:int = -1) : void
|
||||
{
|
||||
var program:name_127 = null;
|
||||
var program:§_-RB§ = null;
|
||||
var i:int = 0;
|
||||
var lm:name_139 = null;
|
||||
var lm:§_-jw§ = null;
|
||||
var dist:Number = NaN;
|
||||
var cLocal:name_139 = null;
|
||||
var cLocal:§_-jw§ = null;
|
||||
var halfW:Number = NaN;
|
||||
var leftX:Number = NaN;
|
||||
var leftY:Number = NaN;
|
||||
@@ -300,26 +300,26 @@ package package_4
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(!var_21 && opacityMap != null && opacityMap.alternativa3d::_texture == null)
|
||||
if(!§_-L4§ && opacityMap != null && opacityMap.alternativa3d::_texture == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var object:name_78 = surface.alternativa3d::object;
|
||||
var positionBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(name_126.POSITION);
|
||||
var uvBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(name_126.TEXCOORDS[0]);
|
||||
var normalsBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(name_126.NORMAL);
|
||||
var tangentsBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(name_126.TANGENT4);
|
||||
var object:§_-OX§ = surface.alternativa3d::object;
|
||||
var positionBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(§_-d6§.POSITION);
|
||||
var uvBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(§_-d6§.TEXCOORDS[0]);
|
||||
var normalsBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(§_-d6§.NORMAL);
|
||||
var tangentsBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(§_-d6§.TANGENT4);
|
||||
if(positionBuffer == null || uvBuffer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var key:String = alternativa3d::fogMode.toString() + this.var_53.toString() + (this.normalMap != null ? "N" : "n") + (opacityMap != null ? "O" : "o") + (var_21 ? "D" : "d");
|
||||
var key:String = alternativa3d::fogMode.toString() + this.§_-NH§.toString() + (this.normalMap != null ? "N" : "n") + (opacityMap != null ? "O" : "o") + (!!§_-L4§ ? "D" : "d");
|
||||
var programs:Dictionary = _programs[object.alternativa3d::transformProcedure];
|
||||
if(programs == null)
|
||||
{
|
||||
programs = new Dictionary(false);
|
||||
_programs[object.alternativa3d::transformProcedure] = programs;
|
||||
program = this.method_75(object);
|
||||
program = this.final(object);
|
||||
program.upload(camera.alternativa3d::context3D);
|
||||
programs[key] = program;
|
||||
}
|
||||
@@ -328,28 +328,28 @@ package package_4
|
||||
program = programs[key];
|
||||
if(program == null)
|
||||
{
|
||||
program = this.method_75(object);
|
||||
program = this.final(object);
|
||||
program.upload(camera.alternativa3d::context3D);
|
||||
programs[key] = program;
|
||||
}
|
||||
}
|
||||
var drawUnit:name_135 = camera.alternativa3d::renderer.alternativa3d::name_137(object,program.program,geometry.alternativa3d::name_132,surface.indexBegin,surface.numTriangles,program);
|
||||
var drawUnit:§_-QF§ = camera.alternativa3d::renderer.alternativa3d::_-2s(object,program.program,geometry.alternativa3d::_-EM,surface.indexBegin,surface.numTriangles,program);
|
||||
drawUnit.alternativa3d::setTextureAt(program.fragmentShader.getVariableIndex("sLightMap"),this.lightMap.alternativa3d::_texture);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.vertexShader.getVariableIndex("aPosition"),positionBuffer,geometry.alternativa3d::_attributesOffsets[name_126.POSITION],name_126.alternativa3d::FORMATS[name_126.POSITION]);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.vertexShader.getVariableIndex("aUV"),uvBuffer,geometry.alternativa3d::_attributesOffsets[name_126.TEXCOORDS[0]],name_126.alternativa3d::FORMATS[name_126.TEXCOORDS[0]]);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.vertexShader.getVariableIndex("aUV1"),uvBuffer,geometry.alternativa3d::_attributesOffsets[name_126.TEXCOORDS[this.lightMapChannel]],name_126.alternativa3d::FORMATS[name_126.TEXCOORDS[this.lightMapChannel]]);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.vertexShader.getVariableIndex("aNormal"),normalsBuffer,geometry.alternativa3d::_attributesOffsets[name_126.NORMAL],name_126.alternativa3d::FORMATS[name_126.NORMAL]);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.vertexShader.getVariableIndex("aPosition"),positionBuffer,geometry.alternativa3d::_attributesOffsets[§_-d6§.POSITION],§_-d6§.alternativa3d::FORMATS[§_-d6§.POSITION]);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.vertexShader.getVariableIndex("aUV"),uvBuffer,geometry.alternativa3d::_attributesOffsets[§_-d6§.TEXCOORDS[0]],§_-d6§.alternativa3d::FORMATS[§_-d6§.TEXCOORDS[0]]);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.vertexShader.getVariableIndex("aUV1"),uvBuffer,geometry.alternativa3d::_attributesOffsets[§_-d6§.TEXCOORDS[this.lightMapChannel]],§_-d6§.alternativa3d::FORMATS[§_-d6§.TEXCOORDS[this.lightMapChannel]]);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.vertexShader.getVariableIndex("aNormal"),normalsBuffer,geometry.alternativa3d::_attributesOffsets[§_-d6§.NORMAL],§_-d6§.alternativa3d::FORMATS[§_-d6§.NORMAL]);
|
||||
object.alternativa3d::setTransformConstants(drawUnit,surface,program.vertexShader,camera);
|
||||
drawUnit.alternativa3d::name_136(camera,program.vertexShader.getVariableIndex("cProjMatrix"),object.alternativa3d::localToCameraTransform);
|
||||
var camTransform:name_139 = object.alternativa3d::cameraToLocalTransform;
|
||||
drawUnit.alternativa3d::name_134(program.fragmentShader.getVariableIndex("cCamera"),camTransform.d,camTransform.h,camTransform.l);
|
||||
drawUnit.alternativa3d::_-mQ(camera,program.vertexShader.getVariableIndex("cProjMatrix"),object.alternativa3d::localToCameraTransform);
|
||||
var camTransform:§_-jw§ = object.alternativa3d::cameraToLocalTransform;
|
||||
drawUnit.alternativa3d::_-Ry(program.fragmentShader.getVariableIndex("cCamera"),camTransform.d,camTransform.h,camTransform.l);
|
||||
var envProgram:EnvironmentMaterialShaderProgram = program as EnvironmentMaterialShaderProgram;
|
||||
if(this.normalMap != null)
|
||||
{
|
||||
drawUnit.alternativa3d::setTextureAt(envProgram.sBump,this.normalMap.alternativa3d::_texture);
|
||||
if(this.var_53 == name_204.TANGENT_RIGHT_HANDED || this.var_53 == name_204.TANGENT_LEFT_HANDED)
|
||||
if(this.§_-NH§ == §_-12§.TANGENT_RIGHT_HANDED || this.§_-NH§ == §_-12§.TANGENT_LEFT_HANDED)
|
||||
{
|
||||
drawUnit.alternativa3d::setVertexBufferAt(envProgram.aTangent,tangentsBuffer,geometry.alternativa3d::_attributesOffsets[name_126.TANGENT4],name_126.alternativa3d::FORMATS[name_126.TANGENT4]);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(envProgram.aTangent,tangentsBuffer,geometry.alternativa3d::_attributesOffsets[§_-d6§.TANGENT4],§_-d6§.alternativa3d::FORMATS[§_-d6§.TANGENT4]);
|
||||
}
|
||||
}
|
||||
if(this.reflectionMap != null)
|
||||
@@ -358,11 +358,11 @@ package package_4
|
||||
}
|
||||
drawUnit.alternativa3d::setTextureAt(envProgram.sTexture,diffuseMap.alternativa3d::_texture);
|
||||
drawUnit.alternativa3d::setTextureAt(envProgram.sCubeMap,this.environmentMap.alternativa3d::_texture);
|
||||
var cameraToLocalTransform:name_139 = object.alternativa3d::cameraToLocalTransform;
|
||||
drawUnit.alternativa3d::name_134(envProgram.cCamera,cameraToLocalTransform.d,cameraToLocalTransform.h,cameraToLocalTransform.l);
|
||||
drawUnit.alternativa3d::name_134(envProgram.cAlpha,0,1 - this.reflection,this.reflection,alpha);
|
||||
var cameraToLocalTransform:§_-jw§ = object.alternativa3d::cameraToLocalTransform;
|
||||
drawUnit.alternativa3d::_-Ry(envProgram.cCamera,cameraToLocalTransform.d,cameraToLocalTransform.h,cameraToLocalTransform.l);
|
||||
drawUnit.alternativa3d::_-Ry(envProgram.cAlpha,0,1 - this.reflection,this.reflection,alpha);
|
||||
drawUnit.alternativa3d::setTextureAt(program.fragmentShader.getVariableIndex("sTexture"),diffuseMap.alternativa3d::_texture);
|
||||
if(!var_21 && opacityMap != null)
|
||||
if(!§_-L4§ && opacityMap != null)
|
||||
{
|
||||
drawUnit.alternativa3d::setTextureAt(program.fragmentShader.getVariableIndex("sOpacity"),opacityMap.alternativa3d::_texture);
|
||||
}
|
||||
@@ -370,12 +370,12 @@ package package_4
|
||||
{
|
||||
lm = object.alternativa3d::localToCameraTransform;
|
||||
dist = alternativa3d::fogFar - alternativa3d::fogNear;
|
||||
drawUnit.alternativa3d::name_144(program.vertexShader.getVariableIndex("cFogSpace"),lm.i / dist,lm.j / dist,lm.k / dist,(lm.l - alternativa3d::fogNear) / dist);
|
||||
drawUnit.alternativa3d::name_134(program.fragmentShader.getVariableIndex("cFogRange"),alternativa3d::fogMaxDensity,1,0,1 - alternativa3d::fogMaxDensity);
|
||||
drawUnit.alternativa3d:: if(program.vertexShader.getVariableIndex("cFogSpace"),lm.i / dist,lm.j / dist,lm.k / dist,(lm.l - alternativa3d::fogNear) / dist);
|
||||
drawUnit.alternativa3d::_-Ry(program.fragmentShader.getVariableIndex("cFogRange"),alternativa3d::fogMaxDensity,1,0,1 - alternativa3d::fogMaxDensity);
|
||||
}
|
||||
if(alternativa3d::fogMode == alternativa3d::SIMPLE)
|
||||
{
|
||||
drawUnit.alternativa3d::name_134(program.fragmentShader.getVariableIndex("cFogColor"),alternativa3d::fogColorR,alternativa3d::fogColorG,alternativa3d::fogColorB);
|
||||
drawUnit.alternativa3d::_-Ry(program.fragmentShader.getVariableIndex("cFogColor"),alternativa3d::fogColorR,alternativa3d::fogColorG,alternativa3d::fogColorB);
|
||||
}
|
||||
if(alternativa3d::fogMode == alternativa3d::ADVANCED)
|
||||
{
|
||||
@@ -386,7 +386,7 @@ package package_4
|
||||
{
|
||||
bmd.setPixel(i,0,i / 32 * 255 << 16);
|
||||
}
|
||||
alternativa3d::fogTexture = new name_93(bmd);
|
||||
alternativa3d::fogTexture = new §_-b1§(bmd);
|
||||
alternativa3d::fogTexture.upload(camera.alternativa3d::context3D);
|
||||
}
|
||||
cLocal = camera.alternativa3d::localToGlobalTransform;
|
||||
@@ -409,26 +409,26 @@ package package_4
|
||||
rightY /= lens;
|
||||
uScale = Math.acos(leftX * rightX + leftY * rightY) / Math.PI / 2;
|
||||
uRight = angle / Math.PI / 2;
|
||||
drawUnit.alternativa3d::name_134(program.fragmentShader.getVariableIndex("cFogConsts"),0.5 * uScale,0.5 - uRight,0);
|
||||
drawUnit.alternativa3d::_-Ry(program.fragmentShader.getVariableIndex("cFogConsts"),0.5 * uScale,0.5 - uRight,0);
|
||||
drawUnit.alternativa3d::setTextureAt(program.fragmentShader.getVariableIndex("sFogTexture"),alternativa3d::fogTexture.alternativa3d::_texture);
|
||||
}
|
||||
if(var_21 || opacityMap != null || alpha < 1)
|
||||
if(Boolean(§_-L4§) || opacityMap != null || alpha < 1)
|
||||
{
|
||||
drawUnit.alternativa3d::blendSource = Context3DBlendFactor.SOURCE_ALPHA;
|
||||
drawUnit.alternativa3d::blendDestination = Context3DBlendFactor.ONE_MINUS_SOURCE_ALPHA;
|
||||
camera.alternativa3d::renderer.alternativa3d::name_130(drawUnit,objectRenderPriority >= 0 ? objectRenderPriority : name_128.TRANSPARENT_SORT);
|
||||
camera.alternativa3d::renderer.alternativa3d::_-SH(drawUnit,objectRenderPriority >= 0 ? objectRenderPriority : int(§_-WR§.TRANSPARENT_SORT));
|
||||
}
|
||||
else
|
||||
{
|
||||
camera.alternativa3d::renderer.alternativa3d::name_130(drawUnit,objectRenderPriority >= 0 ? objectRenderPriority : name_128.OPAQUE);
|
||||
camera.alternativa3d::renderer.alternativa3d::_-SH(drawUnit,objectRenderPriority >= 0 ? objectRenderPriority : int(§_-WR§.OPAQUE));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import package_30.name_121;
|
||||
import §_-M8§.§_-hR§;
|
||||
|
||||
class EnvironmentMaterialShaderProgram extends name_127
|
||||
class EnvironmentMaterialShaderProgram extends §_-RB§
|
||||
{
|
||||
public var aTangent:int = -1;
|
||||
|
||||
@@ -454,21 +454,21 @@ class EnvironmentMaterialShaderProgram extends name_127
|
||||
|
||||
public var sReflection:int = -1;
|
||||
|
||||
public function EnvironmentMaterialShaderProgram(vertexShader:name_121, fragmentShader:name_121)
|
||||
public function EnvironmentMaterialShaderProgram(vertexShader:§_-hR§, fragmentShader:§_-hR§)
|
||||
{
|
||||
super(vertexShader,fragmentShader);
|
||||
this.aPosition = vertexShader.getVariableIndex("aPosition");
|
||||
this.aNormal = vertexShader.getVariableIndex("aNormal");
|
||||
this.aUV = vertexShader.getVariableIndex("aUV");
|
||||
if(fragmentShader.method_286("sBump"))
|
||||
if(fragmentShader.§_-oj§("sBump"))
|
||||
{
|
||||
this.sBump = fragmentShader.getVariableIndex("sBump");
|
||||
}
|
||||
if(vertexShader.method_286("aTangent"))
|
||||
if(vertexShader.§_-oj§("aTangent"))
|
||||
{
|
||||
this.aTangent = vertexShader.getVariableIndex("aTangent");
|
||||
}
|
||||
if(fragmentShader.method_286("sReflection"))
|
||||
if(fragmentShader.§_-oj§("sReflection"))
|
||||
{
|
||||
this.sReflection = fragmentShader.getVariableIndex("sReflection");
|
||||
}
|
||||
@@ -477,7 +477,7 @@ class EnvironmentMaterialShaderProgram extends name_127
|
||||
this.sCubeMap = fragmentShader.getVariableIndex("sCubeMap");
|
||||
this.cCamera = fragmentShader.getVariableIndex("cCamera");
|
||||
this.cAlpha = fragmentShader.getVariableIndex("cAlpha");
|
||||
if(fragmentShader.method_286("sOpacity"))
|
||||
if(fragmentShader.§_-oj§("sOpacity"))
|
||||
{
|
||||
this.sOpacity = fragmentShader.getVariableIndex("sOpacity");
|
||||
}
|
||||
231
src/?_-Wh?/?_-4Q?.as
Normal file
@@ -0,0 +1,231 @@
|
||||
package §_-Wh§
|
||||
{
|
||||
import §_-8D§.§_-OX§;
|
||||
import §_-Ex§.§_-2S§;
|
||||
import §_-LX§.§_-VO§;
|
||||
import §_-US§.§_-4q§;
|
||||
import §_-US§.§_-BV§;
|
||||
import §_-Vh§.§_-YD§;
|
||||
import §_-aG§.§_-7-§;
|
||||
import §_-az§.§_-2J§;
|
||||
import §_-az§.§_-AG§;
|
||||
import §_-e6§.§_-1I§;
|
||||
import §_-e6§.§_-Kn§;
|
||||
import §_-fj§.§_-cx§;
|
||||
import §_-fj§.§_-gd§;
|
||||
import §_-fj§.§_-nL§;
|
||||
import §_-jd§.§_-82§;
|
||||
import §_-nl§.Matrix4;
|
||||
import §_-nl§.§_-bj§;
|
||||
import §_-pe§.§_-m3§;
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import §default§.§_-dT§;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class §_-4Q§ extends §_-2J§ implements §_-Kn§
|
||||
{
|
||||
private static var material:§_-YD§ = new §_-YD§(11141120);
|
||||
|
||||
private static var bodyMaterial:§_-YD§ = new §_-YD§(43520);
|
||||
|
||||
private static var eulerAngles:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var chassis:§_-cx§;
|
||||
|
||||
private var turret:§_-82§;
|
||||
|
||||
private var §_-hF§:Vector.<CollisionPrimitive3D>;
|
||||
|
||||
private var §_-ec§:§_-OX§;
|
||||
|
||||
private var rays:Vector.<RayEntry>;
|
||||
|
||||
public function §_-4Q§()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function initComponent() : void
|
||||
{
|
||||
var collisionBox:§_-m3§ = null;
|
||||
var hs:§_-bj§ = null;
|
||||
var box:§_-7-§ = null;
|
||||
var wireFrame:§_-2S§ = null;
|
||||
this.chassis = §_-cx§(entity.getComponentStrict(§_-cx§));
|
||||
this.turret = §_-82§(entity.getComponentStrict(§_-82§));
|
||||
this.§_-hF§ = new Vector.<CollisionPrimitive3D>();
|
||||
var body:§_-BV§ = this.chassis.getBody();
|
||||
for(var item:§_-4q§ = body.collisionPrimitives.head; item != null; )
|
||||
{
|
||||
collisionBox = §_-m3§(item.primitive);
|
||||
hs = collisionBox.hs.clone().scale(2);
|
||||
box = new §_-7-§(hs.x,hs.y,hs.z);
|
||||
wireFrame = §_-2S§.§_-LJ§(box,16711680);
|
||||
this.§_-hF§.push(new CollisionPrimitive3D(collisionBox,wireFrame));
|
||||
item = item.next;
|
||||
}
|
||||
var trackedChassisGraphicsComponent:§_-VO§ = §_-VO§(entity.getComponentStrict(§_-VO§));
|
||||
var hull:§_-dT§ = trackedChassisGraphicsComponent.§_-lD§();
|
||||
hs = hull.§_-eh§.hs.clone().scale(2);
|
||||
box = new §_-7-§(hs.x,hs.y,hs.z);
|
||||
this.§_-ec§ = §_-2S§.§_-LJ§(box,65280);
|
||||
this.§_-CT§();
|
||||
}
|
||||
|
||||
private function §_-CT§() : void
|
||||
{
|
||||
this.rays = new Vector.<RayEntry>();
|
||||
this.§_-6S§(this.chassis.§_-Ei§,this.rays);
|
||||
this.§_-6S§(this.chassis.§_-iA§,this.rays);
|
||||
}
|
||||
|
||||
private function §_-6S§(track:§_-nL§, rays:Vector.<RayEntry>) : void
|
||||
{
|
||||
var ray:§_-gd§ = null;
|
||||
var box:§_-7-§ = null;
|
||||
var wireFrame1:§_-2S§ = null;
|
||||
var wireFrame2:§_-2S§ = null;
|
||||
for each(ray in track.rays)
|
||||
{
|
||||
box = new §_-7-§(10,10,10);
|
||||
wireFrame1 = §_-2S§.§_-LJ§(box,255);
|
||||
box = new §_-7-§(10,10,10);
|
||||
wireFrame2 = §_-2S§.§_-LJ§(box,65535);
|
||||
rays.push(new RayEntry(ray,wireFrame1,wireFrame2));
|
||||
}
|
||||
}
|
||||
|
||||
override public function addToGame(gameKernel:§_-AG§) : void
|
||||
{
|
||||
var collisionPrimitive3D:CollisionPrimitive3D = null;
|
||||
var rayEntry:RayEntry = null;
|
||||
var renderSystem:§_-1I§ = gameKernel.§_-DZ§();
|
||||
for each(collisionPrimitive3D in this.§_-hF§)
|
||||
{
|
||||
this.§_-Ab§(renderSystem,collisionPrimitive3D.skin);
|
||||
}
|
||||
this.§_-Ab§(renderSystem,this.§_-ec§);
|
||||
for each(rayEntry in this.rays)
|
||||
{
|
||||
this.§_-Ab§(renderSystem,rayEntry.originSkin);
|
||||
this.§_-Ab§(renderSystem,rayEntry.endSkin);
|
||||
}
|
||||
renderSystem.§_-mA§(this);
|
||||
}
|
||||
|
||||
override public function removeFromGame(gameKernel:§_-AG§) : void
|
||||
{
|
||||
var collisionPrimitive3D:CollisionPrimitive3D = null;
|
||||
var rayEntry:RayEntry = null;
|
||||
var renderSystem:§_-1I§ = gameKernel.§_-DZ§();
|
||||
for each(collisionPrimitive3D in this.§_-hF§)
|
||||
{
|
||||
this.§_-Je§(renderSystem,collisionPrimitive3D.skin);
|
||||
}
|
||||
for each(rayEntry in this.rays)
|
||||
{
|
||||
this.§_-Je§(renderSystem,rayEntry.originSkin);
|
||||
this.§_-Je§(renderSystem,rayEntry.endSkin);
|
||||
}
|
||||
this.§_-Je§(renderSystem,this.§_-ec§);
|
||||
gameKernel.§_-DZ§().§_-EI§(this);
|
||||
}
|
||||
|
||||
private function §_-Ab§(renderSystem:§_-1I§, object:§_-OX§) : void
|
||||
{
|
||||
renderSystem.§_-Bj§().addChild(object);
|
||||
renderSystem.§_-IL§(object.getResources());
|
||||
}
|
||||
|
||||
private function §_-Je§(renderSystem:§_-1I§, object:§_-OX§) : void
|
||||
{
|
||||
object.alternativa3d::removeFromParent();
|
||||
renderSystem.§_-Jb§(object.getResources());
|
||||
}
|
||||
|
||||
public function render() : void
|
||||
{
|
||||
var entry:CollisionPrimitive3D = null;
|
||||
var body:§_-BV§ = null;
|
||||
var rayEntry:RayEntry = null;
|
||||
var transform:Matrix4 = null;
|
||||
var skin:§_-OX§ = null;
|
||||
var worldPos:§_-bj§ = null;
|
||||
var rayLength:Number = NaN;
|
||||
for each(entry in this.§_-hF§)
|
||||
{
|
||||
transform = entry.collisionPrimitive.transform;
|
||||
transform.§_-fJ§(eulerAngles);
|
||||
skin = entry.skin;
|
||||
skin.x = transform.d;
|
||||
skin.y = transform.h;
|
||||
skin.z = transform.l;
|
||||
skin.rotationX = eulerAngles.x;
|
||||
skin.rotationY = eulerAngles.y;
|
||||
skin.rotationZ = eulerAngles.z;
|
||||
}
|
||||
body = this.chassis.getBody();
|
||||
body.baseMatrix.§_-fJ§(eulerAngles);
|
||||
this.§_-ec§.rotationX = eulerAngles.x;
|
||||
this.§_-ec§.rotationY = eulerAngles.y;
|
||||
this.§_-ec§.rotationZ = eulerAngles.z;
|
||||
this.§_-ec§.x = body.state.position.x;
|
||||
this.§_-ec§.y = body.state.position.y;
|
||||
this.§_-ec§.z = body.state.position.z;
|
||||
for each(rayEntry in this.rays)
|
||||
{
|
||||
worldPos = rayEntry.ray.worldPos;
|
||||
rayEntry.originSkin.x = worldPos.x;
|
||||
rayEntry.originSkin.y = worldPos.y;
|
||||
rayEntry.originSkin.z = worldPos.z;
|
||||
if(rayEntry.ray.§_-n3§)
|
||||
{
|
||||
rayLength = Number(rayEntry.ray.§_-ZA§.t);
|
||||
}
|
||||
else
|
||||
{
|
||||
rayLength = Number(this.chassis.§_-CF§.rayLength);
|
||||
}
|
||||
rayEntry.endSkin.x = worldPos.x + rayEntry.ray.§_-Py§.x * rayLength;
|
||||
rayEntry.endSkin.y = worldPos.y + rayEntry.ray.§_-Py§.y * rayLength;
|
||||
rayEntry.endSkin.z = worldPos.z + rayEntry.ray.§_-Py§.z * rayLength;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import §_-1e§.§_-Nh§;
|
||||
import §_-8D§.§_-OX§;
|
||||
import §_-fj§.§_-gd§;
|
||||
|
||||
class CollisionPrimitive3D
|
||||
{
|
||||
public var collisionPrimitive:§_-Nh§;
|
||||
|
||||
public var skin:§_-OX§;
|
||||
|
||||
public function CollisionPrimitive3D(collisionPrimitive:§_-Nh§, skin:§_-OX§)
|
||||
{
|
||||
super();
|
||||
this.collisionPrimitive = collisionPrimitive;
|
||||
this.skin = skin;
|
||||
}
|
||||
}
|
||||
|
||||
class RayEntry
|
||||
{
|
||||
public var ray:§_-gd§;
|
||||
|
||||
public var originSkin:§_-OX§;
|
||||
|
||||
public var endSkin:§_-OX§;
|
||||
|
||||
public function RayEntry(ray:§_-gd§, originSkin:§_-OX§, endSkin:§_-OX§)
|
||||
{
|
||||
super();
|
||||
this.ray = ray;
|
||||
this.originSkin = originSkin;
|
||||
this.endSkin = endSkin;
|
||||
}
|
||||
}
|
||||
1431
src/?_-YQ?/?_-A3?.as
Normal file
92
src/?_-YQ?/?_-DN?.as
Normal file
@@ -0,0 +1,92 @@
|
||||
package §_-YQ§
|
||||
{
|
||||
import §_-Ex§.§_-5P§;
|
||||
import §_-I0§.§_-Jv§;
|
||||
import §_-O5§.§_-Hk§;
|
||||
import §_-RG§.A3DMapComponent;
|
||||
import §_-az§.§_-AG§;
|
||||
import §_-az§.§_-gw§;
|
||||
import §_-az§.§_-ps§;
|
||||
import §_-cv§.§_-YU§;
|
||||
import §_-cv§.§_-cP§;
|
||||
import §_-cv§.§_-dD§;
|
||||
import §_-e6§.§_-1I§;
|
||||
import flash.display.DisplayObjectContainer;
|
||||
|
||||
public class §_-DN§ extends §_-ps§
|
||||
{
|
||||
private var gameKernel:§_-AG§;
|
||||
|
||||
private var config:§_-YU§;
|
||||
|
||||
private var container:DisplayObjectContainer;
|
||||
|
||||
private var preloader:Preloader;
|
||||
|
||||
public function §_-DN§(param1:§_-AG§, param2:§_-YU§, param3:DisplayObjectContainer, param4:Preloader)
|
||||
{
|
||||
super(§_-AG§.EVENT_SYSTEM_PRIORITY + 1);
|
||||
this.gameKernel = param1;
|
||||
this.config = param2;
|
||||
this.preloader = param4;
|
||||
this.container = param3;
|
||||
}
|
||||
|
||||
override public function run() : void
|
||||
{
|
||||
var _loc1_:§_-1I§ = this.gameKernel.§_-DZ§();
|
||||
var _loc2_:§_-Jv§ = new §_-Jv§(_loc1_.§_-GW§(),this.gameKernel.§_-Ku§());
|
||||
_loc1_.§_-N8§(_loc2_);
|
||||
_loc2_.§_-oa§(0,0,1000);
|
||||
_loc2_.§_-38§(0,2000,0);
|
||||
this.container.addChild(_loc1_.§_-0D§());
|
||||
var _loc3_:§_-gw§ = this.§_-pL§();
|
||||
this.gameKernel.§_-oR§(_loc3_);
|
||||
this.preloader.§_-QU§(0.75);
|
||||
§_-Uw§.addTask(new §_-A3§(§_-AG§.INPUT_SYSTEM_PRIORITY + 1,this.config,this.gameKernel,_loc2_,this.preloader));
|
||||
§_-Uw§.killTask(this);
|
||||
}
|
||||
|
||||
private function §_-pL§() : §_-gw§
|
||||
{
|
||||
var _loc2_:§_-Hk§ = null;
|
||||
var _loc6_:§_-dD§ = null;
|
||||
var _loc7_:String = null;
|
||||
var _loc3_:§_-cP§ = this.config.§_-WG§.§_-hJ§("skybox");
|
||||
if(_loc3_ != null)
|
||||
{
|
||||
_loc2_ = new §_-Hk§();
|
||||
_loc6_ = _loc3_.§_-EZ§(this.config.§_-f§());
|
||||
for each(_loc7_ in [§_-5P§.BACK,§_-5P§.BOTTOM,§_-5P§.FRONT,§_-5P§.LEFT,§_-5P§.RIGHT,§_-5P§.TOP])
|
||||
{
|
||||
_loc2_.§_-9v§(_loc7_,_loc6_.§_-Vf§(_loc7_));
|
||||
}
|
||||
}
|
||||
var _loc4_:§_-gw§ = new §_-gw§(§_-gw§.§_-9o§());
|
||||
var _loc5_:A3DMapComponent = new A3DMapComponent(this.config.mapData,_loc2_,1000000,new MapListener(this.gameKernel.§_-Ev§()));
|
||||
_loc4_.§_-2d§(_loc5_);
|
||||
_loc4_.§_-m7§();
|
||||
return _loc4_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import §_-RG§.§_-7J§;
|
||||
import §_-az§.§_-Ss§;
|
||||
import §_-j-§.§_-B7§;
|
||||
|
||||
class MapListener implements §_-7J§
|
||||
{
|
||||
private var eventSystem:§_-B7§;
|
||||
|
||||
public function MapListener(param1:§_-B7§)
|
||||
{
|
||||
super();
|
||||
this.eventSystem = param1;
|
||||
}
|
||||
|
||||
public function onA3DMapComplete() : void
|
||||
{
|
||||
this.eventSystem.dispatchEvent(§_-Ss§.MAP_COMPLETE,null);
|
||||
}
|
||||
}
|
||||
699
src/?_-Yj?/TankMaterial2.as
Normal file
@@ -0,0 +1,699 @@
|
||||
package §_-Yj§
|
||||
{
|
||||
import §_-1z§.§_-b1§;
|
||||
import §_-1z§.§_-gA§;
|
||||
import §_-1z§.§_-pi§;
|
||||
import §_-8D§.§_-Jo§;
|
||||
import §_-8D§.§_-OX§;
|
||||
import §_-8D§.§_-QF§;
|
||||
import §_-8D§.§_-WR§;
|
||||
import §_-8D§.§_-be§;
|
||||
import §_-8D§.§_-d6§;
|
||||
import §_-8D§.§_-jw§;
|
||||
import §_-Ex§.§_-a2§;
|
||||
import §_-M8§.§_-5§;
|
||||
import §_-M8§.§_-Xk§;
|
||||
import §_-M8§.§_-hR§;
|
||||
import §_-R1§.DirectionalLight;
|
||||
import §_-R1§.OmniLight;
|
||||
import §_-Vh§.§_-Pt§;
|
||||
import §_-Vh§.§_-RB§;
|
||||
import §_-Vh§.§_-b9§;
|
||||
import §_-Vh§.§_-pZ§;
|
||||
import §_-Z2§.§_-ZC§;
|
||||
import §_-Z2§.§_-cD§;
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import flash.display.BitmapData;
|
||||
import flash.display3D.Context3DBlendFactor;
|
||||
import flash.display3D.Context3DProgramType;
|
||||
import flash.display3D.VertexBuffer3D;
|
||||
import flash.utils.Dictionary;
|
||||
import flash.utils.getDefinitionByName;
|
||||
import flash.utils.getQualifiedClassName;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class TankMaterial2 extends §_-pZ§
|
||||
{
|
||||
private static var fogTexture:§_-pi§;
|
||||
|
||||
public static const DISABLED:int = 0;
|
||||
|
||||
public static const SIMPLE:int = 1;
|
||||
|
||||
public static const ADVANCED:int = 2;
|
||||
|
||||
public static var fogMode:int = DISABLED;
|
||||
|
||||
public static var fogNear:Number = 1000;
|
||||
|
||||
public static var fogFar:Number = 5000;
|
||||
|
||||
public static var fogMaxDensity:Number = 1;
|
||||
|
||||
public static var fogColorR:Number = 200 / 255;
|
||||
|
||||
public static var fogColorG:Number = 162 / 255;
|
||||
|
||||
public static var fogColorB:Number = 200 / 255;
|
||||
|
||||
private static const passSimpleFogConstProcedure:§_-Xk§ = new §_-Xk§(["#v0=vZDistance","#c0=cFogSpace","dp4 t0.z, i0, c0","mov v0, t0.zzzz","sub v0.y, i0.w, t0.z"],"passSimpleFogConst");
|
||||
|
||||
private static const outputWithSimpleFogProcedure:§_-Xk§ = new §_-Xk§(["#v0=vZDistance","#c0=cFogColor","#c1=cFogRange","min t0.xy, v0.xy, c1.xy","max t0.xy, t0.xy, c1.zw","mul t1.xyz, c0.xyz, t0.x","mov t1.w, t0.y","mov o0, t1"],"outputWithSimpleFog");
|
||||
|
||||
private static const postPassAdvancedFogConstProcedure:§_-Xk§ = new §_-Xk§(["#v0=vZDistance","#c0=cFogSpace","dp4 t0.z, i0, c0","mov v0, t0.zzzz","sub v0.y, i0.w, t0.z","mov v0.zw, i1.xwxw","mov o0, i1"],"postPassAdvancedFogConst");
|
||||
|
||||
private static const outputWithAdvancedFogProcedure:§_-Xk§ = new §_-Xk§(["#v0=vZDistance","#c0=cFogConsts","#c1=cFogRange","#s0=sFogTexture","min t0.xy, v0.xy, c1.xy","max t0.xy, t0.xy, c1.zw","mov t1.xyzw, c0.yyzw","div t0.z, v0.z, v0.w","mul t0.z, t0.z, c0.x","add t1.x, t1.x, t0.z","tex t1, t1, s0 <2d, repeat, linear, miplinear>","mul t1.xyz, t1.xyz, t0.x","mov t1.w, t0.y","mov o0, t1"],"outputWithAdvancedFog");
|
||||
|
||||
private static const objectsProgramsSets:Dictionary = new Dictionary();
|
||||
|
||||
private static const lightContainer:Vector.<§_-Jo§> = new Vector.<§_-Jo§>(1,true);
|
||||
|
||||
private static const actualLigths:Vector.<§_-Jo§> = new Vector.<§_-Jo§>();
|
||||
|
||||
private static const passUVProcedure:§_-Xk§ = new §_-Xk§(["#a0=aUV","#v0=vUV","mov v0, a0"],"passUVProcedure");
|
||||
|
||||
private static const diffuseProcedure:§_-Xk§ = §_-Xk§.§_-En§(["#v0=vUV","#c0=cTiling","#s0=sColormap","#s1=sDiffuse","#s2=sSurface","mul t0, v0, c0","tex t1, t0, s0 <2d, repeat, linear, miplinear>","tex t0, v0, s1 <2d, clamp, linear, miplinear>","add t2, t0, t0","mul t2, t2, t1","tex t1, v0, s2 <2d, clamp, linear, miplinear>","mul t2, t2, t1.x","add t2, t2, t0","mul t0, t0, t1.x","sub o0, t2, t0"],"diffuse");
|
||||
|
||||
private static const setColorProcedure:§_-Xk§ = new §_-Xk§(["mov o0, i0"],"setColorProcedure");
|
||||
|
||||
private static const outputWithLightProcedure:§_-Xk§ = new §_-Xk§(["mul t0.xyz, i0.xyz, i1.xyz","mov t0.w, i1.w","mov o0, t0"],"outputWithLightProcedure");
|
||||
|
||||
private static const outputProcedure:§_-Xk§ = new §_-Xk§(["mov o0, i0"],"outputProcedure");
|
||||
|
||||
private static const passVaryingsProcedure:§_-Xk§ = new §_-Xk§(["#c0=cCamera","#v0=vPosition","#v1=vViewVector","mov v0, i0","sub t0, c0, i0","mov v1.xyz, t0.xyz","mov v1.w, c0.w"],"passVaryingsProcedure");
|
||||
|
||||
private static const getNormalAndViewProcedure:§_-Xk§ = new §_-Xk§(["#v0=vUV","#v1=vViewVector","#c0=cSurface","#s0=sBump","tex t0, v0, s0 <2d,clamp,linear,miplinear>","add t0, t0, t0","sub t0.xyz, t0.xyz, c0.www","neg t0.y, t0.y","nrm o0.xyz, t0.xyz","nrm o1.xyz, v1"],"getNormalAndViewProcedure");
|
||||
|
||||
private static const getSpecularOptionsProcedure:§_-Xk§ = new §_-Xk§(["#v0=vUV","#c0=cSurface","#s0=sSurface","tex t0, v0, s0 <2d, clamp, linear, miplinear>","mul i0.w, c0.y, t0.z","mul i1.w, c0.z, t0.y"],"getSpecularOptionsProcedure");
|
||||
|
||||
public var diffuse:§_-pi§;
|
||||
|
||||
public var colorMap:§_-pi§;
|
||||
|
||||
public var surfaceMap:§_-pi§;
|
||||
|
||||
public var §_-jM§:Number = 1;
|
||||
|
||||
public var §_-Sf§:Number = 1;
|
||||
|
||||
public var normalMap:§_-pi§;
|
||||
|
||||
public var glossiness:Number = 100;
|
||||
|
||||
public var §_-kj§:Number = 1;
|
||||
|
||||
private const outputWithSpecularProcedure:§_-Xk§ = new §_-Xk§(["mul t0.xyz, i0.xyz, i1.xyz","add t0.xyz, t0.xyz, i2.xyz","mov t0.w, i1.w","mov o0, t0"],"outputWithSpecularProcedure");
|
||||
|
||||
public function TankMaterial2(colorMap:§_-pi§ = null, diffuse:§_-pi§ = null, normalMap:§_-pi§ = null, surfaceMap:§_-pi§ = null)
|
||||
{
|
||||
super();
|
||||
this.colorMap = colorMap;
|
||||
this.diffuse = diffuse;
|
||||
this.normalMap = normalMap;
|
||||
this.surfaceMap = surfaceMap;
|
||||
}
|
||||
|
||||
public static function §_-RX§(texture:§_-pi§) : void
|
||||
{
|
||||
fogTexture = texture;
|
||||
}
|
||||
|
||||
private static function directionalProcedure(light:§_-Jo§, add:Boolean) : §_-Xk§
|
||||
{
|
||||
return new §_-Xk§(["#c0=c" + light.alternativa3d::_-oG + "Direction","#c1=c" + light.alternativa3d::_-oG + "Color","add t0.xyz, i1.xyz, c0.xyz","nrm t0.xyz, t0.xyz","dp3 t0.w, t0.xyz, i0.xyz","pow t0.w, t0.w, i0.w","mul t0.w, t0.w, i1.w","dp3 t0.x, i0.xyz, c0.xyz","sat t0.x, t0.x",add ? "mul t0.xyz, c1.xyz, t0.x" : "mul o0.xyz, c1.xyz, t0.x",add ? "add o0.xyz, o0.xyz, t0.xyz" : "mov o0.w, c0.w",add ? "mul t0.xyz, c1.xyz, t0.w" : "mul o1.xyz, c1.xyz, t0.w",add ? "add o1.xyz, o1.xyz, t0.xyz" : "mov o1.w, c0.w"],"directionalProcedure");
|
||||
}
|
||||
|
||||
private static function omniProcedure(light:§_-Jo§, add:Boolean) : §_-Xk§
|
||||
{
|
||||
return new §_-Xk§(["#c0=c" + light.alternativa3d::_-oG + "Position","#c1=c" + light.alternativa3d::_-oG + "Color","#c2=c" + light.alternativa3d::_-oG + "Radius","#v0=vPosition","sub t0, c0, v0","dp3 t0.w, t0.xyz, t0.xyz","nrm t0.xyz, t0.xyz","add t1.xyz, i1.xyz, t0.xyz","mov t1.w, c0.w","nrm t1.xyz, t1.xyz","dp3 t1.w, t1.xyz, i0.xyz","pow t1.w, t1.w, i0.w","mul t1.w, t1.w, i1.w","sqt t1.x, t0.w","dp3 t0.w, t0.xyz, i0.xyz","sub t0.x, t1.x, c2.z","div t0.y, t0.x, c2.y","sub t0.x, c2.x, t0.y","sat t0.xw, t0.xw","mul t0.xyz, c1.xyz, t0.xxx",add ? "mul t1.xyz, t0.xyz, t0.w" : "mul o0.xyz, t0.xyz, t0.w",add ? "add o0.xyz, o0.xyz, t1.xyz" : "mov o0.w, c0.w",add ? "mul t1.xyz, t0.xyz, t1.w" : "mul o1.xyz, t0.xyz, t1.w",add ? "add o1.xyz, o1.xyz, t1.xyz" : "mov o1.w, c0.w"],"omniProcedure");
|
||||
}
|
||||
|
||||
override alternativa3d function fillResources(resources:Dictionary, resourceType:Class) : void
|
||||
{
|
||||
super.alternativa3d::fillResources(resources,resourceType);
|
||||
if(this.diffuse != null && Boolean(§_-Pt§.alternativa3d::_-EU(getDefinitionByName(getQualifiedClassName(this.diffuse)) as Class,resourceType)))
|
||||
{
|
||||
resources[this.diffuse] = true;
|
||||
}
|
||||
if(this.colorMap != null && Boolean(§_-Pt§.alternativa3d::_-EU(getDefinitionByName(getQualifiedClassName(this.colorMap)) as Class,resourceType)))
|
||||
{
|
||||
resources[this.colorMap] = true;
|
||||
}
|
||||
if(this.normalMap != null && Boolean(§_-Pt§.alternativa3d::_-EU(getDefinitionByName(getQualifiedClassName(this.normalMap)) as Class,resourceType)))
|
||||
{
|
||||
resources[this.normalMap] = true;
|
||||
}
|
||||
if(this.surfaceMap != null && Boolean(§_-Pt§.alternativa3d::_-EU(getDefinitionByName(getQualifiedClassName(this.surfaceMap)) as Class,resourceType)))
|
||||
{
|
||||
resources[this.surfaceMap] = true;
|
||||
}
|
||||
}
|
||||
|
||||
override alternativa3d function collectDraws(camera:§_-be§, surface:§_-a2§, geometry:§_-gA§, lights:Vector.<§_-Jo§>, lightsLength:int, objectRenderPriority:int = -1) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var light:§_-Jo§ = null;
|
||||
var shadowedLight:DirectionalLight = null;
|
||||
var drawUnit:§_-QF§ = null;
|
||||
var shadowOrAmbientProgram:ShadowOrAmbientProgram = null;
|
||||
var lightingProgram:LightingProgram = null;
|
||||
var numShadows:int = 0;
|
||||
var shadow:§_-ZC§ = null;
|
||||
var lightsPrograms:Dictionary = null;
|
||||
var fogProgram:FogProgram = null;
|
||||
if(this.diffuse == null || this.colorMap == null || this.normalMap == null || this.surfaceMap == null || this.diffuse.alternativa3d::_texture == null || this.colorMap.alternativa3d::_texture == null || this.normalMap.alternativa3d::_texture == null || this.surfaceMap.alternativa3d::_texture == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var object:§_-OX§ = surface.alternativa3d::object;
|
||||
var positionBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(§_-d6§.POSITION);
|
||||
var uvBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(§_-d6§.TEXCOORDS[0]);
|
||||
if(positionBuffer == null || uvBuffer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var lightsKey:String = "";
|
||||
var actualLightsLength:int = 0;
|
||||
for(i = 0; i < lightsLength; )
|
||||
{
|
||||
light = lights[i];
|
||||
if(light is DirectionalLight && shadowedLight == null && DirectionalLight(light).shadow != null)
|
||||
{
|
||||
shadowedLight = DirectionalLight(light);
|
||||
}
|
||||
else if(actualLightsLength < 8 && (light is OmniLight || light is DirectionalLight))
|
||||
{
|
||||
actualLigths[actualLightsLength] = light;
|
||||
lightsKey += light.alternativa3d::_-oG;
|
||||
actualLightsLength++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
var programs:Array = objectsProgramsSets[object.alternativa3d::transformProcedure];
|
||||
if(programs == null)
|
||||
{
|
||||
programs = [];
|
||||
objectsProgramsSets[object.alternativa3d::transformProcedure] = programs;
|
||||
}
|
||||
if(shadowedLight != null)
|
||||
{
|
||||
shadowOrAmbientProgram = programs[0];
|
||||
if(shadowOrAmbientProgram == null)
|
||||
{
|
||||
shadowOrAmbientProgram = this.§_-3O§(object,shadowedLight.shadow,true);
|
||||
shadowOrAmbientProgram.upload(camera.alternativa3d::context3D);
|
||||
programs[0] = shadowOrAmbientProgram;
|
||||
}
|
||||
drawUnit = this.§_-Mi§(shadowOrAmbientProgram,shadowedLight.shadow,true,camera,object,surface,geometry);
|
||||
}
|
||||
else
|
||||
{
|
||||
shadowOrAmbientProgram = programs[1];
|
||||
if(shadowOrAmbientProgram == null)
|
||||
{
|
||||
shadowOrAmbientProgram = this.§_-3O§(object,null,true);
|
||||
shadowOrAmbientProgram.upload(camera.alternativa3d::context3D);
|
||||
programs[1] = shadowOrAmbientProgram;
|
||||
}
|
||||
drawUnit = this.§_-Mi§(shadowOrAmbientProgram,null,true,camera,object,surface,geometry);
|
||||
}
|
||||
drawUnit.alternativa3d::blendSource = Context3DBlendFactor.ONE;
|
||||
drawUnit.alternativa3d::blendDestination = Context3DBlendFactor.ZERO;
|
||||
camera.alternativa3d::renderer.alternativa3d::_-SH(drawUnit,§_-WR§.TANK_OPAQUE);
|
||||
if(shadowedLight != null)
|
||||
{
|
||||
numShadows = object.alternativa3d::shadowRenderers != null ? int(object.alternativa3d::shadowRenderers.length) : 0;
|
||||
for(i = 0; i < numShadows; )
|
||||
{
|
||||
shadow = object.alternativa3d::shadowRenderers[i];
|
||||
if(shadow is §_-cD§)
|
||||
{
|
||||
shadowOrAmbientProgram = programs[2];
|
||||
if(shadowOrAmbientProgram == null)
|
||||
{
|
||||
shadowOrAmbientProgram = this.§_-3O§(object,shadow,false);
|
||||
shadowOrAmbientProgram.upload(camera.alternativa3d::context3D);
|
||||
programs[2] = shadowOrAmbientProgram;
|
||||
}
|
||||
drawUnit = this.§_-Mi§(shadowOrAmbientProgram,shadow,false,camera,object,surface,geometry);
|
||||
drawUnit.alternativa3d::blendSource = Context3DBlendFactor.ZERO;
|
||||
drawUnit.alternativa3d::blendDestination = Context3DBlendFactor.SOURCE_COLOR;
|
||||
camera.alternativa3d::renderer.alternativa3d::_-SH(drawUnit,§_-WR§.SHADOWS);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
lightingProgram = programs[3];
|
||||
if(lightingProgram == null)
|
||||
{
|
||||
lightContainer[0] = shadowedLight;
|
||||
lightingProgram = this.§_-F§(object,lightContainer,1);
|
||||
lightingProgram.upload(camera.alternativa3d::context3D);
|
||||
programs[3] = lightingProgram;
|
||||
}
|
||||
drawUnit = this.§_-MK§(lightingProgram,lightContainer,1,camera,object,surface,geometry);
|
||||
drawUnit.alternativa3d::blendSource = Context3DBlendFactor.DESTINATION_ALPHA;
|
||||
drawUnit.alternativa3d::blendDestination = Context3DBlendFactor.ONE;
|
||||
camera.alternativa3d::renderer.alternativa3d::_-SH(drawUnit,§_-WR§.SHADOWED_LIGHTS);
|
||||
}
|
||||
if(actualLightsLength > 0)
|
||||
{
|
||||
lightsPrograms = programs[4];
|
||||
if(lightsPrograms == null)
|
||||
{
|
||||
lightsPrograms = new Dictionary(false);
|
||||
programs[4] = lightsPrograms;
|
||||
}
|
||||
lightingProgram = lightsPrograms[lightsKey];
|
||||
if(lightingProgram == null)
|
||||
{
|
||||
lightingProgram = this.§_-F§(object,actualLigths,actualLightsLength);
|
||||
lightingProgram.upload(camera.alternativa3d::context3D);
|
||||
lightsPrograms[lightsKey] = lightingProgram;
|
||||
}
|
||||
drawUnit = this.§_-MK§(lightingProgram,actualLigths,actualLightsLength,camera,object,surface,geometry);
|
||||
drawUnit.alternativa3d::blendSource = Context3DBlendFactor.ONE;
|
||||
drawUnit.alternativa3d::blendDestination = Context3DBlendFactor.ONE;
|
||||
camera.alternativa3d::renderer.alternativa3d::_-SH(drawUnit,§_-WR§.LIGHTS);
|
||||
}
|
||||
if(fogMode == SIMPLE || fogMode == ADVANCED)
|
||||
{
|
||||
fogProgram = programs[int(fogMode + 4)];
|
||||
if(fogProgram == null)
|
||||
{
|
||||
fogProgram = this.§_-Ck§(object);
|
||||
fogProgram.upload(camera.alternativa3d::context3D);
|
||||
programs[int(fogMode + 4)] = fogProgram;
|
||||
}
|
||||
drawUnit = this.§_-P8§(fogProgram,camera,object,surface,geometry);
|
||||
drawUnit.alternativa3d::blendSource = Context3DBlendFactor.ONE;
|
||||
drawUnit.alternativa3d::blendDestination = Context3DBlendFactor.SOURCE_ALPHA;
|
||||
camera.alternativa3d::renderer.alternativa3d::_-SH(drawUnit,§_-WR§.FOG);
|
||||
}
|
||||
actualLigths.length = 0;
|
||||
}
|
||||
|
||||
private function §_-3O§(object:§_-OX§, shadow:§_-ZC§, ambient:Boolean) : ShadowOrAmbientProgram
|
||||
{
|
||||
var shadowProc:§_-Xk§ = null;
|
||||
var vertexLinker:§_-hR§ = new §_-hR§(Context3DProgramType.VERTEX);
|
||||
var fragmentLinker:§_-hR§ = new §_-hR§(Context3DProgramType.FRAGMENT);
|
||||
var positionVar:String = "aPosition";
|
||||
vertexLinker.§_-LU§(positionVar,§_-5§.ATTRIBUTE);
|
||||
if(object.alternativa3d::transformProcedure != null)
|
||||
{
|
||||
positionVar = alternativa3d::_-di(object.alternativa3d::transformProcedure,vertexLinker);
|
||||
}
|
||||
vertexLinker.§_-on§(alternativa3d::_projectProcedure);
|
||||
vertexLinker.§_-FS§(alternativa3d::_projectProcedure,positionVar);
|
||||
if(ambient)
|
||||
{
|
||||
vertexLinker.§_-on§(passUVProcedure);
|
||||
}
|
||||
var colorConst:String = ambient ? "cAmbient" : "cShadow";
|
||||
fragmentLinker.§_-LU§(colorConst,§_-5§.CONSTANT);
|
||||
fragmentLinker.§_-LU§("tLight");
|
||||
fragmentLinker.§_-on§(setColorProcedure);
|
||||
fragmentLinker.§_-FS§(setColorProcedure,colorConst);
|
||||
fragmentLinker.§_-qd§(setColorProcedure,"tLight");
|
||||
if(shadow != null)
|
||||
{
|
||||
vertexLinker.§_-on§(shadow.getVShader());
|
||||
shadowProc = shadow.getFIntensityShader();
|
||||
fragmentLinker.§_-on§(shadowProc);
|
||||
fragmentLinker.§_-qd§(shadowProc,"tLight");
|
||||
}
|
||||
if(ambient)
|
||||
{
|
||||
fragmentLinker.§_-LU§("tColor");
|
||||
fragmentLinker.§_-on§(diffuseProcedure);
|
||||
fragmentLinker.§_-qd§(diffuseProcedure,"tColor");
|
||||
fragmentLinker.§_-on§(outputWithLightProcedure);
|
||||
fragmentLinker.§_-FS§(outputWithLightProcedure,"tColor","tLight");
|
||||
}
|
||||
else
|
||||
{
|
||||
fragmentLinker.§_-on§(outputProcedure);
|
||||
fragmentLinker.§_-FS§(outputProcedure,"tLight");
|
||||
}
|
||||
fragmentLinker.§_-NA§(vertexLinker);
|
||||
return new ShadowOrAmbientProgram(vertexLinker,fragmentLinker);
|
||||
}
|
||||
|
||||
private function §_-Mi§(program:ShadowOrAmbientProgram, shadow:§_-ZC§, ambient:Boolean, camera:§_-be§, object:§_-OX§, surface:§_-a2§, geometry:§_-gA§) : §_-QF§
|
||||
{
|
||||
var positionBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(§_-d6§.POSITION);
|
||||
var uvBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(§_-d6§.TEXCOORDS[0]);
|
||||
var drawUnit:§_-QF§ = camera.alternativa3d::renderer.alternativa3d::_-2s(object,program.program,geometry.alternativa3d::_-EM,surface.indexBegin,surface.numTriangles,program);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.aPosition,positionBuffer,geometry.alternativa3d::_attributesOffsets[§_-d6§.POSITION],§_-d6§.alternativa3d::FORMATS[§_-d6§.POSITION]);
|
||||
if(ambient)
|
||||
{
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.aUV,uvBuffer,geometry.alternativa3d::_attributesOffsets[§_-d6§.TEXCOORDS[0]],§_-d6§.alternativa3d::FORMATS[§_-d6§.TEXCOORDS[0]]);
|
||||
}
|
||||
object.alternativa3d::setTransformConstants(drawUnit,surface,program.vertexShader,camera);
|
||||
drawUnit.alternativa3d::_-mQ(camera,program.cProjMatrix,object.alternativa3d::localToCameraTransform);
|
||||
if(ambient)
|
||||
{
|
||||
drawUnit.alternativa3d::_-Ry(program.cAmbient,camera.alternativa3d::ambient[0],camera.alternativa3d::ambient[1],camera.alternativa3d::ambient[2],1);
|
||||
drawUnit.alternativa3d::_-Ry(program.cTiling,this.§_-jM§,this.§_-Sf§,0,0);
|
||||
drawUnit.alternativa3d::setTextureAt(program.sDiffuse,this.diffuse.alternativa3d::_texture);
|
||||
drawUnit.alternativa3d::setTextureAt(program.sColormap,this.colorMap.alternativa3d::_texture);
|
||||
drawUnit.alternativa3d::setTextureAt(program.sSurface,this.surfaceMap.alternativa3d::_texture);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawUnit.alternativa3d::_-Ry(program.cShadow,1,1,1,1);
|
||||
}
|
||||
if(shadow != null)
|
||||
{
|
||||
shadow.applyShader(drawUnit,program,object,camera);
|
||||
}
|
||||
return drawUnit;
|
||||
}
|
||||
|
||||
private function §_-F§(object:§_-OX§, lights:Vector.<§_-Jo§>, lightsLength:int) : LightingProgram
|
||||
{
|
||||
var procedure:§_-Xk§ = null;
|
||||
var light:§_-Jo§ = null;
|
||||
var vertexLinker:§_-hR§ = new §_-hR§(Context3DProgramType.VERTEX);
|
||||
var fragmentLinker:§_-hR§ = new §_-hR§(Context3DProgramType.FRAGMENT);
|
||||
var positionVar:String = "aPosition";
|
||||
vertexLinker.§_-LU§(positionVar,§_-5§.ATTRIBUTE);
|
||||
if(object.alternativa3d::transformProcedure != null)
|
||||
{
|
||||
positionVar = alternativa3d::_-di(object.alternativa3d::transformProcedure,vertexLinker);
|
||||
}
|
||||
vertexLinker.§_-on§(alternativa3d::_projectProcedure);
|
||||
vertexLinker.§_-FS§(alternativa3d::_projectProcedure,positionVar);
|
||||
vertexLinker.§_-on§(passUVProcedure);
|
||||
vertexLinker.§_-on§(passVaryingsProcedure);
|
||||
vertexLinker.§_-FS§(passVaryingsProcedure,positionVar);
|
||||
fragmentLinker.§_-LU§("tNormal");
|
||||
fragmentLinker.§_-LU§("tView");
|
||||
fragmentLinker.§_-on§(getNormalAndViewProcedure);
|
||||
fragmentLinker.§_-qd§(getNormalAndViewProcedure,"tNormal","tView");
|
||||
fragmentLinker.§_-on§(getSpecularOptionsProcedure);
|
||||
fragmentLinker.§_-FS§(getSpecularOptionsProcedure,"tNormal","tView");
|
||||
fragmentLinker.§_-LU§("tLight");
|
||||
fragmentLinker.§_-LU§("tHLight");
|
||||
var first:Boolean = true;
|
||||
for(var i:int = 0; i < lightsLength; )
|
||||
{
|
||||
light = lights[i];
|
||||
if(light is DirectionalLight)
|
||||
{
|
||||
procedure = directionalProcedure(light,!first);
|
||||
fragmentLinker.§_-on§(procedure);
|
||||
fragmentLinker.§_-FS§(procedure,"tNormal","tView");
|
||||
fragmentLinker.§_-qd§(procedure,"tLight","tHLight");
|
||||
if(first)
|
||||
{
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
else if(light is OmniLight)
|
||||
{
|
||||
procedure = omniProcedure(light,!first);
|
||||
fragmentLinker.§_-on§(procedure);
|
||||
fragmentLinker.§_-FS§(procedure,"tNormal","tView");
|
||||
fragmentLinker.§_-qd§(procedure,"tLight","tHLight");
|
||||
if(first)
|
||||
{
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
fragmentLinker.§_-LU§("outColor");
|
||||
fragmentLinker.§_-on§(diffuseProcedure);
|
||||
fragmentLinker.§_-qd§(diffuseProcedure,"outColor");
|
||||
fragmentLinker.§_-on§(this.outputWithSpecularProcedure);
|
||||
fragmentLinker.§_-FS§(this.outputWithSpecularProcedure,"outColor","tLight","tHLight");
|
||||
fragmentLinker.§_-NA§(vertexLinker);
|
||||
return new LightingProgram(vertexLinker,fragmentLinker);
|
||||
}
|
||||
|
||||
private function §_-MK§(program:LightingProgram, lights:Vector.<§_-Jo§>, lightsLength:int, camera:§_-be§, object:§_-OX§, surface:§_-a2§, geometry:§_-gA§) : §_-QF§
|
||||
{
|
||||
var rScale:Number = NaN;
|
||||
var transform:§_-jw§ = null;
|
||||
var light:§_-Jo§ = null;
|
||||
var len:Number = NaN;
|
||||
var omni:OmniLight = null;
|
||||
var positionBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(§_-d6§.POSITION);
|
||||
var uvBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(§_-d6§.TEXCOORDS[0]);
|
||||
var drawUnit:§_-QF§ = camera.alternativa3d::renderer.alternativa3d::_-2s(object,program.program,geometry.alternativa3d::_-EM,surface.indexBegin,surface.numTriangles,program);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.aPosition,positionBuffer,geometry.alternativa3d::_attributesOffsets[§_-d6§.POSITION],§_-d6§.alternativa3d::FORMATS[§_-d6§.POSITION]);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.aUV,uvBuffer,geometry.alternativa3d::_attributesOffsets[§_-d6§.TEXCOORDS[0]],§_-d6§.alternativa3d::FORMATS[§_-d6§.TEXCOORDS[0]]);
|
||||
object.alternativa3d::setTransformConstants(drawUnit,surface,program.vertexShader,camera);
|
||||
drawUnit.alternativa3d::_-mQ(camera,program.cProjMatrix,object.alternativa3d::localToCameraTransform);
|
||||
drawUnit.alternativa3d:: if(program.cCamera,object.alternativa3d::cameraToLocalTransform.d,object.alternativa3d::cameraToLocalTransform.h,object.alternativa3d::cameraToLocalTransform.l,1);
|
||||
for(var i:int = 0; i < lightsLength; )
|
||||
{
|
||||
light = lights[i];
|
||||
if(light is DirectionalLight)
|
||||
{
|
||||
transform = light.alternativa3d::_-cl;
|
||||
len = Number(Math.sqrt(transform.c * transform.c + transform.g * transform.g + transform.k * transform.k));
|
||||
drawUnit.alternativa3d::_-Ry(program.fragmentShader.getVariableIndex("c" + light.alternativa3d::_-oG + "Direction"),-transform.c / len,-transform.g / len,-transform.k / len,1);
|
||||
drawUnit.alternativa3d::_-Ry(program.fragmentShader.getVariableIndex("c" + light.alternativa3d::_-oG + "Color"),light.alternativa3d::red,light.alternativa3d::green,light.alternativa3d::blue);
|
||||
}
|
||||
else if(light is OmniLight)
|
||||
{
|
||||
omni = OmniLight(light);
|
||||
transform = light.alternativa3d::_-cl;
|
||||
rScale = Number(Math.sqrt(transform.a * transform.a + transform.e * transform.e + transform.i * transform.i));
|
||||
rScale += Math.sqrt(transform.b * transform.b + transform.f * transform.f + transform.j * transform.j);
|
||||
rScale += Math.sqrt(transform.c * transform.c + transform.g * transform.g + transform.k * transform.k);
|
||||
rScale /= 3;
|
||||
drawUnit.alternativa3d::_-Ry(program.fragmentShader.getVariableIndex("c" + light.alternativa3d::_-oG + "Position"),transform.d,transform.h,transform.l);
|
||||
drawUnit.alternativa3d::_-Ry(program.fragmentShader.getVariableIndex("c" + light.alternativa3d::_-oG + "Radius"),1,omni.attenuationEnd * rScale - omni.attenuationBegin * rScale,omni.attenuationBegin * rScale);
|
||||
drawUnit.alternativa3d::_-Ry(program.fragmentShader.getVariableIndex("c" + light.alternativa3d::_-oG + "Color"),light.alternativa3d::red,light.alternativa3d::green,light.alternativa3d::blue);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
drawUnit.alternativa3d::_-Ry(program.cSurface,0,this.glossiness,this.§_-kj§,1);
|
||||
drawUnit.alternativa3d::_-Ry(program.cTiling,this.§_-jM§,this.§_-Sf§,0,0);
|
||||
drawUnit.alternativa3d::setTextureAt(program.sDiffuse,this.diffuse.alternativa3d::_texture);
|
||||
drawUnit.alternativa3d::setTextureAt(program.sColormap,this.colorMap.alternativa3d::_texture);
|
||||
drawUnit.alternativa3d::setTextureAt(program.sSurface,this.surfaceMap.alternativa3d::_texture);
|
||||
drawUnit.alternativa3d::setTextureAt(program.sBump,this.normalMap.alternativa3d::_texture);
|
||||
return drawUnit;
|
||||
}
|
||||
|
||||
private function §_-Ck§(object:§_-OX§) : FogProgram
|
||||
{
|
||||
var vertexLinker:§_-hR§ = new §_-hR§(Context3DProgramType.VERTEX);
|
||||
var fragmentLinker:§_-hR§ = new §_-hR§(Context3DProgramType.FRAGMENT);
|
||||
var positionVar:String = "aPosition";
|
||||
vertexLinker.§_-LU§(positionVar,§_-5§.ATTRIBUTE);
|
||||
if(object.alternativa3d::transformProcedure != null)
|
||||
{
|
||||
positionVar = alternativa3d::_-di(object.alternativa3d::transformProcedure,vertexLinker);
|
||||
}
|
||||
vertexLinker.§_-on§(alternativa3d::_projectProcedure);
|
||||
vertexLinker.§_-FS§(alternativa3d::_projectProcedure,positionVar);
|
||||
if(fogMode == SIMPLE)
|
||||
{
|
||||
vertexLinker.§_-on§(passSimpleFogConstProcedure);
|
||||
vertexLinker.§_-FS§(passSimpleFogConstProcedure,positionVar);
|
||||
fragmentLinker.§_-on§(outputWithSimpleFogProcedure);
|
||||
}
|
||||
else
|
||||
{
|
||||
vertexLinker.§_-LU§("projected");
|
||||
vertexLinker.§_-qd§(alternativa3d::_projectProcedure,"projected");
|
||||
vertexLinker.§_-on§(postPassAdvancedFogConstProcedure);
|
||||
vertexLinker.§_-FS§(postPassAdvancedFogConstProcedure,positionVar,"projected");
|
||||
fragmentLinker.§_-on§(outputWithAdvancedFogProcedure);
|
||||
}
|
||||
fragmentLinker.§_-NA§(vertexLinker);
|
||||
return new FogProgram(vertexLinker,fragmentLinker);
|
||||
}
|
||||
|
||||
private function §_-P8§(program:FogProgram, camera:§_-be§, object:§_-OX§, surface:§_-a2§, geometry:§_-gA§) : §_-QF§
|
||||
{
|
||||
var lm:§_-jw§ = null;
|
||||
var dist:Number = NaN;
|
||||
var cLocal:§_-jw§ = null;
|
||||
var halfW:Number = NaN;
|
||||
var leftX:Number = NaN;
|
||||
var leftY:Number = NaN;
|
||||
var rightX:Number = NaN;
|
||||
var rightY:Number = NaN;
|
||||
var angle:Number = NaN;
|
||||
var dx:Number = NaN;
|
||||
var dy:Number = NaN;
|
||||
var lens:Number = NaN;
|
||||
var uScale:Number = NaN;
|
||||
var uRight:Number = NaN;
|
||||
var bmd:BitmapData = null;
|
||||
var i:int = 0;
|
||||
var positionBuffer:VertexBuffer3D = geometry.alternativa3d::getVertexBuffer(§_-d6§.POSITION);
|
||||
var drawUnit:§_-QF§ = camera.alternativa3d::renderer.alternativa3d::_-2s(object,program.program,geometry.alternativa3d::_-EM,surface.indexBegin,surface.numTriangles,program);
|
||||
drawUnit.alternativa3d::setVertexBufferAt(program.aPosition,positionBuffer,geometry.alternativa3d::_attributesOffsets[§_-d6§.POSITION],§_-d6§.alternativa3d::FORMATS[§_-d6§.POSITION]);
|
||||
object.alternativa3d::setTransformConstants(drawUnit,surface,program.vertexShader,camera);
|
||||
drawUnit.alternativa3d::_-mQ(camera,program.cProjMatrix,object.alternativa3d::localToCameraTransform);
|
||||
if(fogMode == SIMPLE || fogMode == ADVANCED)
|
||||
{
|
||||
lm = object.alternativa3d::localToCameraTransform;
|
||||
dist = fogFar - fogNear;
|
||||
drawUnit.alternativa3d:: if(program.cFogSpace,lm.i / dist,lm.j / dist,lm.k / dist,(lm.l - fogNear) / dist);
|
||||
drawUnit.alternativa3d::_-Ry(program.cFogRange,fogMaxDensity,1,0,1 - fogMaxDensity);
|
||||
}
|
||||
if(fogMode == SIMPLE)
|
||||
{
|
||||
drawUnit.alternativa3d::_-Ry(program.cFogColor,fogColorR,fogColorG,fogColorB);
|
||||
}
|
||||
if(fogMode == ADVANCED)
|
||||
{
|
||||
if(fogTexture == null)
|
||||
{
|
||||
bmd = new BitmapData(32,1,false,16711680);
|
||||
for(i = 0; i < 32; i++)
|
||||
{
|
||||
bmd.setPixel(i,0,i / 32 * 255 << 16);
|
||||
}
|
||||
fogTexture = new §_-b1§(bmd);
|
||||
fogTexture.upload(camera.alternativa3d::context3D);
|
||||
}
|
||||
cLocal = camera.alternativa3d::localToGlobalTransform;
|
||||
halfW = camera.view.width / 2;
|
||||
leftX = -halfW * cLocal.a + camera.alternativa3d::focalLength * cLocal.c;
|
||||
leftY = -halfW * cLocal.e + camera.alternativa3d::focalLength * cLocal.g;
|
||||
rightX = halfW * cLocal.a + camera.alternativa3d::focalLength * cLocal.c;
|
||||
rightY = halfW * cLocal.e + camera.alternativa3d::focalLength * cLocal.g;
|
||||
angle = Math.atan2(leftY,leftX) - Math.PI / 2;
|
||||
if(angle < 0)
|
||||
{
|
||||
angle += Math.PI * 2;
|
||||
}
|
||||
dx = rightX - leftX;
|
||||
dy = rightY - leftY;
|
||||
lens = Number(Math.sqrt(dx * dx + dy * dy));
|
||||
leftX /= lens;
|
||||
leftY /= lens;
|
||||
rightX /= lens;
|
||||
rightY /= lens;
|
||||
uScale = Math.acos(leftX * rightX + leftY * rightY) / Math.PI / 2;
|
||||
uRight = angle / Math.PI / 2;
|
||||
drawUnit.alternativa3d::_-Ry(program.cFogConsts,0.5 * uScale,0.5 - uRight,0);
|
||||
drawUnit.alternativa3d::setTextureAt(program.sFogTexture,fogTexture.alternativa3d::_texture);
|
||||
}
|
||||
return drawUnit;
|
||||
}
|
||||
|
||||
override public function clone() : §_-b9§
|
||||
{
|
||||
var cloned:TankMaterial2 = new TankMaterial2(this.colorMap,this.diffuse,this.normalMap,this.surfaceMap);
|
||||
cloned.§_-kj§ = this.§_-kj§;
|
||||
cloned.glossiness = this.glossiness;
|
||||
return cloned;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import §_-M8§.§_-hR§;
|
||||
import §_-Vh§.§_-RB§;
|
||||
|
||||
class ShadowOrAmbientProgram extends §_-RB§
|
||||
{
|
||||
public var aPosition:int;
|
||||
|
||||
public var aUV:int;
|
||||
|
||||
public var cProjMatrix:int;
|
||||
|
||||
public var cAmbient:int;
|
||||
|
||||
public var cTiling:int;
|
||||
|
||||
public var sDiffuse:int;
|
||||
|
||||
public var sColormap:int;
|
||||
|
||||
public var sSurface:int;
|
||||
|
||||
public var cShadow:int;
|
||||
|
||||
public function ShadowOrAmbientProgram(vertex:§_-hR§, fragment:§_-hR§)
|
||||
{
|
||||
super(vertex,fragment);
|
||||
this.aPosition = vertex.§_-Dj§("aPosition");
|
||||
this.aUV = vertex.§_-Dj§("aUV");
|
||||
this.cProjMatrix = vertex.§_-Dj§("cProjMatrix");
|
||||
this.cAmbient = fragment.§_-Dj§("cAmbient");
|
||||
this.cTiling = fragment.§_-Dj§("cTiling");
|
||||
this.sDiffuse = fragment.§_-Dj§("sDiffuse");
|
||||
this.sColormap = fragment.§_-Dj§("sColormap");
|
||||
this.sSurface = fragment.§_-Dj§("sSurface");
|
||||
this.cShadow = fragment.§_-Dj§("cShadow");
|
||||
}
|
||||
}
|
||||
|
||||
class LightingProgram extends §_-RB§
|
||||
{
|
||||
public var aPosition:int;
|
||||
|
||||
public var aUV:int;
|
||||
|
||||
public var cProjMatrix:int;
|
||||
|
||||
public var cCamera:int;
|
||||
|
||||
public var cSurface:int;
|
||||
|
||||
public var cTiling:int;
|
||||
|
||||
public var sDiffuse:int;
|
||||
|
||||
public var sColormap:int;
|
||||
|
||||
public var sSurface:int;
|
||||
|
||||
public var sBump:int;
|
||||
|
||||
public function LightingProgram(vertex:§_-hR§, fragment:§_-hR§)
|
||||
{
|
||||
super(vertex,fragment);
|
||||
this.aPosition = vertex.§_-Dj§("aPosition");
|
||||
this.aUV = vertex.§_-Dj§("aUV");
|
||||
this.cProjMatrix = vertex.§_-Dj§("cProjMatrix");
|
||||
this.cCamera = vertex.§_-Dj§("cCamera");
|
||||
this.cSurface = fragment.§_-Dj§("cSurface");
|
||||
this.cTiling = fragment.§_-Dj§("cTiling");
|
||||
this.sDiffuse = fragment.§_-Dj§("sDiffuse");
|
||||
this.sColormap = fragment.§_-Dj§("sColormap");
|
||||
this.sSurface = fragment.§_-Dj§("sSurface");
|
||||
this.sBump = fragment.§_-Dj§("sBump");
|
||||
}
|
||||
}
|
||||
|
||||
class FogProgram extends §_-RB§
|
||||
{
|
||||
public var aPosition:int;
|
||||
|
||||
public var cProjMatrix:int;
|
||||
|
||||
public var cFogSpace:int;
|
||||
|
||||
public var cFogRange:int;
|
||||
|
||||
public var cFogColor:int;
|
||||
|
||||
public var cFogConsts:int;
|
||||
|
||||
public var sFogTexture:int;
|
||||
|
||||
public function FogProgram(vertex:§_-hR§, fragment:§_-hR§)
|
||||
{
|
||||
super(vertex,fragment);
|
||||
this.aPosition = vertex.§_-Dj§("aPosition");
|
||||
this.cProjMatrix = vertex.§_-Dj§("cProjMatrix");
|
||||
this.cFogSpace = vertex.§_-Dj§("cFogSpace");
|
||||
this.cFogRange = fragment.§_-Dj§("cFogRange");
|
||||
this.cFogColor = fragment.§_-Dj§("cFogColor");
|
||||
this.cFogConsts = fragment.§_-Dj§("cFogConsts");
|
||||
this.sFogTexture = fragment.§_-Dj§("sFogTexture");
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package package_25
|
||||
package §_-aF§
|
||||
{
|
||||
import flash.utils.*;
|
||||
|
||||
public class name_414
|
||||
public class §_-B0§
|
||||
{
|
||||
private static var initialized:Boolean = false;
|
||||
|
||||
@@ -190,16 +190,16 @@ package package_25
|
||||
|
||||
private static const CLAMP:String = "clamp";
|
||||
|
||||
private var var_584:ByteArray = null;
|
||||
private var §_-0e§:ByteArray = null;
|
||||
|
||||
private var var_582:String = "";
|
||||
private var §_-iF§:String = "";
|
||||
|
||||
private var var_583:Boolean = false;
|
||||
private var §_-9J§:Boolean = false;
|
||||
|
||||
public function name_414(debugging:Boolean = false)
|
||||
public function §_-B0§(debugging:Boolean = false)
|
||||
{
|
||||
super();
|
||||
this.var_583 = debugging;
|
||||
this.§_-9J§ = debugging;
|
||||
if(!initialized)
|
||||
{
|
||||
init();
|
||||
@@ -281,12 +281,12 @@ package package_25
|
||||
|
||||
public function get error() : String
|
||||
{
|
||||
return this.var_582;
|
||||
return this.§_-iF§;
|
||||
}
|
||||
|
||||
public function get method_644() : ByteArray
|
||||
public function get §_-Ky§() : ByteArray
|
||||
{
|
||||
return this.var_584;
|
||||
return this.§_-0e§;
|
||||
}
|
||||
|
||||
public function assemble(mode:String, source:String, verbose:Boolean = false) : ByteArray
|
||||
@@ -332,8 +332,8 @@ package package_25
|
||||
var index:uint = 0;
|
||||
var byteStr:String = null;
|
||||
var start:uint = uint(getTimer());
|
||||
this.var_584 = new ByteArray();
|
||||
this.var_582 = "";
|
||||
this.§_-0e§ = new ByteArray();
|
||||
this.§_-iF§ = "";
|
||||
var isFrag:Boolean = false;
|
||||
if(mode == FRAGMENT)
|
||||
{
|
||||
@@ -341,19 +341,19 @@ package package_25
|
||||
}
|
||||
else if(mode != VERTEX)
|
||||
{
|
||||
this.var_582 = "ERROR: mode needs to be \"" + FRAGMENT + "\" or \"" + VERTEX + "\" but is \"" + mode + "\".";
|
||||
this.§_-iF§ = "ERROR: mode needs to be \"" + FRAGMENT + "\" or \"" + VERTEX + "\" but is \"" + mode + "\".";
|
||||
}
|
||||
this.method_644.endian = Endian.LITTLE_ENDIAN;
|
||||
this.method_644.writeByte(160);
|
||||
this.method_644.writeUnsignedInt(1);
|
||||
this.method_644.writeByte(161);
|
||||
this.method_644.writeByte(isFrag ? 1 : 0);
|
||||
this.§_-Ky§.endian = Endian.LITTLE_ENDIAN;
|
||||
this.§_-Ky§.writeByte(160);
|
||||
this.§_-Ky§.writeUnsignedInt(1);
|
||||
this.§_-Ky§.writeByte(161);
|
||||
this.§_-Ky§.writeByte(isFrag ? 1 : 0);
|
||||
var lines:Array = source.replace(/[\f\n\r\v]+/g,"\n").split("\n");
|
||||
var nest:int = 0;
|
||||
var nops:int = 0;
|
||||
var lng:int = int(lines.length);
|
||||
i = 0;
|
||||
while(i < lng && this.var_582 == "")
|
||||
while(i < lng && this.§_-iF§ == "")
|
||||
{
|
||||
line = new String(lines[i]);
|
||||
startcomment = int(line.search("//"));
|
||||
@@ -369,7 +369,7 @@ package package_25
|
||||
}
|
||||
opCode = line.match(/^\w{3}/ig);
|
||||
opFound = OPMAP[opCode[0]];
|
||||
if(this.var_583)
|
||||
if(this.§_-9J§)
|
||||
{
|
||||
trace(opFound);
|
||||
}
|
||||
@@ -388,7 +388,7 @@ package package_25
|
||||
nest--;
|
||||
if(nest < 0)
|
||||
{
|
||||
this.var_582 = "error: conditional closes without open.";
|
||||
this.§_-iF§ = "error: conditional closes without open.";
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -397,30 +397,30 @@ package package_25
|
||||
nest++;
|
||||
if(nest > MAX_NESTING)
|
||||
{
|
||||
this.var_582 = "error: nesting to deep, maximum allowed is " + MAX_NESTING + ".";
|
||||
this.§_-iF§ = "error: nesting to deep, maximum allowed is " + MAX_NESTING + ".";
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(Boolean(opFound.flags & OP_FRAG_ONLY) && !isFrag)
|
||||
{
|
||||
this.var_582 = "error: opcode is only allowed in fragment programs.";
|
||||
this.§_-iF§ = "error: opcode is only allowed in fragment programs.";
|
||||
break;
|
||||
}
|
||||
if(verbose)
|
||||
{
|
||||
trace("emit opcode=" + opFound);
|
||||
}
|
||||
this.method_644.writeUnsignedInt(opFound.emitCode);
|
||||
this.§_-Ky§.writeUnsignedInt(opFound.emitCode);
|
||||
nops++;
|
||||
if(nops > MAX_OPCODES)
|
||||
{
|
||||
this.var_582 = "error: too many opcodes. maximum is " + MAX_OPCODES + ".";
|
||||
this.§_-iF§ = "error: too many opcodes. maximum is " + MAX_OPCODES + ".";
|
||||
break;
|
||||
}
|
||||
regs = line.match(/vc\[([vof][actps]?)(\d*)?(\.[xyzw](\+\d{1,3})?)?\](\.[xyzw]{1,4})?|([vof][actps]?)(\d*)?(\.[xyzw]{1,4})?/gi);
|
||||
if(regs.length != opFound.numRegister)
|
||||
{
|
||||
this.var_582 = "error: wrong number of operands. found " + regs.length + " but expected " + opFound.numRegister + ".";
|
||||
this.§_-iF§ = "error: wrong number of operands. found " + regs.length + " but expected " + opFound.numRegister + ".";
|
||||
break;
|
||||
}
|
||||
badreg = false;
|
||||
@@ -441,13 +441,13 @@ package package_25
|
||||
}
|
||||
res = regs[j].match(/^\b[A-Za-z]{1,2}/ig);
|
||||
regFound = REGMAP[res[0]];
|
||||
if(this.var_583)
|
||||
if(this.§_-9J§)
|
||||
{
|
||||
trace(regFound);
|
||||
}
|
||||
if(regFound == null)
|
||||
{
|
||||
this.var_582 = "error: could not parse operand " + j + " (" + regs[j] + ").";
|
||||
this.§_-iF§ = "error: could not parse operand " + j + " (" + regs[j] + ").";
|
||||
badreg = true;
|
||||
break;
|
||||
}
|
||||
@@ -455,20 +455,20 @@ package package_25
|
||||
{
|
||||
if(!(regFound.flags & REG_FRAG))
|
||||
{
|
||||
this.var_582 = "error: register operand " + j + " (" + regs[j] + ") only allowed in vertex programs.";
|
||||
this.§_-iF§ = "error: register operand " + j + " (" + regs[j] + ") only allowed in vertex programs.";
|
||||
badreg = true;
|
||||
break;
|
||||
}
|
||||
if(isRelative)
|
||||
{
|
||||
this.var_582 = "error: register operand " + j + " (" + regs[j] + ") relative adressing not allowed in fragment programs.";
|
||||
this.§_-iF§ = "error: register operand " + j + " (" + regs[j] + ") relative adressing not allowed in fragment programs.";
|
||||
badreg = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(!(regFound.flags & REG_VERT))
|
||||
{
|
||||
this.var_582 = "error: register operand " + j + " (" + regs[j] + ") only allowed in fragment programs.";
|
||||
this.§_-iF§ = "error: register operand " + j + " (" + regs[j] + ") only allowed in fragment programs.";
|
||||
badreg = true;
|
||||
break;
|
||||
}
|
||||
@@ -481,7 +481,7 @@ package package_25
|
||||
}
|
||||
if(regFound.range < regidx)
|
||||
{
|
||||
this.var_582 = "error: register operand " + j + " (" + regs[j] + ") index exceeds limit of " + (regFound.range + 1) + ".";
|
||||
this.§_-iF§ = "error: register operand " + j + " (" + regs[j] + ") index exceeds limit of " + (regFound.range + 1) + ".";
|
||||
badreg = true;
|
||||
break;
|
||||
}
|
||||
@@ -494,7 +494,7 @@ package package_25
|
||||
reloffset = 0;
|
||||
if(isDest && isRelative)
|
||||
{
|
||||
this.var_582 = "error: relative can not be destination";
|
||||
this.§_-iF§ = "error: relative can not be destination";
|
||||
badreg = true;
|
||||
break;
|
||||
}
|
||||
@@ -537,7 +537,7 @@ package package_25
|
||||
regFoundRel = REGMAP[relname[0]];
|
||||
if(regFoundRel == null)
|
||||
{
|
||||
this.var_582 = "error: bad index register";
|
||||
this.§_-iF§ = "error: bad index register";
|
||||
badreg = true;
|
||||
break;
|
||||
}
|
||||
@@ -545,7 +545,7 @@ package package_25
|
||||
selmatch = relreg[0].match(/(\.[xyzw]{1,1})/);
|
||||
if(selmatch.length == 0)
|
||||
{
|
||||
this.var_582 = "error: bad index register select";
|
||||
this.§_-iF§ = "error: bad index register select";
|
||||
badreg = true;
|
||||
break;
|
||||
}
|
||||
@@ -561,7 +561,7 @@ package package_25
|
||||
}
|
||||
if(reloffset < 0 || reloffset > 255)
|
||||
{
|
||||
this.var_582 = "error: index offset " + reloffset + " out of bounds. [0..255]";
|
||||
this.§_-iF§ = "error: index offset " + reloffset + " out of bounds. [0..255]";
|
||||
badreg = true;
|
||||
break;
|
||||
}
|
||||
@@ -576,9 +576,9 @@ package package_25
|
||||
}
|
||||
if(isDest)
|
||||
{
|
||||
this.method_644.writeShort(regidx);
|
||||
this.method_644.writeByte(regmask);
|
||||
this.method_644.writeByte(regFound.emitCode);
|
||||
this.§_-Ky§.writeShort(regidx);
|
||||
this.§_-Ky§.writeByte(regmask);
|
||||
this.§_-Ky§.writeByte(regFound.emitCode);
|
||||
pad -= 32;
|
||||
}
|
||||
else if(isSampler)
|
||||
@@ -614,10 +614,10 @@ package package_25
|
||||
samplerbits |= uint(optfound.mask) << uint(optfound.flag);
|
||||
}
|
||||
}
|
||||
this.method_644.writeShort(regidx);
|
||||
this.method_644.writeByte(int(bias * 8));
|
||||
this.method_644.writeByte(0);
|
||||
this.method_644.writeUnsignedInt(samplerbits);
|
||||
this.§_-Ky§.writeShort(regidx);
|
||||
this.§_-Ky§.writeByte(int(bias * 8));
|
||||
this.§_-Ky§.writeByte(0);
|
||||
this.§_-Ky§.writeUnsignedInt(samplerbits);
|
||||
if(verbose)
|
||||
{
|
||||
trace(" bits: " + (samplerbits - 5));
|
||||
@@ -628,21 +628,21 @@ package package_25
|
||||
{
|
||||
if(j == 0)
|
||||
{
|
||||
this.method_644.writeUnsignedInt(0);
|
||||
this.§_-Ky§.writeUnsignedInt(0);
|
||||
pad -= 32;
|
||||
}
|
||||
this.method_644.writeShort(regidx);
|
||||
this.method_644.writeByte(reloffset);
|
||||
this.method_644.writeByte(regmask);
|
||||
this.method_644.writeByte(regFound.emitCode);
|
||||
this.method_644.writeByte(reltype);
|
||||
this.method_644.writeShort(isRelative ? relsel | 1 << 15 : 0);
|
||||
this.§_-Ky§.writeShort(regidx);
|
||||
this.§_-Ky§.writeByte(reloffset);
|
||||
this.§_-Ky§.writeByte(regmask);
|
||||
this.§_-Ky§.writeByte(regFound.emitCode);
|
||||
this.§_-Ky§.writeByte(reltype);
|
||||
this.§_-Ky§.writeShort(isRelative ? relsel | 1 << 15 : 0);
|
||||
pad -= 64;
|
||||
}
|
||||
}
|
||||
for(j = 0; j < pad; )
|
||||
{
|
||||
this.method_644.writeByte(0);
|
||||
this.§_-Ky§.writeByte(0);
|
||||
j += 8;
|
||||
}
|
||||
if(badreg)
|
||||
@@ -652,16 +652,16 @@ package package_25
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(this.var_582 != "")
|
||||
if(this.§_-iF§ != "")
|
||||
{
|
||||
this.var_582 += "\n at line " + i + " " + lines[i];
|
||||
this.method_644.length = 0;
|
||||
trace(this.var_582);
|
||||
this.§_-iF§ += "\n at line " + i + " " + lines[i];
|
||||
this.§_-Ky§.length = 0;
|
||||
trace(this.§_-iF§);
|
||||
}
|
||||
if(this.var_583)
|
||||
if(this.§_-9J§)
|
||||
{
|
||||
dbgLine = "generated bytecode:";
|
||||
agalLength = uint(this.method_644.length);
|
||||
agalLength = uint(this.§_-Ky§.length);
|
||||
for(index = 0; index < agalLength; index++)
|
||||
{
|
||||
if(!(index % 16))
|
||||
@@ -672,7 +672,7 @@ package package_25
|
||||
{
|
||||
dbgLine += " ";
|
||||
}
|
||||
byteStr = this.method_644[index].toString(16);
|
||||
byteStr = this.§_-Ky§[index].toString(16);
|
||||
if(byteStr.length < 2)
|
||||
{
|
||||
byteStr = "0" + byteStr;
|
||||
@@ -685,7 +685,7 @@ package package_25
|
||||
{
|
||||
trace("AGALMiniAssembler.assemble time: " + (getTimer() - start) / 1000 + "s");
|
||||
}
|
||||
return this.method_644;
|
||||
return this.§_-Ky§;
|
||||
}
|
||||
}
|
||||
}
|
||||
232
src/?_-aF?/?_-SG?.as
Normal file
@@ -0,0 +1,232 @@
|
||||
package §_-aF§
|
||||
{
|
||||
import §_-8D§.§_-FW§;
|
||||
import §_-8D§.§_-jw§;
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import flash.geom.Vector3D;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class §_-SG§
|
||||
{
|
||||
private static var randomNumbers:Vector.<Number>;
|
||||
|
||||
private static const randomNumbersCount:int = 1000;
|
||||
|
||||
private static const vector:Vector3D = new Vector3D();
|
||||
|
||||
public var name:String;
|
||||
|
||||
public var scale:Number = 1;
|
||||
|
||||
public var boundBox:§_-FW§;
|
||||
|
||||
alternativa3d var next:§_-SG§;
|
||||
|
||||
alternativa3d var §implements§:§_-SG§;
|
||||
|
||||
alternativa3d var system:§_-ja§;
|
||||
|
||||
alternativa3d var startTime:Number;
|
||||
|
||||
alternativa3d var lifeTime:Number = 1.7976931348623157e+308;
|
||||
|
||||
alternativa3d var particleList:Particle;
|
||||
|
||||
alternativa3d var aabb:§_-FW§;
|
||||
|
||||
alternativa3d var §_-M7§:Vector3D;
|
||||
|
||||
protected var §_-cF§:Vector3D;
|
||||
|
||||
protected var §_-gV§:Vector.<Number>;
|
||||
|
||||
protected var §_-lB§:Vector.<Vector3D>;
|
||||
|
||||
protected var §_-ib§:Vector.<Vector3D>;
|
||||
|
||||
protected var §_-Nz§:Vector.<Function>;
|
||||
|
||||
protected var §_-kf§:int = 0;
|
||||
|
||||
private var §_-TK§:int;
|
||||
|
||||
private var §_-hs§:int;
|
||||
|
||||
private var §_-G1§:Vector3D;
|
||||
|
||||
private var §_-Q2§:Vector3D;
|
||||
|
||||
public function §_-SG§()
|
||||
{
|
||||
var i:int = 0;
|
||||
this.alternativa3d::aabb = new §_-FW§();
|
||||
this.§_-gV§ = new Vector.<Number>();
|
||||
this.§_-lB§ = new Vector.<Vector3D>();
|
||||
this.§_-ib§ = new Vector.<Vector3D>();
|
||||
this.§_-Nz§ = new Vector.<Function>();
|
||||
this.§_-G1§ = new Vector3D(0,0,0);
|
||||
this.§_-Q2§ = new Vector3D(0,0,1);
|
||||
super();
|
||||
if(randomNumbers == null)
|
||||
{
|
||||
randomNumbers = new Vector.<Number>();
|
||||
for(i = 0; i < randomNumbersCount; randomNumbers[i] = Math.random(),i++)
|
||||
{
|
||||
}
|
||||
}
|
||||
this.§_-TK§ = Math.random() * randomNumbersCount;
|
||||
}
|
||||
|
||||
public function get position() : Vector3D
|
||||
{
|
||||
return this.§_-G1§.clone();
|
||||
}
|
||||
|
||||
public function set position(value:Vector3D) : void
|
||||
{
|
||||
this.§_-G1§.x = value.x;
|
||||
this.§_-G1§.y = value.y;
|
||||
this.§_-G1§.z = value.z;
|
||||
this.§_-G1§.w = value.w;
|
||||
if(this.alternativa3d::system != null)
|
||||
{
|
||||
this.alternativa3d::_-is(this.alternativa3d::system.alternativa3d::_-EV() - this.alternativa3d::startTime);
|
||||
}
|
||||
}
|
||||
|
||||
public function get direction() : Vector3D
|
||||
{
|
||||
return this.§_-Q2§.clone();
|
||||
}
|
||||
|
||||
public function set direction(value:Vector3D) : void
|
||||
{
|
||||
this.§_-Q2§.x = value.x;
|
||||
this.§_-Q2§.y = value.y;
|
||||
this.§_-Q2§.z = value.z;
|
||||
this.§_-Q2§.w = value.w;
|
||||
if(this.alternativa3d::system != null)
|
||||
{
|
||||
this.alternativa3d::_-Af(this.alternativa3d::system.alternativa3d::_-EV() - this.alternativa3d::startTime);
|
||||
}
|
||||
}
|
||||
|
||||
public function stop() : void
|
||||
{
|
||||
var time:Number = this.alternativa3d::system.alternativa3d::_-EV() - this.alternativa3d::startTime;
|
||||
for(var i:int = 0; i < this.§_-kf§; )
|
||||
{
|
||||
if(time < this.§_-gV§[i])
|
||||
{
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
this.§_-kf§ = i;
|
||||
}
|
||||
|
||||
protected function get §_-Ta§() : §_-ja§
|
||||
{
|
||||
return this.alternativa3d::system;
|
||||
}
|
||||
|
||||
protected function get §_-iq§() : §_-jw§
|
||||
{
|
||||
return this.alternativa3d::system.alternativa3d::cameraToLocalTransform;
|
||||
}
|
||||
|
||||
protected function random() : Number
|
||||
{
|
||||
var res:Number = randomNumbers[this.§_-hs§];
|
||||
++this.§_-hs§;
|
||||
if(this.§_-hs§ == randomNumbersCount)
|
||||
{
|
||||
this.§_-hs§ = 0;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
protected function §_-Le§(time:Number, script:Function) : void
|
||||
{
|
||||
this.§_-gV§[this.§_-kf§] = time;
|
||||
this.§_-lB§[this.§_-kf§] = new Vector3D();
|
||||
this.§_-ib§[this.§_-kf§] = new Vector3D();
|
||||
this.§_-Nz§[this.§_-kf§] = script;
|
||||
++this.§_-kf§;
|
||||
}
|
||||
|
||||
protected function §_-DM§(time:Number) : void
|
||||
{
|
||||
this.alternativa3d::lifeTime = time;
|
||||
}
|
||||
|
||||
alternativa3d function calculateAABB() : void
|
||||
{
|
||||
this.alternativa3d::aabb.minX = this.boundBox.minX * this.scale + this.§_-G1§.x;
|
||||
this.alternativa3d::aabb.minY = this.boundBox.minY * this.scale + this.§_-G1§.y;
|
||||
this.alternativa3d::aabb.minZ = this.boundBox.minZ * this.scale + this.§_-G1§.z;
|
||||
this.alternativa3d::aabb.maxX = this.boundBox.maxX * this.scale + this.§_-G1§.x;
|
||||
this.alternativa3d::aabb.maxY = this.boundBox.maxY * this.scale + this.§_-G1§.y;
|
||||
this.alternativa3d::aabb.maxZ = this.boundBox.maxZ * this.scale + this.§_-G1§.z;
|
||||
}
|
||||
|
||||
alternativa3d function §_-is§(time:Number) : void
|
||||
{
|
||||
var pos:Vector3D = null;
|
||||
for(var i:int = 0; i < this.§_-kf§; )
|
||||
{
|
||||
if(time <= this.§_-gV§[i])
|
||||
{
|
||||
pos = this.§_-lB§[i];
|
||||
pos.x = this.§_-G1§.x;
|
||||
pos.y = this.§_-G1§.y;
|
||||
pos.z = this.§_-G1§.z;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
alternativa3d function §_-Af§(time:Number) : void
|
||||
{
|
||||
var dir:Vector3D = null;
|
||||
vector.x = this.§_-Q2§.x;
|
||||
vector.y = this.§_-Q2§.y;
|
||||
vector.z = this.§_-Q2§.z;
|
||||
vector.normalize();
|
||||
for(var i:int = 0; i < this.§_-kf§; )
|
||||
{
|
||||
if(time <= this.§_-gV§[i])
|
||||
{
|
||||
dir = this.§_-ib§[i];
|
||||
dir.x = vector.x;
|
||||
dir.y = vector.y;
|
||||
dir.z = vector.z;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
alternativa3d function §_-Xj§(time:Number) : Boolean
|
||||
{
|
||||
var keyTime:Number = NaN;
|
||||
var script:Function = null;
|
||||
this.§_-hs§ = this.§_-TK§;
|
||||
for(var i:int = 0; i < this.§_-kf§; )
|
||||
{
|
||||
keyTime = this.§_-gV§[i];
|
||||
if(time < keyTime)
|
||||
{
|
||||
break;
|
||||
}
|
||||
this.alternativa3d::_-M7 = this.§_-lB§[i];
|
||||
this.§_-cF§ = this.§_-ib§[i];
|
||||
script = this.§_-Nz§[i];
|
||||
script.call(this,keyTime,time - keyTime);
|
||||
i++;
|
||||
}
|
||||
return i < this.§_-kf§ || this.alternativa3d::particleList != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,120 +1,120 @@
|
||||
package alternativa.tanks.game.subsystems.inputsystem
|
||||
package §_-aM§
|
||||
{
|
||||
import §_-V-§.§_-C1§;
|
||||
import §_-az§.§_-ps§;
|
||||
import flash.display.InteractiveObject;
|
||||
import flash.events.KeyboardEvent;
|
||||
import flash.events.MouseEvent;
|
||||
import alternativa.tanks.game.GameTask;
|
||||
import package_27.name_479;
|
||||
|
||||
public class InputSystem extends GameTask implements IInput
|
||||
public class §_-Yf§ extends §_-ps§ implements §_-Lm§
|
||||
{
|
||||
private static const NUM_KEYS:int = 256;
|
||||
|
||||
private var eventSource:InteractiveObject;
|
||||
|
||||
private var var_216:name_479;
|
||||
private var §_-Pb§:§_-C1§;
|
||||
|
||||
private var var_230:Boolean;
|
||||
private var §_-FK§:Boolean;
|
||||
|
||||
private var var_221:Boolean;
|
||||
private var §_-PG§:Boolean;
|
||||
|
||||
private var var_225:Boolean;
|
||||
private var §_-Hv§:Boolean;
|
||||
|
||||
private var var_227:int;
|
||||
private var §_-8e§:int;
|
||||
|
||||
private var var_226:int;
|
||||
private var §_-dL§:int;
|
||||
|
||||
private var mouseX:int;
|
||||
|
||||
private var mouseY:int;
|
||||
|
||||
private var var_229:int;
|
||||
private var §_-Sm§:int;
|
||||
|
||||
private var var_228:int;
|
||||
private var §_-4F§:int;
|
||||
|
||||
private var var_223:int;
|
||||
private var §_-HC§:int;
|
||||
|
||||
private var var_224:CleanupTask;
|
||||
private var §_-Jh§:CleanupTask;
|
||||
|
||||
private var var_220:Vector.<Vector.<Function>>;
|
||||
private var §_-CU§:Vector.<Vector.<Function>>;
|
||||
|
||||
private var var_217:Vector.<Vector.<Function>>;
|
||||
private var §_-ll§:Vector.<Vector.<Function>>;
|
||||
|
||||
private var var_219:Vector.<Function>;
|
||||
private var § use§:Vector.<Function>;
|
||||
|
||||
private var var_218:Vector.<Function>;
|
||||
private var §_-A4§:Vector.<Function>;
|
||||
|
||||
private var var_222:KeybardEventQueue;
|
||||
private var §use §:KeybardEventQueue;
|
||||
|
||||
public function InputSystem(priority:int, eventSource:InteractiveObject)
|
||||
public function §_-Yf§(priority:int, eventSource:InteractiveObject)
|
||||
{
|
||||
super(priority);
|
||||
this.eventSource = eventSource;
|
||||
this.var_216 = new name_479(NUM_KEYS);
|
||||
this.var_220 = new Vector.<Vector.<Function>>(NUM_KEYS);
|
||||
this.var_217 = new Vector.<Vector.<Function>>(NUM_KEYS);
|
||||
this.var_219 = new Vector.<Function>();
|
||||
this.var_218 = new Vector.<Function>();
|
||||
this.var_222 = new KeybardEventQueue();
|
||||
this.§_-Pb§ = new §_-C1§(NUM_KEYS);
|
||||
this.§_-CU§ = new Vector.<Vector.<Function>>(NUM_KEYS);
|
||||
this.§_-ll§ = new Vector.<Vector.<Function>>(NUM_KEYS);
|
||||
this.§ use§ = new Vector.<Function>();
|
||||
this.§_-A4§ = new Vector.<Function>();
|
||||
this.§use § = new KeybardEventQueue();
|
||||
}
|
||||
|
||||
public function name_94(eventType:KeyboardEventType, listener:Function, keyCode:uint = 0) : void
|
||||
public function §_-hn§(eventType:§_-X0§, listener:Function, keyCode:uint = 0) : void
|
||||
{
|
||||
switch(eventType)
|
||||
{
|
||||
case KeyboardEventType.KEY_DOWN:
|
||||
case §_-X0§.KEY_DOWN:
|
||||
if(keyCode == 0)
|
||||
{
|
||||
this.addKeyListener(this.var_219,listener);
|
||||
this.§_-3J§(this.§ use§,listener);
|
||||
break;
|
||||
}
|
||||
this.addDistinctKeyListener(this.var_220,keyCode,listener);
|
||||
this.§_-ft§(this.§_-CU§,keyCode,listener);
|
||||
break;
|
||||
case KeyboardEventType.KEY_UP:
|
||||
case §_-X0§.KEY_UP:
|
||||
if(keyCode == 0)
|
||||
{
|
||||
this.addKeyListener(this.var_218,listener);
|
||||
this.§_-3J§(this.§_-A4§,listener);
|
||||
break;
|
||||
}
|
||||
this.addDistinctKeyListener(this.var_217,keyCode,listener);
|
||||
this.§_-ft§(this.§_-ll§,keyCode,listener);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function name_384(eventType:KeyboardEventType, listener:Function, keyCode:uint = 0) : void
|
||||
public function §_-or§(eventType:§_-X0§, listener:Function, keyCode:uint = 0) : void
|
||||
{
|
||||
switch(eventType)
|
||||
{
|
||||
case KeyboardEventType.KEY_DOWN:
|
||||
case §_-X0§.KEY_DOWN:
|
||||
if(keyCode == 0)
|
||||
{
|
||||
this.removeKeyListener(this.var_219,listener);
|
||||
this.§_-JO§(this.§ use§,listener);
|
||||
break;
|
||||
}
|
||||
this.removeDistinctKeyListener(this.var_220,keyCode,listener);
|
||||
this.§_-7G§(this.§_-CU§,keyCode,listener);
|
||||
break;
|
||||
case KeyboardEventType.KEY_UP:
|
||||
case §_-X0§.KEY_UP:
|
||||
if(keyCode == 0)
|
||||
{
|
||||
this.removeKeyListener(this.var_218,listener);
|
||||
this.§_-JO§(this.§_-A4§,listener);
|
||||
break;
|
||||
}
|
||||
this.removeDistinctKeyListener(this.var_217,keyCode,listener);
|
||||
this.§_-7G§(this.§_-ll§,keyCode,listener);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function name_192(keyCode:uint) : int
|
||||
public function §_-OO§(keyCode:uint) : int
|
||||
{
|
||||
return this.var_216.name_478(keyCode);
|
||||
return this.§_-Pb§.§_-2C§(keyCode);
|
||||
}
|
||||
|
||||
public function name_346(keyCode:uint) : Boolean
|
||||
public function §_-IA§(keyCode:uint) : Boolean
|
||||
{
|
||||
return this.var_216.name_478(keyCode) == 1;
|
||||
return this.§_-Pb§.§_-2C§(keyCode) == 1;
|
||||
}
|
||||
|
||||
private function addDistinctKeyListener(keyTypeListeners:Vector.<Vector.<Function>>, keyCode:uint, listener:Function) : void
|
||||
private function §_-ft§(keyTypeListeners:Vector.<Vector.<Function>>, keyCode:uint, listener:Function) : void
|
||||
{
|
||||
var listeners:Vector.<Function> = keyTypeListeners[keyCode];
|
||||
if(listeners == null)
|
||||
@@ -129,7 +129,7 @@ package alternativa.tanks.game.subsystems.inputsystem
|
||||
}
|
||||
}
|
||||
|
||||
private function removeDistinctKeyListener(keyTypeListeners:Vector.<Vector.<Function>>, keyCode:uint, listener:Function) : void
|
||||
private function §_-7G§(keyTypeListeners:Vector.<Vector.<Function>>, keyCode:uint, listener:Function) : void
|
||||
{
|
||||
var index:int = 0;
|
||||
var newLength:int = 0;
|
||||
@@ -146,7 +146,7 @@ package alternativa.tanks.game.subsystems.inputsystem
|
||||
}
|
||||
}
|
||||
|
||||
private function addKeyListener(listeners:Vector.<Function>, listener:Function) : void
|
||||
private function §_-3J§(listeners:Vector.<Function>, listener:Function) : void
|
||||
{
|
||||
if(listeners.indexOf(listener) < 0)
|
||||
{
|
||||
@@ -154,7 +154,7 @@ package alternativa.tanks.game.subsystems.inputsystem
|
||||
}
|
||||
}
|
||||
|
||||
private function removeKeyListener(listeners:Vector.<Function>, listener:Function) : void
|
||||
private function §_-JO§(listeners:Vector.<Function>, listener:Function) : void
|
||||
{
|
||||
var newLength:int = 0;
|
||||
var index:int = int(listeners.indexOf(listener));
|
||||
@@ -166,71 +166,71 @@ package alternativa.tanks.game.subsystems.inputsystem
|
||||
}
|
||||
}
|
||||
|
||||
public function name_199() : Boolean
|
||||
public function §_-an§() : Boolean
|
||||
{
|
||||
return this.var_221;
|
||||
return this.§_-PG§;
|
||||
}
|
||||
|
||||
public function method_262() : Boolean
|
||||
public function §_-0T§() : Boolean
|
||||
{
|
||||
return this.var_225;
|
||||
return this.§_-Hv§;
|
||||
}
|
||||
|
||||
public function name_197() : int
|
||||
public function §_-ow§() : int
|
||||
{
|
||||
return this.var_229;
|
||||
return this.§_-Sm§;
|
||||
}
|
||||
|
||||
public function name_200() : int
|
||||
public function §_-ac§() : int
|
||||
{
|
||||
return this.var_228;
|
||||
return this.§_-4F§;
|
||||
}
|
||||
|
||||
public function method_261() : int
|
||||
public function §_-i9§() : int
|
||||
{
|
||||
return this.var_223;
|
||||
return this.§_-HC§;
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
this.var_224 = new CleanupTask(int.MAX_VALUE,this);
|
||||
var_4.addTask(this.var_224);
|
||||
this.eventSource.addEventListener(KeyboardEvent.KEY_DOWN,this.onKeyDown);
|
||||
this.eventSource.addEventListener(KeyboardEvent.KEY_UP,this.onKeyUp);
|
||||
this.§_-Jh§ = new CleanupTask(int.MAX_VALUE,this);
|
||||
§_-Uw§.addTask(this.§_-Jh§);
|
||||
this.eventSource.addEventListener(KeyboardEvent.KEY_DOWN,this.§_-Ze§);
|
||||
this.eventSource.addEventListener(KeyboardEvent.KEY_UP,this.§_-Uf§);
|
||||
this.eventSource.addEventListener(MouseEvent.MOUSE_MOVE,this.onMouseMove);
|
||||
this.eventSource.addEventListener(MouseEvent.MOUSE_WHEEL,this.onMouseWheel);
|
||||
this.eventSource.addEventListener(MouseEvent.MOUSE_DOWN,this.onMouseDown);
|
||||
this.eventSource.addEventListener(MouseEvent.MOUSE_UP,this.onMouseUp);
|
||||
this.eventSource.addEventListener(MouseEvent.MOUSE_UP,this.§_-4B§);
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
var_4.killTask(this.var_224);
|
||||
this.eventSource.removeEventListener(KeyboardEvent.KEY_DOWN,this.onKeyDown);
|
||||
this.eventSource.removeEventListener(KeyboardEvent.KEY_UP,this.onKeyUp);
|
||||
§_-Uw§.killTask(this.§_-Jh§);
|
||||
this.eventSource.removeEventListener(KeyboardEvent.KEY_DOWN,this.§_-Ze§);
|
||||
this.eventSource.removeEventListener(KeyboardEvent.KEY_UP,this.§_-Uf§);
|
||||
this.eventSource.removeEventListener(MouseEvent.MOUSE_MOVE,this.onMouseMove);
|
||||
this.eventSource.removeEventListener(MouseEvent.MOUSE_WHEEL,this.onMouseWheel);
|
||||
this.eventSource.removeEventListener(MouseEvent.MOUSE_DOWN,this.onMouseDown);
|
||||
this.eventSource.removeEventListener(MouseEvent.MOUSE_UP,this.onMouseUp);
|
||||
this.eventSource.removeEventListener(MouseEvent.MOUSE_UP,this.§_-4B§);
|
||||
}
|
||||
|
||||
override public function run() : void
|
||||
{
|
||||
this.var_229 = this.mouseX - this.var_227;
|
||||
this.var_228 = this.mouseY - this.var_226;
|
||||
this.dispatchKeyboardEvents();
|
||||
this.§_-Sm§ = this.mouseX - this.§_-8e§;
|
||||
this.§_-4F§ = this.mouseY - this.§_-dL§;
|
||||
this.§_-Db§();
|
||||
}
|
||||
|
||||
private function dispatchKeyboardEvents() : void
|
||||
private function §_-Db§() : void
|
||||
{
|
||||
var distinctListeners:Vector.<Function> = null;
|
||||
var listeners:Vector.<Function> = null;
|
||||
var event:KeyboardEventItem = null;
|
||||
var keyCode:uint = 0;
|
||||
var eventType:KeyboardEventType = null;
|
||||
var eventType:§_-X0§ = null;
|
||||
while(true)
|
||||
{
|
||||
event = this.var_222.poll();
|
||||
event = this.§use §.poll();
|
||||
if(event == null)
|
||||
{
|
||||
break;
|
||||
@@ -239,27 +239,27 @@ package alternativa.tanks.game.subsystems.inputsystem
|
||||
eventType = event.type;
|
||||
switch(eventType)
|
||||
{
|
||||
case KeyboardEventType.KEY_DOWN:
|
||||
distinctListeners = this.var_220[keyCode];
|
||||
listeners = this.var_219;
|
||||
case §_-X0§.KEY_DOWN:
|
||||
distinctListeners = this.§_-CU§[keyCode];
|
||||
listeners = this.§ use§;
|
||||
break;
|
||||
case KeyboardEventType.KEY_UP:
|
||||
distinctListeners = this.var_217[keyCode];
|
||||
listeners = this.var_218;
|
||||
case §_-X0§.KEY_UP:
|
||||
distinctListeners = this.§_-ll§[keyCode];
|
||||
listeners = this.§_-A4§;
|
||||
}
|
||||
if(distinctListeners != null)
|
||||
{
|
||||
this.dispatchKeyboardEvent(distinctListeners,eventType,keyCode);
|
||||
this.§_-np§(distinctListeners,eventType,keyCode);
|
||||
}
|
||||
if(listeners != null)
|
||||
{
|
||||
this.dispatchKeyboardEvent(listeners,eventType,keyCode);
|
||||
this.§_-np§(listeners,eventType,keyCode);
|
||||
}
|
||||
event.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
private function dispatchKeyboardEvent(listeners:Vector.<Function>, eventType:KeyboardEventType, keyCode:uint) : void
|
||||
private function §_-np§(listeners:Vector.<Function>, eventType:§_-X0§, keyCode:uint) : void
|
||||
{
|
||||
var func:Function = null;
|
||||
var numListeners:int = int(listeners.length);
|
||||
@@ -270,37 +270,37 @@ package alternativa.tanks.game.subsystems.inputsystem
|
||||
}
|
||||
}
|
||||
|
||||
public function method_341() : void
|
||||
public function §_-cM§() : void
|
||||
{
|
||||
this.var_230 = this.var_221;
|
||||
this.var_225 = false;
|
||||
this.var_227 = this.mouseX;
|
||||
this.var_226 = this.mouseY;
|
||||
this.var_223 = 0;
|
||||
this.§_-FK§ = this.§_-PG§;
|
||||
this.§_-Hv§ = false;
|
||||
this.§_-8e§ = this.mouseX;
|
||||
this.§_-dL§ = this.mouseY;
|
||||
this.§_-HC§ = 0;
|
||||
}
|
||||
|
||||
private function onKeyDown(event:KeyboardEvent) : void
|
||||
private function §_-Ze§(event:KeyboardEvent) : void
|
||||
{
|
||||
var keyCode:uint = uint(event.keyCode);
|
||||
if(keyCode < NUM_KEYS)
|
||||
{
|
||||
if(this.var_216.name_478(keyCode) == 0)
|
||||
if(this.§_-Pb§.§_-2C§(keyCode) == 0)
|
||||
{
|
||||
this.var_216.name_480(keyCode,true);
|
||||
this.var_222.add(keyCode,KeyboardEventType.KEY_DOWN);
|
||||
this.§_-Pb§.§_-Kg§(keyCode,true);
|
||||
this.§use §.add(keyCode,§_-X0§.KEY_DOWN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function onKeyUp(event:KeyboardEvent) : void
|
||||
private function §_-Uf§(event:KeyboardEvent) : void
|
||||
{
|
||||
var keyCode:uint = uint(event.keyCode);
|
||||
if(keyCode < NUM_KEYS)
|
||||
{
|
||||
if(this.var_216.name_478(keyCode) == 1)
|
||||
if(this.§_-Pb§.§_-2C§(keyCode) == 1)
|
||||
{
|
||||
this.var_216.name_480(keyCode,false);
|
||||
this.var_222.add(keyCode,KeyboardEventType.KEY_UP);
|
||||
this.§_-Pb§.§_-Kg§(keyCode,false);
|
||||
this.§use §.add(keyCode,§_-X0§.KEY_UP);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -313,29 +313,29 @@ package alternativa.tanks.game.subsystems.inputsystem
|
||||
|
||||
private function onMouseWheel(event:MouseEvent) : void
|
||||
{
|
||||
this.var_223 = event.delta;
|
||||
this.§_-HC§ = event.delta;
|
||||
}
|
||||
|
||||
private function onMouseDown(event:MouseEvent) : void
|
||||
{
|
||||
this.var_221 = true;
|
||||
this.var_225 = true;
|
||||
this.§_-PG§ = true;
|
||||
this.§_-Hv§ = true;
|
||||
}
|
||||
|
||||
private function onMouseUp(event:MouseEvent) : void
|
||||
private function §_-4B§(event:MouseEvent) : void
|
||||
{
|
||||
this.var_221 = false;
|
||||
this.§_-PG§ = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import alternativa.tanks.game.GameTask;
|
||||
import §_-az§.§_-ps§;
|
||||
|
||||
class CleanupTask extends GameTask
|
||||
class CleanupTask extends §_-ps§
|
||||
{
|
||||
private var inputSystem:InputSystem;
|
||||
private var inputSystem:§_-Yf§;
|
||||
|
||||
public function CleanupTask(priority:int, inputSystem:InputSystem)
|
||||
public function CleanupTask(priority:int, inputSystem:§_-Yf§)
|
||||
{
|
||||
super(priority);
|
||||
this.inputSystem = inputSystem;
|
||||
@@ -343,7 +343,7 @@ class CleanupTask extends GameTask
|
||||
|
||||
override public function run() : void
|
||||
{
|
||||
this.inputSystem.method_341();
|
||||
this.inputSystem.§_-cM§();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -351,7 +351,7 @@ class KeyboardEventItem
|
||||
{
|
||||
private static var pool:KeyboardEventItem;
|
||||
|
||||
public var type:KeyboardEventType;
|
||||
public var type:§_-X0§;
|
||||
|
||||
public var keyCode:uint;
|
||||
|
||||
@@ -392,7 +392,7 @@ class KeybardEventQueue
|
||||
super();
|
||||
}
|
||||
|
||||
public function add(keyCode:uint, type:KeyboardEventType) : void
|
||||
public function add(keyCode:uint, type:§_-X0§) : void
|
||||
{
|
||||
var keyItem:KeyboardEventItem = KeyboardEventItem.create();
|
||||
keyItem.keyCode = keyCode;
|
||||
@@ -1,22 +1,22 @@
|
||||
package package_41
|
||||
package §_-aa§
|
||||
{
|
||||
import §_-cv§.§_-NN§;
|
||||
import §_-cv§.§_-YU§;
|
||||
import §_-cv§.§_-cP§;
|
||||
import §_-cv§.§_-dD§;
|
||||
import flash.events.Event;
|
||||
import flash.utils.ByteArray;
|
||||
import alternativa.tanks.config.Config;
|
||||
import alternativa.tanks.config.StringUtils;
|
||||
import alternativa.tanks.config.BlobGroup;
|
||||
import alternativa.tanks.config.BlobCategory;
|
||||
import package_40.class_7;
|
||||
import package_40.name_169;
|
||||
import package_40.name_170;
|
||||
import §return§.§_-Ui§;
|
||||
import §return§.§_-h5§;
|
||||
import §return§.§_-pj§;
|
||||
|
||||
public class name_175 extends class_7
|
||||
public class §_-cS§ extends §_-h5§
|
||||
{
|
||||
private var config:Config;
|
||||
private var config:§_-YU§;
|
||||
|
||||
private var var_34:name_170;
|
||||
private var §_-d5§:§_-Ui§;
|
||||
|
||||
public function name_175(param1:Config)
|
||||
public function §_-cS§(param1:§_-YU§)
|
||||
{
|
||||
super();
|
||||
this.config = param1;
|
||||
@@ -32,53 +32,53 @@ package package_41
|
||||
var _loc6_:XML = null;
|
||||
var _loc7_:String = null;
|
||||
var _loc8_:String = null;
|
||||
this.var_34 = new name_170();
|
||||
this.§_-d5§ = new §_-Ui§();
|
||||
for each(_loc1_ in this.config.xml.elements("blobs").elements("blobs-category"))
|
||||
{
|
||||
_loc2_ = _loc1_.@id;
|
||||
for each(_loc3_ in _loc1_.elements("blobs-group"))
|
||||
{
|
||||
_loc4_ = _loc3_.@id;
|
||||
_loc5_ = StringUtils.name_460(_loc3_.@baseUrl);
|
||||
_loc5_ = §_-NN§.§_-KN§(_loc3_.@baseUrl);
|
||||
for each(_loc6_ in _loc3_.elements("blob"))
|
||||
{
|
||||
_loc7_ = _loc6_.@id;
|
||||
_loc8_ = _loc5_ + _loc6_.@file;
|
||||
this.var_34.addTask(new BlobLoader(_loc2_,_loc4_,_loc7_,_loc8_,this));
|
||||
this.§_-d5§.addTask(new BlobLoader(_loc2_,_loc4_,_loc7_,_loc8_,this));
|
||||
}
|
||||
}
|
||||
}
|
||||
this.var_34.addEventListener(name_169.TASK_COMPLETE,this.method_312);
|
||||
this.var_34.addEventListener(Event.COMPLETE,this.onLoadingComplete);
|
||||
this.var_34.run();
|
||||
this.§_-d5§.addEventListener(§_-pj§.TASK_COMPLETE,this.§_-fm§);
|
||||
this.§_-d5§.addEventListener(Event.COMPLETE,this.onLoadingComplete);
|
||||
this.§_-d5§.run();
|
||||
}
|
||||
|
||||
private function method_312(param1:name_169) : void
|
||||
private function §_-fm§(param1:§_-pj§) : void
|
||||
{
|
||||
dispatchEvent(new name_169(name_169.TASK_PROGRESS,1,this.var_34.length));
|
||||
dispatchEvent(new §_-pj§(§_-pj§.TASK_PROGRESS,1,this.§_-d5§.length));
|
||||
}
|
||||
|
||||
public function method_328(param1:String, param2:String, param3:String, param4:ByteArray) : void
|
||||
public function §_-To§(param1:String, param2:String, param3:String, param4:ByteArray) : void
|
||||
{
|
||||
var _loc5_:BlobCategory = this.config.name_68.name_72(param1);
|
||||
var _loc5_:§_-cP§ = this.config.§_-WG§.§_-hJ§(param1);
|
||||
if(_loc5_ == null)
|
||||
{
|
||||
_loc5_ = new BlobCategory();
|
||||
this.config.name_68.method_326(param1,_loc5_);
|
||||
_loc5_ = new §_-cP§();
|
||||
this.config.§_-WG§.§_-hv§(param1,_loc5_);
|
||||
}
|
||||
var _loc6_:BlobGroup = _loc5_.name_62(param2);
|
||||
var _loc6_:§_-dD§ = _loc5_.§_-EZ§(param2);
|
||||
if(_loc6_ == null)
|
||||
{
|
||||
_loc6_ = new BlobGroup();
|
||||
_loc5_.method_214(param2,_loc6_);
|
||||
_loc6_ = new §_-dD§();
|
||||
_loc5_.§_-b6§(param2,_loc6_);
|
||||
}
|
||||
_loc6_.method_218(param3,param4);
|
||||
_loc6_.§_-CC§(param3,param4);
|
||||
}
|
||||
|
||||
private function onLoadingComplete(param1:Event) : void
|
||||
{
|
||||
this.var_34 = null;
|
||||
method_102();
|
||||
this.§_-d5§ = null;
|
||||
§_-3Z§();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,9 +88,9 @@ import flash.events.EventDispatcher;
|
||||
import flash.net.URLLoader;
|
||||
import flash.net.URLLoaderDataFormat;
|
||||
import flash.net.URLRequest;
|
||||
import package_40.class_7;
|
||||
import §return§.§_-h5§;
|
||||
|
||||
class BlobLoader extends class_7
|
||||
class BlobLoader extends §_-h5§
|
||||
{
|
||||
private var categoryId:String;
|
||||
|
||||
@@ -100,11 +100,11 @@ class BlobLoader extends class_7
|
||||
|
||||
private var blobUrl:String;
|
||||
|
||||
private var blobsLoaderTask:name_175;
|
||||
private var blobsLoaderTask:§_-cS§;
|
||||
|
||||
private var loader:URLLoader;
|
||||
|
||||
public function BlobLoader(param1:String, param2:String, param3:String, param4:String, param5:name_175)
|
||||
public function BlobLoader(param1:String, param2:String, param3:String, param4:String, param5:§_-cS§)
|
||||
{
|
||||
super();
|
||||
this.categoryId = param1;
|
||||
@@ -124,8 +124,8 @@ class BlobLoader extends class_7
|
||||
|
||||
private function onLoadingComplete(param1:Event) : void
|
||||
{
|
||||
this.blobsLoaderTask.method_328(this.categoryId,this.groupId,this.blobId,this.loader.data);
|
||||
this.blobsLoaderTask.§_-To§(this.categoryId,this.groupId,this.blobId,this.loader.data);
|
||||
this.loader = null;
|
||||
method_102();
|
||||
§_-3Z§();
|
||||
}
|
||||
}
|
||||
101
src/?_-aa?/?_-i0?.as
Normal file
@@ -0,0 +1,101 @@
|
||||
package §_-aa§
|
||||
{
|
||||
import §_-cv§.§_-FR§;
|
||||
import §_-cv§.§_-NN§;
|
||||
import §_-cv§.§_-YU§;
|
||||
import flash.events.Event;
|
||||
import flash.media.Sound;
|
||||
import §return§.§_-Ui§;
|
||||
import §return§.§_-pj§;
|
||||
|
||||
public class §_-i0§ extends §_-FR§
|
||||
{
|
||||
private var sounds:Object = {};
|
||||
|
||||
private var §_-d5§:§_-Ui§;
|
||||
|
||||
public function §_-i0§(param1:§_-YU§)
|
||||
{
|
||||
super("Sounds library loader",param1);
|
||||
}
|
||||
|
||||
public function §_-lM§(param1:String) : Sound
|
||||
{
|
||||
return this.sounds[param1];
|
||||
}
|
||||
|
||||
public function §_-Od§(param1:String, param2:Sound) : void
|
||||
{
|
||||
this.sounds[param1] = param2;
|
||||
}
|
||||
|
||||
override public function run() : void
|
||||
{
|
||||
var _loc3_:XML = null;
|
||||
if(config.xml.sounds == null)
|
||||
{
|
||||
§_-3Z§();
|
||||
return;
|
||||
}
|
||||
var _loc1_:XML = config.xml.sounds[0];
|
||||
var _loc2_:String = §_-NN§.§_-KN§(_loc1_.@baseUrl);
|
||||
this.§_-d5§ = new §_-Ui§();
|
||||
for each(_loc3_ in _loc1_.sound)
|
||||
{
|
||||
this.§_-d5§.addTask(new SoundLoader(_loc3_.@id,_loc2_ + _loc3_.@file,this));
|
||||
}
|
||||
this.§_-d5§.addEventListener(§_-pj§.TASK_COMPLETE,this.§_-fm§);
|
||||
this.§_-d5§.addEventListener(Event.COMPLETE,this.§_-Pw§);
|
||||
this.§_-d5§.run();
|
||||
}
|
||||
|
||||
private function §_-fm§(param1:§_-pj§) : void
|
||||
{
|
||||
dispatchEvent(new §_-pj§(§_-pj§.TASK_PROGRESS,1,this.§_-d5§.length));
|
||||
}
|
||||
|
||||
private function §_-Pw§(param1:Event) : void
|
||||
{
|
||||
this.§_-d5§ = null;
|
||||
§_-3Z§();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import flash.events.Event;
|
||||
import flash.events.EventDispatcher;
|
||||
import flash.media.Sound;
|
||||
import flash.net.URLRequest;
|
||||
import §return§.§_-h5§;
|
||||
|
||||
class SoundLoader extends §_-h5§
|
||||
{
|
||||
private var id:String;
|
||||
|
||||
private var url:String;
|
||||
|
||||
private var library:§_-i0§;
|
||||
|
||||
private var loader:Sound;
|
||||
|
||||
public function SoundLoader(param1:String, param2:String, param3:§_-i0§)
|
||||
{
|
||||
super();
|
||||
this.id = param1;
|
||||
this.url = param2;
|
||||
this.library = param3;
|
||||
}
|
||||
|
||||
override public function run() : void
|
||||
{
|
||||
this.loader = new Sound();
|
||||
this.loader.addEventListener(Event.COMPLETE,this.onLoadingComplete);
|
||||
this.loader.load(new URLRequest(this.url));
|
||||
}
|
||||
|
||||
private function onLoadingComplete(param1:Event) : void
|
||||
{
|
||||
this.library.§_-Od§(this.id,this.loader);
|
||||
§_-3Z§();
|
||||
}
|
||||
}
|
||||
@@ -1,96 +1,96 @@
|
||||
package package_116
|
||||
package §_-am§
|
||||
{
|
||||
import §_-1z§.§_-gA§;
|
||||
import §_-1z§.§_-n4§;
|
||||
import §_-5Y§.A3D2Image;
|
||||
import §_-5Y§.A3D2Map;
|
||||
import §_-5Y§.A3D2Material;
|
||||
import §_-8D§.§_-FW§;
|
||||
import §_-8D§.§_-OX§;
|
||||
import §_-8D§.§_-d6§;
|
||||
import §_-8D§.§_-mb§;
|
||||
import §_-AA§.§_-10§;
|
||||
import §_-DJ§.§_-1F§;
|
||||
import §_-DJ§.§_-2i§;
|
||||
import §_-DJ§.§_-J5§;
|
||||
import §_-DJ§.§_-Sv§;
|
||||
import §_-Ex§.§_-54§;
|
||||
import §_-Ex§.§_-7D§;
|
||||
import §_-Ex§.§_-U2§;
|
||||
import §_-FM§.§_-fl§;
|
||||
import §_-Ie§.§_-Nq§;
|
||||
import §_-KL§.§_-Mu§;
|
||||
import §_-MH§.A3D2IndexBuffer;
|
||||
import §_-MH§.A3D2VertexAttributes;
|
||||
import §_-MH§.A3D2VertexBuffer;
|
||||
import §_-MU§.§_-5-§;
|
||||
import §_-QH§.§_-7x§;
|
||||
import §_-R1§.DirectionalLight;
|
||||
import §_-R1§.OmniLight;
|
||||
import §_-R1§.SpotLight;
|
||||
import §_-R1§.§_-LD§;
|
||||
import §_-TX§.§_-R3§;
|
||||
import §_-Uy§.§_-oP§;
|
||||
import §_-Vh§.§_-Pt§;
|
||||
import §_-Zp§.A3DBox;
|
||||
import §_-Zp§.A3DObject;
|
||||
import §_-Zp§.A3DSurface;
|
||||
import §_-d8§.§_-R3§;
|
||||
import §_-hQ§.§_-Fx§;
|
||||
import §_-hQ§.§_-W-§;
|
||||
import §_-i2§.A3DGeometry;
|
||||
import §_-i2§.A3DIndexBuffer;
|
||||
import §_-i2§.A3DVertexBuffer;
|
||||
import §_-iL§.§_-R6§;
|
||||
import §_-iL§.§_-Yr§;
|
||||
import §_-iL§.§_-ZD§;
|
||||
import §_-jN§.A3DImage;
|
||||
import §_-jN§.A3DMap;
|
||||
import §_-jN§.A3DMaterial;
|
||||
import §_-nD§.§_-aQ§;
|
||||
import §_-oA§.A3D2AmbientLight;
|
||||
import §_-oA§.A3D2Box;
|
||||
import §_-oA§.A3D2DirectionalLight;
|
||||
import §_-oA§.A3D2Joint;
|
||||
import §_-oA§.A3D2Mesh;
|
||||
import §_-oA§.A3D2Object;
|
||||
import §_-oA§.A3D2OmniLight;
|
||||
import §_-oA§.A3D2Skin;
|
||||
import §_-oA§.A3D2SpotLight;
|
||||
import §_-oA§.A3D2Surface;
|
||||
import §_-oA§.A3D2Transform;
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
import flash.geom.Matrix3D;
|
||||
import flash.geom.Vector3D;
|
||||
import flash.utils.ByteArray;
|
||||
import flash.utils.Dictionary;
|
||||
import flash.utils.Endian;
|
||||
import platform.client.a3d.osgi.Activator;
|
||||
import alternativa.protocol.osgi.ProtocolActivator;
|
||||
import platform.clients.fp10.libraries.alternativaprotocol.Activator;
|
||||
import package_19.name_380;
|
||||
import package_19.name_528;
|
||||
import package_19.name_700;
|
||||
import package_21.name_126;
|
||||
import package_21.name_386;
|
||||
import package_21.name_432;
|
||||
import package_21.name_78;
|
||||
import package_24.DirectionalLight;
|
||||
import package_24.OmniLight;
|
||||
import package_24.SpotLight;
|
||||
import package_24.name_376;
|
||||
import package_28.name_119;
|
||||
import package_28.name_167;
|
||||
import package_32.name_148;
|
||||
import package_33.name_155;
|
||||
import package_36.name_152;
|
||||
import package_36.name_163;
|
||||
import package_36.name_442;
|
||||
import package_36.name_648;
|
||||
import package_38.name_159;
|
||||
import package_38.name_162;
|
||||
import package_38.name_453;
|
||||
import package_39.name_160;
|
||||
import package_4.name_28;
|
||||
import package_48.A3D2AmbientLight;
|
||||
import package_48.A3D2Box;
|
||||
import package_48.A3D2DirectionalLight;
|
||||
import package_48.A3D2Joint;
|
||||
import package_48.A3D2Mesh;
|
||||
import package_48.A3D2Object;
|
||||
import package_48.A3D2OmniLight;
|
||||
import package_48.A3D2Skin;
|
||||
import package_48.A3D2SpotLight;
|
||||
import package_48.A3D2Surface;
|
||||
import package_48.A3D2Transform;
|
||||
import alternativa.osgi.OSGi;
|
||||
import package_50.A3DBox;
|
||||
import package_50.A3DObject;
|
||||
import package_50.A3DSurface;
|
||||
import package_51.A3D2Image;
|
||||
import package_51.A3D2Map;
|
||||
import package_51.A3D2Material;
|
||||
import package_52.A3D2IndexBuffer;
|
||||
import package_52.A3D2VertexAttributes;
|
||||
import package_52.A3D2VertexBuffer;
|
||||
import package_53.A3DImage;
|
||||
import package_53.A3DMap;
|
||||
import package_53.A3DMaterial;
|
||||
import package_54.A3DGeometry;
|
||||
import package_54.A3DIndexBuffer;
|
||||
import package_54.A3DVertexBuffer;
|
||||
import package_57.name_213;
|
||||
import package_57.name_214;
|
||||
import package_64.name_212;
|
||||
import package_65.name_210;
|
||||
import package_66.name_211;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
public class name_529
|
||||
public class §_-Fh§
|
||||
{
|
||||
public var hierarchy:Vector.<name_78>;
|
||||
public var hierarchy:Vector.<§_-OX§>;
|
||||
|
||||
public var objects:Vector.<name_78>;
|
||||
public var objects:Vector.<§_-OX§>;
|
||||
|
||||
private var maps:Dictionary;
|
||||
|
||||
private var materials:Dictionary;
|
||||
|
||||
private var protocol:name_159;
|
||||
private var protocol:§_-ZD§;
|
||||
|
||||
private var var_628:Object;
|
||||
private var §_-gk§:Object;
|
||||
|
||||
private var var_629:Boolean = false;
|
||||
private var §_-Y8§:Boolean = false;
|
||||
|
||||
public function name_529()
|
||||
public function §_-Fh§()
|
||||
{
|
||||
super();
|
||||
this.init();
|
||||
}
|
||||
|
||||
private static function method_725(source:name_210) : name_211
|
||||
private static function §_-a5§(source:§_-10§) : §_-Nq§
|
||||
{
|
||||
var i:int = 0;
|
||||
var count:int = 0;
|
||||
@@ -172,7 +172,7 @@ package package_116
|
||||
for(i = 0,count = int(sourceMaterials.length); i < count; i++)
|
||||
{
|
||||
sourceMaterial = sourceMaterials[i];
|
||||
destMaterial = new A3D2Material(method_715(sourceMaterial.diffuseMapId),method_715(sourceMaterial.glossinessMapId),method_715(sourceMaterial.id),method_715(sourceMaterial.lightMapId),method_715(sourceMaterial.normalMapId),method_715(sourceMaterial.opacityMapId),-1,method_715(sourceMaterial.specularMapId));
|
||||
destMaterial = new A3D2Material(§_-pc§(sourceMaterial.diffuseMapId),§_-pc§(sourceMaterial.glossinessMapId),§_-pc§(sourceMaterial.id),§_-pc§(sourceMaterial.lightMapId),§_-pc§(sourceMaterial.normalMapId),§_-pc§(sourceMaterial.opacityMapId),-1,§_-pc§(sourceMaterial.specularMapId));
|
||||
destMaterials[i] = destMaterial;
|
||||
}
|
||||
}
|
||||
@@ -204,7 +204,7 @@ package package_116
|
||||
sourceIndexBuffer = sourceGeometry.indexBuffer;
|
||||
sourceVertexBuffers = sourceGeometry.vertexBuffers;
|
||||
destIndexBuffer = new A3D2IndexBuffer(sourceIndexBuffer.byteBuffer,lastIndexBufferIndex++,sourceIndexBuffer.indexCount);
|
||||
destIndexBufferId = destIndexBuffer.id;
|
||||
destIndexBufferId = int(destIndexBuffer.id);
|
||||
destIndexBuffers.push(destIndexBuffer);
|
||||
for(j = 0,inCount = int(sourceVertexBuffers.length); j < inCount; j++)
|
||||
{
|
||||
@@ -240,41 +240,41 @@ package package_116
|
||||
destVertexBuffersIds.push(destVertexBuffer.id);
|
||||
}
|
||||
}
|
||||
destMesh = new A3D2Mesh(method_715(sourceObject.boundBoxId),method_719(sourceObject.id),destIndexBufferId,sourceObject.name,method_720(sourceObject.parentId),method_723(sourceObject.surfaces),new A3D2Transform(sourceObject.transformation.matrix),destVertexBuffersIds,sourceObject.visible);
|
||||
destMesh = new A3D2Mesh(§_-pc§(sourceObject.boundBoxId),§_-PV§(sourceObject.id),destIndexBufferId,sourceObject.name,§_-0m§(sourceObject.parentId),§_-qD§(sourceObject.surfaces),new A3D2Transform(sourceObject.transformation.matrix),destVertexBuffersIds,sourceObject.visible);
|
||||
destMeshes.push(destMesh);
|
||||
objectsMap[sourceObject.id.id] = destMesh;
|
||||
}
|
||||
else
|
||||
{
|
||||
destObject = new A3D2Object(method_715(sourceObject.boundBoxId),method_719(sourceObject.id),sourceObject.name,method_720(sourceObject.parentId),new A3D2Transform(sourceObject.transformation.matrix),sourceObject.visible);
|
||||
destObject = new A3D2Object(§_-pc§(sourceObject.boundBoxId),§_-PV§(sourceObject.id),sourceObject.name,§_-0m§(sourceObject.parentId),new A3D2Transform(sourceObject.transformation.matrix),sourceObject.visible);
|
||||
destObjects.push(destObject);
|
||||
objectsMap[sourceObject.id.id] = destObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new name_211(null,null,null,destBoxes,null,null,null,destImages,destIndexBuffers,null,destMaps,destMaterials,destMeshes != null && destMeshes.length > 0 ? destMeshes : null,destObjects != null && destObjects.length > 0 ? destObjects : null,null,null,null,null,destVertexBuffers);
|
||||
return new §_-Nq§(null,null,null,destBoxes,null,null,null,destImages,destIndexBuffers,null,destMaps,destMaterials,destMeshes != null && destMeshes.length > 0 ? destMeshes : null,destObjects != null && destObjects.length > 0 ? destObjects : null,null,null,null,null,destVertexBuffers);
|
||||
}
|
||||
|
||||
private static function method_715(id:name_213) : int
|
||||
private static function §_-pc§(id:§_-W-§) : int
|
||||
{
|
||||
return id != null ? int(id.id) : -1;
|
||||
}
|
||||
|
||||
private static function method_719(id:name_213) : name_155
|
||||
private static function §_-PV§(id:§_-W-§) : §_-Mu§
|
||||
{
|
||||
return id != null ? name_155.method_300(id.id) : name_155.method_300(-1);
|
||||
return id != null ? §_-Mu§.§_-mU§(id.id) : §_-Mu§.§_-mU§(-1);
|
||||
}
|
||||
|
||||
private static function method_720(parentId:name_212) : name_155
|
||||
private static function §_-0m§(parentId:§_-aQ§) : §_-Mu§
|
||||
{
|
||||
if(parentId == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return parentId != null ? name_155.method_300(parentId.id) : null;
|
||||
return parentId != null ? §_-Mu§.§_-mU§(parentId.id) : null;
|
||||
}
|
||||
|
||||
private static function method_723(source:Vector.<A3DSurface>) : Vector.<A3D2Surface>
|
||||
private static function §_-qD§(source:Vector.<A3DSurface>) : Vector.<A3D2Surface>
|
||||
{
|
||||
var sourceSurface:A3DSurface = null;
|
||||
var destSurface:A3D2Surface = null;
|
||||
@@ -282,13 +282,13 @@ package package_116
|
||||
for(var i:int = 0,var count:int = int(source.length); i < count; i++)
|
||||
{
|
||||
sourceSurface = source[i];
|
||||
destSurface = new A3D2Surface(sourceSurface.indexBegin,method_715(sourceSurface.materialId),sourceSurface.numTriangles);
|
||||
destSurface = new A3D2Surface(sourceSurface.indexBegin,§_-pc§(sourceSurface.materialId),sourceSurface.numTriangles);
|
||||
dest[i] = destSurface;
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
||||
public function method_314(input:ByteArray) : void
|
||||
public function §_-Om§(input:ByteArray) : void
|
||||
{
|
||||
var version:int = 0;
|
||||
try
|
||||
@@ -301,7 +301,7 @@ package package_116
|
||||
}
|
||||
else
|
||||
{
|
||||
this.method_726(input);
|
||||
this.§_-5V§(input);
|
||||
}
|
||||
}
|
||||
catch(e:Error)
|
||||
@@ -310,9 +310,9 @@ package package_116
|
||||
}
|
||||
}
|
||||
|
||||
public function method_729(name:String) : name_78
|
||||
public function §_-Yy§(name:String) : §_-OX§
|
||||
{
|
||||
var object:name_78 = null;
|
||||
var object:§_-OX§ = null;
|
||||
for each(object in this.objects)
|
||||
{
|
||||
if(object.name == name)
|
||||
@@ -325,41 +325,41 @@ package package_116
|
||||
|
||||
private function init() : void
|
||||
{
|
||||
if(this.var_629)
|
||||
if(this.§_-Y8§)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(OSGi.name_8() != null)
|
||||
if(§_-oP§.§_-nQ§() != null)
|
||||
{
|
||||
this.protocol = name_159(OSGi.name_8().name_30(name_163));
|
||||
this.protocol = §_-ZD§(§_-oP§.§_-nQ§().§_-N6§(§_-2i§));
|
||||
return;
|
||||
}
|
||||
OSGi.clientLog = new DummyClientLog();
|
||||
var osgi:OSGi = new OSGi();
|
||||
osgi.method_116(name_160,new DummyClientLog());
|
||||
new ProtocolActivator().start(osgi);
|
||||
new platform.client.a3d.osgi.Activator().start(osgi);
|
||||
new platform.clients.fp10.libraries.alternativaprotocol.Activator().start(osgi);
|
||||
this.protocol = name_159(osgi.name_30(name_163));
|
||||
this.var_629 = true;
|
||||
§_-oP§.clientLog = new DummyClientLog();
|
||||
var osgi:§_-oP§ = new §_-oP§();
|
||||
osgi.§_-g2§(§_-5-§,new DummyClientLog());
|
||||
new §_-fl§().start(osgi);
|
||||
new §_-d8§.§_-R3§().start(osgi);
|
||||
new §_-TX§.§_-R3§().start(osgi);
|
||||
this.protocol = §_-ZD§(osgi.§_-N6§(§_-2i§));
|
||||
this.§_-Y8§ = true;
|
||||
}
|
||||
|
||||
private function parseVersion1(input:ByteArray) : void
|
||||
{
|
||||
input.position = 4;
|
||||
var nullMap:name_648 = name_453.name_454(input);
|
||||
nullMap.name_702(0);
|
||||
var nullMap:§_-J5§ = §_-Yr§.§_-Nx§(input);
|
||||
nullMap.§_-iM§(0);
|
||||
var data:ByteArray = new ByteArray();
|
||||
data.writeBytes(input,input.position);
|
||||
data.position = 0;
|
||||
var buffer:name_442 = new name_442(data,data,nullMap);
|
||||
var codec:name_152 = this.protocol.name_448(new name_148(name_210,false));
|
||||
var _a3d:name_210 = name_210(codec.method_296(buffer));
|
||||
var a3d2:name_211 = method_725(_a3d);
|
||||
this.method_721(a3d2);
|
||||
var buffer:§_-1F§ = new §_-1F§(data,data,nullMap);
|
||||
var codec:§_-Sv§ = this.protocol.§_-8G§(new §_-7x§(§_-10§,false));
|
||||
var _a3d:§_-10§ = §_-10§(codec.§_-2Q§(buffer));
|
||||
var a3d2:§_-Nq§ = §_-a5§(_a3d);
|
||||
this.§_-Ol§(a3d2);
|
||||
}
|
||||
|
||||
private function method_721(a3d:name_211) : void
|
||||
private function §_-Ol§(a3d:§_-Nq§) : void
|
||||
{
|
||||
var a3DObject:A3D2Object = null;
|
||||
var a3DMesh:A3D2Mesh = null;
|
||||
@@ -375,17 +375,17 @@ package package_116
|
||||
var a3DDirLight:A3D2DirectionalLight = null;
|
||||
var a3DSkin:A3D2Skin = null;
|
||||
var a3DJoint:A3D2Joint = null;
|
||||
var parent:name_155 = null;
|
||||
var p:name_78 = null;
|
||||
var object:name_78 = null;
|
||||
var resJoint:name_700 = null;
|
||||
var resSkin:name_380 = null;
|
||||
var resAmbientLight:name_376 = null;
|
||||
var resObject:name_78 = null;
|
||||
var parent:§_-Mu§ = null;
|
||||
var p:§_-OX§ = null;
|
||||
var object:§_-OX§ = null;
|
||||
var resJoint:§_-7D§ = null;
|
||||
var resSkin:§_-U2§ = null;
|
||||
var resAmbientLight:§_-LD§ = null;
|
||||
var resObject:§_-OX§ = null;
|
||||
var resOmniLight:OmniLight = null;
|
||||
var resSpotLight:SpotLight = null;
|
||||
var resDirLight:DirectionalLight = null;
|
||||
var resMesh:name_380 = null;
|
||||
var resMesh:§_-U2§ = null;
|
||||
var objectsMap:Dictionary = new Dictionary();
|
||||
var a3DIndexBuffers:Dictionary = new Dictionary();
|
||||
var a3DVertexBuffers:Dictionary = new Dictionary();
|
||||
@@ -418,14 +418,14 @@ package package_116
|
||||
{
|
||||
a3DImages[a3DImage.id] = a3DImage;
|
||||
}
|
||||
this.hierarchy = new Vector.<name_78>();
|
||||
this.objects = new Vector.<name_78>();
|
||||
this.hierarchy = new Vector.<§_-OX§>();
|
||||
this.objects = new Vector.<§_-OX§>();
|
||||
this.maps = new Dictionary();
|
||||
this.materials = new Dictionary();
|
||||
this.var_628 = new Dictionary();
|
||||
this.§_-gk§ = new Dictionary();
|
||||
for each(a3DJoint in a3d.joints)
|
||||
{
|
||||
resJoint = new name_700();
|
||||
resJoint = new §_-7D§();
|
||||
resJoint.visible = a3DJoint.visible;
|
||||
resJoint.name = a3DJoint.name;
|
||||
parents[resJoint] = a3DJoint.parentId;
|
||||
@@ -435,16 +435,16 @@ package package_116
|
||||
this.hierarchy.push(resJoint);
|
||||
}
|
||||
this.objects.push(resJoint);
|
||||
this.method_716(a3DJoint.transform,resJoint);
|
||||
this.§_-ET§(a3DJoint.transform,resJoint);
|
||||
a3DBox = a3DBoxes[a3DJoint.boundBoxId];
|
||||
if(a3DBox != null)
|
||||
{
|
||||
this.method_718(a3DBox.box,resJoint);
|
||||
this.§_-Rh§(a3DBox.box,resJoint);
|
||||
}
|
||||
}
|
||||
for each(a3DSkin in a3d.skins)
|
||||
{
|
||||
resSkin = this.method_429(a3DSkin,a3DIndexBuffers,a3DVertexBuffers,a3DMaterials,a3DMaps,a3DImages);
|
||||
resSkin = this.§_-hi§(a3DSkin,a3DIndexBuffers,a3DVertexBuffers,a3DMaterials,a3DMaps,a3DImages);
|
||||
resSkin.visible = a3DSkin.visible;
|
||||
resSkin.name = a3DSkin.name;
|
||||
parents[resSkin] = a3DSkin.parentId;
|
||||
@@ -454,16 +454,16 @@ package package_116
|
||||
this.hierarchy.push(resSkin);
|
||||
}
|
||||
this.objects.push(resSkin);
|
||||
this.method_716(a3DSkin.transform,resSkin);
|
||||
this.§_-ET§(a3DSkin.transform,resSkin);
|
||||
a3DBox = a3DBoxes[a3DSkin.boundBoxId];
|
||||
if(a3DBox != null)
|
||||
{
|
||||
this.method_718(a3DBox.box,resSkin);
|
||||
this.§_-Rh§(a3DBox.box,resSkin);
|
||||
}
|
||||
}
|
||||
for each(a3DAmbientLight in a3d.ambientLights)
|
||||
{
|
||||
resAmbientLight = new name_376(a3DAmbientLight.color);
|
||||
resAmbientLight = new §_-LD§(a3DAmbientLight.color);
|
||||
resAmbientLight.intensity = a3DAmbientLight.intensity;
|
||||
resAmbientLight.visible = a3DAmbientLight.visible;
|
||||
resAmbientLight.name = a3DAmbientLight.name;
|
||||
@@ -474,16 +474,16 @@ package package_116
|
||||
this.hierarchy.push(resAmbientLight);
|
||||
}
|
||||
this.objects.push(resAmbientLight);
|
||||
this.method_716(a3DAmbientLight.transform,resAmbientLight);
|
||||
this.§_-ET§(a3DAmbientLight.transform,resAmbientLight);
|
||||
a3DBox = a3DBoxes[a3DAmbientLight.boundBoxId];
|
||||
if(a3DBox != null)
|
||||
{
|
||||
this.method_718(a3DBox.box,resAmbientLight);
|
||||
this.§_-Rh§(a3DBox.box,resAmbientLight);
|
||||
}
|
||||
}
|
||||
for each(a3DObject in a3d.objects)
|
||||
{
|
||||
resObject = new name_78();
|
||||
resObject = new §_-OX§();
|
||||
resObject.visible = a3DObject.visible;
|
||||
resObject.name = a3DObject.name;
|
||||
parents[resObject] = a3DObject.parentId;
|
||||
@@ -493,11 +493,11 @@ package package_116
|
||||
this.hierarchy.push(resObject);
|
||||
}
|
||||
this.objects.push(resObject);
|
||||
this.method_716(a3DObject.transform,resObject);
|
||||
this.§_-ET§(a3DObject.transform,resObject);
|
||||
a3DBox = a3DBoxes[a3DObject.boundBoxId];
|
||||
if(a3DBox != null)
|
||||
{
|
||||
this.method_718(a3DBox.box,resObject);
|
||||
this.§_-Rh§(a3DBox.box,resObject);
|
||||
}
|
||||
}
|
||||
for each(a3DOmniLight in a3d.omniLights)
|
||||
@@ -512,7 +512,7 @@ package package_116
|
||||
this.hierarchy.push(resOmniLight);
|
||||
}
|
||||
this.objects.push(resOmniLight);
|
||||
this.method_716(a3DOmniLight.transform,resOmniLight);
|
||||
this.§_-ET§(a3DOmniLight.transform,resOmniLight);
|
||||
}
|
||||
for each(a3DSpotLight in a3d.spotLights)
|
||||
{
|
||||
@@ -526,7 +526,7 @@ package package_116
|
||||
this.hierarchy.push(resSpotLight);
|
||||
}
|
||||
this.objects.push(resSpotLight);
|
||||
this.method_716(a3DSpotLight.transform,resSpotLight);
|
||||
this.§_-ET§(a3DSpotLight.transform,resSpotLight);
|
||||
}
|
||||
for each(a3DDirLight in a3d.directionalLights)
|
||||
{
|
||||
@@ -540,11 +540,11 @@ package package_116
|
||||
this.hierarchy.push(resDirLight);
|
||||
}
|
||||
this.objects.push(resDirLight);
|
||||
this.method_716(a3DDirLight.transform,resDirLight);
|
||||
this.§_-ET§(a3DDirLight.transform,resDirLight);
|
||||
}
|
||||
for each(a3DMesh in a3d.meshes)
|
||||
{
|
||||
resMesh = this.method_727(a3DMesh,a3DIndexBuffers,a3DVertexBuffers,a3DMaterials,a3DMaps,a3DImages);
|
||||
resMesh = this.§_-cN§(a3DMesh,a3DIndexBuffers,a3DVertexBuffers,a3DMaterials,a3DMaps,a3DImages);
|
||||
resMesh.visible = a3DMesh.visible;
|
||||
resMesh.name = a3DMesh.name;
|
||||
parents[resMesh] = a3DMesh.parentId;
|
||||
@@ -554,11 +554,11 @@ package package_116
|
||||
this.hierarchy.push(resMesh);
|
||||
}
|
||||
this.objects.push(resMesh);
|
||||
this.method_716(a3DMesh.transform,resMesh);
|
||||
this.§_-ET§(a3DMesh.transform,resMesh);
|
||||
a3DBox = a3DBoxes[a3DMesh.boundBoxId];
|
||||
if(a3DBox != null)
|
||||
{
|
||||
this.method_718(a3DBox.box,resMesh);
|
||||
this.§_-Rh§(a3DBox.box,resMesh);
|
||||
}
|
||||
}
|
||||
for each(object in objectsMap)
|
||||
@@ -572,17 +572,17 @@ package package_116
|
||||
}
|
||||
}
|
||||
|
||||
private function method_730(source:Vector.<Vector.<name_155>>, objectsMap:Dictionary) : Vector.<Vector.<name_700>>
|
||||
private function §_-V6§(source:Vector.<Vector.<§_-Mu§>>, objectsMap:Dictionary) : Vector.<Vector.<§_-7D§>>
|
||||
{
|
||||
var vector:Vector.<name_155> = null;
|
||||
var resultVector:Vector.<name_700> = null;
|
||||
var vector:Vector.<§_-Mu§> = null;
|
||||
var resultVector:Vector.<§_-7D§> = null;
|
||||
var j:int = 0;
|
||||
var jcount:int = 0;
|
||||
var result:Vector.<Vector.<name_700>> = new Vector.<Vector.<name_700>>();
|
||||
var result:Vector.<Vector.<§_-7D§>> = new Vector.<Vector.<§_-7D§>>();
|
||||
for(var i:int = 0,var count:int = int(source.length); i < count; i++)
|
||||
{
|
||||
vector = source[i];
|
||||
resultVector = new Vector.<name_700>();
|
||||
resultVector = new Vector.<§_-7D§>();
|
||||
for(j = 0,jcount = int(vector.length); j < jcount; j++)
|
||||
{
|
||||
resultVector[j] = objectsMap[vector[j]];
|
||||
@@ -592,12 +592,12 @@ package package_116
|
||||
return result;
|
||||
}
|
||||
|
||||
private function method_726(input:ByteArray) : void
|
||||
private function §_-5V§(input:ByteArray) : void
|
||||
{
|
||||
input.position = 0;
|
||||
var data:ByteArray = new ByteArray();
|
||||
var buffer:name_442 = new name_442(data,data,new name_648());
|
||||
name_162.method_303(input,buffer);
|
||||
var buffer:§_-1F§ = new §_-1F§(data,data,new §_-J5§());
|
||||
§_-R6§.§_-Nd§(input,buffer);
|
||||
input.position = 0;
|
||||
var versionMajor:int = int(buffer.reader.readUnsignedShort());
|
||||
var versionMinor:int = int(buffer.reader.readUnsignedShort());
|
||||
@@ -608,16 +608,16 @@ package package_116
|
||||
}
|
||||
}
|
||||
|
||||
private function parseVersion2_0(buffer:name_442) : void
|
||||
private function parseVersion2_0(buffer:§_-1F§) : void
|
||||
{
|
||||
var codec:name_152 = this.protocol.name_448(new name_148(name_211,false));
|
||||
var a3d:name_211 = name_211(codec.method_296(buffer));
|
||||
this.method_721(a3d);
|
||||
var codec:§_-Sv§ = this.protocol.§_-8G§(new §_-7x§(§_-Nq§,false));
|
||||
var a3d:§_-Nq§ = §_-Nq§(codec.§_-2Q§(buffer));
|
||||
this.§_-Ol§(a3d);
|
||||
}
|
||||
|
||||
private function method_718(box:Vector.<Number>, destination:name_78) : void
|
||||
private function §_-Rh§(box:Vector.<Number>, destination:§_-OX§) : void
|
||||
{
|
||||
destination.boundBox = new name_386();
|
||||
destination.boundBox = new §_-FW§();
|
||||
destination.boundBox.minX = box[0];
|
||||
destination.boundBox.minY = box[1];
|
||||
destination.boundBox.minZ = box[2];
|
||||
@@ -626,13 +626,13 @@ package package_116
|
||||
destination.boundBox.maxZ = box[5];
|
||||
}
|
||||
|
||||
private function method_716(transform:A3D2Transform, obj:name_78) : void
|
||||
private function §_-ET§(transform:A3D2Transform, obj:§_-OX§) : void
|
||||
{
|
||||
if(transform == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var matrix:name_214 = transform.matrix;
|
||||
var matrix:§_-Fx§ = transform.matrix;
|
||||
var mat:Matrix3D = new Matrix3D(Vector.<Number>([matrix.a,matrix.e,matrix.i,0,matrix.b,matrix.f,matrix.j,0,matrix.c,matrix.g,matrix.k,0,matrix.d,matrix.h,matrix.l,1]));
|
||||
var vecs:Vector.<Vector3D> = mat.decompose();
|
||||
obj.x = vecs[0].x;
|
||||
@@ -646,55 +646,55 @@ package package_116
|
||||
obj.scaleZ = vecs[2].z;
|
||||
}
|
||||
|
||||
private function method_728(transform:A3D2Transform, obj:name_700) : void
|
||||
private function §_-Ma§(transform:A3D2Transform, obj:§_-7D§) : void
|
||||
{
|
||||
if(transform == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var matrix:name_214 = transform.matrix;
|
||||
var matrix:§_-Fx§ = transform.matrix;
|
||||
var mat:Vector.<Number> = Vector.<Number>([matrix.a,matrix.b,matrix.c,matrix.d,matrix.e,matrix.f,matrix.g,matrix.h,matrix.i,matrix.j,matrix.k,matrix.l]);
|
||||
obj.alternativa3d::name_701(mat);
|
||||
obj.alternativa3d::_-k9(mat);
|
||||
}
|
||||
|
||||
private function method_727(a3DMesh:A3D2Mesh, indexBuffers:Dictionary, vertexBuffers:Dictionary, materials:Dictionary, maps:Dictionary, images:Dictionary) : name_380
|
||||
private function §_-cN§(a3DMesh:A3D2Mesh, indexBuffers:Dictionary, vertexBuffers:Dictionary, materials:Dictionary, maps:Dictionary, images:Dictionary) : §_-U2§
|
||||
{
|
||||
var s:A3D2Surface = null;
|
||||
var m:name_641 = null;
|
||||
var res:name_380 = new name_380();
|
||||
res.geometry = this.method_724(a3DMesh.indexBufferId,a3DMesh.vertexBuffers,indexBuffers,vertexBuffers);
|
||||
var m:§_-qn§ = null;
|
||||
var res:§_-U2§ = new §_-U2§();
|
||||
res.geometry = this.§_-DD§(a3DMesh.indexBufferId,a3DMesh.vertexBuffers,indexBuffers,vertexBuffers);
|
||||
var surfaces:Vector.<A3D2Surface> = a3DMesh.surfaces;
|
||||
for(var i:int = 0; i < surfaces.length; i++)
|
||||
{
|
||||
s = surfaces[i];
|
||||
m = this.method_722(materials[s.materialId],maps,images);
|
||||
m = this.§_-dI§(materials[s.materialId],maps,images);
|
||||
res.addSurface(m,s.indexBegin,s.numTriangles);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private function method_429(a3DSkin:A3D2Skin, indexBuffers:Dictionary, vertexBuffers:Dictionary, materials:Dictionary, maps:Dictionary, images:Dictionary) : name_528
|
||||
private function §_-hi§(a3DSkin:A3D2Skin, indexBuffers:Dictionary, vertexBuffers:Dictionary, materials:Dictionary, maps:Dictionary, images:Dictionary) : §_-54§
|
||||
{
|
||||
var s:A3D2Surface = null;
|
||||
var m:name_641 = null;
|
||||
var res:name_528 = new name_528(1,a3DSkin.joints.length);
|
||||
res.geometry = this.method_724(a3DSkin.indexBufferId,a3DSkin.vertexBuffers,indexBuffers,vertexBuffers);
|
||||
var m:§_-qn§ = null;
|
||||
var res:§_-54§ = new §_-54§(1,a3DSkin.joints.length);
|
||||
res.geometry = this.§_-DD§(a3DSkin.indexBufferId,a3DSkin.vertexBuffers,indexBuffers,vertexBuffers);
|
||||
var surfaces:Vector.<A3D2Surface> = a3DSkin.surfaces;
|
||||
for(var i:int = 0; i < surfaces.length; i++)
|
||||
{
|
||||
s = surfaces[i];
|
||||
m = this.method_722(materials[s.materialId],maps,images);
|
||||
m = this.§_-dI§(materials[s.materialId],maps,images);
|
||||
res.addSurface(m,s.indexBegin,s.numTriangles);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private function method_731(geometry:name_119) : void
|
||||
private function §_-Jp§(geometry:§_-gA§) : void
|
||||
{
|
||||
var offset:int = 0;
|
||||
var i:int = 0;
|
||||
var attr:int = 0;
|
||||
var vertexStream:name_432 = geometry.alternativa3d::_vertexStreams[0];
|
||||
var vertexStream:§_-mb§ = geometry.alternativa3d::_vertexStreams[0];
|
||||
var prev:int = -1;
|
||||
var stride:int = vertexStream.attributes.length * 4;
|
||||
var length:int = vertexStream.data.length / stride;
|
||||
@@ -710,11 +710,11 @@ package package_116
|
||||
{
|
||||
switch(attr)
|
||||
{
|
||||
case name_126.JOINTS[0]:
|
||||
case §_-d6§.JOINTS[0]:
|
||||
data.position = j * stride + offset;
|
||||
trace("JOINT0:",data.readFloat(),data.readFloat(),data.readFloat(),data.readFloat());
|
||||
break;
|
||||
case name_126.JOINTS[1]:
|
||||
case §_-d6§.JOINTS[1]:
|
||||
data.position = j * stride + offset;
|
||||
trace("JOINT1:",data.readFloat(),data.readFloat(),data.readFloat(),data.readFloat());
|
||||
}
|
||||
@@ -724,10 +724,10 @@ package package_116
|
||||
}
|
||||
}
|
||||
|
||||
private function method_724(indexBufferID:int, vertexBuffersIDs:Vector.<int>, indexBuffers:Dictionary, vertexBuffers:Dictionary) : name_119
|
||||
private function §_-DD§(indexBufferID:int, vertexBuffersIDs:Vector.<int>, indexBuffers:Dictionary, vertexBuffers:Dictionary) : §_-gA§
|
||||
{
|
||||
var id:int = 0;
|
||||
var geometry:name_119 = null;
|
||||
var geometry:§_-gA§ = null;
|
||||
var vertexCount:uint = 0;
|
||||
var buffer:A3D2VertexBuffer = null;
|
||||
var byteArray:ByteArray = null;
|
||||
@@ -743,21 +743,21 @@ package package_116
|
||||
{
|
||||
key += "v" + id.toString();
|
||||
}
|
||||
geometry = this.var_628[key];
|
||||
geometry = this.§_-gk§[key];
|
||||
if(geometry != null)
|
||||
{
|
||||
return geometry;
|
||||
}
|
||||
geometry = new name_119();
|
||||
geometry = new §_-gA§();
|
||||
var a3dIB:A3D2IndexBuffer = indexBuffers[indexBufferID];
|
||||
var indices:Vector.<uint> = name_28.method_99(a3dIB.byteBuffer);
|
||||
var indices:Vector.<uint> = §_-Pt§.§_-a1§(a3dIB.byteBuffer);
|
||||
var uvoffset:int = 0;
|
||||
geometry.alternativa3d::_indices = indices;
|
||||
var buffers:Vector.<int> = vertexBuffersIDs;
|
||||
for(var j:int = 0; j < buffers.length; j++)
|
||||
{
|
||||
buffer = vertexBuffers[buffers[j]];
|
||||
vertexCount = buffer.vertexCount;
|
||||
vertexCount = uint(buffer.vertexCount);
|
||||
byteArray = buffer.byteBuffer;
|
||||
byteArray.endian = Endian.LITTLE_ENDIAN;
|
||||
offset = 0;
|
||||
@@ -768,23 +768,23 @@ package package_116
|
||||
switch(buffer.attributes[k])
|
||||
{
|
||||
case A3D2VertexAttributes.POSITION:
|
||||
attr = int(name_126.POSITION);
|
||||
attr = int(§_-d6§.POSITION);
|
||||
break;
|
||||
case A3D2VertexAttributes.NORMAL:
|
||||
attr = int(name_126.NORMAL);
|
||||
attr = int(§_-d6§.NORMAL);
|
||||
break;
|
||||
case A3D2VertexAttributes.TANGENT4:
|
||||
attr = int(name_126.TANGENT4);
|
||||
attr = int(§_-d6§.TANGENT4);
|
||||
break;
|
||||
case A3D2VertexAttributes.TEXCOORD:
|
||||
attr = int(name_126.TEXCOORDS[uvoffset]);
|
||||
attr = int(§_-d6§.TEXCOORDS[uvoffset]);
|
||||
uvoffset++;
|
||||
break;
|
||||
case A3D2VertexAttributes.JOINT:
|
||||
attr = int(name_126.JOINTS[jointsOffset]);
|
||||
attr = int(§_-d6§.JOINTS[jointsOffset]);
|
||||
jointsOffset++;
|
||||
}
|
||||
numFloats = name_126.name_433(attr);
|
||||
numFloats = int(§_-d6§.§_-Dk§(attr));
|
||||
numFloats = numFloats < 1 ? 1 : numFloats;
|
||||
for(t = 0; t < numFloats; t++)
|
||||
{
|
||||
@@ -796,51 +796,51 @@ package package_116
|
||||
geometry.alternativa3d::_vertexStreams[0].data = byteArray;
|
||||
}
|
||||
geometry.alternativa3d::_numVertices = buffers.length > 0 ? int(vertexCount) : 0;
|
||||
this.var_628[key] = geometry;
|
||||
this.§_-gk§[key] = geometry;
|
||||
return geometry;
|
||||
}
|
||||
|
||||
private function method_717(source:A3D2Map, images:Dictionary) : name_167
|
||||
private function §_-L2§(source:A3D2Map, images:Dictionary) : §_-n4§
|
||||
{
|
||||
if(source == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var res:name_167 = this.maps[source.imageId];
|
||||
var res:§_-n4§ = this.maps[source.imageId];
|
||||
if(res != null)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
return this.maps[source.imageId] = new name_167(images[source.imageId].url);
|
||||
return this.maps[source.imageId] = new §_-n4§(images[source.imageId].url);
|
||||
}
|
||||
|
||||
private function method_722(source:A3D2Material, a3DMaps:Dictionary, images:Dictionary) : name_641
|
||||
private function §_-dI§(source:A3D2Material, a3DMaps:Dictionary, images:Dictionary) : §_-qn§
|
||||
{
|
||||
if(source == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var res:name_641 = this.materials[source.id];
|
||||
var res:§_-qn§ = this.materials[source.id];
|
||||
if(res != null)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
res = this.materials[source.id] = new name_641();
|
||||
res.textures["diffuse"] = this.method_717(a3DMaps[source.diffuseMapId],images);
|
||||
res.textures["emission"] = this.method_717(a3DMaps[source.lightMapId],images);
|
||||
res.textures["bump"] = this.method_717(a3DMaps[source.normalMapId],images);
|
||||
res.textures["specular"] = this.method_717(a3DMaps[source.specularMapId],images);
|
||||
res.textures["glossiness"] = this.method_717(a3DMaps[source.glossinessMapId],images);
|
||||
res.textures["transparent"] = this.method_717(a3DMaps[source.opacityMapId],images);
|
||||
res = this.materials[source.id] = new §_-qn§();
|
||||
res.textures["diffuse"] = this.§_-L2§(a3DMaps[source.diffuseMapId],images);
|
||||
res.textures["emission"] = this.§_-L2§(a3DMaps[source.lightMapId],images);
|
||||
res.textures["bump"] = this.§_-L2§(a3DMaps[source.normalMapId],images);
|
||||
res.textures["specular"] = this.§_-L2§(a3DMaps[source.specularMapId],images);
|
||||
res.textures["glossiness"] = this.§_-L2§(a3DMaps[source.glossinessMapId],images);
|
||||
res.textures["transparent"] = this.§_-L2§(a3DMaps[source.opacityMapId],images);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import package_39.name_160;
|
||||
import package_39.name_450;
|
||||
import §_-MU§.§_-5-§;
|
||||
import §_-MU§.§_-XQ§;
|
||||
|
||||
class DummyClientLog implements name_160
|
||||
class DummyClientLog implements §_-5-§
|
||||
{
|
||||
public function DummyClientLog()
|
||||
{
|
||||
@@ -860,19 +860,19 @@ class DummyClientLog implements name_160
|
||||
return null;
|
||||
}
|
||||
|
||||
public function addLogListener(listener:name_450) : void
|
||||
public function addLogListener(listener:§_-XQ§) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function removeLogListener(listener:name_450) : void
|
||||
public function removeLogListener(listener:§_-XQ§) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function addLogChannelListener(channelName:String, listener:name_450) : void
|
||||
public function addLogChannelListener(channelName:String, listener:§_-XQ§) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function removeLogChannelListener(channelName:String, listener:name_450) : void
|
||||
public function removeLogChannelListener(channelName:String, listener:§_-XQ§) : void
|
||||
{
|
||||
}
|
||||
|
||||
175
src/?_-az?/?_-1H?.as
Normal file
@@ -0,0 +1,175 @@
|
||||
package §_-az§
|
||||
{
|
||||
import §_-Lt§.§_-Fv§;
|
||||
import §_-Lt§.§_-x§;
|
||||
import flash.utils.Dictionary;
|
||||
import flash.utils.describeType;
|
||||
import flash.utils.getDefinitionByName;
|
||||
|
||||
public class §_-1H§
|
||||
{
|
||||
private var §_-AF§:§_-Fv§ = new §_-Fv§();
|
||||
|
||||
private var §_-Ey§:TaskArray = new TaskArray();
|
||||
|
||||
private var §_-4z§:TaskArray = new TaskArray();
|
||||
|
||||
private var §_-TV§:Dictionary = new Dictionary();
|
||||
|
||||
public function §_-1H§()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function addTask(task:§_-ps§) : void
|
||||
{
|
||||
if(this.§_-AF§.contains(task))
|
||||
{
|
||||
throw new Error("Task is already active");
|
||||
}
|
||||
if(this.§_-Ey§.contains(task))
|
||||
{
|
||||
throw new Error("Task has been already scheduled for addition");
|
||||
}
|
||||
this.§_-Ey§.add(task);
|
||||
}
|
||||
|
||||
public function killTask(task:§_-ps§) : void
|
||||
{
|
||||
if(Boolean(this.§_-AF§.contains(task)) && !this.§_-4z§.contains(task))
|
||||
{
|
||||
this.§_-4z§.add(task);
|
||||
}
|
||||
}
|
||||
|
||||
public function §_-h3§() : void
|
||||
{
|
||||
var task:§_-ps§ = null;
|
||||
this.§_-db§();
|
||||
var iterator:§_-x§ = this.§_-AF§.listIterator();
|
||||
while(iterator.hasNext())
|
||||
{
|
||||
task = §_-ps§(iterator.next());
|
||||
if(!task.§_-DX§)
|
||||
{
|
||||
task.run();
|
||||
}
|
||||
}
|
||||
this.§_-4g§();
|
||||
}
|
||||
|
||||
public function getTaskInterface(taskInterface:Class) : Object
|
||||
{
|
||||
return this.§_-TV§[taskInterface];
|
||||
}
|
||||
|
||||
public function §_-Ap§() : void
|
||||
{
|
||||
var task:§_-ps§ = null;
|
||||
var listIterator:§_-x§ = this.§_-AF§.listIterator();
|
||||
while(listIterator.hasNext())
|
||||
{
|
||||
task = §_-ps§(listIterator.next());
|
||||
this.killTask(task);
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-db§() : void
|
||||
{
|
||||
var task:§_-ps§ = null;
|
||||
var taskInterfaces:Vector.<Class> = null;
|
||||
var taskInterface:Class = null;
|
||||
var activeTasksIterator:§_-x§ = null;
|
||||
var activeTask:§_-ps§ = null;
|
||||
for(var i:int = 0; i < this.§_-Ey§.numTasks; i++)
|
||||
{
|
||||
task = this.§_-Ey§.tasks[i];
|
||||
task.§_-Uw§ = this;
|
||||
task.start();
|
||||
taskInterfaces = this.§_-8q§(task);
|
||||
for each(taskInterface in taskInterfaces)
|
||||
{
|
||||
this.§_-TV§[taskInterface] = task;
|
||||
}
|
||||
activeTasksIterator = this.§_-AF§.listIterator();
|
||||
while(activeTasksIterator.hasNext())
|
||||
{
|
||||
activeTask = §_-ps§(activeTasksIterator.next());
|
||||
if(activeTask.priority > task.priority)
|
||||
{
|
||||
activeTasksIterator.§_-q9§();
|
||||
break;
|
||||
}
|
||||
}
|
||||
activeTasksIterator.add(task);
|
||||
}
|
||||
this.§_-Ey§.clear();
|
||||
}
|
||||
|
||||
private function §_-4g§() : void
|
||||
{
|
||||
var task:§_-ps§ = null;
|
||||
var taskInterfaces:Vector.<Class> = null;
|
||||
var taskInterface:Class = null;
|
||||
for(var i:int = 0; i < this.§_-4z§.numTasks; i++)
|
||||
{
|
||||
task = this.§_-4z§.tasks[i];
|
||||
this.§_-AF§.remove(task);
|
||||
task.stop();
|
||||
taskInterfaces = this.§_-8q§(task);
|
||||
for each(taskInterface in taskInterfaces)
|
||||
{
|
||||
delete this.§_-TV§[taskInterface];
|
||||
}
|
||||
task.§_-Uw§ = null;
|
||||
}
|
||||
this.§_-4z§.clear();
|
||||
}
|
||||
|
||||
private function §_-8q§(object:Object) : Vector.<Class>
|
||||
{
|
||||
var interfaceXML:XML = null;
|
||||
var interfaceClass:Object = null;
|
||||
var result:Vector.<Class> = new Vector.<Class>();
|
||||
var xml:XML = describeType(object);
|
||||
for each(interfaceXML in xml.implementsInterface)
|
||||
{
|
||||
interfaceClass = getDefinitionByName(interfaceXML.@type);
|
||||
result.push(interfaceClass);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TaskArray
|
||||
{
|
||||
public var tasks:Vector.<§_-ps§> = new Vector.<§_-ps§>();
|
||||
|
||||
public var numTasks:int;
|
||||
|
||||
public function TaskArray()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function add(task:§_-ps§) : void
|
||||
{
|
||||
var _loc2_:* = this.numTasks++;
|
||||
this.tasks[_loc2_] = task;
|
||||
}
|
||||
|
||||
public function clear() : void
|
||||
{
|
||||
for(var i:int = 0; i < this.numTasks; i++)
|
||||
{
|
||||
this.tasks[i] = null;
|
||||
}
|
||||
this.numTasks = 0;
|
||||
}
|
||||
|
||||
public function contains(task:§_-ps§) : Boolean
|
||||
{
|
||||
return this.tasks.indexOf(task) >= 0;
|
||||
}
|
||||
}
|
||||
216
src/?_-az?/?_-AG?.as
Normal file
@@ -0,0 +1,216 @@
|
||||
package §_-az§
|
||||
{
|
||||
import §_-Fc§.§_-8a§;
|
||||
import §_-RQ§.§_-Q9§;
|
||||
import §_-V-§.§_-mw§;
|
||||
import §_-aM§.§_-Lm§;
|
||||
import §_-aM§.§_-Yf§;
|
||||
import §_-e6§.§_-1I§;
|
||||
import §_-j-§.§_-B7§;
|
||||
import §_-j-§.§_-Wd§;
|
||||
import §_-lS§.§_-h2§;
|
||||
import §_-nO§.§_-5B§;
|
||||
import §_-nO§.§_-Yk§;
|
||||
import flash.display.Stage;
|
||||
import §in §.§_-N9§;
|
||||
import §in §.§_-eF§;
|
||||
|
||||
public class §_-AG§
|
||||
{
|
||||
public static const TIME_SYSTEM_PRIORITY:int = 0;
|
||||
|
||||
public static const INPUT_SYSTEM_PRIORITY:int = 1000;
|
||||
|
||||
public static const EVENT_SYSTEM_PRIORITY:int = 2000;
|
||||
|
||||
public static const LOGIC_SYSTEM_1_PRIORITY:int = 3000;
|
||||
|
||||
public static const LOGIC_SYSTEM_2_PRIORITY:int = 3001;
|
||||
|
||||
public static const PHYSICS_SYSTEM_PRIORITY:int = 4000;
|
||||
|
||||
public static const RENDER_SYSTEM_PRIORITY:int = 5000;
|
||||
|
||||
public static const CLEANUP_SYSTEM_PRIORITY:int = 6000;
|
||||
|
||||
public const §_-PI§:§_-mw§ = new §_-mw§(20);
|
||||
|
||||
private var §_-We§:Stage;
|
||||
|
||||
private var §_-D9§:Object;
|
||||
|
||||
private var §_-IC§:§_-kM§ = new DummyLogger();
|
||||
|
||||
private var §_-Uw§:§_-1H§;
|
||||
|
||||
private var §_-f2§:§_-h2§;
|
||||
|
||||
private var inputSystem:§_-Yf§;
|
||||
|
||||
private var eventSystem:§_-Wd§;
|
||||
|
||||
private var logicSystem1:§_-Yk§;
|
||||
|
||||
private var logicSystem2:§_-Yk§;
|
||||
|
||||
private var physicsSystem:§_-8a§;
|
||||
|
||||
private var renderSystem:§_-1I§;
|
||||
|
||||
private var §_-0s§:§_-N9§;
|
||||
|
||||
private var §_-jZ§:Vector.<§_-gw§>;
|
||||
|
||||
private var §_-TA§:int;
|
||||
|
||||
private var §_-XC§:§_-Q9§;
|
||||
|
||||
public function §_-AG§(stage:Stage, options:Object)
|
||||
{
|
||||
super();
|
||||
this.§_-We§ = stage;
|
||||
this.§_-D9§ = options || {};
|
||||
this.§_-jZ§ = new Vector.<§_-gw§>();
|
||||
this.§_-XC§ = new §_-Q9§();
|
||||
this.§_-Uw§ = new §_-1H§();
|
||||
this.§_-f2§ = new §_-h2§(TIME_SYSTEM_PRIORITY);
|
||||
this.§_-Uw§.addTask(this.§_-f2§);
|
||||
this.inputSystem = new §_-Yf§(INPUT_SYSTEM_PRIORITY,stage);
|
||||
this.§_-Uw§.addTask(this.inputSystem);
|
||||
this.eventSystem = new §_-Wd§(EVENT_SYSTEM_PRIORITY);
|
||||
this.§_-Uw§.addTask(this.eventSystem);
|
||||
this.logicSystem1 = new §_-Yk§(LOGIC_SYSTEM_1_PRIORITY,this);
|
||||
this.§_-Uw§.addTask(this.logicSystem1);
|
||||
this.logicSystem2 = new §_-Yk§(LOGIC_SYSTEM_2_PRIORITY,this);
|
||||
this.§_-Uw§.addTask(this.logicSystem2);
|
||||
this.physicsSystem = new §_-8a§(PHYSICS_SYSTEM_PRIORITY,this.§_-XC§);
|
||||
this.§_-Uw§.addTask(this.physicsSystem);
|
||||
this.renderSystem = new §_-1I§(RENDER_SYSTEM_PRIORITY,stage);
|
||||
this.§_-Uw§.addTask(this.renderSystem);
|
||||
this.§_-0s§ = new §_-N9§(CLEANUP_SYSTEM_PRIORITY);
|
||||
this.§_-Uw§.addTask(this.§_-0s§);
|
||||
}
|
||||
|
||||
public function get logger() : §_-kM§
|
||||
{
|
||||
return this.§_-IC§;
|
||||
}
|
||||
|
||||
public function set logger(value:§_-kM§) : void
|
||||
{
|
||||
if(value == null)
|
||||
{
|
||||
throw new ArgumentError("Logger is null");
|
||||
}
|
||||
this.§_-IC§ = value;
|
||||
}
|
||||
|
||||
public function get stage() : Stage
|
||||
{
|
||||
return this.§_-We§;
|
||||
}
|
||||
|
||||
public function get options() : Object
|
||||
{
|
||||
return this.§_-D9§;
|
||||
}
|
||||
|
||||
public function §_-L§(command:§_-eF§) : void
|
||||
{
|
||||
this.§_-0s§.§_-Si§(command);
|
||||
}
|
||||
|
||||
public function §_-11§() : §_-Q9§
|
||||
{
|
||||
return this.§_-XC§;
|
||||
}
|
||||
|
||||
public function addTask(gameTask:§_-ps§) : void
|
||||
{
|
||||
this.§_-Uw§.addTask(gameTask);
|
||||
}
|
||||
|
||||
public function §_-oR§(entity:§_-gw§) : void
|
||||
{
|
||||
if(entity.index < 0)
|
||||
{
|
||||
entity.index = this.§_-TA§;
|
||||
var _loc2_:* = this.§_-TA§++;
|
||||
this.§_-jZ§[_loc2_] = entity;
|
||||
entity.addToGame(this);
|
||||
return;
|
||||
}
|
||||
throw new Error("Entity " + entity + " is already in game");
|
||||
}
|
||||
|
||||
public function §_-13§(entity:§_-gw§) : void
|
||||
{
|
||||
var index:int = int(entity.index);
|
||||
if(index < 0)
|
||||
{
|
||||
throw new Error("Entity " + entity + " is not in game");
|
||||
}
|
||||
var lastEntity:§_-gw§ = this.§_-jZ§[--this.§_-TA§];
|
||||
lastEntity.index = index;
|
||||
this.§_-jZ§[index] = lastEntity;
|
||||
this.§_-jZ§[this.§_-TA§] = null;
|
||||
entity.index = -1;
|
||||
entity.removeFromGame(this);
|
||||
}
|
||||
|
||||
public function §_-Ku§() : §_-Lm§
|
||||
{
|
||||
return this.inputSystem;
|
||||
}
|
||||
|
||||
public function §_-Ev§() : §_-B7§
|
||||
{
|
||||
return this.eventSystem;
|
||||
}
|
||||
|
||||
public function getLogicSystem1() : §_-5B§
|
||||
{
|
||||
return this.logicSystem1;
|
||||
}
|
||||
|
||||
public function getLogicSystem2() : §_-5B§
|
||||
{
|
||||
return this.logicSystem2;
|
||||
}
|
||||
|
||||
public function §_-m8§() : §_-8a§
|
||||
{
|
||||
return this.physicsSystem;
|
||||
}
|
||||
|
||||
public function §_-DZ§() : §_-1I§
|
||||
{
|
||||
return this.renderSystem;
|
||||
}
|
||||
|
||||
public function §_-Kf§() : void
|
||||
{
|
||||
this.§_-PI§.§_-Ay§();
|
||||
this.§_-Uw§.§_-h3§();
|
||||
this.§_-PI§.§_-BM§();
|
||||
}
|
||||
|
||||
public function §_-EC§() : void
|
||||
{
|
||||
this.§_-Uw§.§_-Ap§();
|
||||
this.§_-Uw§.§_-h3§();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DummyLogger implements §_-kM§
|
||||
{
|
||||
public function DummyLogger()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function log(channel:String, text:String) : void
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,20 @@
|
||||
package package_113
|
||||
package §_-bJ§
|
||||
{
|
||||
import package_109.name_377;
|
||||
import package_121.name_666;
|
||||
import package_121.name_667;
|
||||
import package_121.name_668;
|
||||
import package_46.name_194;
|
||||
import package_76.name_235;
|
||||
import package_76.name_631;
|
||||
import package_76.name_665;
|
||||
import package_86.*;
|
||||
import package_90.name_273;
|
||||
import package_90.name_386;
|
||||
import package_92.name_271;
|
||||
import package_92.name_630;
|
||||
import §_-1e§.§_-Nh§;
|
||||
import §_-1e§.§_-hG§;
|
||||
import §_-1e§.§_-jn§;
|
||||
import §_-KA§.§_-FW§;
|
||||
import §_-KA§.§_-jr§;
|
||||
import §_-US§.§_-6h§;
|
||||
import §_-US§.§_-BV§;
|
||||
import §_-fT§.*;
|
||||
import §_-nl§.§_-bj§;
|
||||
import §_-pe§.§_-m3§;
|
||||
import §while§.§_-GQ§;
|
||||
import §while§.§_-Ph§;
|
||||
import §while§.§_-hu§;
|
||||
|
||||
public class name_469 implements name_468
|
||||
public class §_-eG§ implements §_-Zm§
|
||||
{
|
||||
private static var timestamp:int;
|
||||
|
||||
@@ -24,19 +24,19 @@ package package_113
|
||||
|
||||
private static var EPSILON:Number = 0.0001;
|
||||
|
||||
private static var normal:name_194 = new name_194();
|
||||
private static var normal:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var collisionBox:name_377 = new name_377(new name_194(),4294967295,0);
|
||||
private static var collisionBox:§_-m3§ = new §_-m3§(new §_-bj§(),4294967295,0);
|
||||
|
||||
private var cellSize:Number;
|
||||
|
||||
private var var_609:name_386 = new name_386();
|
||||
private var §_-aq§:§_-FW§ = new §_-FW§();
|
||||
|
||||
private var denseArray:Vector.<name_235>;
|
||||
private var denseArray:Vector.<§_-Nh§>;
|
||||
|
||||
private var denseCellIndices:Vector.<int>;
|
||||
|
||||
private var var_613:int;
|
||||
private var §_-00§:int;
|
||||
|
||||
private var numCellsX:int;
|
||||
|
||||
@@ -44,140 +44,140 @@ package package_113
|
||||
|
||||
private var numCellsZ:int;
|
||||
|
||||
private var var_616:int;
|
||||
private var §_-Sp§:int;
|
||||
|
||||
private var var_615:Vector.<int>;
|
||||
private var §_-48§:Vector.<int>;
|
||||
|
||||
private var var_618:int;
|
||||
private var §_-81§:int;
|
||||
|
||||
private var var_611:Vector.<name_685>;
|
||||
private var §_-3Q§:Vector.<§_-Pg§>;
|
||||
|
||||
private var var_612:int;
|
||||
private var §_-VV§:int;
|
||||
|
||||
private var bodyCellEntries:Vector.<BodyCellEntry>;
|
||||
|
||||
private var var_596:Object;
|
||||
private var §_-P6§:Object;
|
||||
|
||||
private var var_610:RaycastCellVisitor;
|
||||
private var §_-SI§:RaycastCellVisitor;
|
||||
|
||||
private var var_614:OccupiedCellIndex;
|
||||
private var §_-Qp§:OccupiedCellIndex;
|
||||
|
||||
private var var_617:Boolean;
|
||||
private var §_-WJ§:Boolean;
|
||||
|
||||
public function name_469()
|
||||
public function §_-eG§()
|
||||
{
|
||||
super();
|
||||
this.var_611 = new Vector.<name_685>();
|
||||
this.var_610 = new RaycastCellVisitor();
|
||||
this.method_690();
|
||||
this.method_686();
|
||||
this.§_-3Q§ = new Vector.<§_-Pg§>();
|
||||
this.§_-SI§ = new RaycastCellVisitor();
|
||||
this.§_-kL§();
|
||||
this.§_-8J§();
|
||||
}
|
||||
|
||||
private function method_655(type1:int, type2:int, collider:name_665) : void
|
||||
private function §_-c2§(type1:int, type2:int, collider:§_-hG§) : void
|
||||
{
|
||||
this.var_596[type1 | type2] = collider;
|
||||
this.§_-P6§[type1 | type2] = collider;
|
||||
}
|
||||
|
||||
public function name_591(bodyCollisionData:name_568) : void
|
||||
public function §_-pN§(bodyCollisionData:§_-YY§) : void
|
||||
{
|
||||
if(this.method_683(bodyCollisionData.body) >= 0)
|
||||
if(this.§_-OL§(bodyCollisionData.body) >= 0)
|
||||
{
|
||||
throw new Error("Body collision data already exists");
|
||||
}
|
||||
var bodyCollisionGridData:name_685 = name_685.create();
|
||||
var bodyCollisionGridData:§_-Pg§ = §_-Pg§.create();
|
||||
bodyCollisionGridData.body = bodyCollisionData.body;
|
||||
bodyCollisionGridData.detailedPrimitives = bodyCollisionData.detailedPrimitives;
|
||||
bodyCollisionGridData.simplePrimitives = bodyCollisionData.simplePrimitives;
|
||||
bodyCollisionGridData.index = this.var_612;
|
||||
var _loc3_:* = this.var_612++;
|
||||
this.var_611[_loc3_] = bodyCollisionGridData;
|
||||
this.var_617 = true;
|
||||
bodyCollisionGridData.index = this.§_-VV§;
|
||||
var _loc3_:* = this.§_-VV§++;
|
||||
this.§_-3Q§[_loc3_] = bodyCollisionGridData;
|
||||
this.§_-WJ§ = true;
|
||||
}
|
||||
|
||||
public function name_590(bodyCollisionData:name_568) : void
|
||||
public function §_-qP§(bodyCollisionData:§_-YY§) : void
|
||||
{
|
||||
var index:int = this.method_683(bodyCollisionData.body);
|
||||
var index:int = this.§_-OL§(bodyCollisionData.body);
|
||||
if(index < 0)
|
||||
{
|
||||
throw new Error("Body collision data not found");
|
||||
}
|
||||
--this.var_612;
|
||||
var lastBodyEntry:name_685 = this.var_611[this.var_612];
|
||||
--this.§_-VV§;
|
||||
var lastBodyEntry:§_-Pg§ = this.§_-3Q§[this.§_-VV§];
|
||||
lastBodyEntry.index = index;
|
||||
name_685(this.var_611[index]).destroy();
|
||||
this.var_611[index] = lastBodyEntry;
|
||||
this.var_611[this.var_612] = null;
|
||||
this.var_617 = true;
|
||||
§_-Pg§(this.§_-3Q§[index]).destroy();
|
||||
this.§_-3Q§[index] = lastBodyEntry;
|
||||
this.§_-3Q§[this.§_-VV§] = null;
|
||||
this.§_-WJ§ = true;
|
||||
}
|
||||
|
||||
public function name_470() : void
|
||||
public function §_-9F§() : void
|
||||
{
|
||||
this.method_680();
|
||||
this.§_-nT§();
|
||||
}
|
||||
|
||||
public function method_696() : Number
|
||||
public function §_-OA§() : Number
|
||||
{
|
||||
return this.cellSize;
|
||||
}
|
||||
|
||||
public function method_700() : name_386
|
||||
public function §_-8t§() : §_-FW§
|
||||
{
|
||||
return this.var_609.clone();
|
||||
return this.§_-aq§.clone();
|
||||
}
|
||||
|
||||
public function method_697() : int
|
||||
public function §_-9i§() : int
|
||||
{
|
||||
return this.numCellsX;
|
||||
}
|
||||
|
||||
public function method_699() : int
|
||||
public function §_-PM§() : int
|
||||
{
|
||||
return this.numCellsY;
|
||||
}
|
||||
|
||||
public function method_698() : int
|
||||
public function §_-5F§() : int
|
||||
{
|
||||
return this.numCellsZ;
|
||||
}
|
||||
|
||||
public function method_701() : int
|
||||
public function §_-Bo§() : int
|
||||
{
|
||||
return this.var_616;
|
||||
return this.§_-Sp§;
|
||||
}
|
||||
|
||||
public function method_695(x:int, y:int, z:int) : int
|
||||
public function §_-D6§(x:int, y:int, z:int) : int
|
||||
{
|
||||
var cellIndex:int = x * this.numCellsY * this.numCellsZ + y * this.numCellsZ + z;
|
||||
return this.denseCellIndices[cellIndex] >>> 24;
|
||||
}
|
||||
|
||||
public function name_472(cellSize:Number, staticPrimitives:Vector.<name_235>) : void
|
||||
public function §_-hS§(cellSize:Number, staticPrimitives:Vector.<§_-Nh§>) : void
|
||||
{
|
||||
this.method_693(staticPrimitives,cellSize);
|
||||
this.method_684(staticPrimitives);
|
||||
this.method_689();
|
||||
this.§_-SQ§(staticPrimitives,cellSize);
|
||||
this.§_-hH§(staticPrimitives);
|
||||
this.§_-EF§();
|
||||
}
|
||||
|
||||
public function method_651(center:name_194, radius:Number, filter:name_655) : Vector.<name_654>
|
||||
public function §_-7u§(center:§_-bj§, radius:Number, filter:§_-VN§) : Vector.<§_-bB§>
|
||||
{
|
||||
var result:Vector.<name_654> = null;
|
||||
var result:Vector.<§_-bB§> = null;
|
||||
var j:int = 0;
|
||||
var k:int = 0;
|
||||
var index:int = 0;
|
||||
var bodyCellEntry:BodyCellEntry = null;
|
||||
var data:name_685 = null;
|
||||
var body:name_271 = null;
|
||||
var position:name_194 = null;
|
||||
var data:§_-Pg§ = null;
|
||||
var body:§_-BV§ = null;
|
||||
var position:§_-bj§ = null;
|
||||
var dx:Number = NaN;
|
||||
var dy:Number = NaN;
|
||||
var dz:Number = NaN;
|
||||
var d:Number = NaN;
|
||||
var imin:int = this.clamp((center.x - radius - this.var_609.minX) / this.cellSize,0,this.numCellsX - 1);
|
||||
var imax:int = this.clamp((center.x + radius - this.var_609.minX) / this.cellSize,0,this.numCellsX - 1);
|
||||
var jmin:int = this.clamp((center.y - radius - this.var_609.minY) / this.cellSize,0,this.numCellsY - 1);
|
||||
var jmax:int = this.clamp((center.y + radius - this.var_609.minY) / this.cellSize,0,this.numCellsY - 1);
|
||||
var kmin:int = this.clamp((center.z - radius - this.var_609.minZ) / this.cellSize,0,this.numCellsZ - 1);
|
||||
var kmax:int = this.clamp((center.z + radius - this.var_609.minZ) / this.cellSize,0,this.numCellsZ - 1);
|
||||
var imin:int = this.clamp((center.x - radius - this.§_-aq§.minX) / this.cellSize,0,this.numCellsX - 1);
|
||||
var imax:int = this.clamp((center.x + radius - this.§_-aq§.minX) / this.cellSize,0,this.numCellsX - 1);
|
||||
var jmin:int = this.clamp((center.y - radius - this.§_-aq§.minY) / this.cellSize,0,this.numCellsY - 1);
|
||||
var jmax:int = this.clamp((center.y + radius - this.§_-aq§.minY) / this.cellSize,0,this.numCellsY - 1);
|
||||
var kmin:int = this.clamp((center.z - radius - this.§_-aq§.minZ) / this.cellSize,0,this.numCellsZ - 1);
|
||||
var kmax:int = this.clamp((center.z + radius - this.§_-aq§.minZ) / this.cellSize,0,this.numCellsZ - 1);
|
||||
var ts:int = int(++timestamp);
|
||||
var radiusSqr:Number = radius * radius;
|
||||
for(var i:int = imin; i <= imax; i++)
|
||||
@@ -201,13 +201,13 @@ package package_113
|
||||
d = dx * dx + dy * dy + dz * dz;
|
||||
if(d < radiusSqr)
|
||||
{
|
||||
if(filter == null || Boolean(filter.name_670(center,body)))
|
||||
if(filter == null || Boolean(filter.§_-cb§(center,body)))
|
||||
{
|
||||
if(result == null)
|
||||
{
|
||||
result = new Vector.<name_654>();
|
||||
result = new Vector.<§_-bB§>();
|
||||
}
|
||||
result.push(new name_654(body,Math.sqrt(d)));
|
||||
result.push(new §_-bB§(body,Math.sqrt(d)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -219,55 +219,55 @@ package package_113
|
||||
return result;
|
||||
}
|
||||
|
||||
public function method_553(contacts:name_630) : name_630
|
||||
public function §_-63§(contacts:§_-6h§) : §_-6h§
|
||||
{
|
||||
var bodyCollisionData:name_685 = null;
|
||||
this.method_680();
|
||||
for(var i:int = 0; i < this.var_612; i++)
|
||||
var bodyCollisionData:§_-Pg§ = null;
|
||||
this.§_-nT§();
|
||||
for(var i:int = 0; i < this.§_-VV§; i++)
|
||||
{
|
||||
bodyCollisionData = this.var_611[i];
|
||||
contacts = this.method_687(bodyCollisionData,contacts);
|
||||
bodyCollisionData = this.§_-3Q§[i];
|
||||
contacts = this.§_-RK§(bodyCollisionData,contacts);
|
||||
}
|
||||
return this.method_692(contacts);
|
||||
return this.§_-aE§(contacts);
|
||||
}
|
||||
|
||||
private function method_689() : void
|
||||
private function §_-EF§() : void
|
||||
{
|
||||
this.var_610.denseArray = this.denseArray;
|
||||
this.var_610.denseCellIndices = this.denseCellIndices;
|
||||
this.var_610.numCellsX = this.numCellsX;
|
||||
this.var_610.numCellsY = this.numCellsY;
|
||||
this.var_610.numCellsZ = this.numCellsZ;
|
||||
this.§_-SI§.denseArray = this.denseArray;
|
||||
this.§_-SI§.denseCellIndices = this.denseCellIndices;
|
||||
this.§_-SI§.numCellsX = this.numCellsX;
|
||||
this.§_-SI§.numCellsY = this.numCellsY;
|
||||
this.§_-SI§.numCellsZ = this.numCellsZ;
|
||||
}
|
||||
|
||||
private function method_693(staticPrimitives:Vector.<name_235>, cellSize:Number) : void
|
||||
private function §_-SQ§(staticPrimitives:Vector.<§_-Nh§>, cellSize:Number) : void
|
||||
{
|
||||
var collisionPrimitive:name_235 = null;
|
||||
var collisionPrimitive:§_-Nh§ = null;
|
||||
this.cellSize = cellSize;
|
||||
this.var_609.name_584();
|
||||
this.§_-aq§.§_-GT§();
|
||||
for each(collisionPrimitive in staticPrimitives)
|
||||
{
|
||||
this.var_609.name_583(collisionPrimitive.calculateAABB());
|
||||
this.§_-aq§.§_-EH§(collisionPrimitive.calculateAABB());
|
||||
}
|
||||
this.var_609.name_686(cellSize + EPSILON);
|
||||
this.numCellsX = int(this.var_609.name_689() / cellSize) + 1;
|
||||
this.numCellsY = int(this.var_609.name_688() / cellSize) + 1;
|
||||
this.numCellsZ = int(this.var_609.name_690() / cellSize) + 1;
|
||||
this.var_613 = this.numCellsX * this.numCellsY * this.numCellsZ;
|
||||
this.var_609.maxX = this.var_609.minX + this.numCellsX * cellSize;
|
||||
this.var_609.maxY = this.var_609.minY + this.numCellsY * cellSize;
|
||||
this.var_609.maxZ = this.var_609.minZ + this.numCellsZ * cellSize;
|
||||
this.bodyCellEntries = new Vector.<BodyCellEntry>(this.var_613);
|
||||
this.§_-aq§.§_-Gd§(cellSize + EPSILON);
|
||||
this.numCellsX = int(this.§_-aq§.§_-ot§() / cellSize) + 1;
|
||||
this.numCellsY = int(this.§_-aq§.§_-jP§() / cellSize) + 1;
|
||||
this.numCellsZ = int(this.§_-aq§.§_-Ix§() / cellSize) + 1;
|
||||
this.§_-00§ = this.numCellsX * this.numCellsY * this.numCellsZ;
|
||||
this.§_-aq§.maxX = this.§_-aq§.minX + this.numCellsX * cellSize;
|
||||
this.§_-aq§.maxY = this.§_-aq§.minY + this.numCellsY * cellSize;
|
||||
this.§_-aq§.maxZ = this.§_-aq§.minZ + this.numCellsZ * cellSize;
|
||||
this.bodyCellEntries = new Vector.<BodyCellEntry>(this.§_-00§);
|
||||
}
|
||||
|
||||
private function method_684(staticPrimitives:Vector.<name_235>) : void
|
||||
private function §_-hH§(staticPrimitives:Vector.<§_-Nh§>) : void
|
||||
{
|
||||
var index:int = 0;
|
||||
var denseArraySize:int = 0;
|
||||
var lastIndex:int = 0;
|
||||
var numCellPrimitives:int = 0;
|
||||
var collisionPrimitive:name_235 = null;
|
||||
var bb:name_386 = null;
|
||||
var collisionPrimitive:§_-Nh§ = null;
|
||||
var bb:§_-FW§ = null;
|
||||
var imin:int = 0;
|
||||
var imax:int = 0;
|
||||
var jmin:int = 0;
|
||||
@@ -279,33 +279,33 @@ package package_113
|
||||
var k:int = 0;
|
||||
var cellIndex:int = 0;
|
||||
var denseCellIndex:int = 0;
|
||||
var cellCounters:Vector.<int> = this.method_685(staticPrimitives);
|
||||
this.var_616 = 0;
|
||||
this.denseCellIndices = new Vector.<int>(this.var_613);
|
||||
for(index = 0; index < this.var_613; index++)
|
||||
var cellCounters:Vector.<int> = this.§_-VK§(staticPrimitives);
|
||||
this.§_-Sp§ = 0;
|
||||
this.denseCellIndices = new Vector.<int>(this.§_-00§);
|
||||
for(index = 0; index < this.§_-00§; index++)
|
||||
{
|
||||
numCellPrimitives = cellCounters[index];
|
||||
if(numCellPrimitives > this.var_616)
|
||||
if(numCellPrimitives > this.§_-Sp§)
|
||||
{
|
||||
this.var_616 = numCellPrimitives;
|
||||
this.§_-Sp§ = numCellPrimitives;
|
||||
}
|
||||
denseArraySize += numCellPrimitives;
|
||||
this.denseCellIndices[index] = numCellPrimitives << 24 | lastIndex;
|
||||
lastIndex += numCellPrimitives;
|
||||
cellCounters[index] = 0;
|
||||
}
|
||||
this.denseArray = new Vector.<name_235>(denseArraySize);
|
||||
this.denseArray = new Vector.<§_-Nh§>(denseArraySize);
|
||||
var numPrimitives:int = int(staticPrimitives.length);
|
||||
for(index = 0; index < numPrimitives; index++)
|
||||
{
|
||||
collisionPrimitive = staticPrimitives[index];
|
||||
bb = collisionPrimitive.aabb;
|
||||
imin = (bb.minX - this.var_609.minX) / this.cellSize;
|
||||
imax = (bb.maxX - this.var_609.minX) / this.cellSize;
|
||||
jmin = (bb.minY - this.var_609.minY) / this.cellSize;
|
||||
jmax = (bb.maxY - this.var_609.minY) / this.cellSize;
|
||||
kmin = (bb.minZ - this.var_609.minZ) / this.cellSize;
|
||||
kmax = (bb.maxZ - this.var_609.minZ) / this.cellSize;
|
||||
imin = (bb.minX - this.§_-aq§.minX) / this.cellSize;
|
||||
imax = (bb.maxX - this.§_-aq§.minX) / this.cellSize;
|
||||
jmin = (bb.minY - this.§_-aq§.minY) / this.cellSize;
|
||||
jmax = (bb.maxY - this.§_-aq§.minY) / this.cellSize;
|
||||
kmin = (bb.minZ - this.§_-aq§.minZ) / this.cellSize;
|
||||
kmax = (bb.maxZ - this.§_-aq§.minZ) / this.cellSize;
|
||||
for(i = imin; i <= imax; i++)
|
||||
{
|
||||
for(j = jmin; j <= jmax; j++)
|
||||
@@ -322,9 +322,9 @@ package package_113
|
||||
}
|
||||
}
|
||||
|
||||
private function method_685(staticPrimitives:Vector.<name_235>) : Vector.<int>
|
||||
private function §_-VK§(staticPrimitives:Vector.<§_-Nh§>) : Vector.<int>
|
||||
{
|
||||
var bb:name_386 = null;
|
||||
var bb:§_-FW§ = null;
|
||||
var imin:int = 0;
|
||||
var imax:int = 0;
|
||||
var jmin:int = 0;
|
||||
@@ -335,17 +335,17 @@ package package_113
|
||||
var j:int = 0;
|
||||
var k:int = 0;
|
||||
var cellIndex:int = 0;
|
||||
var cellPrimitiveCounters:Vector.<int> = new Vector.<int>(this.var_613);
|
||||
var cellPrimitiveCounters:Vector.<int> = new Vector.<int>(this.§_-00§);
|
||||
var numPrimitives:int = int(staticPrimitives.length);
|
||||
for(var index:int = 0; index < numPrimitives; index++)
|
||||
{
|
||||
bb = staticPrimitives[index].aabb;
|
||||
imin = (bb.minX - this.var_609.minX) / this.cellSize;
|
||||
imax = (bb.maxX - this.var_609.minX) / this.cellSize;
|
||||
jmin = (bb.minY - this.var_609.minY) / this.cellSize;
|
||||
jmax = (bb.maxY - this.var_609.minY) / this.cellSize;
|
||||
kmin = (bb.minZ - this.var_609.minZ) / this.cellSize;
|
||||
kmax = (bb.maxZ - this.var_609.minZ) / this.cellSize;
|
||||
imin = (bb.minX - this.§_-aq§.minX) / this.cellSize;
|
||||
imax = (bb.maxX - this.§_-aq§.minX) / this.cellSize;
|
||||
jmin = (bb.minY - this.§_-aq§.minY) / this.cellSize;
|
||||
jmax = (bb.maxY - this.§_-aq§.minY) / this.cellSize;
|
||||
kmin = (bb.minZ - this.§_-aq§.minZ) / this.cellSize;
|
||||
kmax = (bb.maxZ - this.§_-aq§.minZ) / this.cellSize;
|
||||
for(i = imin; i <= imax; i++)
|
||||
{
|
||||
for(j = jmin; j <= jmax; j++)
|
||||
@@ -361,11 +361,11 @@ package package_113
|
||||
return cellPrimitiveCounters;
|
||||
}
|
||||
|
||||
private function method_692(contacts:name_630) : name_630
|
||||
private function §_-aE§(contacts:§_-6h§) : §_-6h§
|
||||
{
|
||||
var currentBodyCellEntry:BodyCellEntry = null;
|
||||
var currentBodyData:name_685 = null;
|
||||
var bodyCollisionGridData:name_685 = null;
|
||||
var currentBodyData:§_-Pg§ = null;
|
||||
var bodyCollisionGridData:§_-Pg§ = null;
|
||||
var imin:int = 0;
|
||||
var imax:int = 0;
|
||||
var jmin:int = 0;
|
||||
@@ -377,14 +377,14 @@ package package_113
|
||||
var j:int = 0;
|
||||
var k:int = 0;
|
||||
var cellIndex:int = 0;
|
||||
this.method_694();
|
||||
var numBodies:int = int(this.var_611.length);
|
||||
for(var occupiedCell:OccupiedCellIndex = this.var_614; occupiedCell != null; )
|
||||
this.§_-KE§();
|
||||
var numBodies:int = int(this.§_-3Q§.length);
|
||||
for(var occupiedCell:OccupiedCellIndex = this.§_-Qp§; occupiedCell != null; )
|
||||
{
|
||||
for(currentBodyCellEntry = this.bodyCellEntries[occupiedCell.index]; currentBodyCellEntry != null; )
|
||||
{
|
||||
currentBodyData = currentBodyCellEntry.data;
|
||||
contacts = this.method_682(currentBodyData.body,currentBodyData.index,currentBodyData.simplePrimitives,currentBodyCellEntry.next,numBodies,contacts);
|
||||
contacts = this.§_-AZ§(currentBodyData.body,currentBodyData.index,currentBodyData.simplePrimitives,currentBodyCellEntry.next,numBodies,contacts);
|
||||
bodyCollisionGridData = currentBodyCellEntry.data;
|
||||
imin = bodyCollisionGridData.i & 0xFFFF;
|
||||
imax = bodyCollisionGridData.i >>> 16;
|
||||
@@ -402,7 +402,7 @@ package package_113
|
||||
cellIndex = i * this.numCellsY * this.numCellsZ + j * this.numCellsZ + k;
|
||||
if(cellIndex != thisCell)
|
||||
{
|
||||
contacts = this.method_682(currentBodyData.body,currentBodyData.index,currentBodyData.simplePrimitives,this.bodyCellEntries[cellIndex],numBodies,contacts);
|
||||
contacts = this.§_-AZ§(currentBodyData.body,currentBodyData.index,currentBodyData.simplePrimitives,this.bodyCellEntries[cellIndex],numBodies,contacts);
|
||||
}
|
||||
k++;
|
||||
}
|
||||
@@ -415,25 +415,25 @@ package package_113
|
||||
return contacts;
|
||||
}
|
||||
|
||||
private function method_682(body:name_271, bodyIndex:int, bodyPrimitives:Vector.<name_235>, cellStartEntry:BodyCellEntry, numBodies:int, contacts:name_630) : name_630
|
||||
private function §_-AZ§(body:§_-BV§, bodyIndex:int, bodyPrimitives:Vector.<§_-Nh§>, cellStartEntry:BodyCellEntry, numBodies:int, contacts:§_-6h§) : §_-6h§
|
||||
{
|
||||
var index2:int = 0;
|
||||
var min:int = 0;
|
||||
var max:int = 0;
|
||||
var bitIndex:int = 0;
|
||||
var mask:int = 0;
|
||||
var body2:name_271 = null;
|
||||
var bodyPrimitives2:Vector.<name_235> = null;
|
||||
var body2:§_-BV§ = null;
|
||||
var bodyPrimitives2:Vector.<§_-Nh§> = null;
|
||||
var numPrimitives2:int = 0;
|
||||
var i:int = 0;
|
||||
var collisionPrimitive1:name_235 = null;
|
||||
var collisionPrimitive1:§_-Nh§ = null;
|
||||
var j:int = 0;
|
||||
var collisionPrimitive2:name_235 = null;
|
||||
var collisionPrimitive2:§_-Nh§ = null;
|
||||
for(var numPrimitives1:int = int(bodyPrimitives.length); cellStartEntry != null; )
|
||||
{
|
||||
if(cellStartEntry.data.body != body)
|
||||
{
|
||||
index2 = cellStartEntry.data.index;
|
||||
index2 = int(cellStartEntry.data.index);
|
||||
min = bodyIndex;
|
||||
max = index2;
|
||||
if(bodyIndex > index2)
|
||||
@@ -443,9 +443,9 @@ package package_113
|
||||
}
|
||||
bitIndex = min * (2 * numBodies - min - 3) / 2 + max - 1;
|
||||
mask = 1 << (bitIndex & 0x1F);
|
||||
if((this.var_615[bitIndex >>> 5] & mask) == 0)
|
||||
if((this.§_-48§[bitIndex >>> 5] & mask) == 0)
|
||||
{
|
||||
this.var_615[bitIndex >>> 5] |= mask;
|
||||
this.§_-48§[bitIndex >>> 5] |= mask;
|
||||
body2 = cellStartEntry.data.body;
|
||||
if(body2.aabb.intersects(body.aabb,EPSILON))
|
||||
{
|
||||
@@ -459,7 +459,7 @@ package package_113
|
||||
collisionPrimitive2 = bodyPrimitives2[j];
|
||||
if(!((collisionPrimitive1.collisionGroup & collisionPrimitive2.collisionMask) == 0 || (collisionPrimitive1.collisionMask & collisionPrimitive2.collisionGroup) == 0 || !collisionPrimitive1.aabb.intersects(collisionPrimitive2.aabb,EPSILON)))
|
||||
{
|
||||
contacts = this.method_691(body,bodyPrimitives,numPrimitives1,body2,bodyPrimitives2,numPrimitives2,contacts);
|
||||
contacts = this.§_-1p§(body,bodyPrimitives,numPrimitives1,body2,bodyPrimitives2,numPrimitives2,contacts);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -471,11 +471,11 @@ package package_113
|
||||
return contacts;
|
||||
}
|
||||
|
||||
private function method_691(body1:name_271, primitives1:Vector.<name_235>, numPrimitives1:int, body2:name_271, primitives2:Vector.<name_235>, numPrimitives2:int, contact:name_630) : name_630
|
||||
private function §_-1p§(body1:§_-BV§, primitives1:Vector.<§_-Nh§>, numPrimitives1:int, body2:§_-BV§, primitives2:Vector.<§_-Nh§>, numPrimitives2:int, contact:§_-6h§) : §_-6h§
|
||||
{
|
||||
var primitive1:name_235 = null;
|
||||
var primitive1:§_-Nh§ = null;
|
||||
var j:int = 0;
|
||||
var primitive2:name_235 = null;
|
||||
var primitive2:§_-Nh§ = null;
|
||||
var skipCollision:Boolean = false;
|
||||
var firstFilterTest:Boolean = true;
|
||||
for(var i:int = 0; i < numPrimitives1; i++)
|
||||
@@ -511,15 +511,15 @@ package package_113
|
||||
return contact;
|
||||
}
|
||||
|
||||
private function method_694() : void
|
||||
private function §_-KE§() : void
|
||||
{
|
||||
for(var i:int = 0; i < this.var_618; i++)
|
||||
for(var i:int = 0; i < this.§_-81§; i++)
|
||||
{
|
||||
this.var_615[i] = 0;
|
||||
this.§_-48§[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private function method_687(bodyCollisionData:name_685, contacts:name_630) : name_630
|
||||
private function §_-RK§(bodyCollisionData:§_-Pg§, contacts:§_-6h§) : §_-6h§
|
||||
{
|
||||
var jj:int = 0;
|
||||
var kk:int = 0;
|
||||
@@ -527,9 +527,9 @@ package package_113
|
||||
var denseIndexStart:int = 0;
|
||||
var denseIndexEnd:int = 0;
|
||||
var index:int = 0;
|
||||
var staticCollisionPrimitive:name_235 = null;
|
||||
var staticCollisionPrimitive:§_-Nh§ = null;
|
||||
var bpi:int = 0;
|
||||
var bodyCollisionPrimitive:name_235 = null;
|
||||
var bodyCollisionPrimitive:§_-Nh§ = null;
|
||||
var imin:int = bodyCollisionData.i & 0xFFFF;
|
||||
var imax:int = bodyCollisionData.i >>> 16;
|
||||
var jmin:int = bodyCollisionData.j & 0xFFFF;
|
||||
@@ -537,7 +537,7 @@ package package_113
|
||||
var kmin:int = bodyCollisionData.k & 0xFFFF;
|
||||
var kmax:int = bodyCollisionData.k >>> 16;
|
||||
var tstamp:int = int(++timestamp);
|
||||
var bodyPrimitives:Vector.<name_235> = bodyCollisionData.detailedPrimitives;
|
||||
var bodyPrimitives:Vector.<§_-Nh§> = bodyCollisionData.detailedPrimitives;
|
||||
var numBodyPrimitives:int = int(bodyPrimitives.length);
|
||||
for(var ii:int = imin; ii <= imax; ii++)
|
||||
{
|
||||
@@ -572,71 +572,71 @@ package package_113
|
||||
return contacts;
|
||||
}
|
||||
|
||||
public function raycast(origin:name_194, direction:name_194, collisionMask:int, maxTime:Number, filter:name_631, result:name_273) : Boolean
|
||||
public function raycast(origin:§_-bj§, direction:§_-bj§, collisionMask:int, maxTime:Number, filter:§_-jn§, result:§_-jr§) : Boolean
|
||||
{
|
||||
if(this.var_617)
|
||||
if(this.§_-WJ§)
|
||||
{
|
||||
this.method_680();
|
||||
this.§_-nT§();
|
||||
}
|
||||
this.var_610.collisionMask = collisionMask;
|
||||
this.var_610.filter = filter;
|
||||
this.var_610.result = result;
|
||||
this.var_610.bodyCellEntries = this.bodyCellEntries;
|
||||
this.method_681(origin,direction,maxTime,this.var_610);
|
||||
this.var_610.clear();
|
||||
if(this.var_610.hasHit)
|
||||
this.§_-SI§.collisionMask = collisionMask;
|
||||
this.§_-SI§.filter = filter;
|
||||
this.§_-SI§.result = result;
|
||||
this.§_-SI§.bodyCellEntries = this.bodyCellEntries;
|
||||
this.§_-e0§(origin,direction,maxTime,this.§_-SI§);
|
||||
this.§_-SI§.clear();
|
||||
if(this.§_-SI§.hasHit)
|
||||
{
|
||||
if(result.t < maxTime)
|
||||
{
|
||||
result.position.copy(origin).method_362(result.t,direction);
|
||||
result.position.copy(origin).§_-LQ§(result.t,direction);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function name_324(origin:name_194, direction:name_194, collisionMask:int, maxTime:Number, filter:name_631, result:name_273) : Boolean
|
||||
public function §_-cX§(origin:§_-bj§, direction:§_-bj§, collisionMask:int, maxTime:Number, filter:§_-jn§, result:§_-jr§) : Boolean
|
||||
{
|
||||
this.var_610.collisionMask = collisionMask;
|
||||
this.var_610.filter = filter;
|
||||
this.var_610.result = result;
|
||||
this.method_681(origin,direction,maxTime,this.var_610);
|
||||
this.var_610.clear();
|
||||
if(this.var_610.hasHit)
|
||||
this.§_-SI§.collisionMask = collisionMask;
|
||||
this.§_-SI§.filter = filter;
|
||||
this.§_-SI§.result = result;
|
||||
this.§_-e0§(origin,direction,maxTime,this.§_-SI§);
|
||||
this.§_-SI§.clear();
|
||||
if(this.§_-SI§.hasHit)
|
||||
{
|
||||
if(result.t < maxTime)
|
||||
{
|
||||
result.position.copy(origin).method_362(result.t,direction);
|
||||
result.position.copy(origin).§_-LQ§(result.t,direction);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getContact(prim1:name_235, prim2:name_235, contact:name_630) : Boolean
|
||||
public function getContact(prim1:§_-Nh§, prim2:§_-Nh§, contact:§_-6h§) : Boolean
|
||||
{
|
||||
if((prim1.collisionMask & prim2.collisionGroup) == 0 || (prim2.collisionMask & prim1.collisionGroup) == 0 || !prim1.aabb.intersects(prim2.aabb,0.01))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var collider:name_665 = this.var_596[prim1.type | prim2.type];
|
||||
var collider:§_-hG§ = this.§_-P6§[prim1.type | prim2.type];
|
||||
if(collider != null && Boolean(collider.getContact(prim1,prim2,contact)))
|
||||
{
|
||||
if(prim1.postCollisionFilter != null && !prim1.postCollisionFilter.name_662(prim1,prim2))
|
||||
if(prim1.postCollisionFilter != null && !prim1.postCollisionFilter.§_-eZ§(prim1,prim2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return !(prim2.postCollisionFilter != null && !prim2.postCollisionFilter.name_662(prim2,prim1));
|
||||
return !(prim2.postCollisionFilter != null && !prim2.postCollisionFilter.§_-eZ§(prim2,prim1));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function method_554(prim1:name_235, prim2:name_235) : Boolean
|
||||
public function §_-A5§(prim1:§_-Nh§, prim2:§_-Nh§) : Boolean
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function method_681(origin:name_194, direction:name_194, maxTime:Number, visitor:class_34) : void
|
||||
public function §_-e0§(origin:§_-bj§, direction:§_-bj§, maxTime:Number, visitor:§_-hm§) : void
|
||||
{
|
||||
var t:Number = NaN;
|
||||
var i:int = 0;
|
||||
@@ -644,29 +644,29 @@ package package_113
|
||||
var k:int = 0;
|
||||
var cellMaxTime:Number = NaN;
|
||||
var tstamp:int = int(++timestamp);
|
||||
var x1:Number = origin.x - this.var_609.minX;
|
||||
var y1:Number = origin.y - this.var_609.minY;
|
||||
var z1:Number = origin.z - this.var_609.minZ;
|
||||
var x1:Number = origin.x - this.§_-aq§.minX;
|
||||
var y1:Number = origin.y - this.§_-aq§.minY;
|
||||
var z1:Number = origin.z - this.§_-aq§.minZ;
|
||||
var x2:Number = x1 + direction.x * maxTime;
|
||||
var y2:Number = y1 + direction.y * maxTime;
|
||||
var z2:Number = z1 + direction.z * maxTime;
|
||||
var axis:int = -1;
|
||||
var entryTime:Number = 0;
|
||||
var p:name_194 = new name_194();
|
||||
var pointInBounds:Boolean = this.var_609.name_687(origin,EPSILON);
|
||||
var p:§_-bj§ = new §_-bj§();
|
||||
var pointInBounds:Boolean = this.§_-aq§.§_-Wu§(origin,EPSILON);
|
||||
if(!pointInBounds)
|
||||
{
|
||||
collisionBox.hs.reset(this.cellSize * this.numCellsX / 2,this.cellSize * this.numCellsY / 2,this.cellSize * this.numCellsZ / 2);
|
||||
collisionBox.transform.d = this.var_609.minX + collisionBox.hs.x;
|
||||
collisionBox.transform.h = this.var_609.minY + collisionBox.hs.y;
|
||||
collisionBox.transform.l = this.var_609.minZ + collisionBox.hs.z;
|
||||
collisionBox.transform.d = this.§_-aq§.minX + collisionBox.hs.x;
|
||||
collisionBox.transform.h = this.§_-aq§.minY + collisionBox.hs.y;
|
||||
collisionBox.transform.l = this.§_-aq§.minZ + collisionBox.hs.z;
|
||||
collisionBox.calculateAABB();
|
||||
t = collisionBox.raycast(origin,direction,EPSILON,normal);
|
||||
if(t < 0 || t >= maxTime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
p.copy(origin).method_362(t,direction);
|
||||
p.copy(origin).§_-LQ§(t,direction);
|
||||
if(normal.x > 0.9999 || normal.x < -0.9999)
|
||||
{
|
||||
axis = 0;
|
||||
@@ -680,9 +680,9 @@ package package_113
|
||||
axis = 2;
|
||||
}
|
||||
entryTime = t;
|
||||
i = this.clamp((p.x - this.var_609.minX) / this.cellSize,0,this.numCellsX - 1);
|
||||
j = this.clamp((p.y - this.var_609.minY) / this.cellSize,0,this.numCellsY - 1);
|
||||
k = this.clamp((p.z - this.var_609.minZ) / this.cellSize,0,this.numCellsZ - 1);
|
||||
i = this.clamp((p.x - this.§_-aq§.minX) / this.cellSize,0,this.numCellsX - 1);
|
||||
j = this.clamp((p.y - this.§_-aq§.minY) / this.cellSize,0,this.numCellsY - 1);
|
||||
k = this.clamp((p.z - this.§_-aq§.minZ) / this.cellSize,0,this.numCellsZ - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -784,12 +784,12 @@ package package_113
|
||||
return value;
|
||||
}
|
||||
|
||||
private function method_688() : void
|
||||
private function §_-Oi§() : void
|
||||
{
|
||||
var bodyCellEntry:BodyCellEntry = null;
|
||||
var nextBodyCellEntry:BodyCellEntry = null;
|
||||
var nextOccupiedCell:OccupiedCellIndex = null;
|
||||
for(var cellIndex:int = 0; cellIndex < this.var_613; cellIndex++)
|
||||
for(var cellIndex:int = 0; cellIndex < this.§_-00§; cellIndex++)
|
||||
{
|
||||
bodyCellEntry = this.bodyCellEntries[cellIndex];
|
||||
for(this.bodyCellEntries[cellIndex] = null; bodyCellEntry != null; )
|
||||
@@ -799,8 +799,8 @@ package package_113
|
||||
bodyCellEntry = nextBodyCellEntry;
|
||||
}
|
||||
}
|
||||
var occupiedCell:OccupiedCellIndex = this.var_614;
|
||||
for(this.var_614 = null; occupiedCell != null; )
|
||||
var occupiedCell:OccupiedCellIndex = this.§_-Qp§;
|
||||
for(this.§_-Qp§ = null; occupiedCell != null; )
|
||||
{
|
||||
nextOccupiedCell = occupiedCell.next;
|
||||
occupiedCell.destory();
|
||||
@@ -808,10 +808,10 @@ package package_113
|
||||
}
|
||||
}
|
||||
|
||||
private function method_680() : void
|
||||
private function §_-nT§() : void
|
||||
{
|
||||
var bodyCollisionData:name_685 = null;
|
||||
var boundBox:name_386 = null;
|
||||
var bodyCollisionData:§_-Pg§ = null;
|
||||
var boundBox:§_-FW§ = null;
|
||||
var imin:int = 0;
|
||||
var jmin:int = 0;
|
||||
var kmin:int = 0;
|
||||
@@ -825,31 +825,31 @@ package package_113
|
||||
var k:int = 0;
|
||||
var index:int = 0;
|
||||
var newEntry:BodyCellEntry = null;
|
||||
this.method_688();
|
||||
for(var ti:int = 0; ti < this.var_612; ti++)
|
||||
this.§_-Oi§();
|
||||
for(var ti:int = 0; ti < this.§_-VV§; ti++)
|
||||
{
|
||||
bodyCollisionData = this.var_611[ti];
|
||||
bodyCollisionData = this.§_-3Q§[ti];
|
||||
boundBox = bodyCollisionData.body.aabb;
|
||||
imin = (boundBox.minX - this.var_609.minX) / this.cellSize;
|
||||
imin = (boundBox.minX - this.§_-aq§.minX) / this.cellSize;
|
||||
if(!(imin < 0 || imin >= this.numCellsX))
|
||||
{
|
||||
jmin = (boundBox.minY - this.var_609.minY) / this.cellSize;
|
||||
jmin = (boundBox.minY - this.§_-aq§.minY) / this.cellSize;
|
||||
if(!(jmin < 0 || jmin >= this.numCellsY))
|
||||
{
|
||||
kmin = (boundBox.minZ - this.var_609.minZ) / this.cellSize;
|
||||
kmin = (boundBox.minZ - this.§_-aq§.minZ) / this.cellSize;
|
||||
if(!(kmin < 0 || kmin >= this.numCellsZ))
|
||||
{
|
||||
imax = (boundBox.maxX - this.var_609.minX) / this.cellSize;
|
||||
imax = (boundBox.maxX - this.§_-aq§.minX) / this.cellSize;
|
||||
if(imax >= this.numCellsX)
|
||||
{
|
||||
imax = this.numCellsX - 1;
|
||||
}
|
||||
jmax = (boundBox.maxY - this.var_609.minY) / this.cellSize;
|
||||
jmax = (boundBox.maxY - this.§_-aq§.minY) / this.cellSize;
|
||||
if(jmax >= this.numCellsY)
|
||||
{
|
||||
jmax = this.numCellsY - 1;
|
||||
}
|
||||
kmax = (boundBox.maxZ - this.var_609.minZ) / this.cellSize;
|
||||
kmax = (boundBox.maxZ - this.§_-aq§.minZ) / this.cellSize;
|
||||
if(kmax >= this.numCellsZ)
|
||||
{
|
||||
kmax = this.numCellsZ - 1;
|
||||
@@ -861,8 +861,8 @@ package package_113
|
||||
if(this.bodyCellEntries[cellIndex] == null)
|
||||
{
|
||||
occupiedCellIndex = OccupiedCellIndex.create(cellIndex);
|
||||
occupiedCellIndex.next = this.var_614;
|
||||
this.var_614 = occupiedCellIndex;
|
||||
occupiedCellIndex.next = this.§_-Qp§;
|
||||
this.§_-Qp§ = occupiedCellIndex;
|
||||
}
|
||||
for(i = imin; i <= imax; )
|
||||
{
|
||||
@@ -883,15 +883,15 @@ package package_113
|
||||
}
|
||||
}
|
||||
}
|
||||
this.var_617 = false;
|
||||
this.§_-WJ§ = false;
|
||||
}
|
||||
|
||||
private function method_683(body:name_271) : int
|
||||
private function §_-OL§(body:§_-BV§) : int
|
||||
{
|
||||
var bodyCollisionGridData:name_685 = null;
|
||||
for(var i:int = 0; i < this.var_612; )
|
||||
var bodyCollisionGridData:§_-Pg§ = null;
|
||||
for(var i:int = 0; i < this.§_-VV§; )
|
||||
{
|
||||
bodyCollisionGridData = this.var_611[i];
|
||||
bodyCollisionGridData = this.§_-3Q§[i];
|
||||
if(bodyCollisionGridData.body == body)
|
||||
{
|
||||
return i;
|
||||
@@ -901,33 +901,33 @@ package package_113
|
||||
return -1;
|
||||
}
|
||||
|
||||
private function method_686() : void
|
||||
private function §_-8J§() : void
|
||||
{
|
||||
var maxObjectPairs:int = MAX_OBJECTS * (MAX_OBJECTS - 1) / 2;
|
||||
this.var_618 = (maxObjectPairs + 31) / 32;
|
||||
this.var_615 = new Vector.<int>(this.var_618);
|
||||
this.§_-81§ = (maxObjectPairs + 31) / 32;
|
||||
this.§_-48§ = new Vector.<int>(this.§_-81§);
|
||||
}
|
||||
|
||||
private function method_690() : void
|
||||
private function §_-kL§() : void
|
||||
{
|
||||
this.var_596 = new Object();
|
||||
this.method_655(name_235.BOX,name_235.BOX,new name_666());
|
||||
this.method_655(name_235.BOX,name_235.RECT,new name_667());
|
||||
this.method_655(name_235.BOX,name_235.TRIANGLE,new name_668());
|
||||
this.§_-P6§ = new Object();
|
||||
this.§_-c2§(§_-Nh§.BOX,§_-Nh§.BOX,new §_-Ph§());
|
||||
this.§_-c2§(§_-Nh§.BOX,§_-Nh§.RECT,new §_-GQ§());
|
||||
this.§_-c2§(§_-Nh§.BOX,§_-Nh§.TRIANGLE,new §_-hu§());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import package_46.name_194;
|
||||
import package_76.name_235;
|
||||
import package_76.name_631;
|
||||
import package_90.name_273;
|
||||
import §_-1e§.§_-Nh§;
|
||||
import §_-1e§.§_-jn§;
|
||||
import §_-KA§.§_-jr§;
|
||||
import §_-nl§.§_-bj§;
|
||||
|
||||
class BodyCellEntry
|
||||
{
|
||||
private static var pool:BodyCellEntry;
|
||||
|
||||
public var data:name_685;
|
||||
public var data:§_-Pg§;
|
||||
|
||||
public var next:BodyCellEntry;
|
||||
|
||||
@@ -956,13 +956,13 @@ class BodyCellEntry
|
||||
}
|
||||
}
|
||||
|
||||
class RaycastCellVisitor implements class_34
|
||||
class RaycastCellVisitor implements §_-hm§
|
||||
{
|
||||
public static var EPSILON:Number = 0.0001;
|
||||
|
||||
private static var normal:name_194 = new name_194();
|
||||
private static var normal:§_-bj§ = new §_-bj§();
|
||||
|
||||
public var denseArray:Vector.<name_235>;
|
||||
public var denseArray:Vector.<§_-Nh§>;
|
||||
|
||||
public var denseCellIndices:Vector.<int>;
|
||||
|
||||
@@ -976,15 +976,15 @@ class RaycastCellVisitor implements class_34
|
||||
|
||||
public var collisionMask:int;
|
||||
|
||||
public var filter:name_631;
|
||||
public var filter:§_-jn§;
|
||||
|
||||
public var result:name_273;
|
||||
public var result:§_-jr§;
|
||||
|
||||
public var hasHit:Boolean;
|
||||
|
||||
private var nearestPrimitive:name_235;
|
||||
private var nearestPrimitive:§_-Nh§;
|
||||
|
||||
private var nearestNormal:name_194 = new name_194();
|
||||
private var nearestNormal:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var nearestTime:Number = 1.7976931348623157e+308;
|
||||
|
||||
@@ -993,13 +993,13 @@ class RaycastCellVisitor implements class_34
|
||||
super();
|
||||
}
|
||||
|
||||
public function visitCell(celli:int, cellj:int, cellk:int, axis:int, cellEntryTime:Number, cellMaxTime:Number, timestamp:int, rayOrigin:name_194, rayDirection:name_194) : Boolean
|
||||
public function visitCell(celli:int, cellj:int, cellk:int, axis:int, cellEntryTime:Number, cellMaxTime:Number, timestamp:int, rayOrigin:§_-bj§, rayDirection:§_-bj§) : Boolean
|
||||
{
|
||||
var collisionPrimitive:name_235 = null;
|
||||
var collisionPrimitive:§_-Nh§ = null;
|
||||
var time:Number = NaN;
|
||||
var bodyCellEntry:BodyCellEntry = null;
|
||||
var data:name_685 = null;
|
||||
var detailedPrimitives:Vector.<name_235> = null;
|
||||
var data:§_-Pg§ = null;
|
||||
var detailedPrimitives:Vector.<§_-Nh§> = null;
|
||||
var numPrimitives:uint = 0;
|
||||
this.hasHit = false;
|
||||
var cellIndex:int = celli * this.numCellsY * this.numCellsZ + cellj * this.numCellsZ + cellk;
|
||||
@@ -1015,8 +1015,8 @@ class RaycastCellVisitor implements class_34
|
||||
collisionPrimitive.timestamp = timestamp;
|
||||
if((collisionPrimitive.collisionGroup & this.collisionMask) != 0)
|
||||
{
|
||||
time = collisionPrimitive.raycast(rayOrigin,rayDirection,EPSILON,normal);
|
||||
if(time > 0 && time < minTime && (this.filter == null || Boolean(this.filter.name_664(collisionPrimitive))))
|
||||
time = Number(collisionPrimitive.raycast(rayOrigin,rayDirection,EPSILON,normal));
|
||||
if(time > 0 && time < minTime && (this.filter == null || Boolean(this.filter.§_-0w§(collisionPrimitive))))
|
||||
{
|
||||
minTime = time;
|
||||
if(time < cellMaxTime)
|
||||
@@ -1052,8 +1052,8 @@ class RaycastCellVisitor implements class_34
|
||||
collisionPrimitive = detailedPrimitives[i];
|
||||
if((collisionPrimitive.collisionGroup & this.collisionMask) != 0)
|
||||
{
|
||||
time = collisionPrimitive.raycast(rayOrigin,rayDirection,EPSILON,normal);
|
||||
if(time > 0 && time < minTime && (this.filter == null || Boolean(this.filter.name_664(collisionPrimitive))))
|
||||
time = Number(collisionPrimitive.raycast(rayOrigin,rayDirection,EPSILON,normal));
|
||||
if(time > 0 && time < minTime && (this.filter == null || Boolean(this.filter.§_-0w§(collisionPrimitive))))
|
||||
{
|
||||
minTime = time;
|
||||
if(time < cellMaxTime)
|
||||
@@ -1,29 +1,29 @@
|
||||
package alternativa.tanks.config
|
||||
package §_-cv§
|
||||
{
|
||||
import flash.display.BitmapData;
|
||||
import flash.events.Event;
|
||||
import package_40.name_169;
|
||||
import package_40.name_170;
|
||||
import §return§.§_-Ui§;
|
||||
import §return§.§_-pj§;
|
||||
|
||||
public class TextureLibrary extends ResourceLoader
|
||||
public class §_-Tv§ extends §_-FR§
|
||||
{
|
||||
private var textures:Object = {};
|
||||
|
||||
private var var_193:BitmapData;
|
||||
private var §_-gh§:BitmapData;
|
||||
|
||||
private var var_34:name_170;
|
||||
private var §_-d5§:§_-Ui§;
|
||||
|
||||
public function TextureLibrary(param1:Config)
|
||||
public function §_-Tv§(param1:§_-YU§)
|
||||
{
|
||||
super("Texture library loader",param1);
|
||||
}
|
||||
|
||||
public function name_244(param1:String) : Object
|
||||
public function §_-o0§(param1:String) : Object
|
||||
{
|
||||
return this.textures[param1] || this.getDummyTexture();
|
||||
return this.textures[param1] || this.§_-8P§();
|
||||
}
|
||||
|
||||
public function method_310(param1:String, param2:Object) : void
|
||||
public function §_-Co§(param1:String, param2:Object) : void
|
||||
{
|
||||
this.textures[param1] = param2;
|
||||
}
|
||||
@@ -32,52 +32,52 @@ package alternativa.tanks.config
|
||||
{
|
||||
var _loc3_:XML = null;
|
||||
var _loc1_:XML = config.xml.textures[0];
|
||||
var _loc2_:String = StringUtils.name_460(_loc1_.@baseUrl);
|
||||
this.var_34 = new name_170();
|
||||
var _loc2_:String = §_-NN§.§_-KN§(_loc1_.@baseUrl);
|
||||
this.§_-d5§ = new §_-Ui§();
|
||||
for each(_loc3_ in _loc1_.texture)
|
||||
{
|
||||
this.var_34.addTask(new TextureLoader(_loc3_.@id,_loc2_ + _loc3_.@url,this));
|
||||
this.§_-d5§.addTask(new TextureLoader(_loc3_.@id,_loc2_ + _loc3_.@url,this));
|
||||
}
|
||||
this.var_34.addEventListener(name_169.TASK_COMPLETE,this.onTaskComplete);
|
||||
this.var_34.addEventListener(Event.COMPLETE,this.onSequenceComplete);
|
||||
this.var_34.run();
|
||||
this.§_-d5§.addEventListener(§_-pj§.TASK_COMPLETE,this.§_-fm§);
|
||||
this.§_-d5§.addEventListener(Event.COMPLETE,this.§_-Pw§);
|
||||
this.§_-d5§.run();
|
||||
}
|
||||
|
||||
private function onTaskComplete(param1:name_169) : void
|
||||
private function §_-fm§(param1:§_-pj§) : void
|
||||
{
|
||||
dispatchEvent(new name_169(name_169.TASK_PROGRESS,1,this.var_34.length));
|
||||
dispatchEvent(new §_-pj§(§_-pj§.TASK_PROGRESS,1,this.§_-d5§.length));
|
||||
}
|
||||
|
||||
private function onSequenceComplete(param1:Event) : void
|
||||
private function §_-Pw§(param1:Event) : void
|
||||
{
|
||||
this.var_34 = null;
|
||||
method_102();
|
||||
this.§_-d5§ = null;
|
||||
§_-3Z§();
|
||||
}
|
||||
|
||||
private function getDummyTexture() : BitmapData
|
||||
private function §_-8P§() : BitmapData
|
||||
{
|
||||
var _loc1_:int = 0;
|
||||
var _loc2_:uint = 0;
|
||||
var _loc3_:int = 0;
|
||||
var _loc4_:int = 0;
|
||||
if(this.var_193 == null)
|
||||
if(this.§_-gh§ == null)
|
||||
{
|
||||
_loc1_ = 128;
|
||||
_loc2_ = 16711935;
|
||||
this.var_193 = new BitmapData(_loc1_,_loc1_,false,0);
|
||||
this.§_-gh§ = new BitmapData(_loc1_,_loc1_,false,0);
|
||||
_loc3_ = 0;
|
||||
while(_loc3_ < _loc1_)
|
||||
{
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < _loc1_)
|
||||
{
|
||||
this.var_193.setPixel(Boolean(_loc3_ % 2) ? _loc4_ : _loc4_ + 1,_loc3_,_loc2_);
|
||||
this.§_-gh§.setPixel(Boolean(_loc3_ % 2) ? _loc4_ : _loc4_ + 1,_loc3_,_loc2_);
|
||||
_loc4_ += 2;
|
||||
}
|
||||
_loc3_++;
|
||||
}
|
||||
}
|
||||
return this.var_193;
|
||||
return this.§_-gh§;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,21 +90,21 @@ import flash.net.URLLoader;
|
||||
import flash.net.URLLoaderDataFormat;
|
||||
import flash.net.URLRequest;
|
||||
import flash.utils.ByteArray;
|
||||
import package_40.class_7;
|
||||
import §return§.§_-h5§;
|
||||
|
||||
class TextureLoader extends class_7
|
||||
class TextureLoader extends §_-h5§
|
||||
{
|
||||
private var id:String;
|
||||
|
||||
private var url:String;
|
||||
|
||||
private var library:TextureLibrary;
|
||||
private var library:§_-Tv§;
|
||||
|
||||
private var loader:Loader;
|
||||
|
||||
private var urlLoader:URLLoader;
|
||||
|
||||
public function TextureLoader(param1:String, param2:String, param3:TextureLibrary)
|
||||
public function TextureLoader(param1:String, param2:String, param3:§_-Tv§)
|
||||
{
|
||||
super();
|
||||
this.id = param1;
|
||||
@@ -131,13 +131,13 @@ class TextureLoader extends class_7
|
||||
|
||||
private function onLoadingCompressedComplete(param1:Event) : void
|
||||
{
|
||||
this.library.method_310(this.id,ByteArray(this.urlLoader.data));
|
||||
method_102();
|
||||
this.library.§_-Co§(this.id,ByteArray(this.urlLoader.data));
|
||||
§_-3Z§();
|
||||
}
|
||||
|
||||
private function onLoadingComplete(param1:Event) : void
|
||||
{
|
||||
this.library.method_310(this.id,Bitmap(this.loader.content).bitmapData);
|
||||
method_102();
|
||||
this.library.§_-Co§(this.id,Bitmap(this.loader.content).bitmapData);
|
||||
§_-3Z§();
|
||||
}
|
||||
}
|
||||
198
src/?_-cv?/?_-YU?.as
Normal file
@@ -0,0 +1,198 @@
|
||||
package §_-cv§
|
||||
{
|
||||
import §_-O5§.§_-Hk§;
|
||||
import §_-aa§.§_-cS§;
|
||||
import §_-aa§.§_-i0§;
|
||||
import flash.events.Event;
|
||||
import flash.events.EventDispatcher;
|
||||
import flash.utils.ByteArray;
|
||||
import §return§.§_-Hr§;
|
||||
import §return§.§_-Ui§;
|
||||
import §return§.§_-h5§;
|
||||
import §return§.§_-pj§;
|
||||
|
||||
[Event(name="complete",type="flash.events.Event")]
|
||||
public class §_-YU§ extends EventDispatcher
|
||||
{
|
||||
public var mapData:§_-Hk§;
|
||||
|
||||
public var §_-WX§:§_-Tv§;
|
||||
|
||||
public var tankParts:§_-Kz§;
|
||||
|
||||
public var soundsLibrary:§_-i0§;
|
||||
|
||||
public var §_-WG§:§_-o6§ = new §_-o6§();
|
||||
|
||||
private var §_-Qb§:XML;
|
||||
|
||||
private var §_-d5§:§_-Ui§;
|
||||
|
||||
private var preloader:Preloader;
|
||||
|
||||
private var §_-D9§:Object = {};
|
||||
|
||||
public function §_-YU§()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function load(param1:String, param2:Preloader) : void
|
||||
{
|
||||
this.preloader = param2;
|
||||
this.§_-d5§ = new §_-Ui§();
|
||||
var _loc3_:ConfigXMLLoader = new ConfigXMLLoader(param1,this);
|
||||
this.§_-d5§.addTask(_loc3_);
|
||||
_loc3_.addEventListener(§_-pj§.TASK_COMPLETE,this.§_-Ax§);
|
||||
var _loc4_:§_-cS§ = new §_-cS§(this);
|
||||
this.§_-d5§.addTask(_loc4_);
|
||||
_loc4_.addEventListener(§_-pj§.TASK_PROGRESS,this.§_-Ax§);
|
||||
this.§_-WX§ = new §_-Tv§(this);
|
||||
this.§_-WX§.addEventListener(§_-pj§.TASK_PROGRESS,this.§_-Ax§);
|
||||
this.§_-d5§.addTask(this.§_-WX§);
|
||||
var _loc5_:§_-h5§ = this.§_-kp§();
|
||||
this.§_-d5§.addTask(_loc5_);
|
||||
_loc5_.addEventListener(§_-pj§.TASK_COMPLETE,this.§_-Ax§);
|
||||
this.tankParts = new §_-Kz§(this);
|
||||
this.tankParts.addEventListener(§_-pj§.TASK_PROGRESS,this.§_-Ax§);
|
||||
this.§_-d5§.addTask(this.tankParts);
|
||||
this.soundsLibrary = new §_-i0§(this);
|
||||
this.soundsLibrary.addEventListener(§_-pj§.TASK_PROGRESS,this.§_-Ax§);
|
||||
this.§_-d5§.addTask(this.soundsLibrary);
|
||||
this.§_-d5§.addEventListener(Event.COMPLETE,this.§_-Pw§);
|
||||
this.§_-d5§.run();
|
||||
}
|
||||
|
||||
private function §_-Ax§(param1:§_-pj§) : void
|
||||
{
|
||||
this.preloader.§_-fE§(param1.progress / param1.total * 0.1);
|
||||
}
|
||||
|
||||
public function §_-f§() : String
|
||||
{
|
||||
return this.xml.map.@skybox;
|
||||
}
|
||||
|
||||
public function get xml() : XML
|
||||
{
|
||||
return this.§_-Qb§;
|
||||
}
|
||||
|
||||
public function set xml(param1:XML) : void
|
||||
{
|
||||
this.§_-Qb§ = param1;
|
||||
this.static();
|
||||
}
|
||||
|
||||
public function get options() : Object
|
||||
{
|
||||
return this.§_-D9§;
|
||||
}
|
||||
|
||||
public function clear() : void
|
||||
{
|
||||
var _loc1_:* = undefined;
|
||||
for(_loc1_ in this.mapData.data)
|
||||
{
|
||||
delete this.mapData.data[_loc1_];
|
||||
}
|
||||
this.§_-Qb§ = null;
|
||||
this.mapData = null;
|
||||
}
|
||||
|
||||
private function §_-kp§() : §_-h5§
|
||||
{
|
||||
return new MapLoadTask(this,this.§_-SN§);
|
||||
}
|
||||
|
||||
private function §_-Pw§(param1:Event) : void
|
||||
{
|
||||
this.§_-d5§ = null;
|
||||
dispatchEvent(new Event(Event.COMPLETE));
|
||||
}
|
||||
|
||||
private function §_-SN§(param1:ByteArray) : void
|
||||
{
|
||||
var _loc2_:§_-Hr§ = new §_-Hr§(param1);
|
||||
this.mapData = new §_-Hk§(_loc2_.data);
|
||||
}
|
||||
|
||||
private function static() : void
|
||||
{
|
||||
var _loc1_:XML = null;
|
||||
for each(_loc1_ in this.§_-Qb§.kernelOptions.option)
|
||||
{
|
||||
this.§_-D9§[_loc1_.@name] = _loc1_.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import flash.events.Event;
|
||||
import flash.events.EventDispatcher;
|
||||
import flash.net.URLLoader;
|
||||
import flash.net.URLLoaderDataFormat;
|
||||
import flash.net.URLRequest;
|
||||
import flash.utils.ByteArray;
|
||||
import §return§.§_-h5§;
|
||||
|
||||
class ConfigXMLLoader extends §_-h5§
|
||||
{
|
||||
private var config:§_-YU§;
|
||||
|
||||
private var loader:URLLoader;
|
||||
|
||||
private var url:String;
|
||||
|
||||
public function ConfigXMLLoader(param1:String, param2:§_-YU§)
|
||||
{
|
||||
super();
|
||||
this.url = param1;
|
||||
this.config = param2;
|
||||
}
|
||||
|
||||
override public function run() : void
|
||||
{
|
||||
this.loader = new URLLoader();
|
||||
this.loader.addEventListener(Event.COMPLETE,this.onLoadingComplete);
|
||||
this.loader.load(new URLRequest(this.url));
|
||||
}
|
||||
|
||||
private function onLoadingComplete(param1:Event) : void
|
||||
{
|
||||
this.config.xml = XML(this.loader.data);
|
||||
this.loader = null;
|
||||
§_-3Z§();
|
||||
}
|
||||
}
|
||||
|
||||
class MapLoadTask extends §_-h5§
|
||||
{
|
||||
private var callback:Function;
|
||||
|
||||
private var config:§_-YU§;
|
||||
|
||||
private var loader:URLLoader;
|
||||
|
||||
public function MapLoadTask(param1:§_-YU§, param2:Function)
|
||||
{
|
||||
super();
|
||||
this.config = param1;
|
||||
this.callback = param2;
|
||||
}
|
||||
|
||||
override public function run() : void
|
||||
{
|
||||
this.loader = new URLLoader();
|
||||
this.loader.dataFormat = URLLoaderDataFormat.BINARY;
|
||||
this.loader.addEventListener(Event.COMPLETE,this.onLoadingComplete);
|
||||
this.loader.load(new URLRequest(this.config.xml.map.@url));
|
||||
}
|
||||
|
||||
private function onLoadingComplete(param1:Event) : void
|
||||
{
|
||||
this.callback.call(null,ByteArray(this.loader.data));
|
||||
this.loader = null;
|
||||
§_-3Z§();
|
||||
}
|
||||
}
|
||||
@@ -1,127 +1,127 @@
|
||||
package package_86
|
||||
package §_-fT§
|
||||
{
|
||||
import package_121.name_666;
|
||||
import package_121.name_667;
|
||||
import package_121.name_668;
|
||||
import package_46.name_194;
|
||||
import package_76.name_235;
|
||||
import package_76.name_631;
|
||||
import package_76.name_656;
|
||||
import package_76.name_663;
|
||||
import package_76.name_665;
|
||||
import package_90.name_273;
|
||||
import package_90.name_386;
|
||||
import package_92.name_271;
|
||||
import package_92.name_513;
|
||||
import package_92.name_601;
|
||||
import package_92.name_630;
|
||||
import §_-1e§.§_-D-§;
|
||||
import §_-1e§.§_-Nh§;
|
||||
import §_-1e§.§_-hG§;
|
||||
import §_-1e§.§_-jn§;
|
||||
import §_-1e§.§_-oZ§;
|
||||
import §_-KA§.§_-FW§;
|
||||
import §_-KA§.§_-jr§;
|
||||
import §_-US§.§_-4q§;
|
||||
import §_-US§.§_-6h§;
|
||||
import §_-US§.§_-BV§;
|
||||
import §_-US§.§_-G2§;
|
||||
import §_-nl§.§_-bj§;
|
||||
import §while§.§_-GQ§;
|
||||
import §while§.§_-Ph§;
|
||||
import §while§.§_-hu§;
|
||||
|
||||
public class name_466 implements name_468
|
||||
public class §_-ZI§ implements §_-Zm§
|
||||
{
|
||||
public var var_592:name_663;
|
||||
public var §_-bw§:§_-D-§;
|
||||
|
||||
public var threshold:Number = 0.0001;
|
||||
|
||||
private var var_596:Object;
|
||||
private var §_-P6§:Object;
|
||||
|
||||
private var var_591:Vector.<name_568>;
|
||||
private var §_-Wj§:Vector.<§_-YY§>;
|
||||
|
||||
private var var_593:int;
|
||||
private var §_-LK§:int;
|
||||
|
||||
private var name_605:Vector.<name_271>;
|
||||
private var §_-By§:Vector.<§_-BV§>;
|
||||
|
||||
private var numBodies:int;
|
||||
|
||||
private var var_420:MinMax = new MinMax();
|
||||
private var §_-qC§:MinMax = new MinMax();
|
||||
|
||||
private var var_594:name_194 = new name_194();
|
||||
private var §_-k8§:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var var_590:name_194 = new name_194();
|
||||
private var §_-0q§:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var var_595:name_273 = new name_273();
|
||||
private var §_-2P§:§_-jr§ = new §_-jr§();
|
||||
|
||||
private var _rayAABB:name_386 = new name_386();
|
||||
private var _rayAABB:§_-FW§ = new §_-FW§();
|
||||
|
||||
public function name_466()
|
||||
public function §_-ZI§()
|
||||
{
|
||||
super();
|
||||
this.var_592 = new name_663();
|
||||
this.name_605 = new Vector.<name_271>();
|
||||
this.var_591 = new Vector.<name_568>();
|
||||
this.var_596 = new Object();
|
||||
this.method_655(name_235.BOX,name_235.BOX,new name_666());
|
||||
this.method_655(name_235.BOX,name_235.RECT,new name_667());
|
||||
this.method_655(name_235.BOX,name_235.TRIANGLE,new name_668());
|
||||
this.§_-bw§ = new §_-D-§();
|
||||
this.§_-By§ = new Vector.<§_-BV§>();
|
||||
this.§_-Wj§ = new Vector.<§_-YY§>();
|
||||
this.§_-P6§ = new Object();
|
||||
this.§_-c2§(§_-Nh§.BOX,§_-Nh§.BOX,new §_-Ph§());
|
||||
this.§_-c2§(§_-Nh§.BOX,§_-Nh§.RECT,new §_-GQ§());
|
||||
this.§_-c2§(§_-Nh§.BOX,§_-Nh§.TRIANGLE,new §_-hu§());
|
||||
}
|
||||
|
||||
public function method_665(primitive:name_235) : void
|
||||
public function §_-oT§(primitive:§_-Nh§) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function method_664(primitive:name_235) : void
|
||||
public function §_-HZ§(primitive:§_-Nh§) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function name_470() : void
|
||||
public function §_-9F§() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function name_473(collisionPrimitives:Vector.<name_235>, boundBox:name_386 = null) : void
|
||||
public function §_-Vy§(collisionPrimitives:Vector.<§_-Nh§>, boundBox:§_-FW§ = null) : void
|
||||
{
|
||||
this.var_592.name_669(collisionPrimitives,boundBox);
|
||||
this.§_-bw§.§_-J9§(collisionPrimitives,boundBox);
|
||||
}
|
||||
|
||||
public function name_591(tankPhysicsEntry:name_568) : void
|
||||
public function §_-pN§(tankPhysicsEntry:§_-YY§) : void
|
||||
{
|
||||
if(this.var_591.indexOf(tankPhysicsEntry) >= 0)
|
||||
if(this.§_-Wj§.indexOf(tankPhysicsEntry) >= 0)
|
||||
{
|
||||
throw new Error("Tank entry already exists");
|
||||
}
|
||||
var _loc2_:* = this.var_593++;
|
||||
this.var_591[_loc2_] = tankPhysicsEntry;
|
||||
var _loc2_:* = this.§_-LK§++;
|
||||
this.§_-Wj§[_loc2_] = tankPhysicsEntry;
|
||||
}
|
||||
|
||||
public function name_590(tankPhysicsEntry:name_568) : void
|
||||
public function §_-qP§(tankPhysicsEntry:§_-YY§) : void
|
||||
{
|
||||
var index:Number = Number(this.var_591.indexOf(tankPhysicsEntry));
|
||||
var index:Number = Number(this.§_-Wj§.indexOf(tankPhysicsEntry));
|
||||
if(index < 0)
|
||||
{
|
||||
throw new Error("Tank entry not found");
|
||||
}
|
||||
this.var_591[index] = this.var_591[--this.var_593];
|
||||
this.var_591[this.var_593] = null;
|
||||
this.§_-Wj§[index] = this.§_-Wj§[--this.§_-LK§];
|
||||
this.§_-Wj§[this.§_-LK§] = null;
|
||||
}
|
||||
|
||||
public function name_592(body:name_271) : void
|
||||
public function §_-D8§(body:§_-BV§) : void
|
||||
{
|
||||
var _loc2_:* = this.numBodies++;
|
||||
this.name_605[_loc2_] = body;
|
||||
this.§_-By§[_loc2_] = body;
|
||||
}
|
||||
|
||||
public function name_593(body:name_271) : void
|
||||
public function §_-2x§(body:§_-BV§) : void
|
||||
{
|
||||
var index:int = int(this.name_605.indexOf(body));
|
||||
var index:int = int(this.§_-By§.indexOf(body));
|
||||
if(index < 0)
|
||||
{
|
||||
throw new Error("Body not found");
|
||||
}
|
||||
this.name_605[index] = this.name_605[--this.numBodies];
|
||||
this.name_605[this.numBodies] = null;
|
||||
this.§_-By§[index] = this.§_-By§[--this.numBodies];
|
||||
this.§_-By§[this.numBodies] = null;
|
||||
}
|
||||
|
||||
public function method_651(center:name_194, radius:Number, filter:name_655) : Vector.<name_654>
|
||||
public function §_-7u§(center:§_-bj§, radius:Number, filter:§_-VN§) : Vector.<§_-bB§>
|
||||
{
|
||||
var result:Vector.<name_654> = null;
|
||||
var tankPhysicsEntry:name_568 = null;
|
||||
var position:name_194 = null;
|
||||
var result:Vector.<§_-bB§> = null;
|
||||
var tankPhysicsEntry:§_-YY§ = null;
|
||||
var position:§_-bj§ = null;
|
||||
var dx:Number = NaN;
|
||||
var dy:Number = NaN;
|
||||
var dz:Number = NaN;
|
||||
var distance:Number = NaN;
|
||||
radius *= radius;
|
||||
for(var i:int = 0; i < this.var_593; )
|
||||
for(var i:int = 0; i < this.§_-LK§; )
|
||||
{
|
||||
tankPhysicsEntry = this.var_591[i];
|
||||
tankPhysicsEntry = this.§_-Wj§[i];
|
||||
position = tankPhysicsEntry.body.state.position;
|
||||
dx = position.x - center.x;
|
||||
dy = position.y - center.y;
|
||||
@@ -129,13 +129,13 @@ package package_86
|
||||
distance = dx * dx + dy * dy + dz * dz;
|
||||
if(distance < radius)
|
||||
{
|
||||
if(filter == null || Boolean(filter.name_670(center,tankPhysicsEntry.body)))
|
||||
if(filter == null || Boolean(filter.§_-cb§(center,tankPhysicsEntry.body)))
|
||||
{
|
||||
if(result == null)
|
||||
{
|
||||
result = new Vector.<name_654>();
|
||||
result = new Vector.<§_-bB§>();
|
||||
}
|
||||
result.push(new name_654(tankPhysicsEntry.body,Math.sqrt(distance)));
|
||||
result.push(new §_-bB§(tankPhysicsEntry.body,Math.sqrt(distance)));
|
||||
}
|
||||
}
|
||||
i++;
|
||||
@@ -143,30 +143,30 @@ package package_86
|
||||
return result;
|
||||
}
|
||||
|
||||
public function method_553(contact:name_630) : name_630
|
||||
public function §_-63§(contact:§_-6h§) : §_-6h§
|
||||
{
|
||||
return this.method_659(contact);
|
||||
return this.§_-Uu§(contact);
|
||||
}
|
||||
|
||||
public function getContact(prim1:name_235, prim2:name_235, contact:name_630) : Boolean
|
||||
public function getContact(prim1:§_-Nh§, prim2:§_-Nh§, contact:§_-6h§) : Boolean
|
||||
{
|
||||
if((prim1.collisionMask & prim2.collisionGroup) == 0 || (prim2.collisionMask & prim1.collisionGroup) == 0 || !prim1.aabb.intersects(prim2.aabb,0.01))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var collider:name_665 = this.var_596[prim1.type | prim2.type];
|
||||
var collider:§_-hG§ = this.§_-P6§[prim1.type | prim2.type];
|
||||
if(collider != null && Boolean(collider.getContact(prim1,prim2,contact)))
|
||||
{
|
||||
if(prim1.postCollisionFilter != null && !prim1.postCollisionFilter.name_662(prim1,prim2))
|
||||
if(prim1.postCollisionFilter != null && !prim1.postCollisionFilter.§_-eZ§(prim1,prim2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return !(prim2.postCollisionFilter != null && !prim2.postCollisionFilter.name_662(prim2,prim1));
|
||||
return !(prim2.postCollisionFilter != null && !prim2.postCollisionFilter.§_-eZ§(prim2,prim1));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function method_554(prim1:name_235, prim2:name_235) : Boolean
|
||||
public function §_-A5§(prim1:§_-Nh§, prim2:§_-Nh§) : Boolean
|
||||
{
|
||||
if((prim1.collisionMask & prim2.collisionGroup) == 0 || (prim2.collisionMask & prim1.collisionGroup) == 0)
|
||||
{
|
||||
@@ -180,31 +180,31 @@ package package_86
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var collider:name_665 = this.var_596[prim1.type | prim2.type];
|
||||
var collider:§_-hG§ = this.§_-P6§[prim1.type | prim2.type];
|
||||
if(collider != null && Boolean(collider.haveCollision(prim1,prim2)))
|
||||
{
|
||||
if(prim1.postCollisionFilter != null && !prim1.postCollisionFilter.name_662(prim1,prim2))
|
||||
if(prim1.postCollisionFilter != null && !prim1.postCollisionFilter.§_-eZ§(prim1,prim2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return !(prim2.postCollisionFilter != null && !prim2.postCollisionFilter.name_662(prim2,prim1));
|
||||
return !(prim2.postCollisionFilter != null && !prim2.postCollisionFilter.§_-eZ§(prim2,prim1));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function raycast(origin:name_194, dir:name_194, collisionMask:int, maxTime:Number, filter:name_631, result:name_273) : Boolean
|
||||
public function raycast(origin:§_-bj§, dir:§_-bj§, collisionMask:int, maxTime:Number, filter:§_-jn§, result:§_-jr§) : Boolean
|
||||
{
|
||||
var hasStaticIntersection:Boolean = this.name_324(origin,dir,collisionMask,maxTime,filter,result);
|
||||
var hasDynamicIntersection:Boolean = this.method_658(origin,dir,collisionMask,maxTime,filter,this.var_595);
|
||||
var hasStaticIntersection:Boolean = this.§_-cX§(origin,dir,collisionMask,maxTime,filter,result);
|
||||
var hasDynamicIntersection:Boolean = this.§_-eu§(origin,dir,collisionMask,maxTime,filter,this.§_-2P§);
|
||||
if(!(hasDynamicIntersection || hasStaticIntersection))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(hasDynamicIntersection && hasStaticIntersection)
|
||||
{
|
||||
if(result.t > this.var_595.t)
|
||||
if(result.t > this.§_-2P§.t)
|
||||
{
|
||||
result.copy(this.var_595);
|
||||
result.copy(this.§_-2P§);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -212,73 +212,73 @@ package package_86
|
||||
{
|
||||
return true;
|
||||
}
|
||||
result.copy(this.var_595);
|
||||
result.copy(this.§_-2P§);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function name_324(origin:name_194, dir:name_194, collisionMask:int, maxTime:Number, filter:name_631, result:name_273) : Boolean
|
||||
public function §_-cX§(origin:§_-bj§, dir:§_-bj§, collisionMask:int, maxTime:Number, filter:§_-jn§, result:§_-jr§) : Boolean
|
||||
{
|
||||
if(!this.method_662(origin,dir,this.var_592.name_659.boundBox,this.var_420))
|
||||
if(!this.§_-oL§(origin,dir,this.§_-bw§.§_-5H§.boundBox,this.§_-qC§))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(this.var_420.max < 0 || this.var_420.min > maxTime)
|
||||
if(this.§_-qC§.max < 0 || this.§_-qC§.min > maxTime)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(this.var_420.min <= 0)
|
||||
if(this.§_-qC§.min <= 0)
|
||||
{
|
||||
this.var_420.min = 0;
|
||||
this.var_590.x = origin.x;
|
||||
this.var_590.y = origin.y;
|
||||
this.var_590.z = origin.z;
|
||||
this.§_-qC§.min = 0;
|
||||
this.§_-0q§.x = origin.x;
|
||||
this.§_-0q§.y = origin.y;
|
||||
this.§_-0q§.z = origin.z;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.var_590.x = origin.x + this.var_420.min * dir.x;
|
||||
this.var_590.y = origin.y + this.var_420.min * dir.y;
|
||||
this.var_590.z = origin.z + this.var_420.min * dir.z;
|
||||
this.§_-0q§.x = origin.x + this.§_-qC§.min * dir.x;
|
||||
this.§_-0q§.y = origin.y + this.§_-qC§.min * dir.y;
|
||||
this.§_-0q§.z = origin.z + this.§_-qC§.min * dir.z;
|
||||
}
|
||||
if(this.var_420.max > maxTime)
|
||||
if(this.§_-qC§.max > maxTime)
|
||||
{
|
||||
this.var_420.max = maxTime;
|
||||
this.§_-qC§.max = maxTime;
|
||||
}
|
||||
var hasIntersection:Boolean = this.method_652(this.var_592.name_659,origin,this.var_590,dir,collisionMask,this.var_420.min,this.var_420.max,filter,result);
|
||||
var hasIntersection:Boolean = this.§_-NC§(this.§_-bw§.§_-5H§,origin,this.§_-0q§,dir,collisionMask,this.§_-qC§.min,this.§_-qC§.max,filter,result);
|
||||
return hasIntersection ? result.t <= maxTime : false;
|
||||
}
|
||||
|
||||
public function method_657(primitive:name_235) : Boolean
|
||||
public function §_-TL§(primitive:§_-Nh§) : Boolean
|
||||
{
|
||||
return this.method_654(primitive,this.var_592.name_659);
|
||||
return this.§_-B8§(primitive,this.§_-bw§.§_-5H§);
|
||||
}
|
||||
|
||||
private function method_655(type1:int, type2:int, collider:name_665) : void
|
||||
private function §_-c2§(type1:int, type2:int, collider:§_-hG§) : void
|
||||
{
|
||||
this.var_596[type1 | type2] = collider;
|
||||
this.§_-P6§[type1 | type2] = collider;
|
||||
}
|
||||
|
||||
private function method_659(contact:name_630) : name_630
|
||||
private function §_-Uu§(contact:§_-6h§) : §_-6h§
|
||||
{
|
||||
var tankEntry:name_568 = null;
|
||||
var body:name_271 = null;
|
||||
var listItem:name_513 = null;
|
||||
var tankEntry:§_-YY§ = null;
|
||||
var body:§_-BV§ = null;
|
||||
var listItem:§_-4q§ = null;
|
||||
var j:int = 0;
|
||||
var otherTankEntry:name_568 = null;
|
||||
for(var i:int = 0; i < this.var_593; i++)
|
||||
var otherTankEntry:§_-YY§ = null;
|
||||
for(var i:int = 0; i < this.§_-LK§; i++)
|
||||
{
|
||||
tankEntry = this.var_591[i];
|
||||
tankEntry = this.§_-Wj§[i];
|
||||
body = tankEntry.body;
|
||||
for(listItem = body.collisionPrimitives.head; listItem != null; )
|
||||
{
|
||||
contact = this.method_653(this.var_592.name_659,listItem.primitive,contact);
|
||||
contact = this.§_-m1§(this.§_-bw§.§_-5H§,listItem.primitive,contact);
|
||||
listItem = listItem.next;
|
||||
}
|
||||
for(j = i + 1; j < this.var_593; )
|
||||
for(j = i + 1; j < this.§_-LK§; )
|
||||
{
|
||||
otherTankEntry = this.var_591[j];
|
||||
otherTankEntry = this.§_-Wj§[j];
|
||||
if(body.aabb.intersects(otherTankEntry.body.aabb,0.1))
|
||||
{
|
||||
contact = this.method_656(tankEntry,otherTankEntry,contact);
|
||||
contact = this.§_-4I§(tankEntry,otherTankEntry,contact);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
@@ -286,15 +286,15 @@ package package_86
|
||||
return contact;
|
||||
}
|
||||
|
||||
private function method_656(tankEntry1:name_568, tankEntry2:name_568, contact:name_630) : name_630
|
||||
private function §_-4I§(tankEntry1:§_-YY§, tankEntry2:§_-YY§, contact:§_-6h§) : §_-6h§
|
||||
{
|
||||
var primitive1:name_235 = null;
|
||||
var primitive1:§_-Nh§ = null;
|
||||
var numSimplePrimitives2:int = 0;
|
||||
var j:int = 0;
|
||||
var primitive2:name_235 = null;
|
||||
var primitive2:§_-Nh§ = null;
|
||||
var skipCollision:Boolean = false;
|
||||
var body1:name_271 = tankEntry1.body;
|
||||
var body2:name_271 = tankEntry2.body;
|
||||
var body1:§_-BV§ = tankEntry1.body;
|
||||
var body2:§_-BV§ = tankEntry2.body;
|
||||
var numSimplePrimitives1:int = int(tankEntry1.simplePrimitives.length);
|
||||
var firstFilterTest:Boolean = true;
|
||||
for(var i:int = 0; i < numSimplePrimitives1; i++)
|
||||
@@ -331,14 +331,14 @@ package package_86
|
||||
return contact;
|
||||
}
|
||||
|
||||
private function method_666(primitives1:name_601, primitives2:name_601) : Boolean
|
||||
private function §_-AX§(primitives1:§_-G2§, primitives2:§_-G2§) : Boolean
|
||||
{
|
||||
var item2:name_513 = null;
|
||||
for(var item1:name_513 = primitives1.head; item1 != null; )
|
||||
var item2:§_-4q§ = null;
|
||||
for(var item1:§_-4q§ = primitives1.head; item1 != null; )
|
||||
{
|
||||
for(item2 = primitives2.head; item2 != null; )
|
||||
{
|
||||
if(this.method_554(item1.primitive,item2.primitive))
|
||||
if(this.§_-A5§(item1.primitive,item2.primitive))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -349,11 +349,11 @@ package package_86
|
||||
return false;
|
||||
}
|
||||
|
||||
private function method_667(primitives:name_601) : Boolean
|
||||
private function §_-bH§(primitives:§_-G2§) : Boolean
|
||||
{
|
||||
for(var item:name_513 = primitives.head; item != null; )
|
||||
for(var item:§_-4q§ = primitives.head; item != null; )
|
||||
{
|
||||
if(this.method_657(item.primitive))
|
||||
if(this.§_-TL§(item.primitive))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -362,16 +362,16 @@ package package_86
|
||||
return false;
|
||||
}
|
||||
|
||||
private function method_653(node:name_656, primitive:name_235, contact:name_630) : name_630
|
||||
private function §_-m1§(node:§_-oZ§, primitive:§_-Nh§, contact:§_-6h§) : §_-6h§
|
||||
{
|
||||
var min:Number = NaN;
|
||||
var max:Number = NaN;
|
||||
var primitives:Vector.<name_235> = null;
|
||||
var primitives:Vector.<§_-Nh§> = null;
|
||||
var indices:Vector.<int> = null;
|
||||
var i:int = 0;
|
||||
if(node.indices != null)
|
||||
{
|
||||
primitives = this.var_592.name_661;
|
||||
primitives = this.§_-bw§.§_-8A§;
|
||||
indices = node.indices;
|
||||
for(i = indices.length - 1; i >= 0; )
|
||||
{
|
||||
@@ -389,46 +389,46 @@ package package_86
|
||||
switch(node.axis)
|
||||
{
|
||||
case 0:
|
||||
min = primitive.aabb.minX;
|
||||
max = primitive.aabb.maxX;
|
||||
min = Number(primitive.aabb.minX);
|
||||
max = Number(primitive.aabb.maxX);
|
||||
break;
|
||||
case 1:
|
||||
min = primitive.aabb.minY;
|
||||
max = primitive.aabb.maxY;
|
||||
min = Number(primitive.aabb.minY);
|
||||
max = Number(primitive.aabb.maxY);
|
||||
break;
|
||||
case 2:
|
||||
min = primitive.aabb.minZ;
|
||||
max = primitive.aabb.maxZ;
|
||||
min = Number(primitive.aabb.minZ);
|
||||
max = Number(primitive.aabb.maxZ);
|
||||
}
|
||||
if(min < node.coord)
|
||||
{
|
||||
contact = this.method_653(node.name_657,primitive,contact);
|
||||
contact = this.§_-m1§(node.§_-Gm§,primitive,contact);
|
||||
}
|
||||
if(max > node.coord)
|
||||
{
|
||||
contact = this.method_653(node.name_658,primitive,contact);
|
||||
contact = this.§_-m1§(node.§_-75§,primitive,contact);
|
||||
}
|
||||
if(node.name_660 != null && min < node.coord && max > node.coord)
|
||||
if(node.§_-da§ != null && min < node.coord && max > node.coord)
|
||||
{
|
||||
contact = this.method_653(node.name_660.name_659,primitive,contact);
|
||||
contact = this.§_-m1§(node.§_-da§.§_-5H§,primitive,contact);
|
||||
}
|
||||
return contact;
|
||||
}
|
||||
|
||||
private function method_654(primitive:name_235, node:name_656) : Boolean
|
||||
private function §_-B8§(primitive:§_-Nh§, node:§_-oZ§) : Boolean
|
||||
{
|
||||
var min:Number = NaN;
|
||||
var max:Number = NaN;
|
||||
var primitives:Vector.<name_235> = null;
|
||||
var primitives:Vector.<§_-Nh§> = null;
|
||||
var indices:Vector.<int> = null;
|
||||
var i:int = 0;
|
||||
if(node.indices != null)
|
||||
{
|
||||
primitives = this.var_592.name_661;
|
||||
primitives = this.§_-bw§.§_-8A§;
|
||||
indices = node.indices;
|
||||
for(i = indices.length - 1; i >= 0; )
|
||||
{
|
||||
if(this.method_554(primitive,primitives[indices[i]]))
|
||||
if(this.§_-A5§(primitive,primitives[indices[i]]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -442,34 +442,34 @@ package package_86
|
||||
switch(node.axis)
|
||||
{
|
||||
case 0:
|
||||
min = primitive.aabb.minX;
|
||||
max = primitive.aabb.maxX;
|
||||
min = Number(primitive.aabb.minX);
|
||||
max = Number(primitive.aabb.maxX);
|
||||
break;
|
||||
case 1:
|
||||
min = primitive.aabb.minY;
|
||||
max = primitive.aabb.maxY;
|
||||
min = Number(primitive.aabb.minY);
|
||||
max = Number(primitive.aabb.maxY);
|
||||
break;
|
||||
case 2:
|
||||
min = primitive.aabb.minZ;
|
||||
max = primitive.aabb.maxZ;
|
||||
min = Number(primitive.aabb.minZ);
|
||||
max = Number(primitive.aabb.maxZ);
|
||||
}
|
||||
if(node.name_660 != null && min < node.coord && max > node.coord)
|
||||
if(node.§_-da§ != null && min < node.coord && max > node.coord)
|
||||
{
|
||||
if(this.method_654(primitive,node.name_660.name_659))
|
||||
if(this.§_-B8§(primitive,node.§_-da§.§_-5H§))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(min < node.coord)
|
||||
{
|
||||
if(this.method_654(primitive,node.name_657))
|
||||
if(this.§_-B8§(primitive,node.§_-Gm§))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(max > node.coord)
|
||||
{
|
||||
if(this.method_654(primitive,node.name_658))
|
||||
if(this.§_-B8§(primitive,node.§_-75§))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -477,13 +477,13 @@ package package_86
|
||||
return false;
|
||||
}
|
||||
|
||||
private function method_658(origin:name_194, dir:name_194, collisionMask:int, maxTime:Number, filter:name_631, result:name_273) : Boolean
|
||||
private function §_-eu§(origin:§_-bj§, dir:§_-bj§, collisionMask:int, maxTime:Number, filter:§_-jn§, result:§_-jr§) : Boolean
|
||||
{
|
||||
var tankPhysicsEntry:name_568 = null;
|
||||
var body:name_271 = null;
|
||||
var aabb:name_386 = null;
|
||||
var collisionPrimitiveListItem:name_513 = null;
|
||||
var primitive:name_235 = null;
|
||||
var tankPhysicsEntry:§_-YY§ = null;
|
||||
var body:§_-BV§ = null;
|
||||
var aabb:§_-FW§ = null;
|
||||
var collisionPrimitiveListItem:§_-4q§ = null;
|
||||
var primitive:§_-Nh§ = null;
|
||||
var t:Number = NaN;
|
||||
var xx:Number = origin.x + dir.x * maxTime;
|
||||
var yy:Number = origin.y + dir.y * maxTime;
|
||||
@@ -519,11 +519,11 @@ package package_86
|
||||
this._rayAABB.maxZ = zz;
|
||||
}
|
||||
var minTime:Number = maxTime + 1;
|
||||
for(var i:int = 0; i < this.var_593; i++)
|
||||
for(var i:int = 0; i < this.§_-LK§; i++)
|
||||
{
|
||||
tankPhysicsEntry = this.var_591[i];
|
||||
tankPhysicsEntry = this.§_-Wj§[i];
|
||||
body = tankPhysicsEntry.body;
|
||||
if(!(filter != null && !filter.name_664(body.collisionPrimitives.head.primitive)))
|
||||
if(!(filter != null && !filter.§_-0w§(body.collisionPrimitives.head.primitive)))
|
||||
{
|
||||
aabb = body.aabb;
|
||||
if(!(this._rayAABB.maxX < aabb.minX || this._rayAABB.minX > aabb.maxX || this._rayAABB.maxY < aabb.minY || this._rayAABB.minY > aabb.maxY || this._rayAABB.maxZ < aabb.minZ || this._rayAABB.minZ > aabb.maxZ))
|
||||
@@ -544,14 +544,14 @@ package package_86
|
||||
}
|
||||
else
|
||||
{
|
||||
t = primitive.raycast(origin,dir,this.threshold,this.var_594);
|
||||
t = Number(primitive.raycast(origin,dir,this.threshold,this.§_-k8§));
|
||||
if(t > 0 && t < minTime)
|
||||
{
|
||||
minTime = t;
|
||||
result.primitive = primitive;
|
||||
result.normal.x = this.var_594.x;
|
||||
result.normal.y = this.var_594.y;
|
||||
result.normal.z = this.var_594.z;
|
||||
result.normal.x = this.§_-k8§.x;
|
||||
result.normal.y = this.§_-k8§.y;
|
||||
result.normal.z = this.§_-k8§.z;
|
||||
}
|
||||
collisionPrimitiveListItem = collisionPrimitiveListItem.next;
|
||||
}
|
||||
@@ -571,7 +571,7 @@ package package_86
|
||||
return true;
|
||||
}
|
||||
|
||||
private function method_662(origin:name_194, dir:name_194, bb:name_386, time:MinMax) : Boolean
|
||||
private function §_-oL§(origin:§_-bj§, dir:§_-bj§, bb:§_-FW§, time:MinMax) : Boolean
|
||||
{
|
||||
var t1:Number = NaN;
|
||||
var t2:Number = NaN;
|
||||
@@ -648,15 +648,15 @@ package package_86
|
||||
return true;
|
||||
}
|
||||
|
||||
private function method_652(node:name_656, origin:name_194, localOrigin:name_194, dir:name_194, collisionMask:int, t1:Number, t2:Number, filter:name_631, result:name_273) : Boolean
|
||||
private function §_-NC§(node:§_-oZ§, origin:§_-bj§, localOrigin:§_-bj§, dir:§_-bj§, collisionMask:int, t1:Number, t2:Number, filter:§_-jn§, result:§_-jr§) : Boolean
|
||||
{
|
||||
var splitTime:Number = NaN;
|
||||
var currChildNode:name_656 = null;
|
||||
var currChildNode:§_-oZ§ = null;
|
||||
var intersects:Boolean = false;
|
||||
var splitNode:name_656 = null;
|
||||
var splitNode:§_-oZ§ = null;
|
||||
var i:int = 0;
|
||||
var primitive:name_235 = null;
|
||||
if(node.indices != null && this.method_660(origin,dir,collisionMask,this.var_592.name_661,node.indices,filter,result))
|
||||
var primitive:§_-Nh§ = null;
|
||||
if(node.indices != null && this.§_-FH§(origin,dir,collisionMask,this.§_-bw§.§_-8A§,node.indices,filter,result))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -675,7 +675,7 @@ package package_86
|
||||
{
|
||||
splitTime = (node.coord - origin.x) / dir.x;
|
||||
}
|
||||
currChildNode = localOrigin.x < node.coord ? node.name_657 : node.name_658;
|
||||
currChildNode = localOrigin.x < node.coord ? node.§_-Gm§ : node.§_-75§;
|
||||
break;
|
||||
case 1:
|
||||
if(dir.y > -this.threshold && dir.y < this.threshold)
|
||||
@@ -686,7 +686,7 @@ package package_86
|
||||
{
|
||||
splitTime = (node.coord - origin.y) / dir.y;
|
||||
}
|
||||
currChildNode = localOrigin.y < node.coord ? node.name_657 : node.name_658;
|
||||
currChildNode = localOrigin.y < node.coord ? node.§_-Gm§ : node.§_-75§;
|
||||
break;
|
||||
case 2:
|
||||
if(dir.z > -this.threshold && dir.z < this.threshold)
|
||||
@@ -697,35 +697,35 @@ package package_86
|
||||
{
|
||||
splitTime = (node.coord - origin.z) / dir.z;
|
||||
}
|
||||
currChildNode = localOrigin.z < node.coord ? node.name_657 : node.name_658;
|
||||
currChildNode = localOrigin.z < node.coord ? node.§_-Gm§ : node.§_-75§;
|
||||
}
|
||||
if(splitTime < t1 || splitTime > t2)
|
||||
{
|
||||
return this.method_652(currChildNode,origin,localOrigin,dir,collisionMask,t1,t2,filter,result);
|
||||
return this.§_-NC§(currChildNode,origin,localOrigin,dir,collisionMask,t1,t2,filter,result);
|
||||
}
|
||||
intersects = this.method_652(currChildNode,origin,localOrigin,dir,collisionMask,t1,splitTime,filter,result);
|
||||
intersects = this.§_-NC§(currChildNode,origin,localOrigin,dir,collisionMask,t1,splitTime,filter,result);
|
||||
if(intersects)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
this.var_590.x = origin.x + splitTime * dir.x;
|
||||
this.var_590.y = origin.y + splitTime * dir.y;
|
||||
this.var_590.z = origin.z + splitTime * dir.z;
|
||||
if(node.name_660 != null)
|
||||
this.§_-0q§.x = origin.x + splitTime * dir.x;
|
||||
this.§_-0q§.y = origin.y + splitTime * dir.y;
|
||||
this.§_-0q§.z = origin.z + splitTime * dir.z;
|
||||
if(node.§_-da§ != null)
|
||||
{
|
||||
splitNode = node.name_660.name_659;
|
||||
splitNode = node.§_-da§.§_-5H§;
|
||||
while(splitNode != null && splitNode.axis != -1)
|
||||
{
|
||||
switch(splitNode.axis)
|
||||
{
|
||||
case 0:
|
||||
splitNode = this.var_590.x < splitNode.coord ? splitNode.name_657 : splitNode.name_658;
|
||||
splitNode = this.§_-0q§.x < splitNode.coord ? splitNode.§_-Gm§ : splitNode.§_-75§;
|
||||
break;
|
||||
case 1:
|
||||
splitNode = this.var_590.y < splitNode.coord ? splitNode.name_657 : splitNode.name_658;
|
||||
splitNode = this.§_-0q§.y < splitNode.coord ? splitNode.§_-Gm§ : splitNode.§_-75§;
|
||||
break;
|
||||
case 2:
|
||||
splitNode = this.var_590.z < splitNode.coord ? splitNode.name_657 : splitNode.name_658;
|
||||
splitNode = this.§_-0q§.z < splitNode.coord ? splitNode.§_-Gm§ : splitNode.§_-75§;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -733,15 +733,15 @@ package package_86
|
||||
{
|
||||
for(i = splitNode.indices.length - 1; i >= 0; )
|
||||
{
|
||||
primitive = this.var_592.name_661[splitNode.indices[i]];
|
||||
primitive = this.§_-bw§.§_-8A§[splitNode.indices[i]];
|
||||
if((primitive.collisionGroup & collisionMask) != 0)
|
||||
{
|
||||
if(!(filter != null && !filter.name_664(primitive)))
|
||||
if(!(filter != null && !filter.§_-0w§(primitive)))
|
||||
{
|
||||
result.t = primitive.raycast(origin,dir,this.threshold,result.normal);
|
||||
if(result.t >= 0)
|
||||
{
|
||||
result.position.copy(this.var_590);
|
||||
result.position.copy(this.§_-0q§);
|
||||
result.primitive = primitive;
|
||||
return true;
|
||||
}
|
||||
@@ -751,12 +751,12 @@ package package_86
|
||||
}
|
||||
}
|
||||
}
|
||||
return this.method_652(currChildNode == node.name_657 ? node.name_658 : node.name_657,origin,this.var_590,dir,collisionMask,splitTime,t2,filter,result);
|
||||
return this.§_-NC§(currChildNode == node.§_-Gm§ ? node.§_-75§ : node.§_-Gm§,origin,this.§_-0q§,dir,collisionMask,splitTime,t2,filter,result);
|
||||
}
|
||||
|
||||
private function method_660(origin:name_194, dir:name_194, collisionMask:int, primitives:Vector.<name_235>, indices:Vector.<int>, filter:name_631, intersection:name_273) : Boolean
|
||||
private function §_-FH§(origin:§_-bj§, dir:§_-bj§, collisionMask:int, primitives:Vector.<§_-Nh§>, indices:Vector.<int>, filter:§_-jn§, intersection:§_-jr§) : Boolean
|
||||
{
|
||||
var primitive:name_235 = null;
|
||||
var primitive:§_-Nh§ = null;
|
||||
var t:Number = NaN;
|
||||
var pnum:int = int(indices.length);
|
||||
var minTime:Number = 1e+308;
|
||||
@@ -765,16 +765,16 @@ package package_86
|
||||
primitive = primitives[indices[i]];
|
||||
if((primitive.collisionGroup & collisionMask) != 0)
|
||||
{
|
||||
if(!(filter != null && !filter.name_664(primitive)))
|
||||
if(!(filter != null && !filter.§_-0w§(primitive)))
|
||||
{
|
||||
t = primitive.raycast(origin,dir,this.threshold,this.var_594);
|
||||
t = Number(primitive.raycast(origin,dir,this.threshold,this.§_-k8§));
|
||||
if(t > 0 && t < minTime)
|
||||
{
|
||||
minTime = t;
|
||||
intersection.primitive = primitive;
|
||||
intersection.normal.x = this.var_594.x;
|
||||
intersection.normal.y = this.var_594.y;
|
||||
intersection.normal.z = this.var_594.z;
|
||||
intersection.normal.x = this.§_-k8§.x;
|
||||
intersection.normal.y = this.§_-k8§.y;
|
||||
intersection.normal.z = this.§_-k8§.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -791,15 +791,15 @@ package package_86
|
||||
return true;
|
||||
}
|
||||
|
||||
private function method_663(body1:name_271, body2:name_271, contact:name_630) : name_630
|
||||
private function §_-Yu§(body1:§_-BV§, body2:§_-BV§, contact:§_-6h§) : §_-6h§
|
||||
{
|
||||
return this.method_661(body1.collisionPrimitives,body2.collisionPrimitives,contact);
|
||||
return this.§_-bO§(body1.collisionPrimitives,body2.collisionPrimitives,contact);
|
||||
}
|
||||
|
||||
private function method_661(primitives1:name_601, primitives2:name_601, contact:name_630) : name_630
|
||||
private function §_-bO§(primitives1:§_-G2§, primitives2:§_-G2§, contact:§_-6h§) : §_-6h§
|
||||
{
|
||||
var item2:name_513 = null;
|
||||
for(var item1:name_513 = primitives1.head; item1 != null; )
|
||||
var item2:§_-4q§ = null;
|
||||
for(var item1:§_-4q§ = primitives1.head; item1 != null; )
|
||||
{
|
||||
for(item2 = primitives2.head; item2 != null; )
|
||||
{
|
||||
118
src/?_-fj?/?_-1t?.as
Normal file
@@ -0,0 +1,118 @@
|
||||
package §_-fj§
|
||||
{
|
||||
import §_-Fc§.§_-8a§;
|
||||
import §_-az§.§_-AG§;
|
||||
import §_-fT§.§_-HM§;
|
||||
import §default§.native;
|
||||
|
||||
public class §_-1t§ extends §_-Cv§
|
||||
{
|
||||
private var §_-Cn§:ContactFilter;
|
||||
|
||||
public function §_-1t§(component:§_-cx§)
|
||||
{
|
||||
super(component);
|
||||
this.§_-Cn§ = new ContactFilter();
|
||||
}
|
||||
|
||||
override public function start(data:*) : void
|
||||
{
|
||||
var gameKernel:§_-AG§ = null;
|
||||
var physicsSystem:§_-8a§ = null;
|
||||
component.addToScene();
|
||||
component.setDetailedCollisionGroup(§_-HM§.TANK);
|
||||
component.setSuspensionCollisionMask(§_-HM§.STATIC);
|
||||
component.body.postCollisionFilter = this.§_-Cn§;
|
||||
var callback:native = native(data);
|
||||
if(callback != null)
|
||||
{
|
||||
gameKernel = component.gameKernel;
|
||||
this.§_-Cn§.initCallback(callback);
|
||||
gameKernel.getLogicSystem1().addLogicUnit(this.§_-Cn§);
|
||||
physicsSystem = gameKernel.§_-m8§();
|
||||
physicsSystem.addControllerAfter(this.§_-Cn§);
|
||||
physicsSystem.addControllerBefore(this.§_-Cn§);
|
||||
}
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
var gameKernel:§_-AG§ = null;
|
||||
var physicsSystem:§_-8a§ = null;
|
||||
component.body.postCollisionFilter = null;
|
||||
if(this.§_-Cn§.callback != null)
|
||||
{
|
||||
gameKernel = component.gameKernel;
|
||||
gameKernel.getLogicSystem1().removeLogicUnit(this.§_-Cn§);
|
||||
physicsSystem = gameKernel.§_-m8§();
|
||||
physicsSystem.removeControllerAfter(this.§_-Cn§);
|
||||
physicsSystem.removeControllerBefore(this.§_-Cn§);
|
||||
this.§_-Cn§.callback = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import §_-1e§.§_-p9§;
|
||||
import §_-Fc§.§catch§;
|
||||
import §_-US§.§_-BV§;
|
||||
import §_-lS§.§_-h2§;
|
||||
import §_-nO§.§_-KI§;
|
||||
import §default§.native;
|
||||
import flash.utils.getTimer;
|
||||
|
||||
class ContactFilter implements §_-p9§, §catch§, §_-KI§
|
||||
{
|
||||
private static const MIN_TRANSPARENCY_DURATION:int = 3000;
|
||||
|
||||
public var callback:native;
|
||||
|
||||
private var numContacts:int;
|
||||
|
||||
private var canActivate:Boolean;
|
||||
|
||||
private var startTime:int;
|
||||
|
||||
public function ContactFilter()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function initCallback(callback:native) : void
|
||||
{
|
||||
this.canActivate = false;
|
||||
this.startTime = getTimer();
|
||||
this.callback = callback;
|
||||
}
|
||||
|
||||
public function acceptBodiesCollision(body1:§_-BV§, body2:§_-BV§) : Boolean
|
||||
{
|
||||
++this.numContacts;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function updateBeforeSimulation(physicsStep:int) : void
|
||||
{
|
||||
this.numContacts = 0;
|
||||
}
|
||||
|
||||
public function updateAfterSimulation(physicsStep:int) : void
|
||||
{
|
||||
if(Boolean(this.canActivate) && this.numContacts == 0)
|
||||
{
|
||||
this.callback.§_-PH§();
|
||||
}
|
||||
}
|
||||
|
||||
public function interpolate(interpolationCoeff:Number) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function runLogic() : void
|
||||
{
|
||||
if(§_-h2§.time - this.startTime > MIN_TRANSPARENCY_DURATION)
|
||||
{
|
||||
this.canActivate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
688
src/?_-fj?/?_-cx?.as
Normal file
@@ -0,0 +1,688 @@
|
||||
package §_-fj§
|
||||
{
|
||||
import §_-1e§.§_-Nh§;
|
||||
import §_-78§.§_-GH§;
|
||||
import §_-78§.§_-M2§;
|
||||
import §_-7A§.§_-3e§;
|
||||
import §_-7A§.§_-Is§;
|
||||
import §_-7A§.§_-U-§;
|
||||
import §_-Fc§.§_-8a§;
|
||||
import §_-Fc§.§catch§;
|
||||
import §_-KA§.§_-FW§;
|
||||
import §_-MU§.§_-5-§;
|
||||
import §_-US§.§_-BV§;
|
||||
import §_-US§.§_-DB§;
|
||||
import §_-US§.§_-kG§;
|
||||
import §_-Uy§.§_-oP§;
|
||||
import §_-az§.§_-2J§;
|
||||
import §_-az§.§_-AG§;
|
||||
import §_-az§.§_-Ss§;
|
||||
import §_-fT§.§_-HM§;
|
||||
import §_-fT§.§_-WY§;
|
||||
import §_-fT§.§_-YY§;
|
||||
import §_-fT§.§_-Zm§;
|
||||
import §_-lS§.§_-h2§;
|
||||
import §_-nl§.Matrix3;
|
||||
import §_-nl§.Matrix4;
|
||||
import §_-nl§.§_-Ok§;
|
||||
import §_-nl§.§_-bj§;
|
||||
import §_-pe§.§_-m3§;
|
||||
import §default§.§_-BH§;
|
||||
import §default§.§_-dT§;
|
||||
import §default§.§_-kU§;
|
||||
|
||||
public class §_-cx§ extends §_-2J§ implements §catch§, §_-Is§, §_-BH§
|
||||
{
|
||||
private static var lastId:int;
|
||||
|
||||
private static const RAY_OFFSET:Number = 5;
|
||||
|
||||
private static var _v:§_-bj§ = new §_-bj§();
|
||||
|
||||
public var gameKernel:§_-AG§;
|
||||
|
||||
public var body:§_-BV§;
|
||||
|
||||
public var §_-Ei§:§_-nL§;
|
||||
|
||||
public var §_-iA§:§_-nL§;
|
||||
|
||||
public var maxSpeed:Number = 0;
|
||||
|
||||
private var §_-fL§:ValueSmoother = new ValueSmoother(100,1000,0,0);
|
||||
|
||||
public var maxTurnSpeed:Number = 0;
|
||||
|
||||
private var §_-dr§:ValueSmoother = new ValueSmoother(0.3,10,0,0);
|
||||
|
||||
private var §_-mt§:Number = 0;
|
||||
|
||||
private var §_-JJ§:Number = 0;
|
||||
|
||||
private var §_-Tb§:Boolean;
|
||||
|
||||
private var §_-mq§:Boolean;
|
||||
|
||||
private var §_-DC§:Vector.<§_-Nh§>;
|
||||
|
||||
public var §_-i1§:Vector.<§_-Nh§>;
|
||||
|
||||
public var §_-4Y§:Vector.<§_-Nh§>;
|
||||
|
||||
public var §_-bi§:§_-bj§ = new §_-bj§();
|
||||
|
||||
public var §_-UQ§:§_-Ok§ = new §_-Ok§();
|
||||
|
||||
public var §_-YH§:Matrix4 = new Matrix4();
|
||||
|
||||
public var §_-CF§:§_-8C§ = new §_-8C§();
|
||||
|
||||
public var moveDirection:int;
|
||||
|
||||
public var turnDirection:int;
|
||||
|
||||
private var hull:§_-dT§;
|
||||
|
||||
private var §_-Rg§:§_-YY§;
|
||||
|
||||
private var §_-z§:§_-M2§;
|
||||
|
||||
private var §case §:Boolean;
|
||||
|
||||
private var turret:§_-3e§;
|
||||
|
||||
private var §_-CG§:Vector.<§_-bj§>;
|
||||
|
||||
private var mass:Number = 1;
|
||||
|
||||
private var power:Number = 0;
|
||||
|
||||
private var reverseBackTurn:Boolean;
|
||||
|
||||
public function §_-cx§(hull:§_-dT§, mass:Number, power:Number)
|
||||
{
|
||||
super();
|
||||
this.mass = mass;
|
||||
this.power = power;
|
||||
this.§_-CG§ = new Vector.<§_-bj§>();
|
||||
this.body = new §_-BV§(1,Matrix3.IDENTITY);
|
||||
this.body.id = lastId++;
|
||||
this.§_-DC§ = new Vector.<§_-Nh§>();
|
||||
this.§_-4Y§ = new Vector.<§_-Nh§>();
|
||||
this.§_-i1§ = new Vector.<§_-Nh§>();
|
||||
this.§_-Rg§ = new §_-YY§(this.body,this.§_-i1§,this.§_-4Y§);
|
||||
this.§_-Uj§(hull);
|
||||
}
|
||||
|
||||
public function §_-P0§() : Vector.<§_-bj§>
|
||||
{
|
||||
return this.§_-CG§;
|
||||
}
|
||||
|
||||
public function getBody() : §_-BV§
|
||||
{
|
||||
return this.body;
|
||||
}
|
||||
|
||||
public function §_-Ln§(wheelName:String) : Number
|
||||
{
|
||||
var lastHitLength:Number = this.§_-Ei§.§_-fG§(wheelName,this.§_-CF§.rayLength);
|
||||
if(lastHitLength < 0)
|
||||
{
|
||||
lastHitLength = this.§_-iA§.§_-fG§(wheelName,this.§_-CF§.rayLength);
|
||||
}
|
||||
if(lastHitLength < 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return this.§_-CF§.§_-Fw§ - lastHitLength;
|
||||
}
|
||||
|
||||
public function §_-Ra§() : Number
|
||||
{
|
||||
return this.§_-Ei§.§_-gt§;
|
||||
}
|
||||
|
||||
public function §_-8p§() : Number
|
||||
{
|
||||
return this.§_-iA§.§_-gt§;
|
||||
}
|
||||
|
||||
public function §_-Uj§(hull:§_-dT§) : void
|
||||
{
|
||||
if(hull == null)
|
||||
{
|
||||
throw new ArgumentError("Parameter hull is null");
|
||||
}
|
||||
if(this.hull == hull)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.hull = hull;
|
||||
this.§_-21§(hull.§_-AE§,this.§_-DC§,§_-HM§.TANK,§_-HM§.TANK | §_-HM§.STATIC);
|
||||
this.§_-21§(hull.§_-KR§,this.§_-i1§,§_-HM§.TANK,§_-HM§.TANK);
|
||||
if(this.turret != null)
|
||||
{
|
||||
this.turret.setTurretMountPoint(hull.§_-Rj§);
|
||||
}
|
||||
this.§_-I3§();
|
||||
this.§_-Y2§();
|
||||
var rayZ:Number = this.§_-EQ§();
|
||||
this.setSuspensionCollisionMask(§_-HM§.TANK | §_-HM§.STATIC);
|
||||
this.§_-CF§.rayLength = 75;
|
||||
this.§_-CF§.§_-Fw§ = rayZ - hull.§_-Sh§.z;
|
||||
this.§_-CF§.§_-WZ§ = 1000;
|
||||
this.body.material.§_-J1§ = 0.1;
|
||||
this.setChassisControls(this.moveDirection,this.turnDirection,true);
|
||||
var bb:§_-FW§ = new §_-FW§();
|
||||
this.calculateBoundBox(bb);
|
||||
this.§_-JA§(bb);
|
||||
}
|
||||
|
||||
public function §_-Gu§(value:Number, immediate:Boolean) : void
|
||||
{
|
||||
if(immediate)
|
||||
{
|
||||
this.maxTurnSpeed = value;
|
||||
this.§_-dr§.reset(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.§_-dr§.targetValue = value;
|
||||
}
|
||||
}
|
||||
|
||||
public function §_-la§(value:Number, immediate:Boolean) : void
|
||||
{
|
||||
if(immediate)
|
||||
{
|
||||
this.maxSpeed = value;
|
||||
this.§_-fL§.reset(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.§_-fL§.targetValue = value;
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-EQ§() : Number
|
||||
{
|
||||
var matrix:Matrix4 = new Matrix4();
|
||||
matrix.§_-Vi§(this.hull.§_-Sh§);
|
||||
this.§_-Ei§ = new §_-nL§(this.body,matrix,this.hull.§_-EY§);
|
||||
this.§_-iA§ = new §_-nL§(this.body,matrix,this.hull.§_-M4§);
|
||||
return this.§_-Ei§.rays[0].getRelativeZ();
|
||||
}
|
||||
|
||||
private function §_-Y2§() : void
|
||||
{
|
||||
var dimensions:§_-bj§ = null;
|
||||
var xx:Number = NaN;
|
||||
var yy:Number = NaN;
|
||||
var zz:Number = NaN;
|
||||
if(this.mass == Infinity)
|
||||
{
|
||||
this.body.invMass = 0;
|
||||
this.body.invInertia.copy(Matrix3.ZERO);
|
||||
}
|
||||
else
|
||||
{
|
||||
dimensions = this.hull.§_-eh§.hs.clone();
|
||||
dimensions.scale(2);
|
||||
this.body.invMass = 1 / this.mass;
|
||||
xx = dimensions.x * dimensions.x;
|
||||
yy = dimensions.y * dimensions.y;
|
||||
zz = dimensions.z * dimensions.z;
|
||||
this.body.invInertia.a = 12 * this.body.invMass / (yy + zz);
|
||||
this.body.invInertia.f = 12 * this.body.invMass / (zz + xx);
|
||||
this.body.invInertia.k = 12 * this.body.invMass / (xx + yy);
|
||||
}
|
||||
}
|
||||
|
||||
private function calculateBoundBox(boundBox:§_-FW§) : void
|
||||
{
|
||||
var collisionPrimitive:§_-Nh§ = null;
|
||||
var primitiveTransform:Matrix4 = null;
|
||||
boundBox.§_-GT§();
|
||||
for each(collisionPrimitive in this.§_-DC§)
|
||||
{
|
||||
primitiveTransform = collisionPrimitive.transform;
|
||||
collisionPrimitive.transform = collisionPrimitive.localTransform || Matrix4.IDENTITY;
|
||||
boundBox.§_-EH§(collisionPrimitive.calculateAABB());
|
||||
collisionPrimitive.transform = primitiveTransform;
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-JA§(boundBox:§_-FW§) : void
|
||||
{
|
||||
var z:int = (boundBox.maxZ - boundBox.minZ) / 2;
|
||||
this.§_-Ud§(0,boundBox.maxX,boundBox.maxY,z);
|
||||
this.§_-Ud§(1,boundBox.minX,boundBox.maxY,z);
|
||||
this.§_-Ud§(2,boundBox.minX,boundBox.minY,z);
|
||||
this.§_-Ud§(3,boundBox.maxX,boundBox.minY,z);
|
||||
}
|
||||
|
||||
private function §_-Ud§(index:int, x:Number, y:Number, z:Number) : void
|
||||
{
|
||||
var point:§_-bj§ = null;
|
||||
var clientLog:§_-5-§ = null;
|
||||
clientLog = §_-5-§(§_-oP§.§_-nQ§().§_-N6§(§_-5-§));
|
||||
clientLog.log("tank","LegacyTrackedChassisComponent::setBoundPoint() point %1: %2, %3, %4",index,x.toFixed(2),y.toFixed(2),z.toFixed(2));
|
||||
if(index < this.§_-CG§.length)
|
||||
{
|
||||
point = this.§_-CG§[index];
|
||||
}
|
||||
if(point == null)
|
||||
{
|
||||
point = new §_-bj§();
|
||||
this.§_-CG§[index] = point;
|
||||
}
|
||||
point.reset(x,y,z);
|
||||
}
|
||||
|
||||
public function §_-I3§() : void
|
||||
{
|
||||
var collisionPrimitive:§_-Nh§ = null;
|
||||
var turretPrimitives:Vector.<§_-Nh§> = null;
|
||||
if(this.body.collisionPrimitives != null)
|
||||
{
|
||||
this.body.collisionPrimitives.clear();
|
||||
}
|
||||
this.§_-y§(this.§_-DC§);
|
||||
this.§_-y§(this.§_-i1§);
|
||||
this.§_-4Y§.length = 0;
|
||||
for each(collisionPrimitive in this.§_-DC§)
|
||||
{
|
||||
this.§_-4Y§.push(collisionPrimitive);
|
||||
}
|
||||
if(this.turret != null)
|
||||
{
|
||||
turretPrimitives = this.turret.getTurretPrimitives();
|
||||
this.§_-y§(turretPrimitives);
|
||||
for each(collisionPrimitive in turretPrimitives)
|
||||
{
|
||||
this.§_-4Y§.push(collisionPrimitive);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function §_-JK§(velocity:§_-bj§) : void
|
||||
{
|
||||
this.body.§_-8g§(velocity);
|
||||
}
|
||||
|
||||
public function §_-VU§(velocity:§_-bj§) : void
|
||||
{
|
||||
this.body.§_-6F§(velocity);
|
||||
}
|
||||
|
||||
public function §_-LV§(orientation:§_-Ok§) : void
|
||||
{
|
||||
this.body.§_-LV§(orientation);
|
||||
}
|
||||
|
||||
public function §_-oa§(x:Number, y:Number, z:Number) : void
|
||||
{
|
||||
this.body.§_-oa§(x,y,z);
|
||||
}
|
||||
|
||||
public function §_-83§(w:Number, x:Number, y:Number, z:Number) : void
|
||||
{
|
||||
this.body.§_-83§(w,x,y,z);
|
||||
}
|
||||
|
||||
public function §_-C3§(x:Number, y:Number, z:Number) : void
|
||||
{
|
||||
var w:Number = 1 - x * x - y * y - z * z;
|
||||
this.body.§_-83§(w < 0 ? 0 : Number(Math.sqrt(w)),x,y,z);
|
||||
}
|
||||
|
||||
public function setLinearVelocityXYZ(x:Number, y:Number, z:Number) : void
|
||||
{
|
||||
this.body.§_-7q§(x,y,z);
|
||||
}
|
||||
|
||||
public function setAngularVelocityXYZ(x:Number, y:Number, z:Number) : void
|
||||
{
|
||||
this.body.§_-U4§(x,y,z);
|
||||
}
|
||||
|
||||
public function §_-Vi§(position:§_-bj§) : void
|
||||
{
|
||||
this.body.§_-Vi§(position);
|
||||
}
|
||||
|
||||
public function §_-eS§() : void
|
||||
{
|
||||
this.body.§use§();
|
||||
}
|
||||
|
||||
private function §_-Er§(throttleLeft:Number, throttleRight:Number) : void
|
||||
{
|
||||
this.§_-mt§ = throttleLeft;
|
||||
this.§_-JJ§ = throttleRight;
|
||||
}
|
||||
|
||||
private function § get§(lb:Boolean, rb:Boolean) : void
|
||||
{
|
||||
this.§_-Tb§ = lb;
|
||||
this.§_-mq§ = rb;
|
||||
}
|
||||
|
||||
public function setChassisControls(moveDirection:int, turnDirection:int, reverseBackTurn:Boolean, force:Boolean = false) : Boolean
|
||||
{
|
||||
var throttle:Number = NaN;
|
||||
var throttleLeft:Number = NaN;
|
||||
var throttleRight:Number = NaN;
|
||||
var k:Number = NaN;
|
||||
turnDirection = -turnDirection;
|
||||
if(force || this.moveDirection != moveDirection || this.turnDirection != turnDirection)
|
||||
{
|
||||
this.moveDirection = moveDirection;
|
||||
this.turnDirection = turnDirection;
|
||||
this.reverseBackTurn = reverseBackTurn;
|
||||
throttle = this.power;
|
||||
throttleLeft = moveDirection * throttle;
|
||||
throttleRight = moveDirection * throttle;
|
||||
if(moveDirection == 0)
|
||||
{
|
||||
this.§ get§(false,false);
|
||||
k = 0.8;
|
||||
throttleLeft -= turnDirection * throttle * k;
|
||||
throttleRight += turnDirection * throttle * k;
|
||||
}
|
||||
else
|
||||
{
|
||||
k = 0.4;
|
||||
if(moveDirection == 1)
|
||||
{
|
||||
this.§ get§(turnDirection == 1,turnDirection == -1);
|
||||
if(turnDirection == 1)
|
||||
{
|
||||
throttleLeft -= throttle * k;
|
||||
}
|
||||
if(turnDirection == -1)
|
||||
{
|
||||
throttleRight -= throttle * k;
|
||||
}
|
||||
}
|
||||
else if(reverseBackTurn)
|
||||
{
|
||||
this.§ get§(turnDirection == -1,turnDirection == 1);
|
||||
if(turnDirection == -1)
|
||||
{
|
||||
throttleLeft += throttle * k;
|
||||
}
|
||||
if(turnDirection == 1)
|
||||
{
|
||||
throttleRight += throttle * k;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.§ get§(turnDirection == 1,turnDirection == -1);
|
||||
if(turnDirection == 1)
|
||||
{
|
||||
throttleLeft += throttle * k;
|
||||
}
|
||||
if(turnDirection == -1)
|
||||
{
|
||||
throttleRight += throttle * k;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.§_-Er§(throttleLeft,throttleRight);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
override public function addToGame(gameKernel:§_-AG§) : void
|
||||
{
|
||||
this.gameKernel = gameKernel;
|
||||
}
|
||||
|
||||
override public function removeFromGame(gameKernel:§_-AG§) : void
|
||||
{
|
||||
this.§_-z§.§_-Ah§.stop();
|
||||
this.removeFromScene();
|
||||
gameKernel = null;
|
||||
}
|
||||
|
||||
override public function initComponent() : void
|
||||
{
|
||||
§_-U-§(entity.getComponentStrict(§_-U-§)).§_-Ea§(this);
|
||||
this.§_-I3§();
|
||||
this.§_-z§ = new §_-M2§();
|
||||
var respawnState:§_-Gg§ = new §_-Gg§(this);
|
||||
this.§_-z§.§_-W§(entity,§_-kU§.SET_RESPAWN_STATE,respawnState);
|
||||
this.§_-z§.§_-W§(entity,§_-kU§.SET_ACTIVATING_STATE,new §_-1t§(this));
|
||||
this.§_-z§.§_-W§(entity,§_-kU§.SET_ACTIVE_STATE,new §_-Wz§(this));
|
||||
this.§_-z§.§_-W§(entity,§_-kU§.SET_DEAD_STATE,new §_-0N§(this));
|
||||
this.§_-z§.§_-Ah§ = §_-GH§.INSTANCE;
|
||||
entity.addEventHandler(§_-Ss§.BATTLE_FINISHED,this.§_-7L§);
|
||||
}
|
||||
|
||||
public function §_-pB§(point:§_-bj§) : void
|
||||
{
|
||||
point.copy(this.hull.§_-EN§);
|
||||
}
|
||||
|
||||
public function §_-Cd§() : Matrix4
|
||||
{
|
||||
return this.§_-YH§;
|
||||
}
|
||||
|
||||
public function setTurret(turret:§_-3e§) : void
|
||||
{
|
||||
this.turret = turret;
|
||||
if(turret != null)
|
||||
{
|
||||
this.§_-I3§();
|
||||
}
|
||||
}
|
||||
|
||||
public function §_-Cj§(point:§_-bj§) : void
|
||||
{
|
||||
point.copy(this.hull.§_-Rj§);
|
||||
}
|
||||
|
||||
public function updateBeforeSimulation(physicsStep:int) : void
|
||||
{
|
||||
var d:Number = NaN;
|
||||
var limit:Number = NaN;
|
||||
var dt:Number = Number(§_-h2§.timeDeltaSeconds);
|
||||
if(this.maxSpeed != this.§_-fL§.targetValue)
|
||||
{
|
||||
this.maxSpeed = this.§_-fL§.update(dt);
|
||||
}
|
||||
if(this.maxTurnSpeed != this.§_-dr§.targetValue)
|
||||
{
|
||||
this.maxTurnSpeed = this.§_-dr§.update(dt);
|
||||
}
|
||||
var slipTerm:int = this.§_-mt§ > this.§_-JJ§ ? -1 : (this.§_-mt§ < this.§_-JJ§ ? 1 : 0);
|
||||
var world:§_-DB§ = this.body.scene;
|
||||
var weight:Number = this.mass * world.§_-MX§.length();
|
||||
var k:Number = this.§_-mt§ != this.§_-JJ§ && !(this.§_-Tb§ || this.§_-mq§) && this.body.state.rotation.length() > this.maxTurnSpeed ? 0.1 : 1;
|
||||
this.§_-Ei§.§_-HQ§(dt,k * this.§_-mt§,this.maxSpeed,slipTerm,weight,this.§_-CF§,this.§_-Tb§);
|
||||
this.§_-iA§.§_-HQ§(dt,k * this.§_-JJ§,this.maxSpeed,slipTerm,weight,this.§_-CF§,this.§_-mq§);
|
||||
var baseMatrix:Matrix3 = this.body.baseMatrix;
|
||||
if(this.§_-iA§.§_-Ca§ >= this.§_-iA§.numRays >> 1 || this.§_-Ei§.§_-Ca§ >= this.§_-Ei§.numRays >> 1)
|
||||
{
|
||||
d = world.§_-MX§.x * baseMatrix.c + world.§_-MX§.y * baseMatrix.g + world.§_-MX§.z * baseMatrix.k;
|
||||
limit = Math.SQRT1_2 * world.§_-MX§.length();
|
||||
if(d < -limit || d > limit)
|
||||
{
|
||||
_v.x = (baseMatrix.c * d - world.§_-MX§.x) * this.mass;
|
||||
_v.y = (baseMatrix.g * d - world.§_-MX§.y) * this.mass;
|
||||
_v.z = (baseMatrix.k * d - world.§_-MX§.z) * this.mass;
|
||||
this.body.§_-Qy§(_v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function updateAfterSimulation(physicsStep:int) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function interpolate(interpolationCoeff:Number) : void
|
||||
{
|
||||
this.body.interpolate(interpolationCoeff,this.§_-bi§,this.§_-UQ§);
|
||||
this.§_-UQ§.normalize();
|
||||
this.§_-UQ§.toMatrix4(this.§_-YH§);
|
||||
this.§_-YH§.§_-Vi§(this.§_-bi§);
|
||||
}
|
||||
|
||||
public function §_-5l§(mask:int) : void
|
||||
{
|
||||
for(var i:int = 0; i < this.§_-i1§.length; i++)
|
||||
{
|
||||
this.§_-i1§[i].collisionMask = mask;
|
||||
}
|
||||
}
|
||||
|
||||
public function setDetailedCollisionGroup(collisionGroup:int) : void
|
||||
{
|
||||
var collisionPrimitive:§_-Nh§ = null;
|
||||
for each(collisionPrimitive in this.§_-DC§)
|
||||
{
|
||||
collisionPrimitive.collisionGroup = collisionGroup;
|
||||
}
|
||||
if(this.turret != null)
|
||||
{
|
||||
for each(collisionPrimitive in this.turret.getTurretPrimitives())
|
||||
{
|
||||
collisionPrimitive.collisionGroup = collisionGroup;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function setSuspensionCollisionMask(collisionMask:int) : void
|
||||
{
|
||||
this.§_-Ei§.collisionMask = collisionMask;
|
||||
this.§_-iA§.collisionMask = collisionMask;
|
||||
}
|
||||
|
||||
public function addToScene() : void
|
||||
{
|
||||
var physicsSystem:§_-8a§ = null;
|
||||
var physicsScene:§_-DB§ = null;
|
||||
var collisionDetector:§_-Zm§ = null;
|
||||
if(!this.§case §)
|
||||
{
|
||||
physicsSystem = this.gameKernel.§_-m8§();
|
||||
physicsScene = physicsSystem.§_-d-§();
|
||||
collisionDetector = §_-Zm§(physicsScene.collisionDetector);
|
||||
physicsScene.§_-D8§(this.body);
|
||||
collisionDetector.§_-pN§(this.§_-Rg§);
|
||||
physicsSystem.addControllerBefore(this);
|
||||
this.§case § = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function removeFromScene() : void
|
||||
{
|
||||
var physicsSystem:§_-8a§ = null;
|
||||
var physicsScene:§_-DB§ = null;
|
||||
var collisionDetector:§_-Zm§ = null;
|
||||
if(this.§case §)
|
||||
{
|
||||
physicsSystem = this.gameKernel.§_-m8§();
|
||||
physicsScene = physicsSystem.§_-d-§();
|
||||
collisionDetector = §_-Zm§(physicsScene.collisionDetector);
|
||||
physicsScene.§_-2x§(this.body);
|
||||
collisionDetector.§_-qP§(this.§_-Rg§);
|
||||
physicsSystem.removeControllerBefore(this);
|
||||
this.§case § = false;
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-Nr§(value:Number) : void
|
||||
{
|
||||
if(value <= 0)
|
||||
{
|
||||
throw new ArgumentError("Mass must have a positive value");
|
||||
}
|
||||
this.body.invMass = 1 / value;
|
||||
if(this.hull != null)
|
||||
{
|
||||
§_-kG§.§_-Il§(value,this.hull.§_-eh§.hs,this.body.invInertia);
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-21§(geometryData:Vector.<§_-WY§>, primitives:Vector.<§_-Nh§>, collisionGroup:int, collisionMask:int) : void
|
||||
{
|
||||
var boxData:§_-WY§ = null;
|
||||
var primitive:§_-m3§ = null;
|
||||
primitives.length = 0;
|
||||
for each(boxData in geometryData)
|
||||
{
|
||||
primitive = new §_-m3§(boxData.hs,collisionGroup,collisionMask);
|
||||
primitive.localTransform = boxData.matrix.clone();
|
||||
primitive.body = this.body;
|
||||
primitives.push(primitive);
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-y§(primitives:Vector.<§_-Nh§>) : void
|
||||
{
|
||||
var collisionPrimitive:§_-Nh§ = null;
|
||||
for each(collisionPrimitive in primitives)
|
||||
{
|
||||
this.body.§_-jH§(collisionPrimitive,collisionPrimitive.localTransform);
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-7L§(gameType:String, gameData:*) : void
|
||||
{
|
||||
this.setChassisControls(0,0,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ValueSmoother
|
||||
{
|
||||
public var currentValue:Number;
|
||||
|
||||
public var targetValue:Number;
|
||||
|
||||
public var smoothingSpeedUp:Number;
|
||||
|
||||
public var smoothingSpeedDown:Number;
|
||||
|
||||
public function ValueSmoother(smoothingSpeedUp:Number, smoothingSpeedDown:Number, targetValue:Number, currentValue:Number)
|
||||
{
|
||||
super();
|
||||
this.smoothingSpeedUp = smoothingSpeedUp;
|
||||
this.smoothingSpeedDown = smoothingSpeedDown;
|
||||
this.targetValue = targetValue;
|
||||
this.currentValue = currentValue;
|
||||
}
|
||||
|
||||
public function reset(value:Number) : void
|
||||
{
|
||||
this.currentValue = value;
|
||||
this.targetValue = value;
|
||||
}
|
||||
|
||||
public function update(dt:Number) : Number
|
||||
{
|
||||
if(this.currentValue < this.targetValue)
|
||||
{
|
||||
this.currentValue += this.smoothingSpeedUp * dt;
|
||||
if(this.currentValue > this.targetValue)
|
||||
{
|
||||
this.currentValue = this.targetValue;
|
||||
}
|
||||
}
|
||||
else if(this.currentValue > this.targetValue)
|
||||
{
|
||||
this.currentValue -= this.smoothingSpeedDown * dt;
|
||||
if(this.currentValue < this.targetValue)
|
||||
{
|
||||
this.currentValue = this.targetValue;
|
||||
}
|
||||
}
|
||||
return this.currentValue;
|
||||
}
|
||||
}
|
||||
151
src/?_-fj?/?_-nL?.as
Normal file
@@ -0,0 +1,151 @@
|
||||
package §_-fj§
|
||||
{
|
||||
import §_-KT§.§_-Ju§;
|
||||
import §_-US§.§_-BV§;
|
||||
import §_-V-§.§_-aY§;
|
||||
import §_-nl§.Matrix4;
|
||||
import §_-nl§.§_-bj§;
|
||||
import §default§.§_-49§;
|
||||
|
||||
public class §_-nL§
|
||||
{
|
||||
private static var conSpeedDamping:§_-Ju§ = new §_-Ju§("track_damping",0,0,1000);
|
||||
|
||||
public var chassisBody:§_-BV§;
|
||||
|
||||
public var rays:Vector.<§_-gd§>;
|
||||
|
||||
public var numRays:int;
|
||||
|
||||
public var §_-Ca§:int;
|
||||
|
||||
public var §_-gt§:Number = 0;
|
||||
|
||||
private var §_-Ce§:Object;
|
||||
|
||||
public function §_-nL§(chassisBody:§_-BV§, matrix:Matrix4, wheels:Vector.<§_-49§>)
|
||||
{
|
||||
super();
|
||||
this.chassisBody = chassisBody;
|
||||
this.§_-TD§(matrix,wheels);
|
||||
}
|
||||
|
||||
public function set collisionMask(value:int) : void
|
||||
{
|
||||
for(var i:int = 0; i < this.numRays; i++)
|
||||
{
|
||||
§_-gd§(this.rays[i]).collisionMask = value;
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-eO§(tankWheel:§_-49§) : Boolean
|
||||
{
|
||||
var parts:Array = tankWheel.name.split("_");
|
||||
return parts[1] == "1";
|
||||
}
|
||||
|
||||
public function §_-TD§(matrix:Matrix4, wheels:Vector.<§_-49§>) : void
|
||||
{
|
||||
var position:§_-bj§;
|
||||
var i:int;
|
||||
var tankWheel:§_-49§ = null;
|
||||
var mainWheel:§_-49§ = null;
|
||||
var ray:§_-gd§ = null;
|
||||
var mainWheels:Vector.<§_-49§> = new Vector.<§_-49§>();
|
||||
for each(tankWheel in wheels)
|
||||
{
|
||||
if(this.§_-eO§(tankWheel))
|
||||
{
|
||||
mainWheels.push(tankWheel);
|
||||
}
|
||||
}
|
||||
if(mainWheels.length == 0)
|
||||
{
|
||||
throw new Error("No main wheels found");
|
||||
}
|
||||
mainWheels.sort(function(a:§_-49§, b:§_-49§):Number
|
||||
{
|
||||
if(a.position.y > b.position.y)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if(a.position.y < b.position.y)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
this.§_-Ce§ = {};
|
||||
this.numRays = mainWheels.length;
|
||||
this.rays = new Vector.<§_-gd§>(this.numRays);
|
||||
position = new §_-bj§();
|
||||
for(i = 0; i < this.numRays; i++)
|
||||
{
|
||||
mainWheel = mainWheels[i];
|
||||
matrix.§_-eP§(mainWheel.position,position);
|
||||
ray = new §_-gd§(this.chassisBody,position,new §_-bj§(0,0,-1));
|
||||
this.rays[i] = ray;
|
||||
this.§_-Ce§[mainWheel.name] = ray;
|
||||
}
|
||||
}
|
||||
|
||||
public function §_-fG§(name:String, maxRayLength:Number) : Number
|
||||
{
|
||||
var ray:§_-gd§ = this.§_-Ce§[name];
|
||||
if(ray == null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return !!ray.§_-n3§ ? Number(ray.§_-ZA§.t) : maxRayLength;
|
||||
}
|
||||
|
||||
public function §_-HQ§(dt:Number, throttle:Number, maxSpeed:Number, slipTerm:int, weight:Number, data:§_-8C§, brake:Boolean) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var springCoeff:Number = NaN;
|
||||
var mid:int = 0;
|
||||
var ray:§_-gd§ = null;
|
||||
this.§_-Ca§ = 0;
|
||||
for(i = 0; i < this.numRays; )
|
||||
{
|
||||
if(§_-gd§(this.rays[i]).§_-1l§(data.rayLength))
|
||||
{
|
||||
++this.§_-Ca§;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(this.§_-Ca§ > 0)
|
||||
{
|
||||
this.§_-gt§ = 0;
|
||||
springCoeff = 0.5 * weight / (this.§_-Ca§ * (data.rayLength - data.§_-Fw§));
|
||||
throttle *= this.numRays / this.§_-Ca§;
|
||||
mid = this.numRays >> 1;
|
||||
if(Boolean(this.numRays & 1 == 0))
|
||||
{
|
||||
for(i = 0; i < this.numRays; i++)
|
||||
{
|
||||
ray = this.rays[i];
|
||||
ray.§_-Qy§(dt,throttle,maxSpeed,i <= mid ? slipTerm : int(-slipTerm),springCoeff,data,brake);
|
||||
this.§_-gt§ += ray.§_-bv§;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(i = 0; i < this.numRays; )
|
||||
{
|
||||
ray = this.rays[i];
|
||||
ray.§_-Qy§(dt,throttle,maxSpeed,i < mid ? slipTerm : (i > mid ? int(-slipTerm) : 0),springCoeff,data,brake);
|
||||
this.§_-gt§ += ray.§_-bv§;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
this.§_-gt§ /= this.§_-Ca§;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.§_-gt§ = §_-aY§.§_-Fi§(this.§_-gt§,0,conSpeedDamping.value * dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package package_93
|
||||
package §_-ks§
|
||||
{
|
||||
import §_-az§.§_-ps§;
|
||||
import flash.display.DisplayObjectContainer;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.TimerEvent;
|
||||
import flash.utils.Timer;
|
||||
import flash.utils.getTimer;
|
||||
import alternativa.tanks.game.GameTask;
|
||||
|
||||
public class name_294 extends GameTask
|
||||
public class §_-ig§ extends §_-ps§
|
||||
{
|
||||
private static const MESSAGE_SPACING_Y:int = 19;
|
||||
|
||||
@@ -15,57 +15,57 @@ package package_93
|
||||
|
||||
private var maxMessagesNumber:int;
|
||||
|
||||
private var var_436:Sprite;
|
||||
private var §_-pQ§:Sprite;
|
||||
|
||||
private var var_435:Vector.<Message>;
|
||||
private var §_-cd§:Vector.<Message>;
|
||||
|
||||
private var timer:Timer;
|
||||
|
||||
public function name_294(priority:int, maxMessagesNumber:int, container:DisplayObjectContainer, messagesX:int, messagesY:int)
|
||||
public function §_-ig§(priority:int, maxMessagesNumber:int, container:DisplayObjectContainer, messagesX:int, messagesY:int)
|
||||
{
|
||||
super(priority);
|
||||
this.maxMessagesNumber = maxMessagesNumber;
|
||||
this.var_436 = new Sprite();
|
||||
this.var_436.x = messagesX;
|
||||
this.var_436.y = messagesY;
|
||||
container.addChild(this.var_436);
|
||||
this.var_435 = new Vector.<Message>();
|
||||
this.§_-pQ§ = new Sprite();
|
||||
this.§_-pQ§.x = messagesX;
|
||||
this.§_-pQ§.y = messagesY;
|
||||
container.addChild(this.§_-pQ§);
|
||||
this.§_-cd§ = new Vector.<Message>();
|
||||
this.timer = new Timer(1000);
|
||||
this.timer.addEventListener(TimerEvent.TIMER,this.method_391);
|
||||
this.timer.addEventListener(TimerEvent.TIMER,this.§_-Zt§);
|
||||
}
|
||||
|
||||
public function set messagesX(value:int) : void
|
||||
{
|
||||
this.var_436.x = value;
|
||||
this.§_-pQ§.x = value;
|
||||
}
|
||||
|
||||
public function set messagesY(value:int) : void
|
||||
{
|
||||
this.var_436.y = value;
|
||||
this.§_-pQ§.y = value;
|
||||
}
|
||||
|
||||
public function name_305(text:String, color:uint) : void
|
||||
public function §_-U8§(text:String, color:uint) : void
|
||||
{
|
||||
var message:Message = new Message(text,color,MESSAGE_LIFE_TIME);
|
||||
this.var_435.push(message);
|
||||
this.var_436.addChild(message);
|
||||
if(this.var_435.length > this.maxMessagesNumber)
|
||||
this.§_-cd§.push(message);
|
||||
this.§_-pQ§.addChild(message);
|
||||
if(this.§_-cd§.length > this.maxMessagesNumber)
|
||||
{
|
||||
this.method_389(0);
|
||||
this.§_-AW§(0);
|
||||
}
|
||||
this.method_390();
|
||||
this.method_388();
|
||||
this.§_-cp§();
|
||||
this.§_-4t§();
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
this.var_436.parent.removeChild(this.var_436);
|
||||
this.§_-pQ§.parent.removeChild(this.§_-pQ§);
|
||||
this.timer.stop();
|
||||
}
|
||||
|
||||
private function method_388() : void
|
||||
private function §_-4t§() : void
|
||||
{
|
||||
if(this.var_435.length > 0)
|
||||
if(this.§_-cd§.length > 0)
|
||||
{
|
||||
if(!this.timer.running)
|
||||
{
|
||||
@@ -78,38 +78,38 @@ package package_93
|
||||
}
|
||||
}
|
||||
|
||||
private function method_390() : void
|
||||
private function §_-cp§() : void
|
||||
{
|
||||
var message:Message = null;
|
||||
for(var i:int = 0; i < this.var_435.length; i++)
|
||||
for(var i:int = 0; i < this.§_-cd§.length; i++)
|
||||
{
|
||||
message = this.var_435[i];
|
||||
message = this.§_-cd§[i];
|
||||
message.y = i * MESSAGE_SPACING_Y;
|
||||
}
|
||||
}
|
||||
|
||||
private function method_391(event:TimerEvent) : void
|
||||
private function §_-Zt§(event:TimerEvent) : void
|
||||
{
|
||||
this.method_392(getTimer());
|
||||
this.method_390();
|
||||
this.method_388();
|
||||
this.§_-ZP§(getTimer());
|
||||
this.§_-cp§();
|
||||
this.§_-4t§();
|
||||
}
|
||||
|
||||
private function method_392(time:int) : void
|
||||
private function §_-ZP§(time:int) : void
|
||||
{
|
||||
if(this.var_435.length > 0)
|
||||
if(this.§_-cd§.length > 0)
|
||||
{
|
||||
if(Message(this.var_435[0]).expirationTime <= time)
|
||||
if(Message(this.§_-cd§[0]).expirationTime <= time)
|
||||
{
|
||||
this.method_389(0);
|
||||
this.§_-AW§(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function method_389(i:int) : void
|
||||
private function §_-AW§(i:int) : void
|
||||
{
|
||||
this.var_436.removeChild(this.var_435[i]);
|
||||
this.var_435.splice(i,1);
|
||||
this.§_-pQ§.removeChild(this.§_-cd§[i]);
|
||||
this.§_-cd§.splice(i,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,28 @@
|
||||
package package_112
|
||||
package §_-mX§
|
||||
{
|
||||
import §_-O5§.§_-Hk§;
|
||||
import §default§.§_-7d§;
|
||||
import flash.events.Event;
|
||||
import alternativa.utils.ByteArrayMap;
|
||||
import package_40.class_7;
|
||||
import package_40.name_170;
|
||||
import package_71.name_333;
|
||||
import §return§.§_-Ui§;
|
||||
import §return§.§_-h5§;
|
||||
|
||||
public class name_651 extends class_7
|
||||
public class §_-Wb§ extends §_-h5§
|
||||
{
|
||||
public var data:name_333;
|
||||
public var data:§_-7d§;
|
||||
|
||||
protected var var_673:String;
|
||||
protected var §_-P9§:String;
|
||||
|
||||
private var files:ByteArrayMap;
|
||||
private var files:§_-Hk§;
|
||||
|
||||
private var var_672:name_170;
|
||||
private var §_-e2§:§_-Ui§;
|
||||
|
||||
private var baseUrl:String;
|
||||
|
||||
private var partXML:XML;
|
||||
|
||||
private var partsCollector:Vector.<name_333>;
|
||||
private var partsCollector:Vector.<§_-7d§>;
|
||||
|
||||
public function name_651(param1:String, param2:XML, param3:Vector.<name_333>)
|
||||
public function §_-Wb§(param1:String, param2:XML, param3:Vector.<§_-7d§>)
|
||||
{
|
||||
super();
|
||||
this.partXML = param2;
|
||||
@@ -33,54 +33,54 @@ package package_112
|
||||
override public function run() : void
|
||||
{
|
||||
var _loc2_:XML = null;
|
||||
this.files = new ByteArrayMap();
|
||||
this.var_672 = new name_170();
|
||||
this.files = new §_-Hk§();
|
||||
this.§_-e2§ = new §_-Ui§();
|
||||
var _loc1_:String = this.baseUrl + this.partXML.modelFile[0].toString();
|
||||
this.var_673 = "main." + this.partXML.modelFile[0].@type;
|
||||
this.var_672.addTask(new BlobLoadTask(this.var_673,_loc1_,this.files));
|
||||
this.§_-P9§ = "main." + this.partXML.modelFile[0].@type;
|
||||
this.§_-e2§.addTask(new BlobLoadTask(this.§_-P9§,_loc1_,this.files));
|
||||
for each(_loc2_ in this.partXML.texture)
|
||||
{
|
||||
this.var_672.addTask(new BlobLoadTask(_loc2_.@id,this.baseUrl + _loc2_.toString(),this.files));
|
||||
this.§_-e2§.addTask(new BlobLoadTask(_loc2_.@id,this.baseUrl + _loc2_.toString(),this.files));
|
||||
}
|
||||
this.var_672.addEventListener(Event.COMPLETE,this.method_817);
|
||||
this.var_672.run();
|
||||
this.§_-e2§.addEventListener(Event.COMPLETE,this.§_-Mk§);
|
||||
this.§_-e2§.run();
|
||||
}
|
||||
|
||||
public function parseModelData(param1:ByteArrayMap) : name_333
|
||||
public function parseModelData(param1:§_-Hk§) : §_-7d§
|
||||
{
|
||||
throw new Error("Not implemented");
|
||||
}
|
||||
|
||||
private function method_817(param1:Event) : void
|
||||
private function §_-Mk§(param1:Event) : void
|
||||
{
|
||||
this.var_672 = null;
|
||||
this.§_-e2§ = null;
|
||||
this.data = this.parseModelData(this.files);
|
||||
this.data.id = this.partXML.id;
|
||||
this.partsCollector.push(this.data);
|
||||
method_102();
|
||||
§_-3Z§();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import §_-O5§.§_-Hk§;
|
||||
import flash.events.Event;
|
||||
import flash.events.EventDispatcher;
|
||||
import flash.net.URLLoader;
|
||||
import flash.net.URLLoaderDataFormat;
|
||||
import flash.net.URLRequest;
|
||||
import alternativa.utils.ByteArrayMap;
|
||||
import package_40.class_7;
|
||||
import §return§.§_-h5§;
|
||||
|
||||
class BlobLoadTask extends class_7
|
||||
class BlobLoadTask extends §_-h5§
|
||||
{
|
||||
public var blobId:String;
|
||||
|
||||
private var collector:ByteArrayMap;
|
||||
private var collector:§_-Hk§;
|
||||
|
||||
private var blobUrl:String;
|
||||
|
||||
private var loader:URLLoader;
|
||||
|
||||
public function BlobLoadTask(param1:String, param2:String, param3:ByteArrayMap)
|
||||
public function BlobLoadTask(param1:String, param2:String, param3:§_-Hk§)
|
||||
{
|
||||
super();
|
||||
this.collector = param3;
|
||||
@@ -98,8 +98,8 @@ class BlobLoadTask extends class_7
|
||||
|
||||
private function onLoadingComplete(param1:Event) : void
|
||||
{
|
||||
this.collector.name_59(this.blobId,this.loader.data);
|
||||
this.collector.§_-9v§(this.blobId,this.loader.data);
|
||||
this.loader = null;
|
||||
method_102();
|
||||
§_-3Z§();
|
||||
}
|
||||
}
|
||||
133
src/?_-nO?/?_-Yk?.as
Normal file
@@ -0,0 +1,133 @@
|
||||
package §_-nO§
|
||||
{
|
||||
import §_-az§.§_-AG§;
|
||||
import §_-az§.§_-ps§;
|
||||
|
||||
public class §_-Yk§ extends §_-ps§ implements §_-5B§
|
||||
{
|
||||
private var §_-jB§:Vector.<§_-KI§>;
|
||||
|
||||
private var §_-0Y§:int;
|
||||
|
||||
private var running:Boolean;
|
||||
|
||||
private var gameKernel:§_-AG§;
|
||||
|
||||
public function §_-Yk§(priority:int, gameKernel:§_-AG§)
|
||||
{
|
||||
super(priority);
|
||||
this.gameKernel = gameKernel;
|
||||
this.§_-jB§ = new Vector.<§_-KI§>();
|
||||
}
|
||||
|
||||
public function addLogicUnit(logicUnit:§_-KI§) : void
|
||||
{
|
||||
var actionAddUnit:ActionAddUnit = null;
|
||||
if(this.running)
|
||||
{
|
||||
actionAddUnit = ActionAddUnit(this.gameKernel.§_-11§().§_-kP§(ActionAddUnit));
|
||||
this.§_-5W§(actionAddUnit,logicUnit);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(this.§_-jB§.indexOf(logicUnit) >= 0)
|
||||
{
|
||||
throw new Error("Logic unit already exists");
|
||||
}
|
||||
var _loc3_:* = this.§_-0Y§++;
|
||||
this.§_-jB§[_loc3_] = logicUnit;
|
||||
}
|
||||
}
|
||||
|
||||
public function removeLogicUnit(logicUnit:§_-KI§) : void
|
||||
{
|
||||
var actionRemoveUnit:ActionRemoveUnit = null;
|
||||
var index:int = 0;
|
||||
if(this.running)
|
||||
{
|
||||
actionRemoveUnit = ActionRemoveUnit(this.gameKernel.§_-11§().§_-kP§(ActionRemoveUnit));
|
||||
this.§_-5W§(actionRemoveUnit,logicUnit);
|
||||
}
|
||||
else
|
||||
{
|
||||
index = int(this.§_-jB§.indexOf(logicUnit));
|
||||
if(index < 0)
|
||||
{
|
||||
throw new Error("Logic unit not found");
|
||||
}
|
||||
this.§_-jB§[index] = this.§_-jB§[--this.§_-0Y§];
|
||||
this.§_-jB§[this.§_-0Y§] = null;
|
||||
}
|
||||
}
|
||||
|
||||
override public function run() : void
|
||||
{
|
||||
this.running = true;
|
||||
for(var i:int = 0; i < this.§_-0Y§; i++)
|
||||
{
|
||||
this.§_-jB§[i].runLogic();
|
||||
}
|
||||
this.running = false;
|
||||
}
|
||||
|
||||
private function §_-5W§(action:DeferredAction, unit:§_-KI§) : void
|
||||
{
|
||||
action.system = this;
|
||||
action.unit = unit;
|
||||
this.gameKernel.§_-L§(action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import §_-RQ§.§_-HE§;
|
||||
import §_-RQ§.§_-Va§;
|
||||
import §in §.§_-eF§;
|
||||
|
||||
class DeferredAction extends §_-eF§
|
||||
{
|
||||
public var system:§_-5B§;
|
||||
|
||||
public var unit:§_-KI§;
|
||||
|
||||
public function DeferredAction(objectPool:§_-Va§)
|
||||
{
|
||||
super(objectPool);
|
||||
}
|
||||
|
||||
override public function execute() : void
|
||||
{
|
||||
this.doExecute();
|
||||
this.system = null;
|
||||
this.unit = null;
|
||||
}
|
||||
|
||||
protected function doExecute() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
class ActionAddUnit extends DeferredAction
|
||||
{
|
||||
public function ActionAddUnit(objectPool:§_-Va§)
|
||||
{
|
||||
super(objectPool);
|
||||
}
|
||||
|
||||
override protected function doExecute() : void
|
||||
{
|
||||
system.addLogicUnit(unit);
|
||||
}
|
||||
}
|
||||
|
||||
class ActionRemoveUnit extends DeferredAction
|
||||
{
|
||||
public function ActionRemoveUnit(objectPool:§_-Va§)
|
||||
{
|
||||
super(objectPool);
|
||||
}
|
||||
|
||||
override protected function doExecute() : void
|
||||
{
|
||||
system.removeLogicUnit(unit);
|
||||
}
|
||||
}
|
||||
@@ -1,40 +1,40 @@
|
||||
package package_109
|
||||
package §_-pe§
|
||||
{
|
||||
import package_46.Matrix4;
|
||||
import package_46.name_194;
|
||||
import package_76.name_235;
|
||||
import package_90.name_386;
|
||||
import §_-1e§.§_-Nh§;
|
||||
import §_-KA§.§_-FW§;
|
||||
import §_-nl§.Matrix4;
|
||||
import §_-nl§.§_-bj§;
|
||||
|
||||
public class name_377 extends name_235
|
||||
public class §_-m3§ extends §_-Nh§
|
||||
{
|
||||
public var hs:name_194 = new name_194();
|
||||
public var hs:§_-bj§ = new §_-bj§();
|
||||
|
||||
public function name_377(hs:name_194, collisionGroup:int, collisionMask:int)
|
||||
public function §_-m3§(hs:§_-bj§, collisionGroup:int, collisionMask:int)
|
||||
{
|
||||
super(BOX,collisionGroup,collisionMask);
|
||||
this.hs.copy(hs);
|
||||
}
|
||||
|
||||
override public function calculateAABB() : name_386
|
||||
override public function calculateAABB() : §_-FW§
|
||||
{
|
||||
var t:Matrix4 = null;
|
||||
var xx:Number = NaN;
|
||||
var yy:Number = NaN;
|
||||
var zz:Number = NaN;
|
||||
t = transform;
|
||||
xx = t.a < 0 ? -t.a : t.a;
|
||||
yy = t.b < 0 ? -t.b : t.b;
|
||||
zz = t.c < 0 ? -t.c : t.c;
|
||||
xx = t.a < 0 ? -t.a : Number(t.a);
|
||||
yy = t.b < 0 ? -t.b : Number(t.b);
|
||||
zz = t.c < 0 ? -t.c : Number(t.c);
|
||||
aabb.maxX = this.hs.x * xx + this.hs.y * yy + this.hs.z * zz;
|
||||
aabb.minX = -aabb.maxX;
|
||||
xx = t.e < 0 ? -t.e : t.e;
|
||||
yy = t.f < 0 ? -t.f : t.f;
|
||||
zz = t.g < 0 ? -t.g : t.g;
|
||||
xx = t.e < 0 ? -t.e : Number(t.e);
|
||||
yy = t.f < 0 ? -t.f : Number(t.f);
|
||||
zz = t.g < 0 ? -t.g : Number(t.g);
|
||||
aabb.maxY = this.hs.x * xx + this.hs.y * yy + this.hs.z * zz;
|
||||
aabb.minY = -aabb.maxY;
|
||||
xx = t.i < 0 ? -t.i : t.i;
|
||||
yy = t.j < 0 ? -t.j : t.j;
|
||||
zz = t.k < 0 ? -t.k : t.k;
|
||||
xx = t.i < 0 ? -t.i : Number(t.i);
|
||||
yy = t.j < 0 ? -t.j : Number(t.j);
|
||||
zz = t.k < 0 ? -t.k : Number(t.k);
|
||||
aabb.maxZ = this.hs.x * xx + this.hs.y * yy + this.hs.z * zz;
|
||||
aabb.minZ = -aabb.maxZ;
|
||||
aabb.minX += t.d;
|
||||
@@ -46,9 +46,9 @@ package package_109
|
||||
return aabb;
|
||||
}
|
||||
|
||||
override public function copyFrom(source:name_235) : name_235
|
||||
override public function copyFrom(source:§_-Nh§) : §_-Nh§
|
||||
{
|
||||
var box:name_377 = source as name_377;
|
||||
var box:§_-m3§ = source as §_-m3§;
|
||||
if(box == null)
|
||||
{
|
||||
return this;
|
||||
@@ -58,12 +58,12 @@ package package_109
|
||||
return this;
|
||||
}
|
||||
|
||||
override protected function createPrimitive() : name_235
|
||||
override protected function createPrimitive() : §_-Nh§
|
||||
{
|
||||
return new name_377(this.hs,collisionGroup,collisionMask);
|
||||
return new §_-m3§(this.hs,collisionGroup,collisionMask);
|
||||
}
|
||||
|
||||
override public function raycast(origin:name_194, vector:name_194, epsilon:Number, normal:name_194) : Number
|
||||
override public function raycast(origin:§_-bj§, vector:§_-bj§, epsilon:Number, normal:§_-bj§) : Number
|
||||
{
|
||||
var t1:Number = NaN;
|
||||
var t2:Number = NaN;
|
||||
@@ -205,9 +205,9 @@ package package_109
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
vx = normal.x;
|
||||
vy = normal.y;
|
||||
vz = normal.z;
|
||||
vx = Number(normal.x);
|
||||
vy = Number(normal.y);
|
||||
vz = Number(normal.z);
|
||||
normal.x = transform.a * vx + transform.b * vy + transform.c * vz;
|
||||
normal.y = transform.e * vx + transform.f * vy + transform.g * vz;
|
||||
normal.z = transform.i * vx + transform.j * vy + transform.k * vz;
|
||||
@@ -1,20 +1,20 @@
|
||||
package package_72
|
||||
package §function§
|
||||
{
|
||||
import §_-8D§.§_-FW§;
|
||||
import §_-aF§.§_-S8§;
|
||||
import §_-aF§.§_-SG§;
|
||||
import §_-aF§.§_-nN§;
|
||||
import flash.display3D.Context3DBlendFactor;
|
||||
import flash.geom.Vector3D;
|
||||
import flash.utils.setTimeout;
|
||||
import package_21.name_386;
|
||||
import package_25.name_113;
|
||||
import package_25.name_250;
|
||||
import package_25.name_626;
|
||||
|
||||
public class name_255 extends name_113
|
||||
public class §_-KQ§ extends §_-SG§
|
||||
{
|
||||
private static var smokePrototype:name_626;
|
||||
private static var smokePrototype:§_-nN§;
|
||||
|
||||
private static var firePrototype:name_626;
|
||||
private static var firePrototype:§_-nN§;
|
||||
|
||||
private static var flamePrototype:name_626;
|
||||
private static var flamePrototype:§_-nN§;
|
||||
|
||||
private static var liftSpeed:Number = 60;
|
||||
|
||||
@@ -22,7 +22,7 @@ package package_72
|
||||
|
||||
private static var pos:Vector3D = new Vector3D();
|
||||
|
||||
public function name_255(smoke:name_250, fire:name_250, flame:name_250, live:Number = 1, repeat:Boolean = false)
|
||||
public function §_-KQ§(smoke:§_-S8§, fire:§_-S8§, flame:§_-S8§, live:Number = 1, repeat:Boolean = false)
|
||||
{
|
||||
var i:int;
|
||||
var ft:Number = NaN;
|
||||
@@ -31,37 +31,37 @@ package package_72
|
||||
ft = 1 / 30;
|
||||
if(smokePrototype == null)
|
||||
{
|
||||
smokePrototype = new name_626(128,128,smoke,false);
|
||||
smokePrototype.method_257(0 * ft,0,0.4,0.4,0.65,0.25,0,0);
|
||||
smokePrototype.method_257(9 * ft,0,0.58,0.58,0.65,0.45,0.23,0.3);
|
||||
smokePrototype.method_257(19 * ft,0,0.78,0.78,0.65,0.55,0.5,0.66);
|
||||
smokePrototype.method_257(40 * ft,0,1.21,1.21,0.4,0.4,0.4,0.27);
|
||||
smokePrototype.method_257(54 * ft,0,1.5,1.5,0,0,0,0);
|
||||
smokePrototype = new §_-nN§(128,128,smoke,false);
|
||||
smokePrototype.§_-Le§(0 * ft,0,0.4,0.4,0.65,0.25,0,0);
|
||||
smokePrototype.§_-Le§(9 * ft,0,0.58,0.58,0.65,0.45,0.23,0.3);
|
||||
smokePrototype.§_-Le§(19 * ft,0,0.78,0.78,0.65,0.55,0.5,0.66);
|
||||
smokePrototype.§_-Le§(40 * ft,0,1.21,1.21,0.4,0.4,0.4,0.27);
|
||||
smokePrototype.§_-Le§(54 * ft,0,1.5,1.5,0,0,0,0);
|
||||
}
|
||||
if(firePrototype == null)
|
||||
{
|
||||
firePrototype = new name_626(128,128,fire,false,Context3DBlendFactor.SOURCE_ALPHA,Context3DBlendFactor.ONE);
|
||||
firePrototype.method_257(0 * ft,0,0.3,0.3,1,1,1,0);
|
||||
firePrototype.method_257(8 * ft,0,0.4,0.4,1,1,1,0.85);
|
||||
firePrototype.method_257(17 * ft,0,0.51,0.51,1,0.56,0.48,0.1);
|
||||
firePrototype.method_257(24 * ft,0,0.6,0.6,1,0.56,0.48,0);
|
||||
firePrototype = new §_-nN§(128,128,fire,false,Context3DBlendFactor.SOURCE_ALPHA,Context3DBlendFactor.ONE);
|
||||
firePrototype.§_-Le§(0 * ft,0,0.3,0.3,1,1,1,0);
|
||||
firePrototype.§_-Le§(8 * ft,0,0.4,0.4,1,1,1,0.85);
|
||||
firePrototype.§_-Le§(17 * ft,0,0.51,0.51,1,0.56,0.48,0.1);
|
||||
firePrototype.§_-Le§(24 * ft,0,0.6,0.6,1,0.56,0.48,0);
|
||||
}
|
||||
if(flamePrototype == null)
|
||||
{
|
||||
flamePrototype = new name_626(128,128,flame,true,Context3DBlendFactor.SOURCE_ALPHA,Context3DBlendFactor.ONE);
|
||||
flamePrototype.method_257(0 * ft,0,1,1,1,1,1,0);
|
||||
flamePrototype.method_257(10 * ft,0,1,1,1,1,1,1);
|
||||
flamePrototype.method_257(live - 10 * ft,0,1,1,1,1,1,1);
|
||||
flamePrototype.method_257(live,0,1,1,1,1,1,0);
|
||||
flamePrototype = new §_-nN§(128,128,flame,true,Context3DBlendFactor.SOURCE_ALPHA,Context3DBlendFactor.ONE);
|
||||
flamePrototype.§_-Le§(0 * ft,0,1,1,1,1,1,0);
|
||||
flamePrototype.§_-Le§(10 * ft,0,1,1,1,1,1,1);
|
||||
flamePrototype.§_-Le§(live - 10 * ft,0,1,1,1,1,1,1);
|
||||
flamePrototype.§_-Le§(live,0,1,1,1,1,1,0);
|
||||
}
|
||||
boundBox = new name_386();
|
||||
boundBox = new §_-FW§();
|
||||
boundBox.minX = -100;
|
||||
boundBox.minY = -100;
|
||||
boundBox.minZ = -20;
|
||||
boundBox.maxX = 100;
|
||||
boundBox.maxY = 100;
|
||||
boundBox.maxZ = 200;
|
||||
method_257(0,this.keyFrame1);
|
||||
§_-Le§(0,this.keyFrame1);
|
||||
i = 0;
|
||||
while(true)
|
||||
{
|
||||
@@ -70,22 +70,22 @@ package package_72
|
||||
{
|
||||
break;
|
||||
}
|
||||
method_257(keyTime,this.method_530);
|
||||
§_-Le§(keyTime,this.§_-IJ§);
|
||||
i++;
|
||||
}
|
||||
if(repeat)
|
||||
{
|
||||
setTimeout(function():void
|
||||
{
|
||||
var newFire:name_255 = new name_255(smoke,fire,flame,live,repeat);
|
||||
var newFire:§_-KQ§ = new §_-KQ§(smoke,fire,flame,live,repeat);
|
||||
newFire.name = name;
|
||||
newFire.scale = scale;
|
||||
newFire.position = position;
|
||||
newFire.direction = direction;
|
||||
var_5.method_37(newFire);
|
||||
§_-Ta§.each(newFire);
|
||||
},(live - 5 * ft) * 1000);
|
||||
}
|
||||
method_258(var_151[var_148 - 1] + smokePrototype.lifeTime);
|
||||
§_-DM§(§_-gV§[§_-kf§ - 1] + smokePrototype.lifeTime);
|
||||
}
|
||||
|
||||
private function keyFrame1(keyTime:Number, time:Number) : void
|
||||
@@ -94,32 +94,32 @@ package package_72
|
||||
pos.y = random() * 10 - 10 * 0.5;
|
||||
pos.z = random() * 10 * 0.5;
|
||||
var rnd:Number = 0.2 + random() * 0.2;
|
||||
flamePrototype.name_627(this,time,pos,0,rnd,rnd,1,0);
|
||||
flamePrototype.§_-fs§(this,time,pos,0,rnd,rnd,1,0);
|
||||
pos.x = random() * 10 - 10 * 0.5;
|
||||
pos.y = random() * 10 - 10 * 0.5;
|
||||
pos.z = random() * 10 * 0.5;
|
||||
rnd = 0.2 + random() * 0.2;
|
||||
flamePrototype.name_627(this,time,pos,0,rnd,rnd,1,0.5 * flamePrototype.atlas.rangeLength);
|
||||
flamePrototype.§_-fs§(this,time,pos,0,rnd,rnd,1,0.5 * flamePrototype.atlas.rangeLength);
|
||||
}
|
||||
|
||||
private function method_530(keyTime:Number, time:Number) : void
|
||||
private function §_-IJ§(keyTime:Number, time:Number) : void
|
||||
{
|
||||
for(var i:int = 0; i < 1; i++)
|
||||
{
|
||||
pos.x = random() * 10 - 10 * 0.5;
|
||||
pos.y = random() * 10 - 10 * 0.5;
|
||||
pos.z = 10 + random() * 10 * 0.5;
|
||||
this.method_529(time,0.7 + random() * 0.5,pos);
|
||||
smokePrototype.name_627(this,time,pos,random() - 0.5,1,1,1,random() * smokePrototype.atlas.rangeLength);
|
||||
this.§_-C8§(time,0.7 + random() * 0.5,pos);
|
||||
smokePrototype.§_-fs§(this,time,pos,random() - 0.5,1,1,1,random() * smokePrototype.atlas.rangeLength);
|
||||
pos.x = 0;
|
||||
pos.y = 0;
|
||||
pos.z = 0;
|
||||
this.method_529(time,0.7 + random() * 0.5,pos);
|
||||
firePrototype.name_627(this,time,pos,random() - 0.5,1,1,0.2,random() * firePrototype.atlas.rangeLength);
|
||||
this.§_-C8§(time,0.7 + random() * 0.5,pos);
|
||||
firePrototype.§_-fs§(this,time,pos,random() - 0.5,1,1,0.2,random() * firePrototype.atlas.rangeLength);
|
||||
}
|
||||
}
|
||||
|
||||
private function method_531(direction:Vector3D, angle:Number, result:Vector3D) : void
|
||||
private function §_-ky§(direction:Vector3D, angle:Number, result:Vector3D) : void
|
||||
{
|
||||
var x:Number = random() * 2 - 1;
|
||||
var y:Number = random() * 2 - 1;
|
||||
@@ -135,11 +135,11 @@ package package_72
|
||||
result.normalize();
|
||||
}
|
||||
|
||||
private function method_529(time:Number, factor:Number, result:Vector3D) : void
|
||||
private function §_-C8§(time:Number, factor:Number, result:Vector3D) : void
|
||||
{
|
||||
result.x += time * windSpeed * var_5.wind.x;
|
||||
result.y += time * windSpeed * var_5.wind.y;
|
||||
result.z += time * windSpeed * var_5.wind.z + time * liftSpeed * factor;
|
||||
result.x += time * windSpeed * §_-Ta§.wind.x;
|
||||
result.y += time * windSpeed * §_-Ta§.wind.y;
|
||||
result.z += time * windSpeed * §_-Ta§.wind.z + time * liftSpeed * factor;
|
||||
}
|
||||
}
|
||||
}
|
||||
122
src/?function?/?_-T?.as
Normal file
@@ -0,0 +1,122 @@
|
||||
package §function§
|
||||
{
|
||||
import §_-1z§.§_-pi§;
|
||||
import §_-7A§.§_-3e§;
|
||||
import §_-az§.§_-2J§;
|
||||
import §_-az§.§_-AG§;
|
||||
import §_-jG§.§_-gg§;
|
||||
import §_-nl§.§_-bj§;
|
||||
import flash.media.Sound;
|
||||
|
||||
public class §_-T§ extends §_-2J§ implements §_-gg§
|
||||
{
|
||||
private var shotTextureResource:§_-pi§;
|
||||
|
||||
private var shotSound:Sound;
|
||||
|
||||
private var gameKernel:§_-AG§;
|
||||
|
||||
private var turret:§_-3e§;
|
||||
|
||||
public function §_-T§(shotTextureResource:§_-pi§, shotSound:Sound)
|
||||
{
|
||||
super();
|
||||
this.shotTextureResource = shotTextureResource;
|
||||
this.shotSound = shotSound;
|
||||
}
|
||||
|
||||
override public function initComponent() : void
|
||||
{
|
||||
this.turret = §_-3e§(entity.getComponentStrict(§_-3e§));
|
||||
}
|
||||
|
||||
override public function addToGame(gameKernel:§_-AG§) : void
|
||||
{
|
||||
this.gameKernel = gameKernel;
|
||||
}
|
||||
|
||||
override public function removeFromGame(gameKernel:§_-AG§) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function §_-km§(barrelIndex:int, barrelOrigin:§_-bj§, muzzlePosition:§_-bj§, gunDirection:§_-bj§, gunElevationAxis:§_-bj§) : void
|
||||
{
|
||||
var simpleWeaponShotEffect:SimpleWeaponShotEffect = SimpleWeaponShotEffect(this.gameKernel.§_-11§().§_-kP§(SimpleWeaponShotEffect));
|
||||
simpleWeaponShotEffect.init(barrelIndex,this.turret,this.shotTextureResource,100);
|
||||
this.gameKernel.§_-DZ§().each(simpleWeaponShotEffect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import §_-1z§.§_-pi§;
|
||||
import §_-7A§.§_-3e§;
|
||||
import §_-Ex§.§_-U2§;
|
||||
import §_-RQ§.§_-HE§;
|
||||
import §_-RQ§.§_-Va§;
|
||||
import §_-V-§.§_-Eh§;
|
||||
import §_-Vh§.§_-pZ§;
|
||||
import §_-e6§.§_-1I§;
|
||||
import §_-e6§.§_-RE§;
|
||||
import §_-e6§.§_-fX§;
|
||||
import §_-lS§.§_-h2§;
|
||||
import §_-nl§.§_-bj§;
|
||||
import alternativa.engine3d.alternativa3d;
|
||||
|
||||
use namespace alternativa3d;
|
||||
|
||||
class SimpleWeaponShotEffect extends §_-HE§ implements §_-fX§
|
||||
{
|
||||
private static var muzzlePosition:§_-bj§ = new §_-bj§();
|
||||
|
||||
private static var gunDirection:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var turret:§_-3e§;
|
||||
|
||||
private var mesh:§_-U2§;
|
||||
|
||||
private var material:§_-pZ§;
|
||||
|
||||
private var timeToLive:int;
|
||||
|
||||
private var barrelIndex:int;
|
||||
|
||||
public function SimpleWeaponShotEffect(objectPool:§_-Va§)
|
||||
{
|
||||
super(objectPool);
|
||||
this.mesh = new §_-Gi§(40,250,0,250 / 2);
|
||||
this.material = new §_-pZ§();
|
||||
this.material.§_-L4§ = true;
|
||||
this.mesh.setMaterialToAllSurfaces(this.material);
|
||||
}
|
||||
|
||||
public function init(barrelIndex:int, turret:§_-3e§, textureResource:§_-pi§, timeToLive:int) : void
|
||||
{
|
||||
this.barrelIndex = barrelIndex;
|
||||
this.turret = turret;
|
||||
this.timeToLive = timeToLive;
|
||||
this.material.diffuseMap = textureResource;
|
||||
}
|
||||
|
||||
public function addedToRenderSystem(system:§_-1I§) : void
|
||||
{
|
||||
system.§_-09§(this.mesh.geometry);
|
||||
system.§_-p1§().addChild(this.mesh);
|
||||
}
|
||||
|
||||
public function play(camera:§_-RE§) : Boolean
|
||||
{
|
||||
if(this.timeToLive < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.turret.getGunMuzzleData(this.barrelIndex,muzzlePosition,gunDirection);
|
||||
§_-Eh§.§_-Wr§(this.mesh,muzzlePosition,gunDirection,camera.position);
|
||||
this.timeToLive -= §_-h2§.timeDelta;
|
||||
return true;
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
this.mesh.alternativa3d::removeFromParent();
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
package package_43
|
||||
package §in §
|
||||
{
|
||||
import alternativa.tanks.game.utils.objectpool.PooledObject;
|
||||
import alternativa.tanks.game.utils.objectpool.ObjectPool;
|
||||
import alternativa.tanks.game.utils.objectpool.PooledObject;
|
||||
|
||||
public class name_190 extends PooledObject
|
||||
public class DeferredCommand extends PooledObject
|
||||
{
|
||||
public var next:name_190;
|
||||
public var next:DeferredCommand;
|
||||
|
||||
public function name_190(objectPool:ObjectPool)
|
||||
public function DeferredCommand(objectPool:ObjectPool)
|
||||
{
|
||||
super(objectPool);
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
package package_43
|
||||
package §in §
|
||||
{
|
||||
import alternativa.tanks.game.GameTask;
|
||||
|
||||
public class name_183 extends GameTask
|
||||
public class DeferredCommandsSystem extends GameTask
|
||||
{
|
||||
private var commands:name_190;
|
||||
private var commands:DeferredCommand;
|
||||
|
||||
public function name_183(priority:int)
|
||||
public function DeferredCommandsSystem(priority:int)
|
||||
{
|
||||
super(priority);
|
||||
}
|
||||
|
||||
public function name_187(command:name_190) : void
|
||||
public function addCommand(command:DeferredCommand) : void
|
||||
{
|
||||
command.next = this.commands;
|
||||
this.commands = command;
|
||||
@@ -19,13 +19,13 @@ package package_43
|
||||
|
||||
override public function run() : void
|
||||
{
|
||||
for(var command:name_190 = null; this.commands != null; )
|
||||
for(var command:DeferredCommand = null; this.commands != null; )
|
||||
{
|
||||
command = this.commands;
|
||||
this.commands = this.commands.next;
|
||||
command.next = null;
|
||||
command.execute();
|
||||
command.method_254();
|
||||
command.storeInPool();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
package package_40
|
||||
package §return§
|
||||
{
|
||||
import flash.utils.ByteArray;
|
||||
|
||||
public class name_171
|
||||
public class §_-Hr§
|
||||
{
|
||||
private var var_102:Object;
|
||||
private var §_-Bp§:Object;
|
||||
|
||||
public function name_171(param1:ByteArray)
|
||||
public function §_-Hr§(param1:ByteArray)
|
||||
{
|
||||
super();
|
||||
if(param1 != null)
|
||||
{
|
||||
this.method_314(param1);
|
||||
this.§_-Om§(param1);
|
||||
}
|
||||
}
|
||||
|
||||
public function method_314(param1:ByteArray) : void
|
||||
public function §_-Om§(param1:ByteArray) : void
|
||||
{
|
||||
var _loc4_:int = 0;
|
||||
var _loc5_:ByteArray = null;
|
||||
@@ -28,30 +28,30 @@ package package_40
|
||||
_loc3_[_loc4_] = new FileInfo(param1.readUTF(),param1.readInt());
|
||||
_loc4_++;
|
||||
}
|
||||
this.var_102 = {};
|
||||
this.§_-Bp§ = {};
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < _loc2_)
|
||||
{
|
||||
_loc5_ = new ByteArray();
|
||||
_loc6_ = _loc3_[_loc4_];
|
||||
param1.readBytes(_loc5_,0,_loc6_.size);
|
||||
this.var_102[_loc6_.name] = _loc5_;
|
||||
this.§_-Bp§[_loc6_.name] = _loc5_;
|
||||
_loc4_++;
|
||||
}
|
||||
}
|
||||
|
||||
public function get data() : Object
|
||||
{
|
||||
return this.var_102;
|
||||
return this.§_-Bp§;
|
||||
}
|
||||
|
||||
public function method_315(param1:String) : ByteArray
|
||||
public function §_-lv§(param1:String) : ByteArray
|
||||
{
|
||||
if(this.var_102 == null)
|
||||
if(this.§_-Bp§ == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return ByteArray(this.var_102[param1]);
|
||||
return ByteArray(this.§_-Bp§[param1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,106 +1,106 @@
|
||||
package package_121
|
||||
package §while§
|
||||
{
|
||||
import package_109.name_377;
|
||||
import package_46.Matrix4;
|
||||
import package_46.name_194;
|
||||
import package_76.name_235;
|
||||
import package_92.name_630;
|
||||
import package_92.name_674;
|
||||
import §_-1e§.§_-Nh§;
|
||||
import §_-US§.§_-6h§;
|
||||
import §_-US§.§_-cR§;
|
||||
import §_-nl§.Matrix4;
|
||||
import §_-nl§.§_-bj§;
|
||||
import §_-pe§.§_-m3§;
|
||||
|
||||
public class name_666 extends class_41
|
||||
public class §_-Ph§ extends §_-dj§
|
||||
{
|
||||
private var epsilon:Number = 0.001;
|
||||
|
||||
private var vectorToBox1:name_194 = new name_194();
|
||||
private var vectorToBox1:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var axis:name_194 = new name_194();
|
||||
private var axis:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var axis10:name_194 = new name_194();
|
||||
private var axis10:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var axis11:name_194 = new name_194();
|
||||
private var axis11:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var axis12:name_194 = new name_194();
|
||||
private var axis12:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var axis20:name_194 = new name_194();
|
||||
private var axis20:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var axis21:name_194 = new name_194();
|
||||
private var axis21:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var axis22:name_194 = new name_194();
|
||||
private var axis22:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var var_675:int;
|
||||
private var §_-Wt§:int;
|
||||
|
||||
private var var_676:Number;
|
||||
private var §_-hK§:Number;
|
||||
|
||||
private var points1:Vector.<name_194> = new Vector.<name_194>(8,true);
|
||||
private var points1:Vector.<§_-bj§> = new Vector.<§_-bj§>(8,true);
|
||||
|
||||
private var points2:Vector.<name_194> = new Vector.<name_194>(8,true);
|
||||
private var points2:Vector.<§_-bj§> = new Vector.<§_-bj§>(8,true);
|
||||
|
||||
private var var_683:Vector.<name_674> = new Vector.<name_674>(8,true);
|
||||
private var §_-2r§:Vector.<§_-cR§> = new Vector.<§_-cR§>(8,true);
|
||||
|
||||
private var name_679:int;
|
||||
private var §_-P3§:int;
|
||||
|
||||
public function name_666()
|
||||
public function §_-Ph§()
|
||||
{
|
||||
super();
|
||||
for(var i:int = 0; i < 8; i++)
|
||||
{
|
||||
this.var_683[i] = new name_674();
|
||||
this.points1[i] = new name_194();
|
||||
this.points2[i] = new name_194();
|
||||
this.§_-2r§[i] = new §_-cR§();
|
||||
this.points1[i] = new §_-bj§();
|
||||
this.points2[i] = new §_-bj§();
|
||||
}
|
||||
}
|
||||
|
||||
override public function getContact(prim1:name_235, prim2:name_235, contact:name_630) : Boolean
|
||||
override public function getContact(prim1:§_-Nh§, prim2:§_-Nh§, contact:§_-6h§) : Boolean
|
||||
{
|
||||
var box1:name_377 = null;
|
||||
var box2:name_377 = null;
|
||||
var box1:§_-m3§ = null;
|
||||
var box2:§_-m3§ = null;
|
||||
if(!this.haveCollision(prim1,prim2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(prim1.body != null)
|
||||
{
|
||||
box1 = prim1 as name_377;
|
||||
box2 = prim2 as name_377;
|
||||
box1 = prim1 as §_-m3§;
|
||||
box2 = prim2 as §_-m3§;
|
||||
}
|
||||
else
|
||||
{
|
||||
box1 = prim2 as name_377;
|
||||
box2 = prim1 as name_377;
|
||||
box1 = prim2 as §_-m3§;
|
||||
box2 = prim1 as §_-m3§;
|
||||
}
|
||||
if(this.var_675 < 6)
|
||||
if(this.§_-Wt§ < 6)
|
||||
{
|
||||
if(!this.method_828(box1,box2,this.vectorToBox1,this.var_675,contact))
|
||||
if(!this.§_-NV§(box1,box2,this.vectorToBox1,this.§_-Wt§,contact))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.var_675 -= 6;
|
||||
this.method_831(box1,box2,this.vectorToBox1,int(this.var_675 / 3),this.var_675 % 3,contact);
|
||||
this.§_-Wt§ -= 6;
|
||||
this.§_-og§(box1,box2,this.vectorToBox1,int(this.§_-Wt§ / 3),this.§_-Wt§ % 3,contact);
|
||||
}
|
||||
contact.body1 = box1.body;
|
||||
contact.body2 = box2.body;
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function haveCollision(prim1:name_235, prim2:name_235) : Boolean
|
||||
override public function haveCollision(prim1:§_-Nh§, prim2:§_-Nh§) : Boolean
|
||||
{
|
||||
var box1:name_377 = null;
|
||||
var box2:name_377 = null;
|
||||
var box1:§_-m3§ = null;
|
||||
var box2:§_-m3§ = null;
|
||||
var transform1:Matrix4 = null;
|
||||
var transform2:Matrix4 = null;
|
||||
this.var_676 = 10000000000;
|
||||
this.§_-hK§ = 10000000000;
|
||||
if(prim1.body != null)
|
||||
{
|
||||
box1 = prim1 as name_377;
|
||||
box2 = prim2 as name_377;
|
||||
box1 = prim1 as §_-m3§;
|
||||
box2 = prim2 as §_-m3§;
|
||||
}
|
||||
else
|
||||
{
|
||||
box1 = prim2 as name_377;
|
||||
box2 = prim1 as name_377;
|
||||
box1 = prim2 as §_-m3§;
|
||||
box2 = prim1 as §_-m3§;
|
||||
}
|
||||
transform1 = box1.transform;
|
||||
transform2 = box2.transform;
|
||||
@@ -110,97 +110,97 @@ package package_121
|
||||
this.axis10.x = transform1.a;
|
||||
this.axis10.y = transform1.e;
|
||||
this.axis10.z = transform1.i;
|
||||
if(!this.method_826(box1,box2,this.axis10,0,this.vectorToBox1))
|
||||
if(!this.§_-mG§(box1,box2,this.axis10,0,this.vectorToBox1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.axis11.x = transform1.b;
|
||||
this.axis11.y = transform1.f;
|
||||
this.axis11.z = transform1.j;
|
||||
if(!this.method_826(box1,box2,this.axis11,1,this.vectorToBox1))
|
||||
if(!this.§_-mG§(box1,box2,this.axis11,1,this.vectorToBox1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.axis12.x = transform1.c;
|
||||
this.axis12.y = transform1.g;
|
||||
this.axis12.z = transform1.k;
|
||||
if(!this.method_826(box1,box2,this.axis12,2,this.vectorToBox1))
|
||||
if(!this.§_-mG§(box1,box2,this.axis12,2,this.vectorToBox1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.axis20.x = transform2.a;
|
||||
this.axis20.y = transform2.e;
|
||||
this.axis20.z = transform2.i;
|
||||
if(!this.method_826(box1,box2,this.axis20,3,this.vectorToBox1))
|
||||
if(!this.§_-mG§(box1,box2,this.axis20,3,this.vectorToBox1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.axis21.x = transform2.b;
|
||||
this.axis21.y = transform2.f;
|
||||
this.axis21.z = transform2.j;
|
||||
if(!this.method_826(box1,box2,this.axis21,4,this.vectorToBox1))
|
||||
if(!this.§_-mG§(box1,box2,this.axis21,4,this.vectorToBox1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.axis22.x = transform2.c;
|
||||
this.axis22.y = transform2.g;
|
||||
this.axis22.z = transform2.k;
|
||||
if(!this.method_826(box1,box2,this.axis22,5,this.vectorToBox1))
|
||||
if(!this.§_-mG§(box1,box2,this.axis22,5,this.vectorToBox1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!this.method_825(box1,box2,this.axis10,this.axis20,6,this.vectorToBox1))
|
||||
if(!this.§_-kt§(box1,box2,this.axis10,this.axis20,6,this.vectorToBox1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!this.method_825(box1,box2,this.axis10,this.axis21,7,this.vectorToBox1))
|
||||
if(!this.§_-kt§(box1,box2,this.axis10,this.axis21,7,this.vectorToBox1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!this.method_825(box1,box2,this.axis10,this.axis22,8,this.vectorToBox1))
|
||||
if(!this.§_-kt§(box1,box2,this.axis10,this.axis22,8,this.vectorToBox1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!this.method_825(box1,box2,this.axis11,this.axis20,9,this.vectorToBox1))
|
||||
if(!this.§_-kt§(box1,box2,this.axis11,this.axis20,9,this.vectorToBox1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!this.method_825(box1,box2,this.axis11,this.axis21,10,this.vectorToBox1))
|
||||
if(!this.§_-kt§(box1,box2,this.axis11,this.axis21,10,this.vectorToBox1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!this.method_825(box1,box2,this.axis11,this.axis22,11,this.vectorToBox1))
|
||||
if(!this.§_-kt§(box1,box2,this.axis11,this.axis22,11,this.vectorToBox1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!this.method_825(box1,box2,this.axis12,this.axis20,12,this.vectorToBox1))
|
||||
if(!this.§_-kt§(box1,box2,this.axis12,this.axis20,12,this.vectorToBox1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!this.method_825(box1,box2,this.axis12,this.axis21,13,this.vectorToBox1))
|
||||
if(!this.§_-kt§(box1,box2,this.axis12,this.axis21,13,this.vectorToBox1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!this.method_825(box1,box2,this.axis12,this.axis22,14,this.vectorToBox1))
|
||||
if(!this.§_-kt§(box1,box2,this.axis12,this.axis22,14,this.vectorToBox1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private function method_828(box1:name_377, box2:name_377, vectorToBox1:name_194, faceAxisIdx:int, contact:name_630) : Boolean
|
||||
private function §_-NV§(box1:§_-m3§, box2:§_-m3§, vectorToBox1:§_-bj§, faceAxisIdx:int, contact:§_-6h§) : Boolean
|
||||
{
|
||||
var transform2:Matrix4 = null;
|
||||
var colAxis:name_194 = null;
|
||||
var colAxis:§_-bj§ = null;
|
||||
var incidentAxisDot:Number = NaN;
|
||||
var pen:Number = NaN;
|
||||
var tmpBox:name_377 = null;
|
||||
var tmpBox:§_-m3§ = null;
|
||||
var dot:Number = NaN;
|
||||
var absDot:Number = NaN;
|
||||
var v:name_194 = null;
|
||||
var cp:name_674 = null;
|
||||
var cpPos:name_194 = null;
|
||||
var r:name_194 = null;
|
||||
var v:§_-bj§ = null;
|
||||
var cp:§_-cR§ = null;
|
||||
var cpPos:§_-bj§ = null;
|
||||
var r:§_-bj§ = null;
|
||||
var swapNormal:Boolean = false;
|
||||
if(faceAxisIdx > 2)
|
||||
{
|
||||
@@ -240,18 +240,18 @@ package package_121
|
||||
axisIdx++;
|
||||
}
|
||||
transform2.getAxis(incidentAxisIdx,this.axis);
|
||||
method_824(box2.hs,incidentAxisIdx,incidentAxisDot < 0,this.points1);
|
||||
transform2.method_357(this.points1,this.points2,4);
|
||||
transform1.method_352(this.points2,this.points1,4);
|
||||
§_-ho§(box2.hs,incidentAxisIdx,incidentAxisDot < 0,this.points1);
|
||||
transform2.§_-ZK§(this.points1,this.points2,4);
|
||||
transform1.§_-iX§(this.points2,this.points1,4);
|
||||
var pnum:int = this.clip(box1.hs,faceAxisIdx);
|
||||
this.name_679 = 0;
|
||||
this.§_-P3§ = 0;
|
||||
for(var i:int = 0; i < pnum; )
|
||||
{
|
||||
v = this.points1[i];
|
||||
pen = this.method_830(box1.hs,v,faceAxisIdx,negativeFace);
|
||||
pen = this.§_-iN§(box1.hs,v,faceAxisIdx,negativeFace);
|
||||
if(pen > -this.epsilon)
|
||||
{
|
||||
cp = this.var_683[this.name_679++];
|
||||
cp = this.§_-2r§[this.§_-P3§++];
|
||||
cpPos = cp.pos;
|
||||
cpPos.x = transform1.a * v.x + transform1.b * v.y + transform1.c * v.z + transform1.d;
|
||||
cpPos.y = transform1.e * v.x + transform1.f * v.y + transform1.g * v.z + transform1.h;
|
||||
@@ -274,41 +274,41 @@ package package_121
|
||||
colAxis.y = -colAxis.y;
|
||||
colAxis.z = -colAxis.z;
|
||||
}
|
||||
if(this.name_679 > 4)
|
||||
if(this.§_-P3§ > 4)
|
||||
{
|
||||
this.method_840();
|
||||
this.§_-PC§();
|
||||
}
|
||||
for(i = 0; i < this.name_679; )
|
||||
for(i = 0; i < this.§_-P3§; )
|
||||
{
|
||||
cp = contact.points[i];
|
||||
cp.copyFrom(this.var_683[i]);
|
||||
cp.copyFrom(this.§_-2r§[i]);
|
||||
i++;
|
||||
}
|
||||
contact.name_679 = this.name_679;
|
||||
contact.§_-P3§ = this.§_-P3§;
|
||||
return true;
|
||||
}
|
||||
|
||||
private function method_840() : void
|
||||
private function §_-PC§() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var minIdx:int = 0;
|
||||
var cp1:name_674 = null;
|
||||
var cp2:name_674 = null;
|
||||
var cp1:§_-cR§ = null;
|
||||
var cp2:§_-cR§ = null;
|
||||
var minLen:Number = NaN;
|
||||
var p1:name_194 = null;
|
||||
var p2:name_194 = null;
|
||||
var p1:§_-bj§ = null;
|
||||
var p2:§_-bj§ = null;
|
||||
var ii:int = 0;
|
||||
var dx:Number = NaN;
|
||||
var dy:Number = NaN;
|
||||
var dz:Number = NaN;
|
||||
var len:Number = NaN;
|
||||
while(this.name_679 > 4)
|
||||
while(this.§_-P3§ > 4)
|
||||
{
|
||||
minLen = 10000000000;
|
||||
p1 = (this.var_683[int(this.name_679 - 1)] as name_674).pos;
|
||||
for(i = 0; i < this.name_679; i++)
|
||||
p1 = (this.§_-2r§[int(this.§_-P3§ - 1)] as §_-cR§).pos;
|
||||
for(i = 0; i < this.§_-P3§; i++)
|
||||
{
|
||||
p2 = (this.var_683[i] as name_674).pos;
|
||||
p2 = (this.§_-2r§[i] as §_-cR§).pos;
|
||||
dx = p2.x - p1.x;
|
||||
dy = p2.y - p1.y;
|
||||
dz = p2.z - p1.z;
|
||||
@@ -320,9 +320,9 @@ package package_121
|
||||
}
|
||||
p1 = p2;
|
||||
}
|
||||
ii = minIdx == 0 ? this.name_679 - 1 : minIdx - 1;
|
||||
cp1 = this.var_683[ii];
|
||||
cp2 = this.var_683[minIdx];
|
||||
ii = minIdx == 0 ? this.§_-P3§ - 1 : minIdx - 1;
|
||||
cp1 = this.§_-2r§[ii];
|
||||
cp2 = this.§_-2r§[minIdx];
|
||||
p1 = cp1.pos;
|
||||
p2 = cp2.pos;
|
||||
p2.x = 0.5 * (p1.x + p2.x);
|
||||
@@ -331,17 +331,17 @@ package package_121
|
||||
cp2.penetration = 0.5 * (cp1.penetration + cp2.penetration);
|
||||
if(minIdx > 0)
|
||||
{
|
||||
for(i = minIdx; i < this.name_679; i++)
|
||||
for(i = minIdx; i < this.§_-P3§; i++)
|
||||
{
|
||||
this.var_683[int(i - 1)] = this.var_683[i];
|
||||
this.§_-2r§[int(i - 1)] = this.§_-2r§[i];
|
||||
}
|
||||
this.var_683[int(this.name_679 - 1)] = cp1;
|
||||
this.§_-2r§[int(this.§_-P3§ - 1)] = cp1;
|
||||
}
|
||||
--this.name_679;
|
||||
--this.§_-P3§;
|
||||
}
|
||||
}
|
||||
|
||||
private function method_830(hs:name_194, p:name_194, faceAxisIdx:int, reverse:Boolean) : Number
|
||||
private function §_-iN§(hs:§_-bj§, p:§_-bj§, faceAxisIdx:int, reverse:Boolean) : Number
|
||||
{
|
||||
switch(faceAxisIdx)
|
||||
{
|
||||
@@ -371,71 +371,71 @@ package package_121
|
||||
}
|
||||
}
|
||||
|
||||
private function clip(hs:name_194, faceAxisIdx:int) : int
|
||||
private function clip(hs:§_-bj§, faceAxisIdx:int) : int
|
||||
{
|
||||
var pnum:int = 4;
|
||||
switch(faceAxisIdx)
|
||||
{
|
||||
case 0:
|
||||
pnum = method_819(-hs.z,pnum,this.points1,this.points2,this.epsilon);
|
||||
pnum = int(§_-Yb§(-hs.z,pnum,this.points1,this.points2,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pnum = method_820(hs.z,pnum,this.points2,this.points1,this.epsilon);
|
||||
pnum = int(§_-Cg§(hs.z,pnum,this.points2,this.points1,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pnum = method_818(-hs.y,pnum,this.points1,this.points2,this.epsilon);
|
||||
pnum = int(§_-BG§(-hs.y,pnum,this.points1,this.points2,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return method_823(hs.y,pnum,this.points2,this.points1,this.epsilon);
|
||||
return §_-Ro§(hs.y,pnum,this.points2,this.points1,this.epsilon);
|
||||
break;
|
||||
case 1:
|
||||
pnum = method_819(-hs.z,pnum,this.points1,this.points2,this.epsilon);
|
||||
pnum = int(§_-Yb§(-hs.z,pnum,this.points1,this.points2,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pnum = method_820(hs.z,pnum,this.points2,this.points1,this.epsilon);
|
||||
pnum = int(§_-Cg§(hs.z,pnum,this.points2,this.points1,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pnum = method_822(-hs.x,pnum,this.points1,this.points2,this.epsilon);
|
||||
pnum = int(§_-ii§(-hs.x,pnum,this.points1,this.points2,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return method_821(hs.x,pnum,this.points2,this.points1,this.epsilon);
|
||||
return §_-KZ§(hs.x,pnum,this.points2,this.points1,this.epsilon);
|
||||
break;
|
||||
case 2:
|
||||
pnum = method_822(-hs.x,pnum,this.points1,this.points2,this.epsilon);
|
||||
pnum = int(§_-ii§(-hs.x,pnum,this.points1,this.points2,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pnum = method_821(hs.x,pnum,this.points2,this.points1,this.epsilon);
|
||||
pnum = int(§_-KZ§(hs.x,pnum,this.points2,this.points1,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pnum = method_818(-hs.y,pnum,this.points1,this.points2,this.epsilon);
|
||||
pnum = int(§_-BG§(-hs.y,pnum,this.points1,this.points2,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return method_823(hs.y,pnum,this.points2,this.points1,this.epsilon);
|
||||
return §_-Ro§(hs.y,pnum,this.points2,this.points1,this.epsilon);
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private function method_831(box1:name_377, box2:name_377, vectorToBox1:name_194, axisIdx1:int, axisIdx2:int, contact:name_630) : void
|
||||
private function §_-og§(box1:§_-m3§, box2:§_-m3§, vectorToBox1:§_-bj§, axisIdx1:int, axisIdx2:int, contact:§_-6h§) : void
|
||||
{
|
||||
var halfLen1:Number = NaN;
|
||||
var halfLen2:Number = NaN;
|
||||
@@ -443,7 +443,7 @@ package package_121
|
||||
var transform2:Matrix4 = box2.transform;
|
||||
transform1.getAxis(axisIdx1,this.axis10);
|
||||
transform2.getAxis(axisIdx2,this.axis20);
|
||||
var colAxis:name_194 = contact.normal;
|
||||
var colAxis:§_-bj§ = contact.normal;
|
||||
colAxis.x = this.axis10.y * this.axis20.z - this.axis10.z * this.axis20.y;
|
||||
colAxis.y = this.axis10.z * this.axis20.x - this.axis10.x * this.axis20.z;
|
||||
colAxis.z = this.axis10.x * this.axis20.y - this.axis10.y * this.axis20.x;
|
||||
@@ -457,16 +457,16 @@ package package_121
|
||||
colAxis.y = -colAxis.y;
|
||||
colAxis.z = -colAxis.z;
|
||||
}
|
||||
var tx:Number = box1.hs.x;
|
||||
var ty:Number = box1.hs.y;
|
||||
var tz:Number = box1.hs.z;
|
||||
var x2:Number = box2.hs.x;
|
||||
var y2:Number = box2.hs.y;
|
||||
var z2:Number = box2.hs.z;
|
||||
var tx:Number = Number(box1.hs.x);
|
||||
var ty:Number = Number(box1.hs.y);
|
||||
var tz:Number = Number(box1.hs.z);
|
||||
var x2:Number = Number(box2.hs.x);
|
||||
var y2:Number = Number(box2.hs.y);
|
||||
var z2:Number = Number(box2.hs.z);
|
||||
if(axisIdx1 == 0)
|
||||
{
|
||||
tx = 0;
|
||||
halfLen1 = box1.hs.x;
|
||||
halfLen1 = Number(box1.hs.x);
|
||||
}
|
||||
else if(colAxis.x * transform1.a + colAxis.y * transform1.e + colAxis.z * transform1.i > 0)
|
||||
{
|
||||
@@ -475,7 +475,7 @@ package package_121
|
||||
if(axisIdx2 == 0)
|
||||
{
|
||||
x2 = 0;
|
||||
halfLen2 = box2.hs.x;
|
||||
halfLen2 = Number(box2.hs.x);
|
||||
}
|
||||
else if(colAxis.x * transform2.a + colAxis.y * transform2.e + colAxis.z * transform2.i < 0)
|
||||
{
|
||||
@@ -484,7 +484,7 @@ package package_121
|
||||
if(axisIdx1 == 1)
|
||||
{
|
||||
ty = 0;
|
||||
halfLen1 = box1.hs.y;
|
||||
halfLen1 = Number(box1.hs.y);
|
||||
}
|
||||
else if(colAxis.x * transform1.b + colAxis.y * transform1.f + colAxis.z * transform1.j > 0)
|
||||
{
|
||||
@@ -493,7 +493,7 @@ package package_121
|
||||
if(axisIdx2 == 1)
|
||||
{
|
||||
y2 = 0;
|
||||
halfLen2 = box2.hs.y;
|
||||
halfLen2 = Number(box2.hs.y);
|
||||
}
|
||||
else if(colAxis.x * transform2.b + colAxis.y * transform2.f + colAxis.z * transform2.j < 0)
|
||||
{
|
||||
@@ -502,7 +502,7 @@ package package_121
|
||||
if(axisIdx1 == 2)
|
||||
{
|
||||
tz = 0;
|
||||
halfLen1 = box1.hs.z;
|
||||
halfLen1 = Number(box1.hs.z);
|
||||
}
|
||||
else if(colAxis.x * transform1.c + colAxis.y * transform1.g + colAxis.z * transform1.k > 0)
|
||||
{
|
||||
@@ -511,7 +511,7 @@ package package_121
|
||||
if(axisIdx2 == 2)
|
||||
{
|
||||
z2 = 0;
|
||||
halfLen2 = box2.hs.z;
|
||||
halfLen2 = Number(box2.hs.z);
|
||||
}
|
||||
else if(colAxis.x * transform2.c + colAxis.y * transform2.g + colAxis.z * transform2.k < 0)
|
||||
{
|
||||
@@ -535,13 +535,13 @@ package package_121
|
||||
var c2:Number = this.axis20.x * tx + this.axis20.y * ty + this.axis20.z * tz;
|
||||
var t1:Number = (c2 * k - c1) / det;
|
||||
var t2:Number = (c2 - c1 * k) / det;
|
||||
contact.name_679 = 1;
|
||||
var cp:name_674 = contact.points[0];
|
||||
var cpPos:name_194 = cp.pos;
|
||||
contact.§_-P3§ = 1;
|
||||
var cp:§_-cR§ = contact.points[0];
|
||||
var cpPos:§_-bj§ = cp.pos;
|
||||
cp.pos.x = 0.5 * (x1 + this.axis10.x * t1 + x2 + this.axis20.x * t2);
|
||||
cp.pos.y = 0.5 * (y1 + this.axis10.y * t1 + y2 + this.axis20.y * t2);
|
||||
cp.pos.z = 0.5 * (z1 + this.axis10.z * t1 + z2 + this.axis20.z * t2);
|
||||
var r:name_194 = cp.r1;
|
||||
var r:§_-bj§ = cp.r1;
|
||||
r.x = cpPos.x - transform1.d;
|
||||
r.y = cpPos.y - transform1.h;
|
||||
r.z = cpPos.z - transform1.l;
|
||||
@@ -549,25 +549,25 @@ package package_121
|
||||
r.x = cpPos.x - transform2.d;
|
||||
r.y = cpPos.y - transform2.h;
|
||||
r.z = cpPos.z - transform2.l;
|
||||
cp.penetration = this.var_676;
|
||||
cp.penetration = this.§_-hK§;
|
||||
}
|
||||
|
||||
private function method_826(box1:name_377, box2:name_377, axis:name_194, axisIndex:int, toBox1:name_194) : Boolean
|
||||
private function §_-mG§(box1:§_-m3§, box2:§_-m3§, axis:§_-bj§, axisIndex:int, toBox1:§_-bj§) : Boolean
|
||||
{
|
||||
var overlap:Number = this.method_827(box1,box2,axis,toBox1);
|
||||
var overlap:Number = this.§true§(box1,box2,axis,toBox1);
|
||||
if(overlap < -this.epsilon)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(overlap + this.epsilon < this.var_676)
|
||||
if(overlap + this.epsilon < this.§_-hK§)
|
||||
{
|
||||
this.var_676 = overlap;
|
||||
this.var_675 = axisIndex;
|
||||
this.§_-hK§ = overlap;
|
||||
this.§_-Wt§ = axisIndex;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private function method_825(box1:name_377, box2:name_377, axis1:name_194, axis2:name_194, axisIndex:int, toBox1:name_194) : Boolean
|
||||
private function §_-kt§(box1:§_-m3§, box2:§_-m3§, axis1:§_-bj§, axis2:§_-bj§, axisIndex:int, toBox1:§_-bj§) : Boolean
|
||||
{
|
||||
this.axis.x = axis1.y * axis2.z - axis1.z * axis2.y;
|
||||
this.axis.y = axis1.z * axis2.x - axis1.x * axis2.z;
|
||||
@@ -581,20 +581,20 @@ package package_121
|
||||
this.axis.x *= k;
|
||||
this.axis.y *= k;
|
||||
this.axis.z *= k;
|
||||
var overlap:Number = this.method_827(box1,box2,this.axis,toBox1);
|
||||
var overlap:Number = this.§true§(box1,box2,this.axis,toBox1);
|
||||
if(overlap < -this.epsilon)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(overlap + this.epsilon < this.var_676)
|
||||
if(overlap + this.epsilon < this.§_-hK§)
|
||||
{
|
||||
this.var_676 = overlap;
|
||||
this.var_675 = axisIndex;
|
||||
this.§_-hK§ = overlap;
|
||||
this.§_-Wt§ = axisIndex;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function method_827(box1:name_377, box2:name_377, axis:name_194, vectorToBox1:name_194) : Number
|
||||
public function §true§(box1:§_-m3§, box2:§_-m3§, axis:§_-bj§, vectorToBox1:§_-bj§) : Number
|
||||
{
|
||||
var m:Matrix4 = box1.transform;
|
||||
var d:Number = (m.a * axis.x + m.e * axis.y + m.i * axis.z) * box1.hs.x;
|
||||
@@ -644,11 +644,11 @@ package package_121
|
||||
}
|
||||
}
|
||||
|
||||
import package_46.name_194;
|
||||
import §_-nl§.§_-bj§;
|
||||
|
||||
class CollisionPointTmp
|
||||
{
|
||||
public var pos:name_194 = new name_194();
|
||||
public var pos:§_-bj§ = new §_-bj§();
|
||||
|
||||
public var penetration:Number;
|
||||
|
||||
@@ -1,81 +1,81 @@
|
||||
package package_121
|
||||
package §while§
|
||||
{
|
||||
import package_109.name_377;
|
||||
import package_109.name_378;
|
||||
import package_46.Matrix4;
|
||||
import package_46.name_194;
|
||||
import package_76.name_235;
|
||||
import package_92.name_630;
|
||||
import package_92.name_674;
|
||||
import §_-1e§.§_-Nh§;
|
||||
import §_-US§.§_-6h§;
|
||||
import §_-US§.§_-cR§;
|
||||
import §_-nl§.Matrix4;
|
||||
import §_-nl§.§_-bj§;
|
||||
import §_-pe§.§_-Pr§;
|
||||
import §_-pe§.§_-m3§;
|
||||
|
||||
public class name_668 extends class_41
|
||||
public class §_-hu§ extends §_-dj§
|
||||
{
|
||||
public var epsilon:Number = 0.001;
|
||||
|
||||
private var var_675:int;
|
||||
private var §_-Wt§:int;
|
||||
|
||||
private var var_676:Number;
|
||||
private var §_-hK§:Number;
|
||||
|
||||
private var toBox:name_194 = new name_194();
|
||||
private var toBox:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var axis:name_194 = new name_194();
|
||||
private var axis:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var var_682:name_194 = new name_194();
|
||||
private var §_-VZ§:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var axis10:name_194 = new name_194();
|
||||
private var axis10:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var axis11:name_194 = new name_194();
|
||||
private var axis11:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var axis12:name_194 = new name_194();
|
||||
private var axis12:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var axis20:name_194 = new name_194();
|
||||
private var axis20:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var axis21:name_194 = new name_194();
|
||||
private var axis21:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var axis22:name_194 = new name_194();
|
||||
private var axis22:§_-bj§ = new §_-bj§();
|
||||
|
||||
private var points1:Vector.<name_194> = new Vector.<name_194>(8,true);
|
||||
private var points1:Vector.<§_-bj§> = new Vector.<§_-bj§>(8,true);
|
||||
|
||||
private var points2:Vector.<name_194> = new Vector.<name_194>(8,true);
|
||||
private var points2:Vector.<§_-bj§> = new Vector.<§_-bj§>(8,true);
|
||||
|
||||
public function name_668()
|
||||
public function §_-hu§()
|
||||
{
|
||||
super();
|
||||
for(var i:int = 0; i < 8; i++)
|
||||
{
|
||||
this.points1[i] = new name_194();
|
||||
this.points2[i] = new name_194();
|
||||
this.points1[i] = new §_-bj§();
|
||||
this.points2[i] = new §_-bj§();
|
||||
}
|
||||
}
|
||||
|
||||
override public function getContact(prim1:name_235, prim2:name_235, contact:name_630) : Boolean
|
||||
override public function getContact(prim1:§_-Nh§, prim2:§_-Nh§, contact:§_-6h§) : Boolean
|
||||
{
|
||||
var box:name_377 = null;
|
||||
var box:§_-m3§ = null;
|
||||
if(!this.haveCollision(prim1,prim2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var tri:name_378 = prim1 as name_378;
|
||||
var tri:§_-Pr§ = prim1 as §_-Pr§;
|
||||
if(tri == null)
|
||||
{
|
||||
box = name_377(prim1);
|
||||
tri = name_378(prim2);
|
||||
box = §_-m3§(prim1);
|
||||
tri = §_-Pr§(prim2);
|
||||
}
|
||||
else
|
||||
{
|
||||
box = name_377(prim2);
|
||||
box = §_-m3§(prim2);
|
||||
}
|
||||
if(this.var_675 < 4)
|
||||
if(this.§_-Wt§ < 4)
|
||||
{
|
||||
if(!this.method_828(box,tri,this.toBox,this.var_675,contact))
|
||||
if(!this.§_-NV§(box,tri,this.toBox,this.§_-Wt§,contact))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.var_675 -= 4;
|
||||
if(!this.method_831(box,tri,this.toBox,this.var_675 % 3,int(this.var_675 / 3),contact))
|
||||
this.§_-Wt§ -= 4;
|
||||
if(!this.§_-og§(box,tri,this.toBox,this.§_-Wt§ % 3,int(this.§_-Wt§ / 3),contact))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -91,53 +91,53 @@ package package_121
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function haveCollision(prim1:name_235, prim2:name_235) : Boolean
|
||||
override public function haveCollision(prim1:§_-Nh§, prim2:§_-Nh§) : Boolean
|
||||
{
|
||||
var tri:name_378 = null;
|
||||
var box:name_377 = null;
|
||||
var tri:§_-Pr§ = null;
|
||||
var box:§_-m3§ = null;
|
||||
var triTransform:Matrix4 = null;
|
||||
var v:name_194 = null;
|
||||
tri = prim1 as name_378;
|
||||
var v:§_-bj§ = null;
|
||||
tri = prim1 as §_-Pr§;
|
||||
if(tri == null)
|
||||
{
|
||||
box = name_377(prim1);
|
||||
tri = name_378(prim2);
|
||||
box = §_-m3§(prim1);
|
||||
tri = §_-Pr§(prim2);
|
||||
}
|
||||
else
|
||||
{
|
||||
box = name_377(prim2);
|
||||
box = §_-m3§(prim2);
|
||||
}
|
||||
var boxTransform:Matrix4 = box.transform;
|
||||
triTransform = tri.transform;
|
||||
this.toBox.x = boxTransform.d - triTransform.d;
|
||||
this.toBox.y = boxTransform.h - triTransform.h;
|
||||
this.toBox.z = boxTransform.l - triTransform.l;
|
||||
this.var_676 = 1e+308;
|
||||
this.§_-hK§ = 1e+308;
|
||||
this.axis.x = triTransform.c;
|
||||
this.axis.y = triTransform.g;
|
||||
this.axis.z = triTransform.k;
|
||||
if(!this.method_826(box,tri,this.axis,0,this.toBox))
|
||||
if(!this.§_-mG§(box,tri,this.axis,0,this.toBox))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.axis10.x = boxTransform.a;
|
||||
this.axis10.y = boxTransform.e;
|
||||
this.axis10.z = boxTransform.i;
|
||||
if(!this.method_826(box,tri,this.axis10,1,this.toBox))
|
||||
if(!this.§_-mG§(box,tri,this.axis10,1,this.toBox))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.axis11.x = boxTransform.b;
|
||||
this.axis11.y = boxTransform.f;
|
||||
this.axis11.z = boxTransform.j;
|
||||
if(!this.method_826(box,tri,this.axis11,2,this.toBox))
|
||||
if(!this.§_-mG§(box,tri,this.axis11,2,this.toBox))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
this.axis12.x = boxTransform.c;
|
||||
this.axis12.y = boxTransform.g;
|
||||
this.axis12.z = boxTransform.k;
|
||||
if(!this.method_826(box,tri,this.axis12,3,this.toBox))
|
||||
if(!this.§_-mG§(box,tri,this.axis12,3,this.toBox))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -145,15 +145,15 @@ package package_121
|
||||
this.axis20.x = triTransform.a * v.x + triTransform.b * v.y + triTransform.c * v.z;
|
||||
this.axis20.y = triTransform.e * v.x + triTransform.f * v.y + triTransform.g * v.z;
|
||||
this.axis20.z = triTransform.i * v.x + triTransform.j * v.y + triTransform.k * v.z;
|
||||
if(!this.method_825(box,tri,this.axis10,this.axis20,4,this.toBox))
|
||||
if(!this.§_-kt§(box,tri,this.axis10,this.axis20,4,this.toBox))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!this.method_825(box,tri,this.axis11,this.axis20,5,this.toBox))
|
||||
if(!this.§_-kt§(box,tri,this.axis11,this.axis20,5,this.toBox))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!this.method_825(box,tri,this.axis12,this.axis20,6,this.toBox))
|
||||
if(!this.§_-kt§(box,tri,this.axis12,this.axis20,6,this.toBox))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -161,15 +161,15 @@ package package_121
|
||||
this.axis21.x = triTransform.a * v.x + triTransform.b * v.y + triTransform.c * v.z;
|
||||
this.axis21.y = triTransform.e * v.x + triTransform.f * v.y + triTransform.g * v.z;
|
||||
this.axis21.z = triTransform.i * v.x + triTransform.j * v.y + triTransform.k * v.z;
|
||||
if(!this.method_825(box,tri,this.axis10,this.axis21,7,this.toBox))
|
||||
if(!this.§_-kt§(box,tri,this.axis10,this.axis21,7,this.toBox))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!this.method_825(box,tri,this.axis11,this.axis21,8,this.toBox))
|
||||
if(!this.§_-kt§(box,tri,this.axis11,this.axis21,8,this.toBox))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!this.method_825(box,tri,this.axis12,this.axis21,9,this.toBox))
|
||||
if(!this.§_-kt§(box,tri,this.axis12,this.axis21,9,this.toBox))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -177,37 +177,37 @@ package package_121
|
||||
this.axis22.x = triTransform.a * v.x + triTransform.b * v.y + triTransform.c * v.z;
|
||||
this.axis22.y = triTransform.e * v.x + triTransform.f * v.y + triTransform.g * v.z;
|
||||
this.axis22.z = triTransform.i * v.x + triTransform.j * v.y + triTransform.k * v.z;
|
||||
if(!this.method_825(box,tri,this.axis10,this.axis22,10,this.toBox))
|
||||
if(!this.§_-kt§(box,tri,this.axis10,this.axis22,10,this.toBox))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!this.method_825(box,tri,this.axis11,this.axis22,11,this.toBox))
|
||||
if(!this.§_-kt§(box,tri,this.axis11,this.axis22,11,this.toBox))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!this.method_825(box,tri,this.axis12,this.axis22,12,this.toBox))
|
||||
if(!this.§_-kt§(box,tri,this.axis12,this.axis22,12,this.toBox))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private function method_826(box:name_377, tri:name_378, axis:name_194, axisIndex:int, toBox:name_194) : Boolean
|
||||
private function §_-mG§(box:§_-m3§, tri:§_-Pr§, axis:§_-bj§, axisIndex:int, toBox:§_-bj§) : Boolean
|
||||
{
|
||||
var overlap:Number = this.method_827(box,tri,axis,toBox);
|
||||
var overlap:Number = this.§true§(box,tri,axis,toBox);
|
||||
if(overlap < -this.epsilon)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(overlap + this.epsilon < this.var_676)
|
||||
if(overlap + this.epsilon < this.§_-hK§)
|
||||
{
|
||||
this.var_676 = overlap;
|
||||
this.var_675 = axisIndex;
|
||||
this.§_-hK§ = overlap;
|
||||
this.§_-Wt§ = axisIndex;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private function method_825(box:name_377, tri:name_378, axis1:name_194, axis2:name_194, axisIndex:int, toBox:name_194) : Boolean
|
||||
private function §_-kt§(box:§_-m3§, tri:§_-Pr§, axis1:§_-bj§, axis2:§_-bj§, axisIndex:int, toBox:§_-bj§) : Boolean
|
||||
{
|
||||
var k:Number = NaN;
|
||||
this.axis.x = axis1.y * axis2.z - axis1.z * axis2.y;
|
||||
@@ -222,20 +222,20 @@ package package_121
|
||||
this.axis.x *= k;
|
||||
this.axis.y *= k;
|
||||
this.axis.z *= k;
|
||||
var overlap:Number = this.method_827(box,tri,this.axis,toBox);
|
||||
var overlap:Number = this.§true§(box,tri,this.axis,toBox);
|
||||
if(overlap < -this.epsilon)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(overlap + this.epsilon < this.var_676)
|
||||
if(overlap + this.epsilon < this.§_-hK§)
|
||||
{
|
||||
this.var_676 = overlap;
|
||||
this.var_675 = axisIndex;
|
||||
this.§_-hK§ = overlap;
|
||||
this.§_-Wt§ = axisIndex;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private function method_827(box:name_377, tri:name_378, axis:name_194, toBox:name_194) : Number
|
||||
private function §true§(box:§_-m3§, tri:§_-Pr§, axis:§_-bj§, toBox:§_-bj§) : Number
|
||||
{
|
||||
var t:Matrix4 = box.transform;
|
||||
var projection:Number = (t.a * axis.x + t.e * axis.y + t.i * axis.z) * box.hs.x;
|
||||
@@ -294,34 +294,34 @@ package package_121
|
||||
return projection + max - vectorProjection;
|
||||
}
|
||||
|
||||
private function method_828(box:name_377, tri:name_378, toBox:name_194, faceAxisIndex:int, contact:name_630) : Boolean
|
||||
private function §_-NV§(box:§_-m3§, tri:§_-Pr§, toBox:§_-bj§, faceAxisIndex:int, contact:§_-6h§) : Boolean
|
||||
{
|
||||
if(faceAxisIndex == 0)
|
||||
{
|
||||
return this.method_837(box,tri,toBox,contact);
|
||||
return this.§_-hz§(box,tri,toBox,contact);
|
||||
}
|
||||
return this.method_838(box,tri,toBox,faceAxisIndex,contact);
|
||||
return this.§_-C-§(box,tri,toBox,faceAxisIndex,contact);
|
||||
}
|
||||
|
||||
private function method_837(box:name_377, tri:name_378, toBox:name_194, contact:name_630) : Boolean
|
||||
private function §_-hz§(box:§_-m3§, tri:§_-Pr§, toBox:§_-bj§, contact:§_-6h§) : Boolean
|
||||
{
|
||||
var cp:name_674 = null;
|
||||
var cp:§_-cR§ = null;
|
||||
var dot:Number = NaN;
|
||||
var absDot:Number = NaN;
|
||||
var v:name_194 = null;
|
||||
var cpPos:name_194 = null;
|
||||
var r:name_194 = null;
|
||||
var v:§_-bj§ = null;
|
||||
var cpPos:§_-bj§ = null;
|
||||
var r:§_-bj§ = null;
|
||||
var boxTransform:Matrix4 = box.transform;
|
||||
var triTransform:Matrix4 = tri.transform;
|
||||
this.var_682.x = triTransform.c;
|
||||
this.var_682.y = triTransform.g;
|
||||
this.var_682.z = triTransform.k;
|
||||
var over:Boolean = toBox.x * this.var_682.x + toBox.y * this.var_682.y + toBox.z * this.var_682.z > 0;
|
||||
this.§_-VZ§.x = triTransform.c;
|
||||
this.§_-VZ§.y = triTransform.g;
|
||||
this.§_-VZ§.z = triTransform.k;
|
||||
var over:Boolean = toBox.x * this.§_-VZ§.x + toBox.y * this.§_-VZ§.y + toBox.z * this.§_-VZ§.z > 0;
|
||||
if(!over)
|
||||
{
|
||||
this.var_682.x = -this.var_682.x;
|
||||
this.var_682.y = -this.var_682.y;
|
||||
this.var_682.z = -this.var_682.z;
|
||||
this.§_-VZ§.x = -this.§_-VZ§.x;
|
||||
this.§_-VZ§.y = -this.§_-VZ§.y;
|
||||
this.§_-VZ§.z = -this.§_-VZ§.z;
|
||||
}
|
||||
var incFaceAxisIdx:int = 0;
|
||||
var incAxisDot:Number = 0;
|
||||
@@ -329,7 +329,7 @@ package package_121
|
||||
for(var axisIdx:int = 0; axisIdx < 3; )
|
||||
{
|
||||
boxTransform.getAxis(axisIdx,this.axis);
|
||||
dot = this.axis.x * this.var_682.x + this.axis.y * this.var_682.y + this.axis.z * this.var_682.z;
|
||||
dot = this.axis.x * this.§_-VZ§.x + this.axis.y * this.§_-VZ§.y + this.axis.z * this.§_-VZ§.z;
|
||||
absDot = dot < 0 ? -dot : dot;
|
||||
if(absDot > maxDot)
|
||||
{
|
||||
@@ -340,17 +340,17 @@ package package_121
|
||||
axisIdx++;
|
||||
}
|
||||
var negativeFace:Boolean = incAxisDot > 0;
|
||||
method_824(box.hs,incFaceAxisIdx,negativeFace,this.points1);
|
||||
boxTransform.method_357(this.points1,this.points2,4);
|
||||
triTransform.method_352(this.points2,this.points1,4);
|
||||
var pnum:int = this.method_839(tri);
|
||||
contact.name_679 = 0;
|
||||
§_-ho§(box.hs,incFaceAxisIdx,negativeFace,this.points1);
|
||||
boxTransform.§_-ZK§(this.points1,this.points2,4);
|
||||
triTransform.§_-iX§(this.points2,this.points1,4);
|
||||
var pnum:int = this.§_-MQ§(tri);
|
||||
contact.§_-P3§ = 0;
|
||||
for(var i:int = 0; i < pnum; )
|
||||
{
|
||||
v = this.points2[i];
|
||||
if(over && v.z < 0 || !over && v.z > 0)
|
||||
{
|
||||
cp = contact.points[contact.name_679++];
|
||||
cp = contact.points[contact.§_-P3§++];
|
||||
cpPos = cp.pos;
|
||||
cpPos.x = triTransform.a * v.x + triTransform.b * v.y + triTransform.c * v.z + triTransform.d;
|
||||
cpPos.y = triTransform.e * v.x + triTransform.f * v.y + triTransform.g * v.z + triTransform.h;
|
||||
@@ -363,34 +363,34 @@ package package_121
|
||||
r.x = cpPos.x - triTransform.d;
|
||||
r.y = cpPos.y - triTransform.h;
|
||||
r.z = cpPos.z - triTransform.l;
|
||||
cp.penetration = over ? -v.z : v.z;
|
||||
cp.penetration = over ? -v.z : Number(v.z);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
contact.normal.x = this.var_682.x;
|
||||
contact.normal.y = this.var_682.y;
|
||||
contact.normal.z = this.var_682.z;
|
||||
contact.normal.x = this.§_-VZ§.x;
|
||||
contact.normal.y = this.§_-VZ§.y;
|
||||
contact.normal.z = this.§_-VZ§.z;
|
||||
return true;
|
||||
}
|
||||
|
||||
private function method_838(box:name_377, tri:name_378, toBox:name_194, faceAxisIdx:int, contact:name_630) : Boolean
|
||||
private function §_-C-§(box:§_-m3§, tri:§_-Pr§, toBox:§_-bj§, faceAxisIdx:int, contact:§_-6h§) : Boolean
|
||||
{
|
||||
var penetration:Number = NaN;
|
||||
var cp:name_674 = null;
|
||||
var cpPos:name_194 = null;
|
||||
var r:name_194 = null;
|
||||
var cp:§_-cR§ = null;
|
||||
var cpPos:§_-bj§ = null;
|
||||
var r:§_-bj§ = null;
|
||||
faceAxisIdx--;
|
||||
var boxTransform:Matrix4 = box.transform;
|
||||
var triTransform:Matrix4 = tri.transform;
|
||||
boxTransform.getAxis(faceAxisIdx,this.var_682);
|
||||
var negativeFace:Boolean = toBox.x * this.var_682.x + toBox.y * this.var_682.y + toBox.z * this.var_682.z > 0;
|
||||
boxTransform.getAxis(faceAxisIdx,this.§_-VZ§);
|
||||
var negativeFace:Boolean = toBox.x * this.§_-VZ§.x + toBox.y * this.§_-VZ§.y + toBox.z * this.§_-VZ§.z > 0;
|
||||
if(!negativeFace)
|
||||
{
|
||||
this.var_682.x = -this.var_682.x;
|
||||
this.var_682.y = -this.var_682.y;
|
||||
this.var_682.z = -this.var_682.z;
|
||||
this.§_-VZ§.x = -this.§_-VZ§.x;
|
||||
this.§_-VZ§.y = -this.§_-VZ§.y;
|
||||
this.§_-VZ§.z = -this.§_-VZ§.z;
|
||||
}
|
||||
var v:name_194 = this.points1[0];
|
||||
var v:§_-bj§ = this.points1[0];
|
||||
v.x = tri.v0.x;
|
||||
v.y = tri.v0.y;
|
||||
v.z = tri.v0.z;
|
||||
@@ -402,17 +402,17 @@ package package_121
|
||||
v.x = tri.v2.x;
|
||||
v.y = tri.v2.y;
|
||||
v.z = tri.v2.z;
|
||||
triTransform.method_357(this.points1,this.points2,3);
|
||||
boxTransform.method_352(this.points2,this.points1,3);
|
||||
var pnum:int = this.method_832(box.hs,faceAxisIdx);
|
||||
contact.name_679 = 0;
|
||||
triTransform.§_-ZK§(this.points1,this.points2,3);
|
||||
boxTransform.§_-iX§(this.points2,this.points1,3);
|
||||
var pnum:int = this.§_-kk§(box.hs,faceAxisIdx);
|
||||
contact.§_-P3§ = 0;
|
||||
for(var i:int = 0; i < pnum; )
|
||||
{
|
||||
v = this.points1[i];
|
||||
penetration = this.method_830(box.hs,v,faceAxisIdx,negativeFace);
|
||||
penetration = this.§_-iN§(box.hs,v,faceAxisIdx,negativeFace);
|
||||
if(penetration > -this.epsilon)
|
||||
{
|
||||
cp = contact.points[contact.name_679++];
|
||||
cp = contact.points[contact.§_-P3§++];
|
||||
cpPos = cp.pos;
|
||||
cpPos.x = boxTransform.a * v.x + boxTransform.b * v.y + boxTransform.c * v.z + boxTransform.d;
|
||||
cpPos.y = boxTransform.e * v.x + boxTransform.f * v.y + boxTransform.g * v.z + boxTransform.h;
|
||||
@@ -429,13 +429,13 @@ package package_121
|
||||
}
|
||||
i++;
|
||||
}
|
||||
contact.normal.x = this.var_682.x;
|
||||
contact.normal.y = this.var_682.y;
|
||||
contact.normal.z = this.var_682.z;
|
||||
contact.normal.x = this.§_-VZ§.x;
|
||||
contact.normal.y = this.§_-VZ§.y;
|
||||
contact.normal.z = this.§_-VZ§.z;
|
||||
return true;
|
||||
}
|
||||
|
||||
private function method_830(hs:name_194, p:name_194, faceAxisIdx:int, negativeFace:Boolean) : Number
|
||||
private function §_-iN§(hs:§_-bj§, p:§_-bj§, faceAxisIdx:int, negativeFace:Boolean) : Number
|
||||
{
|
||||
switch(faceAxisIdx)
|
||||
{
|
||||
@@ -465,96 +465,96 @@ package package_121
|
||||
}
|
||||
}
|
||||
|
||||
private function method_832(hs:name_194, faceAxisIdx:int) : int
|
||||
private function §_-kk§(hs:§_-bj§, faceAxisIdx:int) : int
|
||||
{
|
||||
var pnum:int = 3;
|
||||
switch(faceAxisIdx)
|
||||
{
|
||||
case 0:
|
||||
pnum = method_819(-hs.z,pnum,this.points1,this.points2,this.epsilon);
|
||||
pnum = int(§_-Yb§(-hs.z,pnum,this.points1,this.points2,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pnum = method_820(hs.z,pnum,this.points2,this.points1,this.epsilon);
|
||||
pnum = int(§_-Cg§(hs.z,pnum,this.points2,this.points1,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pnum = method_818(-hs.y,pnum,this.points1,this.points2,this.epsilon);
|
||||
pnum = int(§_-BG§(-hs.y,pnum,this.points1,this.points2,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return method_823(hs.y,pnum,this.points2,this.points1,this.epsilon);
|
||||
return §_-Ro§(hs.y,pnum,this.points2,this.points1,this.epsilon);
|
||||
break;
|
||||
case 1:
|
||||
pnum = method_819(-hs.z,pnum,this.points1,this.points2,this.epsilon);
|
||||
pnum = int(§_-Yb§(-hs.z,pnum,this.points1,this.points2,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pnum = method_820(hs.z,pnum,this.points2,this.points1,this.epsilon);
|
||||
pnum = int(§_-Cg§(hs.z,pnum,this.points2,this.points1,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pnum = method_822(-hs.x,pnum,this.points1,this.points2,this.epsilon);
|
||||
pnum = int(§_-ii§(-hs.x,pnum,this.points1,this.points2,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return method_821(hs.x,pnum,this.points2,this.points1,this.epsilon);
|
||||
return §_-KZ§(hs.x,pnum,this.points2,this.points1,this.epsilon);
|
||||
break;
|
||||
case 2:
|
||||
pnum = method_822(-hs.x,pnum,this.points1,this.points2,this.epsilon);
|
||||
pnum = int(§_-ii§(-hs.x,pnum,this.points1,this.points2,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pnum = method_821(hs.x,pnum,this.points2,this.points1,this.epsilon);
|
||||
pnum = int(§_-KZ§(hs.x,pnum,this.points2,this.points1,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pnum = method_818(-hs.y,pnum,this.points1,this.points2,this.epsilon);
|
||||
pnum = int(§_-BG§(-hs.y,pnum,this.points1,this.points2,this.epsilon));
|
||||
if(pnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return method_823(hs.y,pnum,this.points2,this.points1,this.epsilon);
|
||||
return §_-Ro§(hs.y,pnum,this.points2,this.points1,this.epsilon);
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private function method_839(tri:name_378) : int
|
||||
private function §_-MQ§(tri:§_-Pr§) : int
|
||||
{
|
||||
var vnum:int = 4;
|
||||
vnum = this.method_836(tri.v0,tri.e0,this.points1,vnum,this.points2);
|
||||
vnum = this.§_-NG§(tri.v0,tri.e0,this.points1,vnum,this.points2);
|
||||
if(vnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
vnum = this.method_836(tri.v1,tri.e1,this.points2,vnum,this.points1);
|
||||
vnum = this.§_-NG§(tri.v1,tri.e1,this.points2,vnum,this.points1);
|
||||
if(vnum == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return this.method_836(tri.v2,tri.e2,this.points1,vnum,this.points2);
|
||||
return this.§_-NG§(tri.v2,tri.e2,this.points1,vnum,this.points2);
|
||||
}
|
||||
|
||||
private function method_836(linePoint:name_194, lineDir:name_194, verticesIn:Vector.<name_194>, vnum:int, verticesOut:Vector.<name_194>) : int
|
||||
private function §_-NG§(linePoint:§_-bj§, lineDir:§_-bj§, verticesIn:Vector.<§_-bj§>, vnum:int, verticesOut:Vector.<§_-bj§>) : int
|
||||
{
|
||||
var t:Number = NaN;
|
||||
var v:name_194 = null;
|
||||
var v2:name_194 = null;
|
||||
var v:§_-bj§ = null;
|
||||
var v2:§_-bj§ = null;
|
||||
var offset2:Number = NaN;
|
||||
var nx:Number = -lineDir.y;
|
||||
var ny:Number = lineDir.x;
|
||||
var ny:Number = Number(lineDir.x);
|
||||
var offset:Number = linePoint.x * nx + linePoint.y * ny;
|
||||
var v1:name_194 = verticesIn[int(vnum - 1)];
|
||||
var v1:§_-bj§ = verticesIn[int(vnum - 1)];
|
||||
var offset1:Number = v1.x * nx + v1.y * ny;
|
||||
var num:int = 0;
|
||||
for(var i:int = 0; i < vnum; i++)
|
||||
@@ -596,7 +596,7 @@ package package_121
|
||||
return num;
|
||||
}
|
||||
|
||||
private function method_831(box:name_377, tri:name_378, toBox:name_194, boxAxisIdx:int, triAxisIdx:int, contact:name_630) : Boolean
|
||||
private function §_-og§(box:§_-m3§, tri:§_-Pr§, toBox:§_-bj§, boxAxisIdx:int, triAxisIdx:int, contact:§_-6h§) : Boolean
|
||||
{
|
||||
var tmpx1:Number = NaN;
|
||||
var tmpy1:Number = NaN;
|
||||
@@ -609,28 +609,28 @@ package package_121
|
||||
switch(triAxisIdx)
|
||||
{
|
||||
case 0:
|
||||
tmpx1 = tri.e0.x;
|
||||
tmpy1 = tri.e0.y;
|
||||
tmpz1 = tri.e0.z;
|
||||
tmpx2 = tri.v0.x;
|
||||
tmpy2 = tri.v0.y;
|
||||
tmpz2 = tri.v0.z;
|
||||
tmpx1 = Number(tri.e0.x);
|
||||
tmpy1 = Number(tri.e0.y);
|
||||
tmpz1 = Number(tri.e0.z);
|
||||
tmpx2 = Number(tri.v0.x);
|
||||
tmpy2 = Number(tri.v0.y);
|
||||
tmpz2 = Number(tri.v0.z);
|
||||
break;
|
||||
case 1:
|
||||
tmpx1 = tri.e1.x;
|
||||
tmpy1 = tri.e1.y;
|
||||
tmpz1 = tri.e1.z;
|
||||
tmpx2 = tri.v1.x;
|
||||
tmpy2 = tri.v1.y;
|
||||
tmpz2 = tri.v1.z;
|
||||
tmpx1 = Number(tri.e1.x);
|
||||
tmpy1 = Number(tri.e1.y);
|
||||
tmpz1 = Number(tri.e1.z);
|
||||
tmpx2 = Number(tri.v1.x);
|
||||
tmpy2 = Number(tri.v1.y);
|
||||
tmpz2 = Number(tri.v1.z);
|
||||
break;
|
||||
case 2:
|
||||
tmpx1 = tri.e2.x;
|
||||
tmpy1 = tri.e2.y;
|
||||
tmpz1 = tri.e2.z;
|
||||
tmpx2 = tri.v2.x;
|
||||
tmpy2 = tri.v2.y;
|
||||
tmpz2 = tri.v2.z;
|
||||
tmpx1 = Number(tri.e2.x);
|
||||
tmpy1 = Number(tri.e2.y);
|
||||
tmpz1 = Number(tri.e2.z);
|
||||
tmpx2 = Number(tri.v2.x);
|
||||
tmpy2 = Number(tri.v2.y);
|
||||
tmpz2 = Number(tri.v2.z);
|
||||
}
|
||||
var triTransform:Matrix4 = tri.transform;
|
||||
this.axis20.x = triTransform.a * tmpx1 + triTransform.b * tmpy1 + triTransform.c * tmpz1;
|
||||
@@ -641,7 +641,7 @@ package package_121
|
||||
var z2:Number = triTransform.i * tmpx2 + triTransform.j * tmpy2 + triTransform.k * tmpz2 + triTransform.l;
|
||||
var boxTransform:Matrix4 = box.transform;
|
||||
boxTransform.getAxis(boxAxisIdx,this.axis10);
|
||||
var v:name_194 = contact.normal;
|
||||
var v:§_-bj§ = contact.normal;
|
||||
v.x = this.axis10.y * this.axis20.z - this.axis10.z * this.axis20.y;
|
||||
v.y = this.axis10.z * this.axis20.x - this.axis10.x * this.axis20.z;
|
||||
v.z = this.axis10.x * this.axis20.y - this.axis10.y * this.axis20.x;
|
||||
@@ -655,13 +655,13 @@ package package_121
|
||||
v.y = -v.y;
|
||||
v.z = -v.z;
|
||||
}
|
||||
tmpx1 = box.hs.x;
|
||||
tmpy1 = box.hs.y;
|
||||
tmpz1 = box.hs.z;
|
||||
tmpx1 = Number(box.hs.x);
|
||||
tmpy1 = Number(box.hs.y);
|
||||
tmpz1 = Number(box.hs.z);
|
||||
if(boxAxisIdx == 0)
|
||||
{
|
||||
tmpx1 = 0;
|
||||
boxHalfLen = box.hs.x;
|
||||
boxHalfLen = Number(box.hs.x);
|
||||
}
|
||||
else if(boxTransform.a * v.x + boxTransform.e * v.y + boxTransform.i * v.z > 0)
|
||||
{
|
||||
@@ -670,7 +670,7 @@ package package_121
|
||||
if(boxAxisIdx == 1)
|
||||
{
|
||||
tmpy1 = 0;
|
||||
boxHalfLen = box.hs.y;
|
||||
boxHalfLen = Number(box.hs.y);
|
||||
}
|
||||
else if(boxTransform.b * v.x + boxTransform.f * v.y + boxTransform.j * v.z > 0)
|
||||
{
|
||||
@@ -679,7 +679,7 @@ package package_121
|
||||
if(boxAxisIdx == 2)
|
||||
{
|
||||
tmpz1 = 0;
|
||||
boxHalfLen = box.hs.z;
|
||||
boxHalfLen = Number(box.hs.z);
|
||||
}
|
||||
else if(boxTransform.c * v.x + boxTransform.g * v.y + boxTransform.k * v.z > 0)
|
||||
{
|
||||
@@ -697,14 +697,14 @@ package package_121
|
||||
var c2:Number = this.axis20.x * vx + this.axis20.y * vy + this.axis20.z * vz;
|
||||
var t1:Number = (c2 * k - c1) / det;
|
||||
var t2:Number = (c2 - c1 * k) / det;
|
||||
contact.name_679 = 1;
|
||||
var cp:name_674 = contact.points[0];
|
||||
cp.penetration = this.var_676;
|
||||
contact.§_-P3§ = 1;
|
||||
var cp:§_-cR§ = contact.points[0];
|
||||
cp.penetration = this.§_-hK§;
|
||||
v = cp.pos;
|
||||
v.x = 0.5 * (x1 + this.axis10.x * t1 + x2 + this.axis20.x * t2);
|
||||
v.y = 0.5 * (y1 + this.axis10.y * t1 + y2 + this.axis20.y * t2);
|
||||
v.z = 0.5 * (z1 + this.axis10.z * t1 + z2 + this.axis20.z * t2);
|
||||
var r:name_194 = cp.r1;
|
||||
var r:§_-bj§ = cp.r1;
|
||||
r.x = v.x - boxTransform.d;
|
||||
r.y = v.y - boxTransform.h;
|
||||
r.z = v.z - boxTransform.l;
|
||||
@@ -1,44 +1,44 @@
|
||||
package
|
||||
{
|
||||
import §_-1z§.§_-b1§;
|
||||
import §_-1z§.§_-n4§;
|
||||
import §_-1z§.§_-pi§;
|
||||
import flash.display.Bitmap;
|
||||
import flash.display.BitmapData;
|
||||
import flash.display.Shape;
|
||||
import flash.display.Sprite;
|
||||
import flash.display3D.Context3D;
|
||||
import flash.events.Event;
|
||||
import package_28.name_129;
|
||||
import package_28.name_167;
|
||||
import package_28.name_93;
|
||||
|
||||
public class Preloader extends Sprite
|
||||
{
|
||||
private static const EmbedPreloader:Class = name_166;
|
||||
private static const EmbedPreloader:Class = §_-Lz§;
|
||||
|
||||
private static const EmbedPreloaderA:Class = name_165;
|
||||
private static const EmbedPreloaderA:Class = §_-9C§;
|
||||
|
||||
private static const EmbedProgress:Class = name_164;
|
||||
private static const EmbedProgress:Class = §_-M9§;
|
||||
|
||||
private var area:Shape = new Shape();
|
||||
|
||||
private var var_27:Bitmap = new EmbedPreloader();
|
||||
private var §_-1q§:Bitmap = new EmbedPreloader();
|
||||
|
||||
private var var_28:Bitmap = new EmbedPreloaderA();
|
||||
private var §_-Za§:Bitmap = new EmbedPreloaderA();
|
||||
|
||||
private var progress:Bitmap = new EmbedProgress();
|
||||
|
||||
private var context:Context3D;
|
||||
|
||||
public var maps:Vector.<name_167>;
|
||||
public var maps:Vector.<§_-n4§>;
|
||||
|
||||
private var var_31:int;
|
||||
private var §_-dH§:int;
|
||||
|
||||
private var counter:int;
|
||||
|
||||
private var baseURL:String;
|
||||
|
||||
private var var_30:name_129 = new name_93(new BitmapData(1,1,false,8355711));
|
||||
private var §_-m§:§_-pi§ = new §_-b1§(new BitmapData(1,1,false,8355711));
|
||||
|
||||
private var var_29:Number = 0.09803921568627451;
|
||||
private var §_-UB§:Number = 0.09803921568627451;
|
||||
|
||||
public function Preloader()
|
||||
{
|
||||
@@ -46,61 +46,61 @@ package
|
||||
addChild(this.area);
|
||||
this.area.alpha = 1;
|
||||
this.progress.alpha = 1;
|
||||
this.var_27.alpha = 1;
|
||||
addChild(this.var_27);
|
||||
addChild(this.var_28);
|
||||
this.§_-1q§.alpha = 1;
|
||||
addChild(this.§_-1q§);
|
||||
addChild(this.§_-Za§);
|
||||
addChild(this.progress);
|
||||
addEventListener(Event.ADDED_TO_STAGE,this.method_80);
|
||||
addEventListener(Event.REMOVED_FROM_STAGE,this.method_81);
|
||||
addEventListener(Event.ADDED_TO_STAGE,this.§_-Id§);
|
||||
addEventListener(Event.REMOVED_FROM_STAGE,this.§_-99§);
|
||||
this.progress.scaleX = 0.025;
|
||||
}
|
||||
|
||||
public function name_69(param1:Number) : void
|
||||
public function §_-QU§(param1:Number) : void
|
||||
{
|
||||
this.progress.scaleX = param1;
|
||||
if(this.progress.scaleX >= 1)
|
||||
{
|
||||
this.method_78();
|
||||
this.§_-Dq§();
|
||||
}
|
||||
}
|
||||
|
||||
private function method_78() : void
|
||||
private function §_-Dq§() : void
|
||||
{
|
||||
addEventListener(Event.ENTER_FRAME,this.method_12);
|
||||
addEventListener(Event.ENTER_FRAME,this.§_-ba§);
|
||||
}
|
||||
|
||||
public function method_82(param1:Number) : void
|
||||
public function §_-fE§(param1:Number) : void
|
||||
{
|
||||
this.progress.scaleX += param1;
|
||||
if(this.progress.scaleX > 0.5)
|
||||
{
|
||||
addEventListener(Event.ENTER_FRAME,this.method_79);
|
||||
addEventListener(Event.ENTER_FRAME,this.§_-MO§);
|
||||
}
|
||||
if(this.progress.scaleX >= 1)
|
||||
{
|
||||
this.method_78();
|
||||
this.§_-Dq§();
|
||||
}
|
||||
}
|
||||
|
||||
private function method_80(param1:Event) : void
|
||||
private function §_-Id§(param1:Event) : void
|
||||
{
|
||||
stage.addEventListener(Event.RESIZE,this.method_4);
|
||||
this.method_4();
|
||||
stage.addEventListener(Event.RESIZE,this.§_-7B§);
|
||||
this.§_-7B§();
|
||||
}
|
||||
|
||||
private function method_81(param1:Event) : void
|
||||
private function §_-99§(param1:Event) : void
|
||||
{
|
||||
stage.removeEventListener(Event.RESIZE,this.method_4);
|
||||
stage.removeEventListener(Event.RESIZE,this.§_-7B§);
|
||||
}
|
||||
|
||||
private function method_12(param1:Event) : void
|
||||
private function §_-ba§(param1:Event) : void
|
||||
{
|
||||
this.area.alpha -= this.var_29;
|
||||
this.var_27.alpha -= this.var_29;
|
||||
this.progress.alpha -= this.var_29;
|
||||
this.area.alpha -= this.§_-UB§;
|
||||
this.§_-1q§.alpha -= this.§_-UB§;
|
||||
this.progress.alpha -= this.§_-UB§;
|
||||
if(this.area.alpha <= 0)
|
||||
{
|
||||
removeEventListener(Event.ENTER_FRAME,this.method_12);
|
||||
removeEventListener(Event.ENTER_FRAME,this.§_-ba§);
|
||||
if(parent != null)
|
||||
{
|
||||
parent.removeChild(this);
|
||||
@@ -109,29 +109,29 @@ package
|
||||
}
|
||||
}
|
||||
|
||||
private function method_79(param1:Event) : void
|
||||
private function §_-MO§(param1:Event) : void
|
||||
{
|
||||
this.var_28.alpha -= this.var_29 * 1.5;
|
||||
if(this.var_28.alpha <= 0)
|
||||
this.§_-Za§.alpha -= this.§_-UB§ * 1.5;
|
||||
if(this.§_-Za§.alpha <= 0)
|
||||
{
|
||||
removeEventListener(Event.ENTER_FRAME,this.method_79);
|
||||
removeEventListener(Event.ENTER_FRAME,this.§_-MO§);
|
||||
}
|
||||
}
|
||||
|
||||
private function method_4(param1:Event = null) : void
|
||||
private function §_-7B§(param1:Event = null) : void
|
||||
{
|
||||
this.area.graphics.clear();
|
||||
this.var_27.x = Math.round(stage.stageWidth / 2 - this.var_27.width / 2);
|
||||
this.var_27.y = Math.round(stage.stageHeight / 2 - this.var_27.height / 2) - 30;
|
||||
this.var_28.x = this.var_27.x;
|
||||
this.var_28.y = this.var_27.y;
|
||||
this.progress.x = this.var_27.x + 2;
|
||||
this.progress.y = this.var_27.y + 221;
|
||||
this.§_-1q§.x = Math.round(stage.stageWidth / 2 - this.§_-1q§.width / 2);
|
||||
this.§_-1q§.y = Math.round(stage.stageHeight / 2 - this.§_-1q§.height / 2) - 30;
|
||||
this.§_-Za§.x = this.§_-1q§.x;
|
||||
this.§_-Za§.y = this.§_-1q§.y;
|
||||
this.progress.x = this.§_-1q§.x + 2;
|
||||
this.progress.y = this.§_-1q§.y + 221;
|
||||
this.area.graphics.beginFill(0);
|
||||
this.area.graphics.drawRect(0,0,this.var_27.x,stage.stageHeight);
|
||||
this.area.graphics.drawRect(this.var_27.x,0,this.var_27.width,this.var_27.y);
|
||||
this.area.graphics.drawRect(this.var_27.x + this.var_27.width,0,stage.stageWidth - this.var_27.width - this.var_27.x,stage.stageHeight);
|
||||
this.area.graphics.drawRect(this.var_27.x,this.var_27.y + this.var_27.height,this.var_27.width,stage.stageHeight - this.var_27.height - this.var_27.y);
|
||||
this.area.graphics.drawRect(0,0,this.§_-1q§.x,stage.stageHeight);
|
||||
this.area.graphics.drawRect(this.§_-1q§.x,0,this.§_-1q§.width,this.§_-1q§.y);
|
||||
this.area.graphics.drawRect(this.§_-1q§.x + this.§_-1q§.width,0,stage.stageWidth - this.§_-1q§.width - this.§_-1q§.x,stage.stageHeight);
|
||||
this.area.graphics.drawRect(this.§_-1q§.x,this.§_-1q§.y + this.§_-1q§.height,this.§_-1q§.width,stage.stageHeight - this.§_-1q§.height - this.§_-1q§.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,36 @@
|
||||
package
|
||||
{
|
||||
import §_-1c§.§_-0F§;
|
||||
import §_-5U§.§_-Kr§;
|
||||
import §_-FM§.§_-fl§;
|
||||
import §_-GD§.§_-6A§;
|
||||
import §_-I0§.§_-Jv§;
|
||||
import §_-I0§.§_-VT§;
|
||||
import §_-KT§.§_-6L§;
|
||||
import §_-KT§.§_-Ju§;
|
||||
import §_-KT§.§_-UT§;
|
||||
import §_-KT§.§_-mN§;
|
||||
import §_-O5§.§_-c-§;
|
||||
import §_-RG§.§_-Au§;
|
||||
import §_-RG§.§_-pE§;
|
||||
import §_-TX§.§_-R3§;
|
||||
import §_-Uy§.§_-oP§;
|
||||
import §_-Vh§.§_-Pt§;
|
||||
import §_-Vh§.§_-Wn§;
|
||||
import §_-Vh§.§_-dn§;
|
||||
import §_-YQ§.§_-A3§;
|
||||
import §_-YQ§.§_-DN§;
|
||||
import §_-Yj§.TankMaterial2;
|
||||
import §_-Yj§.§_-4X§;
|
||||
import §_-Yj§.§_-as§;
|
||||
import §_-Yj§.§_-bZ§;
|
||||
import §_-Yj§.§_-jj§;
|
||||
import §_-aA§.§_-1O§;
|
||||
import §_-aA§.§_-a-§;
|
||||
import §_-az§.§_-AG§;
|
||||
import §_-cv§.§_-YU§;
|
||||
import §_-d8§.§_-R3§;
|
||||
import §_-e6§.§_-1I§;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
import flash.display.Stage3D;
|
||||
@@ -11,52 +42,21 @@ package
|
||||
import flash.events.FullScreenEvent;
|
||||
import flash.events.KeyboardEvent;
|
||||
import flash.ui.Keyboard;
|
||||
import alternativa.osgi.service.console.variables.ConsoleVarFloat;
|
||||
import alternativa.osgi.service.console.variables.ConsoleVarInt;
|
||||
import alternativa.osgi.service.console.variables.ConsoleVarString;
|
||||
import alternativa.osgi.service.console.variables.ConsoleVar;
|
||||
import alternativa.tanks.game.GameKernel;
|
||||
import alternativa.ClientConfigurator;
|
||||
import package_12.name_15;
|
||||
import alternativa.tanks.config.Config;
|
||||
import platform.client.a3d.osgi.Activator;
|
||||
import alternativa.utils.Properties;
|
||||
import alternativa.protocol.osgi.ProtocolActivator;
|
||||
import platform.clients.fp10.libraries.alternativaprotocol.Activator;
|
||||
import alternativa.tanks.game.subsystems.rendersystem.RenderSystem;
|
||||
import alternativa.tanks.game.entities.map.VisibleLightMaterial;
|
||||
import alternativa.tanks.game.entities.map.MapMaterial;
|
||||
import alternativa.tanks.game.entities.tank.graphics.materials.TankMaterial2;
|
||||
import alternativa.tanks.game.entities.tank.graphics.materials.TreesMaterial;
|
||||
import alternativa.tanks.game.entities.tank.graphics.materials.GiShadowMaterial;
|
||||
import alternativa.tanks.game.entities.tank.graphics.materials.TracksMaterial2;
|
||||
import alternativa.tanks.game.entities.tank.graphics.materials.TankMaterial;
|
||||
import package_4.name_11;
|
||||
import package_4.name_28;
|
||||
import package_4.name_6;
|
||||
import alternativa.osgi.OSGi;
|
||||
import alternativa.osgi.service.console.IConsole;
|
||||
import alternativa.tanks.InitBattleTask;
|
||||
import alternativa.tanks.TankTestTask;
|
||||
import alternativa.startup.LibraryInfo;
|
||||
import alternativa.startup.ConnectionParameters;
|
||||
import alternativa.tanks.game.camera.FreeCameraController;
|
||||
import alternativa.tanks.game.camera.AxisIndicator;
|
||||
|
||||
[SWF(backgroundColor="#333333",frameRate="100",width="1024",height="768")]
|
||||
public class TanksTestingTool extends Sprite
|
||||
{
|
||||
public static var testTask:TankTestTask;
|
||||
public static var testTask:§_-A3§;
|
||||
|
||||
private var config:Config;
|
||||
private var config:§_-YU§;
|
||||
|
||||
private var gameKernel:GameKernel;
|
||||
private var gameKernel:§_-AG§;
|
||||
|
||||
private var var_1:name_15;
|
||||
private var §_-6s§:§_-0F§;
|
||||
|
||||
private var stage3D:Stage3D;
|
||||
|
||||
private var var_2:ClientConfigurator;
|
||||
private var §_-nZ§:§_-Kr§;
|
||||
|
||||
private var preloader:Preloader = new Preloader();
|
||||
|
||||
@@ -65,174 +65,173 @@ package
|
||||
super();
|
||||
mouseEnabled = false;
|
||||
mouseChildren = false;
|
||||
this.initStage();
|
||||
this.initClient();
|
||||
this.initConsole();
|
||||
this.initOptionsSupport();
|
||||
VisibleLightMaterial.fadeRadius = 7000;
|
||||
VisibleLightMaterial.spotAngle = 140 * Math.PI / 180;
|
||||
VisibleLightMaterial.fallofAngle = 170 * Math.PI / 180;
|
||||
this.§_-PK§();
|
||||
this.§_-l2§();
|
||||
this.§_-33§();
|
||||
this.§_-5D§();
|
||||
§_-Au§.fadeRadius = 7000;
|
||||
§_-Au§.spotAngle = 140 * Math.PI / 180;
|
||||
§_-Au§.fallofAngle = 170 * Math.PI / 180;
|
||||
this.stage3D = stage.stage3Ds[0];
|
||||
this.stage3D.addEventListener(Event.CONTEXT3D_CREATE,this.onContextCreate);
|
||||
this.stage3D.addEventListener(Event.CONTEXT3D_CREATE,this.§_-9x§);
|
||||
this.stage3D.requestContext3D();
|
||||
}
|
||||
|
||||
private function onContextCreate(param1:Event) : void
|
||||
private function §_-9x§(param1:Event) : void
|
||||
{
|
||||
switch(name_28.name_35(this.stage3D.context3D))
|
||||
switch(§_-Pt§.§_-OP§(this.stage3D.context3D))
|
||||
{
|
||||
case name_6.DXT1:
|
||||
this.loadConfig("cfg.dxt1.xml");
|
||||
case §_-Wn§.DXT1:
|
||||
this.§_-Bw§("cfg.dxt1.xml");
|
||||
break;
|
||||
case name_6.ETC1:
|
||||
this.loadConfig("cfg.etc1.xml");
|
||||
case §_-Wn§.ETC1:
|
||||
this.§_-Bw§("cfg.etc1.xml");
|
||||
break;
|
||||
case name_6.PVRTC:
|
||||
this.loadConfig("cfg.pvrtc.xml");
|
||||
} }
|
||||
|
||||
}
|
||||
|
||||
private function initOptionsSupport() : void
|
||||
{
|
||||
new ConsoleVarInt("fog_mode",0,0,3,this.onFogSettingsChange);
|
||||
new ConsoleVarFloat("fog_near",0,0,1000000,this.onFogSettingsChange);
|
||||
new ConsoleVarFloat("fog_far",5000,0,1000000,this.onFogSettingsChange);
|
||||
new ConsoleVarFloat("fog_density",1,0,1,this.onFogSettingsChange);
|
||||
new ConsoleVarFloat("horizon_offset",0,-1000000,1000000,this.onFogSettingsChange);
|
||||
new ConsoleVarFloat("horizon_size",5000,0,1000000,this.onFogSettingsChange);
|
||||
new ConsoleVarString("fog_color","0x0",this.onFogSettingsChange);
|
||||
var _loc1_:IConsole = IConsole(OSGi.name_8().name_30(IConsole));
|
||||
_loc1_.name_45("fog_texture",this.onFogTextureChange);
|
||||
new ConsoleVarFloat("beam_distance",7000,0,1000000,this.onLightSettingsChange);
|
||||
new ConsoleVarFloat("beam_spot",140,0,180,this.onLightSettingsChange);
|
||||
new ConsoleVarFloat("beam_fallof",170,0,180,this.onLightSettingsChange);
|
||||
new ConsoleVarFloat("beam_fallof",170,0,180,this.onLightSettingsChange);
|
||||
new ConsoleVarFloat("camera_smoothing",20,0,200,this.onControllerSettingsChange);
|
||||
MapMaterial.fogMode = MapMaterial.DISABLED;
|
||||
TreesMaterial.fogMode = TreesMaterial.DISABLED;
|
||||
TankMaterial.fogMode = TankMaterial.DISABLED;
|
||||
TankMaterial2.fogMode = TankMaterial.DISABLED;
|
||||
GiShadowMaterial.fogMode = name_11.DISABLED;
|
||||
TracksMaterial2.fogMode = name_11.DISABLED;
|
||||
}
|
||||
|
||||
private function onControllerSettingsChange(param1:ConsoleVarFloat) : void
|
||||
{
|
||||
FreeCameraController.smoothing = param1.value;
|
||||
}
|
||||
|
||||
private function onLightSettingsChange(param1:ConsoleVar) : void
|
||||
{
|
||||
switch(param1.name_32())
|
||||
{
|
||||
case "beam_distance":
|
||||
VisibleLightMaterial.fadeRadius = ConsoleVarFloat(param1).value;
|
||||
break;
|
||||
case "beam_spot":
|
||||
VisibleLightMaterial.spotAngle = ConsoleVarFloat(param1).value * Math.PI / 180;
|
||||
break;
|
||||
case "beam_fallof":
|
||||
VisibleLightMaterial.fallofAngle = ConsoleVarFloat(param1).value * Math.PI / 180;
|
||||
case §_-Wn§.PVRTC:
|
||||
this.§_-Bw§("cfg.pvrtc.xml");
|
||||
}
|
||||
}
|
||||
|
||||
private function onFogSettingsChange(param1:ConsoleVar) : void
|
||||
private function §_-5D§() : void
|
||||
{
|
||||
new §_-UT§("fog_mode",0,0,3,this.§_-JG§);
|
||||
new §_-Ju§("fog_near",0,0,1000000,this.§_-JG§);
|
||||
new §_-Ju§("fog_far",5000,0,1000000,this.§_-JG§);
|
||||
new §_-Ju§("fog_density",1,0,1,this.§_-JG§);
|
||||
new §_-Ju§("horizon_offset",0,-1000000,1000000,this.§_-JG§);
|
||||
new §_-Ju§("horizon_size",5000,0,1000000,this.§_-JG§);
|
||||
new §_-mN§("fog_color","0x0",this.§_-JG§);
|
||||
var _loc1_:§_-6A§ = §_-6A§(§_-oP§.§_-nQ§().§_-N6§(§_-6A§));
|
||||
_loc1_.§_-0j§("fog_texture",this.§_-nx§);
|
||||
new §_-Ju§("beam_distance",7000,0,1000000,this.§_-1B§);
|
||||
new §_-Ju§("beam_spot",140,0,180,this.§_-1B§);
|
||||
new §_-Ju§("beam_fallof",170,0,180,this.§_-1B§);
|
||||
new §_-Ju§("beam_fallof",170,0,180,this.§_-1B§);
|
||||
new §_-Ju§("camera_smoothing",20,0,200,this.§_-27§);
|
||||
§_-pE§.fogMode = §_-pE§.DISABLED;
|
||||
§_-4X§.fogMode = §_-4X§.DISABLED;
|
||||
§_-as§.fogMode = §_-as§.DISABLED;
|
||||
TankMaterial2.fogMode = §_-as§.DISABLED;
|
||||
§_-jj§.fogMode = §_-dn§.DISABLED;
|
||||
§_-bZ§.fogMode = §_-dn§.DISABLED;
|
||||
}
|
||||
|
||||
private function §_-27§(param1:§_-Ju§) : void
|
||||
{
|
||||
§_-Jv§.smoothing = param1.value;
|
||||
}
|
||||
|
||||
private function §_-1B§(param1:§_-6L§) : void
|
||||
{
|
||||
switch(param1.§_-cC§())
|
||||
{
|
||||
case "beam_distance":
|
||||
§_-Au§.fadeRadius = §_-Ju§(param1).value;
|
||||
break;
|
||||
case "beam_spot":
|
||||
§_-Au§.spotAngle = §_-Ju§(param1).value * Math.PI / 180;
|
||||
break;
|
||||
case "beam_fallof":
|
||||
§_-Au§.fallofAngle = §_-Ju§(param1).value * Math.PI / 180;
|
||||
}
|
||||
}
|
||||
|
||||
private function §_-JG§(param1:§_-6L§) : void
|
||||
{
|
||||
var _loc3_:Number = NaN;
|
||||
var _loc4_:Number = NaN;
|
||||
var _loc5_:Number = NaN;
|
||||
var _loc6_:RenderSystem = this.gameKernel.name_5();
|
||||
switch(param1.name_32())
|
||||
var _loc6_:§_-1I§ = this.gameKernel.§_-DZ§();
|
||||
switch(param1.§_-cC§())
|
||||
{
|
||||
case "fog_mode":
|
||||
_loc6_.name_41(ConsoleVarInt(param1).value);
|
||||
_loc6_.§_-ev§(§_-UT§(param1).value);
|
||||
break;
|
||||
case "fog_near":
|
||||
_loc6_.name_47(ConsoleVarFloat(param1).value);
|
||||
_loc6_.§_-9g§(§_-Ju§(param1).value);
|
||||
break;
|
||||
case "fog_far":
|
||||
_loc6_.name_48(ConsoleVarFloat(param1).value);
|
||||
_loc6_.§_-H9§(§_-Ju§(param1).value);
|
||||
break;
|
||||
case "fog_density":
|
||||
_loc6_.name_49(ConsoleVarFloat(param1).value);
|
||||
_loc6_.§_-J0§(§_-Ju§(param1).value);
|
||||
break;
|
||||
case "horizon_size":
|
||||
_loc6_.name_38(ConsoleVarFloat(param1).value);
|
||||
_loc6_.§_-Jk§(§_-Ju§(param1).value);
|
||||
break;
|
||||
case "horizon_offset":
|
||||
_loc6_.name_34(ConsoleVarFloat(param1).value);
|
||||
_loc6_.§_-Dd§(§_-Ju§(param1).value);
|
||||
break;
|
||||
case "fog_color":
|
||||
_loc6_.name_40(parseInt(ConsoleVarString(param1).value,16));
|
||||
_loc6_.§_-5d§(parseInt(§_-mN§(param1).value,16));
|
||||
}
|
||||
}
|
||||
|
||||
private function onFogTextureChange(param1:IConsole, param2:Array) : void
|
||||
private function §_-nx§(param1:§_-6A§, param2:Array) : void
|
||||
{
|
||||
this.gameKernel.name_5().name_36(param2.join(" "));
|
||||
this.gameKernel.§_-DZ§().§_-FZ§(param2.join(" "));
|
||||
}
|
||||
|
||||
private function initStage() : void
|
||||
private function §_-PK§() : void
|
||||
{
|
||||
stage.scaleMode = StageScaleMode.NO_SCALE;
|
||||
stage.align = StageAlign.TOP_LEFT;
|
||||
stage.quality = StageQuality.LOW;
|
||||
}
|
||||
|
||||
private function initClient() : void
|
||||
private function §_-l2§() : void
|
||||
{
|
||||
new OSGi();
|
||||
this.var_2 = new ClientConfigurator();
|
||||
this.var_2.start(this,new Properties(loaderInfo.parameters),new Vector.<LibraryInfo>(),new ConnectionParameters(null,null,null),new Vector.<String>());
|
||||
new ProtocolActivator().start(OSGi.name_8());
|
||||
new platform.clients.fp10.libraries.alternativaprotocol.Activator().start(OSGi.name_8());
|
||||
new platform.client.a3d.osgi.Activator().start(OSGi.name_8());
|
||||
new §_-oP§();
|
||||
this.§_-nZ§ = new §_-Kr§();
|
||||
this.§_-nZ§.start(this,new §_-c-§(loaderInfo.parameters),new Vector.<§_-a-§>(),new §_-1O§(null,null,null),new Vector.<String>());
|
||||
new §_-fl§().start(§_-oP§.§_-nQ§());
|
||||
new §_-TX§.§_-R3§().start(§_-oP§.§_-nQ§());
|
||||
new §_-d8§.§_-R3§().start(§_-oP§.§_-nQ§());
|
||||
}
|
||||
|
||||
private function initConsole() : void
|
||||
private function §_-33§() : void
|
||||
{
|
||||
var _loc1_:IConsole = IConsole(OSGi.name_8().name_30(IConsole));
|
||||
var _loc1_:§_-6A§ = §_-6A§(§_-oP§.§_-nQ§().§_-N6§(§_-6A§));
|
||||
_loc1_.width = 100;
|
||||
_loc1_.alpha = 0.8;
|
||||
_loc1_.height = 30;
|
||||
}
|
||||
|
||||
private function loadConfig(param1:String) : void
|
||||
private function §_-Bw§(param1:String) : void
|
||||
{
|
||||
addChild(this.preloader);
|
||||
this.config = new Config();
|
||||
this.config.addEventListener(Event.COMPLETE,this.onConfigLoadingComplete);
|
||||
this.config = new §_-YU§();
|
||||
this.config.addEventListener(Event.COMPLETE,this.§_-JY§);
|
||||
this.config.load(param1,this.preloader);
|
||||
}
|
||||
|
||||
private function onConfigLoadingComplete(param1:Event) : void
|
||||
private function §_-JY§(param1:Event) : void
|
||||
{
|
||||
this.initGame();
|
||||
this.initHUD();
|
||||
this.§_-G-§();
|
||||
this.§_-lN§();
|
||||
}
|
||||
|
||||
private function initHUD() : void
|
||||
private function §_-lN§() : void
|
||||
{
|
||||
this.var_1 = new name_15();
|
||||
stage.addChild(this.var_1);
|
||||
this.var_1.mouseChildren = true;
|
||||
this.var_1.mouseEnabled = true;
|
||||
this.var_1.addEventListener("CLICK_FULL_SCREEN_BUTTON",this.onClickFullScreenButton);
|
||||
this.var_1.addEventListener("CLICK_NEXT_TANK_BUTTON",this.onClickNextTankButton);
|
||||
this.§_-6s§ = new §_-0F§();
|
||||
stage.addChild(this.§_-6s§);
|
||||
this.§_-6s§.mouseChildren = true;
|
||||
this.§_-6s§.mouseEnabled = true;
|
||||
this.§_-6s§.addEventListener("CLICK_FULL_SCREEN_BUTTON",this.§_-GO§);
|
||||
this.§_-6s§.addEventListener("CLICK_NEXT_TANK_BUTTON",this.§_-gC§);
|
||||
stage.addChild(this.preloader);
|
||||
stage.addEventListener(KeyboardEvent.KEY_DOWN,this.onKeyDown);
|
||||
this.gameKernel.name_5().name_27().diagramVerticalMargin = 85;
|
||||
this.gameKernel.name_5().name_27().diagramHorizontalMargin = 12;
|
||||
this.onResize(null);
|
||||
stage.addEventListener(KeyboardEvent.KEY_DOWN,this.§_-Ze§);
|
||||
this.gameKernel.§_-DZ§().§_-GW§().diagramVerticalMargin = 85;
|
||||
this.gameKernel.§_-DZ§().§_-GW§().diagramHorizontalMargin = 12;
|
||||
this.§_-7B§(null);
|
||||
}
|
||||
|
||||
private function onKeyDown(param1:KeyboardEvent) : void
|
||||
private function §_-Ze§(param1:KeyboardEvent) : void
|
||||
{
|
||||
var _loc2_:DisplayObject = null;
|
||||
if(param1.keyCode == Keyboard.G)
|
||||
{
|
||||
_loc2_ = this.gameKernel.name_5().name_39();
|
||||
_loc2_ = this.gameKernel.§_-DZ§().§_-G§();
|
||||
if(_loc2_.parent != null)
|
||||
{
|
||||
_loc2_.parent.removeChild(_loc2_);
|
||||
@@ -244,19 +243,19 @@ package
|
||||
}
|
||||
}
|
||||
|
||||
private function onClickFullScreenButton(param1:Event) : void
|
||||
private function §_-GO§(param1:Event) : void
|
||||
{
|
||||
stage.displayState = this.var_1.name_31 ? StageDisplayState.FULL_SCREEN : StageDisplayState.NORMAL;
|
||||
stage.addEventListener(FullScreenEvent.FULL_SCREEN,this.onFullScreenChange);
|
||||
stage.displayState = !!this.§_-6s§.§_-8F§ ? StageDisplayState.FULL_SCREEN : StageDisplayState.NORMAL;
|
||||
stage.addEventListener(FullScreenEvent.FULL_SCREEN,this.§_-Tp§);
|
||||
}
|
||||
|
||||
private function onFullScreenChange(param1:Event) : void
|
||||
private function §_-Tp§(param1:Event) : void
|
||||
{
|
||||
stage.removeEventListener(FullScreenEvent.FULL_SCREEN,this.onFullScreenChange);
|
||||
this.var_1.name_31 = stage.displayState != StageDisplayState.NORMAL;
|
||||
stage.removeEventListener(FullScreenEvent.FULL_SCREEN,this.§_-Tp§);
|
||||
this.§_-6s§.§_-8F§ = stage.displayState != StageDisplayState.NORMAL;
|
||||
}
|
||||
|
||||
private function onClickNextTankButton(param1:Event) : void
|
||||
private function §_-gC§(param1:Event) : void
|
||||
{
|
||||
if(testTask != null)
|
||||
{
|
||||
@@ -264,34 +263,34 @@ package
|
||||
}
|
||||
}
|
||||
|
||||
private function initGame() : void
|
||||
private function §_-G-§() : void
|
||||
{
|
||||
this.gameKernel = new GameKernel(stage,this.config.options);
|
||||
this.gameKernel.name_5().name_37(this.stage3D);
|
||||
var _loc1_:InitBattleTask = new InitBattleTask(this.gameKernel,this.config,this,this.preloader);
|
||||
this.gameKernel = new §_-AG§(stage,this.config.options);
|
||||
this.gameKernel.§_-DZ§().§_-X4§(this.stage3D);
|
||||
var _loc1_:§_-DN§ = new §_-DN§(this.gameKernel,this.config,this,this.preloader);
|
||||
this.gameKernel.addTask(_loc1_);
|
||||
stage.addEventListener(Event.RESIZE,this.onResize);
|
||||
this.onResize(null);
|
||||
stage.addEventListener(Event.ENTER_FRAME,this.onEnterFrame);
|
||||
stage.addEventListener(Event.RESIZE,this.§_-7B§);
|
||||
this.§_-7B§(null);
|
||||
stage.addEventListener(Event.ENTER_FRAME,this.§_-ba§);
|
||||
}
|
||||
|
||||
private function onEnterFrame(param1:Event) : void
|
||||
private function §_-ba§(param1:Event) : void
|
||||
{
|
||||
this.gameKernel.name_51();
|
||||
this.gameKernel.§_-Kf§();
|
||||
}
|
||||
|
||||
private function onResize(param1:Event) : void
|
||||
private function §_-7B§(param1:Event) : void
|
||||
{
|
||||
var _loc2_:AxisIndicator = null;
|
||||
var _loc2_:§_-VT§ = null;
|
||||
if(this.gameKernel != null)
|
||||
{
|
||||
this.gameKernel.name_5().name_46(0,0,stage.stageWidth,stage.stageHeight);
|
||||
_loc2_ = this.gameKernel.name_5().name_42();
|
||||
this.gameKernel.§_-DZ§().§_-3N§(0,0,stage.stageWidth,stage.stageHeight);
|
||||
_loc2_ = this.gameKernel.§_-DZ§().§_-MG§();
|
||||
_loc2_.y = stage.stageHeight - _loc2_.size;
|
||||
}
|
||||
if(this.var_1 != null)
|
||||
if(this.§_-6s§ != null)
|
||||
{
|
||||
this.var_1.name_50(stage.stageWidth,stage.stageHeight);
|
||||
this.§_-6s§.§_-K6§(stage.stageWidth,stage.stageHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 9.6 KiB |
58
src/_codec/VectorCodecStringLevel1.as
Normal file
@@ -0,0 +1,58 @@
|
||||
package _codec
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
|
||||
public class VectorCodecStringLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecStringLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(String,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<String> = new Vector.<String>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = String(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<String> = Vector.<String>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package package_35
|
||||
package _codec
|
||||
{
|
||||
import package_32.name_148;
|
||||
import package_34.name_150;
|
||||
import package_36.name_152;
|
||||
import package_36.name_163;
|
||||
import package_36.name_442;
|
||||
import package_38.name_443;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
|
||||
public class VectorCodecStringLevel2 implements name_152
|
||||
public class VectorCodecStringLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:name_152;
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
@@ -19,32 +19,32 @@ package package_35
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:name_163) : void
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.name_448(new name_148(String,false));
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(String,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new name_150(this.elementCodec);
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function method_296(protocolBuffer:name_442) : Object
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<String> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = name_443.name_445(protocolBuffer);
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<String>> = new Vector.<Vector.<String>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.name_447())
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = name_443.name_445(protocolBuffer);
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<String>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = String(this.elementCodec.method_296(protocolBuffer));
|
||||
items2[i2] = String(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
@@ -52,7 +52,7 @@ package package_35
|
||||
return result;
|
||||
}
|
||||
|
||||
public function method_295(protocolBuffer:name_442, object:Object) : void
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<String> = null;
|
||||
var length2:int = 0;
|
||||
@@ -63,23 +63,23 @@ package package_35
|
||||
}
|
||||
var data:Vector.<Vector.<String>> = Vector.<Vector.<String>>(object);
|
||||
var length1:int = int(data.length);
|
||||
name_443.name_446(protocolBuffer,length1);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(false);
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
name_443.name_446(protocolBuffer,length2);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.method_295(protocolBuffer,items2[i2]);
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(true);
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
package package_35
|
||||
package _codec
|
||||
{
|
||||
import package_32.name_148;
|
||||
import package_34.name_150;
|
||||
import package_36.name_152;
|
||||
import package_36.name_163;
|
||||
import package_36.name_442;
|
||||
import package_38.name_443;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
|
||||
public class VectorCodecStringLevel3 implements name_152
|
||||
public class VectorCodecStringLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:name_152;
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
@@ -19,16 +19,16 @@ package package_35
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:name_163) : void
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.name_448(new name_148(String,false));
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(String,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new name_150(this.elementCodec);
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function method_296(protocolBuffer:name_442) : Object
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<String>> = null;
|
||||
@@ -36,25 +36,25 @@ package package_35
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<String> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = name_443.name_445(protocolBuffer);
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<String>>> = new Vector.<Vector.<Vector.<String>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.name_447())
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = name_443.name_445(protocolBuffer);
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<String>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.name_447())
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = name_443.name_445(protocolBuffer);
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<String>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = String(this.elementCodec.method_296(protocolBuffer));
|
||||
items3[i3] = String(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
@@ -65,7 +65,7 @@ package package_35
|
||||
return result;
|
||||
}
|
||||
|
||||
public function method_295(protocolBuffer:name_442, object:Object) : void
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<String>> = null;
|
||||
var length2:int = 0;
|
||||
@@ -79,37 +79,37 @@ package package_35
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<String>>> = Vector.<Vector.<Vector.<String>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
name_443.name_446(protocolBuffer,length1);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(false);
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
name_443.name_446(protocolBuffer,length2);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(false);
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
name_443.name_446(protocolBuffer,length3);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.method_295(protocolBuffer,items3[i3]);
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(true);
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(true);
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
59
src/_codec/VectorCodecbyteLevel1.as
Normal file
@@ -0,0 +1,59 @@
|
||||
package _codec
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.Byte;
|
||||
|
||||
public class VectorCodecbyteLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecbyteLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Byte,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<int> = new Vector.<int>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = int(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<int> = Vector.<int>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package package_35
|
||||
package _codec
|
||||
{
|
||||
import package_32.name_148;
|
||||
import package_33.name_154;
|
||||
import package_34.name_150;
|
||||
import package_36.name_152;
|
||||
import package_36.name_163;
|
||||
import package_36.name_442;
|
||||
import package_38.name_443;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.Byte;
|
||||
|
||||
public class VectorCodecbyteLevel2 implements name_152
|
||||
public class VectorCodecbyteLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:name_152;
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
@@ -20,32 +20,32 @@ package package_35
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:name_163) : void
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.name_448(new name_148(name_154,false));
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Byte,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new name_150(this.elementCodec);
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function method_296(protocolBuffer:name_442) : Object
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<int> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = name_443.name_445(protocolBuffer);
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<int>> = new Vector.<Vector.<int>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.name_447())
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = name_443.name_445(protocolBuffer);
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<int>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = int(this.elementCodec.method_296(protocolBuffer));
|
||||
items2[i2] = int(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
@@ -53,7 +53,7 @@ package package_35
|
||||
return result;
|
||||
}
|
||||
|
||||
public function method_295(protocolBuffer:name_442, object:Object) : void
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<int> = null;
|
||||
var length2:int = 0;
|
||||
@@ -64,23 +64,23 @@ package package_35
|
||||
}
|
||||
var data:Vector.<Vector.<int>> = Vector.<Vector.<int>>(object);
|
||||
var length1:int = int(data.length);
|
||||
name_443.name_446(protocolBuffer,length1);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(false);
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
name_443.name_446(protocolBuffer,length2);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.method_295(protocolBuffer,items2[i2]);
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(true);
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
package package_35
|
||||
package _codec
|
||||
{
|
||||
import package_32.name_148;
|
||||
import package_33.name_154;
|
||||
import package_34.name_150;
|
||||
import package_36.name_152;
|
||||
import package_36.name_163;
|
||||
import package_36.name_442;
|
||||
import package_38.name_443;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.Byte;
|
||||
|
||||
public class VectorCodecbyteLevel3 implements name_152
|
||||
public class VectorCodecbyteLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:name_152;
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
@@ -20,16 +20,16 @@ package package_35
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:name_163) : void
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.name_448(new name_148(name_154,false));
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Byte,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new name_150(this.elementCodec);
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function method_296(protocolBuffer:name_442) : Object
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<int>> = null;
|
||||
@@ -37,25 +37,25 @@ package package_35
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<int> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = name_443.name_445(protocolBuffer);
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<int>>> = new Vector.<Vector.<Vector.<int>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.name_447())
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = name_443.name_445(protocolBuffer);
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<int>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.name_447())
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = name_443.name_445(protocolBuffer);
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<int>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = int(this.elementCodec.method_296(protocolBuffer));
|
||||
items3[i3] = int(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
@@ -66,7 +66,7 @@ package package_35
|
||||
return result;
|
||||
}
|
||||
|
||||
public function method_295(protocolBuffer:name_442, object:Object) : void
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<int>> = null;
|
||||
var length2:int = 0;
|
||||
@@ -80,37 +80,37 @@ package package_35
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<int>>> = Vector.<Vector.<Vector.<int>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
name_443.name_446(protocolBuffer,length1);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(false);
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
name_443.name_446(protocolBuffer,length2);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(false);
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
name_443.name_446(protocolBuffer,length3);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.method_295(protocolBuffer,items3[i3]);
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(true);
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(true);
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
60
src/_codec/VectorCodecfloatLevel1.as
Normal file
@@ -0,0 +1,60 @@
|
||||
package _codec
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.Float;
|
||||
|
||||
public class VectorCodecfloatLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecfloatLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Number> = new Vector.<Number>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = Number(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var value:Number = NaN;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Number> = Vector.<Number>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package package_35
|
||||
package _codec
|
||||
{
|
||||
import package_32.name_148;
|
||||
import package_33.name_157;
|
||||
import package_34.name_150;
|
||||
import package_36.name_152;
|
||||
import package_36.name_163;
|
||||
import package_36.name_442;
|
||||
import package_38.name_443;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.Float;
|
||||
|
||||
public class VectorCodecfloatLevel2 implements name_152
|
||||
public class VectorCodecfloatLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:name_152;
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
@@ -20,32 +20,32 @@ package package_35
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:name_163) : void
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.name_448(new name_148(name_157,false));
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new name_150(this.elementCodec);
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function method_296(protocolBuffer:name_442) : Object
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Number> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = name_443.name_445(protocolBuffer);
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Number>> = new Vector.<Vector.<Number>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.name_447())
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = name_443.name_445(protocolBuffer);
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Number>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = Number(this.elementCodec.method_296(protocolBuffer));
|
||||
items2[i2] = Number(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
@@ -53,7 +53,7 @@ package package_35
|
||||
return result;
|
||||
}
|
||||
|
||||
public function method_295(protocolBuffer:name_442, object:Object) : void
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Number> = null;
|
||||
var length2:int = 0;
|
||||
@@ -64,23 +64,23 @@ package package_35
|
||||
}
|
||||
var data:Vector.<Vector.<Number>> = Vector.<Vector.<Number>>(object);
|
||||
var length1:int = int(data.length);
|
||||
name_443.name_446(protocolBuffer,length1);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(false);
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
name_443.name_446(protocolBuffer,length2);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.method_295(protocolBuffer,items2[i2]);
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(true);
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
package package_35
|
||||
package _codec
|
||||
{
|
||||
import package_32.name_148;
|
||||
import package_33.name_157;
|
||||
import package_34.name_150;
|
||||
import package_36.name_152;
|
||||
import package_36.name_163;
|
||||
import package_36.name_442;
|
||||
import package_38.name_443;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.Float;
|
||||
|
||||
public class VectorCodecfloatLevel3 implements name_152
|
||||
public class VectorCodecfloatLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:name_152;
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
@@ -20,16 +20,16 @@ package package_35
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:name_163) : void
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.name_448(new name_148(name_157,false));
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new name_150(this.elementCodec);
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function method_296(protocolBuffer:name_442) : Object
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<Number>> = null;
|
||||
@@ -37,25 +37,25 @@ package package_35
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<Number> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = name_443.name_445(protocolBuffer);
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<Number>>> = new Vector.<Vector.<Vector.<Number>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.name_447())
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = name_443.name_445(protocolBuffer);
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<Number>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.name_447())
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = name_443.name_445(protocolBuffer);
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<Number>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = Number(this.elementCodec.method_296(protocolBuffer));
|
||||
items3[i3] = Number(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
@@ -66,7 +66,7 @@ package package_35
|
||||
return result;
|
||||
}
|
||||
|
||||
public function method_295(protocolBuffer:name_442, object:Object) : void
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<Number>> = null;
|
||||
var length2:int = 0;
|
||||
@@ -80,37 +80,37 @@ package package_35
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<Number>>> = Vector.<Vector.<Vector.<Number>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
name_443.name_446(protocolBuffer,length1);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(false);
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
name_443.name_446(protocolBuffer,length2);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(false);
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
name_443.name_446(protocolBuffer,length3);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.method_295(protocolBuffer,items3[i3]);
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(true);
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(true);
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
58
src/_codec/VectorCodecintLevel1.as
Normal file
@@ -0,0 +1,58 @@
|
||||
package _codec
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
|
||||
public class VectorCodecintLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecintLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<int> = new Vector.<int>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = int(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<int> = Vector.<int>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package package_35
|
||||
package _codec
|
||||
{
|
||||
import package_32.name_148;
|
||||
import package_34.name_150;
|
||||
import package_36.name_152;
|
||||
import package_36.name_163;
|
||||
import package_36.name_442;
|
||||
import package_38.name_443;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
|
||||
public class VectorCodecintLevel2 implements name_152
|
||||
public class VectorCodecintLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:name_152;
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
@@ -19,32 +19,32 @@ package package_35
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:name_163) : void
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.name_448(new name_148(int,false));
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new name_150(this.elementCodec);
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function method_296(protocolBuffer:name_442) : Object
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<int> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = name_443.name_445(protocolBuffer);
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<int>> = new Vector.<Vector.<int>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.name_447())
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = name_443.name_445(protocolBuffer);
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<int>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = int(this.elementCodec.method_296(protocolBuffer));
|
||||
items2[i2] = int(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
@@ -52,7 +52,7 @@ package package_35
|
||||
return result;
|
||||
}
|
||||
|
||||
public function method_295(protocolBuffer:name_442, object:Object) : void
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<int> = null;
|
||||
var length2:int = 0;
|
||||
@@ -63,23 +63,23 @@ package package_35
|
||||
}
|
||||
var data:Vector.<Vector.<int>> = Vector.<Vector.<int>>(object);
|
||||
var length1:int = int(data.length);
|
||||
name_443.name_446(protocolBuffer,length1);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(false);
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
name_443.name_446(protocolBuffer,length2);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.method_295(protocolBuffer,items2[i2]);
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(true);
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
package package_35
|
||||
package _codec
|
||||
{
|
||||
import package_32.name_148;
|
||||
import package_34.name_150;
|
||||
import package_36.name_152;
|
||||
import package_36.name_163;
|
||||
import package_36.name_442;
|
||||
import package_38.name_443;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
|
||||
public class VectorCodecintLevel3 implements name_152
|
||||
public class VectorCodecintLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:name_152;
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
@@ -19,16 +19,16 @@ package package_35
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:name_163) : void
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.name_448(new name_148(int,false));
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new name_150(this.elementCodec);
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function method_296(protocolBuffer:name_442) : Object
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<int>> = null;
|
||||
@@ -36,25 +36,25 @@ package package_35
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<int> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = name_443.name_445(protocolBuffer);
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<int>>> = new Vector.<Vector.<Vector.<int>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.name_447())
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = name_443.name_445(protocolBuffer);
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<int>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.name_447())
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = name_443.name_445(protocolBuffer);
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<int>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = int(this.elementCodec.method_296(protocolBuffer));
|
||||
items3[i3] = int(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
@@ -65,7 +65,7 @@ package package_35
|
||||
return result;
|
||||
}
|
||||
|
||||
public function method_295(protocolBuffer:name_442, object:Object) : void
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<int>> = null;
|
||||
var length2:int = 0;
|
||||
@@ -79,37 +79,37 @@ package package_35
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<int>>> = Vector.<Vector.<Vector.<int>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
name_443.name_446(protocolBuffer,length1);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(false);
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
name_443.name_446(protocolBuffer,length2);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(false);
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
name_443.name_446(protocolBuffer,length3);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.method_295(protocolBuffer,items3[i3]);
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(true);
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(true);
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
59
src/_codec/VectorCodeclongLevel1.as
Normal file
@@ -0,0 +1,59 @@
|
||||
package _codec
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.Long;
|
||||
|
||||
public class VectorCodeclongLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodeclongLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Long,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Long> = new Vector.<Long>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = Long(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Long> = Vector.<Long>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
89
src/_codec/VectorCodeclongLevel2.as
Normal file
@@ -0,0 +1,89 @@
|
||||
package _codec
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.Long;
|
||||
|
||||
public class VectorCodeclongLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodeclongLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Long,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Long> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Long>> = new Vector.<Vector.<Long>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Long>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = Long(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Long> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Long>> = Vector.<Vector.<Long>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
119
src/_codec/VectorCodeclongLevel3.as
Normal file
@@ -0,0 +1,119 @@
|
||||
package _codec
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.Long;
|
||||
|
||||
public class VectorCodeclongLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodeclongLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Long,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<Long>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<Long> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<Long>>> = new Vector.<Vector.<Vector.<Long>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<Long>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<Long>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = Long(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<Long>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<Long> = null;
|
||||
var length3:int = 0;
|
||||
var i3:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<Long>>> = Vector.<Vector.<Vector.<Long>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
59
src/_codec/VectorCodecshortLevel1.as
Normal file
@@ -0,0 +1,59 @@
|
||||
package _codec
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.Short;
|
||||
|
||||
public class VectorCodecshortLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecshortLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Short,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<int> = new Vector.<int>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = int(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<int> = Vector.<int>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package package_35
|
||||
package _codec
|
||||
{
|
||||
import package_32.name_148;
|
||||
import package_33.name_158;
|
||||
import package_34.name_150;
|
||||
import package_36.name_152;
|
||||
import package_36.name_163;
|
||||
import package_36.name_442;
|
||||
import package_38.name_443;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.Short;
|
||||
|
||||
public class VectorCodecshortLevel2 implements name_152
|
||||
public class VectorCodecshortLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:name_152;
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
@@ -20,32 +20,32 @@ package package_35
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:name_163) : void
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.name_448(new name_148(name_158,false));
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Short,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new name_150(this.elementCodec);
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function method_296(protocolBuffer:name_442) : Object
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<int> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = name_443.name_445(protocolBuffer);
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<int>> = new Vector.<Vector.<int>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.name_447())
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = name_443.name_445(protocolBuffer);
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<int>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = int(this.elementCodec.method_296(protocolBuffer));
|
||||
items2[i2] = int(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
@@ -53,7 +53,7 @@ package package_35
|
||||
return result;
|
||||
}
|
||||
|
||||
public function method_295(protocolBuffer:name_442, object:Object) : void
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<int> = null;
|
||||
var length2:int = 0;
|
||||
@@ -64,23 +64,23 @@ package package_35
|
||||
}
|
||||
var data:Vector.<Vector.<int>> = Vector.<Vector.<int>>(object);
|
||||
var length1:int = int(data.length);
|
||||
name_443.name_446(protocolBuffer,length1);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(false);
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
name_443.name_446(protocolBuffer,length2);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.method_295(protocolBuffer,items2[i2]);
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(true);
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
package package_35
|
||||
package _codec
|
||||
{
|
||||
import package_32.name_148;
|
||||
import package_33.name_158;
|
||||
import package_34.name_150;
|
||||
import package_36.name_152;
|
||||
import package_36.name_163;
|
||||
import package_36.name_442;
|
||||
import package_38.name_443;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.Short;
|
||||
|
||||
public class VectorCodecshortLevel3 implements name_152
|
||||
public class VectorCodecshortLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:name_152;
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
@@ -20,16 +20,16 @@ package package_35
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:name_163) : void
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.name_448(new name_148(name_158,false));
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Short,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new name_150(this.elementCodec);
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function method_296(protocolBuffer:name_442) : Object
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<int>> = null;
|
||||
@@ -37,25 +37,25 @@ package package_35
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<int> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = name_443.name_445(protocolBuffer);
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<int>>> = new Vector.<Vector.<Vector.<int>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.name_447())
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = name_443.name_445(protocolBuffer);
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<int>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.name_447())
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = name_443.name_445(protocolBuffer);
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<int>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = int(this.elementCodec.method_296(protocolBuffer));
|
||||
items3[i3] = int(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
@@ -66,7 +66,7 @@ package package_35
|
||||
return result;
|
||||
}
|
||||
|
||||
public function method_295(protocolBuffer:name_442, object:Object) : void
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<int>> = null;
|
||||
var length2:int = 0;
|
||||
@@ -80,37 +80,37 @@ package package_35
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<int>>> = Vector.<Vector.<Vector.<int>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
name_443.name_446(protocolBuffer,length1);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(false);
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
name_443.name_446(protocolBuffer,length2);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(false);
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
name_443.name_446(protocolBuffer,length3);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.method_295(protocolBuffer,items3[i3]);
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(true);
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.name_444(true);
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
113
src/_codec/commons/CodecA3DMatrix.as
Normal file
@@ -0,0 +1,113 @@
|
||||
package _codec.commons
|
||||
{
|
||||
import alternativa.osgi.OSGi;
|
||||
import alternativa.osgi.service.clientlog.IClientLog;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.Float;
|
||||
import commons.A3DMatrix;
|
||||
|
||||
public class CodecA3DMatrix implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-Bx§:ICodec;
|
||||
|
||||
private var §_-Qh§:ICodec;
|
||||
|
||||
private var §_-ir§:ICodec;
|
||||
|
||||
private var §_-p§:ICodec;
|
||||
|
||||
private var §_-Kw§:ICodec;
|
||||
|
||||
private var §_-PP§:ICodec;
|
||||
|
||||
private var §_-e7§:ICodec;
|
||||
|
||||
private var §_-QE§:ICodec;
|
||||
|
||||
private var §_-SL§:ICodec;
|
||||
|
||||
private var §for §:ICodec;
|
||||
|
||||
private var §_-Hb§:ICodec;
|
||||
|
||||
private var §_-3B§:ICodec;
|
||||
|
||||
public function CodecA3DMatrix()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-Bx§ = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
this.§_-Qh§ = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
this.§_-ir§ = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
this.§_-p§ = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
this.§_-Kw§ = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
this.§_-PP§ = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
this.§_-e7§ = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
this.§_-QE§ = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
this.§_-SL§ = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
this.§for § = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
this.§_-Hb§ = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
this.§_-3B§ = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_a:Number = Number(this.§_-Bx§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","a",value_a);
|
||||
var value_b:Number = Number(this.§_-Qh§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","b",value_b);
|
||||
var value_c:Number = Number(this.§_-ir§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","c",value_c);
|
||||
var value_d:Number = Number(this.§_-p§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","d",value_d);
|
||||
var value_e:Number = Number(this.§_-Kw§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","e",value_e);
|
||||
var value_f:Number = Number(this.§_-PP§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","f",value_f);
|
||||
var value_g:Number = Number(this.§_-e7§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","g",value_g);
|
||||
var value_h:Number = Number(this.§_-QE§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","h",value_h);
|
||||
var value_i:Number = Number(this.§_-SL§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","i",value_i);
|
||||
var value_j:Number = Number(this.§for §.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","j",value_j);
|
||||
var value_k:Number = Number(this.§_-Hb§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","k",value_k);
|
||||
var value_l:Number = Number(this.§_-3B§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","commons.A3DMatrix","l",value_l);
|
||||
return new A3DMatrix(value_a,value_b,value_c,value_d,value_e,value_f,value_g,value_h,value_i,value_j,value_k,value_l);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3DMatrix = A3DMatrix(object);
|
||||
this.§_-Bx§.encode(protocolBuffer,struct.a);
|
||||
this.§_-Qh§.encode(protocolBuffer,struct.b);
|
||||
this.§_-ir§.encode(protocolBuffer,struct.c);
|
||||
this.§_-p§.encode(protocolBuffer,struct.d);
|
||||
this.§_-Kw§.encode(protocolBuffer,struct.e);
|
||||
this.§_-PP§.encode(protocolBuffer,struct.f);
|
||||
this.§_-e7§.encode(protocolBuffer,struct.g);
|
||||
this.§_-QE§.encode(protocolBuffer,struct.h);
|
||||
this.§_-SL§.encode(protocolBuffer,struct.i);
|
||||
this.§for §.encode(protocolBuffer,struct.j);
|
||||
this.§_-Hb§.encode(protocolBuffer,struct.k);
|
||||
this.§_-3B§.encode(protocolBuffer,struct.l);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
46
src/_codec/commons/CodecId.as
Normal file
@@ -0,0 +1,46 @@
|
||||
package _codec.commons
|
||||
{
|
||||
import alternativa.osgi.OSGi;
|
||||
import alternativa.osgi.service.clientlog.IClientLog;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import commons.Id;
|
||||
|
||||
public class CodecId implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
public function CodecId()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(uint,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_id:uint = uint(this.§_-2o§.decode(protocolBuffer) as uint);
|
||||
log.log("codec","struct %1 field %2 value %3","commons.Id","id",value_id);
|
||||
return new Id(value_id);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:Id = Id(object);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
59
src/_codec/commons/VectorCodecA3DMatrixLevel1.as
Normal file
@@ -0,0 +1,59 @@
|
||||
package _codec.commons
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import commons.A3DMatrix;
|
||||
|
||||
public class VectorCodecA3DMatrixLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DMatrixLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMatrix,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<A3DMatrix> = new Vector.<A3DMatrix>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3DMatrix(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<A3DMatrix> = Vector.<A3DMatrix>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
89
src/_codec/commons/VectorCodecA3DMatrixLevel2.as
Normal file
@@ -0,0 +1,89 @@
|
||||
package _codec.commons
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import commons.A3DMatrix;
|
||||
|
||||
public class VectorCodecA3DMatrixLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DMatrixLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMatrix,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3DMatrix> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3DMatrix>> = new Vector.<Vector.<A3DMatrix>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3DMatrix>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3DMatrix(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3DMatrix> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<A3DMatrix>> = Vector.<Vector.<A3DMatrix>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
119
src/_codec/commons/VectorCodecA3DMatrixLevel3.as
Normal file
@@ -0,0 +1,119 @@
|
||||
package _codec.commons
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import commons.A3DMatrix;
|
||||
|
||||
public class VectorCodecA3DMatrixLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DMatrixLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMatrix,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3DMatrix>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3DMatrix> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3DMatrix>>> = new Vector.<Vector.<Vector.<A3DMatrix>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3DMatrix>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3DMatrix>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3DMatrix(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3DMatrix>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3DMatrix> = null;
|
||||
var length3:int = 0;
|
||||
var i3:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<A3DMatrix>>> = Vector.<Vector.<Vector.<A3DMatrix>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
59
src/_codec/commons/VectorCodecIdLevel1.as
Normal file
@@ -0,0 +1,59 @@
|
||||
package _codec.commons
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import commons.Id;
|
||||
|
||||
public class VectorCodecIdLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecIdLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Id,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Id> = new Vector.<Id>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = Id(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Id> = Vector.<Id>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
89
src/_codec/commons/VectorCodecIdLevel2.as
Normal file
@@ -0,0 +1,89 @@
|
||||
package _codec.commons
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import commons.Id;
|
||||
|
||||
public class VectorCodecIdLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecIdLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Id,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Id> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Id>> = new Vector.<Vector.<Id>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Id>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = Id(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Id> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Id>> = Vector.<Vector.<Id>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
119
src/_codec/commons/VectorCodecIdLevel3.as
Normal file
@@ -0,0 +1,119 @@
|
||||
package _codec.commons
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import commons.Id;
|
||||
|
||||
public class VectorCodecIdLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecIdLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(Id,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<Id>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<Id> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<Id>>> = new Vector.<Vector.<Vector.<Id>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<Id>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<Id>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = Id(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<Id>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<Id> = null;
|
||||
var length3:int = 0;
|
||||
var i3:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<Id>>> = Vector.<Vector.<Vector.<Id>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
59
src/_codec/unsigned/VectorCodecintLevel1.as
Normal file
@@ -0,0 +1,59 @@
|
||||
package _codec.unsigned
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.UShort;
|
||||
|
||||
public class VectorCodecintLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecintLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(UShort,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<uint> = new Vector.<uint>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = uint(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<uint> = Vector.<uint>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||