mirror of
https://github.com/MapMakersAndProgrammers/TankiOnline2.0DemoClient.git
synced 2025-10-26 09:59:07 -07:00
Initial commit
This commit is contained in:
28
src/package_27/class_7.as
Normal file
28
src/package_27/class_7.as
Normal file
@@ -0,0 +1,28 @@
|
||||
package package_27
|
||||
{
|
||||
public class class_7
|
||||
{
|
||||
private var var_33:name_170;
|
||||
|
||||
public function class_7()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
throw new Error("Not implemented");
|
||||
}
|
||||
|
||||
internal function set method_101(value:name_170) : void
|
||||
{
|
||||
this.var_33 = value;
|
||||
}
|
||||
|
||||
final protected function method_102() : void
|
||||
{
|
||||
this.var_33.taskComplete(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
58
src/package_27/name_170.as
Normal file
58
src/package_27/name_170.as
Normal file
@@ -0,0 +1,58 @@
|
||||
package package_27
|
||||
{
|
||||
import flash.events.Event;
|
||||
import flash.events.EventDispatcher;
|
||||
|
||||
public class name_170 extends EventDispatcher
|
||||
{
|
||||
private var tasks:Vector.<class_7>;
|
||||
|
||||
private var var_192:int;
|
||||
|
||||
public function name_170()
|
||||
{
|
||||
super();
|
||||
this.tasks = new Vector.<class_7>();
|
||||
}
|
||||
|
||||
public function addTask(task:class_7) : void
|
||||
{
|
||||
if(this.tasks.indexOf(task) < 0)
|
||||
{
|
||||
this.tasks.push(task);
|
||||
task.method_101 = this;
|
||||
}
|
||||
}
|
||||
|
||||
public function run() : void
|
||||
{
|
||||
if(this.tasks.length > 0)
|
||||
{
|
||||
this.var_192 = 0;
|
||||
this.method_309();
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatchEvent(new Event(Event.COMPLETE));
|
||||
}
|
||||
}
|
||||
|
||||
private function method_309() : void
|
||||
{
|
||||
class_7(this.tasks[this.var_192]).run();
|
||||
}
|
||||
|
||||
internal function taskComplete(task:class_7) : void
|
||||
{
|
||||
if(++this.var_192 < this.tasks.length)
|
||||
{
|
||||
this.method_309();
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatchEvent(new Event(Event.COMPLETE));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
44
src/package_27/name_180.as
Normal file
44
src/package_27/name_180.as
Normal file
@@ -0,0 +1,44 @@
|
||||
package package_27
|
||||
{
|
||||
import flash.utils.getTimer;
|
||||
|
||||
public class name_180
|
||||
{
|
||||
public var var_211:Number = 0;
|
||||
|
||||
public var var_212:Number = 0;
|
||||
|
||||
private var maxTicks:int;
|
||||
|
||||
private var var_208:int;
|
||||
|
||||
private var var_210:int;
|
||||
|
||||
private var var_209:int;
|
||||
|
||||
public function name_180(maxTicks:int)
|
||||
{
|
||||
super();
|
||||
this.maxTicks = maxTicks;
|
||||
}
|
||||
|
||||
public function name_188() : void
|
||||
{
|
||||
this.var_210 = getTimer();
|
||||
}
|
||||
|
||||
public function name_186() : void
|
||||
{
|
||||
this.var_209 += getTimer() - this.var_210;
|
||||
++this.var_208;
|
||||
if(this.var_208 >= this.maxTicks)
|
||||
{
|
||||
this.var_211 = this.var_209 / this.var_208;
|
||||
this.var_212 = this.var_208 * 1000 / this.var_209;
|
||||
this.var_208 = 0;
|
||||
this.var_209 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
55
src/package_27/name_479.as
Normal file
55
src/package_27/name_479.as
Normal file
@@ -0,0 +1,55 @@
|
||||
package package_27
|
||||
{
|
||||
public class name_479
|
||||
{
|
||||
private var elements:Vector.<uint>;
|
||||
|
||||
public function name_479(size:uint)
|
||||
{
|
||||
super();
|
||||
this.elements = new Vector.<uint>((size + 31) / 32);
|
||||
}
|
||||
|
||||
public function name_480(bitIndex:uint, value:Boolean) : void
|
||||
{
|
||||
var elementIndex:uint = uint(bitIndex >>> 5);
|
||||
var element:uint = this.elements[elementIndex];
|
||||
bitIndex &= 31;
|
||||
if(value)
|
||||
{
|
||||
element |= 1 << bitIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
element &= ~(1 << bitIndex);
|
||||
}
|
||||
this.elements[elementIndex] = element;
|
||||
}
|
||||
|
||||
public function name_478(bitIndex:uint) : int
|
||||
{
|
||||
var elementIndex:uint = uint(bitIndex >>> 5);
|
||||
bitIndex &= 31;
|
||||
return this.elements[elementIndex] >> bitIndex & 1;
|
||||
}
|
||||
|
||||
public function clear() : void
|
||||
{
|
||||
var len:int = int(this.elements.length);
|
||||
for(var i:int = 0; i < len; i++)
|
||||
{
|
||||
this.elements[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public function copyFrom(source:name_479) : void
|
||||
{
|
||||
var len:int = int(this.elements.length);
|
||||
for(var i:int = 0; i < len; i++)
|
||||
{
|
||||
this.elements[i] = source.elements[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
78
src/package_27/name_501.as
Normal file
78
src/package_27/name_501.as
Normal file
@@ -0,0 +1,78 @@
|
||||
package package_27
|
||||
{
|
||||
public class name_501
|
||||
{
|
||||
public static const EPSILON:Number = 0.001;
|
||||
|
||||
public static const BIG_VALUE:Number = 1000000;
|
||||
|
||||
public static const PI2:Number = 2 * Math.PI;
|
||||
|
||||
public function name_501()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function clamp(value:Number, min:Number, max:Number) : Number
|
||||
{
|
||||
if(value < min)
|
||||
{
|
||||
return min;
|
||||
}
|
||||
if(value > max)
|
||||
{
|
||||
return max;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public static function name_506(radians:Number) : Number
|
||||
{
|
||||
radians %= PI2;
|
||||
if(radians < -Math.PI)
|
||||
{
|
||||
return PI2 + radians;
|
||||
}
|
||||
if(radians > Math.PI)
|
||||
{
|
||||
return radians - PI2;
|
||||
}
|
||||
return radians;
|
||||
}
|
||||
|
||||
public static function name_628(radians:Number) : Number
|
||||
{
|
||||
if(radians < -Math.PI)
|
||||
{
|
||||
return PI2 + radians;
|
||||
}
|
||||
if(radians > Math.PI)
|
||||
{
|
||||
return radians - PI2;
|
||||
}
|
||||
return radians;
|
||||
}
|
||||
|
||||
public static function name_504(value:Number, targetValue:Number, delta:Number) : Number
|
||||
{
|
||||
if(value < targetValue)
|
||||
{
|
||||
value += delta;
|
||||
if(value > targetValue)
|
||||
{
|
||||
value = targetValue;
|
||||
}
|
||||
}
|
||||
else if(value > targetValue)
|
||||
{
|
||||
value -= delta;
|
||||
if(value < targetValue)
|
||||
{
|
||||
value = targetValue;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
74
src/package_27/name_519.as
Normal file
74
src/package_27/name_519.as
Normal file
@@ -0,0 +1,74 @@
|
||||
package package_27
|
||||
{
|
||||
import package_21.name_78;
|
||||
import package_46.Matrix3;
|
||||
import package_46.name_194;
|
||||
|
||||
public class name_519
|
||||
{
|
||||
private static var axis1:name_194 = new name_194();
|
||||
|
||||
private static var axis2:name_194 = new name_194();
|
||||
|
||||
private static var eulerAngles:name_194 = new name_194();
|
||||
|
||||
private static var targetAxisZ:name_194 = new name_194();
|
||||
|
||||
private static var objectAxis:name_194 = new name_194();
|
||||
|
||||
private static var matrix1:Matrix3 = new Matrix3();
|
||||
|
||||
private static var matrix2:Matrix3 = new Matrix3();
|
||||
|
||||
public function name_519()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function name_521(object:name_78, objectPosition:name_194, objectDirection:name_194, cameraPosition:name_194) : void
|
||||
{
|
||||
var angle:Number = NaN;
|
||||
if(objectDirection.y < -0.99999 || objectDirection.y > 0.99999)
|
||||
{
|
||||
axis1.x = 0;
|
||||
axis1.y = 0;
|
||||
axis1.z = 1;
|
||||
angle = objectDirection.y < 0 ? Number(Math.PI) : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
axis1.x = objectDirection.z;
|
||||
axis1.y = 0;
|
||||
axis1.z = -objectDirection.x;
|
||||
axis1.normalize();
|
||||
angle = Number(Math.acos(objectDirection.y));
|
||||
}
|
||||
matrix1.method_344(axis1,angle);
|
||||
targetAxisZ.x = cameraPosition.x - objectPosition.x;
|
||||
targetAxisZ.y = cameraPosition.y - objectPosition.y;
|
||||
targetAxisZ.z = cameraPosition.z - objectPosition.z;
|
||||
var dot:Number = targetAxisZ.x * objectDirection.x + targetAxisZ.y * objectDirection.y + targetAxisZ.z * objectDirection.z;
|
||||
targetAxisZ.x -= dot * objectDirection.x;
|
||||
targetAxisZ.y -= dot * objectDirection.y;
|
||||
targetAxisZ.z -= dot * objectDirection.z;
|
||||
targetAxisZ.normalize();
|
||||
matrix1.method_345(name_194.Z_AXIS,objectAxis);
|
||||
dot = objectAxis.x * targetAxisZ.x + objectAxis.y * targetAxisZ.y + objectAxis.z * targetAxisZ.z;
|
||||
axis2.x = objectAxis.y * targetAxisZ.z - objectAxis.z * targetAxisZ.y;
|
||||
axis2.y = objectAxis.z * targetAxisZ.x - objectAxis.x * targetAxisZ.z;
|
||||
axis2.z = objectAxis.x * targetAxisZ.y - objectAxis.y * targetAxisZ.x;
|
||||
axis2.normalize();
|
||||
angle = Number(Math.acos(dot));
|
||||
matrix2.method_344(axis2,angle);
|
||||
matrix1.append(matrix2);
|
||||
matrix1.name_341(eulerAngles);
|
||||
object.rotationX = eulerAngles.x;
|
||||
object.rotationY = eulerAngles.y;
|
||||
object.rotationZ = eulerAngles.z;
|
||||
object.x = objectPosition.x;
|
||||
object.y = objectPosition.y;
|
||||
object.z = objectPosition.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
186
src/package_27/name_642.as
Normal file
186
src/package_27/name_642.as
Normal file
@@ -0,0 +1,186 @@
|
||||
package package_27
|
||||
{
|
||||
import package_109.name_377;
|
||||
import package_109.name_378;
|
||||
import package_109.name_381;
|
||||
import package_19.name_380;
|
||||
import package_21.name_126;
|
||||
import package_46.Matrix4;
|
||||
import package_46.name_194;
|
||||
import package_76.name_235;
|
||||
|
||||
public class name_642
|
||||
{
|
||||
public function name_642()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function name_646(mesh:name_380, collisionPrimitives:Vector.<name_235>, collisionGroup:int, collisionMask:int) : void
|
||||
{
|
||||
mesh.calculateBoundBox();
|
||||
var minX:Number = mesh.boundBox.minX * mesh.scaleX;
|
||||
var maxX:Number = mesh.boundBox.maxX * mesh.scaleX;
|
||||
var minY:Number = mesh.boundBox.minY * mesh.scaleX;
|
||||
var maxY:Number = mesh.boundBox.maxY * mesh.scaleX;
|
||||
var minZ:Number = mesh.boundBox.minZ * mesh.scaleX;
|
||||
var maxZ:Number = mesh.boundBox.maxZ * mesh.scaleX;
|
||||
var halfSize:name_194 = new name_194();
|
||||
halfSize.x = maxX - minX;
|
||||
halfSize.y = maxY - minY;
|
||||
halfSize.z = maxZ - minZ;
|
||||
halfSize.scale(0.5);
|
||||
var collisionBox:name_377 = new name_377(halfSize,collisionGroup,collisionMask);
|
||||
collisionBox.transform.setMatrix(mesh.x,mesh.y,mesh.z,mesh.rotationX,mesh.rotationY,mesh.rotationZ);
|
||||
var midPoint:name_194 = new name_194(0.5 * (maxX + minX),0.5 * (maxY + minY),0.5 * (maxZ + minZ));
|
||||
midPoint.transform4(collisionBox.transform);
|
||||
collisionBox.transform.d = midPoint.x;
|
||||
collisionBox.transform.h = midPoint.y;
|
||||
collisionBox.transform.l = midPoint.z;
|
||||
collisionPrimitives.push(collisionBox);
|
||||
}
|
||||
|
||||
public static function name_645(mesh:name_380, collisionPrimitives:Vector.<name_235>, collisionGroup:int, collisionMask:int) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var baseIndex:uint = 0;
|
||||
var edge:name_194 = null;
|
||||
var len:Number = NaN;
|
||||
var indices:Vector.<uint> = mesh.geometry.indices;
|
||||
var vertexCoordinates:Vector.<Number> = mesh.geometry.method_275(name_126.POSITION);
|
||||
var faceVertexIndices:Vector.<uint> = Vector.<uint>([indices[0],indices[1],indices[2]]);
|
||||
var edges:Vector.<name_194> = Vector.<name_194>([new name_194(),new name_194(),new name_194()]);
|
||||
var lengths:Vector.<Number> = new Vector.<Number>(3);
|
||||
var vertices:Vector.<name_194> = new Vector.<name_194>(3);
|
||||
for(i = 0; i < 3; i++)
|
||||
{
|
||||
baseIndex = 3 * faceVertexIndices[i];
|
||||
vertices[i] = new name_194(vertexCoordinates[baseIndex],vertexCoordinates[baseIndex + 1],vertexCoordinates[baseIndex + 2]);
|
||||
}
|
||||
var max:Number = -1;
|
||||
var imax:int = 0;
|
||||
for(i = 0; i < 3; )
|
||||
{
|
||||
edge = edges[i];
|
||||
edge.method_366(vertices[(i + 1) % 3],vertices[i]);
|
||||
len = lengths[i] = edge.length();
|
||||
if(len > max)
|
||||
{
|
||||
max = len;
|
||||
imax = i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
var ix:int = (imax + 2) % 3;
|
||||
var iy:int = (imax + 1) % 3;
|
||||
var xAxis:name_194 = edges[ix];
|
||||
var yAxis:name_194 = edges[iy];
|
||||
yAxis.reverse();
|
||||
var width:Number = lengths[ix];
|
||||
var length:Number = lengths[iy];
|
||||
var translation:name_194 = vertices[(imax + 2) % 3].clone();
|
||||
translation.x += 0.5 * (xAxis.x + yAxis.x);
|
||||
translation.y += 0.5 * (xAxis.y + yAxis.y);
|
||||
translation.z += 0.5 * (xAxis.z + yAxis.z);
|
||||
xAxis.normalize();
|
||||
yAxis.normalize();
|
||||
var zAxis:name_194 = new name_194().cross2(xAxis,yAxis);
|
||||
var collisionRect:name_381 = new name_381(new name_194(width / 2,length / 2,0),collisionGroup,collisionMask);
|
||||
var transform:Matrix4 = collisionRect.transform;
|
||||
transform.a = xAxis.x;
|
||||
transform.e = xAxis.y;
|
||||
transform.i = xAxis.z;
|
||||
transform.b = yAxis.x;
|
||||
transform.f = yAxis.y;
|
||||
transform.j = yAxis.z;
|
||||
transform.c = zAxis.x;
|
||||
transform.g = zAxis.y;
|
||||
transform.k = zAxis.z;
|
||||
transform.d = translation.x;
|
||||
transform.h = translation.y;
|
||||
transform.l = translation.z;
|
||||
var matrix:Matrix4 = new Matrix4();
|
||||
matrix.setMatrix(mesh.x,mesh.y,mesh.z,mesh.rotationX,mesh.rotationY,mesh.rotationZ);
|
||||
transform.append(matrix);
|
||||
collisionPrimitives.push(collisionRect);
|
||||
}
|
||||
|
||||
public static function name_644(mesh:name_380, collisionPrimitives:Vector.<name_235>, collisionGroup:int, collisionMask:int) : int
|
||||
{
|
||||
var numTriangles:int = 0;
|
||||
var j:int = 0;
|
||||
var vertexBaseIndex:uint = 0;
|
||||
var v:name_194 = null;
|
||||
var indices:Vector.<uint> = mesh.geometry.indices;
|
||||
var vertexCoordinates:Vector.<Number> = mesh.geometry.method_275(name_126.POSITION);
|
||||
var vertices:Vector.<name_194> = new Vector.<name_194>(3);
|
||||
vertices[0] = new name_194();
|
||||
vertices[1] = new name_194();
|
||||
vertices[2] = new name_194();
|
||||
for(var i:int = 0; i < indices.length; i += 3)
|
||||
{
|
||||
for(j = 0; j < 3; j++)
|
||||
{
|
||||
vertexBaseIndex = 3 * indices[i + j];
|
||||
v = vertices[j];
|
||||
v.x = vertexCoordinates[vertexBaseIndex];
|
||||
v.y = vertexCoordinates[vertexBaseIndex + 1];
|
||||
v.z = vertexCoordinates[vertexBaseIndex + 2];
|
||||
v.scale(mesh.scaleX);
|
||||
}
|
||||
numTriangles++;
|
||||
collisionPrimitives.push(method_813(vertices[0],vertices[1],vertices[2],mesh,collisionGroup,collisionMask));
|
||||
}
|
||||
return numTriangles;
|
||||
}
|
||||
|
||||
private static function method_813(v0:name_194, v1:name_194, v2:name_194, parentMesh:name_380, collisionGroup:int, collisionMask:int) : name_378
|
||||
{
|
||||
var midPoint:name_194 = new name_194();
|
||||
midPoint.x = (v0.x + v1.x + v2.x) / 3;
|
||||
midPoint.y = (v0.y + v1.y + v2.y) / 3;
|
||||
midPoint.z = (v0.z + v1.z + v2.z) / 3;
|
||||
var xAxis:name_194 = new name_194();
|
||||
xAxis.method_366(v1,v0);
|
||||
v1.reset(xAxis.length(),0,0);
|
||||
xAxis.normalize();
|
||||
var yAxis:name_194 = new name_194();
|
||||
yAxis.method_366(v2,v0);
|
||||
var x:Number = yAxis.dot(xAxis);
|
||||
var y:Number = Number(Math.sqrt(yAxis.method_365() - x * x));
|
||||
v2.reset(x,y,0);
|
||||
var zAxis:name_194 = new name_194();
|
||||
zAxis.cross2(xAxis,yAxis);
|
||||
zAxis.normalize();
|
||||
yAxis.cross2(zAxis,xAxis);
|
||||
yAxis.normalize();
|
||||
var transform:Matrix4 = new Matrix4();
|
||||
transform.a = xAxis.x;
|
||||
transform.e = xAxis.y;
|
||||
transform.i = xAxis.z;
|
||||
transform.b = yAxis.x;
|
||||
transform.f = yAxis.y;
|
||||
transform.j = yAxis.z;
|
||||
transform.c = zAxis.x;
|
||||
transform.g = zAxis.y;
|
||||
transform.k = zAxis.z;
|
||||
transform.d = midPoint.x;
|
||||
transform.h = midPoint.y;
|
||||
transform.l = midPoint.z;
|
||||
var meshMatrix:Matrix4 = new Matrix4();
|
||||
meshMatrix.setMatrix(parentMesh.x,parentMesh.y,parentMesh.z,parentMesh.rotationX,parentMesh.rotationY,parentMesh.rotationZ);
|
||||
transform.append(meshMatrix);
|
||||
x = (v1.x + v2.x) / 3;
|
||||
y = (v1.y + v2.y) / 3;
|
||||
v0.reset(-x,-y,0);
|
||||
v1.x -= x;
|
||||
v1.y -= y;
|
||||
v2.x -= x;
|
||||
v2.y -= y;
|
||||
var collisionTriangle:name_378 = new name_378(v0,v1,v2,collisionGroup,collisionMask);
|
||||
collisionTriangle.transform = transform;
|
||||
return collisionTriangle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
33
src/package_27/name_95.as
Normal file
33
src/package_27/name_95.as
Normal file
@@ -0,0 +1,33 @@
|
||||
package package_27
|
||||
{
|
||||
public class name_95
|
||||
{
|
||||
public var flags:int;
|
||||
|
||||
public function name_95()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function method_268(mask:int) : void
|
||||
{
|
||||
this.flags |= mask;
|
||||
}
|
||||
|
||||
public function method_270(mask:int) : void
|
||||
{
|
||||
this.flags &= ~mask;
|
||||
}
|
||||
|
||||
public function method_269(mask:int) : Boolean
|
||||
{
|
||||
return (this.flags & mask) != 0;
|
||||
}
|
||||
|
||||
public function method_271(mask:int) : Boolean
|
||||
{
|
||||
return (this.flags & mask) == mask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user