Section 1
//b2BoxDef (Box2D.Collision.Shapes.b2BoxDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2BoxDef extends b2ShapeDef {
public var extents:b2Vec2;
public function b2BoxDef(){
type = b2Shape.e_boxShape;
extents = new b2Vec2(1, 1);
}
}
}//package Box2D.Collision.Shapes
Section 2
//b2CircleDef (Box2D.Collision.Shapes.b2CircleDef)
package Box2D.Collision.Shapes {
public class b2CircleDef extends b2ShapeDef {
public var radius:Number;
public function b2CircleDef(){
type = b2Shape.e_circleShape;
radius = 1;
}
}
}//package Box2D.Collision.Shapes
Section 3
//b2CircleShape (Box2D.Collision.Shapes.b2CircleShape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
public class b2CircleShape extends b2Shape {
public var m_localPosition:b2Vec2;
public var m_radius:Number;
public function b2CircleShape(_arg1:b2ShapeDef, _arg2:b2Body, _arg3:b2Vec2){
var _local4:b2CircleDef;
var _local5:Number;
var _local6:Number;
var _local7:b2AABB;
var _local8:b2BroadPhase;
m_localPosition = new b2Vec2();
super(_arg1, _arg2);
_local4 = (_arg1 as b2CircleDef);
m_localPosition.Set((_arg1.localPosition.x - _arg3.x), (_arg1.localPosition.y - _arg3.y));
m_type = b2Shape.e_circleShape;
m_radius = _local4.radius;
m_R.SetM(m_body.m_R);
_local5 = ((m_R.col1.x * m_localPosition.x) + (m_R.col2.x * m_localPosition.y));
_local6 = ((m_R.col1.y * m_localPosition.x) + (m_R.col2.y * m_localPosition.y));
m_position.x = (m_body.m_position.x + _local5);
m_position.y = (m_body.m_position.y + _local6);
m_maxRadius = (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))) + m_radius);
_local7 = new b2AABB();
_local7.minVertex.Set((m_position.x - m_radius), (m_position.y - m_radius));
_local7.maxVertex.Set((m_position.x + m_radius), (m_position.y + m_radius));
_local8 = m_body.m_world.m_broadPhase;
if (_local8.InRange(_local7)){
m_proxyId = _local8.CreateProxy(_local7, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
if (m_proxyId == b2Pair.b2_nullProxy){
m_body.Freeze();
};
}
override public function ResetProxy(_arg1:b2BroadPhase):void{
var _local2:b2Proxy;
var _local3:b2AABB;
if (m_proxyId == b2Pair.b2_nullProxy){
return;
};
_local2 = _arg1.GetProxy(m_proxyId);
_arg1.DestroyProxy(m_proxyId);
_local2 = null;
_local3 = new b2AABB();
_local3.minVertex.Set((m_position.x - m_radius), (m_position.y - m_radius));
_local3.maxVertex.Set((m_position.x + m_radius), (m_position.y + m_radius));
if (_arg1.InRange(_local3)){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
if (m_proxyId == b2Pair.b2_nullProxy){
m_body.Freeze();
};
}
override public function QuickSync(_arg1:b2Vec2, _arg2:b2Mat22):void{
m_R.SetM(_arg2);
m_position.x = (((_arg2.col1.x * m_localPosition.x) + (_arg2.col2.x * m_localPosition.y)) + _arg1.x);
m_position.y = (((_arg2.col1.y * m_localPosition.x) + (_arg2.col2.y * m_localPosition.y)) + _arg1.y);
}
override public function Support(_arg1:Number, _arg2:Number, _arg3:b2Vec2):void{
var _local4:Number;
_local4 = Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2)));
_arg1 = (_arg1 / _local4);
_arg2 = (_arg2 / _local4);
_arg3.Set((m_position.x + (m_radius * _arg1)), (m_position.y + (m_radius * _arg2)));
}
override public function Synchronize(_arg1:b2Vec2, _arg2:b2Mat22, _arg3:b2Vec2, _arg4:b2Mat22):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:b2AABB;
var _local12:b2BroadPhase;
m_R.SetM(_arg4);
m_position.x = (((_arg4.col1.x * m_localPosition.x) + (_arg4.col2.x * m_localPosition.y)) + _arg3.x);
m_position.y = (((_arg4.col1.y * m_localPosition.x) + (_arg4.col2.y * m_localPosition.y)) + _arg3.y);
if (m_proxyId == b2Pair.b2_nullProxy){
return;
};
_local5 = (_arg1.x + ((_arg2.col1.x * m_localPosition.x) + (_arg2.col2.x * m_localPosition.y)));
_local6 = (_arg1.y + ((_arg2.col1.y * m_localPosition.x) + (_arg2.col2.y * m_localPosition.y)));
_local7 = Math.min(_local5, m_position.x);
_local8 = Math.min(_local6, m_position.y);
_local9 = Math.max(_local5, m_position.x);
_local10 = Math.max(_local6, m_position.y);
_local11 = new b2AABB();
_local11.minVertex.Set((_local7 - m_radius), (_local8 - m_radius));
_local11.maxVertex.Set((_local9 + m_radius), (_local10 + m_radius));
_local12 = m_body.m_world.m_broadPhase;
if (_local12.InRange(_local11)){
_local12.MoveProxy(m_proxyId, _local11);
} else {
m_body.Freeze();
};
}
override public function TestPoint(_arg1:b2Vec2):Boolean{
var _local2:b2Vec2;
_local2 = new b2Vec2();
_local2.SetV(_arg1);
_local2.Subtract(m_position);
return ((b2Math.b2Dot(_local2, _local2) <= (m_radius * m_radius)));
}
}
}//package Box2D.Collision.Shapes
Section 4
//b2MassData (Box2D.Collision.Shapes.b2MassData)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2MassData {
public var mass:Number;// = 0
public var center:b2Vec2;
public var I:Number;// = 0
public function b2MassData(){
mass = 0;
center = new b2Vec2(0, 0);
I = 0;
super();
}
}
}//package Box2D.Collision.Shapes
Section 5
//b2PolyDef (Box2D.Collision.Shapes.b2PolyDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PolyDef extends b2ShapeDef {
public var vertexCount:int;
public var vertices:Array;
public function b2PolyDef(){
var _local1:int;
vertices = new Array(b2Settings.b2_maxPolyVertices);
super();
type = b2Shape.e_polyShape;
vertexCount = 0;
_local1 = 0;
while (_local1 < b2Settings.b2_maxPolyVertices) {
vertices[_local1] = new b2Vec2();
_local1++;
};
}
}
}//package Box2D.Collision.Shapes
Section 6
//b2PolyShape (Box2D.Collision.Shapes.b2PolyShape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolyShape extends b2Shape {
public var m_vertices:Array;
public var m_localOBB:b2OBB;
public var m_normals:Array;
public var m_vertexCount:int;
private var syncMat:b2Mat22;
public var m_coreVertices:Array;
public var m_localCentroid:b2Vec2;
private var syncAABB:b2AABB;
private static var tempVec:b2Vec2 = new b2Vec2();
private static var tAbsR:b2Mat22 = new b2Mat22();
public function b2PolyShape(_arg1:b2ShapeDef, _arg2:b2Body, _arg3:b2Vec2){
var _local4:int;
var _local5:Number;
var _local6:Number;
var _local7:b2Vec2;
var _local8:b2AABB;
var _local9:b2Mat22;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:int;
var _local15:int;
var _local16:Number;
var _local17:Number;
var _local18:b2BroadPhase;
var _local19:b2BoxDef;
var _local20:Number;
var _local21:Number;
var _local22:b2PolyDef;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:b2Vec2;
syncAABB = new b2AABB();
syncMat = new b2Mat22();
m_localCentroid = new b2Vec2();
m_localOBB = new b2OBB();
super(_arg1, _arg2);
_local8 = new b2AABB();
m_vertices = new Array(b2Settings.b2_maxPolyVertices);
m_coreVertices = new Array(b2Settings.b2_maxPolyVertices);
m_normals = new Array(b2Settings.b2_maxPolyVertices);
m_type = b2Shape.e_polyShape;
_local9 = new b2Mat22(_arg1.localRotation);
if (_arg1.type == b2Shape.e_boxShape){
m_localCentroid.x = (_arg1.localPosition.x - _arg3.x);
m_localCentroid.y = (_arg1.localPosition.y - _arg3.y);
_local19 = (_arg1 as b2BoxDef);
m_vertexCount = 4;
_local5 = _local19.extents.x;
_local6 = _local19.extents.y;
_local20 = Math.max(0, (_local5 - (2 * b2Settings.b2_linearSlop)));
_local21 = Math.max(0, (_local6 - (2 * b2Settings.b2_linearSlop)));
_local7 = (m_vertices[0] = new b2Vec2());
_local7.x = ((_local9.col1.x * _local5) + (_local9.col2.x * _local6));
_local7.y = ((_local9.col1.y * _local5) + (_local9.col2.y * _local6));
_local7 = (m_vertices[1] = new b2Vec2());
_local7.x = ((_local9.col1.x * -(_local5)) + (_local9.col2.x * _local6));
_local7.y = ((_local9.col1.y * -(_local5)) + (_local9.col2.y * _local6));
_local7 = (m_vertices[2] = new b2Vec2());
_local7.x = ((_local9.col1.x * -(_local5)) + (_local9.col2.x * -(_local6)));
_local7.y = ((_local9.col1.y * -(_local5)) + (_local9.col2.y * -(_local6)));
_local7 = (m_vertices[3] = new b2Vec2());
_local7.x = ((_local9.col1.x * _local5) + (_local9.col2.x * -(_local6)));
_local7.y = ((_local9.col1.y * _local5) + (_local9.col2.y * -(_local6)));
_local7 = (m_coreVertices[0] = new b2Vec2());
_local7.x = ((_local9.col1.x * _local20) + (_local9.col2.x * _local21));
_local7.y = ((_local9.col1.y * _local20) + (_local9.col2.y * _local21));
_local7 = (m_coreVertices[1] = new b2Vec2());
_local7.x = ((_local9.col1.x * -(_local20)) + (_local9.col2.x * _local21));
_local7.y = ((_local9.col1.y * -(_local20)) + (_local9.col2.y * _local21));
_local7 = (m_coreVertices[2] = new b2Vec2());
_local7.x = ((_local9.col1.x * -(_local20)) + (_local9.col2.x * -(_local21)));
_local7.y = ((_local9.col1.y * -(_local20)) + (_local9.col2.y * -(_local21)));
_local7 = (m_coreVertices[3] = new b2Vec2());
_local7.x = ((_local9.col1.x * _local20) + (_local9.col2.x * -(_local21)));
_local7.y = ((_local9.col1.y * _local20) + (_local9.col2.y * -(_local21)));
} else {
_local22 = (_arg1 as b2PolyDef);
m_vertexCount = _local22.vertexCount;
PolyCentroid(_local22.vertices, _local22.vertexCount, tempVec);
_local23 = tempVec.x;
_local24 = tempVec.y;
m_localCentroid.x = ((_arg1.localPosition.x + ((_local9.col1.x * _local23) + (_local9.col2.x * _local24))) - _arg3.x);
m_localCentroid.y = ((_arg1.localPosition.y + ((_local9.col1.y * _local23) + (_local9.col2.y * _local24))) - _arg3.y);
_local4 = 0;
while (_local4 < m_vertexCount) {
m_vertices[_local4] = new b2Vec2();
m_coreVertices[_local4] = new b2Vec2();
_local5 = (_local22.vertices[_local4].x - _local23);
_local6 = (_local22.vertices[_local4].y - _local24);
m_vertices[_local4].x = ((_local9.col1.x * _local5) + (_local9.col2.x * _local6));
m_vertices[_local4].y = ((_local9.col1.y * _local5) + (_local9.col2.y * _local6));
_local25 = m_vertices[_local4].x;
_local26 = m_vertices[_local4].y;
_local27 = Math.sqrt(((_local25 * _local25) + (_local26 * _local26)));
if (_local27 > Number.MIN_VALUE){
_local25 = (_local25 * (1 / _local27));
_local26 = (_local26 * (1 / _local27));
};
m_coreVertices[_local4].x = (m_vertices[_local4].x - ((2 * b2Settings.b2_linearSlop) * _local25));
m_coreVertices[_local4].y = (m_vertices[_local4].y - ((2 * b2Settings.b2_linearSlop) * _local26));
_local4++;
};
};
_local10 = Number.MAX_VALUE;
_local11 = Number.MAX_VALUE;
_local12 = -(Number.MAX_VALUE);
_local13 = -(Number.MAX_VALUE);
m_maxRadius = 0;
_local4 = 0;
while (_local4 < m_vertexCount) {
_local28 = m_vertices[_local4];
_local10 = Math.min(_local10, _local28.x);
_local11 = Math.min(_local11, _local28.y);
_local12 = Math.max(_local12, _local28.x);
_local13 = Math.max(_local13, _local28.y);
m_maxRadius = Math.max(m_maxRadius, _local28.Length());
_local4++;
};
m_localOBB.R.SetIdentity();
m_localOBB.center.Set(((_local10 + _local12) * 0.5), ((_local11 + _local13) * 0.5));
m_localOBB.extents.Set(((_local12 - _local10) * 0.5), ((_local13 - _local11) * 0.5));
_local4 = 0;
while (_local4 < m_vertexCount) {
m_normals[_local4] = new b2Vec2();
_local14 = _local4;
_local15 = (((_local4 + 1) < m_vertexCount)) ? (_local4 + 1) : 0;
m_normals[_local4].x = (m_vertices[_local15].y - m_vertices[_local14].y);
m_normals[_local4].y = -((m_vertices[_local15].x - m_vertices[_local14].x));
m_normals[_local4].Normalize();
_local4++;
};
_local4 = 0;
while (_local4 < m_vertexCount) {
_local14 = _local4;
_local15 = (((_local4 + 1) < m_vertexCount)) ? (_local4 + 1) : 0;
_local4++;
};
m_R.SetM(m_body.m_R);
m_position.x = (m_body.m_position.x + ((m_R.col1.x * m_localCentroid.x) + (m_R.col2.x * m_localCentroid.y)));
m_position.y = (m_body.m_position.y + ((m_R.col1.y * m_localCentroid.x) + (m_R.col2.y * m_localCentroid.y)));
tAbsR.col1.x = ((m_R.col1.x * m_localOBB.R.col1.x) + (m_R.col2.x * m_localOBB.R.col1.y));
tAbsR.col1.y = ((m_R.col1.y * m_localOBB.R.col1.x) + (m_R.col2.y * m_localOBB.R.col1.y));
tAbsR.col2.x = ((m_R.col1.x * m_localOBB.R.col2.x) + (m_R.col2.x * m_localOBB.R.col2.y));
tAbsR.col2.y = ((m_R.col1.y * m_localOBB.R.col2.x) + (m_R.col2.y * m_localOBB.R.col2.y));
tAbsR.Abs();
_local5 = ((tAbsR.col1.x * m_localOBB.extents.x) + (tAbsR.col2.x * m_localOBB.extents.y));
_local6 = ((tAbsR.col1.y * m_localOBB.extents.x) + (tAbsR.col2.y * m_localOBB.extents.y));
_local16 = (m_position.x + ((m_R.col1.x * m_localOBB.center.x) + (m_R.col2.x * m_localOBB.center.y)));
_local17 = (m_position.y + ((m_R.col1.y * m_localOBB.center.x) + (m_R.col2.y * m_localOBB.center.y)));
_local8.minVertex.x = (_local16 - _local5);
_local8.minVertex.y = (_local17 - _local6);
_local8.maxVertex.x = (_local16 + _local5);
_local8.maxVertex.y = (_local17 + _local6);
_local18 = m_body.m_world.m_broadPhase;
if (_local18.InRange(_local8)){
m_proxyId = _local18.CreateProxy(_local8, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
if (m_proxyId == b2Pair.b2_nullProxy){
m_body.Freeze();
};
}
override public function QuickSync(_arg1:b2Vec2, _arg2:b2Mat22):void{
m_R.SetM(_arg2);
m_position.x = (_arg1.x + ((_arg2.col1.x * m_localCentroid.x) + (_arg2.col2.x * m_localCentroid.y)));
m_position.y = (_arg1.y + ((_arg2.col1.y * m_localCentroid.x) + (_arg2.col2.y * m_localCentroid.y)));
}
override public function Support(_arg1:Number, _arg2:Number, _arg3:b2Vec2):void{
var _local4:Number;
var _local5:Number;
var _local6:int;
var _local7:Number;
var _local8:int;
var _local9:Number;
_local4 = ((_arg1 * m_R.col1.x) + (_arg2 * m_R.col1.y));
_local5 = ((_arg1 * m_R.col2.x) + (_arg2 * m_R.col2.y));
_local6 = 0;
_local7 = ((m_coreVertices[0].x * _local4) + (m_coreVertices[0].y * _local5));
_local8 = 1;
while (_local8 < m_vertexCount) {
_local9 = ((m_coreVertices[_local8].x * _local4) + (m_coreVertices[_local8].y * _local5));
if (_local9 > _local7){
_local6 = _local8;
_local7 = _local9;
};
_local8++;
};
_arg3.Set((m_position.x + ((m_R.col1.x * m_coreVertices[_local6].x) + (m_R.col2.x * m_coreVertices[_local6].y))), (m_position.y + ((m_R.col1.y * m_coreVertices[_local6].x) + (m_R.col2.y * m_coreVertices[_local6].y))));
}
override public function Synchronize(_arg1:b2Vec2, _arg2:b2Mat22, _arg3:b2Vec2, _arg4:b2Mat22):void{
var _local5:Number;
var _local6:Number;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:Number;
var _local12:Number;
var _local13:b2BroadPhase;
m_R.SetM(_arg4);
m_position.x = (m_body.m_position.x + ((_arg4.col1.x * m_localCentroid.x) + (_arg4.col2.x * m_localCentroid.y)));
m_position.y = (m_body.m_position.y + ((_arg4.col1.y * m_localCentroid.x) + (_arg4.col2.y * m_localCentroid.y)));
if (m_proxyId == b2Pair.b2_nullProxy){
return;
};
_local7 = _arg2.col1;
_local8 = _arg2.col2;
_local9 = m_localOBB.R.col1;
_local10 = m_localOBB.R.col2;
syncMat.col1.x = ((_local7.x * _local9.x) + (_local8.x * _local9.y));
syncMat.col1.y = ((_local7.y * _local9.x) + (_local8.y * _local9.y));
syncMat.col2.x = ((_local7.x * _local10.x) + (_local8.x * _local10.y));
syncMat.col2.y = ((_local7.y * _local10.x) + (_local8.y * _local10.y));
syncMat.Abs();
_local5 = (m_localCentroid.x + m_localOBB.center.x);
_local6 = (m_localCentroid.y + m_localOBB.center.y);
_local11 = (_arg1.x + ((_arg2.col1.x * _local5) + (_arg2.col2.x * _local6)));
_local12 = (_arg1.y + ((_arg2.col1.y * _local5) + (_arg2.col2.y * _local6)));
_local5 = ((syncMat.col1.x * m_localOBB.extents.x) + (syncMat.col2.x * m_localOBB.extents.y));
_local6 = ((syncMat.col1.y * m_localOBB.extents.x) + (syncMat.col2.y * m_localOBB.extents.y));
syncAABB.minVertex.x = (_local11 - _local5);
syncAABB.minVertex.y = (_local12 - _local6);
syncAABB.maxVertex.x = (_local11 + _local5);
syncAABB.maxVertex.y = (_local12 + _local6);
_local7 = _arg4.col1;
_local8 = _arg4.col2;
_local9 = m_localOBB.R.col1;
_local10 = m_localOBB.R.col2;
syncMat.col1.x = ((_local7.x * _local9.x) + (_local8.x * _local9.y));
syncMat.col1.y = ((_local7.y * _local9.x) + (_local8.y * _local9.y));
syncMat.col2.x = ((_local7.x * _local10.x) + (_local8.x * _local10.y));
syncMat.col2.y = ((_local7.y * _local10.x) + (_local8.y * _local10.y));
syncMat.Abs();
_local5 = (m_localCentroid.x + m_localOBB.center.x);
_local6 = (m_localCentroid.y + m_localOBB.center.y);
_local11 = (_arg3.x + ((_arg4.col1.x * _local5) + (_arg4.col2.x * _local6)));
_local12 = (_arg3.y + ((_arg4.col1.y * _local5) + (_arg4.col2.y * _local6)));
_local5 = ((syncMat.col1.x * m_localOBB.extents.x) + (syncMat.col2.x * m_localOBB.extents.y));
_local6 = ((syncMat.col1.y * m_localOBB.extents.x) + (syncMat.col2.y * m_localOBB.extents.y));
syncAABB.minVertex.x = Math.min(syncAABB.minVertex.x, (_local11 - _local5));
syncAABB.minVertex.y = Math.min(syncAABB.minVertex.y, (_local12 - _local6));
syncAABB.maxVertex.x = Math.max(syncAABB.maxVertex.x, (_local11 + _local5));
syncAABB.maxVertex.y = Math.max(syncAABB.maxVertex.y, (_local12 + _local6));
_local13 = m_body.m_world.m_broadPhase;
if (_local13.InRange(syncAABB)){
_local13.MoveProxy(m_proxyId, syncAABB);
} else {
m_body.Freeze();
};
}
override public function TestPoint(_arg1:b2Vec2):Boolean{
var _local2:b2Vec2;
var _local3:int;
var _local4:b2Vec2;
var _local5:Number;
_local2 = new b2Vec2();
_local2.SetV(_arg1);
_local2.Subtract(m_position);
_local2.MulTM(m_R);
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = new b2Vec2();
_local4.SetV(_local2);
_local4.Subtract(m_vertices[_local3]);
_local5 = b2Math.b2Dot(m_normals[_local3], _local4);
if (_local5 > 0){
return (false);
};
_local3++;
};
return (true);
}
override public function ResetProxy(_arg1:b2BroadPhase):void{
var _local2:b2Proxy;
var _local3:b2Mat22;
var _local4:b2Mat22;
var _local5:b2Vec2;
var _local6:b2Vec2;
var _local7:b2AABB;
if (m_proxyId == b2Pair.b2_nullProxy){
return;
};
_local2 = _arg1.GetProxy(m_proxyId);
_arg1.DestroyProxy(m_proxyId);
_local2 = null;
_local3 = b2Math.b2MulMM(m_R, m_localOBB.R);
_local4 = b2Math.b2AbsM(_local3);
_local5 = b2Math.b2MulMV(_local4, m_localOBB.extents);
_local6 = b2Math.b2MulMV(m_R, m_localOBB.center);
_local6.Add(m_position);
_local7 = new b2AABB();
_local7.minVertex.SetV(_local6);
_local7.minVertex.Subtract(_local5);
_local7.maxVertex.SetV(_local6);
_local7.maxVertex.Add(_local5);
if (_arg1.InRange(_local7)){
m_proxyId = _arg1.CreateProxy(_local7, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
if (m_proxyId == b2Pair.b2_nullProxy){
m_body.Freeze();
};
}
}
}//package Box2D.Collision.Shapes
Section 7
//b2Shape (Box2D.Collision.Shapes.b2Shape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2Shape {
public var m_body:b2Body;
public var m_maxRadius:Number;
public var m_next:b2Shape;
public var m_R:b2Mat22;
public var m_type:int;
public var m_friction:Number;
public var m_proxyId:uint;
public var m_maskBits:uint;
public var m_groupIndex:int;
public var m_userData;// = null
public var m_restitution:Number;
public var m_position:b2Vec2;
public var m_categoryBits:uint;
public static const e_boxShape:int = 1;
public static const e_unknownShape:int = -1;
public static const e_shapeTypeCount:int = 4;
public static const e_circleShape:int = 0;
public static const e_meshShape:int = 3;
public static const e_polyShape:int = 2;
public function b2Shape(_arg1:b2ShapeDef, _arg2:b2Body){
m_R = new b2Mat22();
m_position = new b2Vec2();
m_userData = null;
super();
m_userData = _arg1.userData;
m_friction = _arg1.friction;
m_restitution = _arg1.restitution;
m_body = _arg2;
m_proxyId = b2Pair.b2_nullProxy;
m_maxRadius = 0;
m_categoryBits = _arg1.categoryBits;
m_maskBits = _arg1.maskBits;
m_groupIndex = _arg1.groupIndex;
}
public function GetMaxRadius():Number{
return (m_maxRadius);
}
public function GetPosition():b2Vec2{
return (m_position);
}
public function QuickSync(_arg1:b2Vec2, _arg2:b2Mat22):void{
}
public function GetNext():b2Shape{
return (m_next);
}
public function GetType():int{
return (m_type);
}
public function GetUserData(){
return (m_userData);
}
public function Support(_arg1:Number, _arg2:Number, _arg3:b2Vec2):void{
}
public function Synchronize(_arg1:b2Vec2, _arg2:b2Mat22, _arg3:b2Vec2, _arg4:b2Mat22):void{
}
public function DestroyProxy():void{
if (m_proxyId != b2Pair.b2_nullProxy){
m_body.m_world.m_broadPhase.DestroyProxy(m_proxyId);
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function GetRotationMatrix():b2Mat22{
return (m_R);
}
public function GetBody():b2Body{
return (m_body);
}
public function TestPoint(_arg1:b2Vec2):Boolean{
return (false);
}
public function ResetProxy(_arg1:b2BroadPhase):void{
}
public static function Destroy(_arg1:b2Shape):void{
if (_arg1.m_proxyId != b2Pair.b2_nullProxy){
_arg1.m_body.m_world.m_broadPhase.DestroyProxy(_arg1.m_proxyId);
};
}
public static function PolyMass(_arg1:b2MassData, _arg2:Array, _arg3:int, _arg4:Number):void{
var _local5:b2Vec2;
var _local6:Number;
var _local7:Number;
var _local8:b2Vec2;
var _local9:Number;
var _local10:int;
var _local11:b2Vec2;
var _local12:b2Vec2;
var _local13:b2Vec2;
var _local14:b2Vec2;
var _local15:b2Vec2;
var _local16:Number;
var _local17:Number;
var _local18:b2Vec2;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
_local5 = new b2Vec2();
_local5.SetZero();
_local6 = 0;
_local7 = 0;
_local8 = new b2Vec2(0, 0);
_local9 = (1 / 3);
_local10 = 0;
while (_local10 < _arg3) {
_local11 = _local8;
_local12 = _arg2[_local10];
_local13 = (((_local10 + 1) < _arg3)) ? _arg2[(_local10 + 1)] : _arg2[0];
_local14 = b2Math.SubtractVV(_local12, _local11);
_local15 = b2Math.SubtractVV(_local13, _local11);
_local16 = b2Math.b2CrossVV(_local14, _local15);
_local17 = (0.5 * _local16);
_local6 = (_local6 + _local17);
_local18 = new b2Vec2();
_local18.SetV(_local11);
_local18.Add(_local12);
_local18.Add(_local13);
_local18.Multiply((_local9 * _local17));
_local5.Add(_local18);
_local19 = _local11.x;
_local20 = _local11.y;
_local21 = _local14.x;
_local22 = _local14.y;
_local23 = _local15.x;
_local24 = _local15.y;
_local25 = ((_local9 * ((0.25 * (((_local21 * _local21) + (_local23 * _local21)) + (_local23 * _local23))) + ((_local19 * _local21) + (_local19 * _local23)))) + ((0.5 * _local19) * _local19));
_local26 = ((_local9 * ((0.25 * (((_local22 * _local22) + (_local24 * _local22)) + (_local24 * _local24))) + ((_local20 * _local22) + (_local20 * _local24)))) + ((0.5 * _local20) * _local20));
_local7 = (_local7 + (_local16 * (_local25 + _local26)));
_local10++;
};
_arg1.mass = (_arg4 * _local6);
_local5.Multiply((1 / _local6));
_arg1.center = _local5;
_local7 = (_arg4 * (_local7 - (_local6 * b2Math.b2Dot(_local5, _local5))));
_arg1.I = _local7;
}
public static function PolyCentroid(_arg1:Array, _arg2:int, _arg3:b2Vec2):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:int;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = 0;
_local8 = 0;
_local9 = (1 / 3);
_local10 = 0;
while (_local10 < _arg2) {
_local11 = _local7;
_local12 = _local8;
_local13 = _arg1[_local10].x;
_local14 = _arg1[_local10].y;
_local15 = (((_local10 + 1) < _arg2)) ? _arg1[(_local10 + 1)].x : _arg1[0].x;
_local16 = (((_local10 + 1) < _arg2)) ? _arg1[(_local10 + 1)].y : _arg1[0].y;
_local17 = (_local13 - _local11);
_local18 = (_local14 - _local12);
_local19 = (_local15 - _local11);
_local20 = (_local16 - _local12);
_local21 = ((_local17 * _local20) - (_local18 * _local19));
_local22 = (0.5 * _local21);
_local6 = (_local6 + _local22);
_local4 = (_local4 + ((_local22 * _local9) * ((_local11 + _local13) + _local15)));
_local5 = (_local5 + ((_local22 * _local9) * ((_local12 + _local14) + _local16)));
_local10++;
};
_local4 = (_local4 * (1 / _local6));
_local5 = (_local5 * (1 / _local6));
_arg3.Set(_local4, _local5);
}
public static function Create(_arg1:b2ShapeDef, _arg2:b2Body, _arg3:b2Vec2):b2Shape{
switch (_arg1.type){
case e_circleShape:
return (new b2CircleShape(_arg1, _arg2, _arg3));
case e_boxShape:
case e_polyShape:
return (new b2PolyShape(_arg1, _arg2, _arg3));
};
return (null);
}
}
}//package Box2D.Collision.Shapes
Section 8
//b2ShapeDef (Box2D.Collision.Shapes.b2ShapeDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2ShapeDef {
public var groupIndex:int;
public var categoryBits:int;
public var localRotation:Number;
public var restitution:Number;
public var userData;// = null
public var density:Number;
public var maskBits:int;
public var type:int;
public var localPosition:b2Vec2;
public var friction:Number;
public function b2ShapeDef(){
userData = null;
super();
type = b2Shape.e_unknownShape;
userData = null;
localPosition = new b2Vec2(0, 0);
localRotation = 0;
friction = 0.2;
restitution = 0;
density = 0;
categoryBits = 1;
maskBits = 0xFFFF;
groupIndex = 0;
}
public function ComputeMass(_arg1:b2MassData):void{
var _local2:b2CircleDef;
var _local3:b2BoxDef;
var _local4:b2PolyDef;
_arg1.center = new b2Vec2(0, 0);
if (density == 0){
_arg1.mass = 0;
_arg1.center.Set(0, 0);
_arg1.I = 0;
};
switch (type){
case b2Shape.e_circleShape:
_local2 = (this as b2CircleDef);
_arg1.mass = (((density * b2Settings.b2_pi) * _local2.radius) * _local2.radius);
_arg1.center.Set(0, 0);
_arg1.I = (((0.5 * _arg1.mass) * _local2.radius) * _local2.radius);
break;
case b2Shape.e_boxShape:
_local3 = (this as b2BoxDef);
_arg1.mass = (((4 * density) * _local3.extents.x) * _local3.extents.y);
_arg1.center.Set(0, 0);
_arg1.I = ((_arg1.mass / 3) * b2Math.b2Dot(_local3.extents, _local3.extents));
break;
case b2Shape.e_polyShape:
_local4 = (this as b2PolyDef);
b2Shape.PolyMass(_arg1, _local4.vertices, _local4.vertexCount, density);
break;
default:
_arg1.mass = 0;
_arg1.center.Set(0, 0);
_arg1.I = 0;
break;
};
}
}
}//package Box2D.Collision.Shapes
Section 9
//b2AABB (Box2D.Collision.b2AABB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2AABB {
public var minVertex:b2Vec2;
public var maxVertex:b2Vec2;
public function b2AABB(){
minVertex = new b2Vec2();
maxVertex = new b2Vec2();
super();
}
public function IsValid():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:Boolean;
_local1 = maxVertex.x;
_local2 = maxVertex.y;
_local1 = maxVertex.x;
_local2 = maxVertex.y;
_local1 = (_local1 - minVertex.x);
_local2 = (_local2 - minVertex.y);
_local3 = (((_local1 >= 0)) && ((_local2 >= 0)));
_local3 = ((((_local3) && (minVertex.IsValid()))) && (maxVertex.IsValid()));
return (_local3);
}
}
}//package Box2D.Collision
Section 10
//b2Bound (Box2D.Collision.b2Bound)
package Box2D.Collision {
public class b2Bound {
public var proxyId:uint;
public var stabbingCount:uint;
public var value:uint;
public function Swap(_arg1:b2Bound):void{
var _local2:uint;
var _local3:uint;
var _local4:uint;
_local2 = value;
_local3 = proxyId;
_local4 = stabbingCount;
value = _arg1.value;
proxyId = _arg1.proxyId;
stabbingCount = _arg1.stabbingCount;
_arg1.value = _local2;
_arg1.proxyId = _local3;
_arg1.stabbingCount = _local4;
}
public function IsLower():Boolean{
return (((value & 1) == 0));
}
public function IsUpper():Boolean{
return (((value & 1) == 1));
}
}
}//package Box2D.Collision
Section 11
//b2BoundValues (Box2D.Collision.b2BoundValues)
package Box2D.Collision {
public class b2BoundValues {
public var lowerValues:Array;
public var upperValues:Array;
public function b2BoundValues(){
lowerValues = [0, 0];
upperValues = [0, 0];
super();
}
}
}//package Box2D.Collision
Section 12
//b2BroadPhase (Box2D.Collision.b2BroadPhase)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2BroadPhase {
public var m_quantizationFactor:b2Vec2;
public var m_worldAABB:b2AABB;
public var m_bounds:Array;
public var m_freeProxy:uint;
public var m_proxyCount:int;
public var m_proxyPool:Array;
public var m_queryResultCount:int;
public var m_pairManager:b2PairManager;
public var m_timeStamp:uint;
public var m_queryResults:Array;
public static const b2_nullEdge:uint = b2Settings.USHRT_MAX;
public static const b2_invalid:uint = b2Settings.USHRT_MAX;
public static var s_validate:Boolean = false;
public function b2BroadPhase(_arg1:b2AABB, _arg2:b2PairCallback){
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:b2Proxy;
var _local7:int;
m_pairManager = new b2PairManager();
m_proxyPool = new Array(b2Settings.b2_maxPairs);
m_bounds = new Array((2 * b2Settings.b2_maxProxies));
m_queryResults = new Array(b2Settings.b2_maxProxies);
m_quantizationFactor = new b2Vec2();
super();
m_pairManager.Initialize(this, _arg2);
m_worldAABB = _arg1;
m_proxyCount = 0;
_local3 = 0;
while (_local3 < b2Settings.b2_maxProxies) {
m_queryResults[_local3] = 0;
_local3++;
};
m_bounds = new Array(2);
_local3 = 0;
while (_local3 < 2) {
m_bounds[_local3] = new Array((2 * b2Settings.b2_maxProxies));
_local7 = 0;
while (_local7 < (2 * b2Settings.b2_maxProxies)) {
m_bounds[_local3][_local7] = new b2Bound();
_local7++;
};
_local3++;
};
_local4 = _arg1.maxVertex.x;
_local5 = _arg1.maxVertex.y;
_local4 = (_local4 - _arg1.minVertex.x);
_local5 = (_local5 - _arg1.minVertex.y);
m_quantizationFactor.x = (b2Settings.USHRT_MAX / _local4);
m_quantizationFactor.y = (b2Settings.USHRT_MAX / _local5);
_local3 = 0;
while (_local3 < (b2Settings.b2_maxProxies - 1)) {
_local6 = new b2Proxy();
m_proxyPool[_local3] = _local6;
_local6.SetNext((_local3 + 1));
_local6.timeStamp = 0;
_local6.overlapCount = b2_invalid;
_local6.userData = null;
_local3++;
};
_local6 = new b2Proxy();
m_proxyPool[(b2Settings.b2_maxProxies - 1)] = _local6;
_local6.SetNext(b2Pair.b2_nullProxy);
_local6.timeStamp = 0;
_local6.overlapCount = b2_invalid;
_local6.userData = null;
m_freeProxy = 0;
m_timeStamp = 1;
m_queryResultCount = 0;
}
public function QueryAABB(_arg1:b2AABB, _arg2, _arg3:int):int{
var _local4:Array;
var _local5:Array;
var _local6:uint;
var _local7:uint;
var _local8:Array;
var _local9:Array;
var _local10:int;
var _local11:int;
var _local12:b2Proxy;
_local4 = new Array();
_local5 = new Array();
ComputeBounds(_local4, _local5, _arg1);
_local8 = [_local6];
_local9 = [_local7];
Query(_local8, _local9, _local4[0], _local5[0], m_bounds[0], (2 * m_proxyCount), 0);
Query(_local8, _local9, _local4[1], _local5[1], m_bounds[1], (2 * m_proxyCount), 1);
_local10 = 0;
_local11 = 0;
while ((((_local11 < m_queryResultCount)) && ((_local10 < _arg3)))) {
_local12 = m_proxyPool[m_queryResults[_local11]];
_arg2[_local11] = _local12.userData;
_local11++;
_local10++;
};
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local10);
}
public function Commit():void{
m_pairManager.Commit();
}
public function GetProxy(_arg1:int):b2Proxy{
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((m_proxyPool[_arg1].IsValid() == false)))){
return (null);
};
return (m_proxyPool[_arg1]);
}
private function IncrementTimeStamp():void{
var _local1:uint;
if (m_timeStamp == b2Settings.USHRT_MAX){
_local1 = 0;
while (_local1 < b2Settings.b2_maxProxies) {
m_proxyPool[_local1].timeStamp = 0;
_local1++;
};
m_timeStamp = 1;
} else {
m_timeStamp++;
};
}
private function Query(_arg1:Array, _arg2:Array, _arg3:uint, _arg4:uint, _arg5:Array, _arg6:uint, _arg7:int):void{
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:int;
var _local12:int;
var _local13:b2Proxy;
_local8 = BinarySearch(_arg5, _arg6, _arg3);
_local9 = BinarySearch(_arg5, _arg6, _arg4);
_local10 = _local8;
while (_local10 < _local9) {
if (_arg5[_local10].IsLower()){
IncrementOverlapCount(_arg5[_local10].proxyId);
};
_local10++;
};
if (_local8 > 0){
_local11 = (_local8 - 1);
_local12 = _arg5[_local11].stabbingCount;
while (_local12) {
if (_arg5[_local11].IsLower()){
_local13 = m_proxyPool[_arg5[_local11].proxyId];
if (_local8 <= _local13.upperBounds[_arg7]){
IncrementOverlapCount(_arg5[_local11].proxyId);
_local12--;
};
};
_local11--;
};
};
_arg1[0] = _local8;
_arg2[0] = _local9;
}
private function TestOverlapValidate(_arg1:b2Proxy, _arg2:b2Proxy):Boolean{
var _local3:int;
var _local4:Array;
_local3 = 0;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
if (_local4[_arg1.lowerBounds[_local3]].value > _local4[_arg2.upperBounds[_local3]].value){
return (false);
};
if (_local4[_arg1.upperBounds[_local3]].value < _local4[_arg2.lowerBounds[_local3]].value){
return (false);
};
_local3++;
};
return (true);
}
private function ComputeBounds(_arg1:Array, _arg2:Array, _arg3:b2AABB):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local4 = _arg3.minVertex.x;
_local5 = _arg3.minVertex.y;
_local4 = b2Math.b2Min(_local4, m_worldAABB.maxVertex.x);
_local5 = b2Math.b2Min(_local5, m_worldAABB.maxVertex.y);
_local4 = b2Math.b2Max(_local4, m_worldAABB.minVertex.x);
_local5 = b2Math.b2Max(_local5, m_worldAABB.minVertex.y);
_local6 = _arg3.maxVertex.x;
_local7 = _arg3.maxVertex.y;
_local6 = b2Math.b2Min(_local6, m_worldAABB.maxVertex.x);
_local7 = b2Math.b2Min(_local7, m_worldAABB.maxVertex.y);
_local6 = b2Math.b2Max(_local6, m_worldAABB.minVertex.x);
_local7 = b2Math.b2Max(_local7, m_worldAABB.minVertex.y);
_arg1[0] = (uint((m_quantizationFactor.x * (_local4 - m_worldAABB.minVertex.x))) & (b2Settings.USHRT_MAX - 1));
_arg2[0] = ((uint((m_quantizationFactor.x * (_local6 - m_worldAABB.minVertex.x))) & 0xFFFF) | 1);
_arg1[1] = (uint((m_quantizationFactor.y * (_local5 - m_worldAABB.minVertex.y))) & (b2Settings.USHRT_MAX - 1));
_arg2[1] = ((uint((m_quantizationFactor.y * (_local7 - m_worldAABB.minVertex.y))) & 0xFFFF) | 1);
}
public function CreateProxy(_arg1:b2AABB, _arg2):uint{
var _local3:uint;
var _local4:b2Proxy;
var _local5:uint;
var _local6:uint;
var _local7:Array;
var _local8:Array;
var _local9:int;
var _local10:int;
var _local11:Array;
var _local12:uint;
var _local13:uint;
var _local14:Array;
var _local15:Array;
var _local16:Array;
var _local17:int;
var _local18:int;
var _local19:b2Bound;
var _local20:b2Bound;
var _local21:int;
var _local22:b2Proxy;
_local5 = m_freeProxy;
_local4 = m_proxyPool[_local5];
m_freeProxy = _local4.GetNext();
_local4.overlapCount = 0;
_local4.userData = _arg2;
_local6 = (2 * m_proxyCount);
_local7 = new Array();
_local8 = new Array();
ComputeBounds(_local7, _local8, _arg1);
_local9 = 0;
while (_local9 < 2) {
_local11 = m_bounds[_local9];
_local14 = [_local12];
_local15 = [_local13];
Query(_local14, _local15, _local7[_local9], _local8[_local9], _local11, _local6, _local9);
_local12 = _local14[0];
_local13 = _local15[0];
_local16 = new Array();
_local18 = (_local6 - _local13);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[(_local13 + _local17)];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local21 = (_local13 + 2);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[(_local21 + _local17)];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local16 = new Array();
_local18 = (_local13 - _local12);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[(_local12 + _local17)];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local21 = (_local12 + 1);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[(_local21 + _local17)];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local13++;
_local11[_local12].value = _local7[_local9];
_local11[_local12].proxyId = _local5;
_local11[_local13].value = _local8[_local9];
_local11[_local13].proxyId = _local5;
_local11[_local12].stabbingCount = ((_local12 == 0)) ? 0 : _local11[(_local12 - 1)].stabbingCount;
_local11[_local13].stabbingCount = _local11[(_local13 - 1)].stabbingCount;
_local3 = _local12;
while (_local3 < _local13) {
_local11[_local3].stabbingCount++;
_local3++;
};
_local3 = _local12;
while (_local3 < (_local6 + 2)) {
_local22 = m_proxyPool[_local11[_local3].proxyId];
if (_local11[_local3].IsLower()){
_local22.lowerBounds[_local9] = _local3;
} else {
_local22.upperBounds[_local9] = _local3;
};
_local3++;
};
_local9++;
};
m_proxyCount++;
_local10 = 0;
while (_local10 < m_queryResultCount) {
m_pairManager.AddBufferedPair(_local5, m_queryResults[_local10]);
_local10++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local5);
}
public function DestroyProxy(_arg1:uint):void{
var _local2:b2Proxy;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:Array;
var _local12:int;
var _local13:int;
var _local14:b2Bound;
var _local15:b2Bound;
var _local16:int;
var _local17:uint;
var _local18:int;
var _local19:b2Proxy;
_local2 = m_proxyPool[_arg1];
_local3 = (2 * m_proxyCount);
_local4 = 0;
while (_local4 < 2) {
_local6 = m_bounds[_local4];
_local7 = _local2.lowerBounds[_local4];
_local8 = _local2.upperBounds[_local4];
_local9 = _local6[_local7].value;
_local10 = _local6[_local8].value;
_local11 = new Array();
_local13 = ((_local8 - _local7) - 1);
_local12 = 0;
while (_local12 < _local13) {
_local11[_local12] = new b2Bound();
_local14 = _local11[_local12];
_local15 = _local6[((_local7 + 1) + _local12)];
_local14.value = _local15.value;
_local14.proxyId = _local15.proxyId;
_local14.stabbingCount = _local15.stabbingCount;
_local12++;
};
_local13 = _local11.length;
_local16 = _local7;
_local12 = 0;
while (_local12 < _local13) {
_local15 = _local11[_local12];
_local14 = _local6[(_local16 + _local12)];
_local14.value = _local15.value;
_local14.proxyId = _local15.proxyId;
_local14.stabbingCount = _local15.stabbingCount;
_local12++;
};
_local11 = new Array();
_local13 = ((_local3 - _local8) - 1);
_local12 = 0;
while (_local12 < _local13) {
_local11[_local12] = new b2Bound();
_local14 = _local11[_local12];
_local15 = _local6[((_local8 + 1) + _local12)];
_local14.value = _local15.value;
_local14.proxyId = _local15.proxyId;
_local14.stabbingCount = _local15.stabbingCount;
_local12++;
};
_local13 = _local11.length;
_local16 = (_local8 - 1);
_local12 = 0;
while (_local12 < _local13) {
_local15 = _local11[_local12];
_local14 = _local6[(_local16 + _local12)];
_local14.value = _local15.value;
_local14.proxyId = _local15.proxyId;
_local14.stabbingCount = _local15.stabbingCount;
_local12++;
};
_local13 = (_local3 - 2);
_local17 = _local7;
while (_local17 < _local13) {
_local19 = m_proxyPool[_local6[_local17].proxyId];
if (_local6[_local17].IsLower()){
_local19.lowerBounds[_local4] = _local17;
} else {
_local19.upperBounds[_local4] = _local17;
};
_local17++;
};
_local13 = (_local8 - 1);
_local18 = _local7;
while (_local18 < _local13) {
_local6[_local18].stabbingCount--;
_local18++;
};
Query([0], [0], _local9, _local10, _local6, (_local3 - 2), _local4);
_local4++;
};
_local5 = 0;
while (_local5 < m_queryResultCount) {
m_pairManager.RemoveBufferedPair(_arg1, m_queryResults[_local5]);
_local5++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
_local2.userData = null;
_local2.overlapCount = b2_invalid;
_local2.lowerBounds[0] = b2_invalid;
_local2.lowerBounds[1] = b2_invalid;
_local2.upperBounds[0] = b2_invalid;
_local2.upperBounds[1] = b2_invalid;
_local2.SetNext(m_freeProxy);
m_freeProxy = _arg1;
m_proxyCount--;
}
public function TestOverlap(_arg1:b2BoundValues, _arg2:b2Proxy):Boolean{
var _local3:int;
var _local4:Array;
_local3 = 0;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
if (_arg1.lowerValues[_local3] > _local4[_arg2.upperBounds[_local3]].value){
return (false);
};
if (_arg1.upperValues[_local3] < _local4[_arg2.lowerBounds[_local3]].value){
return (false);
};
_local3++;
};
return (true);
}
public function Validate():void{
var _local1:b2Pair;
var _local2:b2Proxy;
var _local3:b2Proxy;
var _local4:Boolean;
var _local5:int;
var _local6:b2Bound;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:b2Bound;
_local5 = 0;
while (_local5 < 2) {
_local6 = m_bounds[_local5];
_local7 = (2 * m_proxyCount);
_local8 = 0;
_local9 = 0;
while (_local9 < _local7) {
_local10 = _local6[_local9];
if (_local10.IsLower() == true){
_local8++;
} else {
_local8--;
};
_local9++;
};
_local5++;
};
}
private function IncrementOverlapCount(_arg1:uint):void{
var _local2:b2Proxy;
_local2 = m_proxyPool[_arg1];
if (_local2.timeStamp < m_timeStamp){
_local2.timeStamp = m_timeStamp;
_local2.overlapCount = 1;
} else {
_local2.overlapCount = 2;
m_queryResults[m_queryResultCount] = _arg1;
m_queryResultCount++;
};
}
public function InRange(_arg1:b2AABB):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = _arg1.minVertex.x;
_local3 = _arg1.minVertex.y;
_local2 = (_local2 - m_worldAABB.maxVertex.x);
_local3 = (_local3 - m_worldAABB.maxVertex.y);
_local4 = m_worldAABB.minVertex.x;
_local5 = m_worldAABB.minVertex.y;
_local4 = (_local4 - _arg1.maxVertex.x);
_local5 = (_local5 - _arg1.maxVertex.y);
_local2 = b2Math.b2Max(_local2, _local4);
_local3 = b2Math.b2Max(_local3, _local5);
return ((b2Math.b2Max(_local2, _local3) < 0));
}
public function MoveProxy(_arg1:uint, _arg2:b2AABB):void{
var _local3:uint;
var _local4:uint;
var _local5:b2Bound;
var _local6:b2Bound;
var _local7:b2Bound;
var _local8:uint;
var _local9:b2Proxy;
var _local10:uint;
var _local11:b2Proxy;
var _local12:b2BoundValues;
var _local13:b2BoundValues;
var _local14:Array;
var _local15:uint;
var _local16:uint;
var _local17:uint;
var _local18:uint;
var _local19:int;
var _local20:int;
var _local21:uint;
var _local22:b2Proxy;
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((b2Settings.b2_maxProxies <= _arg1)))){
return;
};
if (_arg2.IsValid() == false){
return;
};
_local10 = (2 * m_proxyCount);
_local11 = m_proxyPool[_arg1];
_local12 = new b2BoundValues();
ComputeBounds(_local12.lowerValues, _local12.upperValues, _arg2);
_local13 = new b2BoundValues();
_local3 = 0;
while (_local3 < 2) {
_local13.lowerValues[_local3] = m_bounds[_local3][_local11.lowerBounds[_local3]].value;
_local13.upperValues[_local3] = m_bounds[_local3][_local11.upperBounds[_local3]].value;
_local3++;
};
_local3 = 0;
while (_local3 < 2) {
_local14 = m_bounds[_local3];
_local15 = _local11.lowerBounds[_local3];
_local16 = _local11.upperBounds[_local3];
_local17 = _local12.lowerValues[_local3];
_local18 = _local12.upperValues[_local3];
_local19 = (_local17 - _local14[_local15].value);
_local20 = (_local18 - _local14[_local16].value);
_local14[_local15].value = _local17;
_local14[_local16].value = _local18;
if (_local19 < 0){
_local4 = _local15;
while ((((_local4 > 0)) && ((_local17 < _local14[(_local4 - 1)].value)))) {
_local5 = _local14[_local4];
_local6 = _local14[(_local4 - 1)];
_local21 = _local6.proxyId;
_local22 = m_proxyPool[_local6.proxyId];
_local6.stabbingCount++;
if (_local6.IsUpper() == true){
if (TestOverlap(_local12, _local22)){
m_pairManager.AddBufferedPair(_arg1, _local21);
};
var _local23 = _local22.upperBounds;
var _local24 = _local3;
var _local25 = (_local23[_local24] + 1);
_local23[_local24] = _local25;
_local5.stabbingCount++;
} else {
_local23 = _local22.lowerBounds;
_local24 = _local3;
_local25 = (_local23[_local24] + 1);
_local23[_local24] = _local25;
_local5.stabbingCount--;
};
_local23 = _local11.lowerBounds;
_local24 = _local3;
_local25 = (_local23[_local24] - 1);
_local23[_local24] = _local25;
_local5.Swap(_local6);
_local4--;
};
};
if (_local20 > 0){
_local4 = _local16;
while ((((_local4 < (_local10 - 1))) && ((_local14[(_local4 + 1)].value <= _local18)))) {
_local5 = _local14[_local4];
_local7 = _local14[(_local4 + 1)];
_local8 = _local7.proxyId;
_local9 = m_proxyPool[_local8];
_local7.stabbingCount++;
if (_local7.IsLower() == true){
if (TestOverlap(_local12, _local9)){
m_pairManager.AddBufferedPair(_arg1, _local8);
};
_local23 = _local9.lowerBounds;
_local24 = _local3;
_local25 = (_local23[_local24] - 1);
_local23[_local24] = _local25;
_local5.stabbingCount++;
} else {
_local23 = _local9.upperBounds;
_local24 = _local3;
_local25 = (_local23[_local24] - 1);
_local23[_local24] = _local25;
_local5.stabbingCount--;
};
_local23 = _local11.upperBounds;
_local24 = _local3;
_local25 = (_local23[_local24] + 1);
_local23[_local24] = _local25;
_local5.Swap(_local7);
_local4++;
};
};
if (_local19 > 0){
_local4 = _local15;
while ((((_local4 < (_local10 - 1))) && ((_local14[(_local4 + 1)].value <= _local17)))) {
_local5 = _local14[_local4];
_local7 = _local14[(_local4 + 1)];
_local8 = _local7.proxyId;
_local9 = m_proxyPool[_local8];
_local7.stabbingCount--;
if (_local7.IsUpper()){
if (TestOverlap(_local13, _local9)){
m_pairManager.RemoveBufferedPair(_arg1, _local8);
};
_local23 = _local9.upperBounds;
_local24 = _local3;
_local25 = (_local23[_local24] - 1);
_local23[_local24] = _local25;
_local5.stabbingCount--;
} else {
_local23 = _local9.lowerBounds;
_local24 = _local3;
_local25 = (_local23[_local24] - 1);
_local23[_local24] = _local25;
_local5.stabbingCount++;
};
_local23 = _local11.lowerBounds;
_local24 = _local3;
_local25 = (_local23[_local24] + 1);
_local23[_local24] = _local25;
_local5.Swap(_local7);
_local4++;
};
};
if (_local20 < 0){
_local4 = _local16;
while ((((_local4 > 0)) && ((_local18 < _local14[(_local4 - 1)].value)))) {
_local5 = _local14[_local4];
_local6 = _local14[(_local4 - 1)];
_local21 = _local6.proxyId;
_local22 = m_proxyPool[_local21];
_local6.stabbingCount--;
if (_local6.IsLower() == true){
if (TestOverlap(_local13, _local22)){
m_pairManager.RemoveBufferedPair(_arg1, _local21);
};
_local23 = _local22.lowerBounds;
_local24 = _local3;
_local25 = (_local23[_local24] + 1);
_local23[_local24] = _local25;
_local5.stabbingCount--;
} else {
_local23 = _local22.upperBounds;
_local24 = _local3;
_local25 = (_local23[_local24] + 1);
_local23[_local24] = _local25;
_local5.stabbingCount++;
};
_local23 = _local11.upperBounds;
_local24 = _local3;
_local25 = (_local23[_local24] - 1);
_local23[_local24] = _local25;
_local5.Swap(_local6);
_local4--;
};
};
_local3++;
};
}
public static function BinarySearch(_arg1:Array, _arg2:int, _arg3:uint):uint{
var _local4:int;
var _local5:int;
var _local6:int;
_local4 = 0;
_local5 = (_arg2 - 1);
while (_local4 <= _local5) {
_local6 = ((_local4 + _local5) / 2);
if (_arg1[_local6].value > _arg3){
_local5 = (_local6 - 1);
} else {
if (_arg1[_local6].value < _arg3){
_local4 = (_local6 + 1);
} else {
return (uint(_local6));
};
};
};
return (uint(_local4));
}
}
}//package Box2D.Collision
Section 13
//b2BufferedPair (Box2D.Collision.b2BufferedPair)
package Box2D.Collision {
public class b2BufferedPair {
public var proxyId1:uint;
public var proxyId2:uint;
}
}//package Box2D.Collision
Section 14
//b2Collision (Box2D.Collision.b2Collision)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2Collision {
public static const b2_nullFeature:uint = 0xFF;
private static var b2CollidePolyTempVec:b2Vec2 = new b2Vec2();
public static function EdgeSeparation(_arg1:b2PolyShape, _arg2:int, _arg3:b2PolyShape):Number{
var _local4:Array;
var _local5:int;
var _local6:Array;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:Number;
var _local12:Number;
var _local13:int;
var _local14:Number;
var _local15:int;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:b2Vec2;
var _local22:Number;
_local4 = _arg1.m_vertices;
_local5 = _arg3.m_vertexCount;
_local6 = _arg3.m_vertices;
_local7 = _arg1.m_normals[_arg2].x;
_local8 = _arg1.m_normals[_arg2].y;
_local9 = _local7;
_local10 = _arg1.m_R;
_local7 = ((_local10.col1.x * _local9) + (_local10.col2.x * _local8));
_local8 = ((_local10.col1.y * _local9) + (_local10.col2.y * _local8));
_local11 = _local7;
_local12 = _local8;
_local10 = _arg3.m_R;
_local9 = ((_local11 * _local10.col1.x) + (_local12 * _local10.col1.y));
_local12 = ((_local11 * _local10.col2.x) + (_local12 * _local10.col2.y));
_local11 = _local9;
_local13 = 0;
_local14 = Number.MAX_VALUE;
_local15 = 0;
while (_local15 < _local5) {
_local21 = _local6[_local15];
_local22 = ((_local21.x * _local11) + (_local21.y * _local12));
if (_local22 < _local14){
_local14 = _local22;
_local13 = _local15;
};
_local15++;
};
_local10 = _arg1.m_R;
_local16 = (_arg1.m_position.x + ((_local10.col1.x * _local4[_arg2].x) + (_local10.col2.x * _local4[_arg2].y)));
_local17 = (_arg1.m_position.y + ((_local10.col1.y * _local4[_arg2].x) + (_local10.col2.y * _local4[_arg2].y)));
_local10 = _arg3.m_R;
_local18 = (_arg3.m_position.x + ((_local10.col1.x * _local6[_local13].x) + (_local10.col2.x * _local6[_local13].y)));
_local19 = (_arg3.m_position.y + ((_local10.col1.y * _local6[_local13].x) + (_local10.col2.y * _local6[_local13].y)));
_local18 = (_local18 - _local16);
_local19 = (_local19 - _local17);
_local20 = ((_local18 * _local7) + (_local19 * _local8));
return (_local20);
}
public static function b2TestOverlap(_arg1:b2AABB, _arg2:b2AABB):Boolean{
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local3 = _arg2.minVertex;
_local4 = _arg1.maxVertex;
_local5 = (_local3.x - _local4.x);
_local6 = (_local3.y - _local4.y);
_local3 = _arg1.minVertex;
_local4 = _arg2.maxVertex;
_local7 = (_local3.x - _local4.x);
_local8 = (_local3.y - _local4.y);
if ((((_local5 > 0)) || ((_local6 > 0)))){
return (false);
};
if ((((_local7 > 0)) || ((_local8 > 0)))){
return (false);
};
return (true);
}
public static function FindIncidentEdge(_arg1:Array, _arg2:b2PolyShape, _arg3:int, _arg4:b2PolyShape):void{
var _local5:int;
var _local6:Array;
var _local7:int;
var _local8:Array;
var _local9:int;
var _local10:int;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:b2Mat22;
var _local19:Number;
var _local20:Number;
var _local21:int;
var _local22:int;
var _local23:Number;
var _local24:int;
var _local25:ClipVertex;
var _local26:int;
var _local27:int;
var _local28:Number;
var _local29:Number;
var _local30:Number;
_local5 = _arg2.m_vertexCount;
_local6 = _arg2.m_vertices;
_local7 = _arg4.m_vertexCount;
_local8 = _arg4.m_vertices;
_local9 = _arg3;
_local10 = (((_arg3 + 1) == _local5)) ? 0 : (_arg3 + 1);
_local11 = _local6[_local10];
_local12 = _local11.x;
_local13 = _local11.y;
_local11 = _local6[_local9];
_local12 = (_local12 - _local11.x);
_local13 = (_local13 - _local11.y);
_local14 = _local12;
_local12 = _local13;
_local13 = -(_local14);
_local15 = (1 / Math.sqrt(((_local12 * _local12) + (_local13 * _local13))));
_local12 = (_local12 * _local15);
_local13 = (_local13 * _local15);
_local16 = _local12;
_local17 = _local13;
_local14 = _local16;
_local18 = _arg2.m_R;
_local16 = ((_local18.col1.x * _local14) + (_local18.col2.x * _local17));
_local17 = ((_local18.col1.y * _local14) + (_local18.col2.y * _local17));
_local19 = _local16;
_local20 = _local17;
_local18 = _arg4.m_R;
_local14 = ((_local19 * _local18.col1.x) + (_local20 * _local18.col1.y));
_local20 = ((_local19 * _local18.col2.x) + (_local20 * _local18.col2.y));
_local19 = _local14;
_local23 = Number.MAX_VALUE;
_local24 = 0;
while (_local24 < _local7) {
_local26 = _local24;
_local27 = (((_local24 + 1) < _local7)) ? (_local24 + 1) : 0;
_local11 = _local8[_local27];
_local28 = _local11.x;
_local29 = _local11.y;
_local11 = _local8[_local26];
_local28 = (_local28 - _local11.x);
_local29 = (_local29 - _local11.y);
_local14 = _local28;
_local28 = _local29;
_local29 = -(_local14);
_local15 = (1 / Math.sqrt(((_local28 * _local28) + (_local29 * _local29))));
_local28 = (_local28 * _local15);
_local29 = (_local29 * _local15);
_local30 = ((_local28 * _local19) + (_local29 * _local20));
if (_local30 < _local23){
_local23 = _local30;
_local21 = _local26;
_local22 = _local27;
};
_local24++;
};
_local25 = _arg1[0];
_local11 = _local25.v;
_local11.SetV(_local8[_local21]);
_local11.MulM(_arg4.m_R);
_local11.Add(_arg4.m_position);
_local25.id.features.referenceFace = _arg3;
_local25.id.features.incidentEdge = _local21;
_local25.id.features.incidentVertex = _local21;
_local25 = _arg1[1];
_local11 = _local25.v;
_local11.SetV(_local8[_local22]);
_local11.MulM(_arg4.m_R);
_local11.Add(_arg4.m_position);
_local25.id.features.referenceFace = _arg3;
_local25.id.features.incidentEdge = _local21;
_local25.id.features.incidentVertex = _local22;
}
public static function b2CollidePolyAndCircle(_arg1:b2Manifold, _arg2:b2PolyShape, _arg3:b2CircleShape, _arg4:Boolean):void{
var _local5:b2ContactPoint;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:Number;
var _local12:Number;
var _local13:int;
var _local14:Number;
var _local15:Number;
var _local16:int;
var _local17:int;
var _local18:int;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:b2Vec2;
_arg1.pointCount = 0;
_local8 = (_arg3.m_position.x - _arg2.m_position.x);
_local9 = (_arg3.m_position.y - _arg2.m_position.y);
_local10 = _arg2.m_R;
_local11 = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
_local9 = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
_local8 = _local11;
_local13 = 0;
_local14 = -(Number.MAX_VALUE);
_local15 = _arg3.m_radius;
_local16 = 0;
while (_local16 < _arg2.m_vertexCount) {
_local25 = ((_arg2.m_normals[_local16].x * (_local8 - _arg2.m_vertices[_local16].x)) + (_arg2.m_normals[_local16].y * (_local9 - _arg2.m_vertices[_local16].y)));
if (_local25 > _local15){
return;
};
if (_local25 > _local14){
_local14 = _local25;
_local13 = _local16;
};
_local16++;
};
if (_local14 < Number.MIN_VALUE){
_arg1.pointCount = 1;
_local26 = _arg2.m_normals[_local13];
_arg1.normal.x = ((_local10.col1.x * _local26.x) + (_local10.col2.x * _local26.y));
_arg1.normal.y = ((_local10.col1.y * _local26.x) + (_local10.col2.y * _local26.y));
_local5 = _arg1.points[0];
_local5.id.features.incidentEdge = _local13;
_local5.id.features.incidentVertex = b2_nullFeature;
_local5.id.features.referenceFace = b2_nullFeature;
_local5.id.features.flip = 0;
_local5.position.x = (_arg3.m_position.x - (_local15 * _arg1.normal.x));
_local5.position.y = (_arg3.m_position.y - (_local15 * _arg1.normal.y));
_local5.separation = (_local14 - _local15);
return;
};
_local17 = _local13;
_local18 = (((_local17 + 1) < _arg2.m_vertexCount)) ? (_local17 + 1) : 0;
_local19 = (_arg2.m_vertices[_local18].x - _arg2.m_vertices[_local17].x);
_local20 = (_arg2.m_vertices[_local18].y - _arg2.m_vertices[_local17].y);
_local21 = Math.sqrt(((_local19 * _local19) + (_local20 * _local20)));
_local19 = (_local19 / _local21);
_local20 = (_local20 / _local21);
if (_local21 < Number.MIN_VALUE){
_local6 = (_local8 - _arg2.m_vertices[_local17].x);
_local7 = (_local9 - _arg2.m_vertices[_local17].y);
_local12 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
_local6 = (_local6 / _local12);
_local7 = (_local7 / _local12);
if (_local12 > _local15){
return;
};
_arg1.pointCount = 1;
_arg1.normal.Set(((_local10.col1.x * _local6) + (_local10.col2.x * _local7)), ((_local10.col1.y * _local6) + (_local10.col2.y * _local7)));
_local5 = _arg1.points[0];
_local5.id.features.incidentEdge = b2_nullFeature;
_local5.id.features.incidentVertex = _local17;
_local5.id.features.referenceFace = b2_nullFeature;
_local5.id.features.flip = 0;
_local5.position.x = (_arg3.m_position.x - (_local15 * _arg1.normal.x));
_local5.position.y = (_arg3.m_position.y - (_local15 * _arg1.normal.y));
_local5.separation = (_local12 - _local15);
return;
};
_local22 = (((_local8 - _arg2.m_vertices[_local17].x) * _local19) + ((_local9 - _arg2.m_vertices[_local17].y) * _local20));
_local5 = _arg1.points[0];
_local5.id.features.incidentEdge = b2_nullFeature;
_local5.id.features.incidentVertex = b2_nullFeature;
_local5.id.features.referenceFace = b2_nullFeature;
_local5.id.features.flip = 0;
if (_local22 <= 0){
_local23 = _arg2.m_vertices[_local17].x;
_local24 = _arg2.m_vertices[_local17].y;
_local5.id.features.incidentVertex = _local17;
} else {
if (_local22 >= _local21){
_local23 = _arg2.m_vertices[_local18].x;
_local24 = _arg2.m_vertices[_local18].y;
_local5.id.features.incidentVertex = _local18;
} else {
_local23 = ((_local19 * _local22) + _arg2.m_vertices[_local17].x);
_local24 = ((_local20 * _local22) + _arg2.m_vertices[_local17].y);
_local5.id.features.incidentEdge = _local17;
};
};
_local6 = (_local8 - _local23);
_local7 = (_local9 - _local24);
_local12 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
_local6 = (_local6 / _local12);
_local7 = (_local7 / _local12);
if (_local12 > _local15){
return;
};
_arg1.pointCount = 1;
_arg1.normal.Set(((_local10.col1.x * _local6) + (_local10.col2.x * _local7)), ((_local10.col1.y * _local6) + (_local10.col2.y * _local7)));
_local5.position.x = (_arg3.m_position.x - (_local15 * _arg1.normal.x));
_local5.position.y = (_arg3.m_position.y - (_local15 * _arg1.normal.y));
_local5.separation = (_local12 - _local15);
}
public static function FindMaxSeparation(_arg1:Array, _arg2:b2PolyShape, _arg3:b2PolyShape, _arg4:Boolean):Number{
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:int;
var _local11:Number;
var _local12:int;
var _local13:Number;
var _local14:int;
var _local15:Number;
var _local16:int;
var _local17:Number;
var _local18:int;
var _local19:Number;
var _local20:int;
var _local21:Number;
_local5 = _arg2.m_vertexCount;
_local6 = (_arg3.m_position.x - _arg2.m_position.x);
_local7 = (_arg3.m_position.y - _arg2.m_position.y);
_local8 = ((_local6 * _arg2.m_R.col1.x) + (_local7 * _arg2.m_R.col1.y));
_local9 = ((_local6 * _arg2.m_R.col2.x) + (_local7 * _arg2.m_R.col2.y));
_local10 = 0;
_local11 = -(Number.MAX_VALUE);
_local12 = 0;
while (_local12 < _local5) {
_local21 = ((_arg2.m_normals[_local12].x * _local8) + (_arg2.m_normals[_local12].y * _local9));
if (_local21 > _local11){
_local11 = _local21;
_local10 = _local12;
};
_local12++;
};
_local13 = EdgeSeparation(_arg2, _local10, _arg3);
if ((((_local13 > 0)) && ((_arg4 == false)))){
return (_local13);
};
_local14 = (((_local10 - 1) >= 0)) ? (_local10 - 1) : (_local5 - 1);
_local15 = EdgeSeparation(_arg2, _local14, _arg3);
if ((((_local15 > 0)) && ((_arg4 == false)))){
return (_local15);
};
_local16 = (((_local10 + 1) < _local5)) ? (_local10 + 1) : 0;
_local17 = EdgeSeparation(_arg2, _local16, _arg3);
if ((((_local17 > 0)) && ((_arg4 == false)))){
return (_local17);
};
if ((((_local15 > _local13)) && ((_local15 > _local17)))){
_local20 = -1;
_local18 = _local14;
_local19 = _local15;
} else {
if (_local17 > _local13){
_local20 = 1;
_local18 = _local16;
_local19 = _local17;
} else {
_arg1[0] = _local10;
return (_local13);
};
};
while (true) {
if (_local20 == -1){
_local10 = (((_local18 - 1) >= 0)) ? (_local18 - 1) : (_local5 - 1);
} else {
_local10 = (((_local18 + 1) < _local5)) ? (_local18 + 1) : 0;
};
_local13 = EdgeSeparation(_arg2, _local10, _arg3);
if ((((_local13 > 0)) && ((_arg4 == false)))){
return (_local13);
};
if (_local13 > _local19){
_local18 = _local10;
_local19 = _local13;
} else {
break;
};
};
_arg1[0] = _local18;
return (_local19);
}
public static function ClipSegmentToLine(_arg1:Array, _arg2:Array, _arg3:b2Vec2, _arg4:Number):int{
var _local5:int;
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:b2Vec2;
_local5 = 0;
_local6 = _arg2[0].v;
_local7 = _arg2[1].v;
_local8 = (b2Math.b2Dot(_arg3, _arg2[0].v) - _arg4);
_local9 = (b2Math.b2Dot(_arg3, _arg2[1].v) - _arg4);
if (_local8 <= 0){
var _temp1 = _local5;
_local5 = (_local5 + 1);
var _local12 = _temp1;
_arg1[_local12] = _arg2[0];
};
if (_local9 <= 0){
var _temp2 = _local5;
_local5 = (_local5 + 1);
_local12 = _temp2;
_arg1[_local12] = _arg2[1];
};
if ((_local8 * _local9) < 0){
_local10 = (_local8 / (_local8 - _local9));
_local11 = _arg1[_local5].v;
_local11.x = (_local6.x + (_local10 * (_local7.x - _local6.x)));
_local11.y = (_local6.y + (_local10 * (_local7.y - _local6.y)));
if (_local8 > 0){
_arg1[_local5].id = _arg2[0].id;
} else {
_arg1[_local5].id = _arg2[1].id;
};
_local5++;
};
return (_local5);
}
public static function b2CollidePoly(_arg1:b2Manifold, _arg2:b2PolyShape, _arg3:b2PolyShape, _arg4:Boolean):void{
var _local5:int;
var _local6:Array;
var _local7:Number;
var _local8:int;
var _local9:Array;
var _local10:Number;
var _local11:b2PolyShape;
var _local12:b2PolyShape;
var _local13:int;
var _local14:int;
var _local15:Number;
var _local16:Number;
var _local17:Array;
var _local18:int;
var _local19:Array;
var _local20:b2Vec2;
var _local21:b2Vec2;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:b2Mat22;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Array;
var _local39:Array;
var _local40:int;
var _local41:int;
var _local42:int;
var _local43:b2Vec2;
var _local44:Number;
var _local45:b2ContactPoint;
_arg1.pointCount = 0;
_local5 = 0;
_local6 = [_local5];
_local7 = FindMaxSeparation(_local6, _arg2, _arg3, _arg4);
_local5 = _local6[0];
if ((((_local7 > 0)) && ((_arg4 == false)))){
return;
};
_local8 = 0;
_local9 = [_local8];
_local10 = FindMaxSeparation(_local9, _arg3, _arg2, _arg4);
_local8 = _local9[0];
if ((((_local10 > 0)) && ((_arg4 == false)))){
return;
};
_local15 = 0.98;
_local16 = 0.001;
if (_local10 > ((_local15 * _local7) + _local16)){
_local11 = _arg3;
_local12 = _arg2;
_local13 = _local8;
_local14 = 1;
} else {
_local11 = _arg2;
_local12 = _arg3;
_local13 = _local5;
_local14 = 0;
};
_local17 = [new ClipVertex(), new ClipVertex()];
FindIncidentEdge(_local17, _local11, _local13, _local12);
_local18 = _local11.m_vertexCount;
_local19 = _local11.m_vertices;
_local20 = _local19[_local13];
_local21 = (((_local13 + 1) < _local18)) ? _local19[(_local13 + 1)] : _local19[0];
_local22 = (_local21.x - _local20.x);
_local23 = (_local21.y - _local20.y);
_local24 = (_local21.x - _local20.x);
_local25 = (_local21.y - _local20.y);
_local26 = _local24;
_local27 = _local11.m_R;
_local24 = ((_local27.col1.x * _local26) + (_local27.col2.x * _local25));
_local25 = ((_local27.col1.y * _local26) + (_local27.col2.y * _local25));
_local28 = (1 / Math.sqrt(((_local24 * _local24) + (_local25 * _local25))));
_local24 = (_local24 * _local28);
_local25 = (_local25 * _local28);
_local29 = _local24;
_local30 = _local25;
_local26 = _local29;
_local29 = _local30;
_local30 = -(_local26);
_local31 = _local20.x;
_local32 = _local20.y;
_local26 = _local31;
_local27 = _local11.m_R;
_local31 = ((_local27.col1.x * _local26) + (_local27.col2.x * _local32));
_local32 = ((_local27.col1.y * _local26) + (_local27.col2.y * _local32));
_local31 = (_local31 + _local11.m_position.x);
_local32 = (_local32 + _local11.m_position.y);
_local33 = _local21.x;
_local34 = _local21.y;
_local26 = _local33;
_local27 = _local11.m_R;
_local33 = ((_local27.col1.x * _local26) + (_local27.col2.x * _local34));
_local34 = ((_local27.col1.y * _local26) + (_local27.col2.y * _local34));
_local33 = (_local33 + _local11.m_position.x);
_local34 = (_local34 + _local11.m_position.y);
_local35 = ((_local29 * _local31) + (_local30 * _local32));
_local36 = -(((_local24 * _local31) + (_local25 * _local32)));
_local37 = ((_local24 * _local33) + (_local25 * _local34));
_local38 = [new ClipVertex(), new ClipVertex()];
_local39 = [new ClipVertex(), new ClipVertex()];
b2CollidePolyTempVec.Set(-(_local24), -(_local25));
_local40 = ClipSegmentToLine(_local38, _local17, b2CollidePolyTempVec, _local36);
if (_local40 < 2){
return;
};
b2CollidePolyTempVec.Set(_local24, _local25);
_local40 = ClipSegmentToLine(_local39, _local38, b2CollidePolyTempVec, _local37);
if (_local40 < 2){
return;
};
if (_local14){
_arg1.normal.Set(-(_local29), -(_local30));
} else {
_arg1.normal.Set(_local29, _local30);
};
_local41 = 0;
_local42 = 0;
while (_local42 < b2Settings.b2_maxManifoldPoints) {
_local43 = _local39[_local42].v;
_local44 = (((_local29 * _local43.x) + (_local30 * _local43.y)) - _local35);
if ((((_local44 <= 0)) || ((_arg4 == true)))){
_local45 = _arg1.points[_local41];
_local45.separation = _local44;
_local45.position.SetV(_local39[_local42].v);
_local45.id.Set(_local39[_local42].id);
_local45.id.features.flip = _local14;
_local41++;
};
_local42++;
};
_arg1.pointCount = _local41;
}
public static function b2CollideCircle(_arg1:b2Manifold, _arg2:b2CircleShape, _arg3:b2CircleShape, _arg4:Boolean):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2ContactPoint;
var _local11:Number;
var _local12:Number;
_arg1.pointCount = 0;
_local5 = (_arg3.m_position.x - _arg2.m_position.x);
_local6 = (_arg3.m_position.y - _arg2.m_position.y);
_local7 = ((_local5 * _local5) + (_local6 * _local6));
_local8 = (_arg2.m_radius + _arg3.m_radius);
if ((((_local7 > (_local8 * _local8))) && ((_arg4 == false)))){
return;
};
if (_local7 < Number.MIN_VALUE){
_local9 = -(_local8);
_arg1.normal.Set(0, 1);
} else {
_local11 = Math.sqrt(_local7);
_local9 = (_local11 - _local8);
_local12 = (1 / _local11);
_arg1.normal.x = (_local12 * _local5);
_arg1.normal.y = (_local12 * _local6);
};
_arg1.pointCount = 1;
_local10 = _arg1.points[0];
_local10.id.key = 0;
_local10.separation = _local9;
_local10.position.x = (_arg3.m_position.x - (_arg3.m_radius * _arg1.normal.x));
_local10.position.y = (_arg3.m_position.y - (_arg3.m_radius * _arg1.normal.y));
}
}
}//package Box2D.Collision
Section 15
//b2ContactID (Box2D.Collision.b2ContactID)
package Box2D.Collision {
public class b2ContactID {
public var _key:uint;
public var features:Features;
public function b2ContactID(){
features = new Features();
super();
features._m_id = this;
}
public function Set(_arg1:b2ContactID):void{
key = _arg1._key;
}
public function Copy():b2ContactID{
var _local1:b2ContactID;
_local1 = new b2ContactID();
_local1.key = key;
return (_local1);
}
public function get key():uint{
return (_key);
}
public function set key(_arg1:uint):void{
_key = _arg1;
features._referenceFace = (_key & 0xFF);
features._incidentEdge = (((_key & 0xFF00) >> 8) & 0xFF);
features._incidentVertex = (((_key & 0xFF0000) >> 16) & 0xFF);
features._flip = (((_key & 4278190080) >> 24) & 0xFF);
}
}
}//package Box2D.Collision
Section 16
//b2ContactPoint (Box2D.Collision.b2ContactPoint)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2ContactPoint {
public var separation:Number;
public var position:b2Vec2;
public var normalImpulse:Number;
public var tangentImpulse:Number;
public var id:b2ContactID;
public function b2ContactPoint(){
position = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 17
//b2Manifold (Box2D.Collision.b2Manifold)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Manifold {
public var points:Array;
public var pointCount:int;
public var normal:b2Vec2;
public function b2Manifold(){
var _local1:int;
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ContactPoint();
_local1++;
};
normal = new b2Vec2();
}
}
}//package Box2D.Collision
Section 18
//b2OBB (Box2D.Collision.b2OBB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2OBB {
public var R:b2Mat22;
public var center:b2Vec2;
public var extents:b2Vec2;
public function b2OBB(){
R = new b2Mat22();
center = new b2Vec2();
extents = new b2Vec2();
super();
}
}
}//package Box2D.Collision
Section 19
//b2Pair (Box2D.Collision.b2Pair)
package Box2D.Collision {
public class b2Pair {
public var userData;// = null
public var proxyId1:uint;
public var proxyId2:uint;
public var status:uint;
public var next:uint;
public static var e_pairFinal:uint = 4;
public static var b2_tableMask:int = (b2_tableCapacity - 1);
public static var e_pairRemoved:uint = 2;
public static var b2_nullPair:uint = 0xFFFF;
public static var e_pairBuffered:uint = 1;
public static var b2_nullProxy:uint = 0xFFFF;
public static var b2_tableCapacity:int = 8192;
public function b2Pair(){
userData = null;
super();
}
public function SetBuffered():void{
status = (status | e_pairBuffered);
}
public function IsBuffered():Boolean{
return (((status & e_pairBuffered) == e_pairBuffered));
}
public function IsFinal():Boolean{
return (((status & e_pairFinal) == e_pairFinal));
}
public function ClearRemoved():void{
status = (status & ~(e_pairRemoved));
}
public function SetFinal():void{
status = (status | e_pairFinal);
}
public function IsRemoved():Boolean{
return (((status & e_pairRemoved) == e_pairRemoved));
}
public function ClearBuffered():void{
status = (status & ~(e_pairBuffered));
}
public function SetRemoved():void{
status = (status | e_pairRemoved);
}
}
}//package Box2D.Collision
Section 20
//b2PairCallback (Box2D.Collision.b2PairCallback)
package Box2D.Collision {
public class b2PairCallback {
public function PairRemoved(_arg1, _arg2, _arg3):void{
}
public function PairAdded(_arg1, _arg2){
return (null);
}
}
}//package Box2D.Collision
Section 21
//b2PairManager (Box2D.Collision.b2PairManager)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PairManager {
public var m_pairCount:int;
public var m_pairBuffer:Array;
public var m_callback:b2PairCallback;
public var m_pairs:Array;
public var m_pairBufferCount:int;
public var m_hashTable:Array;
public var m_broadPhase:b2BroadPhase;
public var m_freePair:uint;
public function b2PairManager(){
var _local1:uint;
super();
m_hashTable = new Array(b2Pair.b2_tableCapacity);
_local1 = 0;
while (_local1 < b2Pair.b2_tableCapacity) {
m_hashTable[_local1] = b2Pair.b2_nullPair;
_local1++;
};
m_pairs = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1] = new b2Pair();
_local1++;
};
m_pairBuffer = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairBuffer[_local1] = new b2BufferedPair();
_local1++;
};
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1].proxyId1 = b2Pair.b2_nullProxy;
m_pairs[_local1].proxyId2 = b2Pair.b2_nullProxy;
m_pairs[_local1].userData = null;
m_pairs[_local1].status = 0;
m_pairs[_local1].next = (_local1 + 1);
_local1++;
};
m_pairs[(b2Settings.b2_maxPairs - 1)].next = b2Pair.b2_nullPair;
m_pairCount = 0;
}
private function FindHash(_arg1:uint, _arg2:uint, _arg3:uint):b2Pair{
var _local4:uint;
_local4 = m_hashTable[_arg3];
while (((!((_local4 == b2Pair.b2_nullPair))) && ((Equals(m_pairs[_local4], _arg1, _arg2) == false)))) {
_local4 = m_pairs[_local4].next;
};
if (_local4 == b2Pair.b2_nullPair){
return (null);
};
return (m_pairs[_local4]);
}
private function Find(_arg1:uint, _arg2:uint):b2Pair{
var _local3:uint;
var _local4:uint;
if (_arg1 > _arg2){
_local4 = _arg1;
_arg1 = _arg2;
_arg2 = _local4;
};
_local3 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
return (FindHash(_arg1, _arg2, _local3));
}
private function ValidateBuffer():void{
}
public function Commit():void{
var _local1:int;
var _local2:int;
var _local3:Array;
var _local4:b2Pair;
var _local5:b2Proxy;
var _local6:b2Proxy;
_local2 = 0;
_local3 = m_broadPhase.m_proxyPool;
_local1 = 0;
while (_local1 < m_pairBufferCount) {
_local4 = Find(m_pairBuffer[_local1].proxyId1, m_pairBuffer[_local1].proxyId2);
_local4.ClearBuffered();
_local5 = _local3[_local4.proxyId1];
_local6 = _local3[_local4.proxyId2];
if (_local4.IsRemoved()){
if (_local4.IsFinal() == true){
m_callback.PairRemoved(_local5.userData, _local6.userData, _local4.userData);
};
m_pairBuffer[_local2].proxyId1 = _local4.proxyId1;
m_pairBuffer[_local2].proxyId2 = _local4.proxyId2;
_local2++;
} else {
if (_local4.IsFinal() == false){
_local4.userData = m_callback.PairAdded(_local5.userData, _local6.userData);
_local4.SetFinal();
};
};
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
RemovePair(m_pairBuffer[_local1].proxyId1, m_pairBuffer[_local1].proxyId2);
_local1++;
};
m_pairBufferCount = 0;
if (b2BroadPhase.s_validate){
ValidateTable();
};
}
public function RemoveBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2Pair;
_local3 = Find(_arg1, _arg2);
if (_local3 == null){
return;
};
if (_local3.IsBuffered() == false){
_local3.SetBuffered();
m_pairBuffer[m_pairBufferCount].proxyId1 = _local3.proxyId1;
m_pairBuffer[m_pairBufferCount].proxyId2 = _local3.proxyId2;
m_pairBufferCount++;
};
_local3.SetRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function RemovePair(_arg1:uint, _arg2:uint){
var _local3:uint;
var _local4:uint;
var _local5:b2Pair;
var _local6:uint;
var _local7:uint;
var _local8:b2Pair;
var _local9:*;
if (_arg1 > _arg2){
_local6 = _arg1;
_arg1 = _arg2;
_arg2 = _local6;
};
_local3 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
_local4 = m_hashTable[_local3];
_local5 = null;
while (_local4 != b2Pair.b2_nullPair) {
if (Equals(m_pairs[_local4], _arg1, _arg2)){
_local7 = _local4;
if (_local5){
_local5.next = m_pairs[_local4].next;
} else {
m_hashTable[_local3] = m_pairs[_local4].next;
};
_local8 = m_pairs[_local7];
_local9 = _local8.userData;
_local8.next = m_freePair;
_local8.proxyId1 = b2Pair.b2_nullProxy;
_local8.proxyId2 = b2Pair.b2_nullProxy;
_local8.userData = null;
_local8.status = 0;
m_freePair = _local7;
m_pairCount--;
return (_local9);
} else {
_local5 = m_pairs[_local4];
_local4 = _local5.next;
};
};
return (null);
}
public function Initialize(_arg1:b2BroadPhase, _arg2:b2PairCallback):void{
m_broadPhase = _arg1;
m_callback = _arg2;
}
public function AddBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2Pair;
_local3 = AddPair(_arg1, _arg2);
if (_local3.IsBuffered() == false){
_local3.SetBuffered();
m_pairBuffer[m_pairBufferCount].proxyId1 = _local3.proxyId1;
m_pairBuffer[m_pairBufferCount].proxyId2 = _local3.proxyId2;
m_pairBufferCount++;
};
_local3.ClearRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function AddPair(_arg1:uint, _arg2:uint):b2Pair{
var _local3:uint;
var _local4:b2Pair;
var _local5:uint;
var _local6:uint;
if (_arg1 > _arg2){
_local6 = _arg1;
_arg1 = _arg2;
_arg2 = _local6;
};
_local3 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
_local4 = FindHash(_arg1, _arg2, _local3);
if (_local4 != null){
return (_local4);
};
_local5 = m_freePair;
_local4 = m_pairs[_local5];
m_freePair = _local4.next;
_local4.proxyId1 = _arg1;
_local4.proxyId2 = _arg2;
_local4.status = 0;
_local4.userData = null;
_local4.next = m_hashTable[_local3];
m_hashTable[_local3] = _local5;
m_pairCount++;
return (_local4);
}
private function ValidateTable():void{
}
public static function EqualsPair(_arg1:b2BufferedPair, _arg2:b2BufferedPair):Boolean{
return ((((_arg1.proxyId1 == _arg2.proxyId1)) && ((_arg1.proxyId2 == _arg2.proxyId2))));
}
public static function Hash(_arg1:uint, _arg2:uint):uint{
var _local3:uint;
_local3 = (((_arg2 << 16) & 4294901760) | _arg1);
_local3 = (~(_local3) + ((_local3 << 15) & 4294934528));
_local3 = (_local3 ^ ((_local3 >> 12) & 1048575));
_local3 = (_local3 + ((_local3 << 2) & 4294967292));
_local3 = (_local3 ^ ((_local3 >> 4) & 268435455));
_local3 = (_local3 * 2057);
_local3 = (_local3 ^ ((_local3 >> 16) & 0xFFFF));
return (_local3);
}
public static function Equals(_arg1:b2Pair, _arg2:uint, _arg3:uint):Boolean{
return ((((_arg1.proxyId1 == _arg2)) && ((_arg1.proxyId2 == _arg3))));
}
}
}//package Box2D.Collision
Section 22
//b2Proxy (Box2D.Collision.b2Proxy)
package Box2D.Collision {
public class b2Proxy {
public var overlapCount:uint;
public var lowerBounds:Array;
public var upperBounds:Array;
public var userData;// = null
public var timeStamp:uint;
public function b2Proxy(){
lowerBounds = [uint(0), uint(0)];
upperBounds = [uint(0), uint(0)];
userData = null;
super();
}
public function GetNext():uint{
return (lowerBounds[0]);
}
public function IsValid():Boolean{
return (!((overlapCount == b2BroadPhase.b2_invalid)));
}
public function SetNext(_arg1:uint):void{
lowerBounds[0] = (_arg1 & 0xFFFF);
}
}
}//package Box2D.Collision
Section 23
//ClipVertex (Box2D.Collision.ClipVertex)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class ClipVertex {
public var v:b2Vec2;
public var id:b2ContactID;
public function ClipVertex(){
v = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 24
//Features (Box2D.Collision.Features)
package Box2D.Collision {
public class Features {
public var _referenceFace:int;
public var _incidentEdge:int;
public var _flip:int;
public var _incidentVertex:int;
public var _m_id:b2ContactID;
public function get referenceFace():int{
return (_referenceFace);
}
public function set incidentVertex(_arg1:int):void{
_incidentVertex = _arg1;
_m_id._key = ((_m_id._key & 4278255615) | ((_incidentVertex << 16) & 0xFF0000));
}
public function get flip():int{
return (_flip);
}
public function get incidentEdge():int{
return (_incidentEdge);
}
public function set referenceFace(_arg1:int):void{
_referenceFace = _arg1;
_m_id._key = ((_m_id._key & 4294967040) | (_referenceFace & 0xFF));
}
public function set flip(_arg1:int):void{
_flip = _arg1;
_m_id._key = ((_m_id._key & 0xFFFFFF) | ((_flip << 24) & 4278190080));
}
public function get incidentVertex():int{
return (_incidentVertex);
}
public function set incidentEdge(_arg1:int):void{
_incidentEdge = _arg1;
_m_id._key = ((_m_id._key & 4294902015) | ((_incidentEdge << 8) & 0xFF00));
}
}
}//package Box2D.Collision
Section 25
//b2Mat22 (Box2D.Common.Math.b2Mat22)
package Box2D.Common.Math {
public class b2Mat22 {
public var col1:b2Vec2;
public var col2:b2Vec2;
public function b2Mat22(_arg1:Number=0, _arg2:b2Vec2=null, _arg3:b2Vec2=null){
var _local4:Number;
var _local5:Number;
col1 = new b2Vec2();
col2 = new b2Vec2();
super();
if (((!((_arg2 == null))) && (!((_arg3 == null))))){
col1.SetV(_arg2);
col2.SetV(_arg3);
} else {
_local4 = Math.cos(_arg1);
_local5 = Math.sin(_arg1);
col1.x = _local4;
col2.x = -(_local5);
col1.y = _local5;
col2.y = _local4;
};
}
public function SetIdentity():void{
col1.x = 1;
col2.x = 0;
col1.y = 0;
col2.y = 1;
}
public function Set(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
col1.x = _local2;
col2.x = -(_local3);
col1.y = _local3;
col2.y = _local2;
}
public function SetVV(_arg1:b2Vec2, _arg2:b2Vec2):void{
col1.SetV(_arg1);
col2.SetV(_arg2);
}
public function SetZero():void{
col1.x = 0;
col2.x = 0;
col1.y = 0;
col2.y = 0;
}
public function SetM(_arg1:b2Mat22):void{
col1.SetV(_arg1.col1);
col2.SetV(_arg1.col2);
}
public function AddM(_arg1:b2Mat22):void{
col1.x = (col1.x + _arg1.col1.x);
col1.y = (col1.y + _arg1.col1.y);
col2.x = (col2.x + _arg1.col2.x);
col2.y = (col2.y + _arg1.col2.y);
}
public function Abs():void{
col1.Abs();
col2.Abs();
}
public function Copy():b2Mat22{
return (new b2Mat22(0, col1, col2));
}
public function Invert(_arg1:b2Mat22):b2Mat22{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = col1.x;
_local3 = col2.x;
_local4 = col1.y;
_local5 = col2.y;
_local6 = ((_local2 * _local5) - (_local3 * _local4));
_local6 = (1 / _local6);
_arg1.col1.x = (_local6 * _local5);
_arg1.col2.x = (-(_local6) * _local3);
_arg1.col1.y = (-(_local6) * _local4);
_arg1.col2.y = (_local6 * _local2);
return (_arg1);
}
public function Solve(_arg1:b2Vec2, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = col1.x;
_local5 = col2.x;
_local6 = col1.y;
_local7 = col2.y;
_local8 = ((_local4 * _local7) - (_local5 * _local6));
_local8 = (1 / _local8);
_arg1.x = (_local8 * ((_local7 * _arg2) - (_local5 * _arg3)));
_arg1.y = (_local8 * ((_local4 * _arg3) - (_local6 * _arg2)));
return (_arg1);
}
}
}//package Box2D.Common.Math
Section 26
//b2Math (Box2D.Common.Math.b2Math)
package Box2D.Common.Math {
public class b2Math {
public static function b2CrossVF(_arg1:b2Vec2, _arg2:Number):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg2 * _arg1.y), (-(_arg2) * _arg1.x));
return (_local3);
}
public static function AddVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1.x + _arg2.x), (_arg1.y + _arg2.y));
return (_local3);
}
public static function b2IsValid(_arg1:Number):Boolean{
return (isFinite(_arg1));
}
public static function b2Swap(_arg1:Array, _arg2:Array):void{
var _local3:*;
_local3 = _arg1[0];
_arg1[0] = _arg2[0];
_arg2[0] = _local3;
}
public static function b2Abs(_arg1:Number):Number{
return (((_arg1 > 0)) ? _arg1 : -(_arg1));
}
public static function b2AbsM(_arg1:b2Mat22):b2Mat22{
var _local2:b2Mat22;
_local2 = new b2Mat22(0, b2AbsV(_arg1.col1), b2AbsV(_arg1.col2));
return (_local2);
}
public static function SubtractVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1.x - _arg2.x), (_arg1.y - _arg2.y));
return (_local3);
}
public static function b2CrossVV(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function b2Clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (b2Max(_arg2, b2Min(_arg1, _arg3)));
}
public static function b2AbsV(_arg1:b2Vec2):b2Vec2{
var _local2:b2Vec2;
_local2 = new b2Vec2(b2Abs(_arg1.x), b2Abs(_arg1.y));
return (_local2);
}
public static function b2MinV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Min(_arg1.x, _arg2.x), b2Min(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2Dot(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function b2CrossFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((-(_arg1) * _arg2.y), (_arg1 * _arg2.x));
return (_local3);
}
public static function AddMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22;
_local3 = new b2Mat22(0, AddVV(_arg1.col1, _arg2.col1), AddVV(_arg1.col2, _arg2.col2));
return (_local3);
}
public static function b2MulTMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2Mat22;
_local3 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col1), b2Dot(_arg1.col2, _arg2.col1));
_local4 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col2), b2Dot(_arg1.col2, _arg2.col2));
_local5 = new b2Mat22(0, _local3, _local4);
return (_local5);
}
public static function b2MaxV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Max(_arg1.x, _arg2.x), b2Max(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2IsPowerOfTwo(_arg1:uint):Boolean{
var _local2:Boolean;
_local2 = (((_arg1 > 0)) && (((_arg1 & (_arg1 - 1)) == 0)));
return (_local2);
}
public static function b2ClampV(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Vec2):b2Vec2{
return (b2MaxV(_arg2, b2MinV(_arg1, _arg3)));
}
public static function MulFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1 * _arg2.x), (_arg1 * _arg2.y));
return (_local3);
}
public static function b2MulTMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Dot(_arg2, _arg1.col1), b2Dot(_arg2, _arg1.col2));
return (_local3);
}
public static function b2Min(_arg1:Number, _arg2:Number):Number{
return (((_arg1 < _arg2)) ? _arg1 : _arg2);
}
public static function b2Random():Number{
return (((Math.random() * 2) - 1));
}
public static function b2MulMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22;
_local3 = new b2Mat22(0, b2MulMV(_arg1, _arg2.col1), b2MulMV(_arg1, _arg2.col2));
return (_local3);
}
public static function b2NextPowerOfTwo(_arg1:uint):uint{
_arg1 = (_arg1 | ((_arg1 >> 1) & 2147483647));
_arg1 = (_arg1 | ((_arg1 >> 2) & 1073741823));
_arg1 = (_arg1 | ((_arg1 >> 4) & 268435455));
_arg1 = (_arg1 | ((_arg1 >> 8) & 0xFFFFFF));
_arg1 = (_arg1 | ((_arg1 >> 16) & 0xFFFF));
return ((_arg1 + 1));
}
public static function b2Max(_arg1:Number, _arg2:Number):Number{
return (((_arg1 > _arg2)) ? _arg1 : _arg2);
}
public static function b2MulMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(((_arg1.col1.x * _arg2.x) + (_arg1.col2.x * _arg2.y)), ((_arg1.col1.y * _arg2.x) + (_arg1.col2.y * _arg2.y)));
return (_local3);
}
}
}//package Box2D.Common.Math
Section 27
//b2Vec2 (Box2D.Common.Math.b2Vec2)
package Box2D.Common.Math {
public class b2Vec2 {
public var x:Number;
public var y:Number;
public function b2Vec2(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Set(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Multiply(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
}
public function Length():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function Add(_arg1:b2Vec2):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
public function SetZero():void{
x = 0;
y = 0;
}
public function CrossVF(_arg1:Number):void{
var _local2:Number;
_local2 = x;
x = (_arg1 * y);
y = (-(_arg1) * _local2);
}
public function MaxV(_arg1:b2Vec2):void{
x = ((x > _arg1.x)) ? x : _arg1.x;
y = ((y > _arg1.y)) ? y : _arg1.y;
}
public function SetV(_arg1:b2Vec2):void{
x = _arg1.x;
y = _arg1.y;
}
public function Negative():b2Vec2{
return (new b2Vec2(-(x), -(y)));
}
public function Abs():void{
x = Math.abs(x);
y = Math.abs(y);
}
public function Copy():b2Vec2{
return (new b2Vec2(x, y));
}
public function MulTM(_arg1:b2Mat22):void{
var _local2:Number;
_local2 = b2Math.b2Dot(this, _arg1.col1);
y = b2Math.b2Dot(this, _arg1.col2);
x = _local2;
}
public function IsValid():Boolean{
return (((b2Math.b2IsValid(x)) && (b2Math.b2IsValid(y))));
}
public function MinV(_arg1:b2Vec2):void{
x = ((x < _arg1.x)) ? x : _arg1.x;
y = ((y < _arg1.y)) ? y : _arg1.y;
}
public function MulM(_arg1:b2Mat22):void{
var _local2:Number;
_local2 = x;
x = ((_arg1.col1.x * _local2) + (_arg1.col2.x * y));
y = ((_arg1.col1.y * _local2) + (_arg1.col2.y * y));
}
public function Normalize():Number{
var _local1:Number;
var _local2:Number;
_local1 = Length();
if (_local1 < Number.MIN_VALUE){
return (0);
};
_local2 = (1 / _local1);
x = (x * _local2);
y = (y * _local2);
return (_local1);
}
public function Subtract(_arg1:b2Vec2):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
public function CrossFV(_arg1:Number):void{
var _local2:Number;
_local2 = x;
x = (-(_arg1) * y);
y = (_arg1 * _local2);
}
public static function Make(_arg1:Number, _arg2:Number):b2Vec2{
return (new b2Vec2(_arg1, _arg2));
}
}
}//package Box2D.Common.Math
Section 28
//b2Settings (Box2D.Common.b2Settings)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Settings {
public static const b2_lengthUnitsPerMeter:Number = 30;
public static const b2_angularSleepTolerance:Number = 0.0111111111111111;
public static const b2_linearSleepTolerance:Number = 0.3;
public static const b2_angularSlop:Number = 0.0349065850398866;
public static const b2_linearSlop:Number = 0.15;
public static const b2_pi:Number = 3.14159265358979;
public static const b2_maxShapesPerBody:int = 64;
public static const b2_maxProxies:int = 0x0400;
public static const b2_velocityThreshold:Number = 30;
public static const b2_timeToSleep:Number = 0.5;
public static const b2_contactBaumgarte:Number = 0.2;
public static const b2_maxPairs:int = 8192;
public static const b2_maxManifoldPoints:int = 2;
public static const b2_massUnitsPerKilogram:Number = 1;
public static const b2_maxAngularCorrection:Number = 0.139626340159546;
public static const USHRT_MAX:int = 0xFFFF;
public static const b2_maxLinearCorrection:Number = 6;
public static const b2_maxPolyVertices:int = 8;
public static const b2_timeUnitsPerSecond:Number = 1;
public static function b2Assert(_arg1:Boolean):void{
var _local2:b2Vec2;
if (!_arg1){
_local2.x++;
};
}
}
}//package Box2D.Common
Section 29
//b2CircleContact (Box2D.Dynamics.Contacts.b2CircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2CircleContact extends b2Contact {
public var m_manifold:Array;
public function b2CircleContact(_arg1:b2Shape, _arg2:b2Shape){
m_manifold = [new b2Manifold()];
super(_arg1, _arg2);
m_manifold[0].pointCount = 0;
m_manifold[0].points[0].normalImpulse = 0;
m_manifold[0].points[0].tangentImpulse = 0;
}
override public function GetManifolds():Array{
return (m_manifold);
}
override public function Evaluate():void{
b2Collision.b2CollideCircle(m_manifold[0], (m_shape1 as b2CircleShape), (m_shape2 as b2CircleShape), false);
if (m_manifold[0].pointCount > 0){
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2CircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 30
//b2Contact (Box2D.Dynamics.Contacts.b2Contact)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2Contact {
public var m_shape1:b2Shape;
public var m_shape2:b2Shape;
public var m_prev:b2Contact;
public var m_next:b2Contact;
public var m_friction:Number;
public var m_manifoldCount:int;
public var m_node1:b2ContactNode;
public var m_node2:b2ContactNode;
public var m_restitution:Number;
public var m_flags:uint;
public static var s_registers:Array;
public static var s_initialized:Boolean = false;
public static var e_islandFlag:uint = 1;
public static var e_destroyFlag:uint = 2;
public function b2Contact(_arg1:b2Shape=null, _arg2:b2Shape=null){
m_node1 = new b2ContactNode();
m_node2 = new b2ContactNode();
super();
m_flags = 0;
if (((!(_arg1)) || (!(_arg2)))){
m_shape1 = null;
m_shape2 = null;
return;
};
m_shape1 = _arg1;
m_shape2 = _arg2;
m_manifoldCount = 0;
m_friction = Math.sqrt((m_shape1.m_friction * m_shape2.m_friction));
m_restitution = b2Math.b2Max(m_shape1.m_restitution, m_shape2.m_restitution);
m_prev = null;
m_next = null;
m_node1.contact = null;
m_node1.prev = null;
m_node1.next = null;
m_node1.other = null;
m_node2.contact = null;
m_node2.prev = null;
m_node2.next = null;
m_node2.other = null;
}
public function GetShape1():b2Shape{
return (m_shape1);
}
public function GetNext():b2Contact{
return (m_next);
}
public function GetShape2():b2Shape{
return (m_shape2);
}
public function GetManifoldCount():int{
return (m_manifoldCount);
}
public function GetManifolds():Array{
return (null);
}
public function Evaluate():void{
}
public static function InitializeRegisters():void{
var _local1:int;
var _local2:int;
s_registers = new Array(b2Shape.e_shapeTypeCount);
_local1 = 0;
while (_local1 < b2Shape.e_shapeTypeCount) {
s_registers[_local1] = new Array(b2Shape.e_shapeTypeCount);
_local2 = 0;
while (_local2 < b2Shape.e_shapeTypeCount) {
s_registers[_local1][_local2] = new b2ContactRegister();
_local2++;
};
_local1++;
};
AddType(b2CircleContact.Create, b2CircleContact.Destroy, b2Shape.e_circleShape, b2Shape.e_circleShape);
AddType(b2PolyAndCircleContact.Create, b2PolyAndCircleContact.Destroy, b2Shape.e_polyShape, b2Shape.e_circleShape);
AddType(b2PolyContact.Create, b2PolyContact.Destroy, b2Shape.e_polyShape, b2Shape.e_polyShape);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
var _local3:int;
var _local4:int;
var _local5:*;
if (_arg1.GetManifoldCount() > 0){
_arg1.m_shape1.m_body.WakeUp();
_arg1.m_shape2.m_body.WakeUp();
};
_local3 = _arg1.m_shape1.m_type;
_local4 = _arg1.m_shape2.m_type;
_local5 = s_registers[_local3][_local4].destroyFcn;
_local5(_arg1, _arg2);
}
public static function AddType(_arg1, _arg2, _arg3:int, _arg4:int):void{
s_registers[_arg3][_arg4].createFcn = _arg1;
s_registers[_arg3][_arg4].destroyFcn = _arg2;
s_registers[_arg3][_arg4].primary = true;
if (_arg3 != _arg4){
s_registers[_arg4][_arg3].createFcn = _arg1;
s_registers[_arg4][_arg3].destroyFcn = _arg2;
s_registers[_arg4][_arg3].primary = false;
};
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
var _local4:int;
var _local5:int;
var _local6:*;
var _local7:b2Contact;
var _local8:int;
var _local9:b2Manifold;
if (s_initialized == false){
InitializeRegisters();
s_initialized = true;
};
_local4 = _arg1.m_type;
_local5 = _arg2.m_type;
_local6 = s_registers[_local4][_local5].createFcn;
if (_local6){
if (s_registers[_local4][_local5].primary){
return (_local6(_arg1, _arg2, _arg3));
};
_local7 = _local6(_arg2, _arg1, _arg3);
_local8 = 0;
while (_local8 < _local7.GetManifoldCount()) {
_local9 = _local7.GetManifolds()[_local8];
_local7.GetManifolds()[_local8].normal = _local9.normal.Negative();
_local8++;
};
return (_local7);
//unresolved jump
};
return (null);
}
}
}//package Box2D.Dynamics.Contacts
Section 31
//b2ContactConstraint (Box2D.Dynamics.Contacts.b2ContactConstraint)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactConstraint {
public var points:Array;
public var restitution:Number;
public var body1:b2Body;
public var manifold:b2Manifold;
public var normal:b2Vec2;
public var body2:b2Body;
public var friction:Number;
public var pointCount:int;
public function b2ContactConstraint(){
var _local1:int;
normal = new b2Vec2();
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ContactConstraintPoint();
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 32
//b2ContactConstraintPoint (Box2D.Dynamics.Contacts.b2ContactConstraintPoint)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
public class b2ContactConstraintPoint {
public var separation:Number;
public var positionImpulse:Number;
public var normalImpulse:Number;
public var tangentImpulse:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var tangentMass:Number;
public var normalMass:Number;
public var velocityBias:Number;
public function b2ContactConstraintPoint(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 33
//b2ContactNode (Box2D.Dynamics.Contacts.b2ContactNode)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2ContactNode {
public var next:b2ContactNode;
public var other:b2Body;
public var contact:b2Contact;
public var prev:b2ContactNode;
}
}//package Box2D.Dynamics.Contacts
Section 34
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister)
package Box2D.Dynamics.Contacts {
public class b2ContactRegister {
public var primary:Boolean;
public var createFcn;
public var destroyFcn;
}
}//package Box2D.Dynamics.Contacts
Section 35
//b2ContactSolver (Box2D.Dynamics.Contacts.b2ContactSolver)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactSolver {
public var m_constraintCount:int;
public var m_constraints:Array;
public var m_allocator;
public function b2ContactSolver(_arg1:Array, _arg2:int, _arg3){
var _local4:int;
var _local5:b2Vec2;
var _local6:b2Mat22;
var _local7:int;
var _local8:b2Contact;
var _local9:b2Body;
var _local10:b2Body;
var _local11:int;
var _local12:Array;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:int;
var _local22:b2Manifold;
var _local23:Number;
var _local24:Number;
var _local25:b2ContactConstraint;
var _local26:uint;
var _local27:b2ContactPoint;
var _local28:b2ContactConstraintPoint;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
var _local42:Number;
var _local43:Number;
var _local44:Number;
var _local45:Number;
m_constraints = new Array();
super();
m_allocator = _arg3;
m_constraintCount = 0;
_local4 = 0;
while (_local4 < _arg2) {
m_constraintCount = (m_constraintCount + _arg1[_local4].GetManifoldCount());
_local4++;
};
_local4 = 0;
while (_local4 < m_constraintCount) {
m_constraints[_local4] = new b2ContactConstraint();
_local4++;
};
_local7 = 0;
_local4 = 0;
while (_local4 < _arg2) {
_local8 = _arg1[_local4];
_local9 = _local8.m_shape1.m_body;
_local10 = _local8.m_shape2.m_body;
_local11 = _local8.GetManifoldCount();
_local12 = _local8.GetManifolds();
_local13 = _local8.m_friction;
_local14 = _local8.m_restitution;
_local15 = _local9.m_linearVelocity.x;
_local16 = _local9.m_linearVelocity.y;
_local17 = _local10.m_linearVelocity.x;
_local18 = _local10.m_linearVelocity.y;
_local19 = _local9.m_angularVelocity;
_local20 = _local10.m_angularVelocity;
_local21 = 0;
while (_local21 < _local11) {
_local22 = _local12[_local21];
_local23 = _local22.normal.x;
_local24 = _local22.normal.y;
_local25 = m_constraints[_local7];
_local25.body1 = _local9;
_local25.body2 = _local10;
_local25.manifold = _local22;
_local25.normal.x = _local23;
_local25.normal.y = _local24;
_local25.pointCount = _local22.pointCount;
_local25.friction = _local13;
_local25.restitution = _local14;
_local26 = 0;
while (_local26 < _local25.pointCount) {
_local27 = _local22.points[_local26];
_local28 = _local25.points[_local26];
_local28.normalImpulse = _local27.normalImpulse;
_local28.tangentImpulse = _local27.tangentImpulse;
_local28.separation = _local27.separation;
_local29 = (_local27.position.x - _local9.m_position.x);
_local30 = (_local27.position.y - _local9.m_position.y);
_local31 = (_local27.position.x - _local10.m_position.x);
_local32 = (_local27.position.y - _local10.m_position.y);
_local5 = _local28.localAnchor1;
_local6 = _local9.m_R;
_local5.x = ((_local29 * _local6.col1.x) + (_local30 * _local6.col1.y));
_local5.y = ((_local29 * _local6.col2.x) + (_local30 * _local6.col2.y));
_local5 = _local28.localAnchor2;
_local6 = _local10.m_R;
_local5.x = ((_local31 * _local6.col1.x) + (_local32 * _local6.col1.y));
_local5.y = ((_local31 * _local6.col2.x) + (_local32 * _local6.col2.y));
_local33 = ((_local29 * _local29) + (_local30 * _local30));
_local34 = ((_local31 * _local31) + (_local32 * _local32));
_local35 = ((_local29 * _local23) + (_local30 * _local24));
_local36 = ((_local31 * _local23) + (_local32 * _local24));
_local37 = (_local9.m_invMass + _local10.m_invMass);
_local37 = (_local37 + ((_local9.m_invI * (_local33 - (_local35 * _local35))) + (_local10.m_invI * (_local34 - (_local36 * _local36)))));
_local28.normalMass = (1 / _local37);
_local38 = _local24;
_local39 = -(_local23);
_local40 = ((_local29 * _local38) + (_local30 * _local39));
_local41 = ((_local31 * _local38) + (_local32 * _local39));
_local42 = (_local9.m_invMass + _local10.m_invMass);
_local42 = (_local42 + ((_local9.m_invI * (_local33 - (_local40 * _local40))) + (_local10.m_invI * (_local34 - (_local41 * _local41)))));
_local28.tangentMass = (1 / _local42);
_local28.velocityBias = 0;
if (_local28.separation > 0){
_local28.velocityBias = (-60 * _local28.separation);
};
_local43 = (((_local17 + (-(_local20) * _local32)) - _local15) - (-(_local19) * _local30));
_local44 = (((_local18 + (_local20 * _local31)) - _local16) - (_local19 * _local29));
_local45 = ((_local25.normal.x * _local43) + (_local25.normal.y * _local44));
if (_local45 < -(b2Settings.b2_velocityThreshold)){
_local28.velocityBias = (_local28.velocityBias + (-(_local25.restitution) * _local45));
};
_local26++;
};
_local7++;
_local21++;
};
_local4++;
};
}
public function SolvePositionConstraints(_arg1:Number):Boolean{
var _local2:Number;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:int;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:b2Vec2;
var _local10:Number;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:int;
var _local22:int;
var _local23:b2ContactConstraintPoint;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
_local2 = 0;
_local5 = 0;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_position;
_local10 = _local7.m_rotation;
_local11 = _local8.m_position;
_local12 = _local8.m_rotation;
_local13 = _local7.m_invMass;
_local14 = _local7.m_invI;
_local15 = _local8.m_invMass;
_local16 = _local8.m_invI;
_local17 = _local6.normal.x;
_local18 = _local6.normal.y;
_local19 = _local18;
_local20 = -(_local17);
_local21 = _local6.pointCount;
_local22 = 0;
while (_local22 < _local21) {
_local23 = _local6.points[_local22];
_local3 = _local7.m_R;
_local4 = _local23.localAnchor1;
_local24 = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local25 = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local3 = _local8.m_R;
_local4 = _local23.localAnchor2;
_local26 = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local27 = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local28 = (_local9.x + _local24);
_local29 = (_local9.y + _local25);
_local30 = (_local11.x + _local26);
_local31 = (_local11.y + _local27);
_local32 = (_local30 - _local28);
_local33 = (_local31 - _local29);
_local34 = (((_local32 * _local17) + (_local33 * _local18)) + _local23.separation);
_local2 = b2Math.b2Min(_local2, _local34);
_local35 = (_arg1 * b2Math.b2Clamp((_local34 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0));
_local36 = (-(_local23.normalMass) * _local35);
_local37 = _local23.positionImpulse;
_local23.positionImpulse = b2Math.b2Max((_local37 + _local36), 0);
_local36 = (_local23.positionImpulse - _local37);
_local38 = (_local36 * _local17);
_local39 = (_local36 * _local18);
_local9.x = (_local9.x - (_local13 * _local38));
_local9.y = (_local9.y - (_local13 * _local39));
_local10 = (_local10 - (_local14 * ((_local24 * _local39) - (_local25 * _local38))));
_local7.m_R.Set(_local10);
_local11.x = (_local11.x + (_local15 * _local38));
_local11.y = (_local11.y + (_local15 * _local39));
_local12 = (_local12 + (_local16 * ((_local26 * _local39) - (_local27 * _local38))));
_local8.m_R.Set(_local12);
_local22++;
};
_local7.m_rotation = _local10;
_local8.m_rotation = _local12;
_local5++;
};
return ((_local2 >= -(b2Settings.b2_linearSlop)));
}
public function SolveVelocityConstraints():void{
var _local1:int;
var _local2:b2ContactConstraintPoint;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:b2Mat22;
var _local14:b2Vec2;
var _local15:int;
var _local16:b2ContactConstraint;
var _local17:b2Body;
var _local18:b2Body;
var _local19:Number;
var _local20:b2Vec2;
var _local21:Number;
var _local22:b2Vec2;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:int;
var _local32:Number;
var _local33:Number;
var _local34:Number;
_local15 = 0;
while (_local15 < m_constraintCount) {
_local16 = m_constraints[_local15];
_local17 = _local16.body1;
_local18 = _local16.body2;
_local19 = _local17.m_angularVelocity;
_local20 = _local17.m_linearVelocity;
_local21 = _local18.m_angularVelocity;
_local22 = _local18.m_linearVelocity;
_local23 = _local17.m_invMass;
_local24 = _local17.m_invI;
_local25 = _local18.m_invMass;
_local26 = _local18.m_invI;
_local27 = _local16.normal.x;
_local28 = _local16.normal.y;
_local29 = _local28;
_local30 = -(_local27);
_local31 = _local16.pointCount;
_local1 = 0;
while (_local1 < _local31) {
_local2 = _local16.points[_local1];
_local13 = _local17.m_R;
_local14 = _local2.localAnchor1;
_local3 = ((_local13.col1.x * _local14.x) + (_local13.col2.x * _local14.y));
_local4 = ((_local13.col1.y * _local14.x) + (_local13.col2.y * _local14.y));
_local13 = _local18.m_R;
_local14 = _local2.localAnchor2;
_local5 = ((_local13.col1.x * _local14.x) + (_local13.col2.x * _local14.y));
_local6 = ((_local13.col1.y * _local14.x) + (_local13.col2.y * _local14.y));
_local7 = (((_local22.x + (-(_local21) * _local6)) - _local20.x) - (-(_local19) * _local4));
_local8 = (((_local22.y + (_local21 * _local5)) - _local20.y) - (_local19 * _local3));
_local32 = ((_local7 * _local27) + (_local8 * _local28));
_local9 = (-(_local2.normalMass) * (_local32 - _local2.velocityBias));
_local10 = b2Math.b2Max((_local2.normalImpulse + _local9), 0);
_local9 = (_local10 - _local2.normalImpulse);
_local11 = (_local9 * _local27);
_local12 = (_local9 * _local28);
_local20.x = (_local20.x - (_local23 * _local11));
_local20.y = (_local20.y - (_local23 * _local12));
_local19 = (_local19 - (_local24 * ((_local3 * _local12) - (_local4 * _local11))));
_local22.x = (_local22.x + (_local25 * _local11));
_local22.y = (_local22.y + (_local25 * _local12));
_local21 = (_local21 + (_local26 * ((_local5 * _local12) - (_local6 * _local11))));
_local2.normalImpulse = _local10;
_local7 = (((_local22.x + (-(_local21) * _local6)) - _local20.x) - (-(_local19) * _local4));
_local8 = (((_local22.y + (_local21 * _local5)) - _local20.y) - (_local19 * _local3));
_local33 = ((_local7 * _local29) + (_local8 * _local30));
_local9 = (_local2.tangentMass * -(_local33));
_local34 = (_local16.friction * _local2.normalImpulse);
_local10 = b2Math.b2Clamp((_local2.tangentImpulse + _local9), -(_local34), _local34);
_local9 = (_local10 - _local2.tangentImpulse);
_local11 = (_local9 * _local29);
_local12 = (_local9 * _local30);
_local20.x = (_local20.x - (_local23 * _local11));
_local20.y = (_local20.y - (_local23 * _local12));
_local19 = (_local19 - (_local24 * ((_local3 * _local12) - (_local4 * _local11))));
_local22.x = (_local22.x + (_local25 * _local11));
_local22.y = (_local22.y + (_local25 * _local12));
_local21 = (_local21 + (_local26 * ((_local5 * _local12) - (_local6 * _local11))));
_local2.tangentImpulse = _local10;
_local1++;
};
_local17.m_angularVelocity = _local19;
_local18.m_angularVelocity = _local21;
_local15++;
};
}
public function PreSolve():void{
var _local1:b2Vec2;
var _local2:b2Vec2;
var _local3:b2Mat22;
var _local4:int;
var _local5:b2ContactConstraint;
var _local6:b2Body;
var _local7:b2Body;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:int;
var _local17:int;
var _local18:b2ContactConstraintPoint;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:b2ContactConstraintPoint;
_local4 = 0;
while (_local4 < m_constraintCount) {
_local5 = m_constraints[_local4];
_local6 = _local5.body1;
_local7 = _local5.body2;
_local8 = _local6.m_invMass;
_local9 = _local6.m_invI;
_local10 = _local7.m_invMass;
_local11 = _local7.m_invI;
_local12 = _local5.normal.x;
_local13 = _local5.normal.y;
_local14 = _local13;
_local15 = -(_local12);
if (b2World.s_enableWarmStarting){
_local17 = _local5.pointCount;
_local16 = 0;
while (_local16 < _local17) {
_local18 = _local5.points[_local16];
_local19 = ((_local18.normalImpulse * _local12) + (_local18.tangentImpulse * _local14));
_local20 = ((_local18.normalImpulse * _local13) + (_local18.tangentImpulse * _local15));
_local3 = _local6.m_R;
_local1 = _local18.localAnchor1;
_local21 = ((_local3.col1.x * _local1.x) + (_local3.col2.x * _local1.y));
_local22 = ((_local3.col1.y * _local1.x) + (_local3.col2.y * _local1.y));
_local3 = _local7.m_R;
_local1 = _local18.localAnchor2;
_local23 = ((_local3.col1.x * _local1.x) + (_local3.col2.x * _local1.y));
_local24 = ((_local3.col1.y * _local1.x) + (_local3.col2.y * _local1.y));
_local6.m_angularVelocity = (_local6.m_angularVelocity - (_local9 * ((_local21 * _local20) - (_local22 * _local19))));
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x - (_local8 * _local19));
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y - (_local8 * _local20));
_local7.m_angularVelocity = (_local7.m_angularVelocity + (_local11 * ((_local23 * _local20) - (_local24 * _local19))));
_local7.m_linearVelocity.x = (_local7.m_linearVelocity.x + (_local10 * _local19));
_local7.m_linearVelocity.y = (_local7.m_linearVelocity.y + (_local10 * _local20));
_local18.positionImpulse = 0;
_local16++;
};
} else {
_local17 = _local5.pointCount;
_local16 = 0;
while (_local16 < _local17) {
_local25 = _local5.points[_local16];
_local25.normalImpulse = 0;
_local25.tangentImpulse = 0;
_local25.positionImpulse = 0;
_local16++;
};
};
_local4++;
};
}
public function PostSolve():void{
var _local1:int;
var _local2:b2ContactConstraint;
var _local3:b2Manifold;
var _local4:int;
var _local5:b2ContactPoint;
var _local6:b2ContactConstraintPoint;
_local1 = 0;
while (_local1 < m_constraintCount) {
_local2 = m_constraints[_local1];
_local3 = _local2.manifold;
_local4 = 0;
while (_local4 < _local2.pointCount) {
_local5 = _local3.points[_local4];
_local6 = _local2.points[_local4];
_local5.normalImpulse = _local6.normalImpulse;
_local5.tangentImpulse = _local6.tangentImpulse;
_local4++;
};
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 36
//b2NullContact (Box2D.Dynamics.Contacts.b2NullContact)
package Box2D.Dynamics.Contacts {
public class b2NullContact extends b2Contact {
public function b2NullContact():void{
}
override public function GetManifolds():Array{
return (null);
}
override public function Evaluate():void{
}
}
}//package Box2D.Dynamics.Contacts
Section 37
//b2PolyAndCircleContact (Box2D.Dynamics.Contacts.b2PolyAndCircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolyAndCircleContact extends b2Contact {
public var m_manifold:Array;
public function b2PolyAndCircleContact(_arg1:b2Shape, _arg2:b2Shape){
m_manifold = [new b2Manifold()];
super(_arg1, _arg2);
b2Settings.b2Assert((m_shape1.m_type == b2Shape.e_polyShape));
b2Settings.b2Assert((m_shape2.m_type == b2Shape.e_circleShape));
m_manifold[0].pointCount = 0;
m_manifold[0].points[0].normalImpulse = 0;
m_manifold[0].points[0].tangentImpulse = 0;
}
override public function GetManifolds():Array{
return (m_manifold);
}
override public function Evaluate():void{
b2Collision.b2CollidePolyAndCircle(m_manifold[0], (m_shape1 as b2PolyShape), (m_shape2 as b2CircleShape), false);
if (m_manifold[0].pointCount > 0){
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolyAndCircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 38
//b2PolyContact (Box2D.Dynamics.Contacts.b2PolyContact)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolyContact extends b2Contact {
public var m_manifold:Array;
private var m0:b2Manifold;
public function b2PolyContact(_arg1:b2Shape, _arg2:b2Shape):void{
m0 = new b2Manifold();
m_manifold = [new b2Manifold()];
super(_arg1, _arg2);
m_manifold[0].pointCount = 0;
}
override public function GetManifolds():Array{
return (m_manifold);
}
override public function Evaluate():void{
var _local1:b2Manifold;
var _local2:Array;
var _local3:int;
var _local4:b2ContactPoint;
var _local5:b2ContactPoint;
var _local6:Array;
var _local7:int;
var _local8:b2ContactPoint;
var _local9:uint;
var _local10:int;
var _local11:b2ContactPoint;
var _local12:b2ContactID;
_local1 = m_manifold[0];
_local2 = m0.points;
_local3 = 0;
while (_local3 < _local1.pointCount) {
_local4 = _local2[_local3];
_local5 = _local1.points[_local3];
_local4.normalImpulse = _local5.normalImpulse;
_local4.tangentImpulse = _local5.tangentImpulse;
_local4.id = _local5.id.Copy();
_local3++;
};
m0.pointCount = _local1.pointCount;
b2Collision.b2CollidePoly(_local1, (m_shape1 as b2PolyShape), (m_shape2 as b2PolyShape), false);
if (_local1.pointCount > 0){
_local6 = [false, false];
_local7 = 0;
while (_local7 < _local1.pointCount) {
_local8 = _local1.points[_local7];
_local8.normalImpulse = 0;
_local8.tangentImpulse = 0;
_local9 = _local8.id.key;
_local10 = 0;
while (_local10 < m0.pointCount) {
if (_local6[_local10] == true){
} else {
_local11 = m0.points[_local10];
_local12 = _local11.id;
if (_local12.key == _local9){
_local6[_local10] = true;
_local8.normalImpulse = _local11.normalImpulse;
_local8.tangentImpulse = _local11.tangentImpulse;
break;
};
};
_local10++;
};
_local7++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolyContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 39
//b2DistanceJoint (Box2D.Dynamics.Joints.b2DistanceJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2DistanceJoint extends b2Joint {
public var m_localAnchor2:b2Vec2;
public var m_mass:Number;
public var m_localAnchor1:b2Vec2;
public var m_u:b2Vec2;
public var m_impulse:Number;
public var m_length:Number;
public function b2DistanceJoint(_arg1:b2DistanceJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u = new b2Vec2();
super(_arg1);
_local2 = m_body1.m_R;
_local3 = (_arg1.anchorPoint1.x - m_body1.m_position.x);
_local4 = (_arg1.anchorPoint1.y - m_body1.m_position.y);
m_localAnchor1.x = ((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y));
m_localAnchor1.y = ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y));
_local2 = m_body2.m_R;
_local3 = (_arg1.anchorPoint2.x - m_body2.m_position.x);
_local4 = (_arg1.anchorPoint2.y - m_body2.m_position.y);
m_localAnchor2.x = ((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y));
m_localAnchor2.y = ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y));
_local3 = (_arg1.anchorPoint2.x - _arg1.anchorPoint1.x);
_local4 = (_arg1.anchorPoint2.y - _arg1.anchorPoint1.y);
m_length = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
m_impulse = 0;
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local2 = m_body1.m_R;
_local3 = ((_local2.col1.x * m_localAnchor1.x) + (_local2.col2.x * m_localAnchor1.y));
_local4 = ((_local2.col1.y * m_localAnchor1.x) + (_local2.col2.y * m_localAnchor1.y));
_local2 = m_body2.m_R;
_local5 = ((_local2.col1.x * m_localAnchor2.x) + (_local2.col2.x * m_localAnchor2.y));
_local6 = ((_local2.col1.y * m_localAnchor2.x) + (_local2.col2.y * m_localAnchor2.y));
_local7 = (m_body1.m_linearVelocity.x + (-(m_body1.m_angularVelocity) * _local4));
_local8 = (m_body1.m_linearVelocity.y + (m_body1.m_angularVelocity * _local3));
_local9 = (m_body2.m_linearVelocity.x + (-(m_body2.m_angularVelocity) * _local6));
_local10 = (m_body2.m_linearVelocity.y + (m_body2.m_angularVelocity * _local5));
_local11 = ((m_u.x * (_local9 - _local7)) + (m_u.y * (_local10 - _local8)));
_local12 = (-(m_mass) * _local11);
m_impulse = (m_impulse + _local12);
_local13 = (_local12 * m_u.x);
_local14 = (_local12 * m_u.y);
m_body1.m_linearVelocity.x = (m_body1.m_linearVelocity.x - (m_body1.m_invMass * _local13));
m_body1.m_linearVelocity.y = (m_body1.m_linearVelocity.y - (m_body1.m_invMass * _local14));
m_body1.m_angularVelocity = (m_body1.m_angularVelocity - (m_body1.m_invI * ((_local3 * _local14) - (_local4 * _local13))));
m_body2.m_linearVelocity.x = (m_body2.m_linearVelocity.x + (m_body2.m_invMass * _local13));
m_body2.m_linearVelocity.y = (m_body2.m_linearVelocity.y + (m_body2.m_invMass * _local14));
m_body2.m_angularVelocity = (m_body2.m_angularVelocity + (m_body2.m_invI * ((_local5 * _local14) - (_local6 * _local13))));
}
override public function GetAnchor1():b2Vec2{
return (b2Math.AddVV(m_body1.m_position, b2Math.b2MulMV(m_body1.m_R, m_localAnchor1)));
}
override public function GetAnchor2():b2Vec2{
return (b2Math.AddVV(m_body2.m_position, b2Math.b2MulMV(m_body2.m_R, m_localAnchor2)));
}
override public function PrepareVelocitySolver():void{
var _local1:b2Mat22;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local1 = m_body1.m_R;
_local2 = ((_local1.col1.x * m_localAnchor1.x) + (_local1.col2.x * m_localAnchor1.y));
_local3 = ((_local1.col1.y * m_localAnchor1.x) + (_local1.col2.y * m_localAnchor1.y));
_local1 = m_body2.m_R;
_local4 = ((_local1.col1.x * m_localAnchor2.x) + (_local1.col2.x * m_localAnchor2.y));
_local5 = ((_local1.col1.y * m_localAnchor2.x) + (_local1.col2.y * m_localAnchor2.y));
m_u.x = (((m_body2.m_position.x + _local4) - m_body1.m_position.x) - _local2);
m_u.y = (((m_body2.m_position.y + _local5) - m_body1.m_position.y) - _local3);
_local6 = Math.sqrt(((m_u.x * m_u.x) + (m_u.y * m_u.y)));
if (_local6 > b2Settings.b2_linearSlop){
m_u.Multiply((1 / _local6));
} else {
m_u.SetZero();
};
_local7 = ((_local2 * m_u.y) - (_local3 * m_u.x));
_local8 = ((_local4 * m_u.y) - (_local5 * m_u.x));
m_mass = (((m_body1.m_invMass + ((m_body1.m_invI * _local7) * _local7)) + m_body2.m_invMass) + ((m_body2.m_invI * _local8) * _local8));
m_mass = (1 / m_mass);
if (b2World.s_enableWarmStarting){
_local9 = (m_impulse * m_u.x);
_local10 = (m_impulse * m_u.y);
m_body1.m_linearVelocity.x = (m_body1.m_linearVelocity.x - (m_body1.m_invMass * _local9));
m_body1.m_linearVelocity.y = (m_body1.m_linearVelocity.y - (m_body1.m_invMass * _local10));
m_body1.m_angularVelocity = (m_body1.m_angularVelocity - (m_body1.m_invI * ((_local2 * _local10) - (_local3 * _local9))));
m_body2.m_linearVelocity.x = (m_body2.m_linearVelocity.x + (m_body2.m_invMass * _local9));
m_body2.m_linearVelocity.y = (m_body2.m_linearVelocity.y + (m_body2.m_invMass * _local10));
m_body2.m_angularVelocity = (m_body2.m_angularVelocity + (m_body2.m_invI * ((_local4 * _local10) - (_local5 * _local9))));
} else {
m_impulse = 0;
};
}
override public function GetReactionTorque(_arg1:Number):Number{
return (0);
}
override public function GetReactionForce(_arg1:Number):b2Vec2{
var _local2:b2Vec2;
_local2 = new b2Vec2();
_local2.SetV(m_u);
_local2.Multiply((m_impulse * _arg1));
return (_local2);
}
override public function SolvePositionConstraints():Boolean{
var _local1:b2Mat22;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local1 = m_body1.m_R;
_local2 = ((_local1.col1.x * m_localAnchor1.x) + (_local1.col2.x * m_localAnchor1.y));
_local3 = ((_local1.col1.y * m_localAnchor1.x) + (_local1.col2.y * m_localAnchor1.y));
_local1 = m_body2.m_R;
_local4 = ((_local1.col1.x * m_localAnchor2.x) + (_local1.col2.x * m_localAnchor2.y));
_local5 = ((_local1.col1.y * m_localAnchor2.x) + (_local1.col2.y * m_localAnchor2.y));
_local6 = (((m_body2.m_position.x + _local4) - m_body1.m_position.x) - _local2);
_local7 = (((m_body2.m_position.y + _local5) - m_body1.m_position.y) - _local3);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
_local6 = (_local6 / _local8);
_local7 = (_local7 / _local8);
_local9 = (_local8 - m_length);
_local9 = b2Math.b2Clamp(_local9, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local10 = (-(m_mass) * _local9);
m_u.Set(_local6, _local7);
_local11 = (_local10 * m_u.x);
_local12 = (_local10 * m_u.y);
m_body1.m_position.x = (m_body1.m_position.x - (m_body1.m_invMass * _local11));
m_body1.m_position.y = (m_body1.m_position.y - (m_body1.m_invMass * _local12));
m_body1.m_rotation = (m_body1.m_rotation - (m_body1.m_invI * ((_local2 * _local12) - (_local3 * _local11))));
m_body2.m_position.x = (m_body2.m_position.x + (m_body2.m_invMass * _local11));
m_body2.m_position.y = (m_body2.m_position.y + (m_body2.m_invMass * _local12));
m_body2.m_rotation = (m_body2.m_rotation + (m_body2.m_invI * ((_local4 * _local12) - (_local5 * _local11))));
m_body1.m_R.Set(m_body1.m_rotation);
m_body2.m_R.Set(m_body2.m_rotation);
return ((b2Math.b2Abs(_local9) < b2Settings.b2_linearSlop));
}
}
}//package Box2D.Dynamics.Joints
Section 40
//b2DistanceJointDef (Box2D.Dynamics.Joints.b2DistanceJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2DistanceJointDef extends b2JointDef {
public var anchorPoint2:b2Vec2;
public var anchorPoint1:b2Vec2;
public function b2DistanceJointDef(){
anchorPoint1 = new b2Vec2();
anchorPoint2 = new b2Vec2();
super();
type = b2Joint.e_distanceJoint;
}
}
}//package Box2D.Dynamics.Joints
Section 41
//b2GearJoint (Box2D.Dynamics.Joints.b2GearJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2GearJoint extends b2Joint {
public var m_impulse:Number;
public var m_mass:Number;
public var m_prismatic1:b2PrismaticJoint;
public var m_prismatic2:b2PrismaticJoint;
public var m_ground1:b2Body;
public var m_ground2:b2Body;
public var m_constant:Number;
public var m_revolute1:b2RevoluteJoint;
public var m_revolute2:b2RevoluteJoint;
public var m_groundAnchor1:b2Vec2;
public var m_groundAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_ratio:Number;
public var m_J:b2Jacobian;
public function b2GearJoint(_arg1:b2GearJointDef){
var _local2:Number;
var _local3:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_J = new b2Jacobian();
super(_arg1);
m_revolute1 = null;
m_prismatic1 = null;
m_revolute2 = null;
m_prismatic2 = null;
m_ground1 = _arg1.joint1.m_body1;
m_body1 = _arg1.joint1.m_body2;
if (_arg1.joint1.m_type == b2Joint.e_revoluteJoint){
m_revolute1 = (_arg1.joint1 as b2RevoluteJoint);
m_groundAnchor1.SetV(m_revolute1.m_localAnchor1);
m_localAnchor1.SetV(m_revolute1.m_localAnchor2);
_local2 = m_revolute1.GetJointAngle();
} else {
m_prismatic1 = (_arg1.joint1 as b2PrismaticJoint);
m_groundAnchor1.SetV(m_prismatic1.m_localAnchor1);
m_localAnchor1.SetV(m_prismatic1.m_localAnchor2);
_local2 = m_prismatic1.GetJointTranslation();
};
m_ground2 = _arg1.joint2.m_body1;
m_body2 = _arg1.joint2.m_body2;
if (_arg1.joint2.m_type == b2Joint.e_revoluteJoint){
m_revolute2 = (_arg1.joint2 as b2RevoluteJoint);
m_groundAnchor2.SetV(m_revolute2.m_localAnchor1);
m_localAnchor2.SetV(m_revolute2.m_localAnchor2);
_local3 = m_revolute2.GetJointAngle();
} else {
m_prismatic2 = (_arg1.joint2 as b2PrismaticJoint);
m_groundAnchor2.SetV(m_prismatic2.m_localAnchor1);
m_localAnchor2.SetV(m_prismatic2.m_localAnchor2);
_local3 = m_prismatic2.GetJointTranslation();
};
m_ratio = _arg1.ratio;
m_constant = (_local2 + (m_ratio * _local3));
m_impulse = 0;
}
override public function GetAnchor1():b2Vec2{
var _local1:b2Mat22;
_local1 = m_body1.m_R;
return (new b2Vec2((m_body1.m_position.x + ((_local1.col1.x * m_localAnchor1.x) + (_local1.col2.x * m_localAnchor1.y))), (m_body1.m_position.y + ((_local1.col1.y * m_localAnchor1.x) + (_local1.col2.y * m_localAnchor1.y)))));
}
override public function GetAnchor2():b2Vec2{
var _local1:b2Mat22;
_local1 = m_body2.m_R;
return (new b2Vec2((m_body2.m_position.x + ((_local1.col1.x * m_localAnchor2.x) + (_local1.col2.x * m_localAnchor2.y))), (m_body2.m_position.y + ((_local1.col1.y * m_localAnchor2.x) + (_local1.col2.y * m_localAnchor2.y)))));
}
override public function PrepareVelocitySolver():void{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:b2Mat22;
var _local10:b2Vec2;
var _local11:Number;
var _local12:Number;
_local1 = m_ground1;
_local2 = m_ground2;
_local3 = m_body1;
_local4 = m_body2;
_local12 = 0;
m_J.SetZero();
if (m_revolute1){
m_J.angular1 = -1;
_local12 = (_local12 + _local3.m_invI);
} else {
_local9 = _local1.m_R;
_local10 = m_prismatic1.m_localXAxis1;
_local5 = ((_local9.col1.x * _local10.x) + (_local9.col2.x * _local10.y));
_local6 = ((_local9.col1.y * _local10.x) + (_local9.col2.y * _local10.y));
_local9 = _local3.m_R;
_local7 = ((_local9.col1.x * m_localAnchor1.x) + (_local9.col2.x * m_localAnchor1.y));
_local8 = ((_local9.col1.y * m_localAnchor1.x) + (_local9.col2.y * m_localAnchor1.y));
_local11 = ((_local7 * _local6) - (_local8 * _local5));
m_J.linear1.Set(-(_local5), -(_local6));
m_J.angular1 = -(_local11);
_local12 = (_local12 + (_local3.m_invMass + ((_local3.m_invI * _local11) * _local11)));
};
if (m_revolute2){
m_J.angular2 = -(m_ratio);
_local12 = (_local12 + ((m_ratio * m_ratio) * _local4.m_invI));
} else {
_local9 = _local2.m_R;
_local10 = m_prismatic2.m_localXAxis1;
_local5 = ((_local9.col1.x * _local10.x) + (_local9.col2.x * _local10.y));
_local6 = ((_local9.col1.y * _local10.x) + (_local9.col2.y * _local10.y));
_local9 = _local4.m_R;
_local7 = ((_local9.col1.x * m_localAnchor2.x) + (_local9.col2.x * m_localAnchor2.y));
_local8 = ((_local9.col1.y * m_localAnchor2.x) + (_local9.col2.y * m_localAnchor2.y));
_local11 = ((_local7 * _local6) - (_local8 * _local5));
m_J.linear2.Set((-(m_ratio) * _local5), (-(m_ratio) * _local6));
m_J.angular2 = (-(m_ratio) * _local11);
_local12 = (_local12 + ((m_ratio * m_ratio) * (_local4.m_invMass + ((_local4.m_invI * _local11) * _local11))));
};
m_mass = (1 / _local12);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local3.m_invMass * m_impulse) * m_J.linear1.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local3.m_invMass * m_impulse) * m_J.linear1.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * m_impulse) * m_J.angular1));
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + ((_local4.m_invMass * m_impulse) * m_J.linear2.x));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + ((_local4.m_invMass * m_impulse) * m_J.linear2.y));
_local4.m_angularVelocity = (_local4.m_angularVelocity + ((_local4.m_invI * m_impulse) * m_J.angular2));
}
override public function GetReactionForce(_arg1:Number):b2Vec2{
return (new b2Vec2());
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local1 = 0;
_local2 = m_body1;
_local3 = m_body2;
if (m_revolute1){
_local4 = m_revolute1.GetJointAngle();
} else {
_local4 = m_prismatic1.GetJointTranslation();
};
if (m_revolute2){
_local5 = m_revolute2.GetJointAngle();
} else {
_local5 = m_prismatic2.GetJointTranslation();
};
_local6 = (m_constant - (_local4 + (m_ratio * _local5)));
_local7 = (-(m_mass) * _local6);
_local2.m_position.x = (_local2.m_position.x + ((_local2.m_invMass * _local7) * m_J.linear1.x));
_local2.m_position.y = (_local2.m_position.y + ((_local2.m_invMass * _local7) * m_J.linear1.y));
_local2.m_rotation = (_local2.m_rotation + ((_local2.m_invI * _local7) * m_J.angular1));
_local3.m_position.x = (_local3.m_position.x + ((_local3.m_invMass * _local7) * m_J.linear2.x));
_local3.m_position.y = (_local3.m_position.y + ((_local3.m_invMass * _local7) * m_J.linear2.y));
_local3.m_rotation = (_local3.m_rotation + ((_local3.m_invI * _local7) * m_J.angular2));
_local2.m_R.Set(_local2.m_rotation);
_local3.m_R.Set(_local3.m_rotation);
return ((_local1 < b2Settings.b2_linearSlop));
}
override public function GetReactionTorque(_arg1:Number):Number{
return (0);
}
public function GetRatio():Number{
return (m_ratio);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = m_J.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local5 = (-(m_mass) * _local4);
m_impulse = (m_impulse + _local5);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local2.m_invMass * _local5) * m_J.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local2.m_invMass * _local5) * m_J.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local2.m_invI * _local5) * m_J.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local3.m_invMass * _local5) * m_J.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local3.m_invMass * _local5) * m_J.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _local5) * m_J.angular2));
}
}
}//package Box2D.Dynamics.Joints
Section 42
//b2GearJointDef (Box2D.Dynamics.Joints.b2GearJointDef)
package Box2D.Dynamics.Joints {
public class b2GearJointDef extends b2JointDef {
public var joint2:b2Joint;
public var joint1:b2Joint;
public var ratio:Number;
public function b2GearJointDef(){
type = b2Joint.e_gearJoint;
joint1 = null;
joint2 = null;
ratio = 1;
}
}
}//package Box2D.Dynamics.Joints
Section 43
//b2Jacobian (Box2D.Dynamics.Joints.b2Jacobian)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2Jacobian {
public var linear1:b2Vec2;
public var linear2:b2Vec2;
public var angular2:Number;
public var angular1:Number;
public function b2Jacobian(){
linear1 = new b2Vec2();
linear2 = new b2Vec2();
super();
}
public function Set(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):void{
linear1.SetV(_arg1);
angular1 = _arg2;
linear2.SetV(_arg3);
angular2 = _arg4;
}
public function SetZero():void{
linear1.SetZero();
angular1 = 0;
linear2.SetZero();
angular2 = 0;
}
public function Compute(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):Number{
return ((((((linear1.x * _arg1.x) + (linear1.y * _arg1.y)) + (angular1 * _arg2)) + ((linear2.x * _arg3.x) + (linear2.y * _arg3.y))) + (angular2 * _arg4)));
}
}
}//package Box2D.Dynamics.Joints
Section 44
//b2Joint (Box2D.Dynamics.Joints.b2Joint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2Joint {
public var m_islandFlag:Boolean;
public var m_collideConnected:Boolean;
public var m_prev:b2Joint;
public var m_next:b2Joint;
public var m_type:int;
public var m_node1:b2JointNode;
public var m_node2:b2JointNode;
public var m_userData;
public var m_body1:b2Body;
public var m_body2:b2Body;
public static const e_unknownJoint:int = 0;
public static const e_inactiveLimit:int = 0;
public static const e_atUpperLimit:int = 2;
public static const e_atLowerLimit:int = 1;
public static const e_gearJoint:int = 6;
public static const e_revoluteJoint:int = 1;
public static const e_equalLimits:int = 3;
public static const e_distanceJoint:int = 3;
public static const e_pulleyJoint:int = 4;
public static const e_prismaticJoint:int = 2;
public static const e_mouseJoint:int = 5;
public function b2Joint(_arg1:b2JointDef){
m_node1 = new b2JointNode();
m_node2 = new b2JointNode();
super();
m_type = _arg1.type;
m_prev = null;
m_next = null;
m_body1 = _arg1.body1;
m_body2 = _arg1.body2;
m_collideConnected = _arg1.collideConnected;
m_islandFlag = false;
m_userData = _arg1.userData;
}
public function GetAnchor1():b2Vec2{
return (null);
}
public function GetAnchor2():b2Vec2{
return (null);
}
public function GetNext():b2Joint{
return (m_next);
}
public function GetType():int{
return (m_type);
}
public function GetBody2():b2Body{
return (m_body2);
}
public function PrepareVelocitySolver():void{
}
public function PreparePositionSolver():void{
}
public function GetReactionTorque(_arg1:Number):Number{
return (0);
}
public function GetUserData(){
return (m_userData);
}
public function GetReactionForce(_arg1:Number):b2Vec2{
return (null);
}
public function SolvePositionConstraints():Boolean{
return (false);
}
public function GetBody1():b2Body{
return (m_body1);
}
public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
}
public static function Destroy(_arg1:b2Joint, _arg2):void{
}
public static function Create(_arg1:b2JointDef, _arg2):b2Joint{
var _local3:b2Joint;
_local3 = null;
switch (_arg1.type){
case e_distanceJoint:
_local3 = new b2DistanceJoint((_arg1 as b2DistanceJointDef));
break;
case e_mouseJoint:
_local3 = new b2MouseJoint((_arg1 as b2MouseJointDef));
break;
case e_prismaticJoint:
_local3 = new b2PrismaticJoint((_arg1 as b2PrismaticJointDef));
break;
case e_revoluteJoint:
_local3 = new b2RevoluteJoint((_arg1 as b2RevoluteJointDef));
break;
case e_pulleyJoint:
_local3 = new b2PulleyJoint((_arg1 as b2PulleyJointDef));
break;
case e_gearJoint:
_local3 = new b2GearJoint((_arg1 as b2GearJointDef));
break;
default:
break;
};
return (_local3);
}
}
}//package Box2D.Dynamics.Joints
Section 45
//b2JointDef (Box2D.Dynamics.Joints.b2JointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointDef {
public var collideConnected:Boolean;
public var body1:b2Body;
public var body2:b2Body;
public var userData;
public var type:int;
public function b2JointDef(){
type = b2Joint.e_unknownJoint;
userData = null;
body1 = null;
body2 = null;
collideConnected = false;
}
}
}//package Box2D.Dynamics.Joints
Section 46
//b2JointNode (Box2D.Dynamics.Joints.b2JointNode)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointNode {
public var joint:b2Joint;
public var other:b2Body;
public var next:b2JointNode;
public var prev:b2JointNode;
}
}//package Box2D.Dynamics.Joints
Section 47
//b2MouseJoint (Box2D.Dynamics.Joints.b2MouseJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2MouseJoint extends b2Joint {
public var m_beta:Number;
public var m_target:b2Vec2;
public var m_impulse:b2Vec2;
public var m_ptpMass:b2Mat22;
public var m_localAnchor:b2Vec2;
private var K1:b2Mat22;
private var K2:b2Mat22;
private var K:b2Mat22;
public var m_gamma:Number;
public var m_C:b2Vec2;
public var m_maxForce:Number;
public function b2MouseJoint(_arg1:b2MouseJointDef){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
m_localAnchor = new b2Vec2();
m_target = new b2Vec2();
m_impulse = new b2Vec2();
m_ptpMass = new b2Mat22();
m_C = new b2Vec2();
super(_arg1);
m_target.SetV(_arg1.target);
_local2 = (m_target.x - m_body2.m_position.x);
_local3 = (m_target.y - m_body2.m_position.y);
m_localAnchor.x = ((_local2 * m_body2.m_R.col1.x) + (_local3 * m_body2.m_R.col1.y));
m_localAnchor.y = ((_local2 * m_body2.m_R.col2.x) + (_local3 * m_body2.m_R.col2.y));
m_maxForce = _arg1.maxForce;
m_impulse.SetZero();
_local4 = m_body2.m_mass;
_local5 = ((2 * b2Settings.b2_pi) * _arg1.frequencyHz);
_local6 = (((2 * _local4) * _arg1.dampingRatio) * _local5);
_local7 = ((_local4 * _local5) * _local5);
m_gamma = (1 / (_local6 + (_arg1.timeStep * _local7)));
m_beta = ((_arg1.timeStep * _local7) / (_local6 + (_arg1.timeStep * _local7)));
}
override public function GetAnchor1():b2Vec2{
return (m_target);
}
override public function GetAnchor2():b2Vec2{
var _local1:b2Vec2;
_local1 = b2Math.b2MulMV(m_body2.m_R, m_localAnchor);
_local1.Add(m_body2.m_position);
return (_local1);
}
override public function PrepareVelocitySolver():void{
var _local1:b2Body;
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = m_body2;
_local2 = _local1.m_R;
_local3 = ((_local2.col1.x * m_localAnchor.x) + (_local2.col2.x * m_localAnchor.y));
_local4 = ((_local2.col1.y * m_localAnchor.x) + (_local2.col2.y * m_localAnchor.y));
_local5 = _local1.m_invMass;
_local6 = _local1.m_invI;
K1.col1.x = _local5;
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = _local5;
K2.col1.x = ((_local6 * _local4) * _local4);
K2.col2.x = ((-(_local6) * _local3) * _local4);
K2.col1.y = ((-(_local6) * _local3) * _local4);
K2.col2.y = ((_local6 * _local3) * _local3);
K.SetM(K1);
K.AddM(K2);
K.col1.x = (K.col1.x + m_gamma);
K.col2.y = (K.col2.y + m_gamma);
K.Invert(m_ptpMass);
m_C.x = ((_local1.m_position.x + _local3) - m_target.x);
m_C.y = ((_local1.m_position.y + _local4) - m_target.y);
_local1.m_angularVelocity = (_local1.m_angularVelocity * 0.98);
_local7 = m_impulse.x;
_local8 = m_impulse.y;
_local1.m_linearVelocity.x = (_local1.m_linearVelocity.x + (_local5 * _local7));
_local1.m_linearVelocity.y = (_local1.m_linearVelocity.y + (_local5 * _local8));
_local1.m_angularVelocity = (_local1.m_angularVelocity + (_local6 * ((_local3 * _local8) - (_local4 * _local7))));
}
override public function GetReactionForce(_arg1:Number):b2Vec2{
var _local2:b2Vec2;
_local2 = new b2Vec2();
_local2.SetV(m_impulse);
_local2.Multiply(_arg1);
return (_local2);
}
override public function SolvePositionConstraints():Boolean{
return (true);
}
override public function GetReactionTorque(_arg1:Number):Number{
return (0);
}
public function SetTarget(_arg1:b2Vec2):void{
m_body2.WakeUp();
m_target = _arg1;
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local2 = m_body2;
_local3 = _local2.m_R;
_local4 = ((_local3.col1.x * m_localAnchor.x) + (_local3.col2.x * m_localAnchor.y));
_local5 = ((_local3.col1.y * m_localAnchor.x) + (_local3.col2.y * m_localAnchor.y));
_local6 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local5));
_local7 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local4));
_local3 = m_ptpMass;
_local8 = ((_local6 + ((m_beta * _arg1.inv_dt) * m_C.x)) + (m_gamma * m_impulse.x));
_local9 = ((_local7 + ((m_beta * _arg1.inv_dt) * m_C.y)) + (m_gamma * m_impulse.y));
_local10 = -(((_local3.col1.x * _local8) + (_local3.col2.x * _local9)));
_local11 = -(((_local3.col1.y * _local8) + (_local3.col2.y * _local9)));
_local12 = m_impulse.x;
_local13 = m_impulse.y;
m_impulse.x = (m_impulse.x + _local10);
m_impulse.y = (m_impulse.y + _local11);
_local14 = m_impulse.Length();
if (_local14 > (_arg1.dt * m_maxForce)){
m_impulse.Multiply(((_arg1.dt * m_maxForce) / _local14));
};
_local10 = (m_impulse.x - _local12);
_local11 = (m_impulse.y - _local13);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local10));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local11));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local4 * _local11) - (_local5 * _local10))));
}
}
}//package Box2D.Dynamics.Joints
Section 48
//b2MouseJointDef (Box2D.Dynamics.Joints.b2MouseJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2MouseJointDef extends b2JointDef {
public var frequencyHz:Number;
public var dampingRatio:Number;
public var maxForce:Number;
public var target:b2Vec2;
public var timeStep:Number;
public function b2MouseJointDef(){
target = new b2Vec2();
super();
type = b2Joint.e_mouseJoint;
maxForce = 0;
frequencyHz = 5;
dampingRatio = 0.7;
timeStep = (1 / 60);
}
}
}//package Box2D.Dynamics.Joints
Section 49
//b2PrismaticJoint (Box2D.Dynamics.Joints.b2PrismaticJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PrismaticJoint extends b2Joint {
public var m_initialAngle:Number;
public var m_lowerTranslation:Number;
public var m_localXAxis1:b2Vec2;
public var m_enableLimit:Boolean;
public var m_maxMotorForce:Number;
public var m_angularMass:Number;
public var m_localYAxis1:b2Vec2;
public var m_linearImpulse:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_motorMass:Number;
public var m_limitState:int;
public var m_linearMass:Number;
public var m_upperTranslation:Number;
public var m_angularImpulse:Number;
public var m_motorImpulse:Number;
public var m_motorJacobian:b2Jacobian;
public var m_limitImpulse:Number;
public var m_motorSpeed:Number;
public var m_enableMotor:Boolean;
public var m_limitPositionImpulse:Number;
public var m_linearJacobian:b2Jacobian;
public function b2PrismaticJoint(_arg1:b2PrismaticJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_localXAxis1 = new b2Vec2();
m_localYAxis1 = new b2Vec2();
m_linearJacobian = new b2Jacobian();
m_motorJacobian = new b2Jacobian();
super(_arg1);
_local2 = m_body1.m_R;
_local3 = (_arg1.anchorPoint.x - m_body1.m_position.x);
_local4 = (_arg1.anchorPoint.y - m_body1.m_position.y);
m_localAnchor1.Set(((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y)), ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y)));
_local2 = m_body2.m_R;
_local3 = (_arg1.anchorPoint.x - m_body2.m_position.x);
_local4 = (_arg1.anchorPoint.y - m_body2.m_position.y);
m_localAnchor2.Set(((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y)), ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y)));
_local2 = m_body1.m_R;
_local3 = _arg1.axis.x;
_local4 = _arg1.axis.y;
m_localXAxis1.Set(((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y)), ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y)));
m_localYAxis1.x = -(m_localXAxis1.y);
m_localYAxis1.y = m_localXAxis1.x;
m_initialAngle = (m_body2.m_rotation - m_body1.m_rotation);
m_linearJacobian.SetZero();
m_linearMass = 0;
m_linearImpulse = 0;
m_angularMass = 0;
m_angularImpulse = 0;
m_motorJacobian.SetZero();
m_motorMass = 0;
m_motorImpulse = 0;
m_limitImpulse = 0;
m_limitPositionImpulse = 0;
m_lowerTranslation = _arg1.lowerTranslation;
m_upperTranslation = _arg1.upperTranslation;
m_maxMotorForce = _arg1.motorForce;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
}
override public function GetAnchor1():b2Vec2{
var _local1:b2Body;
var _local2:b2Vec2;
_local1 = m_body1;
_local2 = new b2Vec2();
_local2.SetV(m_localAnchor1);
_local2.MulM(_local1.m_R);
_local2.Add(_local1.m_position);
return (_local2);
}
override public function GetAnchor2():b2Vec2{
var _local1:b2Body;
var _local2:b2Vec2;
_local1 = m_body2;
_local2 = new b2Vec2();
_local2.SetV(m_localAnchor2);
_local2.MulM(_local1.m_R);
_local2.Add(_local1.m_position);
return (_local2);
}
override public function PrepareVelocitySolver():void{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
_local1 = m_body1;
_local2 = m_body2;
_local3 = _local1.m_R;
_local4 = ((_local3.col1.x * m_localAnchor1.x) + (_local3.col2.x * m_localAnchor1.y));
_local5 = ((_local3.col1.y * m_localAnchor1.x) + (_local3.col2.y * m_localAnchor1.y));
_local3 = _local2.m_R;
_local6 = ((_local3.col1.x * m_localAnchor2.x) + (_local3.col2.x * m_localAnchor2.y));
_local7 = ((_local3.col1.y * m_localAnchor2.x) + (_local3.col2.y * m_localAnchor2.y));
_local8 = _local1.m_invMass;
_local9 = _local2.m_invMass;
_local10 = _local1.m_invI;
_local11 = _local2.m_invI;
_local3 = _local1.m_R;
_local12 = ((_local3.col1.x * m_localYAxis1.x) + (_local3.col2.x * m_localYAxis1.y));
_local13 = ((_local3.col1.y * m_localYAxis1.x) + (_local3.col2.y * m_localYAxis1.y));
_local14 = ((_local2.m_position.x + _local6) - _local1.m_position.x);
_local15 = ((_local2.m_position.y + _local7) - _local1.m_position.y);
m_linearJacobian.linear1.x = -(_local12);
m_linearJacobian.linear1.y = -(_local13);
m_linearJacobian.linear2.x = _local12;
m_linearJacobian.linear2.y = _local13;
m_linearJacobian.angular1 = -(((_local14 * _local13) - (_local15 * _local12)));
m_linearJacobian.angular2 = ((_local6 * _local13) - (_local7 * _local12));
m_linearMass = (((_local8 + ((_local10 * m_linearJacobian.angular1) * m_linearJacobian.angular1)) + _local9) + ((_local11 * m_linearJacobian.angular2) * m_linearJacobian.angular2));
m_linearMass = (1 / m_linearMass);
m_angularMass = (1 / (_local10 + _local11));
if (((m_enableLimit) || (m_enableMotor))){
_local3 = _local1.m_R;
_local16 = ((_local3.col1.x * m_localXAxis1.x) + (_local3.col2.x * m_localXAxis1.y));
_local17 = ((_local3.col1.y * m_localXAxis1.x) + (_local3.col2.y * m_localXAxis1.y));
m_motorJacobian.linear1.x = -(_local16);
m_motorJacobian.linear1.y = -(_local17);
m_motorJacobian.linear2.x = _local16;
m_motorJacobian.linear2.y = _local17;
m_motorJacobian.angular1 = -(((_local14 * _local17) - (_local15 * _local16)));
m_motorJacobian.angular2 = ((_local6 * _local17) - (_local7 * _local16));
m_motorMass = (((_local8 + ((_local10 * m_motorJacobian.angular1) * m_motorJacobian.angular1)) + _local9) + ((_local11 * m_motorJacobian.angular2) * m_motorJacobian.angular2));
m_motorMass = (1 / m_motorMass);
if (m_enableLimit){
_local18 = (_local14 - _local4);
_local19 = (_local15 - _local5);
_local20 = ((_local16 * _local18) + (_local17 * _local19));
if (b2Math.b2Abs((m_upperTranslation - m_lowerTranslation)) < (2 * b2Settings.b2_linearSlop)){
m_limitState = e_equalLimits;
} else {
if (_local20 <= m_lowerTranslation){
if (m_limitState != e_atLowerLimit){
m_limitImpulse = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local20 >= m_upperTranslation){
if (m_limitState != e_atUpperLimit){
m_limitImpulse = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_limitImpulse = 0;
};
};
};
};
};
if (m_enableMotor == false){
m_motorImpulse = 0;
};
if (m_enableLimit == false){
m_limitImpulse = 0;
};
if (b2World.s_enableWarmStarting){
_local21 = ((m_linearImpulse * m_linearJacobian.linear1.x) + ((m_motorImpulse + m_limitImpulse) * m_motorJacobian.linear1.x));
_local22 = ((m_linearImpulse * m_linearJacobian.linear1.y) + ((m_motorImpulse + m_limitImpulse) * m_motorJacobian.linear1.y));
_local23 = ((m_linearImpulse * m_linearJacobian.linear2.x) + ((m_motorImpulse + m_limitImpulse) * m_motorJacobian.linear2.x));
_local24 = ((m_linearImpulse * m_linearJacobian.linear2.y) + ((m_motorImpulse + m_limitImpulse) * m_motorJacobian.linear2.y));
_local25 = (((m_linearImpulse * m_linearJacobian.angular1) - m_angularImpulse) + ((m_motorImpulse + m_limitImpulse) * m_motorJacobian.angular1));
_local26 = (((m_linearImpulse * m_linearJacobian.angular2) + m_angularImpulse) + ((m_motorImpulse + m_limitImpulse) * m_motorJacobian.angular2));
_local1.m_linearVelocity.x = (_local1.m_linearVelocity.x + (_local8 * _local21));
_local1.m_linearVelocity.y = (_local1.m_linearVelocity.y + (_local8 * _local22));
_local1.m_angularVelocity = (_local1.m_angularVelocity + (_local10 * _local25));
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local9 * _local23));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local9 * _local24));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local11 * _local26));
} else {
m_linearImpulse = 0;
m_angularImpulse = 0;
m_limitImpulse = 0;
m_motorImpulse = 0;
};
m_limitPositionImpulse = 0;
}
public function GetJointTranslation():Number{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local1 = m_body1;
_local2 = m_body2;
_local3 = _local1.m_R;
_local4 = ((_local3.col1.x * m_localAnchor1.x) + (_local3.col2.x * m_localAnchor1.y));
_local5 = ((_local3.col1.y * m_localAnchor1.x) + (_local3.col2.y * m_localAnchor1.y));
_local3 = _local2.m_R;
_local6 = ((_local3.col1.x * m_localAnchor2.x) + (_local3.col2.x * m_localAnchor2.y));
_local7 = ((_local3.col1.y * m_localAnchor2.x) + (_local3.col2.y * m_localAnchor2.y));
_local8 = (_local1.m_position.x + _local4);
_local9 = (_local1.m_position.y + _local5);
_local10 = (_local2.m_position.x + _local6);
_local11 = (_local2.m_position.y + _local7);
_local12 = (_local10 - _local8);
_local13 = (_local11 - _local9);
_local3 = _local1.m_R;
_local14 = ((_local3.col1.x * m_localXAxis1.x) + (_local3.col2.x * m_localXAxis1.y));
_local15 = ((_local3.col1.y * m_localXAxis1.x) + (_local3.col2.y * m_localXAxis1.y));
_local16 = ((_local14 * _local12) + (_local15 * _local13));
return (_local16);
}
override public function GetReactionForce(_arg1:Number):b2Vec2{
var _local2:Number;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local2 = (_arg1 * m_limitImpulse);
_local3 = m_body1.m_R;
_local4 = (_local2 * ((_local3.col1.x * m_localXAxis1.x) + (_local3.col2.x * m_localXAxis1.y)));
_local5 = (_local2 * ((_local3.col1.y * m_localXAxis1.x) + (_local3.col2.y * m_localXAxis1.y)));
_local6 = (_local2 * ((_local3.col1.x * m_localYAxis1.x) + (_local3.col2.x * m_localYAxis1.y)));
_local7 = (_local2 * ((_local3.col1.y * m_localYAxis1.x) + (_local3.col2.y * m_localYAxis1.y)));
return (new b2Vec2((_local4 + _local6), (_local5 + _local7)));
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:b2Mat22;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
_local3 = m_body1;
_local4 = m_body2;
_local5 = _local3.m_invMass;
_local6 = _local4.m_invMass;
_local7 = _local3.m_invI;
_local8 = _local4.m_invI;
_local9 = _local3.m_R;
_local10 = ((_local9.col1.x * m_localAnchor1.x) + (_local9.col2.x * m_localAnchor1.y));
_local11 = ((_local9.col1.y * m_localAnchor1.x) + (_local9.col2.y * m_localAnchor1.y));
_local9 = _local4.m_R;
_local12 = ((_local9.col1.x * m_localAnchor2.x) + (_local9.col2.x * m_localAnchor2.y));
_local13 = ((_local9.col1.y * m_localAnchor2.x) + (_local9.col2.y * m_localAnchor2.y));
_local14 = (_local3.m_position.x + _local10);
_local15 = (_local3.m_position.y + _local11);
_local16 = (_local4.m_position.x + _local12);
_local17 = (_local4.m_position.y + _local13);
_local18 = (_local16 - _local14);
_local19 = (_local17 - _local15);
_local9 = _local3.m_R;
_local20 = ((_local9.col1.x * m_localYAxis1.x) + (_local9.col2.x * m_localYAxis1.y));
_local21 = ((_local9.col1.y * m_localYAxis1.x) + (_local9.col2.y * m_localYAxis1.y));
_local22 = ((_local20 * _local18) + (_local21 * _local19));
_local22 = b2Math.b2Clamp(_local22, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local23 = (-(m_linearMass) * _local22);
_local3.m_position.x = (_local3.m_position.x + ((_local5 * _local23) * m_linearJacobian.linear1.x));
_local3.m_position.y = (_local3.m_position.y + ((_local5 * _local23) * m_linearJacobian.linear1.y));
_local3.m_rotation = (_local3.m_rotation + ((_local7 * _local23) * m_linearJacobian.angular1));
_local4.m_position.x = (_local4.m_position.x + ((_local6 * _local23) * m_linearJacobian.linear2.x));
_local4.m_position.y = (_local4.m_position.y + ((_local6 * _local23) * m_linearJacobian.linear2.y));
_local4.m_rotation = (_local4.m_rotation + ((_local8 * _local23) * m_linearJacobian.angular2));
_local24 = b2Math.b2Abs(_local22);
_local25 = ((_local4.m_rotation - _local3.m_rotation) - m_initialAngle);
_local25 = b2Math.b2Clamp(_local25, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_angularMass) * _local25);
_local3.m_rotation = (_local3.m_rotation - (_local3.m_invI * _local26));
_local3.m_R.Set(_local3.m_rotation);
_local4.m_rotation = (_local4.m_rotation + (_local4.m_invI * _local26));
_local4.m_R.Set(_local4.m_rotation);
_local27 = b2Math.b2Abs(_local25);
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local9 = _local3.m_R;
_local10 = ((_local9.col1.x * m_localAnchor1.x) + (_local9.col2.x * m_localAnchor1.y));
_local11 = ((_local9.col1.y * m_localAnchor1.x) + (_local9.col2.y * m_localAnchor1.y));
_local9 = _local4.m_R;
_local12 = ((_local9.col1.x * m_localAnchor2.x) + (_local9.col2.x * m_localAnchor2.y));
_local13 = ((_local9.col1.y * m_localAnchor2.x) + (_local9.col2.y * m_localAnchor2.y));
_local14 = (_local3.m_position.x + _local10);
_local15 = (_local3.m_position.y + _local11);
_local16 = (_local4.m_position.x + _local12);
_local17 = (_local4.m_position.y + _local13);
_local18 = (_local16 - _local14);
_local19 = (_local17 - _local15);
_local9 = _local3.m_R;
_local28 = ((_local9.col1.x * m_localXAxis1.x) + (_local9.col2.x * m_localXAxis1.y));
_local29 = ((_local9.col1.y * m_localXAxis1.x) + (_local9.col2.y * m_localXAxis1.y));
_local30 = ((_local28 * _local18) + (_local29 * _local19));
_local31 = 0;
if (m_limitState == e_equalLimits){
_local1 = b2Math.b2Clamp(_local30, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local31 = (-(m_motorMass) * _local1);
_local24 = b2Math.b2Max(_local24, b2Math.b2Abs(_local25));
} else {
if (m_limitState == e_atLowerLimit){
_local1 = (_local30 - m_lowerTranslation);
_local24 = b2Math.b2Max(_local24, -(_local1));
_local1 = b2Math.b2Clamp((_local1 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local31 = (-(m_motorMass) * _local1);
_local2 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local31), 0);
_local31 = (m_limitPositionImpulse - _local2);
} else {
if (m_limitState == e_atUpperLimit){
_local1 = (_local30 - m_upperTranslation);
_local24 = b2Math.b2Max(_local24, _local1);
_local1 = b2Math.b2Clamp((_local1 - b2Settings.b2_linearSlop), 0, b2Settings.b2_maxLinearCorrection);
_local31 = (-(m_motorMass) * _local1);
_local2 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local31), 0);
_local31 = (m_limitPositionImpulse - _local2);
};
};
};
_local3.m_position.x = (_local3.m_position.x + ((_local5 * _local31) * m_motorJacobian.linear1.x));
_local3.m_position.y = (_local3.m_position.y + ((_local5 * _local31) * m_motorJacobian.linear1.y));
_local3.m_rotation = (_local3.m_rotation + ((_local7 * _local31) * m_motorJacobian.angular1));
_local3.m_R.Set(_local3.m_rotation);
_local4.m_position.x = (_local4.m_position.x + ((_local6 * _local31) * m_motorJacobian.linear2.x));
_local4.m_position.y = (_local4.m_position.y + ((_local6 * _local31) * m_motorJacobian.linear2.y));
_local4.m_rotation = (_local4.m_rotation + ((_local8 * _local31) * m_motorJacobian.angular2));
_local4.m_R.Set(_local4.m_rotation);
};
return ((((_local24 <= b2Settings.b2_linearSlop)) && ((_local27 <= b2Settings.b2_angularSlop))));
}
public function GetJointSpeed():Number{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:b2Vec2;
var _local17:b2Vec2;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local1 = m_body1;
_local2 = m_body2;
_local3 = _local1.m_R;
_local4 = ((_local3.col1.x * m_localAnchor1.x) + (_local3.col2.x * m_localAnchor1.y));
_local5 = ((_local3.col1.y * m_localAnchor1.x) + (_local3.col2.y * m_localAnchor1.y));
_local3 = _local2.m_R;
_local6 = ((_local3.col1.x * m_localAnchor2.x) + (_local3.col2.x * m_localAnchor2.y));
_local7 = ((_local3.col1.y * m_localAnchor2.x) + (_local3.col2.y * m_localAnchor2.y));
_local8 = (_local1.m_position.x + _local4);
_local9 = (_local1.m_position.y + _local5);
_local10 = (_local2.m_position.x + _local6);
_local11 = (_local2.m_position.y + _local7);
_local12 = (_local10 - _local8);
_local13 = (_local11 - _local9);
_local3 = _local1.m_R;
_local14 = ((_local3.col1.x * m_localXAxis1.x) + (_local3.col2.x * m_localXAxis1.y));
_local15 = ((_local3.col1.y * m_localXAxis1.x) + (_local3.col2.y * m_localXAxis1.y));
_local16 = _local1.m_linearVelocity;
_local17 = _local2.m_linearVelocity;
_local18 = _local1.m_angularVelocity;
_local19 = _local2.m_angularVelocity;
_local20 = (((_local12 * (-(_local18) * _local15)) + (_local13 * (_local18 * _local14))) + ((_local14 * (((_local17.x + (-(_local19) * _local7)) - _local16.x) - (-(_local18) * _local5))) + (_local15 * (((_local17.y + (_local19 * _local6)) - _local16.y) - (_local18 * _local4)))));
return (_local20);
}
public function SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
public function GetMotorForce(_arg1:Number):Number{
return ((_arg1 * m_motorImpulse));
}
public function SetMotorForce(_arg1:Number):void{
m_maxMotorForce = _arg1;
}
override public function GetReactionTorque(_arg1:Number):Number{
return ((_arg1 * m_angularImpulse));
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_invMass;
_local5 = _local3.m_invMass;
_local6 = _local2.m_invI;
_local7 = _local3.m_invI;
_local9 = m_linearJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local10 = (-(m_linearMass) * _local9);
m_linearImpulse = (m_linearImpulse + _local10);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local10) * m_linearJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local10) * m_linearJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local10) * m_linearJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local10) * m_linearJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local10) * m_linearJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local10) * m_linearJacobian.angular2));
_local11 = (_local3.m_angularVelocity - _local2.m_angularVelocity);
_local12 = (-(m_angularMass) * _local11);
m_angularImpulse = (m_angularImpulse + _local12);
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local6 * _local12));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local7 * _local12));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local13 = (m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity) - m_motorSpeed);
_local14 = (-(m_motorMass) * _local13);
_local15 = m_motorImpulse;
m_motorImpulse = b2Math.b2Clamp((m_motorImpulse + _local14), (-(_arg1.dt) * m_maxMotorForce), (_arg1.dt * m_maxMotorForce));
_local14 = (m_motorImpulse - _local15);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local14) * m_motorJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local14) * m_motorJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local14) * m_motorJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local14) * m_motorJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local14) * m_motorJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local14) * m_motorJacobian.angular2));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local16 = m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local17 = (-(m_motorMass) * _local16);
if (m_limitState == e_equalLimits){
m_limitImpulse = (m_limitImpulse + _local17);
} else {
if (m_limitState == e_atLowerLimit){
_local8 = m_limitImpulse;
m_limitImpulse = b2Math.b2Max((m_limitImpulse + _local17), 0);
_local17 = (m_limitImpulse - _local8);
} else {
if (m_limitState == e_atUpperLimit){
_local8 = m_limitImpulse;
m_limitImpulse = b2Math.b2Min((m_limitImpulse + _local17), 0);
_local17 = (m_limitImpulse - _local8);
};
};
};
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local17) * m_motorJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local17) * m_motorJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local17) * m_motorJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local17) * m_motorJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local17) * m_motorJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local17) * m_motorJacobian.angular2));
};
}
}
}//package Box2D.Dynamics.Joints
Section 50
//b2PrismaticJointDef (Box2D.Dynamics.Joints.b2PrismaticJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2PrismaticJointDef extends b2JointDef {
public var motorSpeed:Number;
public var anchorPoint:b2Vec2;
public var axis:b2Vec2;
public var upperTranslation:Number;
public var lowerTranslation:Number;
public var enableMotor:Boolean;
public var motorForce:Number;
public var enableLimit:Boolean;
public function b2PrismaticJointDef(){
type = b2Joint.e_prismaticJoint;
anchorPoint = new b2Vec2(0, 0);
axis = new b2Vec2(0, 0);
lowerTranslation = 0;
upperTranslation = 0;
motorForce = 0;
motorSpeed = 0;
enableLimit = false;
enableMotor = false;
}
}
}//package Box2D.Dynamics.Joints
Section 51
//b2PulleyJoint (Box2D.Dynamics.Joints.b2PulleyJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PulleyJoint extends b2Joint {
public var m_ground:b2Body;
public var m_maxLength2:Number;
public var m_limitState1:int;
public var m_maxLength1:Number;
public var m_pulleyImpulse:Number;
public var m_limitPositionImpulse1:Number;
public var m_constant:Number;
public var m_ratio:Number;
public var m_groundAnchor1:b2Vec2;
public var m_groundAnchor2:b2Vec2;
public var m_limitPositionImpulse2:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_limitState2:int;
public var m_limitMass2:Number;
public var m_limitMass1:Number;
public var m_limitImpulse2:Number;
public var m_u1:b2Vec2;
public var m_u2:b2Vec2;
public var m_limitImpulse1:Number;
public var m_pulleyMass:Number;
public static var b2_minPulleyLength:Number = 30;
public function b2PulleyJoint(_arg1:b2PulleyJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u1 = new b2Vec2();
m_u2 = new b2Vec2();
super(_arg1);
m_ground = m_body1.m_world.m_groundBody;
m_groundAnchor1.x = (_arg1.groundPoint1.x - m_ground.m_position.x);
m_groundAnchor1.y = (_arg1.groundPoint1.y - m_ground.m_position.y);
m_groundAnchor2.x = (_arg1.groundPoint2.x - m_ground.m_position.x);
m_groundAnchor2.y = (_arg1.groundPoint2.y - m_ground.m_position.y);
_local2 = m_body1.m_R;
_local3 = (_arg1.anchorPoint1.x - m_body1.m_position.x);
_local4 = (_arg1.anchorPoint1.y - m_body1.m_position.y);
m_localAnchor1.x = ((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y));
m_localAnchor1.y = ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y));
_local2 = m_body2.m_R;
_local3 = (_arg1.anchorPoint2.x - m_body2.m_position.x);
_local4 = (_arg1.anchorPoint2.y - m_body2.m_position.y);
m_localAnchor2.x = ((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y));
m_localAnchor2.y = ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y));
m_ratio = _arg1.ratio;
_local3 = (_arg1.groundPoint1.x - _arg1.anchorPoint1.x);
_local4 = (_arg1.groundPoint1.y - _arg1.anchorPoint1.y);
_local5 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
_local3 = (_arg1.groundPoint2.x - _arg1.anchorPoint2.x);
_local4 = (_arg1.groundPoint2.y - _arg1.anchorPoint2.y);
_local6 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
_local7 = b2Math.b2Max((0.5 * b2_minPulleyLength), _local5);
_local8 = b2Math.b2Max((0.5 * b2_minPulleyLength), _local6);
m_constant = (_local7 + (m_ratio * _local8));
m_maxLength1 = b2Math.b2Clamp(_arg1.maxLength1, _local7, (m_constant - (m_ratio * b2_minPulleyLength)));
m_maxLength2 = b2Math.b2Clamp(_arg1.maxLength2, _local8, ((m_constant - b2_minPulleyLength) / m_ratio));
m_pulleyImpulse = 0;
m_limitImpulse1 = 0;
m_limitImpulse2 = 0;
}
public function GetLength1():Number{
var _local1:b2Mat22;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body1.m_R;
_local2 = (m_body1.m_position.x + ((_local1.col1.x * m_localAnchor1.x) + (_local1.col2.x * m_localAnchor1.y)));
_local3 = (m_body1.m_position.y + ((_local1.col1.y * m_localAnchor1.x) + (_local1.col2.y * m_localAnchor1.y)));
_local4 = (_local2 - (m_ground.m_position.x + m_groundAnchor1.x));
_local5 = (_local3 - (m_ground.m_position.y + m_groundAnchor1.y));
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
override public function GetAnchor1():b2Vec2{
var _local1:b2Mat22;
_local1 = m_body1.m_R;
return (new b2Vec2((m_body1.m_position.x + ((_local1.col1.x * m_localAnchor1.x) + (_local1.col2.x * m_localAnchor1.y))), (m_body1.m_position.y + ((_local1.col1.y * m_localAnchor1.x) + (_local1.col2.y * m_localAnchor1.y)))));
}
override public function GetAnchor2():b2Vec2{
var _local1:b2Mat22;
_local1 = m_body2.m_R;
return (new b2Vec2((m_body2.m_position.x + ((_local1.col1.x * m_localAnchor2.x) + (_local1.col2.x * m_localAnchor2.y))), (m_body2.m_position.y + ((_local1.col1.y * m_localAnchor2.x) + (_local1.col2.y * m_localAnchor2.y)))));
}
override public function PrepareVelocitySolver():void{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
_local1 = m_body1;
_local2 = m_body2;
_local3 = _local1.m_R;
_local4 = ((_local3.col1.x * m_localAnchor1.x) + (_local3.col2.x * m_localAnchor1.y));
_local5 = ((_local3.col1.y * m_localAnchor1.x) + (_local3.col2.y * m_localAnchor1.y));
_local3 = _local2.m_R;
_local6 = ((_local3.col1.x * m_localAnchor2.x) + (_local3.col2.x * m_localAnchor2.y));
_local7 = ((_local3.col1.y * m_localAnchor2.x) + (_local3.col2.y * m_localAnchor2.y));
_local8 = (_local1.m_position.x + _local4);
_local9 = (_local1.m_position.y + _local5);
_local10 = (_local2.m_position.x + _local6);
_local11 = (_local2.m_position.y + _local7);
_local12 = (m_ground.m_position.x + m_groundAnchor1.x);
_local13 = (m_ground.m_position.y + m_groundAnchor1.y);
_local14 = (m_ground.m_position.x + m_groundAnchor2.x);
_local15 = (m_ground.m_position.y + m_groundAnchor2.y);
m_u1.Set((_local8 - _local12), (_local9 - _local13));
m_u2.Set((_local10 - _local14), (_local11 - _local15));
_local16 = m_u1.Length();
_local17 = m_u2.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local16));
} else {
m_u1.SetZero();
};
if (_local17 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local17));
} else {
m_u2.SetZero();
};
if (_local16 < m_maxLength1){
m_limitState1 = e_inactiveLimit;
m_limitImpulse1 = 0;
} else {
m_limitState1 = e_atUpperLimit;
m_limitPositionImpulse1 = 0;
};
if (_local17 < m_maxLength2){
m_limitState2 = e_inactiveLimit;
m_limitImpulse2 = 0;
} else {
m_limitState2 = e_atUpperLimit;
m_limitPositionImpulse2 = 0;
};
_local18 = ((_local4 * m_u1.y) - (_local5 * m_u1.x));
_local19 = ((_local6 * m_u2.y) - (_local7 * m_u2.x));
m_limitMass1 = (_local1.m_invMass + ((_local1.m_invI * _local18) * _local18));
m_limitMass2 = (_local2.m_invMass + ((_local2.m_invI * _local19) * _local19));
m_pulleyMass = (m_limitMass1 + ((m_ratio * m_ratio) * m_limitMass2));
m_limitMass1 = (1 / m_limitMass1);
m_limitMass2 = (1 / m_limitMass2);
m_pulleyMass = (1 / m_pulleyMass);
_local20 = ((-(m_pulleyImpulse) - m_limitImpulse1) * m_u1.x);
_local21 = ((-(m_pulleyImpulse) - m_limitImpulse1) * m_u1.y);
_local22 = (((-(m_ratio) * m_pulleyImpulse) - m_limitImpulse2) * m_u2.x);
_local23 = (((-(m_ratio) * m_pulleyImpulse) - m_limitImpulse2) * m_u2.y);
_local1.m_linearVelocity.x = (_local1.m_linearVelocity.x + (_local1.m_invMass * _local20));
_local1.m_linearVelocity.y = (_local1.m_linearVelocity.y + (_local1.m_invMass * _local21));
_local1.m_angularVelocity = (_local1.m_angularVelocity + (_local1.m_invI * ((_local4 * _local21) - (_local5 * _local20))));
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local22));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local23));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local6 * _local23) - (_local7 * _local22))));
}
override public function GetReactionForce(_arg1:Number):b2Vec2{
return (new b2Vec2());
}
override public function SolvePositionConstraints():Boolean{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
_local1 = m_body1;
_local2 = m_body2;
_local4 = (m_ground.m_position.x + m_groundAnchor1.x);
_local5 = (m_ground.m_position.y + m_groundAnchor1.y);
_local6 = (m_ground.m_position.x + m_groundAnchor2.x);
_local7 = (m_ground.m_position.y + m_groundAnchor2.y);
_local21 = 0;
_local3 = _local1.m_R;
_local8 = ((_local3.col1.x * m_localAnchor1.x) + (_local3.col2.x * m_localAnchor1.y));
_local9 = ((_local3.col1.y * m_localAnchor1.x) + (_local3.col2.y * m_localAnchor1.y));
_local3 = _local2.m_R;
_local10 = ((_local3.col1.x * m_localAnchor2.x) + (_local3.col2.x * m_localAnchor2.y));
_local11 = ((_local3.col1.y * m_localAnchor2.x) + (_local3.col2.y * m_localAnchor2.y));
_local12 = (_local1.m_position.x + _local8);
_local13 = (_local1.m_position.y + _local9);
_local14 = (_local2.m_position.x + _local10);
_local15 = (_local2.m_position.y + _local11);
m_u1.Set((_local12 - _local4), (_local13 - _local5));
m_u2.Set((_local14 - _local6), (_local15 - _local7));
_local16 = m_u1.Length();
_local17 = m_u2.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local16));
} else {
m_u1.SetZero();
};
if (_local17 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local17));
} else {
m_u2.SetZero();
};
_local18 = ((m_constant - _local16) - (m_ratio * _local17));
_local21 = b2Math.b2Max(_local21, Math.abs(_local18));
_local18 = b2Math.b2Clamp(_local18, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local19 = (-(m_pulleyMass) * _local18);
_local12 = (-(_local19) * m_u1.x);
_local13 = (-(_local19) * m_u1.y);
_local14 = ((-(m_ratio) * _local19) * m_u2.x);
_local15 = ((-(m_ratio) * _local19) * m_u2.y);
_local1.m_position.x = (_local1.m_position.x + (_local1.m_invMass * _local12));
_local1.m_position.y = (_local1.m_position.y + (_local1.m_invMass * _local13));
_local1.m_rotation = (_local1.m_rotation + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12))));
_local2.m_position.x = (_local2.m_position.x + (_local2.m_invMass * _local14));
_local2.m_position.y = (_local2.m_position.y + (_local2.m_invMass * _local15));
_local2.m_rotation = (_local2.m_rotation + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14))));
_local1.m_R.Set(_local1.m_rotation);
_local2.m_R.Set(_local2.m_rotation);
if (m_limitState1 == e_atUpperLimit){
_local3 = _local1.m_R;
_local8 = ((_local3.col1.x * m_localAnchor1.x) + (_local3.col2.x * m_localAnchor1.y));
_local9 = ((_local3.col1.y * m_localAnchor1.x) + (_local3.col2.y * m_localAnchor1.y));
_local12 = (_local1.m_position.x + _local8);
_local13 = (_local1.m_position.y + _local9);
m_u1.Set((_local12 - _local4), (_local13 - _local5));
_local16 = m_u1.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.x = (m_u1.x * (1 / _local16));
m_u1.y = (m_u1.y * (1 / _local16));
} else {
m_u1.SetZero();
};
_local18 = (m_maxLength1 - _local16);
_local21 = b2Math.b2Max(_local21, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_limitMass1) * _local18);
_local20 = m_limitPositionImpulse1;
m_limitPositionImpulse1 = b2Math.b2Max(0, (m_limitPositionImpulse1 + _local19));
_local19 = (m_limitPositionImpulse1 - _local20);
_local12 = (-(_local19) * m_u1.x);
_local13 = (-(_local19) * m_u1.y);
_local1.m_position.x = (_local1.m_position.x + (_local1.m_invMass * _local12));
_local1.m_position.y = (_local1.m_position.y + (_local1.m_invMass * _local13));
_local1.m_rotation = (_local1.m_rotation + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12))));
_local1.m_R.Set(_local1.m_rotation);
};
if (m_limitState2 == e_atUpperLimit){
_local3 = _local2.m_R;
_local10 = ((_local3.col1.x * m_localAnchor2.x) + (_local3.col2.x * m_localAnchor2.y));
_local11 = ((_local3.col1.y * m_localAnchor2.x) + (_local3.col2.y * m_localAnchor2.y));
_local14 = (_local2.m_position.x + _local10);
_local15 = (_local2.m_position.y + _local11);
m_u2.Set((_local14 - _local6), (_local15 - _local7));
_local17 = m_u2.Length();
if (_local17 > b2Settings.b2_linearSlop){
m_u2.x = (m_u2.x * (1 / _local17));
m_u2.y = (m_u2.y * (1 / _local17));
} else {
m_u2.SetZero();
};
_local18 = (m_maxLength2 - _local17);
_local21 = b2Math.b2Max(_local21, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_limitMass2) * _local18);
_local20 = m_limitPositionImpulse2;
m_limitPositionImpulse2 = b2Math.b2Max(0, (m_limitPositionImpulse2 + _local19));
_local19 = (m_limitPositionImpulse2 - _local20);
_local14 = (-(_local19) * m_u2.x);
_local15 = (-(_local19) * m_u2.y);
_local2.m_position.x = (_local2.m_position.x + (_local2.m_invMass * _local14));
_local2.m_position.y = (_local2.m_position.y + (_local2.m_invMass * _local15));
_local2.m_rotation = (_local2.m_rotation + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14))));
_local2.m_R.Set(_local2.m_rotation);
};
return ((_local21 < b2Settings.b2_linearSlop));
}
public function GetGroundPoint1():b2Vec2{
return (new b2Vec2((m_ground.m_position.x + m_groundAnchor1.x), (m_ground.m_position.y + m_groundAnchor1.y)));
}
public function GetGroundPoint2():b2Vec2{
return (new b2Vec2((m_ground.m_position.x + m_groundAnchor2.x), (m_ground.m_position.y + m_groundAnchor2.y)));
}
override public function GetReactionTorque(_arg1:Number):Number{
return (0);
}
public function GetRatio():Number{
return (m_ratio);
}
public function GetLength2():Number{
var _local1:b2Mat22;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body2.m_R;
_local2 = (m_body2.m_position.x + ((_local1.col1.x * m_localAnchor2.x) + (_local1.col2.x * m_localAnchor2.y)));
_local3 = (m_body2.m_position.y + ((_local1.col1.y * m_localAnchor2.x) + (_local1.col2.y * m_localAnchor2.y)));
_local4 = (_local2 - (m_ground.m_position.x + m_groundAnchor2.x));
_local5 = (_local3 - (m_ground.m_position.y + m_groundAnchor2.y));
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_R;
_local5 = ((_local4.col1.x * m_localAnchor1.x) + (_local4.col2.x * m_localAnchor1.y));
_local6 = ((_local4.col1.y * m_localAnchor1.x) + (_local4.col2.y * m_localAnchor1.y));
_local4 = _local3.m_R;
_local7 = ((_local4.col1.x * m_localAnchor2.x) + (_local4.col2.x * m_localAnchor2.y));
_local8 = ((_local4.col1.y * m_localAnchor2.x) + (_local4.col2.y * m_localAnchor2.y));
_local9 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local10 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local11 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local8));
_local12 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local7));
_local17 = (-(((m_u1.x * _local9) + (m_u1.y * _local10))) - (m_ratio * ((m_u2.x * _local11) + (m_u2.y * _local12))));
_local18 = (-(m_pulleyMass) * _local17);
m_pulleyImpulse = (m_pulleyImpulse + _local18);
_local13 = (-(_local18) * m_u1.x);
_local14 = (-(_local18) * m_u1.y);
_local15 = ((-(m_ratio) * _local18) * m_u2.x);
_local16 = ((-(m_ratio) * _local18) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local13));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local14));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local14) - (_local6 * _local13))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local15));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local16));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local7 * _local16) - (_local8 * _local15))));
if (m_limitState1 == e_atUpperLimit){
_local9 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local10 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local17 = -(((m_u1.x * _local9) + (m_u1.y * _local10)));
_local18 = (-(m_limitMass1) * _local17);
_local19 = m_limitImpulse1;
m_limitImpulse1 = b2Math.b2Max(0, (m_limitImpulse1 + _local18));
_local18 = (m_limitImpulse1 - _local19);
_local13 = (-(_local18) * m_u1.x);
_local14 = (-(_local18) * m_u1.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local13));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local14));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local14) - (_local6 * _local13))));
};
if (m_limitState2 == e_atUpperLimit){
_local11 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local8));
_local12 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local7));
_local17 = -(((m_u2.x * _local11) + (m_u2.y * _local12)));
_local18 = (-(m_limitMass2) * _local17);
_local19 = m_limitImpulse2;
m_limitImpulse2 = b2Math.b2Max(0, (m_limitImpulse2 + _local18));
_local18 = (m_limitImpulse2 - _local19);
_local15 = (-(_local18) * m_u2.x);
_local16 = (-(_local18) * m_u2.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local15));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local16));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local7 * _local16) - (_local8 * _local15))));
};
}
}
}//package Box2D.Dynamics.Joints
Section 52
//b2PulleyJointDef (Box2D.Dynamics.Joints.b2PulleyJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2PulleyJointDef extends b2JointDef {
public var groundPoint1:b2Vec2;
public var groundPoint2:b2Vec2;
public var ratio:Number;
public var maxLength1:Number;
public var maxLength2:Number;
public var anchorPoint1:b2Vec2;
public var anchorPoint2:b2Vec2;
public function b2PulleyJointDef(){
groundPoint1 = new b2Vec2();
groundPoint2 = new b2Vec2();
anchorPoint1 = new b2Vec2();
anchorPoint2 = new b2Vec2();
super();
type = b2Joint.e_pulleyJoint;
groundPoint1.Set(-1, 1);
groundPoint2.Set(1, 1);
anchorPoint1.Set(-1, 0);
anchorPoint2.Set(1, 0);
maxLength1 = (0.5 * b2PulleyJoint.b2_minPulleyLength);
maxLength2 = (0.5 * b2PulleyJoint.b2_minPulleyLength);
ratio = 1;
collideConnected = true;
}
}
}//package Box2D.Dynamics.Joints
Section 53
//b2RevoluteJoint (Box2D.Dynamics.Joints.b2RevoluteJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2RevoluteJoint extends b2Joint {
public var m_intialAngle:Number;
public var m_enableLimit:Boolean;
public var m_limitState:int;
public var m_ptpMass:b2Mat22;
public var m_motorMass:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
private var K1:b2Mat22;
private var K2:b2Mat22;
private var K3:b2Mat22;
private var K:b2Mat22;
public var m_limitImpulse:Number;
public var m_motorImpulse:Number;
public var m_enableMotor:Boolean;
public var m_lowerAngle:Number;
public var m_limitPositionImpulse:Number;
public var m_maxMotorTorque:Number;
public var m_upperAngle:Number;
public var m_motorSpeed:Number;
public var m_ptpImpulse:b2Vec2;
public static var tImpulse:b2Vec2 = new b2Vec2();
public function b2RevoluteJoint(_arg1:b2RevoluteJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
K3 = new b2Mat22();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_ptpImpulse = new b2Vec2();
m_ptpMass = new b2Mat22();
super(_arg1);
_local2 = m_body1.m_R;
_local3 = (_arg1.anchorPoint.x - m_body1.m_position.x);
_local4 = (_arg1.anchorPoint.y - m_body1.m_position.y);
m_localAnchor1.x = ((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y));
m_localAnchor1.y = ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y));
_local2 = m_body2.m_R;
_local3 = (_arg1.anchorPoint.x - m_body2.m_position.x);
_local4 = (_arg1.anchorPoint.y - m_body2.m_position.y);
m_localAnchor2.x = ((_local3 * _local2.col1.x) + (_local4 * _local2.col1.y));
m_localAnchor2.y = ((_local3 * _local2.col2.x) + (_local4 * _local2.col2.y));
m_intialAngle = (m_body2.m_rotation - m_body1.m_rotation);
m_ptpImpulse.Set(0, 0);
m_motorImpulse = 0;
m_limitImpulse = 0;
m_limitPositionImpulse = 0;
m_lowerAngle = _arg1.lowerAngle;
m_upperAngle = _arg1.upperAngle;
m_maxMotorTorque = _arg1.motorTorque;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
}
override public function GetAnchor1():b2Vec2{
var _local1:b2Mat22;
_local1 = m_body1.m_R;
return (new b2Vec2((m_body1.m_position.x + ((_local1.col1.x * m_localAnchor1.x) + (_local1.col2.x * m_localAnchor1.y))), (m_body1.m_position.y + ((_local1.col1.y * m_localAnchor1.x) + (_local1.col2.y * m_localAnchor1.y)))));
}
override public function GetAnchor2():b2Vec2{
var _local1:b2Mat22;
_local1 = m_body2.m_R;
return (new b2Vec2((m_body2.m_position.x + ((_local1.col1.x * m_localAnchor2.x) + (_local1.col2.x * m_localAnchor2.y))), (m_body2.m_position.y + ((_local1.col1.y * m_localAnchor2.x) + (_local1.col2.y * m_localAnchor2.y)))));
}
override public function PrepareVelocitySolver():void{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
_local1 = m_body1;
_local2 = m_body2;
_local3 = _local1.m_R;
_local4 = ((_local3.col1.x * m_localAnchor1.x) + (_local3.col2.x * m_localAnchor1.y));
_local5 = ((_local3.col1.y * m_localAnchor1.x) + (_local3.col2.y * m_localAnchor1.y));
_local3 = _local2.m_R;
_local6 = ((_local3.col1.x * m_localAnchor2.x) + (_local3.col2.x * m_localAnchor2.y));
_local7 = ((_local3.col1.y * m_localAnchor2.x) + (_local3.col2.y * m_localAnchor2.y));
_local8 = _local1.m_invMass;
_local9 = _local2.m_invMass;
_local10 = _local1.m_invI;
_local11 = _local2.m_invI;
K1.col1.x = (_local8 + _local9);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local8 + _local9);
K2.col1.x = ((_local10 * _local5) * _local5);
K2.col2.x = ((-(_local10) * _local4) * _local5);
K2.col1.y = ((-(_local10) * _local4) * _local5);
K2.col2.y = ((_local10 * _local4) * _local4);
K3.col1.x = ((_local11 * _local7) * _local7);
K3.col2.x = ((-(_local11) * _local6) * _local7);
K3.col1.y = ((-(_local11) * _local6) * _local7);
K3.col2.y = ((_local11 * _local6) * _local6);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Invert(m_ptpMass);
m_motorMass = (1 / (_local10 + _local11));
if (m_enableMotor == false){
m_motorImpulse = 0;
};
if (m_enableLimit){
_local12 = ((_local2.m_rotation - _local1.m_rotation) - m_intialAngle);
if (b2Math.b2Abs((m_upperAngle - m_lowerAngle)) < (2 * b2Settings.b2_angularSlop)){
m_limitState = e_equalLimits;
} else {
if (_local12 <= m_lowerAngle){
if (m_limitState != e_atLowerLimit){
m_limitImpulse = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local12 >= m_upperAngle){
if (m_limitState != e_atUpperLimit){
m_limitImpulse = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_limitImpulse = 0;
};
};
};
} else {
m_limitImpulse = 0;
};
if (b2World.s_enableWarmStarting){
_local1.m_linearVelocity.x = (_local1.m_linearVelocity.x - (_local8 * m_ptpImpulse.x));
_local1.m_linearVelocity.y = (_local1.m_linearVelocity.y - (_local8 * m_ptpImpulse.y));
_local1.m_angularVelocity = (_local1.m_angularVelocity - (_local10 * ((((_local4 * m_ptpImpulse.y) - (_local5 * m_ptpImpulse.x)) + m_motorImpulse) + m_limitImpulse)));
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local9 * m_ptpImpulse.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local9 * m_ptpImpulse.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local11 * ((((_local6 * m_ptpImpulse.y) - (_local7 * m_ptpImpulse.x)) + m_motorImpulse) + m_limitImpulse)));
} else {
m_ptpImpulse.SetZero();
m_motorImpulse = 0;
m_limitImpulse = 0;
};
m_limitPositionImpulse = 0;
}
override public function GetReactionForce(_arg1:Number):b2Vec2{
var _local2:b2Vec2;
_local2 = m_ptpImpulse.Copy();
_local2.Multiply(_arg1);
return (_local2);
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:b2Mat22;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_local3 = m_body1;
_local4 = m_body2;
_local5 = 0;
_local6 = _local3.m_R;
_local7 = ((_local6.col1.x * m_localAnchor1.x) + (_local6.col2.x * m_localAnchor1.y));
_local8 = ((_local6.col1.y * m_localAnchor1.x) + (_local6.col2.y * m_localAnchor1.y));
_local6 = _local4.m_R;
_local9 = ((_local6.col1.x * m_localAnchor2.x) + (_local6.col2.x * m_localAnchor2.y));
_local10 = ((_local6.col1.y * m_localAnchor2.x) + (_local6.col2.y * m_localAnchor2.y));
_local11 = (_local3.m_position.x + _local7);
_local12 = (_local3.m_position.y + _local8);
_local13 = (_local4.m_position.x + _local9);
_local14 = (_local4.m_position.y + _local10);
_local15 = (_local13 - _local11);
_local16 = (_local14 - _local12);
_local5 = Math.sqrt(((_local15 * _local15) + (_local16 * _local16)));
_local17 = _local3.m_invMass;
_local18 = _local4.m_invMass;
_local19 = _local3.m_invI;
_local20 = _local4.m_invI;
K1.col1.x = (_local17 + _local18);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local17 + _local18);
K2.col1.x = ((_local19 * _local8) * _local8);
K2.col2.x = ((-(_local19) * _local7) * _local8);
K2.col1.y = ((-(_local19) * _local7) * _local8);
K2.col2.y = ((_local19 * _local7) * _local7);
K3.col1.x = ((_local20 * _local10) * _local10);
K3.col2.x = ((-(_local20) * _local9) * _local10);
K3.col1.y = ((-(_local20) * _local9) * _local10);
K3.col2.y = ((_local20 * _local9) * _local9);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Solve(tImpulse, -(_local15), -(_local16));
_local21 = tImpulse.x;
_local22 = tImpulse.y;
_local3.m_position.x = (_local3.m_position.x - (_local3.m_invMass * _local21));
_local3.m_position.y = (_local3.m_position.y - (_local3.m_invMass * _local22));
_local3.m_rotation = (_local3.m_rotation - (_local3.m_invI * ((_local7 * _local22) - (_local8 * _local21))));
_local3.m_R.Set(_local3.m_rotation);
_local4.m_position.x = (_local4.m_position.x + (_local4.m_invMass * _local21));
_local4.m_position.y = (_local4.m_position.y + (_local4.m_invMass * _local22));
_local4.m_rotation = (_local4.m_rotation + (_local4.m_invI * ((_local9 * _local22) - (_local10 * _local21))));
_local4.m_R.Set(_local4.m_rotation);
_local23 = 0;
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local24 = ((_local4.m_rotation - _local3.m_rotation) - m_intialAngle);
_local25 = 0;
if (m_limitState == e_equalLimits){
_local2 = b2Math.b2Clamp(_local24, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
_local25 = (-(m_motorMass) * _local2);
_local23 = b2Math.b2Abs(_local2);
} else {
if (m_limitState == e_atLowerLimit){
_local2 = (_local24 - m_lowerAngle);
_local23 = b2Math.b2Max(0, -(_local2));
_local2 = b2Math.b2Clamp((_local2 + b2Settings.b2_angularSlop), -(b2Settings.b2_maxAngularCorrection), 0);
_local25 = (-(m_motorMass) * _local2);
_local1 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local25), 0);
_local25 = (m_limitPositionImpulse - _local1);
} else {
if (m_limitState == e_atUpperLimit){
_local2 = (_local24 - m_upperAngle);
_local23 = b2Math.b2Max(0, _local2);
_local2 = b2Math.b2Clamp((_local2 - b2Settings.b2_angularSlop), 0, b2Settings.b2_maxAngularCorrection);
_local25 = (-(m_motorMass) * _local2);
_local1 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local25), 0);
_local25 = (m_limitPositionImpulse - _local1);
};
};
};
_local3.m_rotation = (_local3.m_rotation - (_local3.m_invI * _local25));
_local3.m_R.Set(_local3.m_rotation);
_local4.m_rotation = (_local4.m_rotation + (_local4.m_invI * _local25));
_local4.m_R.Set(_local4.m_rotation);
};
return ((((_local5 <= b2Settings.b2_linearSlop)) && ((_local23 <= b2Settings.b2_angularSlop))));
}
public function GetJointSpeed():Number{
return ((m_body2.m_angularVelocity - m_body1.m_angularVelocity));
}
public function SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
public function SetMotorTorque(_arg1:Number):void{
m_maxMotorTorque = _arg1;
}
public function GetJointAngle():Number{
return ((m_body2.m_rotation - m_body1.m_rotation));
}
public function GetMotorTorque(_arg1:Number):Number{
return ((_arg1 * m_motorImpulse));
}
override public function GetReactionTorque(_arg1:Number):Number{
return ((_arg1 * m_limitImpulse));
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_R;
_local5 = ((_local4.col1.x * m_localAnchor1.x) + (_local4.col2.x * m_localAnchor1.y));
_local6 = ((_local4.col1.y * m_localAnchor1.x) + (_local4.col2.y * m_localAnchor1.y));
_local4 = _local3.m_R;
_local7 = ((_local4.col1.x * m_localAnchor2.x) + (_local4.col2.x * m_localAnchor2.y));
_local8 = ((_local4.col1.y * m_localAnchor2.x) + (_local4.col2.y * m_localAnchor2.y));
_local10 = (((_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local8)) - _local2.m_linearVelocity.x) - (-(_local2.m_angularVelocity) * _local6));
_local11 = (((_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local7)) - _local2.m_linearVelocity.y) - (_local2.m_angularVelocity * _local5));
_local12 = -(((m_ptpMass.col1.x * _local10) + (m_ptpMass.col2.x * _local11)));
_local13 = -(((m_ptpMass.col1.y * _local10) + (m_ptpMass.col2.y * _local11)));
m_ptpImpulse.x = (m_ptpImpulse.x + _local12);
m_ptpImpulse.y = (m_ptpImpulse.y + _local13);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - (_local2.m_invMass * _local12));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - (_local2.m_invMass * _local13));
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local2.m_invI * ((_local5 * _local13) - (_local6 * _local12))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local12));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local13));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local7 * _local13) - (_local8 * _local12))));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local14 = ((_local3.m_angularVelocity - _local2.m_angularVelocity) - m_motorSpeed);
_local15 = (-(m_motorMass) * _local14);
_local16 = m_motorImpulse;
m_motorImpulse = b2Math.b2Clamp((m_motorImpulse + _local15), (-(_arg1.dt) * m_maxMotorTorque), (_arg1.dt * m_maxMotorTorque));
_local15 = (m_motorImpulse - _local16);
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local2.m_invI * _local15));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * _local15));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local17 = (_local3.m_angularVelocity - _local2.m_angularVelocity);
_local18 = (-(m_motorMass) * _local17);
if (m_limitState == e_equalLimits){
m_limitImpulse = (m_limitImpulse + _local18);
} else {
if (m_limitState == e_atLowerLimit){
_local9 = m_limitImpulse;
m_limitImpulse = b2Math.b2Max((m_limitImpulse + _local18), 0);
_local18 = (m_limitImpulse - _local9);
} else {
if (m_limitState == e_atUpperLimit){
_local9 = m_limitImpulse;
m_limitImpulse = b2Math.b2Min((m_limitImpulse + _local18), 0);
_local18 = (m_limitImpulse - _local9);
};
};
};
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local2.m_invI * _local18));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * _local18));
};
}
}
}//package Box2D.Dynamics.Joints
Section 54
//b2RevoluteJointDef (Box2D.Dynamics.Joints.b2RevoluteJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2RevoluteJointDef extends b2JointDef {
public var upperAngle:Number;
public var lowerAngle:Number;
public var motorSpeed:Number;
public var anchorPoint:b2Vec2;
public var motorTorque:Number;
public var enableMotor:Boolean;
public var enableLimit:Boolean;
public function b2RevoluteJointDef(){
type = b2Joint.e_revoluteJoint;
anchorPoint = new b2Vec2(0, 0);
lowerAngle = 0;
upperAngle = 0;
motorTorque = 0;
motorSpeed = 0;
enableLimit = false;
enableMotor = false;
}
}
}//package Box2D.Dynamics.Joints
Section 55
//b2Body (Box2D.Dynamics.b2Body)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Common.*;
public class b2Body {
public var m_next:b2Body;
public var m_mass:Number;
public var m_contactList:b2ContactNode;
public var m_angularVelocity:Number;
public var m_rotation:Number;
public var m_shapeList:b2Shape;
public var m_R:b2Mat22;
public var m_force:b2Vec2;
public var m_torque:Number;
public var m_rotation0:Number;
public var m_userData;
public var m_linearVelocity:b2Vec2;
public var m_invMass:Number;
public var m_position:b2Vec2;
public var m_flags:uint;
public var m_invI:Number;
public var m_linearDamping:Number;
public var m_prev:b2Body;
public var m_world:b2World;
public var m_angularDamping:Number;
public var m_position0:b2Vec2;
private var sMat0:b2Mat22;
public var m_center:b2Vec2;
public var m_sleepTime:Number;
public var m_shapeCount:int;
public var m_I:Number;
public var m_jointList:b2JointNode;
public static var e_frozenFlag:uint = 2;
public static var e_sleepFlag:uint = 8;
public static var e_islandFlag:uint = 4;
public static var e_destroyFlag:uint = 32;
public static var e_allowSleepFlag:uint = 16;
public static var e_staticFlag:uint = 1;
public function b2Body(_arg1:b2BodyDef, _arg2:b2World){
var _local3:int;
var _local4:b2ShapeDef;
var _local5:b2MassData;
var _local6:Array;
var _local7:b2Vec2;
var _local8:b2Shape;
sMat0 = new b2Mat22();
m_position = new b2Vec2();
m_R = new b2Mat22(0);
m_position0 = new b2Vec2();
super();
m_flags = 0;
m_position.SetV(_arg1.position);
m_rotation = _arg1.rotation;
m_R.Set(m_rotation);
m_position0.SetV(m_position);
m_rotation0 = m_rotation;
m_world = _arg2;
m_linearDamping = b2Math.b2Clamp((1 - _arg1.linearDamping), 0, 1);
m_angularDamping = b2Math.b2Clamp((1 - _arg1.angularDamping), 0, 1);
m_force = new b2Vec2(0, 0);
m_torque = 0;
m_mass = 0;
_local6 = new Array(b2Settings.b2_maxShapesPerBody);
_local3 = 0;
while (_local3 < b2Settings.b2_maxShapesPerBody) {
_local6[_local3] = new b2MassData();
_local3++;
};
m_shapeCount = 0;
m_center = new b2Vec2(0, 0);
_local3 = 0;
while (_local3 < b2Settings.b2_maxShapesPerBody) {
_local4 = _arg1.shapes[_local3];
if (_local4 == null){
break;
};
_local5 = _local6[_local3];
_local4.ComputeMass(_local5);
m_mass = (m_mass + _local5.mass);
m_center.x = (m_center.x + (_local5.mass * (_local4.localPosition.x + _local5.center.x)));
m_center.y = (m_center.y + (_local5.mass * (_local4.localPosition.y + _local5.center.y)));
m_shapeCount++;
_local3++;
};
if (m_mass > 0){
m_center.Multiply((1 / m_mass));
m_position.Add(b2Math.b2MulMV(m_R, m_center));
} else {
m_flags = (m_flags | e_staticFlag);
};
m_I = 0;
_local3 = 0;
while (_local3 < m_shapeCount) {
_local4 = _arg1.shapes[_local3];
_local5 = _local6[_local3];
m_I = (m_I + _local5.I);
_local7 = b2Math.SubtractVV(b2Math.AddVV(_local4.localPosition, _local5.center), m_center);
m_I = (m_I + (_local5.mass * b2Math.b2Dot(_local7, _local7)));
_local3++;
};
if (m_mass > 0){
m_invMass = (1 / m_mass);
} else {
m_invMass = 0;
};
if ((((m_I > 0)) && ((_arg1.preventRotation == false)))){
m_invI = (1 / m_I);
} else {
m_I = 0;
m_invI = 0;
};
m_linearVelocity = b2Math.AddVV(_arg1.linearVelocity, b2Math.b2CrossFV(_arg1.angularVelocity, m_center));
m_angularVelocity = _arg1.angularVelocity;
m_jointList = null;
m_contactList = null;
m_prev = null;
m_next = null;
m_shapeList = null;
_local3 = 0;
while (_local3 < m_shapeCount) {
_local4 = _arg1.shapes[_local3];
_local8 = b2Shape.Create(_local4, this, m_center);
_local8.m_next = m_shapeList;
m_shapeList = _local8;
_local3++;
};
m_sleepTime = 0;
if (_arg1.allowSleep){
m_flags = (m_flags | e_allowSleepFlag);
};
if (_arg1.isSleeping){
m_flags = (m_flags | e_sleepFlag);
};
if ((((m_flags & e_sleepFlag)) || ((m_invMass == 0)))){
m_linearVelocity.Set(0, 0);
m_angularVelocity = 0;
};
m_userData = _arg1.userData;
}
public function SetCenterPosition(_arg1:b2Vec2, _arg2:Number):void{
var _local3:b2Shape;
if (IsFrozen()){
return;
};
m_rotation = _arg2;
m_R.Set(m_rotation);
m_position.SetV(_arg1);
m_position0.SetV(m_position);
m_rotation0 = m_rotation;
_local3 = m_shapeList;
while (_local3 != null) {
_local3.Synchronize(m_position, m_R, m_position, m_R);
_local3 = _local3.m_next;
};
m_world.m_broadPhase.Commit();
}
public function GetWorldPoint(_arg1:b2Vec2):b2Vec2{
return (b2Math.AddVV(m_position, b2Math.b2MulMV(m_R, _arg1)));
}
public function SetLinearVelocity(_arg1:b2Vec2):void{
m_linearVelocity.SetV(_arg1);
}
public function IsFrozen():Boolean{
return (((m_flags & e_frozenFlag) == e_frozenFlag));
}
public function IsSleeping():Boolean{
return (((m_flags & e_sleepFlag) == e_sleepFlag));
}
public function QuickSyncShapes():void{
var _local1:b2Shape;
_local1 = m_shapeList;
while (_local1 != null) {
_local1.QuickSync(m_position, m_R);
_local1 = _local1.m_next;
};
}
public function GetInertia():Number{
return (m_I);
}
public function GetLocalVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulTMV(m_R, _arg1));
}
public function GetLinearVelocity():b2Vec2{
return (m_linearVelocity);
}
public function GetJointList():b2JointNode{
return (m_jointList);
}
public function GetRotationMatrix():b2Mat22{
return (m_R);
}
public function Freeze():void{
var _local1:b2Shape;
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local1 = m_shapeList;
while (_local1 != null) {
_local1.DestroyProxy();
_local1 = _local1.m_next;
};
}
public function SetAngularVelocity(_arg1:Number):void{
m_angularVelocity = _arg1;
}
public function SynchronizeShapes():void{
var _local1:b2Shape;
sMat0.Set(m_rotation0);
_local1 = m_shapeList;
while (_local1 != null) {
_local1.Synchronize(m_position0, sMat0, m_position, m_R);
_local1 = _local1.m_next;
};
}
public function ApplyForce(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping() == false){
m_force.Add(_arg1);
m_torque = (m_torque + b2Math.b2CrossVV(b2Math.SubtractVV(_arg2, m_position), _arg1));
};
}
public function GetOriginPosition():b2Vec2{
return (b2Math.SubtractVV(m_position, b2Math.b2MulMV(m_R, m_center)));
}
public function ApplyImpulse(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping() == false){
m_linearVelocity.Add(b2Math.MulFV(m_invMass, _arg1));
m_angularVelocity = (m_angularVelocity + (m_invI * b2Math.b2CrossVV(b2Math.SubtractVV(_arg2, m_position), _arg1)));
};
}
public function GetContactList():b2ContactNode{
return (m_contactList);
}
public function GetAngularVelocity():Number{
return (m_angularVelocity);
}
public function GetMass():Number{
return (m_mass);
}
public function GetShapeList():b2Shape{
return (m_shapeList);
}
public function SetOriginPosition(_arg1:b2Vec2, _arg2:Number):void{
var _local3:b2Shape;
if (IsFrozen()){
return;
};
m_rotation = _arg2;
m_R.Set(m_rotation);
m_position = b2Math.AddVV(_arg1, b2Math.b2MulMV(m_R, m_center));
m_position0.SetV(m_position);
m_rotation0 = m_rotation;
_local3 = m_shapeList;
while (_local3 != null) {
_local3.Synchronize(m_position, m_R, m_position, m_R);
_local3 = _local3.m_next;
};
m_world.m_broadPhase.Commit();
}
public function GetLocalPoint(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulTMV(m_R, b2Math.SubtractVV(_arg1, m_position)));
}
public function GetRotation():Number{
return (m_rotation);
}
public function IsStatic():Boolean{
return (((m_flags & e_staticFlag) == e_staticFlag));
}
public function Destroy():void{
var _local1:b2Shape;
var _local2:b2Shape;
_local1 = m_shapeList;
while (_local1) {
_local2 = _local1;
_local1 = _local1.m_next;
b2Shape.Destroy(_local2);
};
}
public function GetWorldVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulMV(m_R, _arg1));
}
public function GetNext():b2Body{
return (m_next);
}
public function IsConnected(_arg1:b2Body):Boolean{
var _local2:b2JointNode;
_local2 = m_jointList;
while (_local2 != null) {
if (_local2.other == _arg1){
return ((_local2.joint.m_collideConnected == false));
};
_local2 = _local2.next;
};
return (false);
}
public function GetUserData(){
return (m_userData);
}
public function GetCenterPosition():b2Vec2{
return (m_position);
}
public function ApplyTorque(_arg1:Number):void{
if (IsSleeping() == false){
m_torque = (m_torque + _arg1);
};
}
public function AllowSleeping(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_allowSleepFlag);
} else {
m_flags = (m_flags & ~(e_allowSleepFlag));
WakeUp();
};
}
public function WakeUp():void{
m_flags = (m_flags & ~(e_sleepFlag));
m_sleepTime = 0;
}
}
}//package Box2D.Dynamics
Section 56
//b2BodyDef (Box2D.Dynamics.b2BodyDef)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.*;
public class b2BodyDef {
public var angularDamping:Number;
public var rotation:Number;
public var allowSleep:Boolean;
public var userData;
public var linearDamping:Number;
public var angularVelocity:Number;
public var linearVelocity:b2Vec2;
public var position:b2Vec2;
public var shapes:Array;
public var isSleeping:Boolean;
public var preventRotation:Boolean;
public function b2BodyDef(){
var _local1:int;
shapes = new Array();
super();
userData = null;
_local1 = 0;
while (_local1 < b2Settings.b2_maxShapesPerBody) {
shapes[_local1] = null;
_local1++;
};
position = new b2Vec2(0, 0);
rotation = 0;
linearVelocity = new b2Vec2(0, 0);
angularVelocity = 0;
linearDamping = 0;
angularDamping = 0;
allowSleep = true;
isSleeping = false;
preventRotation = false;
}
public function AddShape(_arg1:b2ShapeDef):void{
var _local2:int;
_local2 = 0;
while (_local2 < b2Settings.b2_maxShapesPerBody) {
if (shapes[_local2] == null){
shapes[_local2] = _arg1;
break;
};
_local2++;
};
}
}
}//package Box2D.Dynamics
Section 57
//b2CollisionFilter (Box2D.Dynamics.b2CollisionFilter)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
public class b2CollisionFilter {
public static var b2_defaultFilter:b2CollisionFilter = new (b2CollisionFilter);
;
public function ShouldCollide(_arg1:b2Shape, _arg2:b2Shape):Boolean{
var _local3:Boolean;
if ((((_arg1.m_groupIndex == _arg2.m_groupIndex)) && (!((_arg1.m_groupIndex == 0))))){
return ((_arg1.m_groupIndex > 0));
};
_local3 = ((!(((_arg1.m_maskBits & _arg2.m_categoryBits) == 0))) && (!(((_arg1.m_categoryBits & _arg2.m_maskBits) == 0))));
return (_local3);
}
}
}//package Box2D.Dynamics
Section 58
//b2ContactManager (Box2D.Dynamics.b2ContactManager)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Collision.*;
public class b2ContactManager extends b2PairCallback {
public var m_world:b2World;
public var m_destroyImmediate:Boolean;
public var m_nullContact:b2NullContact;
public function b2ContactManager(){
m_nullContact = new b2NullContact();
super();
m_world = null;
m_destroyImmediate = false;
}
public function Collide():void{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2ContactNode;
var _local4:b2ContactNode;
var _local5:b2Contact;
var _local6:int;
var _local7:int;
_local5 = m_world.m_contactList;
while (_local5 != null) {
if (((_local5.m_shape1.m_body.IsSleeping()) && (_local5.m_shape2.m_body.IsSleeping()))){
} else {
_local6 = _local5.GetManifoldCount();
_local5.Evaluate();
_local7 = _local5.GetManifoldCount();
if ((((_local6 == 0)) && ((_local7 > 0)))){
_local1 = _local5.m_shape1.m_body;
_local2 = _local5.m_shape2.m_body;
_local3 = _local5.m_node1;
_local4 = _local5.m_node2;
_local3.contact = _local5;
_local3.other = _local2;
_local3.prev = null;
_local3.next = _local1.m_contactList;
if (_local3.next != null){
_local3.next.prev = _local5.m_node1;
};
_local1.m_contactList = _local5.m_node1;
_local4.contact = _local5;
_local4.other = _local1;
_local4.prev = null;
_local4.next = _local2.m_contactList;
if (_local4.next != null){
_local4.next.prev = _local4;
};
_local2.m_contactList = _local4;
} else {
if ((((_local6 > 0)) && ((_local7 == 0)))){
_local1 = _local5.m_shape1.m_body;
_local2 = _local5.m_shape2.m_body;
_local3 = _local5.m_node1;
_local4 = _local5.m_node2;
if (_local3.prev){
_local3.prev.next = _local3.next;
};
if (_local3.next){
_local3.next.prev = _local3.prev;
};
if (_local3 == _local1.m_contactList){
_local1.m_contactList = _local3.next;
};
_local3.prev = null;
_local3.next = null;
if (_local4.prev){
_local4.prev.next = _local4.next;
};
if (_local4.next){
_local4.next.prev = _local4.prev;
};
if (_local4 == _local2.m_contactList){
_local2.m_contactList = _local4.next;
};
_local4.prev = null;
_local4.next = null;
};
};
};
_local5 = _local5.m_next;
};
}
public function DestroyContact(_arg1:b2Contact):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2ContactNode;
var _local5:b2ContactNode;
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_world.m_contactList){
m_world.m_contactList = _arg1.m_next;
};
if (_arg1.GetManifoldCount() > 0){
_local2 = _arg1.m_shape1.m_body;
_local3 = _arg1.m_shape2.m_body;
_local4 = _arg1.m_node1;
_local5 = _arg1.m_node2;
_local2.WakeUp();
_local3.WakeUp();
if (_local4.prev){
_local4.prev.next = _local4.next;
};
if (_local4.next){
_local4.next.prev = _local4.prev;
};
if (_local4 == _local2.m_contactList){
_local2.m_contactList = _local4.next;
};
_local4.prev = null;
_local4.next = null;
if (_local5.prev){
_local5.prev.next = _local5.next;
};
if (_local5.next){
_local5.next.prev = _local5.prev;
};
if (_local5 == _local3.m_contactList){
_local3.m_contactList = _local5.next;
};
_local5.prev = null;
_local5.next = null;
};
b2Contact.Destroy(_arg1, m_world.m_blockAllocator);
m_world.m_contactCount--;
}
override public function PairAdded(_arg1, _arg2){
var _local3:b2Shape;
var _local4:b2Shape;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2Contact;
var _local8:b2Shape;
var _local9:b2Body;
_local3 = (_arg1 as b2Shape);
_local4 = (_arg2 as b2Shape);
_local5 = _local3.m_body;
_local6 = _local4.m_body;
if (((_local5.IsStatic()) && (_local6.IsStatic()))){
return (m_nullContact);
};
if (_local3.m_body == _local4.m_body){
return (m_nullContact);
};
if (_local6.IsConnected(_local5)){
return (m_nullContact);
};
if (((!((m_world.m_filter == null))) && ((m_world.m_filter.ShouldCollide(_local3, _local4) == false)))){
return (m_nullContact);
};
if (_local6.m_invMass == 0){
_local8 = _local3;
_local3 = _local4;
_local4 = _local8;
_local9 = _local5;
_local5 = _local6;
_local6 = _local9;
};
_local7 = b2Contact.Create(_local3, _local4, m_world.m_blockAllocator);
if (_local7 == null){
return (m_nullContact);
};
_local7.m_prev = null;
_local7.m_next = m_world.m_contactList;
if (m_world.m_contactList != null){
m_world.m_contactList.m_prev = _local7;
};
m_world.m_contactList = _local7;
m_world.m_contactCount++;
return (_local7);
}
public function CleanContactList():void{
var _local1:b2Contact;
var _local2:b2Contact;
_local1 = m_world.m_contactList;
while (_local1 != null) {
_local2 = _local1;
_local1 = _local1.m_next;
if ((_local2.m_flags & b2Contact.e_destroyFlag)){
DestroyContact(_local2);
_local2 = null;
};
};
}
override public function PairRemoved(_arg1, _arg2, _arg3):void{
var _local4:b2Contact;
if (_arg3 == null){
return;
};
_local4 = (_arg3 as b2Contact);
if (_local4 != m_nullContact){
if (m_destroyImmediate == true){
DestroyContact(_local4);
_local4 = null;
} else {
_local4.m_flags = (_local4.m_flags | b2Contact.e_destroyFlag);
};
};
}
}
}//package Box2D.Dynamics
Section 59
//b2Island (Box2D.Dynamics.b2Island)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Common.*;
public class b2Island {
public var m_positionError:Number;
public var m_bodyCapacity:int;
public var m_bodies:Array;
public var m_joints:Array;
public var m_jointCapacity:int;
public var m_contactCount:int;
public var m_contacts:Array;
public var m_contactCapacity:int;
public var m_jointCount:int;
public var m_allocator;
public var m_bodyCount:int;
public static var m_positionIterationCount:uint;
public function b2Island(_arg1:int, _arg2:int, _arg3:int, _arg4):void{
var _local5:int;
super();
m_bodyCapacity = _arg1;
m_contactCapacity = _arg2;
m_jointCapacity = _arg3;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_bodies = new Array(_arg1);
_local5 = 0;
while (_local5 < _arg1) {
m_bodies[_local5] = null;
_local5++;
};
m_contacts = new Array(_arg2);
_local5 = 0;
while (_local5 < _arg2) {
m_contacts[_local5] = null;
_local5++;
};
m_joints = new Array(_arg3);
_local5 = 0;
while (_local5 < _arg3) {
m_joints[_local5] = null;
_local5++;
};
m_allocator = _arg4;
}
public function AddBody(_arg1:b2Body):void{
var _local2 = m_bodyCount++;
m_bodies[_local2] = _arg1;
}
public function AddJoint(_arg1:b2Joint):void{
var _local2 = m_jointCount++;
m_joints[_local2] = _arg1;
}
public function Solve(_arg1:b2TimeStep, _arg2:b2Vec2):void{
var _local3:int;
var _local4:b2Body;
var _local5:b2ContactSolver;
var _local6:int;
var _local7:Boolean;
var _local8:Boolean;
var _local9:Boolean;
_local3 = 0;
while (_local3 < m_bodyCount) {
_local4 = m_bodies[_local3];
if (_local4.m_invMass == 0){
} else {
_local4.m_linearVelocity.Add(b2Math.MulFV(_arg1.dt, b2Math.AddVV(_arg2, b2Math.MulFV(_local4.m_invMass, _local4.m_force))));
_local4.m_angularVelocity = (_local4.m_angularVelocity + ((_arg1.dt * _local4.m_invI) * _local4.m_torque));
_local4.m_linearVelocity.Multiply(_local4.m_linearDamping);
_local4.m_angularVelocity = (_local4.m_angularVelocity * _local4.m_angularDamping);
_local4.m_position0.SetV(_local4.m_position);
_local4.m_rotation0 = _local4.m_rotation;
};
_local3++;
};
_local5 = new b2ContactSolver(m_contacts, m_contactCount, m_allocator);
_local5.PreSolve();
_local3 = 0;
while (_local3 < m_jointCount) {
m_joints[_local3].PrepareVelocitySolver();
_local3++;
};
_local3 = 0;
while (_local3 < _arg1.iterations) {
_local5.SolveVelocityConstraints();
_local6 = 0;
while (_local6 < m_jointCount) {
m_joints[_local6].SolveVelocityConstraints(_arg1);
_local6++;
};
_local3++;
};
_local3 = 0;
while (_local3 < m_bodyCount) {
_local4 = m_bodies[_local3];
if (_local4.m_invMass == 0){
} else {
_local4.m_position.x = (_local4.m_position.x + (_arg1.dt * _local4.m_linearVelocity.x));
_local4.m_position.y = (_local4.m_position.y + (_arg1.dt * _local4.m_linearVelocity.y));
_local4.m_rotation = (_local4.m_rotation + (_arg1.dt * _local4.m_angularVelocity));
_local4.m_R.Set(_local4.m_rotation);
};
_local3++;
};
_local3 = 0;
while (_local3 < m_jointCount) {
m_joints[_local3].PreparePositionSolver();
_local3++;
};
if (b2World.s_enablePositionCorrection){
m_positionIterationCount = 0;
while (m_positionIterationCount < _arg1.iterations) {
_local7 = _local5.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);
_local8 = true;
_local3 = 0;
while (_local3 < m_jointCount) {
_local9 = m_joints[_local3].SolvePositionConstraints();
_local8 = ((_local8) && (_local9));
_local3++;
};
if (((_local7) && (_local8))){
break;
};
m_positionIterationCount++;
};
};
_local5.PostSolve();
_local3 = 0;
while (_local3 < m_bodyCount) {
_local4 = m_bodies[_local3];
if (_local4.m_invMass == 0){
} else {
_local4.m_R.Set(_local4.m_rotation);
_local4.SynchronizeShapes();
_local4.m_force.Set(0, 0);
_local4.m_torque = 0;
};
_local3++;
};
}
public function AddContact(_arg1:b2Contact):void{
var _local2 = m_contactCount++;
m_contacts[_local2] = _arg1;
}
public function Clear():void{
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
}
public function UpdateSleep(_arg1:Number):void{
var _local2:int;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local4 = Number.MAX_VALUE;
_local5 = (b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance);
_local6 = (b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance);
_local2 = 0;
while (_local2 < m_bodyCount) {
_local3 = m_bodies[_local2];
if (_local3.m_invMass == 0){
} else {
if ((_local3.m_flags & b2Body.e_allowSleepFlag) == 0){
_local3.m_sleepTime = 0;
_local4 = 0;
};
if (((((((_local3.m_flags & b2Body.e_allowSleepFlag) == 0)) || (((_local3.m_angularVelocity * _local3.m_angularVelocity) > _local6)))) || ((b2Math.b2Dot(_local3.m_linearVelocity, _local3.m_linearVelocity) > _local5)))){
_local3.m_sleepTime = 0;
_local4 = 0;
} else {
_local3.m_sleepTime = (_local3.m_sleepTime + _arg1);
_local4 = b2Math.b2Min(_local4, _local3.m_sleepTime);
};
};
_local2++;
};
if (_local4 >= b2Settings.b2_timeToSleep){
_local2 = 0;
while (_local2 < m_bodyCount) {
_local3 = m_bodies[_local2];
_local3.m_flags = (_local3.m_flags | b2Body.e_sleepFlag);
_local2++;
};
};
}
}
}//package Box2D.Dynamics
Section 60
//b2TimeStep (Box2D.Dynamics.b2TimeStep)
package Box2D.Dynamics {
public class b2TimeStep {
public var dt:Number;
public var iterations:int;
public var inv_dt:Number;
}
}//package Box2D.Dynamics
Section 61
//b2World (Box2D.Dynamics.b2World)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
public class b2World {
public var m_filter:b2CollisionFilter;
public var m_blockAllocator;
public var m_contactList:b2Contact;
public var m_broadPhase:b2BroadPhase;
public var m_allowSleep:Boolean;
public var m_jointCount:int;
public var m_bodyCount:int;
public var m_listener:b2WorldListener;
private var step:b2TimeStep;
public var m_positionIterationCount:int;
public var m_groundBody:b2Body;
public var m_contactCount:int;
public var m_bodyDestroyList:b2Body;
public var m_bodyList:b2Body;
public var m_stackAllocator;
public var m_gravity:b2Vec2;
public var m_jointList:b2Joint;
public var m_contactManager:b2ContactManager;
public static var s_enableWarmStarting:int = 1;
public static var s_enablePositionCorrection:int = 1;
public function b2World(_arg1:b2AABB, _arg2:b2Vec2, _arg3:Boolean){
var _local4:b2BodyDef;
step = new b2TimeStep();
m_contactManager = new b2ContactManager();
super();
m_listener = null;
m_filter = b2CollisionFilter.b2_defaultFilter;
m_bodyList = null;
m_contactList = null;
m_jointList = null;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_bodyDestroyList = null;
m_allowSleep = _arg3;
m_gravity = _arg2;
m_contactManager.m_world = this;
m_broadPhase = new b2BroadPhase(_arg1, m_contactManager);
_local4 = new b2BodyDef();
m_groundBody = CreateBody(_local4);
}
public function SetListener(_arg1:b2WorldListener):void{
m_listener = _arg1;
}
public function DestroyBody(_arg1:b2Body):void{
if ((_arg1.m_flags & b2Body.e_destroyFlag)){
return;
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_bodyList){
m_bodyList = _arg1.m_next;
};
_arg1.m_flags = (_arg1.m_flags | b2Body.e_destroyFlag);
m_bodyCount--;
_arg1.m_prev = null;
_arg1.m_next = m_bodyDestroyList;
m_bodyDestroyList = _arg1;
}
public function GetGroundBody():b2Body{
return (m_groundBody);
}
public function Query(_arg1:b2AABB, _arg2:Array, _arg3:int):int{
var _local4:Array;
var _local5:int;
var _local6:int;
_local4 = new Array();
_local5 = m_broadPhase.QueryAABB(_arg1, _local4, _arg3);
_local6 = 0;
while (_local6 < _local5) {
_arg2[_local6] = (_local4[_local6] as b2Shape);
_local6++;
};
return (_local5);
}
public function CleanBodyList():void{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2JointNode;
var _local4:b2JointNode;
m_contactManager.m_destroyImmediate = true;
_local1 = m_bodyDestroyList;
while (_local1) {
_local2 = _local1;
_local1 = _local1.m_next;
_local3 = _local2.m_jointList;
while (_local3) {
_local4 = _local3;
_local3 = _local3.next;
if (m_listener){
m_listener.NotifyJointDestroyed(_local4.joint);
};
DestroyJoint(_local4.joint);
};
_local2.Destroy();
};
m_bodyDestroyList = null;
m_contactManager.m_destroyImmediate = false;
}
public function GetJointList():b2Joint{
return (m_jointList);
}
public function GetBodyList():b2Body{
return (m_bodyList);
}
public function GetContactList():b2Contact{
return (m_contactList);
}
public function CreateJoint(_arg1:b2JointDef):b2Joint{
var _local2:b2Joint;
var _local3:b2Body;
var _local4:b2Shape;
_local2 = b2Joint.Create(_arg1, m_blockAllocator);
_local2.m_prev = null;
_local2.m_next = m_jointList;
if (m_jointList){
m_jointList.m_prev = _local2;
};
m_jointList = _local2;
m_jointCount++;
_local2.m_node1.joint = _local2;
_local2.m_node1.other = _local2.m_body2;
_local2.m_node1.prev = null;
_local2.m_node1.next = _local2.m_body1.m_jointList;
if (_local2.m_body1.m_jointList){
_local2.m_body1.m_jointList.prev = _local2.m_node1;
};
_local2.m_body1.m_jointList = _local2.m_node1;
_local2.m_node2.joint = _local2;
_local2.m_node2.other = _local2.m_body1;
_local2.m_node2.prev = null;
_local2.m_node2.next = _local2.m_body2.m_jointList;
if (_local2.m_body2.m_jointList){
_local2.m_body2.m_jointList.prev = _local2.m_node2;
};
_local2.m_body2.m_jointList = _local2.m_node2;
if (_arg1.collideConnected == false){
_local3 = ((_arg1.body1.m_shapeCount < _arg1.body2.m_shapeCount)) ? _arg1.body1 : _arg1.body2;
_local4 = _local3.m_shapeList;
while (_local4) {
_local4.ResetProxy(m_broadPhase);
_local4 = _local4.m_next;
};
};
return (_local2);
}
public function DestroyJoint(_arg1:b2Joint):void{
var _local2:Boolean;
var _local3:b2Body;
var _local4:b2Body;
var _local5:b2Body;
var _local6:b2Shape;
_local2 = _arg1.m_collideConnected;
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_jointList){
m_jointList = _arg1.m_next;
};
_local3 = _arg1.m_body1;
_local4 = _arg1.m_body2;
_local3.WakeUp();
_local4.WakeUp();
if (_arg1.m_node1.prev){
_arg1.m_node1.prev.next = _arg1.m_node1.next;
};
if (_arg1.m_node1.next){
_arg1.m_node1.next.prev = _arg1.m_node1.prev;
};
if (_arg1.m_node1 == _local3.m_jointList){
_local3.m_jointList = _arg1.m_node1.next;
};
_arg1.m_node1.prev = null;
_arg1.m_node1.next = null;
if (_arg1.m_node2.prev){
_arg1.m_node2.prev.next = _arg1.m_node2.next;
};
if (_arg1.m_node2.next){
_arg1.m_node2.next.prev = _arg1.m_node2.prev;
};
if (_arg1.m_node2 == _local4.m_jointList){
_local4.m_jointList = _arg1.m_node2.next;
};
_arg1.m_node2.prev = null;
_arg1.m_node2.next = null;
b2Joint.Destroy(_arg1, m_blockAllocator);
m_jointCount--;
if (_local2 == false){
_local5 = ((_local3.m_shapeCount < _local4.m_shapeCount)) ? _local3 : _local4;
_local6 = _local5.m_shapeList;
while (_local6) {
_local6.ResetProxy(m_broadPhase);
_local6 = _local6.m_next;
};
};
}
public function SetFilter(_arg1:b2CollisionFilter):void{
m_filter = _arg1;
}
public function CreateBody(_arg1:b2BodyDef):b2Body{
var _local2:b2Body;
_local2 = new b2Body(_arg1, this);
_local2.m_prev = null;
_local2.m_next = m_bodyList;
if (m_bodyList){
m_bodyList.m_prev = _local2;
};
m_bodyList = _local2;
m_bodyCount++;
return (_local2);
}
public function Step(_arg1:Number, _arg2:int):void{
var _local3:b2Body;
var _local4:b2Body;
var _local5:b2Island;
var _local6:b2Contact;
var _local7:b2Joint;
var _local8:int;
var _local9:Array;
var _local10:int;
var _local11:b2Body;
var _local12:int;
var _local13:int;
var _local14:b2ContactNode;
var _local15:b2JointNode;
var _local16:uint;
step.dt = _arg1;
step.iterations = _arg2;
if (_arg1 > 0){
step.inv_dt = (1 / _arg1);
} else {
step.inv_dt = 0;
};
m_positionIterationCount = 0;
m_contactManager.CleanContactList();
CleanBodyList();
m_contactManager.Collide();
_local5 = new b2Island(m_bodyCount, m_contactCount, m_jointCount, m_stackAllocator);
_local3 = m_bodyList;
while (_local3 != null) {
_local3.m_flags = (_local3.m_flags & ~(b2Body.e_islandFlag));
_local3 = _local3.m_next;
};
_local6 = m_contactList;
while (_local6 != null) {
_local6.m_flags = (_local6.m_flags & ~(b2Contact.e_islandFlag));
_local6 = _local6.m_next;
};
_local7 = m_jointList;
while (_local7 != null) {
_local7.m_islandFlag = false;
_local7 = _local7.m_next;
};
_local8 = m_bodyCount;
_local9 = new Array(m_bodyCount);
_local10 = 0;
while (_local10 < m_bodyCount) {
_local9[_local10] = null;
_local10++;
};
_local11 = m_bodyList;
while (_local11 != null) {
if ((_local11.m_flags & (((b2Body.e_staticFlag | b2Body.e_islandFlag) | b2Body.e_sleepFlag) | b2Body.e_frozenFlag))){
} else {
_local5.Clear();
_local12 = 0;
var _temp1 = _local12;
_local12 = (_local12 + 1);
var _local17 = _temp1;
_local9[_local17] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
while (_local12 > 0) {
--_local12;
_local3 = _local9[_local12];
_local5.AddBody(_local3);
_local3.m_flags = (_local3.m_flags & ~(b2Body.e_sleepFlag));
if ((_local3.m_flags & b2Body.e_staticFlag)){
} else {
_local14 = _local3.m_contactList;
while (_local14 != null) {
if ((_local14.contact.m_flags & b2Contact.e_islandFlag)){
} else {
_local5.AddContact(_local14.contact);
_local14.contact.m_flags = (_local14.contact.m_flags | b2Contact.e_islandFlag);
_local4 = _local14.other;
if ((_local4.m_flags & b2Body.e_islandFlag)){
} else {
var _temp2 = _local12;
_local12 = (_local12 + 1);
var _local18 = _temp2;
_local9[_local18] = _local4;
_local4.m_flags = (_local4.m_flags | b2Body.e_islandFlag);
};
};
_local14 = _local14.next;
};
_local15 = _local3.m_jointList;
while (_local15 != null) {
if (_local15.joint.m_islandFlag == true){
} else {
_local5.AddJoint(_local15.joint);
_local15.joint.m_islandFlag = true;
_local4 = _local15.other;
if ((_local4.m_flags & b2Body.e_islandFlag)){
} else {
var _temp3 = _local12;
_local12 = (_local12 + 1);
_local18 = _temp3;
_local9[_local18] = _local4;
_local4.m_flags = (_local4.m_flags | b2Body.e_islandFlag);
};
};
_local15 = _local15.next;
};
};
};
_local5.Solve(step, m_gravity);
m_positionIterationCount = b2Math.b2Max(m_positionIterationCount, b2Island.m_positionIterationCount);
if (m_allowSleep){
_local5.UpdateSleep(_arg1);
};
_local13 = 0;
while (_local13 < _local5.m_bodyCount) {
_local3 = _local5.m_bodies[_local13];
if ((_local3.m_flags & b2Body.e_staticFlag)){
_local3.m_flags = (_local3.m_flags & ~(b2Body.e_islandFlag));
};
if (((_local3.IsFrozen()) && (m_listener))){
_local16 = m_listener.NotifyBoundaryViolated(_local3);
if (_local16 == b2WorldListener.b2_destroyBody){
DestroyBody(_local3);
_local3 = null;
_local5.m_bodies[_local13] = null;
};
};
_local13++;
};
};
_local11 = _local11.m_next;
};
m_broadPhase.Commit();
}
}
}//package Box2D.Dynamics
Section 62
//b2WorldListener (Box2D.Dynamics.b2WorldListener)
package Box2D.Dynamics {
import Box2D.Dynamics.Joints.*;
public class b2WorldListener {
public static var b2_freezeBody:uint = 0;
public static var b2_destroyBody:uint = 1;
public function NotifyBoundaryViolated(_arg1:b2Body):uint{
return (b2_freezeBody);
}
public function NotifyJointDestroyed(_arg1:b2Joint):void{
}
}
}//package Box2D.Dynamics
Section 63
//DebugDispatcher (com.blitzagency.xray.logger.events.DebugDispatcher)
package com.blitzagency.xray.logger.events {
import flash.events.*;
public class DebugDispatcher extends EventDispatcher {
public static var TRACE:String = "trace";
public function sendEvent(_arg1:String, _arg2:Object):void{
trace(_arg2.message);
dispatchEvent(new DebugEvent(DebugDispatcher.TRACE, false, false, _arg2));
}
}
}//package com.blitzagency.xray.logger.events
Section 64
//DebugEvent (com.blitzagency.xray.logger.events.DebugEvent)
package com.blitzagency.xray.logger.events {
import flash.events.*;
public class DebugEvent extends Event {
public var obj:Object;
public function DebugEvent(_arg1:String, _arg2:Boolean, _arg3:Boolean, _arg4:Object):void{
obj = new Object();
super(_arg1, _arg2, _arg3);
obj = _arg4;
}
}
}//package com.blitzagency.xray.logger.events
Section 65
//ObjectTools (com.blitzagency.xray.logger.util.ObjectTools)
package com.blitzagency.xray.logger.util {
import com.blitzagency.xray.logger.*;
import flash.utils.*;
public class ObjectTools {
private static var log:XrayLog = new XrayLog();
public function resolveBaseType(_arg1:Object):String{
return ("");
}
public static function getImmediateClassPath(_arg1:Object):String{
var _local2:String;
var _local3:String;
_local2 = getQualifiedClassName(_arg1);
_local3 = getQualifiedSuperclassName(_arg1);
_local2 = ((_local2.indexOf("::") > -1)) ? _local2.split("::").join(".") : _local2;
if (_local3 == null){
return (_local2);
};
_local3 = ((_local3.indexOf("::") > -1)) ? _local3.split("::").join(".") : _local3;
return (((_local3 + ".") + _local2));
}
public static function getFullClassPath(_arg1:Object):String{
var _local2:XML;
var _local3:Array;
var _local4:String;
var _local5:XML;
var _local6:String;
_local2 = describeType(_arg1);
_local3 = [];
_local4 = getQualifiedClassName(_arg1);
_local4 = ((_local4.indexOf("::") > -1)) ? _local4.split("::").join(".") : _local4;
_local3.push(_local4);
for each (_local5 in _local2.extendsClass) {
_local6 = ((_local5.@type.toString().indexOf("::") > -1)) ? _local5.@type.toString().split("::")[1] : _local5.@type.toString();
_local3.push(_local6);
};
return (_local3.join("."));
}
}
}//package com.blitzagency.xray.logger.util
Section 66
//PropertyTools (com.blitzagency.xray.logger.util.PropertyTools)
package com.blitzagency.xray.logger.util {
import flash.utils.*;
public class PropertyTools {
private static function getVariables():void{
}
public static function getProperties(_arg1:Object):Array{
var ary:Array;
var xmlDoc:XML;
var item:XML;
var name:String;
var type:String;
var value:Object;
var obj = _arg1;
ary = [];
try {
xmlDoc = describeType(obj);
for each (item in xmlDoc.variable) {
name = item.@name.toString();
type = item.@type.toString();
value = ((obj[name])!=null) ? obj[name] : "";
ary.push({name:name, type:type, value:value});
};
} catch(e:Error) {
};
return (ary);
}
private static function getMethods():void{
}
}
}//package com.blitzagency.xray.logger.util
Section 67
//Debug (com.blitzagency.xray.logger.Debug)
package com.blitzagency.xray.logger {
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import com.blitzagency.xray.logger.events.*;
public class Debug {
private static var connected:Boolean = false;
private static var xrayLC:LocalConnection;
private static var ed:DebugDispatcher = new DebugDispatcher();
public static function traceObject(_arg1:Object, _arg2:Number=254, _arg3:Number=0, _arg4:String="", _arg5:Number=0):void{
var recurseDepth:Number;
var indent:Number;
var prop:String;
var lead:String;
var i:Number;
var obj:String;
var o = _arg1;
var pRecurseDepth = _arg2;
var pIndent = _arg3;
var pPackage = _arg4;
var pLevel = _arg5;
try {
recurseDepth = pRecurseDepth;
indent = pIndent;
for (prop in o) {
lead = "";
i = 0;
while (i < indent) {
lead = (lead + " ");
i = (i + 1);
};
obj = o[prop].toString();
if ((o[prop] is Array)){
obj = "[Array]";
};
if (obj == "[object Object]"){
obj = "[Object]";
};
Debug.trace((((lead + prop) + ": ") + obj), pPackage, pLevel);
if (recurseDepth > 0){
Debug.traceObject(o[prop], (recurseDepth - 1), (indent + 1), pPackage, pLevel);
};
};
} catch(e:Error) {
};
}
public static function trace(_arg1:Object, _arg2:String="", _arg3:Number=0):void{
var msg:String;
var pMsg = _arg1;
var pPackage = _arg2;
var pLevel = _arg3;
ed.sendEvent(DebugDispatcher.TRACE, {message:pMsg, classPackage:pPackage});
if (!connected){
makeConnection();
};
if (connected){
try {
msg = ((String(pMsg).length >= 39995)) ? (String(pMsg).substr(0, 39995) + "...") : String(pMsg);
xrayLC.send("_xray_view_conn", "setTrace", msg, pLevel, pPackage);
} catch(e:LogError) {
LogError("No Xray Interface running");
};
};
}
private static function makeConnection():void{
var err:LogError;
xrayLC = new LocalConnection();
xrayLC.addEventListener("status", statusHandler);
xrayLC.allowDomain("*");
try {
xrayLC.connect(("_xray_standAlone_debug" + getTimer()));
connected = true;
} catch(e:Error) {
err = new LogError("log");
setTimeout(makeConnection, 1000);
};
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
ed.addEventListener(_arg1, _arg2);
}
private static function initialize():Boolean{
ed = new DebugDispatcher();
return (true);
}
private static function statusHandler(_arg1:StatusEvent):void{
if ((((((_arg1.code == null)) && ((_arg1.level == "error")))) && (connected))){
connected = false;
} else {
if ((((_arg1.level == "status")) && ((_arg1.code == null)))){
connected = true;
};
};
}
}
}//package com.blitzagency.xray.logger
class LogError extends Error {
private function LogError(_arg1:String){
super(_arg1);
}
}
Section 68
//Log (com.blitzagency.xray.logger.Log)
package com.blitzagency.xray.logger {
import com.blitzagency.xray.logger.util.*;
public class Log {
private var level:Number;
private var caller:String;// = ""
private var classPackage:String;
private var dump:Object;
private var message:String;
public function Log(_arg1:String, _arg2:Object, _arg3:Number, ... _args){
var err:LogError;
var nullArray:Array;
var str:String;
var p_message = _arg1;
var p_dump = _arg2;
var p_level = _arg3;
var rest = _args;
caller = "";
super();
try {
nullArray.push("bogus");
} catch(e:Error) {
err = new LogError("log");
} finally {
if (err.hasOwnProperty("getStackTrace")){
str = err.getStackTrace();
setCaller(resolveCaller(str));
} else {
setCaller("");
};
setMessage(p_message);
setDump(p_dump);
setLevel(p_level);
setClassPackage(p_dump);
};
}
public function setLevel(_arg1:Number):void{
level = _arg1;
}
public function getCaller():String{
return (caller);
}
public function setMessage(_arg1:String):void{
message = _arg1;
}
public function getLevel():Number{
return (level);
}
public function getDump():Object{
return (dump);
}
public function setCaller(_arg1:String):void{
caller = _arg1;
}
public function setClassPackage(_arg1:Object):void{
classPackage = ObjectTools.getImmediateClassPath(_arg1);
}
public function getMessage():String{
return (message);
}
public function getClassPackage():String{
return (classPackage);
}
public function setDump(_arg1:Object):void{
dump = _arg1;
}
private function resolveCaller(_arg1:String):String{
var ary:Array;
var str = _arg1;
ary = [];
try {
str = str.split("\n").join("");
ary = str.split("\tat ");
str = ary[3];
} catch(e:Error) {
} finally {
str = "";
};
return (str);
}
}
}//package com.blitzagency.xray.logger
class LogError extends Error {
private function LogError(_arg1:String){
super(_arg1);
}
}
Section 69
//Logger (com.blitzagency.xray.logger.Logger)
package com.blitzagency.xray.logger {
public interface Logger {
function setLevel(_arg1:Number=0):void;
function debug(_arg1:Log):void;
function fatal(_arg1:Log):void;
function warn(_arg1:Log):void;
function error(_arg1:Log):void;
function log(_arg1:String, _arg2:String, _arg3:String, _arg4:Number, _arg5:Object=null):void;
function info(_arg1:Log):void;
}
}//package com.blitzagency.xray.logger
Section 70
//XrayLog (com.blitzagency.xray.logger.XrayLog)
package com.blitzagency.xray.logger {
public class XrayLog {
private var logger:XrayLogger;
public function XrayLog(){
logger = XrayLogger.getInstance();
}
public function debug(_arg1:String, ... _args):void{
var _local3:Number;
if (_args.length == 0){
logger.debug(new Log(_arg1, null, XrayLogger.DEBUG));
};
_local3 = 0;
while (_local3 < _args.length) {
if (_local3 > 0){
_arg1 = "";
};
logger.debug(new Log(_arg1, _args[_local3], XrayLogger.DEBUG));
_local3++;
};
}
public function fatal(_arg1:String, ... _args):void{
var _local3:Number;
if (_args.length == 0){
logger.fatal(new Log(_arg1, null, XrayLogger.FATAL));
};
_local3 = 0;
while (_local3 < _args.length) {
if (_local3 > 0){
_arg1 = "";
};
logger.fatal(new Log(_arg1, _args[_local3], XrayLogger.FATAL));
_local3++;
};
}
public function info(_arg1:String, ... _args):void{
var _local3:Number;
if (_args.length == 0){
logger.info(new Log(_arg1, null, XrayLogger.INFO));
};
_local3 = 0;
while (_local3 < _args.length) {
if (_local3 > 0){
_arg1 = "";
};
logger.info(new Log(_arg1, _args[_local3], XrayLogger.INFO));
_local3++;
};
}
public function warn(_arg1:String, ... _args):void{
var _local3:Number;
if (_args.length == 0){
logger.warn(new Log(_arg1, null, XrayLogger.WARN));
};
_local3 = 0;
while (_local3 < _args.length) {
if (_local3 > 0){
_arg1 = "";
};
logger.warn(new Log(_arg1, _args[_local3], XrayLogger.WARN));
_local3++;
};
}
public function error(_arg1:String, ... _args):void{
var _local3:Number;
if (_args.length == 0){
logger.error(new Log(_arg1, null, XrayLogger.ERROR));
};
_local3 = 0;
while (_local3 < _args.length) {
if (_local3 > 0){
_arg1 = "";
};
logger.error(new Log(_arg1, _args[_local3], XrayLogger.ERROR));
_local3++;
};
}
}
}//package com.blitzagency.xray.logger
Section 71
//XrayLogger (com.blitzagency.xray.logger.XrayLogger)
package com.blitzagency.xray.logger {
import flash.events.*;
import flash.utils.*;
import com.blitzagency.xray.logger.util.*;
public class XrayLogger extends EventDispatcher implements Logger {
private var displayObjectRecursionDepth:Number;// = 3
private var level:Number;// = 0
private var indentation:Number;// = 0
private var objectRecursionDepth:Number;// = 254
private var filters:Array;
public static var FATAL:Number = 4;
public static var WARN:Number = 2;
public static var ERROR:Number = 3;
public static var INFO:Number = 1;
public static var DEBUG:Number = 0;
private static var _instance:XrayLogger = null;
public static var NONE:Number = 5;
public function XrayLogger(){
level = 0;
displayObjectRecursionDepth = 3;
objectRecursionDepth = 254;
indentation = 0;
filters = [];
super();
}
public function checkFilters():Boolean{
var _local1:uint;
if (filters.length == 0){
return (true);
};
_local1 = 0;
while (_local1 < filters.length) {
_local1++;
};
return (true);
}
public function debug(_arg1:Log):void{
if (_arg1.getLevel() == level){
log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 0, _arg1.getDump());
};
}
public function setIndentation(_arg1:Number=0):void{
indentation = _arg1;
}
public function error(_arg1:Log):void{
if (_arg1.getLevel() >= level){
log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 3, _arg1.getDump());
};
}
public function setLevel(_arg1:Number=0):void{
level = _arg1;
}
public function fatal(_arg1:Log):void{
if (_arg1.getLevel() >= level){
log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 4, _arg1.getDump());
};
}
public function warn(_arg1:Log):void{
if (_arg1.getLevel() >= level){
log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 2, _arg1.getDump());
};
}
public function setObjectRecursionDepth(_arg1:Number):void{
objectRecursionDepth = _arg1;
}
public function setDisplayClipRecursionDepth(_arg1:Number):void{
displayObjectRecursionDepth = _arg1;
}
public function info(_arg1:Log):void{
if (_arg1.getLevel() >= level){
log(_arg1.getMessage(), _arg1.getCaller(), _arg1.getClassPackage(), 1, _arg1.getDump());
};
}
public function log(_arg1:String, _arg2:String, _arg3:String, _arg4:Number, _arg5:Object=null):void{
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:Object;
_local6 = (("(" + getTimer()) + ") ");
if (_arg3.length > 0){
_local6 = (_local6 + (_arg2 + "\n"));
};
_local6 = (_local6 + _arg1);
if (_arg1.length > 0){
Debug.trace(_local6, _arg3, _arg4);
};
if (_arg5 == null){
return;
};
_local7 = typeof(_arg5);
if ((((((((((_local7 == "string")) || ((_local7 == "number")))) || ((_local7 == "boolean")))) || ((_local7 == "undefined")))) || ((_local7 == "null")))){
Debug.trace(_arg5, _arg3, _arg4);
} else {
if (_local7 == "xml"){
Debug.trace(_arg5.toString(), _arg3, _arg4);
} else {
_local8 = ObjectTools.getImmediateClassPath(_arg5);
if ((((_local8 == "Object")) || ((_local8 == "Object.Array")))){
Debug.traceObject(_arg5, objectRecursionDepth, indentation, _arg3, _arg4);
} else {
_local9 = PropertyTools.getProperties(_arg5);
Debug.traceObject(_local9, displayObjectRecursionDepth, indentation, _arg3, _arg4);
};
};
};
}
public function setFilters(_arg1:Array):void{
filters = _arg1;
}
public static function getInstance():XrayLogger{
if (_instance == null){
_instance = new (XrayLogger);
};
return (_instance);
}
public static function resolveLevelAsName(_arg1:Number):String{
switch (_arg1){
case 0:
return ("debug");
case 1:
return ("info");
case 2:
return ("warn");
case 3:
return ("error");
case 4:
return ("fatal");
default:
return ("debug");
};
}
}
}//package com.blitzagency.xray.logger
Section 72
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class AdLoader extends Sprite {
private var contentspotid:String;
private var cpmstarLoader:Loader;
public function AdLoader(_arg1:String){
this.contentspotid = _arg1;
addEventListener(Event.ADDED, addedHandler);
}
private function addedHandler(_arg1:Event):void{
var _local2:String;
var _local3:DisplayObjectContainer;
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
_local2 = "http://server.cpmstar.com/adviewas3.swf";
_local3 = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((_local2 + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
private function dispatchHandler(_arg1:Event):void{
dispatchEvent(_arg1);
}
}
}//package CPMStar
Section 73
//None (fl.transitions.easing.None)
package fl.transitions.easing {
public class None {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package fl.transitions.easing
Section 74
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
public var begin:Number;// = NAN
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var change:Number;// = NAN
private var _finish:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
isPlaying = false;
obj = null;
prop = "";
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
begin = NaN;
change = NaN;
useSeconds = false;
prevTime = NaN;
prevPos = NaN;
looping = false;
_duration = NaN;
_time = NaN;
_fps = NaN;
_position = NaN;
_startTime = NaN;
_intervalID = 0;
_finish = NaN;
_timer = null;
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean;
_local2 = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 75
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
time = NaN;
position = NaN;
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 76
//FreeCamera3D (org.papervision3d.cameras.FreeCamera3D)
package org.papervision3d.cameras {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.math.*;
public class FreeCamera3D extends CameraObject3D {
public static const TYPE:String = "FREECAMERA3D";
public function FreeCamera3D(_arg1:Number=2, _arg2:Number=100, _arg3:Object=null){
super(_arg1, _arg2, _arg3);
}
override public function transformView(_arg1:Matrix3D=null):void{
if (this._transformDirty){
updateTransform();
};
super.transformView();
}
}
}//package org.papervision3d.cameras
Section 77
//CoordinateTools (org.papervision3d.core.components.as3.utils.CoordinateTools)
package org.papervision3d.core.components.as3.utils {
import flash.display.*;
import flash.geom.*;
public class CoordinateTools {
public static function random(_arg1:Number):Number{
return (Math.floor((Math.random() * _arg1)));
}
public static function localToLocal(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Point=null):Point{
var _local4:Point;
_local4 = (_arg3) ? _arg3 : new Point();
_local4 = _arg1.localToGlobal(_local4);
_local4 = _arg2.globalToLocal(_local4);
return (_local4);
}
}
}//package org.papervision3d.core.components.as3.utils
Section 78
//DefaultLineCuller (org.papervision3d.core.culling.DefaultLineCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
public class DefaultLineCuller implements ILineCuller {
public function testLine(_arg1:Line3D):Boolean{
return (((_arg1.v0.vertex3DInstance.visible) && (_arg1.v1.vertex3DInstance.visible)));
}
}
}//package org.papervision3d.core.culling
Section 79
//DefaultParticleCuller (org.papervision3d.core.culling.DefaultParticleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
public class DefaultParticleCuller implements IParticleCuller {
public function testParticle(_arg1:Particle):Boolean{
if (_arg1.material.invisible == false){
if (_arg1.vertex3D.vertex3DInstance.visible == true){
return (true);
};
};
return (false);
}
}
}//package org.papervision3d.core.culling
Section 80
//DefaultTriangleCuller (org.papervision3d.core.culling.DefaultTriangleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.geom.renderables.*;
public class DefaultTriangleCuller implements ITriangleCuller {
protected static var y2:Number;
protected static var y1:Number;
protected static var y0:Number;
protected static var x0:Number;
protected static var x1:Number;
protected static var x2:Number;
public function testFace(_arg1:Triangle3D, _arg2:Vertex3DInstance, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance):Boolean{
var _local5:MaterialObject3D;
if (((((_arg2.visible) && (_arg3.visible))) && (_arg4.visible))){
_local5 = (_arg1.material) ? _arg1.material : _arg1.instance.material;
if (_local5.invisible){
return (false);
};
x0 = _arg2.x;
y0 = _arg2.y;
x1 = _arg3.x;
y1 = _arg3.y;
x2 = _arg4.x;
y2 = _arg4.y;
if (_local5.oneSide){
if (_local5.opposite){
if ((((x2 - x0) * (y1 - y0)) - ((y2 - y0) * (x1 - x0))) > 0){
return (false);
};
} else {
if ((((x2 - x0) * (y1 - y0)) - ((y2 - y0) * (x1 - x0))) < 0){
return (false);
};
};
};
return (true);
};
return (false);
}
}
}//package org.papervision3d.core.culling
Section 81
//FrustumTestMethod (org.papervision3d.core.culling.FrustumTestMethod)
package org.papervision3d.core.culling {
public class FrustumTestMethod {
public static const BOUNDING_SPHERE:int = 0;
public static const BOUNDING_BOX:int = 1;
}
}//package org.papervision3d.core.culling
Section 82
//ILineCuller (org.papervision3d.core.culling.ILineCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
public interface ILineCuller {
function testLine(_arg1:Line3D):Boolean;
}
}//package org.papervision3d.core.culling
Section 83
//IObjectCuller (org.papervision3d.core.culling.IObjectCuller)
package org.papervision3d.core.culling {
import org.papervision3d.objects.*;
public interface IObjectCuller {
function testObject(_arg1:DisplayObject3D):int;
}
}//package org.papervision3d.core.culling
Section 84
//IParticleCuller (org.papervision3d.core.culling.IParticleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
public interface IParticleCuller {
function testParticle(_arg1:Particle):Boolean;
}
}//package org.papervision3d.core.culling
Section 85
//ITriangleCuller (org.papervision3d.core.culling.ITriangleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
public interface ITriangleCuller {
function testFace(_arg1:Triangle3D, _arg2:Vertex3DInstance, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance):Boolean;
}
}//package org.papervision3d.core.culling
Section 86
//RectangleLineCuller (org.papervision3d.core.culling.RectangleLineCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
import flash.geom.*;
import org.papervision3d.core.math.util.*;
public class RectangleLineCuller implements ILineCuller {
private var rectIntersection:Rectangle;
private var lineBoundsRect:Rectangle;
private var cullingRectangle:Rectangle;
public function RectangleLineCuller(_arg1:Rectangle=null):void{
if (_arg1){
this.cullingRectangle = _arg1;
};
lineBoundsRect = new Rectangle();
rectIntersection = new Rectangle();
}
public function testLine(_arg1:Line3D):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
if (((!(_arg1.v0.vertex3DInstance.visible)) || (!(_arg1.v1.vertex3DInstance.visible)))){
return (false);
};
_local2 = _arg1.v0.vertex3DInstance.x;
_local3 = _arg1.v0.vertex3DInstance.y;
_local4 = _arg1.v1.vertex3DInstance.x;
_local5 = _arg1.v1.vertex3DInstance.y;
lineBoundsRect.width = Math.abs((_local4 - _local2));
lineBoundsRect.height = Math.abs((_local5 - _local3));
if (_local2 < _local4){
lineBoundsRect.x = _local2;
} else {
lineBoundsRect.x = _local4;
};
if (_local3 < _local5){
lineBoundsRect.y = _local3;
} else {
lineBoundsRect.y = _local5;
};
if (cullingRectangle.containsRect(lineBoundsRect)){
return (true);
};
if (!FastRectangleTools.intersects(lineBoundsRect, cullingRectangle)){
return (false);
};
rectIntersection = FastRectangleTools.intersection(lineBoundsRect, cullingRectangle);
_local6 = ((_local5 - _local3) / (_local4 - _local2));
_local7 = (_local3 - (_local6 * _local2));
_local8 = ((cullingRectangle.top - _local7) / _local6);
if ((((_local8 > rectIntersection.left)) && ((_local8 < rectIntersection.right)))){
return (true);
};
_local8 = ((cullingRectangle.bottom - _local7) / _local6);
if ((((_local8 > rectIntersection.left)) && ((_local8 < rectIntersection.right)))){
return (true);
};
_local9 = ((_local6 * cullingRectangle.left) + _local7);
if ((((_local9 > rectIntersection.top)) && ((_local9 < rectIntersection.bottom)))){
return (true);
};
_local9 = ((_local6 * cullingRectangle.right) + _local7);
if ((((_local9 > rectIntersection.top)) && ((_local9 < rectIntersection.bottom)))){
return (true);
};
return (false);
}
}
}//package org.papervision3d.core.culling
Section 87
//RectangleParticleCuller (org.papervision3d.core.culling.RectangleParticleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
import flash.geom.*;
import org.papervision3d.core.math.util.*;
public class RectangleParticleCuller implements IParticleCuller {
public var cullingRectangle:Rectangle;
private static var vInstance:Vertex3DInstance;
private static var testPoint:Point;
public function RectangleParticleCuller(_arg1:Rectangle=null){
this.cullingRectangle = _arg1;
testPoint = new Point();
}
public function testParticle(_arg1:Particle):Boolean{
vInstance = _arg1.vertex3D.vertex3DInstance;
if (_arg1.material.invisible == false){
if (vInstance.visible){
if (FastRectangleTools.intersects(_arg1.renderRect, cullingRectangle)){
return (true);
};
};
};
return (false);
}
}
}//package org.papervision3d.core.culling
Section 88
//RectangleTriangleCuller (org.papervision3d.core.culling.RectangleTriangleCuller)
package org.papervision3d.core.culling {
import org.papervision3d.core.geom.renderables.*;
import flash.geom.*;
import org.papervision3d.core.math.util.*;
public class RectangleTriangleCuller extends DefaultTriangleCuller implements ITriangleCuller {
public var cullingRectangle:Rectangle;
private static const DEFAULT_RECT_X:Number = -((DEFAULT_RECT_W / 2));
private static const DEFAULT_RECT_W:Number = 640;
private static const DEFAULT_RECT_H:Number = 480;
private static const DEFAULT_RECT_Y:Number = -((DEFAULT_RECT_H / 2));
private static var hitRect:Rectangle = new Rectangle();
public function RectangleTriangleCuller(_arg1:Rectangle=null):void{
cullingRectangle = new Rectangle(DEFAULT_RECT_X, DEFAULT_RECT_Y, DEFAULT_RECT_W, DEFAULT_RECT_H);
super();
if (_arg1){
this.cullingRectangle = _arg1;
};
}
override public function testFace(_arg1:Triangle3D, _arg2:Vertex3DInstance, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance):Boolean{
if (super.testFace(_arg1, _arg2, _arg3, _arg4)){
hitRect.x = Math.min(_arg4.x, Math.min(_arg3.x, _arg2.x));
hitRect.width = (Math.max(_arg4.x, Math.max(_arg3.x, _arg2.x)) + Math.abs(hitRect.x));
hitRect.y = Math.min(_arg4.y, Math.min(_arg3.y, _arg2.y));
hitRect.height = (Math.max(_arg4.y, Math.max(_arg3.y, _arg2.y)) + Math.abs(hitRect.y));
return (FastRectangleTools.intersects(cullingRectangle, hitRect));
};
return (false);
}
}
}//package org.papervision3d.core.culling
Section 89
//ViewportObjectFilter (org.papervision3d.core.culling.ViewportObjectFilter)
package org.papervision3d.core.culling {
import org.papervision3d.objects.*;
import flash.utils.*;
public class ViewportObjectFilter implements IObjectCuller {
protected var _mode:int;
protected var objects:Dictionary;
public function ViewportObjectFilter(_arg1:int):void{
this.mode = _arg1;
init();
}
public function addObject(_arg1:DisplayObject3D):void{
objects[_arg1] = _arg1;
}
public function removeObject(_arg1:DisplayObject3D):void{
delete objects[_arg1];
}
public function set mode(_arg1:int):void{
_mode = _arg1;
}
public function get mode():int{
return (_mode);
}
private function init():void{
objects = new Dictionary(true);
}
public function testObject(_arg1:DisplayObject3D):int{
if (objects[_arg1]){
if (_mode == ViewportObjectFilterMode.INCLUSIVE){
return (1);
};
if (_mode == ViewportObjectFilterMode.EXCLUSIVE){
return (0);
};
} else {
if (_mode == ViewportObjectFilterMode.INCLUSIVE){
return (0);
};
if (_mode == ViewportObjectFilterMode.EXCLUSIVE){
return (1);
};
};
return (0);
}
public function destroy():void{
objects = null;
}
}
}//package org.papervision3d.core.culling
Section 90
//ViewportObjectFilterMode (org.papervision3d.core.culling.ViewportObjectFilterMode)
package org.papervision3d.core.culling {
public class ViewportObjectFilterMode {
public static const INCLUSIVE:int = 0;
public static const EXCLUSIVE:int = 1;
}
}//package org.papervision3d.core.culling
Section 91
//UserData (org.papervision3d.core.data.UserData)
package org.papervision3d.core.data {
public class UserData {
public var data;
public function UserData(_arg1=null){
this.data = _arg1;
}
}
}//package org.papervision3d.core.data
Section 92
//AbstractRenderable (org.papervision3d.core.geom.renderables.AbstractRenderable)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.render.command.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.data.*;
public class AbstractRenderable implements IRenderable {
public var _userData:UserData;
public var instance:DisplayObject3D;
public function getRenderListItem():IRenderListItem{
return (null);
}
public function set userData(_arg1:UserData):void{
_userData = _arg1;
}
public function get userData():UserData{
return (_userData);
}
}
}//package org.papervision3d.core.geom.renderables
Section 93
//IRenderable (org.papervision3d.core.geom.renderables.IRenderable)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.render.command.*;
public interface IRenderable {
function getRenderListItem():IRenderListItem;
}
}//package org.papervision3d.core.geom.renderables
Section 94
//Line3D (org.papervision3d.core.geom.renderables.Line3D)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.render.command.*;
import org.papervision3d.materials.special.*;
import org.papervision3d.core.geom.*;
public class Line3D extends AbstractRenderable implements IRenderable {
public var size:Number;
public var cV:Vertex3D;
public var renderCommand:RenderLine;
public var material:LineMaterial;
public var v0:Vertex3D;
public var v1:Vertex3D;
public function Line3D(_arg1:Lines3D, _arg2:LineMaterial, _arg3:Number, _arg4:Vertex3D, _arg5:Vertex3D, _arg6:Vertex3D=null){
this.size = _arg3;
this.material = _arg2;
this.v0 = _arg4;
this.v1 = _arg5;
this.cV = _arg5;
this.instance = _arg1;
this.renderCommand = new RenderLine(this);
}
public function addControlVertex(_arg1:Number, _arg2:Number, _arg3:Number):void{
cV = new Vertex3D(_arg1, _arg2, _arg3);
if (instance.geometry.vertices.indexOf(cV) == -1){
instance.geometry.vertices.push(cV);
};
}
override public function getRenderListItem():IRenderListItem{
return (this.renderCommand);
}
}
}//package org.papervision3d.core.geom.renderables
Section 95
//Particle (org.papervision3d.core.geom.renderables.Particle)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.render.command.*;
import flash.geom.*;
import org.papervision3d.materials.special.*;
public class Particle extends AbstractRenderable implements IRenderable {
public var size:Number;
public var renderScale:Number;
public var vertex3D:Vertex3D;
public var renderRect:Rectangle;
public var renderCommand:RenderParticle;
public var material:ParticleMaterial;
public function Particle(_arg1:ParticleMaterial, _arg2:Number=1, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0){
this.material = _arg1;
this.size = _arg2;
this.renderCommand = new RenderParticle(this);
this.renderRect = new Rectangle();
vertex3D = new Vertex3D(_arg3, _arg4, _arg5);
}
public function get y():Number{
return (vertex3D.y);
}
public function updateRenderRect():void{
material.updateRenderRect(this);
}
public function set z(_arg1:Number):void{
vertex3D.z = _arg1;
}
public function set x(_arg1:Number):void{
vertex3D.x = _arg1;
}
public function set y(_arg1:Number):void{
vertex3D.y = _arg1;
}
public function get x():Number{
return (vertex3D.x);
}
public function get z():Number{
return (vertex3D.z);
}
override public function getRenderListItem():IRenderListItem{
return (renderCommand);
}
}
}//package org.papervision3d.core.geom.renderables
Section 96
//Triangle3D (org.papervision3d.core.geom.renderables.Triangle3D)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.command.*;
import org.papervision3d.core.math.*;
import org.papervision3d.objects.*;
public class Triangle3D extends AbstractRenderable implements IRenderable {
public var vertices:Array;
public var v1:Vertex3D;
public var face3DInstance:Triangle3DInstance;
public var _uvArray:Array;
public var visible:Boolean;
public var id:Number;
public var material:MaterialObject3D;
public var renderCommand:RenderTriangle;
public var screenZ:Number;
public var uv0:NumberUV;
public var uv1:NumberUV;
public var uv2:NumberUV;
public var faceNormal:Number3D;
public var _materialName:String;
public var v0:Vertex3D;
public var v2:Vertex3D;
private static var _totalFaces:Number = 0;
public function Triangle3D(_arg1:DisplayObject3D, _arg2:Array, _arg3:MaterialObject3D=null, _arg4:Array=null){
this.instance = _arg1;
this.renderCommand = new RenderTriangle(this);
face3DInstance = new Triangle3DInstance(this, _arg1);
faceNormal = new Number3D();
if (((_arg2) && ((_arg2.length == 3)))){
this.vertices = _arg2;
v0 = _arg2[0];
v1 = _arg2[1];
v2 = _arg2[2];
createNormal();
} else {
_arg2 = new Array();
v0 = (_arg2[0] = new Vertex3D());
v1 = (_arg2[1] = new Vertex3D());
v2 = (_arg2[2] = new Vertex3D());
};
this.material = _arg3;
this.uv = _arg4;
this.id = _totalFaces++;
}
public function set uv(_arg1:Array):void{
if (((_arg1) && ((_arg1.length == 3)))){
uv0 = NumberUV(_arg1[0]);
uv1 = NumberUV(_arg1[1]);
uv2 = NumberUV(_arg1[2]);
};
_uvArray = _arg1;
}
public function createNormal():void{
var _local1:Number3D;
var _local2:Number3D;
var _local3:Number3D;
_local1 = v0.getPosition();
_local2 = v1.getPosition();
_local3 = v2.getPosition();
_local2.minusEq(_local1);
_local3.minusEq(_local1);
faceNormal = Number3D.cross(_local2, _local3, faceNormal);
faceNormal.normalize();
}
public function get uv():Array{
return (_uvArray);
}
public function updateVertices():void{
v0 = vertices[0];
v1 = vertices[1];
v2 = vertices[2];
}
override public function getRenderListItem():IRenderListItem{
return (renderCommand);
}
}
}//package org.papervision3d.core.geom.renderables
Section 97
//Triangle3DInstance (org.papervision3d.core.geom.renderables.Triangle3DInstance)
package org.papervision3d.core.geom.renderables {
import flash.display.*;
import org.papervision3d.core.math.*;
import org.papervision3d.objects.*;
public class Triangle3DInstance {
public var container:Sprite;
public var faceNormal:Number3D;
public var screenZ:Number;
public var visible:Boolean;// = false
public var instance:DisplayObject3D;
public function Triangle3DInstance(_arg1:Triangle3D, _arg2:DisplayObject3D){
visible = false;
super();
this.instance = _arg2;
faceNormal = new Number3D();
}
}
}//package org.papervision3d.core.geom.renderables
Section 98
//Vertex3D (org.papervision3d.core.geom.renderables.Vertex3D)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.render.command.*;
import org.papervision3d.core.math.*;
import flash.utils.*;
public class Vertex3D extends AbstractRenderable implements IRenderable {
public var vertex3DInstance:Vertex3DInstance;
public var extra:Object;
public var normal:Number3D;
protected var position:Number3D;
public var connectedFaces:Dictionary;
public var x:Number;
public var y:Number;
public var z:Number;
public function Vertex3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
position = new Number3D();
super();
this.x = (position.x = _arg1);
this.y = (position.y = _arg2);
this.z = (position.z = _arg3);
this.vertex3DInstance = new Vertex3DInstance();
this.normal = new Number3D();
this.connectedFaces = new Dictionary();
}
public function clone():Vertex3D{
var _local1:Vertex3D;
_local1 = new Vertex3D(x, y, z);
_local1.extra = extra;
_local1.vertex3DInstance = vertex3DInstance.clone();
_local1.normal = normal.clone();
return (_local1);
}
public function getPosition():Number3D{
position.x = x;
position.y = y;
position.z = z;
return (position);
}
public function toNumber3D():Number3D{
return (new Number3D(x, y, z));
}
public function calculateNormal():void{
var _local1:Triangle3D;
var _local2:Number;
_local2 = 0;
normal.reset();
for each (_local1 in connectedFaces) {
if (_local1.faceNormal){
_local2++;
normal.plusEq(_local1.faceNormal);
};
};
normal.x = (normal.x / _local2);
normal.y = (normal.y / _local2);
normal.z = (normal.z / _local2);
normal.normalize();
}
override public function getRenderListItem():IRenderListItem{
return (null);
}
}
}//package org.papervision3d.core.geom.renderables
Section 99
//Vertex3DInstance (org.papervision3d.core.geom.renderables.Vertex3DInstance)
package org.papervision3d.core.geom.renderables {
import org.papervision3d.core.math.*;
public class Vertex3DInstance {
public var visible:Boolean;
public var normal:Number3D;
public var extra:Object;
public var x:Number;
public var y:Number;
public var z:Number;
public function Vertex3DInstance(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.visible = false;
this.normal = new Number3D();
}
public function clone():Vertex3DInstance{
var _local1:Vertex3DInstance;
_local1 = new Vertex3DInstance(x, y, z);
_local1.visible = visible;
_local1.extra = extra;
return (_local1);
}
public static function cross(_arg1:Vertex3DInstance, _arg2:Vertex3DInstance):Number{
return (((_arg1.x * _arg2.y) - (_arg2.x * _arg1.y)));
}
public static function dot(_arg1:Vertex3DInstance, _arg2:Vertex3DInstance):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function subTo(_arg1:Vertex3DInstance, _arg2:Vertex3DInstance, _arg3:Vertex3DInstance):void{
_arg3.x = (_arg2.x - _arg1.x);
_arg3.y = (_arg2.y - _arg1.y);
}
public static function sub(_arg1:Vertex3DInstance, _arg2:Vertex3DInstance):Vertex3DInstance{
return (new Vertex3DInstance((_arg2.x - _arg1.x), (_arg2.y - _arg1.y)));
}
}
}//package org.papervision3d.core.geom.renderables
Section 100
//Lines3D (org.papervision3d.core.geom.Lines3D)
package org.papervision3d.core.geom {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.objects.*;
import org.papervision3d.materials.special.*;
import org.papervision3d.*;
import org.papervision3d.core.render.draw.*;
public class Lines3D extends Vertices3D {
public var lines:Array;
private var _material:ILineDrawer;
public function Lines3D(_arg1:LineMaterial, _arg2:String=null){
super(null, _arg2);
this.material = _arg1;
init();
}
private function init():void{
this.lines = new Array();
}
override public function project(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{
var _local3:Line3D;
var _local4:Number;
super.project(_arg1, _arg2);
for each (_local3 in lines) {
if (_arg2.viewPort.lineCuller.testLine(_local3)){
_local3.renderCommand.renderer = _local3.material;
_local4 = (_local4 + (_local3.renderCommand.screenDepth = ((_local3.v0.vertex3DInstance.z + _local3.v1.vertex3DInstance.z) / 2)));
_arg2.renderer.addToRenderList(_local3.renderCommand);
};
};
return ((_local4 / (lines.length + 1)));
}
public function addLine(_arg1:Line3D):void{
lines.push(_arg1);
_arg1.instance = this;
if (geometry.vertices.indexOf(_arg1.v0) == -1){
geometry.vertices.push(_arg1.v0);
};
if (geometry.vertices.indexOf(_arg1.v1) == -1){
geometry.vertices.push(_arg1.v1);
};
if (_arg1.cV){
if (geometry.vertices.indexOf(_arg1.cV) == -1){
geometry.vertices.push(_arg1.cV);
};
};
}
public function addNewSegmentedLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):void{
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Line3D;
var _local13:Vertex3D;
var _local14:Vertex3D;
var _local15:Number;
_local9 = ((_arg6 - _arg3) / _arg2);
_local10 = ((_arg7 - _arg4) / _arg2);
_local11 = ((_arg8 - _arg5) / _arg2);
_local13 = new Vertex3D(_arg3, _arg4, _arg5);
_local15 = 0;
while (_local15 <= _arg2) {
_local14 = new Vertex3D((_arg3 + (_local9 * _local15)), (_arg4 + (_local10 * _local15)), (_arg5 + (_local11 * _local15)));
_local12 = new Line3D(this, (material as LineMaterial), _arg1, _local13, _local14);
addLine(_local12);
_local13 = _local14;
_local15++;
};
}
public function removeAllLines():void{
trace("WARNING - Lines3D.removeAllLines not yet implemented");
}
public function removeLine(_arg1:Line3D):void{
var _local2:int;
_local2 = lines.indexOf(_arg1);
if (_local2 > -1){
lines.splice(_local2, 1);
} else {
if (Papervision3D.VERBOSE){
trace("Papervision3D Lines3D.removeLine : WARNING removal of non-existant line attempted. ");
};
};
}
public function addNewLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Line3D{
var _local8:Line3D;
_local8 = new Line3D(this, (material as LineMaterial), _arg1, new Vertex3D(_arg2, _arg3, _arg4), new Vertex3D(_arg5, _arg6, _arg7));
addLine(_local8);
return (_local8);
}
}
}//package org.papervision3d.core.geom
Section 101
//TriangleMesh3D (org.papervision3d.core.geom.TriangleMesh3D)
package org.papervision3d.core.geom {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.render.command.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.math.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.culling.*;
import flash.utils.*;
import org.papervision3d.core.render.draw.*;
public class TriangleMesh3D extends Vertices3D {
public function TriangleMesh3D(_arg1:MaterialObject3D, _arg2:Array, _arg3:Array, _arg4:String=null, _arg5:Object=null){
super(_arg2, _arg4, _arg5);
this.geometry.faces = ((_arg3) || (new Array()));
this.material = ((_arg1) || (MaterialObject3D.DEFAULT));
}
override public function project(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{
var _local3:Array;
var _local4:Number;
var _local5:Number;
var _local6:ITriangleCuller;
var _local7:Vertex3DInstance;
var _local8:Vertex3DInstance;
var _local9:Vertex3DInstance;
var _local10:Triangle3DInstance;
var _local11:Triangle3D;
var _local12:MaterialObject3D;
var _local13:RenderTriangle;
super.project(_arg1, _arg2);
if (!this.culled){
_local3 = this.geometry.faces;
_local4 = 0;
_local5 = 0;
_local6 = _arg2.triangleCuller;
for each (_local11 in _local3) {
_local12 = (_local11.material) ? _local11.material : material;
_local10 = _local11.face3DInstance;
_local7 = _local11.v0.vertex3DInstance;
_local8 = _local11.v1.vertex3DInstance;
_local9 = _local11.v2.vertex3DInstance;
if ((_local10.visible = _local6.testFace(_local11, _local7, _local8, _local9))){
_local4 = (_local4 + (_local10.screenZ = (((_local7.z + _local8.z) + _local9.z) / 3)));
_local13 = _local11.renderCommand;
_local5++;
_local13.renderer = (_local12 as ITriangleDrawer);
_local13.screenDepth = _local10.screenZ;
_arg2.renderer.addToRenderList(_local13);
} else {
_arg2.renderStatistics.culledTriangles++;
};
};
return ((this.screenZ = (_local4 / _local5)));
//unresolved jump
};
return (0);
}
override public function clone():DisplayObject3D{
var _local1:DisplayObject3D;
var _local2:TriangleMesh3D;
_local1 = super.clone();
_local2 = new TriangleMesh3D(this.material, [], [], _local1.name);
if (this.materials){
_local2.materials = this.materials.clone();
};
if (_local1.geometry){
_local2.geometry = _local1.geometry.clone(_local2);
};
_local2.copyTransform(this.transform);
return (_local2);
}
public function mergeVertices():void{
var _local1:Dictionary;
var _local2:Array;
var _local3:Vertex3D;
var _local4:Triangle3D;
var _local5:Vertex3D;
_local1 = new Dictionary();
_local2 = new Array();
for each (_local3 in this.geometry.vertices) {
for each (_local5 in _local1) {
if ((((((_local3.x == _local5.x)) && ((_local3.y == _local5.y)))) && ((_local3.z == _local5.z)))){
_local1[_local3] = _local5;
break;
};
};
if (!_local1[_local3]){
_local1[_local3] = _local3;
_local2.push(_local3);
};
};
this.geometry.vertices = _local2;
for each (_local4 in geometry.faces) {
_local4.v0 = _local1[_local4.v0];
_local4.v1 = _local1[_local4.v1];
_local4.v2 = _local1[_local4.v2];
};
}
override public function set material(_arg1:MaterialObject3D):void{
var _local2:Triangle3D;
super.material = _arg1;
for each (_local2 in geometry.faces) {
_local2.material = _arg1;
};
}
public function quarterFaces():void{
var _local1:Array;
var _local2:Array;
var _local3:Array;
var _local4:Triangle3D;
var _local5:int;
var _local6:Vertex3D;
var _local7:Vertex3D;
var _local8:Vertex3D;
var _local9:Vertex3D;
var _local10:Vertex3D;
var _local11:Vertex3D;
var _local12:NumberUV;
var _local13:NumberUV;
var _local14:NumberUV;
var _local15:NumberUV;
var _local16:NumberUV;
var _local17:NumberUV;
var _local18:Triangle3D;
var _local19:Triangle3D;
var _local20:Triangle3D;
var _local21:Triangle3D;
_local1 = new Array();
_local2 = new Array();
_local3 = this.geometry.faces;
_local5 = _local3.length;
while ((_local4 = _local3[--_local5])) {
_local6 = _local4.v0;
_local7 = _local4.v1;
_local8 = _local4.v2;
_local9 = new Vertex3D(((_local6.x + _local7.x) / 2), ((_local6.y + _local7.y) / 2), ((_local6.z + _local7.z) / 2));
_local10 = new Vertex3D(((_local7.x + _local8.x) / 2), ((_local7.y + _local8.y) / 2), ((_local7.z + _local8.z) / 2));
_local11 = new Vertex3D(((_local8.x + _local6.x) / 2), ((_local8.y + _local6.y) / 2), ((_local8.z + _local6.z) / 2));
this.geometry.vertices.push(_local9, _local10, _local11);
_local12 = _local4.uv[0];
_local13 = _local4.uv[1];
_local14 = _local4.uv[2];
_local15 = new NumberUV(((_local12.u + _local13.u) / 2), ((_local12.v + _local13.v) / 2));
_local16 = new NumberUV(((_local13.u + _local14.u) / 2), ((_local13.v + _local14.v) / 2));
_local17 = new NumberUV(((_local14.u + _local12.u) / 2), ((_local14.v + _local12.v) / 2));
_local18 = new Triangle3D(this, [_local6, _local9, _local11], _local4.material, [_local12, _local15, _local17]);
_local19 = new Triangle3D(this, [_local9, _local7, _local10], _local4.material, [_local15, _local13, _local16]);
_local20 = new Triangle3D(this, [_local11, _local10, _local8], _local4.material, [_local17, _local16, _local14]);
_local21 = new Triangle3D(this, [_local9, _local10, _local11], _local4.material, [_local15, _local16, _local17]);
_local2.push(_local18, _local19, _local20, _local21);
};
this.geometry.faces = _local2;
this.mergeVertices();
this.geometry.ready = true;
}
public function projectTexture(_arg1:String="x", _arg2:String="y"):void{
var _local3:Array;
var _local4:Object;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:MaterialObject3D;
var _local10:String;
var _local11:Triangle3D;
var _local12:Array;
var _local13:Vertex3D;
var _local14:Vertex3D;
var _local15:Vertex3D;
var _local16:NumberUV;
var _local17:NumberUV;
var _local18:NumberUV;
_local3 = this.geometry.faces;
_local4 = this.boundingBox();
_local5 = _local4.min[_arg1];
_local6 = _local4.size[_arg1];
_local7 = _local4.min[_arg2];
_local8 = _local4.size[_arg2];
_local9 = this.material;
for (_local10 in _local3) {
_local11 = _local3[Number(_local10)];
_local12 = _local11.vertices;
_local13 = _local12[0];
_local14 = _local12[1];
_local15 = _local12[2];
_local16 = new NumberUV(((_local13[_arg1] - _local5) / _local6), ((_local13[_arg2] - _local7) / _local8));
_local17 = new NumberUV(((_local14[_arg1] - _local5) / _local6), ((_local14[_arg2] - _local7) / _local8));
_local18 = new NumberUV(((_local15[_arg1] - _local5) / _local6), ((_local15[_arg2] - _local7) / _local8));
_local11.uv = [_local16, _local17, _local18];
};
}
}
}//package org.papervision3d.core.geom
Section 102
//Vertices3D (org.papervision3d.core.geom.Vertices3D)
package org.papervision3d.core.geom {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.geom.*;
import org.papervision3d.core.math.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.culling.*;
public class Vertices3D extends DisplayObject3D {
public function Vertices3D(_arg1:Array, _arg2:String=null, _arg3:Object=null){
super(_arg2, new GeometryObject3D(), _arg3);
this.geometry.vertices = ((_arg1) || (new Array()));
}
public function projectFrustum(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{
var _local3:Matrix3D;
var _local4:Rectangle;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Vertex3D;
var _local27:Vertex3DInstance;
var _local28:Array;
var _local29:int;
_local3 = this.view;
_local4 = _arg2.camera.viewport;
_local5 = _local3.n11;
_local6 = _local3.n12;
_local7 = _local3.n13;
_local8 = _local3.n21;
_local9 = _local3.n22;
_local10 = _local3.n23;
_local11 = _local3.n31;
_local12 = _local3.n32;
_local13 = _local3.n33;
_local14 = _local3.n41;
_local15 = _local3.n42;
_local16 = _local3.n43;
_local24 = (_local4.width / 2);
_local25 = (_local4.height / 2);
_local28 = this.geometry.vertices;
_local29 = _local28.length;
while ((_local26 = _local28[--_local29])) {
_local17 = _local26.x;
_local18 = _local26.y;
_local19 = _local26.z;
_local22 = ((((_local17 * _local11) + (_local18 * _local12)) + (_local19 * _local13)) + _local3.n34);
_local23 = ((((_local17 * _local14) + (_local18 * _local15)) + (_local19 * _local16)) + _local3.n44);
_local27 = _local26.vertex3DInstance;
_local22 = (_local22 / _local23);
if ((_local27.visible = (((_local22 > 0)) && ((_local22 < 1))))){
_local20 = (((((_local17 * _local5) + (_local18 * _local6)) + (_local19 * _local7)) + _local3.n14) / _local23);
_local21 = (((((_local17 * _local8) + (_local18 * _local9)) + (_local19 * _local10)) + _local3.n24) / _local23);
_local27.x = (_local20 * _local24);
_local27.y = (_local21 * _local25);
_local27.z = (_local22 * _local23);
};
};
return (0);
}
override public function project(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{
var _local3:Matrix3D;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Vertex3D;
var _local20:Vertex3DInstance;
var _local21:Number;
var _local22:Array;
var _local23:int;
var _local24:Number;
var _local25:Number;
super.project(_arg1, _arg2);
if (this.culled){
return (0);
};
if ((_arg2.camera is IObjectCuller)){
return (projectFrustum(_arg1, _arg2));
};
_local3 = this.view;
_local4 = _local3.n11;
_local5 = _local3.n12;
_local6 = _local3.n13;
_local7 = _local3.n21;
_local8 = _local3.n22;
_local9 = _local3.n23;
_local10 = _local3.n31;
_local11 = _local3.n32;
_local12 = _local3.n33;
_local22 = this.geometry.vertices;
_local23 = _local22.length;
_local24 = _arg2.camera.focus;
_local25 = (_local24 * _arg2.camera.zoom);
while ((_local19 = _local22[--_local23])) {
_local13 = _local19.x;
_local14 = _local19.y;
_local15 = _local19.z;
_local18 = ((((_local13 * _local10) + (_local14 * _local11)) + (_local15 * _local12)) + _local3.n34);
_local20 = _local19.vertex3DInstance;
if ((_local20.visible = ((_local24 + _local18) > 0))){
_local16 = ((((_local13 * _local4) + (_local14 * _local5)) + (_local15 * _local6)) + _local3.n14);
_local17 = ((((_local13 * _local7) + (_local14 * _local8)) + (_local15 * _local9)) + _local3.n24);
_local21 = (_local25 / (_local24 + _local18));
_local20.x = (_local16 * _local21);
_local20.y = (_local17 * _local21);
_local20.z = _local18;
};
};
return (0);
}
override public function clone():DisplayObject3D{
var _local1:DisplayObject3D;
var _local2:Vertices3D;
_local1 = super.clone();
_local2 = new Vertices3D(null, _local1.name);
_local2.material = _local1.material;
if (_local1.materials){
_local2.materials = _local1.materials.clone();
};
if (this.geometry){
_local2.geometry = this.geometry.clone(_local2);
};
_local2.copyTransform(this.transform);
return (_local2);
}
public function transformVertices(_arg1:Matrix3D):void{
geometry.transformVertices(_arg1);
}
public function boundingBox():Object{
var _local1:Array;
var _local2:Object;
var _local3:Vertex3D;
_local1 = this.geometry.vertices;
_local2 = new Object();
_local2.min = new Number3D(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
_local2.max = new Number3D(-(Number.MAX_VALUE), -(Number.MAX_VALUE), -(Number.MAX_VALUE));
_local2.size = new Number3D();
for each (_local3 in _local1) {
_local2.min.x = Math.min(_local3.x, _local2.min.x);
_local2.min.y = Math.min(_local3.y, _local2.min.y);
_local2.min.z = Math.min(_local3.z, _local2.min.z);
_local2.max.x = Math.max(_local3.x, _local2.max.x);
_local2.max.y = Math.max(_local3.y, _local2.max.y);
_local2.max.z = Math.max(_local3.z, _local2.max.z);
};
_local2.size.x = (_local2.max.x - _local2.min.x);
_local2.size.y = (_local2.max.y - _local2.min.y);
_local2.size.z = (_local2.max.z - _local2.min.z);
return (_local2);
}
}
}//package org.papervision3d.core.geom
Section 103
//TriangleMaterial (org.papervision3d.core.material.TriangleMaterial)
package org.papervision3d.core.material {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.render.draw.*;
public class TriangleMaterial extends MaterialObject3D implements ITriangleDrawer {
override public function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void{
}
}
}//package org.papervision3d.core.material
Section 104
//FastRectangleTools (org.papervision3d.core.math.util.FastRectangleTools)
package org.papervision3d.core.math.util {
import flash.geom.*;
public class FastRectangleTools {
public static function intersection(_arg1:Rectangle, _arg2:Rectangle, _arg3:Rectangle=null):Rectangle{
if (!_arg3){
_arg3 = new Rectangle();
};
if (!intersects(_arg1, _arg2)){
_arg3.x = (_arg3.y = (_arg3.width = (_arg3.height = 0)));
return (_arg3);
};
_arg3.left = ((_arg1.left)>_arg2.left) ? _arg1.left : _arg2.left;
_arg3.right = ((_arg1.right)<_arg2.right) ? _arg1.right : _arg2.right;
_arg3.top = ((_arg1.top)>_arg2.top) ? _arg1.top : _arg2.top;
_arg3.bottom = ((_arg1.bottom)<_arg2.bottom) ? _arg1.bottom : _arg2.bottom;
return (_arg3);
}
public static function intersects(_arg1:Rectangle, _arg2:Rectangle):Boolean{
if (!(((_arg1.right < _arg2.left)) || ((_arg1.left > _arg2.right)))){
if (!(((_arg1.bottom < _arg2.top)) || ((_arg1.top > _arg2.bottom)))){
return (true);
};
};
return (false);
}
}
}//package org.papervision3d.core.math.util
Section 105
//AxisAlignedBoundingBox (org.papervision3d.core.math.AxisAlignedBoundingBox)
package org.papervision3d.core.math {
import org.papervision3d.core.geom.renderables.*;
public class AxisAlignedBoundingBox {
public var minX:Number;
public var minY:Number;
public var minZ:Number;
public var maxX:Number;
public var maxY:Number;
protected var _vertices:Array;
public var maxZ:Number;
public function AxisAlignedBoundingBox(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){
this.minX = _arg1;
this.minY = _arg2;
this.minZ = _arg3;
this.maxX = _arg4;
this.maxY = _arg5;
this.maxZ = _arg6;
createBoxVertices();
}
protected function createBoxVertices():void{
_vertices = new Array();
_vertices.push(new Vertex3D(minX, minY, minZ));
_vertices.push(new Vertex3D(minX, minY, maxZ));
_vertices.push(new Vertex3D(minX, maxY, minZ));
_vertices.push(new Vertex3D(minX, maxY, maxZ));
_vertices.push(new Vertex3D(maxX, minY, minZ));
_vertices.push(new Vertex3D(maxX, minY, maxZ));
_vertices.push(new Vertex3D(maxX, maxY, minZ));
_vertices.push(new Vertex3D(maxX, maxY, maxZ));
}
public function getBoxVertices():Array{
return (_vertices);
}
public static function createFromVertices(_arg1:Array):AxisAlignedBoundingBox{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Vertex3D;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = 0;
for each (_local8 in _arg1) {
_local2 = ((_local8.x)<_local2) ? _local8.x : _local2;
_local4 = ((_local8.y)<_local4) ? _local8.y : _local4;
_local6 = ((_local8.z)<_local6) ? _local8.z : _local6;
_local3 = ((_local8.x)>_local3) ? _local8.x : _local3;
_local5 = ((_local8.y)>_local5) ? _local8.y : _local5;
_local7 = ((_local8.z)>_local7) ? _local8.z : _local7;
};
return (new AxisAlignedBoundingBox(_local2, _local4, _local6, _local3, _local5, _local7));
}
}
}//package org.papervision3d.core.math
Section 106
//BoundingSphere (org.papervision3d.core.math.BoundingSphere)
package org.papervision3d.core.math {
import org.papervision3d.core.geom.renderables.*;
public class BoundingSphere {
public var maxDistance:Number;
public var radius:Number;
public function BoundingSphere(_arg1:Number){
this.maxDistance = _arg1;
this.radius = Math.sqrt(_arg1);
}
public static function getFromVertices(_arg1:Array):BoundingSphere{
var _local2:Number;
var _local3:Number;
var _local4:Vertex3D;
_local2 = 0;
for each (_local4 in _arg1) {
_local3 = (((_local4.x * _local4.x) + (_local4.y * _local4.y)) + (_local4.z * _local4.z));
_local2 = ((_local3)>_local2) ? _local3 : _local2;
};
return (new BoundingSphere(_local2));
}
}
}//package org.papervision3d.core.math
Section 107
//Matrix3D (org.papervision3d.core.math.Matrix3D)
package org.papervision3d.core.math {
public class Matrix3D {
public var n31:Number;
public var n32:Number;
public var n11:Number;
public var n13:Number;
public var n14:Number;
public var n33:Number;
public var n12:Number;
public var n42:Number;
public var n21:Number;
public var n22:Number;
public var n23:Number;
public var n24:Number;
public var n34:Number;
public var n41:Number;
public var n43:Number;
public var n44:Number;
private static var _cos:Function = Math.cos;
private static var _sin:Function = Math.sin;
private static var temp:Matrix3D = Matrix3D.IDENTITY;
private static var n3Di:Number3D = Number3D.ZERO;
private static var n3Dj:Number3D = Number3D.ZERO;
private static var n3Dk:Number3D = Number3D.ZERO;
private static var toDEGREES:Number = 57.2957795130823;
private static var toRADIANS:Number = 0.0174532925199433;
public function Matrix3D(_arg1:Array=null){
reset(_arg1);
}
public function calculateMultiply3x3(_arg1:Matrix3D, _arg2:Matrix3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local3 = _arg1.n11;
_local4 = _arg2.n11;
_local5 = _arg1.n21;
_local6 = _arg2.n21;
_local7 = _arg1.n31;
_local8 = _arg2.n31;
_local9 = _arg1.n12;
_local10 = _arg2.n12;
_local11 = _arg1.n22;
_local12 = _arg2.n22;
_local13 = _arg1.n32;
_local14 = _arg2.n32;
_local15 = _arg1.n13;
_local16 = _arg2.n13;
_local17 = _arg1.n23;
_local18 = _arg2.n23;
_local19 = _arg1.n33;
_local20 = _arg2.n33;
this.n11 = (((_local3 * _local4) + (_local9 * _local6)) + (_local15 * _local8));
this.n12 = (((_local3 * _local10) + (_local9 * _local12)) + (_local15 * _local14));
this.n13 = (((_local3 * _local16) + (_local9 * _local18)) + (_local15 * _local20));
this.n21 = (((_local5 * _local4) + (_local11 * _local6)) + (_local17 * _local8));
this.n22 = (((_local5 * _local10) + (_local11 * _local12)) + (_local17 * _local14));
this.n23 = (((_local5 * _local16) + (_local11 * _local18)) + (_local17 * _local20));
this.n31 = (((_local7 * _local4) + (_local13 * _local6)) + (_local19 * _local8));
this.n32 = (((_local7 * _local10) + (_local13 * _local12)) + (_local19 * _local14));
this.n33 = (((_local7 * _local16) + (_local13 * _local18)) + (_local19 * _local20));
}
public function calculateMultiply4x4(_arg1:Matrix3D, _arg2:Matrix3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
_local3 = _arg1.n11;
_local4 = _arg2.n11;
_local5 = _arg1.n21;
_local6 = _arg2.n21;
_local7 = _arg1.n31;
_local8 = _arg2.n31;
_local9 = _arg1.n41;
_local10 = _arg2.n41;
_local11 = _arg1.n12;
_local12 = _arg2.n12;
_local13 = _arg1.n22;
_local14 = _arg2.n22;
_local15 = _arg1.n32;
_local16 = _arg2.n32;
_local17 = _arg1.n42;
_local18 = _arg2.n42;
_local19 = _arg1.n13;
_local20 = _arg2.n13;
_local21 = _arg1.n23;
_local22 = _arg2.n23;
_local23 = _arg1.n33;
_local24 = _arg2.n33;
_local25 = _arg1.n43;
_local26 = _arg2.n43;
_local27 = _arg1.n14;
_local28 = _arg2.n14;
_local29 = _arg1.n24;
_local30 = _arg2.n24;
_local31 = _arg1.n34;
_local32 = _arg2.n34;
_local33 = _arg1.n44;
_local34 = _arg2.n44;
this.n11 = (((_local3 * _local4) + (_local11 * _local6)) + (_local19 * _local8));
this.n12 = (((_local3 * _local12) + (_local11 * _local14)) + (_local19 * _local16));
this.n13 = (((_local3 * _local20) + (_local11 * _local22)) + (_local19 * _local24));
this.n14 = ((((_local3 * _local28) + (_local11 * _local30)) + (_local19 * _local32)) + _local27);
this.n21 = (((_local5 * _local4) + (_local13 * _local6)) + (_local21 * _local8));
this.n22 = (((_local5 * _local12) + (_local13 * _local14)) + (_local21 * _local16));
this.n23 = (((_local5 * _local20) + (_local13 * _local22)) + (_local21 * _local24));
this.n24 = ((((_local5 * _local28) + (_local13 * _local30)) + (_local21 * _local32)) + _local29);
this.n31 = (((_local7 * _local4) + (_local15 * _local6)) + (_local23 * _local8));
this.n32 = (((_local7 * _local12) + (_local15 * _local14)) + (_local23 * _local16));
this.n33 = (((_local7 * _local20) + (_local15 * _local22)) + (_local23 * _local24));
this.n34 = ((((_local7 * _local28) + (_local15 * _local30)) + (_local23 * _local32)) + _local31);
this.n41 = (((_local9 * _local4) + (_local17 * _local6)) + (_local25 * _local8));
this.n42 = (((_local9 * _local12) + (_local17 * _local14)) + (_local25 * _local16));
this.n43 = (((_local9 * _local20) + (_local17 * _local22)) + (_local25 * _local24));
this.n44 = ((((_local9 * _local28) + (_local17 * _local30)) + (_local25 * _local32)) + _local33);
}
public function get det():Number{
return ((((((this.n11 * this.n22) - (this.n21 * this.n12)) * this.n33) - (((this.n11 * this.n32) - (this.n31 * this.n12)) * this.n23)) + (((this.n21 * this.n32) - (this.n31 * this.n22)) * this.n13)));
}
public function copy(_arg1:Matrix3D):Matrix3D{
this.n11 = _arg1.n11;
this.n12 = _arg1.n12;
this.n13 = _arg1.n13;
this.n14 = _arg1.n14;
this.n21 = _arg1.n21;
this.n22 = _arg1.n22;
this.n23 = _arg1.n23;
this.n24 = _arg1.n24;
this.n31 = _arg1.n31;
this.n32 = _arg1.n32;
this.n33 = _arg1.n33;
this.n34 = _arg1.n34;
return (this);
}
public function copy3x3(_arg1:Matrix3D):Matrix3D{
this.n11 = _arg1.n11;
this.n12 = _arg1.n12;
this.n13 = _arg1.n13;
this.n21 = _arg1.n21;
this.n22 = _arg1.n22;
this.n23 = _arg1.n23;
this.n31 = _arg1.n31;
this.n32 = _arg1.n32;
this.n33 = _arg1.n33;
return (this);
}
public function calculateAdd(_arg1:Matrix3D, _arg2:Matrix3D):void{
this.n11 = (_arg1.n11 + _arg2.n11);
this.n12 = (_arg1.n12 + _arg2.n12);
this.n13 = (_arg1.n13 + _arg2.n13);
this.n14 = (_arg1.n14 + _arg2.n14);
this.n21 = (_arg1.n21 + _arg2.n21);
this.n22 = (_arg1.n22 + _arg2.n22);
this.n23 = (_arg1.n23 + _arg2.n23);
this.n24 = (_arg1.n24 + _arg2.n24);
this.n31 = (_arg1.n31 + _arg2.n31);
this.n32 = (_arg1.n32 + _arg2.n32);
this.n33 = (_arg1.n33 + _arg2.n33);
this.n34 = (_arg1.n34 + _arg2.n34);
}
public function calculateMultiply(_arg1:Matrix3D, _arg2:Matrix3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
_local3 = _arg1.n11;
_local4 = _arg2.n11;
_local5 = _arg1.n21;
_local6 = _arg2.n21;
_local7 = _arg1.n31;
_local8 = _arg2.n31;
_local9 = _arg1.n12;
_local10 = _arg2.n12;
_local11 = _arg1.n22;
_local12 = _arg2.n22;
_local13 = _arg1.n32;
_local14 = _arg2.n32;
_local15 = _arg1.n13;
_local16 = _arg2.n13;
_local17 = _arg1.n23;
_local18 = _arg2.n23;
_local19 = _arg1.n33;
_local20 = _arg2.n33;
_local21 = _arg1.n14;
_local22 = _arg2.n14;
_local23 = _arg1.n24;
_local24 = _arg2.n24;
_local25 = _arg1.n34;
_local26 = _arg2.n34;
this.n11 = (((_local3 * _local4) + (_local9 * _local6)) + (_local15 * _local8));
this.n12 = (((_local3 * _local10) + (_local9 * _local12)) + (_local15 * _local14));
this.n13 = (((_local3 * _local16) + (_local9 * _local18)) + (_local15 * _local20));
this.n14 = ((((_local3 * _local22) + (_local9 * _local24)) + (_local15 * _local26)) + _local21);
this.n21 = (((_local5 * _local4) + (_local11 * _local6)) + (_local17 * _local8));
this.n22 = (((_local5 * _local10) + (_local11 * _local12)) + (_local17 * _local14));
this.n23 = (((_local5 * _local16) + (_local11 * _local18)) + (_local17 * _local20));
this.n24 = ((((_local5 * _local22) + (_local11 * _local24)) + (_local17 * _local26)) + _local23);
this.n31 = (((_local7 * _local4) + (_local13 * _local6)) + (_local19 * _local8));
this.n32 = (((_local7 * _local10) + (_local13 * _local12)) + (_local19 * _local14));
this.n33 = (((_local7 * _local16) + (_local13 * _local18)) + (_local19 * _local20));
this.n34 = ((((_local7 * _local22) + (_local13 * _local24)) + (_local19 * _local26)) + _local25);
}
public function invert():void{
temp.copy(this);
calculateInverse(temp);
}
public function calculateInverse(_arg1:Matrix3D):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local2 = _arg1.det;
if (Math.abs(_local2) > 0.001){
_local2 = (1 / _local2);
_local3 = _arg1.n11;
_local4 = _arg1.n21;
_local5 = _arg1.n31;
_local6 = _arg1.n12;
_local7 = _arg1.n22;
_local8 = _arg1.n32;
_local9 = _arg1.n13;
_local10 = _arg1.n23;
_local11 = _arg1.n33;
_local12 = _arg1.n14;
_local13 = _arg1.n24;
_local14 = _arg1.n34;
this.n11 = (_local2 * ((_local7 * _local11) - (_local8 * _local10)));
this.n12 = (-(_local2) * ((_local6 * _local11) - (_local8 * _local9)));
this.n13 = (_local2 * ((_local6 * _local10) - (_local7 * _local9)));
this.n14 = (-(_local2) * (((_local6 * ((_local10 * _local14) - (_local11 * _local13))) - (_local7 * ((_local9 * _local14) - (_local11 * _local12)))) + (_local8 * ((_local9 * _local13) - (_local10 * _local12)))));
this.n21 = (-(_local2) * ((_local4 * _local11) - (_local5 * _local10)));
this.n22 = (_local2 * ((_local3 * _local11) - (_local5 * _local9)));
this.n23 = (-(_local2) * ((_local3 * _local10) - (_local4 * _local9)));
this.n24 = (_local2 * (((_local3 * ((_local10 * _local14) - (_local11 * _local13))) - (_local4 * ((_local9 * _local14) - (_local11 * _local12)))) + (_local5 * ((_local9 * _local13) - (_local10 * _local12)))));
this.n31 = (_local2 * ((_local4 * _local8) - (_local5 * _local7)));
this.n32 = (-(_local2) * ((_local3 * _local8) - (_local5 * _local6)));
this.n33 = (_local2 * ((_local3 * _local7) - (_local4 * _local6)));
this.n34 = (-(_local2) * (((_local3 * ((_local7 * _local14) - (_local8 * _local13))) - (_local4 * ((_local6 * _local14) - (_local8 * _local12)))) + (_local5 * ((_local6 * _local13) - (_local7 * _local12)))));
};
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + ((((((((int((n11 * 1000)) / 1000) + "\t\t") + (int((n12 * 1000)) / 1000)) + "\t\t") + (int((n13 * 1000)) / 1000)) + "\t\t") + (int((n14 * 1000)) / 1000)) + "\n"));
_local1 = (_local1 + ((((((((int((n21 * 1000)) / 1000) + "\t\t") + (int((n22 * 1000)) / 1000)) + "\t\t") + (int((n23 * 1000)) / 1000)) + "\t\t") + (int((n24 * 1000)) / 1000)) + "\n"));
_local1 = (_local1 + ((((((((int((n31 * 1000)) / 1000) + "\t\t") + (int((n32 * 1000)) / 1000)) + "\t\t") + (int((n33 * 1000)) / 1000)) + "\t\t") + (int((n34 * 1000)) / 1000)) + "\n"));
_local1 = (_local1 + ((((((((int((n41 * 1000)) / 1000) + "\t\t") + (int((n42 * 1000)) / 1000)) + "\t\t") + (int((n43 * 1000)) / 1000)) + "\t\t") + (int((n44 * 1000)) / 1000)) + "\n"));
return (_local1);
}
public function reset(_arg1:Array=null):void{
if (((!(_arg1)) || ((_arg1.length < 12)))){
n11 = (n22 = (n33 = (n44 = 1)));
n12 = (n13 = (n14 = (n21 = (n23 = (n24 = (n31 = (n32 = (n34 = (n41 = (n42 = (n43 = 0)))))))))));
} else {
n11 = _arg1[0];
n12 = _arg1[1];
n13 = _arg1[2];
n14 = _arg1[3];
n21 = _arg1[4];
n22 = _arg1[5];
n23 = _arg1[6];
n24 = _arg1[7];
n31 = _arg1[8];
n32 = _arg1[9];
n33 = _arg1[10];
n34 = _arg1[11];
if (_arg1.length == 16){
n41 = _arg1[12];
n42 = _arg1[13];
n43 = _arg1[14];
n44 = _arg1[15];
} else {
n41 = (n42 = (n43 = 0));
n44 = 1;
};
};
}
public static function rotationMatrixWithReference(_arg1:Number3D, _arg2:Number, _arg3:Number3D):Matrix3D{
var _local4:Matrix3D;
_local4 = Matrix3D.translationMatrix(_arg3.x, -(_arg3.y), _arg3.z);
Matrix3D.translationMatrix(_arg3.x, -(_arg3.y), _arg3.z).calculateMultiply(_local4, Matrix3D.rotationMatrix(_arg1.x, _arg1.y, _arg1.z, _arg2));
_local4.calculateMultiply(_local4, Matrix3D.translationMatrix(-(_arg3.x), _arg3.y, -(_arg3.z)));
return (_local4);
}
public static function multiplyVector(_arg1:Matrix3D, _arg2:Number3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = _arg2.x;
_local4 = _arg2.y;
_local5 = _arg2.z;
_arg2.x = ((((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13)) + _arg1.n14);
_arg2.y = ((((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23)) + _arg1.n24);
_arg2.z = ((((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33)) + _arg1.n34);
}
public static function multiplyVector4x4(_arg1:Matrix3D, _arg2:Number3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = _arg2.x;
_local4 = _arg2.y;
_local5 = _arg2.z;
_local6 = (1 / ((((_local3 * _arg1.n41) + (_local4 * _arg1.n42)) + (_local5 * _arg1.n43)) + _arg1.n44));
_arg2.x = ((((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13)) + _arg1.n14);
_arg2.y = ((((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23)) + _arg1.n24);
_arg2.z = ((((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33)) + _arg1.n34);
_arg2.x = (_arg2.x * _local6);
_arg2.y = (_arg2.y * _local6);
_arg2.z = (_arg2.z * _local6);
}
public static function multiply3x3(_arg1:Matrix3D, _arg2:Matrix3D):Matrix3D{
var _local3:Matrix3D;
_local3 = new (Matrix3D);
_local3.calculateMultiply3x3(_arg1, _arg2);
return (_local3);
}
public static function normalizeQuaternion(_arg1:Object):Object{
var _local2:Number;
_local2 = magnitudeQuaternion(_arg1);
_arg1.x = (_arg1.x / _local2);
_arg1.y = (_arg1.y / _local2);
_arg1.z = (_arg1.z / _local2);
_arg1.w = (_arg1.w / _local2);
return (_arg1);
}
public static function multiplyVector3x3(_arg1:Matrix3D, _arg2:Number3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = _arg2.x;
_local4 = _arg2.y;
_local5 = _arg2.z;
_arg2.x = (((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13));
_arg2.y = (((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23));
_arg2.z = (((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33));
}
public static function axis2quaternion(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Object{
var _local5:Number;
var _local6:Number;
var _local7:Object;
_local5 = Math.sin((_arg4 / 2));
_local6 = Math.cos((_arg4 / 2));
_local7 = new Object();
_local7.x = (_arg1 * _local5);
_local7.y = (_arg2 * _local5);
_local7.z = (_arg3 * _local5);
_local7.w = _local6;
return (normalizeQuaternion(_local7));
}
public static function translationMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
var _local4:Matrix3D;
_local4 = IDENTITY;
_local4.n14 = _arg1;
_local4.n24 = _arg2;
_local4.n34 = _arg3;
return (_local4);
}
public static function magnitudeQuaternion(_arg1:Object):Number{
return (Math.sqrt(((((_arg1.w * _arg1.w) + (_arg1.x * _arg1.x)) + (_arg1.y * _arg1.y)) + (_arg1.z * _arg1.z))));
}
public static function rotationX(_arg1:Number):Matrix3D{
var _local2:Matrix3D;
var _local3:Number;
var _local4:Number;
_local2 = IDENTITY;
_local3 = Math.cos(_arg1);
_local4 = Math.sin(_arg1);
_local2.n22 = _local3;
_local2.n23 = -(_local4);
_local2.n32 = _local4;
_local2.n33 = _local3;
return (_local2);
}
public static function rotationY(_arg1:Number):Matrix3D{
var _local2:Matrix3D;
var _local3:Number;
var _local4:Number;
_local2 = IDENTITY;
_local3 = Math.cos(_arg1);
_local4 = Math.sin(_arg1);
_local2.n11 = _local3;
_local2.n13 = -(_local4);
_local2.n31 = _local4;
_local2.n33 = _local3;
return (_local2);
}
public static function rotationZ(_arg1:Number):Matrix3D{
var _local2:Matrix3D;
var _local3:Number;
var _local4:Number;
_local2 = IDENTITY;
_local3 = Math.cos(_arg1);
_local4 = Math.sin(_arg1);
_local2.n11 = _local3;
_local2.n12 = -(_local4);
_local2.n21 = _local4;
_local2.n22 = _local3;
return (_local2);
}
public static function clone(_arg1:Matrix3D):Matrix3D{
return (new Matrix3D([_arg1.n11, _arg1.n12, _arg1.n13, _arg1.n14, _arg1.n21, _arg1.n22, _arg1.n23, _arg1.n24, _arg1.n31, _arg1.n32, _arg1.n33, _arg1.n34]));
}
public static function rotationMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Matrix3D=null):Matrix3D{
var _local6:Matrix3D;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
if (!_arg5){
_local6 = IDENTITY;
} else {
_local6 = _arg5;
};
_local7 = Math.cos(_arg4);
_local8 = Math.sin(_arg4);
_local9 = (1 - _local7);
_local10 = ((_arg1 * _arg2) * _local9);
_local11 = ((_arg2 * _arg3) * _local9);
_local12 = ((_arg1 * _arg3) * _local9);
_local13 = (_local8 * _arg3);
_local14 = (_local8 * _arg2);
_local15 = (_local8 * _arg1);
_local6.n11 = (_local7 + ((_arg1 * _arg1) * _local9));
_local6.n12 = (-(_local13) + _local10);
_local6.n13 = (_local14 + _local12);
_local6.n21 = (_local13 + _local10);
_local6.n22 = (_local7 + ((_arg2 * _arg2) * _local9));
_local6.n23 = (-(_local15) + _local11);
_local6.n31 = (-(_local14) + _local12);
_local6.n32 = (_local15 + _local11);
_local6.n33 = (_local7 + ((_arg3 * _arg3) * _local9));
return (_local6);
}
public static function add(_arg1:Matrix3D, _arg2:Matrix3D):Matrix3D{
var _local3:Matrix3D;
_local3 = new (Matrix3D);
_local3.calculateAdd(_arg1, _arg2);
return (_local3);
}
public static function multiply(_arg1:Matrix3D, _arg2:Matrix3D):Matrix3D{
var _local3:Matrix3D;
_local3 = new (Matrix3D);
_local3.calculateMultiply(_arg1, _arg2);
return (_local3);
}
public static function euler2quaternion(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Quaternion=null):Quaternion{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Quaternion;
_local5 = Math.sin((_arg1 * 0.5));
_local6 = Math.cos((_arg1 * 0.5));
_local7 = Math.sin((_arg2 * 0.5));
_local8 = Math.cos((_arg2 * 0.5));
_local9 = Math.sin((_arg3 * 0.5));
_local10 = Math.cos((_arg3 * 0.5));
_local11 = (_local6 * _local8);
_local12 = (_local5 * _local7);
if (!_arg4){
_local13 = new Quaternion();
} else {
_local13 = _arg4;
};
_local13.x = ((_local9 * _local11) - (_local10 * _local12));
_local13.y = (((_local10 * _local5) * _local8) + ((_local9 * _local6) * _local7));
_local13.z = (((_local10 * _local6) * _local7) - ((_local9 * _local5) * _local8));
_local13.w = ((_local10 * _local11) + (_local9 * _local12));
return (_local13);
}
public static function quaternion2matrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Matrix3D=null):Matrix3D{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Matrix3D;
_local6 = (_arg1 * _arg1);
_local7 = (_arg1 * _arg2);
_local8 = (_arg1 * _arg3);
_local9 = (_arg1 * _arg4);
_local10 = (_arg2 * _arg2);
_local11 = (_arg2 * _arg3);
_local12 = (_arg2 * _arg4);
_local13 = (_arg3 * _arg3);
_local14 = (_arg3 * _arg4);
if (!_arg5){
_local15 = IDENTITY;
} else {
_local15 = _arg5;
};
_local15.n11 = (1 - (2 * (_local10 + _local13)));
_local15.n12 = (2 * (_local7 - _local14));
_local15.n13 = (2 * (_local8 + _local12));
_local15.n21 = (2 * (_local7 + _local14));
_local15.n22 = (1 - (2 * (_local6 + _local13)));
_local15.n23 = (2 * (_local11 - _local9));
_local15.n31 = (2 * (_local8 - _local12));
_local15.n32 = (2 * (_local11 + _local9));
_local15.n33 = (1 - (2 * (_local6 + _local10)));
return (_local15);
}
public static function inverse(_arg1:Matrix3D):Matrix3D{
var _local2:Matrix3D;
_local2 = new (Matrix3D);
_local2.calculateInverse(_arg1);
return (_local2);
}
public static function euler2matrix(_arg1:Number3D):Matrix3D{
var _local2:Matrix3D;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
temp.reset();
_local2 = temp;
_local2 = temp;
_local3 = (_arg1.x * toRADIANS);
_local4 = (_arg1.y * toRADIANS);
_local5 = (_arg1.z * toRADIANS);
_local6 = Math.cos(_local3);
_local7 = Math.sin(_local3);
_local8 = Math.cos(_local4);
_local9 = Math.sin(_local4);
_local10 = Math.cos(_local5);
_local11 = Math.sin(_local5);
_local12 = (_local6 * _local9);
_local13 = (_local7 * _local9);
_local2.n11 = (_local8 * _local10);
_local2.n12 = (-(_local8) * _local11);
_local2.n13 = _local9;
_local2.n21 = ((_local13 * _local10) + (_local6 * _local11));
_local2.n22 = ((-(_local13) * _local11) + (_local6 * _local10));
_local2.n23 = (-(_local7) * _local8);
_local2.n31 = ((-(_local12) * _local10) + (_local7 * _local11));
_local2.n32 = ((_local12 * _local11) + (_local7 * _local10));
_local2.n33 = (_local6 * _local8);
return (_local2);
}
public static function scaleMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
var _local4:Matrix3D;
_local4 = IDENTITY;
_local4.n11 = _arg1;
_local4.n22 = _arg2;
_local4.n33 = _arg3;
return (_local4);
}
public static function rotateAxis(_arg1:Matrix3D, _arg2:Number3D):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = _arg2.x;
_local4 = _arg2.y;
_local5 = _arg2.z;
_arg2.x = (((_local3 * _arg1.n11) + (_local4 * _arg1.n12)) + (_local5 * _arg1.n13));
_arg2.y = (((_local3 * _arg1.n21) + (_local4 * _arg1.n22)) + (_local5 * _arg1.n23));
_arg2.z = (((_local3 * _arg1.n31) + (_local4 * _arg1.n32)) + (_local5 * _arg1.n33));
_arg2.normalize();
}
public static function matrix2euler(_arg1:Matrix3D, _arg2:Number3D=null):Number3D{
var _local3:Matrix3D;
var _local4:Matrix3D;
var _local5:Matrix3D;
var _local6:Number;
if (!_arg2){
_arg2 = Number3D.ZERO;
};
n3Di.reset(_arg1.n11, _arg1.n21, _arg1.n31);
n3Dj.reset(_arg1.n12, _arg1.n22, _arg1.n32);
n3Dk.reset(_arg1.n13, _arg1.n23, _arg1.n33);
n3Di.normalize();
n3Dj.normalize();
n3Dk.normalize();
temp.reset([n3Di.x, n3Dj.x, n3Dk.x, 0, n3Di.y, n3Dj.y, n3Dk.y, 0, n3Di.z, n3Dj.z, n3Dk.z, 0]);
_local3 = temp;
_arg2.x = Math.atan2(_local3.n23, _local3.n33);
_local4 = Matrix3D.rotationX(-(_arg2.x));
_local5 = Matrix3D.multiply(_local4, _local3);
_local6 = Math.sqrt(((_local5.n11 * _local5.n11) + (_local5.n21 * _local5.n21)));
_arg2.y = Math.atan2(-(_local5.n31), _local6);
_arg2.z = Math.atan2(-(_local5.n12), _local5.n11);
if (_arg2.x == Math.PI){
if (_arg2.y > 0){
_arg2.y = (_arg2.y - Math.PI);
} else {
_arg2.y = (_arg2.y + Math.PI);
};
_arg2.x = 0;
_arg2.z = (_arg2.z + Math.PI);
};
_arg2.x = (_arg2.x * toDEGREES);
_arg2.y = (_arg2.y * toDEGREES);
_arg2.z = (_arg2.z * toDEGREES);
return (_arg2);
}
public static function multiplyQuaternion(_arg1:Object, _arg2:Object):Object{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Object;
_local3 = _arg1.x;
_local4 = _arg1.y;
_local5 = _arg1.z;
_local6 = _arg1.w;
_local7 = _arg2.x;
_local8 = _arg2.y;
_local9 = _arg2.z;
_local10 = _arg2.w;
_local11 = new Object();
_local11.x = ((((_local6 * _local7) + (_local3 * _local10)) + (_local4 * _local9)) - (_local5 * _local8));
_local11.y = ((((_local6 * _local8) + (_local4 * _local10)) + (_local5 * _local7)) - (_local3 * _local9));
_local11.z = ((((_local6 * _local9) + (_local5 * _local10)) + (_local3 * _local8)) - (_local4 * _local7));
_local11.w = ((((_local6 * _local10) - (_local3 * _local7)) - (_local4 * _local8)) - (_local5 * _local9));
return (_local11);
}
public static function get IDENTITY():Matrix3D{
return (new Matrix3D([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]));
}
}
}//package org.papervision3d.core.math
Section 108
//Number2D (org.papervision3d.core.math.Number2D)
package org.papervision3d.core.math {
import org.papervision3d.*;
public class Number2D {
public var x:Number;
public var y:Number;
public static const DEGTORAD:Number = 0.0174532925199433;
public static const RADTODEG:Number = 57.2957795130823;
public function Number2D(_arg1:Number=0, _arg2:Number=0){
this.x = _arg1;
this.y = _arg2;
}
public function divideEq(_arg1:Number):void{
x = (x / _arg1);
y = (y / _arg1);
}
public function copyTo(_arg1:Number2D):void{
_arg1.x = this.x;
_arg1.y = this.y;
}
public function get moduloSquared():Number{
return (((this.x * this.x) + (this.y * this.y)));
}
public function angle():Number{
if (Papervision3D.useDEGREES){
return ((RADTODEG * Math.atan2(y, x)));
};
return (Math.atan2(y, x));
}
public function reset(_arg1:Number=0, _arg2:Number=0):void{
this.x = _arg1;
this.y = _arg2;
}
public function isModuloGreaterThan(_arg1:Number):Boolean{
return ((moduloSquared > (_arg1 * _arg1)));
}
public function clone():Number2D{
return (new Number2D(this.x, this.y));
}
public function reverse():void{
this.x = -(this.x);
this.y = -(this.y);
}
public function plusEq(_arg1:Number2D):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
public function rotate(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number2D;
if (Papervision3D.useDEGREES){
_arg1 = (_arg1 * DEGTORAD);
};
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
_local4 = clone();
this.x = ((_local4.x * _local2) - (_local4.y * _local3));
this.y = ((_local4.x * _local3) + (_local4.y * _local2));
}
public function toString():String{
var _local1:Number;
var _local2:Number;
_local1 = (Math.round((this.x * 1000)) / 1000);
_local2 = (Math.round((this.y * 1000)) / 1000);
return ((((("[" + _local1) + ", ") + _local2) + "]"));
}
public function isModuloEqualTo(_arg1:Number):Boolean{
return ((moduloSquared == (_arg1 * _arg1)));
}
public function multiplyEq(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
}
public function normalise():void{
var _local1:Number;
_local1 = this.modulo;
this.x = (this.x / _local1);
this.y = (this.y / _local1);
}
public function get modulo():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function isModuloLessThan(_arg1:Number):Boolean{
return ((moduloSquared < (_arg1 * _arg1)));
}
public function minusEq(_arg1:Number2D):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
public function copyFrom(_arg1:Number2D):void{
this.x = _arg1.x;
this.y = _arg1.y;
}
public static function multiplyScalar(_arg1:Number2D, _arg2:Number):Number2D{
return (new Number2D((_arg1.x * _arg2), (_arg1.y * _arg2)));
}
public static function add(_arg1:Number2D, _arg2:Number2D):Number2D{
return (new Number2D((_arg1.x = (_arg1.x + _arg2.x)), (_arg1.y + _arg2.y)));
}
public static function dot(_arg1:Number2D, _arg2:Number2D):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function subtract(_arg1:Number2D, _arg2:Number2D):Number2D{
return (new Number2D((_arg1.x - _arg2.x), (_arg1.y - _arg2.y)));
}
}
}//package org.papervision3d.core.math
Section 109
//Number3D (org.papervision3d.core.math.Number3D)
package org.papervision3d.core.math {
import org.papervision3d.*;
public class Number3D {
public var z:Number;
public var x:Number;
public var y:Number;
public static var toDEGREES:Number = 57.2957795130823;
private static var temp:Number3D = Number3D.ZERO;
public static var toRADIANS:Number = 0.0174532925199433;
public function Number3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function normalize():void{
var _local1:Number;
_local1 = this.modulo;
if (((!((_local1 == 0))) && (!((_local1 == 1))))){
this.x = (this.x / _local1);
this.y = (this.y / _local1);
this.z = (this.z / _local1);
};
}
public function copyTo(_arg1:Number3D):void{
_arg1.x = x;
_arg1.y = y;
_arg1.z = z;
}
public function get moduloSquared():Number{
return ((((this.x * this.x) + (this.y * this.y)) + (this.z * this.z)));
}
public function reset(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):void{
x = _arg1;
y = _arg2;
z = _arg3;
}
public function isModuloGreaterThan(_arg1:Number):Boolean{
return ((moduloSquared > (_arg1 * _arg1)));
}
public function rotateX(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (Papervision3D.useDEGREES){
_arg1 = (_arg1 * toRADIANS);
};
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
temp.copyFrom(this);
this.y = ((temp.y * _local2) - (temp.z * _local3));
this.z = ((temp.y * _local3) + (temp.z * _local2));
}
public function rotateY(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (Papervision3D.useDEGREES){
_arg1 = (_arg1 * toRADIANS);
};
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
temp.copyFrom(this);
this.x = ((temp.x * _local2) + (temp.z * _local3));
this.z = ((temp.x * -(_local3)) + (temp.z * _local2));
}
public function rotateZ(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (Papervision3D.useDEGREES){
_arg1 = (_arg1 * toRADIANS);
};
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
temp.copyFrom(this);
this.x = ((temp.x * _local2) - (temp.y * _local3));
this.y = ((temp.x * _local3) + (temp.y * _local2));
}
public function clone():Number3D{
return (new Number3D(this.x, this.y, this.z));
}
public function plusEq(_arg1:Number3D):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
}
public function toString():String{
return (((((("x:" + (Math.round((x * 100)) / 100)) + " y:") + (Math.round((y * 100)) / 100)) + " z:") + (Math.round((z * 100)) / 100)));
}
public function isModuloEqualTo(_arg1:Number):Boolean{
return ((moduloSquared == (_arg1 * _arg1)));
}
public function multiplyEq(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
}
public function get modulo():Number{
return (Math.sqrt((((this.x * this.x) + (this.y * this.y)) + (this.z * this.z))));
}
public function isModuloLessThan(_arg1:Number):Boolean{
return ((moduloSquared < (_arg1 * _arg1)));
}
public function minusEq(_arg1:Number3D):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
z = (z - _arg1.z);
}
public function copyFrom(_arg1:Number3D):void{
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
}
public static function sub(_arg1:Number3D, _arg2:Number3D):Number3D{
return (new Number3D((_arg1.x - _arg2.x), (_arg1.y - _arg2.y), (_arg1.z - _arg2.z)));
}
public static function add(_arg1:Number3D, _arg2:Number3D):Number3D{
return (new Number3D((_arg1.x + _arg2.x), (_arg1.y + _arg2.y), (_arg1.z + _arg2.z)));
}
public static function cross(_arg1:Number3D, _arg2:Number3D, _arg3:Number3D=null):Number3D{
if (!_arg3){
_arg3 = ZERO;
};
_arg3.reset(((_arg2.y * _arg1.z) - (_arg2.z * _arg1.y)), ((_arg2.z * _arg1.x) - (_arg2.x * _arg1.z)), ((_arg2.x * _arg1.y) - (_arg2.y * _arg1.x)));
return (_arg3);
}
public static function dot(_arg1:Number3D, _arg2:Number3D):Number{
return ((((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)) + (_arg2.z * _arg1.z)));
}
public static function get ZERO():Number3D{
return (new Number3D(0, 0, 0));
}
}
}//package org.papervision3d.core.math
Section 110
//NumberUV (org.papervision3d.core.math.NumberUV)
package org.papervision3d.core.math {
public class NumberUV {
public var u:Number;
public var v:Number;
public function NumberUV(_arg1:Number=0, _arg2:Number=0){
this.u = _arg1;
this.v = _arg2;
}
public function toString():String{
return (((("u:" + u) + " v:") + v));
}
public function clone():NumberUV{
return (new NumberUV(this.u, this.v));
}
public static function get ZERO():NumberUV{
return (new NumberUV(0, 0));
}
}
}//package org.papervision3d.core.math
Section 111
//Quaternion (org.papervision3d.core.math.Quaternion)
package org.papervision3d.core.math {
public class Quaternion {
private var _matrix:Matrix3D;
public var w:Number;
public var x:Number;
public var y:Number;
public var z:Number;
public static const EPSILON:Number = 1E-6;
public static const DEGTORAD:Number = 0.0174532925199433;
public static const RADTODEG:Number = 57.2957795130823;
public function Quaternion(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=1):void{
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.w = _arg4;
_matrix = Matrix3D.IDENTITY;
}
public function toString():String{
return (((((((("Quaternion: x:" + this.x) + " y:") + this.y) + " z:") + this.z) + " w:") + this.w));
}
public function normalize():void{
var _local1:Number;
var _local2:Number;
_local1 = this.modulo;
if (Math.abs(_local1) < EPSILON){
x = (y = (z = 0));
w = 1;
} else {
_local2 = (1 / _local1);
x = (x * _local2);
y = (y * _local2);
z = (z * _local2);
w = (w * _local2);
};
}
public function get modulo():Number{
return (Math.sqrt(((((x * x) + (y * y)) + (z * z)) + (w * w))));
}
public function toMatrix():Matrix3D{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local1 = (x * x);
_local2 = (x * y);
_local3 = (x * z);
_local4 = (x * w);
_local5 = (y * y);
_local6 = (y * z);
_local7 = (y * w);
_local8 = (z * z);
_local9 = (z * w);
_matrix.n11 = (1 - (2 * (_local5 + _local8)));
_matrix.n12 = (2 * (_local2 - _local9));
_matrix.n13 = (2 * (_local3 + _local7));
_matrix.n21 = (2 * (_local2 + _local9));
_matrix.n22 = (1 - (2 * (_local1 + _local8)));
_matrix.n23 = (2 * (_local6 - _local4));
_matrix.n31 = (2 * (_local3 - _local7));
_matrix.n32 = (2 * (_local6 + _local4));
_matrix.n33 = (1 - (2 * (_local1 + _local5)));
return (_matrix);
}
public function mult(_arg1:Quaternion):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = this.w;
_local3 = this.x;
_local4 = this.y;
_local5 = this.z;
x = ((((_local2 * _arg1.x) + (_local3 * _arg1.w)) + (_local4 * _arg1.z)) - (_local5 * _arg1.y));
y = ((((_local2 * _arg1.y) - (_local3 * _arg1.z)) + (_local4 * _arg1.w)) + (_local5 * _arg1.x));
z = ((((_local2 * _arg1.z) + (_local3 * _arg1.y)) - (_local4 * _arg1.x)) + (_local5 * _arg1.w));
w = ((((_local2 * _arg1.w) - (_local3 * _arg1.x)) - (_local4 * _arg1.y)) - (_local5 * _arg1.z));
}
public static function sub(_arg1:Quaternion, _arg2:Quaternion):Quaternion{
return (new Quaternion((_arg1.x - _arg2.x), (_arg1.y - _arg2.y), (_arg1.z - _arg2.z), (_arg1.w - _arg2.w)));
}
public static function add(_arg1:Quaternion, _arg2:Quaternion):Quaternion{
return (new Quaternion((_arg1.x + _arg2.x), (_arg1.y + _arg2.y), (_arg1.z + _arg2.z), (_arg1.w + _arg2.w)));
}
public static function createFromEuler(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=false):Quaternion{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Quaternion;
if (_arg4){
_arg1 = (_arg1 * DEGTORAD);
_arg2 = (_arg2 * DEGTORAD);
_arg3 = (_arg3 * DEGTORAD);
};
_local5 = Math.sin((_arg1 * 0.5));
_local6 = Math.cos((_arg1 * 0.5));
_local7 = Math.sin((_arg2 * 0.5));
_local8 = Math.cos((_arg2 * 0.5));
_local9 = Math.sin((_arg3 * 0.5));
_local10 = Math.cos((_arg3 * 0.5));
_local11 = (_local6 * _local8);
_local12 = (_local5 * _local7);
_local13 = new (Quaternion);
_local13.x = ((_local9 * _local11) - (_local10 * _local12));
_local13.y = (((_local10 * _local5) * _local8) + ((_local9 * _local6) * _local7));
_local13.z = (((_local10 * _local6) * _local7) - ((_local9 * _local5) * _local8));
_local13.w = ((_local10 * _local11) + (_local9 * _local12));
return (_local13);
}
public static function createFromMatrix(_arg1:Matrix3D):Quaternion{
var _local2:Quaternion;
var _local3:Number;
var _local4:Array;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Number;
var _local9:Array;
var _local10:Array;
_local2 = new (Quaternion);
_local4 = new Array(4);
_local8 = ((_arg1.n11 + _arg1.n22) + _arg1.n33);
if (_local8 > 0){
_local3 = Math.sqrt((_local8 + 1));
_local2.w = (_local3 / 2);
_local3 = (0.5 / _local3);
_local2.x = ((_arg1.n32 - _arg1.n23) * _local3);
_local2.y = ((_arg1.n13 - _arg1.n31) * _local3);
_local2.z = ((_arg1.n21 - _arg1.n12) * _local3);
} else {
_local9 = [1, 2, 0];
_local10 = [[_arg1.n11, _arg1.n12, _arg1.n13, _arg1.n14], [_arg1.n21, _arg1.n22, _arg1.n23, _arg1.n24], [_arg1.n31, _arg1.n32, _arg1.n33, _arg1.n34]];
_local5 = 0;
if (_local10[1][1] > _local10[0][0]){
_local5 = 1;
};
if (_local10[2][2] > _local10[_local5][_local5]){
_local5 = 2;
};
_local6 = _local9[_local5];
_local7 = _local9[_local6];
_local3 = Math.sqrt(((_local10[_local5][_local5] - (_local10[_local6][_local6] + _local10[_local7][_local7])) + 1));
_local4[_local5] = (_local3 * 0.5);
if (_local3 != 0){
_local3 = (0.5 / _local3);
};
_local4[3] = ((_local10[_local7][_local6] - _local10[_local6][_local7]) * _local3);
_local4[_local6] = ((_local10[_local6][_local5] + _local10[_local5][_local6]) * _local3);
_local4[_local7] = ((_local10[_local7][_local5] + _local10[_local5][_local7]) * _local3);
_local2.x = _local4[0];
_local2.y = _local4[1];
_local2.z = _local4[2];
_local2.w = _local4[3];
};
return (_local2);
}
public static function dot(_arg1:Quaternion, _arg2:Quaternion):Number{
return (((((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)) + (_arg1.z * _arg2.z)) + (_arg1.w * _arg2.w)));
}
public static function multiply(_arg1:Quaternion, _arg2:Quaternion):Quaternion{
var _local3:Quaternion;
_local3 = new (Quaternion);
_local3.x = ((((_arg1.w * _arg2.x) + (_arg1.x * _arg2.w)) + (_arg1.y * _arg2.z)) - (_arg1.z * _arg2.y));
_local3.y = ((((_arg1.w * _arg2.y) - (_arg1.x * _arg2.z)) + (_arg1.y * _arg2.w)) + (_arg1.z * _arg2.x));
_local3.z = ((((_arg1.w * _arg2.z) + (_arg1.x * _arg2.y)) - (_arg1.y * _arg2.x)) + (_arg1.z * _arg2.w));
_local3.w = ((((_arg1.w * _arg2.w) - (_arg1.x * _arg2.x)) - (_arg1.y * _arg2.y)) - (_arg1.z * _arg2.z));
return (_local3);
}
public static function createFromAxisAngle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Quaternion{
var _local5:Number;
var _local6:Number;
var _local7:Quaternion;
_local5 = Math.sin((_arg4 / 2));
_local6 = Math.cos((_arg4 / 2));
_local7 = new (Quaternion);
_local7.x = (_arg1 * _local5);
_local7.y = (_arg2 * _local5);
_local7.z = (_arg3 * _local5);
_local7.w = _local6;
_local7.normalize();
return (_local7);
}
public static function slerp(_arg1:Quaternion, _arg2:Quaternion, _arg3:Number):Quaternion{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = ((((_arg1.w * _arg2.w) + (_arg1.x * _arg2.x)) + (_arg1.y * _arg2.y)) + (_arg1.z * _arg2.z));
if (_local4 < 0){
_arg1.x = (_arg1.x * -1);
_arg1.y = (_arg1.y * -1);
_arg1.z = (_arg1.z * -1);
_arg1.w = (_arg1.w * -1);
_local4 = (_local4 * -1);
};
if ((_local4 + 1) > EPSILON){
if ((1 - _local4) >= EPSILON){
_local7 = Math.acos(_local4);
_local8 = (1 / Math.sin(_local7));
_local5 = (Math.sin((_local7 * (1 - _arg3))) * _local8);
_local6 = (Math.sin((_local7 * _arg3)) * _local8);
} else {
_local5 = (1 - _arg3);
_local6 = _arg3;
};
} else {
_arg2.y = -(_arg1.y);
_arg2.x = _arg1.x;
_arg2.w = -(_arg1.w);
_arg2.z = _arg1.z;
_local5 = Math.sin((Math.PI * (0.5 - _arg3)));
_local6 = Math.sin((Math.PI * _arg3));
};
return (new Quaternion(((_local5 * _arg1.x) + (_local6 * _arg2.x)), ((_local5 * _arg1.y) + (_local6 * _arg2.y)), ((_local5 * _arg1.z) + (_local6 * _arg2.z)), ((_local5 * _arg1.w) + (_local6 * _arg2.w))));
}
public static function createFromOrthoMatrix(_arg1:Matrix3D):Quaternion{
var _local2:Quaternion;
_local2 = new (Quaternion);
_local2.w = (Math.sqrt(Math.max(0, (((1 + _arg1.n11) + _arg1.n22) + _arg1.n33))) / 2);
_local2.x = (Math.sqrt(Math.max(0, (((1 + _arg1.n11) - _arg1.n22) - _arg1.n33))) / 2);
_local2.y = (Math.sqrt(Math.max(0, (((1 - _arg1.n11) + _arg1.n22) - _arg1.n33))) / 2);
_local2.z = (Math.sqrt(Math.max(0, (((1 - _arg1.n11) - _arg1.n22) + _arg1.n33))) / 2);
_local2.x = (((_arg1.n32 - _arg1.n23) < 0)) ? ((_local2.x < 0)) ? _local2.x : -(_local2.x) : ((_local2.x < 0)) ? -(_local2.x) : _local2.x;
_local2.y = (((_arg1.n13 - _arg1.n31) < 0)) ? ((_local2.y < 0)) ? _local2.y : -(_local2.y) : ((_local2.y < 0)) ? -(_local2.y) : _local2.y;
_local2.z = (((_arg1.n21 - _arg1.n12) < 0)) ? ((_local2.z < 0)) ? _local2.z : -(_local2.z) : ((_local2.z < 0)) ? -(_local2.z) : _local2.z;
return (_local2);
}
public static function conjugate(_arg1:Quaternion):Quaternion{
var _local2:Quaternion;
_local2 = new (Quaternion);
_local2.x = -(_arg1.x);
_local2.y = -(_arg1.y);
_local2.z = -(_arg1.z);
_local2.w = _arg1.w;
return (_local2);
}
public static function slerpOld(_arg1:Quaternion, _arg2:Quaternion, _arg3:Number):Quaternion{
var _local4:Quaternion;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local4 = new (Quaternion);
_local5 = ((((_arg1.w * _arg2.w) + (_arg1.x * _arg2.x)) + (_arg1.y * _arg2.y)) + (_arg1.z * _arg2.z));
if (Math.abs(_local5) >= 1){
_local4.w = _arg1.w;
_local4.x = _arg1.x;
_local4.y = _arg1.y;
_local4.z = _arg1.z;
return (_local4);
};
_local6 = Math.acos(_local5);
_local7 = Math.sqrt((1 - (_local5 * _local5)));
if (Math.abs(_local7) < 0.001){
_local4.w = ((_arg1.w * 0.5) + (_arg2.w * 0.5));
_local4.x = ((_arg1.x * 0.5) + (_arg2.x * 0.5));
_local4.y = ((_arg1.y * 0.5) + (_arg2.y * 0.5));
_local4.z = ((_arg1.z * 0.5) + (_arg2.z * 0.5));
return (_local4);
};
_local8 = (Math.sin(((1 - _arg3) * _local6)) / _local7);
_local9 = (Math.sin((_arg3 * _local6)) / _local7);
_local4.w = ((_arg1.w * _local8) + (_arg2.w * _local9));
_local4.x = ((_arg1.x * _local8) + (_arg2.x * _local9));
_local4.y = ((_arg1.y * _local8) + (_arg2.y * _local9));
_local4.z = ((_arg1.z * _local8) + (_arg2.z * _local9));
return (_local4);
}
}
}//package org.papervision3d.core.math
Section 112
//pv3dview (org.papervision3d.core.ns.pv3dview)
package org.papervision3d.core.ns {
public namespace pv3dview;
}//package org.papervision3d.core.ns
Section 113
//CameraObject3D (org.papervision3d.core.proto.CameraObject3D)
package org.papervision3d.core.proto {
import flash.geom.*;
import org.papervision3d.core.math.*;
import org.papervision3d.objects.*;
import org.papervision3d.*;
public class CameraObject3D extends DisplayObject3D {
public var eye:Matrix3D;
public var viewport:Rectangle;
public var zoom:Number;
public var sort:Boolean;
public var yUP:Boolean;
public var focus:Number;
public static const TYPE:String = "ABSTRACT";
public static var DEFAULT_POS:Number3D = new Number3D(0, 0, -1000);
public static var DEFAULT_UP:Number3D = new Number3D(0, 1, 0);
private static var _flipY:Matrix3D = Matrix3D.scaleMatrix(1, -1, 1);
public function CameraObject3D(_arg1:Number=3, _arg2:Number=500, _arg3:Object=null){
this.x = (_arg3) ? ((_arg3.x) || (DEFAULT_POS.x)) : DEFAULT_POS.x;
this.y = (_arg3) ? ((_arg3.y) || (DEFAULT_POS.y)) : DEFAULT_POS.y;
this.z = (_arg3) ? ((_arg3.z) || (DEFAULT_POS.z)) : DEFAULT_POS.z;
this.zoom = _arg1;
this.focus = _arg2;
this.eye = Matrix3D.IDENTITY;
this.sort = (_arg3) ? !((_arg3.sort == false)) : true;
if (Papervision3D.useRIGHTHANDED){
DEFAULT_UP.y = -1;
this.yUP = false;
this.lookAt(DisplayObject3D.ZERO);
} else {
this.yUP = true;
};
}
override public function lookAt(_arg1:DisplayObject3D, _arg2:Number3D=null):void{
if (this.yUP){
super.lookAt(_arg1, _arg2);
} else {
super.lookAt(_arg1, ((_arg2) || (DEFAULT_UP)));
};
}
public function unproject(_arg1:Number, _arg2:Number):Number3D{
var _local3:Number;
var _local4:Number3D;
_local3 = ((focus * zoom) / focus);
_local4 = new Number3D((_arg1 / _local3), (-(_arg2) / _local3), focus);
Matrix3D.multiplyVector3x3(transform, _local4);
return (_local4);
}
public function transformView(_arg1:Matrix3D=null):void{
if (this.yUP){
eye.calculateMultiply(((_arg1) || (this.transform)), _flipY);
eye.invert();
} else {
eye.calculateInverse(((_arg1) || (this.transform)));
};
}
public function pan(_arg1:Number):void{
super.yaw(_arg1);
}
public function tilt(_arg1:Number):void{
super.pitch(_arg1);
}
}
}//package org.papervision3d.core.proto
Section 114
//DisplayObjectContainer3D (org.papervision3d.core.proto.DisplayObjectContainer3D)
package org.papervision3d.core.proto {
import org.papervision3d.objects.*;
import flash.events.*;
import flash.utils.*;
public class DisplayObjectContainer3D extends EventDispatcher {
protected var _childrenByName:Object;
private var _childrenTotal:int;
public var root:DisplayObjectContainer3D;
protected var _children:Dictionary;
public function DisplayObjectContainer3D():void{
this._children = new Dictionary(false);
this._childrenByName = new Dictionary(true);
this._childrenTotal = 0;
}
public function addChild(_arg1:DisplayObject3D, _arg2:String=null):DisplayObject3D{
_arg2 = ((((_arg2) || (_arg1.name))) || (String(_arg1.id)));
this._children[_arg1] = _arg2;
this._childrenByName[_arg2] = _arg1;
this._childrenTotal++;
_arg1.parent = this;
_arg1.root = this.root;
return (_arg1);
}
private function findChildByName(_arg1:String, _arg2:DisplayObject3D=null):DisplayObject3D{
var _local3:DisplayObject3D;
var _local4:DisplayObject3D;
_arg2 = ((_arg2) || (DisplayObject3D(this)));
if (!_arg2){
return (null);
};
if (_arg2.name == _arg1){
return (_arg2);
};
for each (_local3 in _arg2.children) {
_local4 = findChildByName(_arg1, _local3);
if (_local4){
return (_local4);
};
};
return (null);
}
public function getChildByName(_arg1:String, _arg2:Boolean=false):DisplayObject3D{
if (_arg2){
return (findChildByName(_arg1));
};
return (this._childrenByName[_arg1]);
}
public function get numChildren():int{
return (this._childrenTotal);
}
public function removeChildByName(_arg1:String):DisplayObject3D{
return (removeChild(getChildByName(_arg1)));
}
override public function toString():String{
return (childrenList());
}
public function addChildren(_arg1:DisplayObject3D):DisplayObjectContainer3D{
var _local2:DisplayObject3D;
for each (_local2 in _arg1.children) {
_arg1.removeChild(_local2);
this.addChild(_local2);
};
return (this);
}
public function removeChild(_arg1:DisplayObject3D):DisplayObject3D{
if (_arg1){
delete this._childrenByName[this._children[_arg1]];
delete this._children[_arg1];
_arg1.parent = null;
_arg1.root = null;
_childrenTotal--;
return (_arg1);
};
return (null);
}
public function childrenList():String{
var _local1:String;
var _local2:String;
_local1 = "";
for (_local2 in this._children) {
_local1 = (_local1 + (_local2 + "\n"));
};
return (_local1);
}
public function get children():Object{
return (this._childrenByName);
}
}
}//package org.papervision3d.core.proto
Section 115
//GeometryObject3D (org.papervision3d.core.proto.GeometryObject3D)
package org.papervision3d.core.proto {
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.math.*;
import org.papervision3d.objects.*;
import flash.events.*;
import flash.utils.*;
public class GeometryObject3D extends EventDispatcher {
protected var _boundingSphereDirty:Boolean;// = true
public var dirty:Boolean;
protected var _aabbDirty:Boolean;// = true
public var _ready:Boolean;// = false
protected var _boundingSphere:BoundingSphere;
public var faces:Array;
private var _numInstances:uint;// = 0
public var vertices:Array;
protected var _aabb:AxisAlignedBoundingBox;
public function GeometryObject3D(_arg1:Object=null):void{
_boundingSphereDirty = true;
_aabbDirty = true;
_numInstances = 0;
_ready = false;
super();
dirty = true;
}
public function transformVertices(_arg1:Matrix3D):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:int;
var _local15:Vertex3D;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
_local2 = _arg1.n11;
_local3 = _arg1.n12;
_local4 = _arg1.n13;
_local5 = _arg1.n21;
_local6 = _arg1.n22;
_local7 = _arg1.n23;
_local8 = _arg1.n31;
_local9 = _arg1.n32;
_local10 = _arg1.n33;
_local11 = _arg1.n14;
_local12 = _arg1.n24;
_local13 = _arg1.n34;
_local14 = vertices.length;
while ((_local15 = vertices[--_local14])) {
_local16 = _local15.x;
_local17 = _local15.y;
_local18 = _local15.z;
_local19 = ((((_local16 * _local2) + (_local17 * _local3)) + (_local18 * _local4)) + _local11);
_local20 = ((((_local16 * _local5) + (_local17 * _local6)) + (_local18 * _local7)) + _local12);
_local21 = ((((_local16 * _local8) + (_local17 * _local9)) + (_local18 * _local10)) + _local13);
_local15.x = _local19;
_local15.y = _local20;
_local15.z = _local21;
};
}
public function flipFaces():void{
var _local1:Triangle3D;
var _local2:Vertex3D;
for each (_local1 in this.faces) {
_local2 = _local1.v0;
_local1.v0 = _local1.v2;
_local1.v2 = _local2;
_local1.uv = [_local1.uv2, _local1.uv1, _local1.uv0];
_local1.createNormal();
};
this.ready = true;
}
private function createVertexNormals():void{
var _local1:Dictionary;
var _local2:Triangle3D;
var _local3:Vertex3D;
_local1 = new Dictionary(true);
for each (_local2 in faces) {
_local2.v0.connectedFaces[_local2] = _local2;
_local2.v1.connectedFaces[_local2] = _local2;
_local2.v2.connectedFaces[_local2] = _local2;
_local1[_local2.v0] = _local2.v0;
_local1[_local2.v1] = _local2.v1;
_local1[_local2.v2] = _local2.v2;
};
for each (_local3 in _local1) {
_local3.calculateNormal();
};
}
public function transformUV(_arg1:MaterialObject3D):void{
var _local2:String;
if (_arg1.bitmap){
for (_local2 in this.faces) {
faces[_local2].transformUV(_arg1);
};
};
}
public function clone(_arg1:DisplayObject3D=null):GeometryObject3D{
var _local2:Dictionary;
var _local3:Dictionary;
var _local4:GeometryObject3D;
var _local5:int;
var _local6:MaterialObject3D;
var _local7:Vertex3D;
var _local8:Triangle3D;
var _local9:Vertex3D;
var _local10:Vertex3D;
var _local11:Vertex3D;
_local2 = new Dictionary(true);
_local3 = new Dictionary(true);
_local4 = new GeometryObject3D();
_local4.vertices = new Array();
_local4.faces = new Array();
_local5 = 0;
while (_local5 < this.vertices.length) {
_local7 = this.vertices[_local5];
_local3[_local7] = _local7.clone();
_local4.vertices.push(_local3[_local7]);
_local5++;
};
_local5 = 0;
while (_local5 < this.faces.length) {
_local8 = this.faces[_local5];
_local9 = _local3[_local8.v0];
_local10 = _local3[_local8.v1];
_local11 = _local3[_local8.v2];
_local4.faces.push(new Triangle3D(_arg1, [_local9, _local10, _local11], _local8.material, _local8.uv));
_local2[_local8.material] = _local8.material;
_local5++;
};
for each (_local6 in _local2) {
_local6.registerObject(_arg1);
};
return (_local4);
}
public function set ready(_arg1:Boolean):void{
if (_arg1){
createVertexNormals();
this.dirty = false;
};
_ready = _arg1;
}
public function get ready():Boolean{
return (_ready);
}
public function get aabb():AxisAlignedBoundingBox{
if (_aabbDirty){
_aabb = AxisAlignedBoundingBox.createFromVertices(vertices);
_aabbDirty = false;
};
return (_aabb);
}
public function get boundingSphere():BoundingSphere{
if (_boundingSphereDirty){
_boundingSphere = BoundingSphere.getFromVertices(vertices);
_boundingSphereDirty = false;
};
return (_boundingSphere);
}
}
}//package org.papervision3d.core.proto
Section 116
//MaterialObject3D (org.papervision3d.core.proto.MaterialObject3D)
package org.papervision3d.core.proto {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.render.material.*;
import flash.events.*;
import flash.utils.*;
import org.papervision3d.core.render.draw.*;
import org.papervision3d.materials.*;
public class MaterialObject3D extends EventDispatcher implements ITriangleDrawer {
public var maxV:Number;
public var name:String;
public var heightOffset:Number;// = 0
public var fillAlpha:Number;// = 0
public var fillColor:Number;
public var id:Number;
protected var objects:Dictionary;
public var invisible:Boolean;// = false
public var smooth:Boolean;// = false
public var bitmap:BitmapData;
public var lineColor:Number;
public var lineAlpha:Number;// = 0
public var oneSide:Boolean;// = true
public var lineThickness:Number;// = 1
public var interactive:Boolean;// = false
public var opposite:Boolean;// = false
public var maxU:Number;
public var tiled:Boolean;// = false
public var widthOffset:Number;// = 0
public static var DEFAULT_COLOR:int = 0;
public static var DEBUG_COLOR:int = 0xFF00FF;
private static var _totalMaterialObjects:Number = 0;
public function MaterialObject3D(){
smooth = false;
tiled = false;
lineColor = DEFAULT_COLOR;
lineAlpha = 0;
lineThickness = 1;
fillColor = DEFAULT_COLOR;
fillAlpha = 0;
oneSide = true;
invisible = false;
opposite = false;
widthOffset = 0;
heightOffset = 0;
interactive = false;
super();
this.id = _totalMaterialObjects++;
MaterialManager.registerMaterial(this);
objects = new Dictionary(true);
}
public function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void{
}
public function get doubleSided():Boolean{
return (!(this.oneSide));
}
public function unregisterObject(_arg1:DisplayObject3D):void{
if (((objects) && (!((objects[_arg1] == null))))){
delete objects[_arg1];
};
}
public function set doubleSided(_arg1:Boolean):void{
this.oneSide = !(_arg1);
}
public function registerObject(_arg1:DisplayObject3D):void{
objects[_arg1] = _arg1;
}
public function updateBitmap():void{
}
override public function toString():String{
return (((((("[MaterialObject3D] bitmap:" + this.bitmap) + " lineColor:") + this.lineColor) + " fillColor:") + fillColor));
}
public function copy(_arg1:MaterialObject3D):void{
this.bitmap = _arg1.bitmap;
this.smooth = _arg1.smooth;
this.lineColor = _arg1.lineColor;
this.lineAlpha = _arg1.lineAlpha;
this.fillColor = _arg1.fillColor;
this.fillAlpha = _arg1.fillAlpha;
this.oneSide = _arg1.oneSide;
this.opposite = _arg1.opposite;
this.invisible = _arg1.invisible;
this.name = _arg1.name;
this.maxU = _arg1.maxU;
this.maxV = _arg1.maxV;
}
public function destroy():void{
objects = null;
bitmap = null;
MaterialManager.unRegisterMaterial(this);
}
public function clone():MaterialObject3D{
var _local1:MaterialObject3D;
_local1 = new MaterialObject3D();
_local1.copy(this);
return (_local1);
}
public static function get DEFAULT():MaterialObject3D{
var _local1:MaterialObject3D;
_local1 = new WireframeMaterial();
_local1.lineColor = (0xFFFFFF * Math.random());
_local1.lineAlpha = 1;
_local1.fillColor = DEFAULT_COLOR;
_local1.fillAlpha = 1;
_local1.doubleSided = false;
return (_local1);
}
public static function get DEBUG():MaterialObject3D{
var _local1:MaterialObject3D;
_local1 = new (MaterialObject3D);
_local1.lineColor = (0xFFFFFF * Math.random());
_local1.lineAlpha = 1;
_local1.fillColor = DEBUG_COLOR;
_local1.fillAlpha = 0.37;
_local1.doubleSided = true;
return (_local1);
}
}
}//package org.papervision3d.core.proto
Section 117
//SceneObject3D (org.papervision3d.core.proto.SceneObject3D)
package org.papervision3d.core.proto {
import org.papervision3d.materials.utils.*;
import org.papervision3d.objects.*;
import org.papervision3d.*;
public class SceneObject3D extends DisplayObjectContainer3D {
public var objects:Array;
public var materials:MaterialsList;
public function SceneObject3D(){
this.objects = new Array();
this.materials = new MaterialsList();
Papervision3D.log((((((Papervision3D.NAME + " ") + Papervision3D.VERSION) + " (") + Papervision3D.DATE) + ")\n"));
this.root = this;
}
override public function removeChild(_arg1:DisplayObject3D):DisplayObject3D{
var _local2:int;
super.removeChild(_arg1);
_local2 = 0;
while (_local2 < this.objects.length) {
if (this.objects[_local2] === _arg1){
this.objects.splice(_local2, 1);
return (_arg1);
};
_local2++;
};
return (_arg1);
}
override public function addChild(_arg1:DisplayObject3D, _arg2:String=null):DisplayObject3D{
var _local3:DisplayObject3D;
_local3 = super.addChild(_arg1, (_arg2) ? _arg2 : _arg1.name);
_arg1.scene = this;
this.objects.push(_local3);
return (_local3);
}
}
}//package org.papervision3d.core.proto
Section 118
//AbstractRenderListItem (org.papervision3d.core.render.command.AbstractRenderListItem)
package org.papervision3d.core.render.command {
import org.papervision3d.core.render.data.*;
import flash.display.*;
public class AbstractRenderListItem implements IRenderListItem {
public var screenDepth:Number;
public function render(_arg1:RenderSessionData, _arg2:Graphics):void{
}
}
}//package org.papervision3d.core.render.command
Section 119
//IRenderListItem (org.papervision3d.core.render.command.IRenderListItem)
package org.papervision3d.core.render.command {
import org.papervision3d.core.render.data.*;
import flash.display.*;
public interface IRenderListItem {
function render(_arg1:RenderSessionData, _arg2:Graphics):void;
}
}//package org.papervision3d.core.render.command
Section 120
//RenderableListItem (org.papervision3d.core.render.command.RenderableListItem)
package org.papervision3d.core.render.command {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.geom.*;
import org.papervision3d.objects.*;
public class RenderableListItem extends AbstractRenderListItem {
public var renderableInstance:AbstractRenderable;
public var renderable:Class;
public var instance:DisplayObject3D;
public function hitTestPoint2D(_arg1:Point, _arg2:RenderHitData):RenderHitData{
return (_arg2);
}
}
}//package org.papervision3d.core.render.command
Section 121
//RenderLine (org.papervision3d.core.render.command.RenderLine)
package org.papervision3d.core.render.command {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.math.*;
import org.papervision3d.materials.special.*;
public class RenderLine extends RenderableListItem implements IRenderListItem {
public var renderer:LineMaterial;
private var l1:Number2D;
private var l2:Number2D;
public var line:Line3D;
private var v:Number2D;
private var cp3d:Number3D;
private var p:Number2D;
private static var mouseVector:Number3D = Number3D.ZERO;
private static var lineVector:Number3D = Number3D.ZERO;
public function RenderLine(_arg1:Line3D){
this.renderable = Line3D;
this.renderableInstance = _arg1;
this.line = _arg1;
p = new Number2D();
l1 = new Number2D();
l2 = new Number2D();
v = new Number2D();
cp3d = new Number3D();
}
override public function render(_arg1:RenderSessionData, _arg2:Graphics):void{
renderer.drawLine(line, _arg2, _arg1);
}
override public function hitTestPoint2D(_arg1:Point, _arg2:RenderHitData):RenderHitData{
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (renderer.interactive){
_local3 = line.size;
p.reset(_arg1.x, _arg1.y);
l1.reset(line.v0.vertex3DInstance.x, line.v0.vertex3DInstance.y);
l2.reset(line.v1.vertex3DInstance.x, line.v1.vertex3DInstance.y);
v.copyFrom(l2);
v.minusEq(l1);
_local4 = ((((p.x - l1.x) * (l2.x - l1.x)) + ((p.y - l1.y) * (l2.y - l1.y))) / ((v.x * v.x) + (v.y * v.y)));
if ((((_local4 > 0)) && ((_local4 < 1)))){
v.multiplyEq(_local4);
v.plusEq(l1);
v.minusEq(p);
_local5 = ((v.x * v.x) + (v.y * v.y));
if (_local5 < (_local3 * _local3)){
_arg2.displayObject3D = line.instance;
_arg2.material = renderer;
_arg2.renderable = line;
_arg2.hasHit = true;
cp3d.reset((line.v1.x - line.v0.x), (line.v1.y - line.v0.y), (line.v1.x - line.v0.x));
cp3d.x = (cp3d.x * _local4);
cp3d.y = (cp3d.y * _local4);
cp3d.z = (cp3d.z * _local4);
cp3d.x = (cp3d.x + line.v0.x);
cp3d.y = (cp3d.y + line.v0.y);
cp3d.z = (cp3d.z + line.v0.z);
_arg2.x = cp3d.x;
_arg2.y = cp3d.y;
_arg2.z = cp3d.z;
_arg2.u = 0;
_arg2.v = 0;
return (_arg2);
};
};
};
return (_arg2);
}
}
}//package org.papervision3d.core.render.command
Section 122
//RenderParticle (org.papervision3d.core.render.command.RenderParticle)
package org.papervision3d.core.render.command {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.materials.special.*;
public class RenderParticle extends RenderableListItem implements IRenderListItem {
public var particle:Particle;
public var renderMat:ParticleMaterial;
public function RenderParticle(_arg1:Particle){
this.particle = _arg1;
this.renderableInstance = _arg1;
this.renderable = Particle;
}
override public function render(_arg1:RenderSessionData, _arg2:Graphics):void{
particle.material.drawParticle(particle, _arg2, _arg1);
}
override public function hitTestPoint2D(_arg1:Point, _arg2:RenderHitData):RenderHitData{
renderMat = particle.material;
if (renderMat.interactive){
if (particle.renderRect.contains(_arg1.x, _arg1.y)){
_arg2.displayObject3D = particle.instance;
_arg2.material = renderMat;
_arg2.renderable = particle;
_arg2.hasHit = true;
_arg2.x = particle.x;
_arg2.y = particle.y;
_arg2.z = particle.z;
_arg2.u = 0;
_arg2.v = 0;
return (_arg2);
};
};
return (_arg2);
}
}
}//package org.papervision3d.core.render.command
Section 123
//RenderTriangle (org.papervision3d.core.render.command.RenderTriangle)
package org.papervision3d.core.render.command {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.render.draw.*;
import org.papervision3d.materials.*;
public class RenderTriangle extends RenderableListItem implements IRenderListItem {
public var renderer:ITriangleDrawer;
public var triangle:Triangle3D;
public var container:Sprite;
private var position:Number3D;
public var renderMat:MaterialObject3D;
protected static var resPA:Vertex3DInstance = new Vertex3DInstance();
protected static var resBA:Vertex3DInstance = new Vertex3DInstance();
protected static var vPoint:Vertex3DInstance = new Vertex3DInstance();
protected static var resRA:Vertex3DInstance = new Vertex3DInstance();
public function RenderTriangle(_arg1:Triangle3D):void{
position = new Number3D();
super();
this.triangle = _arg1;
renderableInstance = _arg1;
renderable = Triangle3D;
}
override public function render(_arg1:RenderSessionData, _arg2:Graphics):void{
renderer.drawTriangle(triangle, _arg2, _arg1);
}
override public function hitTestPoint2D(_arg1:Point, _arg2:RenderHitData):RenderHitData{
var _local3:Vertex3DInstance;
var _local4:Vertex3DInstance;
var _local5:Vertex3DInstance;
var _local6:Vertex3DInstance;
renderMat = triangle.material;
if (!renderMat){
renderMat = triangle.instance.material;
};
if (renderMat.interactive){
_local3 = RenderTriangle.vPoint;
_local3.x = _arg1.x;
_local3.y = _arg1.y;
_local4 = triangle.v0.vertex3DInstance;
_local5 = triangle.v1.vertex3DInstance;
_local6 = triangle.v2.vertex3DInstance;
if (sameSide(_local3, _local4, _local5, _local6)){
if (sameSide(_local3, _local5, _local4, _local6)){
if (sameSide(_local3, _local6, _local4, _local5)){
return (deepHitTest(triangle, _local3, _arg2));
};
};
};
};
return (_arg2);
}
public function sameSide(_arg1:Vertex3DInstance, _arg2:Vertex3DInstance, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance):Boolean{
Vertex3DInstance.subTo(_arg4, _arg3, resBA);
Vertex3DInstance.subTo(_arg1, _arg3, resPA);
Vertex3DInstance.subTo(_arg2, _arg3, resRA);
return (((Vertex3DInstance.cross(resBA, resPA) * Vertex3DInstance.cross(resBA, resRA)) > 0));
}
private function deepHitTest(_arg1:Triangle3D, _arg2:Vertex3DInstance, _arg3:RenderHitData):RenderHitData{
var _local4:Vertex3DInstance;
var _local5:Vertex3DInstance;
var _local6:Vertex3DInstance;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Array;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:BitmapData;
var _local40:Number;
var _local41:Number;
_local4 = _arg1.v0.vertex3DInstance;
_local5 = _arg1.v1.vertex3DInstance;
_local6 = _arg1.v2.vertex3DInstance;
_local7 = (_local6.x - _local4.x);
_local8 = (_local6.y - _local4.y);
_local9 = (_local5.x - _local4.x);
_local10 = (_local5.y - _local4.y);
_local11 = (_arg2.x - _local4.x);
_local12 = (_arg2.y - _local4.y);
_local13 = ((_local7 * _local7) + (_local8 * _local8));
_local14 = ((_local7 * _local9) + (_local8 * _local10));
_local15 = ((_local7 * _local11) + (_local8 * _local12));
_local16 = ((_local9 * _local9) + (_local10 * _local10));
_local17 = ((_local9 * _local11) + (_local10 * _local12));
_local18 = (1 / ((_local13 * _local16) - (_local14 * _local14)));
_local19 = (((_local16 * _local15) - (_local14 * _local17)) * _local18);
_local20 = (((_local13 * _local17) - (_local14 * _local15)) * _local18);
_local21 = (_arg1.v2.x - _arg1.v0.x);
_local22 = (_arg1.v2.y - _arg1.v0.y);
_local23 = (_arg1.v2.z - _arg1.v0.z);
_local24 = (_arg1.v1.x - _arg1.v0.x);
_local25 = (_arg1.v1.y - _arg1.v0.y);
_local26 = (_arg1.v1.z - _arg1.v0.z);
_local27 = ((_arg1.v0.x + (_local21 * _local19)) + (_local24 * _local20));
_local28 = ((_arg1.v0.y + (_local22 * _local19)) + (_local25 * _local20));
_local29 = ((_arg1.v0.z + (_local23 * _local19)) + (_local26 * _local20));
_local30 = _arg1.uv;
_local31 = _local30[0].u;
_local32 = _local30[1].u;
_local33 = _local30[2].u;
_local34 = _local30[0].v;
_local35 = _local30[1].v;
_local36 = _local30[2].v;
_local37 = ((((_local32 - _local31) * _local20) + ((_local33 - _local31) * _local19)) + _local31);
_local38 = ((((_local35 - _local34) * _local20) + ((_local36 - _local34) * _local19)) + _local34);
if (triangle.material){
renderMat = _arg1.material;
} else {
renderMat = _arg1.instance.material;
};
_local39 = renderMat.bitmap;
_local40 = 1;
_local41 = 1;
if (_local39){
_local40 = (BitmapMaterial.AUTO_MIP_MAPPING) ? renderMat.widthOffset : _local39.width;
_local41 = (BitmapMaterial.AUTO_MIP_MAPPING) ? renderMat.heightOffset : _local39.height;
};
_arg3.displayObject3D = _arg1.instance;
_arg3.material = renderMat;
_arg3.renderable = _arg1;
_arg3.hasHit = true;
position.x = _local27;
position.y = _local28;
position.z = _local29;
Matrix3D.multiplyVector(_arg1.instance.world, position);
_arg3.x = position.x;
_arg3.y = position.y;
_arg3.z = position.z;
_arg3.u = (_local37 * _local40);
_arg3.v = (_local41 - (_local38 * _local41));
return (_arg3);
}
}
}//package org.papervision3d.core.render.command
Section 124
//RenderHitData (org.papervision3d.core.render.data.RenderHitData)
package org.papervision3d.core.render.data {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.objects.*;
public class RenderHitData {
public var y:Number;
public var endTime:int;// = 0
public var displayObject3D:DisplayObject3D;
public var startTime:int;// = 0
public var hasHit:Boolean;// = false
public var material:MaterialObject3D;
public var renderable:IRenderable;
public var u:Number;
public var v:Number;
public var x:Number;
public var z:Number;
public function RenderHitData():void{
startTime = 0;
endTime = 0;
hasHit = false;
super();
}
public function clear():void{
startTime = 0;
endTime = 0;
hasHit = false;
displayObject3D = null;
material = null;
renderable = null;
u = 0;
v = 0;
x = 0;
y = 0;
z = 0;
}
public function clone():RenderHitData{
var _local1:RenderHitData;
_local1 = new RenderHitData();
_local1.startTime = startTime;
_local1.endTime = endTime;
_local1.hasHit = hasHit;
_local1.displayObject3D = displayObject3D;
_local1.material = material;
_local1.renderable = renderable;
_local1.u = u;
_local1.v = v;
_local1.x = x;
_local1.y = y;
_local1.z = z;
return (_local1);
}
public function toString():String{
return (((displayObject3D + " ") + renderable));
}
}
}//package org.papervision3d.core.render.data
Section 125
//RenderSessionData (org.papervision3d.core.render.data.RenderSessionData)
package org.papervision3d.core.render.data {
import org.papervision3d.core.proto.*;
import org.papervision3d.view.*;
import flash.display.*;
import org.papervision3d.core.culling.*;
import org.papervision3d.core.render.*;
public class RenderSessionData {
public var renderer:IRenderEngine;
public var particleCuller:IParticleCuller;
public var viewPort:Viewport3D;
public var triangleCuller:ITriangleCuller;
public var container:Sprite;
public var scene:SceneObject3D;
public var renderStatistics:RenderStatistics;
public var renderObjects:Array;
public var camera:CameraObject3D;
public var renderLayers:Array;
public var sorted:Boolean;
public function RenderSessionData():void{
this.renderStatistics = new RenderStatistics();
}
public function destroy():void{
triangleCuller = null;
particleCuller = null;
viewPort = null;
container = null;
scene = null;
camera = null;
renderer = null;
renderStatistics = null;
renderObjects = null;
renderLayers = null;
}
public function clone():RenderSessionData{
var _local1:RenderSessionData;
_local1 = new RenderSessionData();
_local1.triangleCuller = triangleCuller;
_local1.particleCuller = particleCuller;
_local1.viewPort = viewPort;
_local1.container = container;
_local1.scene = scene;
_local1.camera = camera;
_local1.renderer = renderer;
_local1.renderStatistics = renderStatistics.clone();
return (_local1);
}
}
}//package org.papervision3d.core.render.data
Section 126
//RenderStatistics (org.papervision3d.core.render.data.RenderStatistics)
package org.papervision3d.core.render.data {
public class RenderStatistics {
public var renderTime:int;// = 0
public var culledObjects:int;// = 0
public var shadedTriangles:int;// = 0
public var culledParticles:int;// = 0
public var culledTriangles:int;// = 0
public var triangles:int;// = 0
public var particles:int;// = 0
public var rendered:int;// = 0
public var projectionTime:int;// = 0
public var filteredObjects:int;// = 0
public var lines:int;// = 0
public function RenderStatistics(){
projectionTime = 0;
renderTime = 0;
rendered = 0;
triangles = 0;
culledTriangles = 0;
particles = 0;
culledParticles = 0;
lines = 0;
shadedTriangles = 0;
filteredObjects = 0;
culledObjects = 0;
super();
}
public function clone():RenderStatistics{
var _local1:RenderStatistics;
_local1 = new RenderStatistics();
_local1.projectionTime = projectionTime;
_local1.renderTime = renderTime;
_local1.rendered = rendered;
_local1.particles = particles;
_local1.triangles = triangles;
_local1.culledTriangles = culledTriangles;
_local1.lines = lines;
_local1.shadedTriangles = shadedTriangles;
_local1.filteredObjects = filteredObjects;
_local1.culledObjects = culledObjects;
return (_local1);
}
public function clear():void{
projectionTime = 0;
renderTime = 0;
rendered = 0;
particles = 0;
triangles = 0;
culledTriangles = 0;
culledParticles = 0;
lines = 0;
shadedTriangles = 0;
filteredObjects = 0;
culledObjects = 0;
}
public function toString():String{
return (new String((((((((((((((((((("ProjectionTime:" + projectionTime) + " RenderTime:") + renderTime) + " Particles:") + particles) + " CulledParticles :") + culledParticles) + " Triangles:") + triangles) + " ShadedTriangles :") + shadedTriangles) + " CulledTriangles:") + culledTriangles) + " FilteredObjects:") + filteredObjects) + " CulledObjects:") + culledObjects) + "")));
}
}
}//package org.papervision3d.core.render.data
Section 127
//ILineDrawer (org.papervision3d.core.render.draw.ILineDrawer)
package org.papervision3d.core.render.draw {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
public interface ILineDrawer {
function drawLine(_arg1:Line3D, _arg2:Graphics, _arg3:RenderSessionData):void;
}
}//package org.papervision3d.core.render.draw
Section 128
//IParticleDrawer (org.papervision3d.core.render.draw.IParticleDrawer)
package org.papervision3d.core.render.draw {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
public interface IParticleDrawer {
function updateRenderRect(_arg1:Particle):void;
function drawParticle(_arg1:Particle, _arg2:Graphics, _arg3:RenderSessionData):void;
}
}//package org.papervision3d.core.render.draw
Section 129
//ITriangleDrawer (org.papervision3d.core.render.draw.ITriangleDrawer)
package org.papervision3d.core.render.draw {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
public interface ITriangleDrawer {
function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void;
}
}//package org.papervision3d.core.render.draw
Section 130
//BasicRenderFilter (org.papervision3d.core.render.filter.BasicRenderFilter)
package org.papervision3d.core.render.filter {
public class BasicRenderFilter implements IRenderFilter {
public function filter(_arg1:Array):int{
return (0);
}
}
}//package org.papervision3d.core.render.filter
Section 131
//IRenderFilter (org.papervision3d.core.render.filter.IRenderFilter)
package org.papervision3d.core.render.filter {
public interface IRenderFilter {
function filter(_arg1:Array):int;
}
}//package org.papervision3d.core.render.filter
Section 132
//IUpdateAfterMaterial (org.papervision3d.core.render.material.IUpdateAfterMaterial)
package org.papervision3d.core.render.material {
import org.papervision3d.core.render.data.*;
public interface IUpdateAfterMaterial {
function updateAfterRender(_arg1:RenderSessionData):void;
}
}//package org.papervision3d.core.render.material
Section 133
//IUpdateBeforeMaterial (org.papervision3d.core.render.material.IUpdateBeforeMaterial)
package org.papervision3d.core.render.material {
import org.papervision3d.core.render.data.*;
public interface IUpdateBeforeMaterial {
function updateBeforeRender(_arg1:RenderSessionData):void;
}
}//package org.papervision3d.core.render.material
Section 134
//MaterialManager (org.papervision3d.core.render.material.MaterialManager)
package org.papervision3d.core.render.material {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.data.*;
import flash.utils.*;
public class MaterialManager {
private var materials:Dictionary;
private static var instance:MaterialManager;
public function MaterialManager():void{
if (instance){
throw (new Error("Only 1 instance of materialmanager allowed"));
};
init();
}
private function init():void{
materials = new Dictionary(true);
}
private function _unRegisterMaterial(_arg1:MaterialObject3D):void{
delete materials[_arg1];
}
public function updateMaterialsAfterRender(_arg1:RenderSessionData):void{
var _local2:IUpdateAfterMaterial;
var _local3:MaterialObject3D;
for each (_local3 in materials) {
if ((_local3 is IUpdateAfterMaterial)){
_local2 = (_local3 as IUpdateAfterMaterial);
_local2.updateAfterRender(_arg1);
};
};
}
private function _registerMaterial(_arg1:MaterialObject3D):void{
materials[_arg1] = _arg1;
}
public function updateMaterialsBeforeRender(_arg1:RenderSessionData):void{
var _local2:IUpdateBeforeMaterial;
var _local3:MaterialObject3D;
for each (_local3 in materials) {
if ((_local3 is IUpdateBeforeMaterial)){
_local2 = (_local3 as IUpdateBeforeMaterial);
_local2.updateBeforeRender(_arg1);
};
};
}
public static function getInstance():MaterialManager{
if (!instance){
instance = new (MaterialManager);
};
return (instance);
}
public static function unRegisterMaterial(_arg1:MaterialObject3D):void{
getInstance()._unRegisterMaterial(_arg1);
}
public static function registerMaterial(_arg1:MaterialObject3D):void{
getInstance()._registerMaterial(_arg1);
}
}
}//package org.papervision3d.core.render.material
Section 135
//BasicProjectionPipeline (org.papervision3d.core.render.project.BasicProjectionPipeline)
package org.papervision3d.core.render.project {
import org.papervision3d.core.render.data.*;
import org.papervision3d.objects.*;
import org.papervision3d.core.culling.*;
public class BasicProjectionPipeline extends ProjectionPipeline {
public function BasicProjectionPipeline(){
init();
}
protected function init():void{
}
protected function projectObject(_arg1:DisplayObject3D, _arg2:RenderSessionData):void{
_arg1.project(_arg2.camera, _arg2);
}
override public function project(_arg1:RenderSessionData):void{
var _local2:Array;
var _local3:DisplayObject3D;
var _local4:Number;
_arg1.camera.transformView();
_local2 = _arg1.renderObjects;
_local4 = _local2.length;
if ((_arg1.camera is IObjectCuller)){
for each (_local3 in _local2) {
if (_local3.visible){
if (_arg1.viewPort.viewportObjectFilter){
if (_arg1.viewPort.viewportObjectFilter.testObject(_local3)){
_local3.view.calculateMultiply4x4(_arg1.camera.eye, _local3.transform);
projectObject(_local3, _arg1);
} else {
_arg1.renderStatistics.filteredObjects++;
};
} else {
_local3.view.calculateMultiply4x4(_arg1.camera.eye, _local3.transform);
projectObject(_local3, _arg1);
};
};
};
} else {
for each (_local3 in _local2) {
if (_local3.visible){
if (_arg1.viewPort.viewportObjectFilter){
if (_arg1.viewPort.viewportObjectFilter.testObject(_local3)){
_local3.view.calculateMultiply(_arg1.camera.eye, _local3.transform);
projectObject(_local3, _arg1);
} else {
_arg1.renderStatistics.filteredObjects++;
};
} else {
_local3.view.calculateMultiply(_arg1.camera.eye, _local3.transform);
projectObject(_local3, _arg1);
};
};
};
};
}
}
}//package org.papervision3d.core.render.project
Section 136
//ProjectionPipeline (org.papervision3d.core.render.project.ProjectionPipeline)
package org.papervision3d.core.render.project {
import org.papervision3d.core.render.data.*;
public class ProjectionPipeline {
public function project(_arg1:RenderSessionData):void{
}
}
}//package org.papervision3d.core.render.project
Section 137
//BasicRenderSorter (org.papervision3d.core.render.sort.BasicRenderSorter)
package org.papervision3d.core.render.sort {
public class BasicRenderSorter implements IRenderSorter {
public function sort(_arg1:Array):void{
_arg1.sortOn("screenDepth", Array.NUMERIC);
}
}
}//package org.papervision3d.core.render.sort
Section 138
//IRenderSorter (org.papervision3d.core.render.sort.IRenderSorter)
package org.papervision3d.core.render.sort {
public interface IRenderSorter {
function sort(_arg1:Array):void;
}
}//package org.papervision3d.core.render.sort
Section 139
//AbstractRenderEngine (org.papervision3d.core.render.AbstractRenderEngine)
package org.papervision3d.core.render {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.view.*;
import org.papervision3d.core.render.command.*;
import flash.events.*;
public class AbstractRenderEngine extends EventDispatcher implements IRenderEngine {
public function AbstractRenderEngine(_arg1:IEventDispatcher=null){
super(_arg1);
}
public function removeFromRenderList(_arg1:IRenderListItem):int{
return (0);
}
public function addToRenderList(_arg1:IRenderListItem):int{
return (0);
}
public function renderScene(_arg1:SceneObject3D, _arg2:CameraObject3D, _arg3:Viewport3D, _arg4:Boolean=true):RenderStatistics{
return (null);
}
}
}//package org.papervision3d.core.render
Section 140
//IRenderEngine (org.papervision3d.core.render.IRenderEngine)
package org.papervision3d.core.render {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.view.*;
import org.papervision3d.core.render.command.*;
public interface IRenderEngine {
function addToRenderList(_arg1:IRenderListItem):int;
function removeFromRenderList(_arg1:IRenderListItem):int;
function renderScene(_arg1:SceneObject3D, _arg2:CameraObject3D, _arg3:Viewport3D, _arg4:Boolean=true):RenderStatistics;
}
}//package org.papervision3d.core.render
Section 141
//IVirtualMouseEvent (org.papervision3d.core.utils.virtualmouse.IVirtualMouseEvent)
package org.papervision3d.core.utils.virtualmouse {
public interface IVirtualMouseEvent {
}
}//package org.papervision3d.core.utils.virtualmouse
Section 142
//VirtualMouse (org.papervision3d.core.utils.virtualmouse.VirtualMouse)
package org.papervision3d.core.utils.virtualmouse {
import flash.display.*;
import flash.geom.*;
import com.blitzagency.xray.logger.*;
import flash.events.*;
import flash.utils.*;
import org.papervision3d.core.components.as3.utils.*;
public class VirtualMouse extends EventDispatcher {
private var _container:Sprite;
private var lastDownTarget:DisplayObject;
private var target:InteractiveObject;
private var updateMouseDown:Boolean;// = false
private var eventEvent:Class;
private var _lastEvent:Event;
private var mouseEventEvent:Class;
private var location:Point;
private var delta:int;// = 0
private var disabledEvents:Object;
private var log:XrayLog;
private var ignoredInstances:Dictionary;
private var isLocked:Boolean;// = false
private var lastWithinStage:Boolean;// = true
private var lastLocation:Point;
private var isDoubleClickEvent:Boolean;// = false
private var lastMouseDown:Boolean;// = false
private var altKey:Boolean;// = false
private var _useNativeEvents:Boolean;// = false
private var ctrlKey:Boolean;// = false
private var shiftKey:Boolean;// = false
private var _stage:Stage;
public static const UPDATE:String = "update";
private static var _mouseIsDown:Boolean = false;
public function VirtualMouse(_arg1:Stage=null, _arg2:Sprite=null, _arg3:Number=0, _arg4:Number=0){
altKey = false;
ctrlKey = false;
shiftKey = false;
delta = 0;
isLocked = false;
isDoubleClickEvent = false;
disabledEvents = new Object();
ignoredInstances = new Dictionary(true);
lastMouseDown = false;
updateMouseDown = false;
lastWithinStage = true;
_useNativeEvents = false;
eventEvent = VirtualMouseEvent;
mouseEventEvent = VirtualMouseMouseEvent;
log = new XrayLog();
super();
this.stage = _arg1;
this.container = _arg2;
location = new Point(_arg3, _arg4);
lastLocation = location.clone();
addEventListener(UPDATE, handleUpdate);
update();
}
public function get mouseIsDown():Boolean{
return (_mouseIsDown);
}
public function get stage():Stage{
return (_stage);
}
public function exitContainer():void{
var _local1:Point;
_local1 = target.globalToLocal(location);
if (!disabledEvents[MouseEvent.MOUSE_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
container.dispatchEvent(new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
dispatchEvent(new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
};
if (!disabledEvents[MouseEvent.ROLL_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
container.dispatchEvent(new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
dispatchEvent(new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
};
if (target != container){
if (!disabledEvents[MouseEvent.MOUSE_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
target.dispatchEvent(new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
dispatchEvent(new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
};
if (!disabledEvents[MouseEvent.ROLL_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
target.dispatchEvent(new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
dispatchEvent(new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local1.x, _local1.y, container, ctrlKey, altKey, shiftKey, _mouseIsDown, delta));
};
};
target = _stage;
}
public function release():void{
updateMouseDown = true;
_mouseIsDown = false;
if (!isLocked){
update();
};
}
public function click():void{
press();
release();
}
public function get container():Sprite{
return (_container);
}
public function set container(_arg1:Sprite):void{
_container = _arg1;
}
public function get y():Number{
return (location.y);
}
public function set x(_arg1:Number):void{
location.x = _arg1;
if (!isLocked){
update();
};
}
public function disableEvent(_arg1:String):void{
disabledEvents[_arg1] = true;
}
public function get lastEvent():Event{
return (_lastEvent);
}
private function handleUpdate(_arg1:Event):void{
var _local2:Point;
var _local3:Array;
var _local4:InteractiveObject;
var _local5:DisplayObject;
var _local6:int;
var _local7:Point;
var _local8:Point;
var _local9:Boolean;
if (!container){
return;
};
_local2 = CoordinateTools.localToLocal(container, stage, location);
_local3 = container.getObjectsUnderPoint(location);
_local6 = _local3.length;
while (_local6--) {
_local5 = _local3[_local6];
while (_local5) {
if (ignoredInstances[_local5]){
_local4 = null;
break;
};
if (((_local4) && ((_local5 is SimpleButton)))){
_local4 = null;
} else {
if (((_local4) && (!(DisplayObjectContainer(_local5).mouseChildren)))){
_local4 = null;
};
};
if (((((!(_local4)) && ((_local5 is InteractiveObject)))) && (InteractiveObject(_local5).mouseEnabled))){
_local4 = InteractiveObject(_local5);
};
_local5 = _local5.parent;
};
if (_local4){
break;
};
};
if (!_local4){
_local4 = _stage;
};
_local7 = target.globalToLocal(location);
_local8 = _local4.globalToLocal(location);
if (((!((lastLocation.x == location.x))) || (!((lastLocation.y == location.y))))){
_local9 = false;
if (stage){
_local9 = (((((((location.x >= 0)) && ((location.y >= 0)))) && ((location.x <= stage.stageWidth)))) && ((location.y <= stage.stageHeight)));
};
if (((((!(_local9)) && (lastWithinStage))) && (!(disabledEvents[Event.MOUSE_LEAVE])))){
_lastEvent = new eventEvent(Event.MOUSE_LEAVE, false, false);
stage.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (((_local9) && (!(disabledEvents[MouseEvent.MOUSE_MOVE])))){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_MOVE, true, false, _local8.x, _local8.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local4.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastWithinStage = _local9;
};
if (_local4 != target){
if (!disabledEvents[MouseEvent.MOUSE_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OUT, true, false, _local7.x, _local7.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
target.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (!disabledEvents[MouseEvent.ROLL_OUT]){
_lastEvent = new mouseEventEvent(MouseEvent.ROLL_OUT, false, false, _local7.x, _local7.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
target.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (!disabledEvents[MouseEvent.MOUSE_OVER]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_OVER, true, false, _local8.x, _local8.y, target, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local4.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (!disabledEvents[MouseEvent.ROLL_OVER]){
_lastEvent = new mouseEventEvent(MouseEvent.ROLL_OVER, false, false, _local8.x, _local8.y, target, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local4.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
};
if (updateMouseDown){
if (_mouseIsDown){
if (!disabledEvents[MouseEvent.MOUSE_DOWN]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_DOWN, true, false, _local8.x, _local8.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local4.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastDownTarget = _local4;
updateMouseDown = false;
} else {
if (!disabledEvents[MouseEvent.MOUSE_UP]){
_lastEvent = new mouseEventEvent(MouseEvent.MOUSE_UP, true, false, _local8.x, _local8.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local4.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
if (((!(disabledEvents[MouseEvent.CLICK])) && ((_local4 == lastDownTarget)))){
_lastEvent = new mouseEventEvent(MouseEvent.CLICK, true, false, _local8.x, _local8.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local4.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastDownTarget = null;
updateMouseDown = false;
};
};
if (((((isDoubleClickEvent) && (!(disabledEvents[MouseEvent.DOUBLE_CLICK])))) && (_local4.doubleClickEnabled))){
_lastEvent = new mouseEventEvent(MouseEvent.DOUBLE_CLICK, true, false, _local8.x, _local8.y, _local4, ctrlKey, altKey, shiftKey, _mouseIsDown, delta);
_local4.dispatchEvent(_lastEvent);
dispatchEvent(_lastEvent);
};
lastLocation = location.clone();
lastMouseDown = _mouseIsDown;
target = _local4;
}
public function getLocation():Point{
return (location.clone());
}
public function get x():Number{
return (location.x);
}
public function lock():void{
isLocked = true;
}
public function get useNativeEvents():Boolean{
return (_useNativeEvents);
}
public function setLocation(_arg1, _arg2=null):void{
var _local3:Point;
if ((_arg1 is Point)){
_local3 = (_arg1 as Point);
trace(_local3);
location.x = _local3.x;
location.y = _local3.y;
} else {
location.x = Number(_arg1);
location.y = Number(_arg2);
};
if (!isLocked){
update();
};
}
private function keyHandler(_arg1:KeyboardEvent):void{
altKey = _arg1.altKey;
ctrlKey = _arg1.ctrlKey;
shiftKey = _arg1.shiftKey;
}
public function unignore(_arg1:DisplayObject):void{
if ((_arg1 in ignoredInstances)){
delete ignoredInstances[_arg1];
};
}
public function doubleClick():void{
if (isLocked){
release();
} else {
click();
press();
isDoubleClickEvent = true;
release();
isDoubleClickEvent = false;
};
}
public function update():void{
dispatchEvent(new Event(UPDATE, false, false));
}
public function ignore(_arg1:DisplayObject):void{
ignoredInstances[_arg1] = true;
}
public function unlock():void{
isLocked = false;
update();
}
public function enableEvent(_arg1:String):void{
if ((_arg1 in disabledEvents)){
delete disabledEvents[_arg1];
};
}
public function press():void{
updateMouseDown = true;
_mouseIsDown = true;
if (!isLocked){
update();
};
}
public function set useNativeEvents(_arg1:Boolean):void{
if (_arg1 == _useNativeEvents){
return;
};
_useNativeEvents = _arg1;
if (_useNativeEvents){
eventEvent = VirtualMouseEvent;
mouseEventEvent = VirtualMouseMouseEvent;
} else {
eventEvent = Event;
mouseEventEvent = MouseEvent;
};
}
public function set y(_arg1:Number):void{
location.y = _arg1;
if (!isLocked){
update();
};
}
public function set stage(_arg1:Stage):void{
var _local2:Boolean;
if (_stage){
_local2 = true;
_stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
_stage.removeEventListener(KeyboardEvent.KEY_UP, keyHandler);
} else {
_local2 = false;
};
_stage = _arg1;
if (_stage){
_stage.addEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
_stage.addEventListener(KeyboardEvent.KEY_UP, keyHandler);
target = _stage;
if (!_local2){
update();
};
};
}
}
}//package org.papervision3d.core.utils.virtualmouse
Section 143
//VirtualMouseEvent (org.papervision3d.core.utils.virtualmouse.VirtualMouseEvent)
package org.papervision3d.core.utils.virtualmouse {
import flash.events.*;
public class VirtualMouseEvent extends Event implements IVirtualMouseEvent {
public function VirtualMouseEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package org.papervision3d.core.utils.virtualmouse
Section 144
//VirtualMouseMouseEvent (org.papervision3d.core.utils.virtualmouse.VirtualMouseMouseEvent)
package org.papervision3d.core.utils.virtualmouse {
import flash.display.*;
import flash.events.*;
public class VirtualMouseMouseEvent extends MouseEvent implements IVirtualMouseEvent {
public function VirtualMouseMouseEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Number=NaN, _arg5:Number=NaN, _arg6:InteractiveObject=null, _arg7:Boolean=false, _arg8:Boolean=false, _arg9:Boolean=false, _arg10:Boolean=false, _arg11:int=0){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11);
}
}
}//package org.papervision3d.core.utils.virtualmouse
Section 145
//InteractiveSceneManager (org.papervision3d.core.utils.InteractiveSceneManager)
package org.papervision3d.core.utils {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.view.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.objects.*;
import com.blitzagency.xray.logger.*;
import flash.events.*;
import org.papervision3d.events.*;
import org.papervision3d.core.utils.virtualmouse.*;
import org.papervision3d.materials.*;
public class InteractiveSceneManager extends EventDispatcher {
public var container:Sprite;
public var currentDisplayObject3D:DisplayObject3D;
public var viewport:Viewport3D;
protected var log:XrayLog;
public var currentMaterial:MaterialObject3D;
public var debug:Boolean;// = false
public var mouse3D:Mouse3D;
public var enableOverOut:Boolean;// = true
public var virtualMouse:VirtualMouse;
public var renderHitData:RenderHitData;
public var currentMouseDO3D:DisplayObject3D;// = null
public static var MOUSE_IS_DOWN:Boolean = false;
public function InteractiveSceneManager(_arg1:Viewport3D){
virtualMouse = new VirtualMouse();
mouse3D = new Mouse3D();
enableOverOut = true;
currentMouseDO3D = null;
debug = false;
log = new XrayLog();
super();
this.viewport = _arg1;
this.container = _arg1.containerSprite;
init();
}
protected function initVirtualMouse():void{
virtualMouse.stage = container.stage;
virtualMouse.container = container;
}
public function init():void{
if (container){
if (container.stage){
initVirtualMouse();
initListeners();
} else {
container.addEventListener(Event.ADDED_TO_STAGE, handleAddedToStage);
};
};
}
public function initListeners():void{
if (viewport.interactive){
container.addEventListener(MouseEvent.MOUSE_DOWN, handleMousePress);
container.addEventListener(MouseEvent.MOUSE_UP, handleMouseRelease);
container.addEventListener(MouseEvent.CLICK, handleMouseClick);
container.stage.addEventListener(MouseEvent.MOUSE_MOVE, handleMouseMove);
};
}
public function updateRenderHitData():void{
resolveRenderHitData();
currentDisplayObject3D = renderHitData.displayObject3D;
currentMaterial = renderHitData.material;
manageOverOut();
}
protected function handleMouseClick(_arg1:MouseEvent):void{
if ((_arg1 is IVirtualMouseEvent)){
return;
};
if (((renderHitData) && (renderHitData.hasHit))){
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_CLICK, currentDisplayObject3D);
};
}
protected function handleMouseOut(_arg1:DisplayObject3D):void{
var _local2:MovieMaterial;
if (_arg1){
_local2 = (_arg1.material as MovieMaterial);
if (_local2){
virtualMouse.exitContainer();
};
};
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_OUT, _arg1);
}
protected function manageOverOut():void{
if (!enableOverOut){
return;
};
if (((renderHitData) && (renderHitData.hasHit))){
if (((!(currentMouseDO3D)) && (currentDisplayObject3D))){
handleMouseOver(currentDisplayObject3D);
currentMouseDO3D = currentDisplayObject3D;
} else {
if (((currentMouseDO3D) && (!((currentMouseDO3D == currentDisplayObject3D))))){
handleMouseOut(currentMouseDO3D);
handleMouseOver(currentDisplayObject3D);
currentMouseDO3D = currentDisplayObject3D;
};
};
} else {
if (currentMouseDO3D != null){
handleMouseOut(currentMouseDO3D);
currentMouseDO3D = null;
};
};
}
protected function dispatchObjectEvent(_arg1:String, _arg2:DisplayObject3D):void{
var _local3:Number;
var _local4:Number;
if (debug){
log.debug(_arg1, _arg2.name);
};
if (((renderHitData) && (renderHitData.hasHit))){
_local3 = (renderHitData.u) ? renderHitData.u : 0;
_local4 = (renderHitData.v) ? renderHitData.v : 0;
dispatchEvent(new InteractiveScene3DEvent(_arg1, _arg2, container, (renderHitData.renderable as Triangle3D), _local3, _local4));
_arg2.dispatchEvent(new InteractiveScene3DEvent(_arg1, _arg2, container, (renderHitData.renderable as Triangle3D), _local3, _local4));
} else {
dispatchEvent(new InteractiveScene3DEvent(_arg1, _arg2, container));
if (_arg2){
_arg2.dispatchEvent(new InteractiveScene3DEvent(_arg1, _arg2, container));
};
};
}
protected function handleMouseMove(_arg1:MouseEvent):void{
var _local2:MovieMaterial;
updateRenderHitData();
if ((_arg1 is IVirtualMouseEvent)){
return;
};
if (((virtualMouse) && (renderHitData))){
_local2 = (currentMaterial as MovieMaterial);
if (_local2){
virtualMouse.container = (_local2.movie as Sprite);
};
if (virtualMouse.container){
virtualMouse.setLocation(renderHitData.u, renderHitData.v);
};
if (((((Mouse3D.enabled) && (renderHitData))) && (renderHitData.hasHit))){
mouse3D.updatePosition(renderHitData);
};
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_MOVE, currentDisplayObject3D);
} else {
if (((renderHitData) && (renderHitData.hasHit))){
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_MOVE, currentDisplayObject3D);
};
};
}
protected function handleMouseOver(_arg1:DisplayObject3D):void{
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_OVER, _arg1);
}
protected function resolveRenderHitData():void{
var _local1:Point;
_local1 = new Point();
_local1.x = container.mouseX;
_local1.y = container.mouseY;
renderHitData = (viewport.hitTestPoint2D(_local1) as RenderHitData);
}
protected function handleMousePress(_arg1:MouseEvent):void{
if ((_arg1 is IVirtualMouseEvent)){
return;
};
MOUSE_IS_DOWN = true;
if (virtualMouse){
virtualMouse.press();
};
if (((((Mouse3D.enabled) && (renderHitData))) && (!((renderHitData.renderable == null))))){
mouse3D.updatePosition(renderHitData);
};
if (((renderHitData) && (renderHitData.hasHit))){
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_PRESS, currentDisplayObject3D);
};
}
protected function handleMouseRelease(_arg1:MouseEvent):void{
if ((_arg1 is IVirtualMouseEvent)){
return;
};
MOUSE_IS_DOWN = false;
if (virtualMouse){
virtualMouse.release();
};
if (((((Mouse3D.enabled) && (renderHitData))) && (!((renderHitData.renderable == null))))){
mouse3D.updatePosition(renderHitData);
};
if (((renderHitData) && (renderHitData.hasHit))){
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_RELEASE, currentDisplayObject3D);
};
}
protected function handleAddedToStage(_arg1:Event):void{
initVirtualMouse();
initListeners();
}
public function destroy():void{
viewport = null;
renderHitData = null;
currentDisplayObject3D = null;
currentMaterial = null;
currentMouseDO3D = null;
container.removeEventListener(MouseEvent.MOUSE_DOWN, handleMousePress);
container.removeEventListener(MouseEvent.MOUSE_UP, handleMouseRelease);
container.removeEventListener(MouseEvent.CLICK, handleMouseClick);
if (container.stage){
container.stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleMouseMove);
};
container = null;
}
}
}//package org.papervision3d.core.utils
Section 146
//Mouse3D (org.papervision3d.core.utils.Mouse3D)
package org.papervision3d.core.utils {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.math.*;
import org.papervision3d.objects.*;
public class Mouse3D extends DisplayObject3D {
private var position:Number3D;
private var target:Number3D;
public static var enabled:Boolean = false;
private static var UP:Number3D = new Number3D(0, 1, 0);
public function Mouse3D(_arg1:Object=null):void{
position = new Number3D(0, 0, 0);
target = new Number3D();
super();
}
public function updatePosition(_arg1:RenderHitData):void{
var _local2:Triangle3D;
var _local3:Number3D;
var _local4:Matrix3D;
var _local5:Number3D;
var _local6:Number3D;
var _local7:Matrix3D;
_local2 = (_arg1.renderable as Triangle3D);
target.x = _local2.faceNormal.x;
target.y = _local2.faceNormal.y;
target.z = _local2.faceNormal.z;
_local3 = Number3D.sub(target, position);
_local3.normalize();
if (_local3.modulo > 0.1){
_local5 = Number3D.cross(_local3, UP);
_local5.normalize();
_local6 = Number3D.cross(_local3, _local5);
_local6.normalize();
_local7 = this.transform;
_local7.n11 = _local5.x;
_local7.n21 = _local5.y;
_local7.n31 = _local5.z;
_local7.n12 = -(_local6.x);
_local7.n22 = -(_local6.y);
_local7.n32 = -(_local6.z);
_local7.n13 = _local3.x;
_local7.n23 = _local3.y;
_local7.n33 = _local3.z;
};
_local4 = Matrix3D.IDENTITY;
this.transform = Matrix3D.multiply(_local2.instance.world, _local7);
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
}
}
}//package org.papervision3d.core.utils
Section 147
//StopWatch (org.papervision3d.core.utils.StopWatch)
package org.papervision3d.core.utils {
import flash.events.*;
import flash.utils.*;
public class StopWatch extends EventDispatcher {
private var startTime:int;
private var elapsedTime:int;
private var stopTime:int;
private var isRunning:Boolean;
public function stop():int{
if (isRunning){
stopTime = getTimer();
elapsedTime = (stopTime - startTime);
isRunning = false;
return (elapsedTime);
};
return (0);
}
public function start():void{
if (!isRunning){
startTime = getTimer();
isRunning = true;
};
}
public function reset():void{
isRunning = false;
}
}
}//package org.papervision3d.core.utils
Section 148
//IViewport3D (org.papervision3d.core.view.IViewport3D)
package org.papervision3d.core.view {
import org.papervision3d.core.render.data.*;
public interface IViewport3D {
function updateAfterRender(_arg1:RenderSessionData):void;
function updateBeforeRender(_arg1:RenderSessionData):void;
}
}//package org.papervision3d.core.view
Section 149
//FileLoadEvent (org.papervision3d.events.FileLoadEvent)
package org.papervision3d.events {
import flash.events.*;
public class FileLoadEvent extends Event {
public var bytesLoaded:Number;// = -1
public var message:String;// = ""
public var bytesTotal:Number;// = -1
public var dataObj:Object;// = null
public var file:String;// = ""
public static const COLLADA_MATERIALS_DONE:String = "colladaMaterialsDone";
public static const LOAD_PROGRESS:String = "loadProgress";
public static const ANIMATIONS_COMPLETE:String = "animationsComplete";
public static const SECURITY_LOAD_ERROR:String = "securityLoadError";
public static const LOAD_ERROR:String = "loadError";
public static const LOAD_COMPLETE:String = "loadComplete";
public static const ANIMATIONS_PROGRESS:String = "animationsProgress";
public function FileLoadEvent(_arg1:String, _arg2:String="", _arg3:Number=-1, _arg4:Number=-1, _arg5:String="", _arg6:Object=null, _arg7:Boolean=false, _arg8:Boolean=false){
file = "";
bytesLoaded = -1;
bytesTotal = -1;
message = "";
dataObj = null;
super(_arg1, _arg7, _arg8);
this.file = _arg2;
this.bytesLoaded = _arg3;
this.bytesTotal = _arg4;
this.message = _arg5;
this.dataObj = _arg6;
}
}
}//package org.papervision3d.events
Section 150
//InteractiveScene3DEvent (org.papervision3d.events.InteractiveScene3DEvent)
package org.papervision3d.events {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import org.papervision3d.objects.*;
import flash.events.*;
public class InteractiveScene3DEvent extends Event {
public var sprite:Sprite;// = null
public var displayObject3D:DisplayObject3D;// = null
public var face3d:Triangle3D;// = null
public var renderHitData:RenderHitData;
public var x:Number;// = 0
public var y:Number;// = 0
public static const OBJECT_ADDED:String = "objectAdded";
public static const OBJECT_PRESS:String = "mousePress";
public static const OBJECT_RELEASE:String = "mouseRelease";
public static const OBJECT_CLICK:String = "mouseClick";
public static const OBJECT_RELEASE_OUTSIDE:String = "mouseReleaseOutside";
public static const OBJECT_OUT:String = "mouseOut";
public static const OBJECT_MOVE:String = "mouseMove";
public static const OBJECT_OVER:String = "mouseOver";
public function InteractiveScene3DEvent(_arg1:String, _arg2:DisplayObject3D=null, _arg3:Sprite=null, _arg4:Triangle3D=null, _arg5:Number=0, _arg6:Number=0, _arg7:RenderHitData=null, _arg8:Boolean=false, _arg9:Boolean=false){
displayObject3D = null;
sprite = null;
face3d = null;
x = 0;
y = 0;
super(_arg1, _arg8, _arg9);
this.displayObject3D = _arg2;
this.sprite = _arg3;
this.face3d = _arg4;
this.x = _arg5;
this.y = _arg6;
this.renderHitData = _arg7;
}
override public function toString():String{
return (((((((("Type : " + type) + ", DO3D : ") + displayObject3D) + " Sprite : ") + sprite) + " Face : ") + face3d));
}
}
}//package org.papervision3d.events
Section 151
//RendererEvent (org.papervision3d.events.RendererEvent)
package org.papervision3d.events {
import org.papervision3d.core.render.data.*;
import flash.events.*;
public class RendererEvent extends Event {
public var renderSessionData:RenderSessionData;
public static const PROJECTION_DONE:String = "projectionDone";
public static const RENDER_DONE:String = "renderDone";
public function RendererEvent(_arg1:String, _arg2:RenderSessionData){
super(_arg1);
this.renderSessionData = _arg2;
}
public function clear():void{
renderSessionData = null;
}
override public function clone():Event{
return (new RendererEvent(type, renderSessionData));
}
}
}//package org.papervision3d.events
Section 152
//LineMaterial (org.papervision3d.materials.special.LineMaterial)
package org.papervision3d.materials.special {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import org.papervision3d.core.render.draw.*;
public class LineMaterial extends MaterialObject3D implements ILineDrawer {
public function LineMaterial(_arg1:Number=0xFF0000, _arg2:Number=1){
this.lineColor = _arg1;
this.lineAlpha = _arg2;
}
public function drawLine(_arg1:Line3D, _arg2:Graphics, _arg3:RenderSessionData):void{
_arg2.lineStyle(_arg1.size, lineColor, lineAlpha);
_arg2.moveTo(_arg1.v0.vertex3DInstance.x, _arg1.v0.vertex3DInstance.y);
if (_arg1.cV){
_arg2.curveTo(_arg1.cV.vertex3DInstance.x, _arg1.cV.vertex3DInstance.y, _arg1.v1.vertex3DInstance.x, _arg1.v1.vertex3DInstance.y);
} else {
_arg2.lineTo(_arg1.v1.vertex3DInstance.x, _arg1.v1.vertex3DInstance.y);
};
_arg2.moveTo(0, 0);
_arg2.lineStyle();
}
}
}//package org.papervision3d.materials.special
Section 153
//ParticleMaterial (org.papervision3d.materials.special.ParticleMaterial)
package org.papervision3d.materials.special {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.render.draw.*;
public class ParticleMaterial extends MaterialObject3D implements IParticleDrawer {
public var shape:int;
public static var SHAPE_SQUARE:int = 0;
public static var SHAPE_CIRCLE:int = 1;
public function ParticleMaterial(_arg1:Number, _arg2:Number, _arg3:int=0){
this.shape = _arg3;
this.fillAlpha = _arg2;
this.fillColor = _arg1;
}
public function updateRenderRect(_arg1:Particle):void{
var _local2:Rectangle;
_local2 = _arg1.renderRect;
if (_arg1.size == 0){
_local2.width = 1;
_local2.height = 1;
} else {
_local2.width = (_arg1.renderScale * _arg1.size);
_local2.height = (_arg1.renderScale * _arg1.size);
};
_local2.x = (_arg1.vertex3D.vertex3DInstance.x - (_local2.width / 2));
_local2.y = (_arg1.vertex3D.vertex3DInstance.y - (_local2.width / 2));
}
public function drawParticle(_arg1:Particle, _arg2:Graphics, _arg3:RenderSessionData):void{
var _local4:Rectangle;
_arg2.beginFill(fillColor, fillAlpha);
_local4 = _arg1.renderRect;
if (shape == SHAPE_SQUARE){
_arg2.drawRect(_local4.x, _local4.y, _local4.width, _local4.height);
} else {
if (shape == SHAPE_CIRCLE){
_arg2.drawCircle((_local4.x + (_local4.width / 2)), (_local4.y + (_local4.width / 2)), (_local4.width / 2));
} else {
trace("warning - Particle material has no valid shape - Must be ParticleMaterial.SHAPE_SQUARE or ParticleMaterial.SHAPE_CIRCLE");
};
};
_arg2.endFill();
_arg3.renderStatistics.particles++;
}
}
}//package org.papervision3d.materials.special
Section 154
//MaterialsList (org.papervision3d.materials.utils.MaterialsList)
package org.papervision3d.materials.utils {
import org.papervision3d.core.proto.*;
import flash.utils.*;
public class MaterialsList {
protected var _materials:Dictionary;
public var materialsByName:Dictionary;
private var _materialsTotal:int;
public function MaterialsList(_arg1=null):void{
var _local2:String;
var _local3:String;
super();
this.materialsByName = new Dictionary(true);
this._materials = new Dictionary(false);
this._materialsTotal = 0;
if (_arg1){
if ((_arg1 is Array)){
for (_local2 in _arg1) {
this.addMaterial(_arg1[_local2]);
};
} else {
if ((_arg1 is Object)){
for (_local3 in _arg1) {
this.addMaterial(_arg1[_local3], _local3);
};
};
};
};
}
public function get numMaterials():int{
return (_materialsTotal);
}
public function addMaterial(_arg1:MaterialObject3D, _arg2:String=null):MaterialObject3D{
_arg2 = ((((_arg2) || (_arg1.name))) || (String(_arg1.id)));
this._materials[_arg1] = _arg2;
this.materialsByName[_arg2] = _arg1;
this._materialsTotal++;
return (_arg1);
}
public function removeMaterial(_arg1:MaterialObject3D):MaterialObject3D{
delete this.materialsByName[this._materials[_arg1]];
delete this._materials[_arg1];
return (_arg1);
}
public function toString():String{
var _local1:String;
var _local2:MaterialObject3D;
_local1 = "";
for each (_local2 in this.materialsByName) {
_local1 = (_local1 + (this._materials[_local2] + "\n"));
};
return (_local1);
}
public function removeMaterialByName(_arg1:String):MaterialObject3D{
return (removeMaterial(getMaterialByName(_arg1)));
}
public function clone():MaterialsList{
var _local1:MaterialsList;
var _local2:MaterialObject3D;
_local1 = new MaterialsList();
for each (_local2 in this.materialsByName) {
_local1.addMaterial(_local2.clone(), this._materials[_local2]);
};
return (_local1);
}
public function getMaterialByName(_arg1:String):MaterialObject3D{
return ((this.materialsByName[_arg1]) ? this.materialsByName[_arg1] : this.materialsByName["all"]);
}
}
}//package org.papervision3d.materials.utils
Section 155
//RenderRecStorage (org.papervision3d.materials.utils.RenderRecStorage)
package org.papervision3d.materials.utils {
import org.papervision3d.core.geom.renderables.*;
import flash.geom.*;
public class RenderRecStorage {
public var mat:Matrix;
public var v0:Vertex3DInstance;
public var v1:Vertex3DInstance;
public var v2:Vertex3DInstance;
public function RenderRecStorage(){
v0 = new Vertex3DInstance();
v1 = new Vertex3DInstance();
v2 = new Vertex3DInstance();
mat = new Matrix();
super();
}
}
}//package org.papervision3d.materials.utils
Section 156
//BitmapAssetMaterial (org.papervision3d.materials.BitmapAssetMaterial)
package org.papervision3d.materials {
import flash.display.*;
import flash.utils.*;
import org.papervision3d.*;
import org.papervision3d.core.render.draw.*;
public class BitmapAssetMaterial extends BitmapMaterial implements ITriangleDrawer {
private static var _library:Object = new Object();
private static var _count:Object = new Object();
public function BitmapAssetMaterial(_arg1:String, _arg2:Boolean=false){
texture = _arg1;
this.precise = _arg2;
}
override public function get texture():Object{
return (this._texture);
}
override public function set texture(_arg1:Object):void{
if ((_arg1 is String) == false){
Papervision3D.log("Error: BitmapMaterial.texture requires a BitmapData object for the texture");
return;
};
bitmap = createBitmapFromLinkageID(String(_arg1));
_texture = _arg1;
}
protected function createBitmapFromLinkageID(_arg1:String):BitmapData{
var _local2:BitmapData;
var _local3:BitmapData;
var _local4:BitmapData;
var _local5:Class;
var _local6:XML;
if (this._texture != _arg1){
var _local7 = _count;
var _local8 = this._texture;
var _local9 = (_local7[_local8] - 1);
_local7[_local8] = _local9;
_local4 = _library[this._texture];
if (((_local4) && ((_count[this._texture] == 0)))){
_local4.dispose();
};
};
_local3 = _library[_arg1];
if (!_local3){
_local5 = (getDefinitionByName(_arg1) as Class);
_local6 = describeType(_local5);
if (_local6..constructor.length() == 0){
_local3 = (new (_local5) as BitmapData);
} else {
_local3 = (new _local5(0, 0) as BitmapData);
};
_local2 = createBitmap(_local3);
_library[_arg1] = _local2;
_count[_arg1] = 0;
} else {
_local2 = _local3;
maxU = (maxV = 1);
_local7 = _count;
_local8 = _arg1;
_local9 = (_local7[_local8] + 1);
_local7[_local8] = _local9;
};
return (_local2);
}
}
}//package org.papervision3d.materials
Section 157
//BitmapFileMaterial (org.papervision3d.materials.BitmapFileMaterial)
package org.papervision3d.materials {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import org.papervision3d.events.*;
import flash.net.*;
import flash.utils.*;
import org.papervision3d.*;
import org.papervision3d.core.render.draw.*;
public class BitmapFileMaterial extends BitmapMaterial implements ITriangleDrawer {
public var loaded:Boolean;
private var errorLoading:Boolean;// = false
public var url:String;// = ""
public static var LOADING_COLOR:int = MaterialObject3D.DEFAULT_COLOR;
public static var callback:Function;
private static var _loadedBitmaps:Object = new Object();
private static var _loadingIdle:Boolean = true;
private static var _waitingBitmaps:Array = new Array();
private static var _subscribedMaterials:Object = new Object();
public static var ERROR_COLOR:int = MaterialObject3D.DEBUG_COLOR;
private static var _loaderUrls:Dictionary = new Dictionary();
public function BitmapFileMaterial(_arg1:String="", _arg2:Boolean=false){
url = "";
errorLoading = false;
super(null, _arg2);
this.url = _arg1;
this.loaded = false;
this.fillAlpha = 1;
this.fillColor = LOADING_COLOR;
if (_arg1.length > 0){
texture = _arg1;
};
}
override public function get texture():Object{
return (this._texture);
}
private function loadComplete():void{
var _local1:FileLoadEvent;
this.fillAlpha = 0;
this.fillColor = 0;
this.loaded = true;
_local1 = new FileLoadEvent(FileLoadEvent.LOAD_COMPLETE, this.url);
this.dispatchEvent(_local1);
}
override public function set texture(_arg1:Object):void{
if ((_arg1 is String) == false){
Papervision3D.log("Error: BitmapFileMaterial.texture requires a String for the texture");
return;
};
bitmap = createBitmapFromURL(String(_arg1));
_texture = _arg1;
}
private function loadBitmapCompleteHandler(_arg1:Event):void{
var _local2:Loader;
var _local3:Bitmap;
var _local4:String;
var _local5:BitmapData;
var _local6:BitmapFileMaterial;
_local2 = Loader(_arg1.target.loader);
_local3 = Bitmap(_local2.content);
_local4 = _loaderUrls[_local2];
_local5 = super.createBitmap(_local3.bitmapData);
for each (_local6 in _subscribedMaterials[_local4]) {
_local6.bitmap = _local5;
_local6.maxU = this.maxU;
_local6.maxV = this.maxV;
_local6.resetMapping();
_local6.loadComplete();
};
_loadedBitmaps[_local4] = _local5;
_waitingBitmaps.shift();
if (_waitingBitmaps.length > 0){
loadNextBitmap();
} else {
_loadingIdle = true;
if (Boolean(callback)){
callback();
};
};
}
override public function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void{
if ((((bitmap == null)) || (errorLoading))){
if (errorLoading){
_arg2.lineStyle(lineThickness, lineColor, lineAlpha);
};
_arg2.beginFill(fillColor, fillAlpha);
_arg2.moveTo(_arg1.v0.vertex3DInstance.x, _arg1.v0.vertex3DInstance.y);
_arg2.lineTo(_arg1.v1.vertex3DInstance.x, _arg1.v1.vertex3DInstance.y);
_arg2.lineTo(_arg1.v2.vertex3DInstance.x, _arg1.v2.vertex3DInstance.y);
_arg2.lineTo(_arg1.v0.vertex3DInstance.x, _arg1.v0.vertex3DInstance.y);
_arg2.endFill();
if (errorLoading){
_arg2.lineStyle();
};
_arg3.renderStatistics.triangles++;
};
super.drawTriangle(_arg1, _arg2, _arg3);
}
private function loadNextBitmap():void{
var file:String;
var request:URLRequest;
var bitmapLoader:Loader;
file = _waitingBitmaps[0];
request = new URLRequest(file);
bitmapLoader = new Loader();
bitmapLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadBitmapProgressHandler);
bitmapLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadBitmapCompleteHandler);
bitmapLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadBitmapErrorHandler);
try {
bitmapLoader.load(request);
_loaderUrls[bitmapLoader] = file;
_loadingIdle = false;
Papervision3D.log(("BitmapFileMaterial: Loading bitmap from " + file));
} catch(error:Error) {
_waitingBitmaps.shift();
_loadingIdle = true;
Papervision3D.log(("[ERROR] BitmapFileMaterial: Unable to load file " + error.message));
};
}
private function loadBitmapErrorHandler(_arg1:IOErrorEvent):void{
var _local2:String;
var _local3:FileLoadEvent;
_local2 = String(_waitingBitmaps.shift());
_loadedBitmaps[_local2] = null;
_subscribedMaterials[_local2] = null;
this.errorLoading = true;
this.lineColor = ERROR_COLOR;
this.lineAlpha = 1;
this.lineThickness = 1;
if (_waitingBitmaps.length > 0){
loadNextBitmap();
} else {
_loadingIdle = true;
if (Boolean(callback)){
callback();
};
};
_local3 = new FileLoadEvent(FileLoadEvent.LOAD_ERROR, _local2, -1, -1, _arg1.text);
dispatchEvent(_local3);
}
private function queueBitmap(_arg1:String):void{
if (!_subscribedMaterials[_arg1]){
_waitingBitmaps.push(_arg1);
_subscribedMaterials[_arg1] = new Array();
};
_subscribedMaterials[_arg1].push(this);
if (_loadingIdle){
loadNextBitmap();
};
}
protected function createBitmapFromURL(_arg1:String):BitmapData{
var _local2:BitmapData;
if (_arg1 == ""){
return (null);
};
if (_loadedBitmaps[_arg1]){
_local2 = _loadedBitmaps[_arg1];
bitmap = super.createBitmap(_local2);
this.loadComplete();
return (_local2);
};
queueBitmap(_arg1);
return (null);
}
private function loadBitmapProgressHandler(_arg1:ProgressEvent):void{
var _local2:FileLoadEvent;
_local2 = new FileLoadEvent(FileLoadEvent.LOAD_PROGRESS, url, _arg1.bytesLoaded, _arg1.bytesTotal);
dispatchEvent(_local2);
}
}
}//package org.papervision3d.materials
Section 158
//BitmapMaterial (org.papervision3d.materials.BitmapMaterial)
package org.papervision3d.materials {
import org.papervision3d.core.proto.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import org.papervision3d.*;
import org.papervision3d.core.render.draw.*;
import org.papervision3d.core.math.util.*;
import org.papervision3d.core.material.*;
public class BitmapMaterial extends TriangleMaterial implements ITriangleDrawer {
protected var renderRecStorage:Array;
protected var mabz:Number;
protected var dcay:Number;
protected var dsab:Number;
protected var tempTriangleMatrix:Matrix;
protected var dsbc:Number;
private var b2:Number;
protected var _precise:Boolean;
protected var faz:Number;
public var uvMatrices:Dictionary;
protected var dsca:Number;
protected var ax:Number;
protected var az:Number;
protected var ay:Number;
protected var mcay:Number;
protected var bx:Number;
protected var by:Number;
protected var fbz:Number;
protected var fcz:Number;
public var minimumRenderSize:Number;// = 4
protected var bz:Number;
private var c2:Number;
protected var mcax:Number;
protected var dbcx:Number;
protected var cx:Number;
protected var cy:Number;
protected var cz:Number;
private var d2:Number;
protected var mcaz:Number;
protected var dbcy:Number;
protected var dabx:Number;
protected var _perPixelPrecision:int;// = 8
protected var daby:Number;
private var x0:Number;
private var x1:Number;
private var x2:Number;
protected var mbcy:Number;
protected var mbcz:Number;
private var y0:Number;
private var y1:Number;
private var y2:Number;
protected var _texture:Object;
protected var focus:Number;// = 200
protected var maby:Number;
protected var mabx:Number;
protected var dcax:Number;
protected var mbcx:Number;
private var a2:Number;
protected var _precision:int;// = 8
protected static const DEFAULT_FOCUS:Number = 200;
protected static var _triMatrix:Matrix = new Matrix();
protected static var _triMap:Matrix;
public static var AUTO_MIP_MAPPING:Boolean = false;
public static var MIP_MAP_DEPTH:Number = 8;
protected static var hitRect:Rectangle = new Rectangle();
protected static var _localMatrix:Matrix = new Matrix();
public function BitmapMaterial(_arg1:BitmapData=null, _arg2:Boolean=false){
focus = 200;
_precision = 8;
_perPixelPrecision = 8;
minimumRenderSize = 4;
uvMatrices = new Dictionary();
tempTriangleMatrix = new Matrix();
super();
if (_arg1){
texture = _arg1;
};
this.precise = _arg2;
createRenderRecStorage();
}
public function transformUV(_arg1:Triangle3D):Matrix{
var _local2:Array;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Matrix;
var _local16:Matrix;
if (!_arg1.uv){
Papervision3D.log("MaterialObject3D: transformUV() uv not found!");
} else {
if (bitmap){
_local2 = _arg1.uv;
_local3 = (bitmap.width * maxU);
_local4 = (bitmap.height * maxV);
_local5 = (_local3 * _arg1.uv0.u);
_local6 = (_local4 * (1 - _arg1.uv0.v));
_local7 = (_local3 * _arg1.uv1.u);
_local8 = (_local4 * (1 - _arg1.uv1.v));
_local9 = (_local3 * _arg1.uv2.u);
_local10 = (_local4 * (1 - _arg1.uv2.v));
if ((((((_local5 == _local7)) && ((_local6 == _local8)))) || ((((_local5 == _local9)) && ((_local6 == _local10)))))){
_local5 = (_local5 - ((_local5)>0.05) ? 0.05 : -0.05);
_local6 = (_local6 - ((_local6)>0.07) ? 0.07 : -0.07);
};
if ((((_local9 == _local7)) && ((_local10 == _local8)))){
_local9 = (_local9 - ((_local9)>0.05) ? 0.04 : -0.04);
_local10 = (_local10 - ((_local10)>0.06) ? 0.06 : -0.06);
};
_local11 = (_local7 - _local5);
_local12 = (_local8 - _local6);
_local13 = (_local9 - _local5);
_local14 = (_local10 - _local6);
_local15 = new Matrix(_local11, _local12, _local13, _local14, _local5, _local6);
if (Papervision3D.useRIGHTHANDED){
_local15.scale(-1, 1);
_local15.translate(_local3, 0);
};
_local15.invert();
_local16 = (uvMatrices[_arg1]) ? uvMatrices[_arg1] : uvMatrices[_arg1] = _local15.clone();
_local16.a = _local15.a;
_local16.b = _local15.b;
_local16.c = _local15.c;
_local16.d = _local15.d;
_local16.tx = _local15.tx;
_local16.ty = _local15.ty;
} else {
Papervision3D.log("MaterialObject3D: transformUV() material.bitmap not found!");
};
};
return (_local16);
}
protected function renderRec(_arg1:Graphics, _arg2:Matrix, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance, _arg5:Vertex3DInstance, _arg6:Number, _arg7:RenderSessionData, _arg8:BitmapData):void{
var _local9:int;
var _local10:RenderRecStorage;
var _local11:Matrix;
var _local12:Number;
az = _arg3.z;
bz = _arg4.z;
cz = _arg5.z;
if ((((((az <= 0)) && ((bz <= 0)))) && ((cz <= 0)))){
return;
};
cx = _arg5.x;
cy = _arg5.y;
bx = _arg4.x;
by = _arg4.y;
ax = _arg3.x;
ay = _arg3.y;
if (_arg7.viewPort.cullingRectangle){
hitRect.x = Math.min(cx, Math.min(bx, ax));
hitRect.width = (Math.max(cx, Math.max(bx, ax)) + Math.abs(hitRect.x));
hitRect.y = Math.min(cy, Math.min(by, ay));
hitRect.height = (Math.max(cy, Math.max(by, ay)) + Math.abs(hitRect.y));
if (!FastRectangleTools.intersects(hitRect, _arg7.viewPort.cullingRectangle)){
return;
};
};
if ((((((((_arg6 >= 100)) || ((hitRect.width < minimumRenderSize)))) || ((hitRect.height < minimumRenderSize)))) || ((focus == Infinity)))){
renderTriangleBitmap(_arg1, _arg2, _arg3, _arg4, _arg5, smooth, tiled, _arg8);
_arg7.renderStatistics.triangles++;
return;
};
faz = (focus + az);
fbz = (focus + bz);
fcz = (focus + cz);
mabz = (2 / (faz + fbz));
mbcz = (2 / (fbz + fcz));
mcaz = (2 / (fcz + faz));
mabx = (((ax * faz) + (bx * fbz)) * mabz);
maby = (((ay * faz) + (by * fbz)) * mabz);
mbcx = (((bx * fbz) + (cx * fcz)) * mbcz);
mbcy = (((by * fbz) + (cy * fcz)) * mbcz);
mcax = (((cx * fcz) + (ax * faz)) * mcaz);
mcay = (((cy * fcz) + (ay * faz)) * mcaz);
dabx = ((ax + bx) - mabx);
daby = ((ay + by) - maby);
dbcx = ((bx + cx) - mbcx);
dbcy = ((by + cy) - mbcy);
dcax = ((cx + ax) - mcax);
dcay = ((cy + ay) - mcay);
dsab = ((dabx * dabx) + (daby * daby));
dsbc = ((dbcx * dbcx) + (dbcy * dbcy));
dsca = ((dcax * dcax) + (dcay * dcay));
_local9 = (_arg6 + 1);
_local10 = RenderRecStorage(renderRecStorage[int(_arg6)]);
_local11 = _local10.mat;
if ((((((dsab <= _precision)) && ((dsca <= _precision)))) && ((dsbc <= _precision)))){
renderTriangleBitmap(_arg1, _arg2, _arg3, _arg4, _arg5, smooth, tiled, _arg8);
_arg7.renderStatistics.triangles++;
return;
};
if ((((((dsab > _precision)) && ((dsca > _precision)))) && ((dsbc > _precision)))){
_local11.a = (_arg2.a * 2);
_local11.b = (_arg2.b * 2);
_local11.c = (_arg2.c * 2);
_local11.d = (_arg2.d * 2);
_local11.tx = (_arg2.tx * 2);
_local11.ty = (_arg2.ty * 2);
_local10.v0.x = (mabx * 0.5);
_local10.v0.y = (maby * 0.5);
_local10.v0.z = ((az + bz) * 0.5);
_local10.v1.x = (mbcx * 0.5);
_local10.v1.y = (mbcy * 0.5);
_local10.v1.z = ((bz + cz) * 0.5);
_local10.v2.x = (mcax * 0.5);
_local10.v2.y = (mcay * 0.5);
_local10.v2.z = ((cz + az) * 0.5);
renderRec(_arg1, _local11, _arg3, _local10.v0, _local10.v2, _local9, _arg7, _arg8);
_local11.tx = (_local11.tx - 1);
renderRec(_arg1, _local11, _local10.v0, _arg4, _local10.v1, _local9, _arg7, _arg8);
_local11.ty = (_local11.ty - 1);
_local11.tx = (_arg2.tx * 2);
renderRec(_arg1, _local11, _local10.v2, _local10.v1, _arg5, _local9, _arg7, _arg8);
_local11.a = (-(_arg2.a) * 2);
_local11.b = (-(_arg2.b) * 2);
_local11.c = (-(_arg2.c) * 2);
_local11.d = (-(_arg2.d) * 2);
_local11.tx = ((-(_arg2.tx) * 2) + 1);
_local11.ty = ((-(_arg2.ty) * 2) + 1);
renderRec(_arg1, _local11, _local10.v1, _local10.v2, _local10.v0, _local9, _arg7, _arg8);
return;
};
_local12 = Math.max(dsab, Math.max(dsca, dsbc));
if (dsab == _local12){
_local11.a = (_arg2.a * 2);
_local11.b = _arg2.b;
_local11.c = (_arg2.c * 2);
_local11.d = _arg2.d;
_local11.tx = (_arg2.tx * 2);
_local11.ty = _arg2.ty;
_local10.v0.x = (mabx * 0.5);
_local10.v0.y = (maby * 0.5);
_local10.v0.z = ((az + bz) * 0.5);
renderRec(_arg1, _local11, _arg3, _local10.v0, _arg5, _local9, _arg7, _arg8);
_local11.a = ((_arg2.a * 2) + _arg2.b);
_local11.c = ((2 * _arg2.c) + _arg2.d);
_local11.tx = (((_arg2.tx * 2) + _arg2.ty) - 1);
renderRec(_arg1, _local11, _local10.v0, _arg4, _arg5, _local9, _arg7, _arg8);
return;
};
if (dsca == _local12){
_local11.a = _arg2.a;
_local11.b = (_arg2.b * 2);
_local11.c = _arg2.c;
_local11.d = (_arg2.d * 2);
_local11.tx = _arg2.tx;
_local11.ty = (_arg2.ty * 2);
_local10.v2.x = (mcax * 0.5);
_local10.v2.y = (mcay * 0.5);
_local10.v2.z = ((cz + az) * 0.5);
renderRec(_arg1, _local11, _arg3, _arg4, _local10.v2, _local9, _arg7, _arg8);
_local11.b = (_local11.b + _arg2.a);
_local11.d = (_local11.d + _arg2.c);
_local11.ty = (_local11.ty + (_arg2.tx - 1));
renderRec(_arg1, _local11, _local10.v2, _arg4, _arg5, _local9, _arg7, _arg8);
return;
};
_local11.a = (_arg2.a - _arg2.b);
_local11.b = (_arg2.b * 2);
_local11.c = (_arg2.c - _arg2.d);
_local11.d = (_arg2.d * 2);
_local11.tx = (_arg2.tx - _arg2.ty);
_local11.ty = (_arg2.ty * 2);
_local10.v1.x = (mbcx * 0.5);
_local10.v1.y = (mbcy * 0.5);
_local10.v1.z = ((bz + cz) * 0.5);
renderRec(_arg1, _local11, _arg3, _arg4, _local10.v1, _local9, _arg7, _arg8);
_local11.a = (_arg2.a * 2);
_local11.b = (_arg2.b - _arg2.a);
_local11.c = (_arg2.c * 2);
_local11.d = (_arg2.d - _arg2.c);
_local11.tx = (_arg2.tx * 2);
_local11.ty = (_arg2.ty - _arg2.tx);
renderRec(_arg1, _local11, _arg3, _local10.v1, _arg5, _local9, _arg7, _arg8);
}
protected function createRenderRecStorage():void{
var _local1:int;
this.renderRecStorage = new Array();
_local1 = 0;
while (_local1 <= 100) {
this.renderRecStorage[_local1] = new RenderRecStorage();
_local1++;
};
}
public function resetUVS():void{
uvMatrices = new Dictionary(false);
}
public function get texture():Object{
return (this._texture);
}
public function set pixelPrecision(_arg1:int):void{
_precision = ((_arg1 * _arg1) * 1.4);
_perPixelPrecision = _arg1;
}
protected function correctBitmap(_arg1:BitmapData):BitmapData{
var _local2:BitmapData;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Boolean;
_local3 = (1 << MIP_MAP_DEPTH);
_local4 = (_arg1.width / _local3);
_local4 = ((_local4 == uint(_local4))) ? _local4 : (uint(_local4) + 1);
_local5 = (_arg1.height / _local3);
_local5 = ((_local5 == uint(_local5))) ? _local5 : (uint(_local5) + 1);
_local6 = (_local3 * _local4);
_local7 = (_local3 * _local5);
_local8 = true;
if (_local6 > 2880){
_local6 = _arg1.width;
_local8 = false;
};
if (_local7 > 2880){
_local7 = _arg1.height;
_local8 = false;
};
if (!_local8){
Papervision3D.log((("Material " + this.name) + ": Texture too big for mip mapping. Resizing recommended for better performance and quality."));
};
if (((_arg1) && (((!(((_arg1.width % _local3) == 0))) || (!(((_arg1.height % _local3) == 0))))))){
_local2 = new BitmapData(_local6, _local7, _arg1.transparent, 0);
widthOffset = _arg1.width;
heightOffset = _arg1.height;
this.maxU = (_arg1.width / _local6);
this.maxV = (_arg1.height / _local7);
_local2.draw(_arg1);
extendBitmapEdges(_local2, _arg1.width, _arg1.height);
} else {
this.maxU = (this.maxV = 1);
_local2 = _arg1;
};
return (_local2);
}
protected function createBitmap(_arg1:BitmapData):BitmapData{
var _local2:BitmapData;
resetMapping();
if (AUTO_MIP_MAPPING){
_local2 = correctBitmap(_arg1);
} else {
this.maxU = (this.maxV = 1);
_local2 = _arg1;
};
return (_local2);
}
public function get precise():Boolean{
return (_precise);
}
override public function clone():MaterialObject3D{
var _local1:MaterialObject3D;
_local1 = super.clone();
_local1.maxU = this.maxU;
_local1.maxV = this.maxV;
return (_local1);
}
public function set texture(_arg1:Object):void{
if ((_arg1 is BitmapData) == false){
Papervision3D.log("Error: BitmapMaterial.texture requires a BitmapData object for the texture");
return;
};
bitmap = createBitmap(BitmapData(_arg1));
_texture = _arg1;
}
override public function toString():String{
return (((((("Texture:" + this.texture) + " lineColor:") + this.lineColor) + " lineAlpha:") + this.lineAlpha));
}
override public function copy(_arg1:MaterialObject3D):void{
super.copy(_arg1);
this.maxU = _arg1.maxU;
this.maxV = _arg1.maxV;
}
override public function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void{
if (!_precise){
if (lineAlpha){
_arg2.lineStyle(lineThickness, lineColor, lineAlpha);
};
if (bitmap){
_triMap = (_arg5) ? _arg5 : ((uvMatrices[_arg1]) || (transformUV(_arg1)));
x0 = _arg1.v0.vertex3DInstance.x;
y0 = _arg1.v0.vertex3DInstance.y;
x1 = _arg1.v1.vertex3DInstance.x;
y1 = _arg1.v1.vertex3DInstance.y;
x2 = _arg1.v2.vertex3DInstance.x;
y2 = _arg1.v2.vertex3DInstance.y;
_triMatrix.a = (x1 - x0);
_triMatrix.b = (y1 - y0);
_triMatrix.c = (x2 - x0);
_triMatrix.d = (y2 - y0);
_triMatrix.tx = x0;
_triMatrix.ty = y0;
_localMatrix.a = _triMap.a;
_localMatrix.b = _triMap.b;
_localMatrix.c = _triMap.c;
_localMatrix.d = _triMap.d;
_localMatrix.tx = _triMap.tx;
_localMatrix.ty = _triMap.ty;
_localMatrix.concat(_triMatrix);
_arg2.beginBitmapFill((_arg4) ? _arg4 : bitmap, _localMatrix, tiled, smooth);
};
_arg2.moveTo(x0, y0);
_arg2.lineTo(x1, y1);
_arg2.lineTo(x2, y2);
_arg2.lineTo(x0, y0);
if (bitmap){
_arg2.endFill();
};
if (lineAlpha){
_arg2.lineStyle();
};
_arg3.renderStatistics.triangles++;
} else {
_triMap = (_arg5) ? _arg5 : ((uvMatrices[_arg1]) || (transformUV(_arg1)));
focus = _arg3.camera.focus;
renderRec(_arg2, _triMap, _arg1.v0.vertex3DInstance, _arg1.v1.vertex3DInstance, _arg1.v2.vertex3DInstance, 0, _arg3, (_arg4) ? _arg4 : bitmap);
};
}
public function resetMapping():void{
uvMatrices = new Dictionary();
}
public function get precision():int{
return (_precision);
}
public function get pixelPrecision():int{
return (_perPixelPrecision);
}
public function renderTriangleBitmap(_arg1:Graphics, _arg2:Matrix, _arg3:Vertex3DInstance, _arg4:Vertex3DInstance, _arg5:Vertex3DInstance, _arg6:Boolean, _arg7:Boolean, _arg8:BitmapData):void{
a2 = (_arg4.x - _arg3.x);
b2 = (_arg4.y - _arg3.y);
c2 = (_arg5.x - _arg3.x);
d2 = (_arg5.y - _arg3.y);
tempTriangleMatrix.a = ((_arg2.a * a2) + (_arg2.b * c2));
tempTriangleMatrix.b = ((_arg2.a * b2) + (_arg2.b * d2));
tempTriangleMatrix.c = ((_arg2.c * a2) + (_arg2.d * c2));
tempTriangleMatrix.d = ((_arg2.c * b2) + (_arg2.d * d2));
tempTriangleMatrix.tx = (((_arg2.tx * a2) + (_arg2.ty * c2)) + _arg3.x);
tempTriangleMatrix.ty = (((_arg2.tx * b2) + (_arg2.ty * d2)) + _arg3.y);
_arg1.beginBitmapFill(_arg8, tempTriangleMatrix, _arg7, _arg6);
_arg1.moveTo(_arg3.x, _arg3.y);
_arg1.lineTo(_arg4.x, _arg4.y);
_arg1.lineTo(_arg5.x, _arg5.y);
_arg1.endFill();
}
public function set precise(_arg1:Boolean):void{
_precise = _arg1;
}
protected function extendBitmapEdges(_arg1:BitmapData, _arg2:Number, _arg3:Number):void{
var _local4:Rectangle;
var _local5:Point;
var _local6:int;
_local4 = new Rectangle();
_local5 = new Point();
if (_arg1.width > _arg2){
_local4.x = (_arg2 - 1);
_local4.y = 0;
_local4.width = 1;
_local4.height = _arg3;
_local5.y = 0;
_local6 = _arg2;
while (_local6 < _arg1.width) {
_local5.x = _local6;
_arg1.copyPixels(_arg1, _local4, _local5);
_local6++;
};
};
if (_arg1.height > _arg3){
_local4.x = 0;
_local4.y = (_arg3 - 1);
_local4.width = _arg1.width;
_local4.height = 1;
_local5.x = 0;
_local6 = _arg3;
while (_local6 < _arg1.height) {
_local5.y = _local6;
_arg1.copyPixels(_arg1, _local4, _local5);
_local6++;
};
};
}
override public function destroy():void{
super.destroy();
if (uvMatrices){
uvMatrices = null;
};
if (bitmap){
bitmap.dispose();
};
this.renderRecStorage = null;
}
public function set precision(_arg1:int):void{
_precision = _arg1;
}
}
}//package org.papervision3d.materials
Section 159
//MovieMaterial (org.papervision3d.materials.MovieMaterial)
package org.papervision3d.materials {
import org.papervision3d.core.render.data.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.render.material.*;
import org.papervision3d.*;
import org.papervision3d.core.render.draw.*;
public class MovieMaterial extends BitmapMaterial implements ITriangleDrawer, IUpdateBeforeMaterial {
private var _animated:Boolean;
public var movieTransparent:Boolean;
public var movie:DisplayObject;
public var allowAutoResize:Boolean;// = true
public function MovieMaterial(_arg1:DisplayObject=null, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Boolean=false){
allowAutoResize = true;
super();
movieTransparent = _arg2;
this.animated = _arg3;
this.interactive = interactive;
this.precise = _arg4;
if (_arg1){
texture = _arg1;
};
}
override public function get texture():Object{
return (this._texture);
}
public function set animated(_arg1:Boolean):void{
_animated = _arg1;
}
override public function set texture(_arg1:Object):void{
if ((_arg1 is DisplayObject) == false){
Papervision3D.log("Error: MovieMaterial.texture requires a Sprite to be passed as the object");
return;
};
bitmap = createBitmapFromSprite(DisplayObject(_arg1));
_texture = _arg1;
}
protected function initBitmap(_arg1:DisplayObject):void{
if (bitmap){
bitmap.dispose();
};
if ((((_arg1.width == 0)) || ((_arg1.height == 0)))){
bitmap = new BitmapData(0x0100, 0x0100, movieTransparent, fillColor);
} else {
bitmap = new BitmapData(_arg1.width, _arg1.height, this.movieTransparent);
};
}
public function updateBeforeRender(_arg1:RenderSessionData):void{
var _local2:int;
var _local3:int;
var _local4:Boolean;
if (_animated){
_local2 = int(movie.width);
_local3 = int(movie.height);
if (((allowAutoResize) && (((!((_local2 == bitmap.width))) || (!((_local3 == bitmap.height))))))){
initBitmap(movie);
_local4 = true;
};
drawBitmap();
if (_local4){
bitmap = super.createBitmap(bitmap);
};
};
}
public function get animated():Boolean{
return (_animated);
}
public function drawBitmap():void{
var _local1:Matrix;
bitmap.fillRect(bitmap.rect, this.fillColor);
_local1 = new Matrix();
_local1.scale(movie.scaleX, movie.scaleY);
bitmap.draw(movie, _local1, movie.transform.colorTransform);
}
protected function createBitmapFromSprite(_arg1:DisplayObject):BitmapData{
movie = _arg1;
initBitmap(movie);
drawBitmap();
bitmap = super.createBitmap(bitmap);
return (bitmap);
}
}
}//package org.papervision3d.materials
Section 160
//WireframeMaterial (org.papervision3d.materials.WireframeMaterial)
package org.papervision3d.materials {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.render.draw.*;
import org.papervision3d.core.material.*;
public class WireframeMaterial extends TriangleMaterial implements ITriangleDrawer {
public function WireframeMaterial(_arg1:Number=0xFF00FF, _arg2:Number=100, _arg3:Number=0){
this.lineColor = _arg1;
this.lineAlpha = _arg2;
this.lineThickness = _arg3;
this.doubleSided = false;
}
override public function toString():String{
return (((("WireframeMaterial - color:" + this.lineColor) + " alpha:") + this.lineAlpha));
}
override public function drawTriangle(_arg1:Triangle3D, _arg2:Graphics, _arg3:RenderSessionData, _arg4:BitmapData=null, _arg5:Matrix=null):void{
var _local6:Number;
var _local7:Number;
_local6 = _arg1.v0.vertex3DInstance.x;
_local7 = _arg1.v0.vertex3DInstance.y;
if (lineAlpha){
_arg2.lineStyle(lineThickness, lineColor, lineAlpha);
_arg2.moveTo(_local6, _local7);
_arg2.lineTo(_arg1.v1.vertex3DInstance.x, _arg1.v1.vertex3DInstance.y);
_arg2.lineTo(_arg1.v2.vertex3DInstance.x, _arg1.v2.vertex3DInstance.y);
_arg2.lineTo(_local6, _local7);
_arg2.lineStyle();
_arg3.renderStatistics.triangles++;
};
}
}
}//package org.papervision3d.materials
Section 161
//LibraryCollada (org.papervision3d.objects.parsers.LibraryCollada)
package org.papervision3d.objects.parsers {
import org.papervision3d.core.proto.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.math.*;
import org.papervision3d.objects.*;
import flash.events.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.events.*;
import flash.net.*;
import org.papervision3d.*;
import org.papervision3d.materials.*;
public class LibraryCollada extends DisplayObject3D {
public var loaded:Boolean;
private var _container:DisplayObjectContainer3D;
private var COLLADA:XML;
private var _geometries:Object;
private var _loader:URLLoader;
private var _yUp:Boolean;
private var _scaling:Number;
private var _filename:String;
public var materialsToLoad:int;// = 0
private var _materials:MaterialsList;
private var _doubleSidedMaterials:Boolean;// = false
private static var NODESECTION:String = "node";
private static var SKEWNODE:String = "skew";
private static var INPUTTAG:String = "input";
private static var GEOMETRYSECTION:String = "geometry";
private static var VERTEXINPUT:String = "VERTEX";
private static var INSTANCENODE:String = "instance";
private static var POLYGON:String = "p";
private static var PERSPECTIVENODE:String = "perspective";
private static var POSITIONINPUT:String = "POSITION";
private static var LOOKATNODE:String = "lookat";
private static var ACCESSORSECTION:String = "accessor";
private static var UVINPUT:String = "UV";
private static var NORMALINPUT:String = "NORMAL";
private static var POLYGONSSECTION:String = "polygons";
private static var INSTACESCENE:String = "instance_visual_scene";
private static var TRANSLATENODE:String = "translate";
private static var SCALENODE:String = "scale";
private static var MESHSECTION:String = "mesh";
private static var VERTICESSECTION:String = "vertices";
private static var TANGENTINPUT:String = "TANGENT";
private static var MATERIALSECTION:String = "material";
private static var toDEGREES:Number = 57.2957795130823;
public static var DEFAULT_SCALING:Number = 1;
private static var SOURCESECTION:String = "source";
private static var TEXCOORDINPUT:String = "TEXCOORD";
private static var LIBRARYSECTION:String = "library";
private static var MATRIXNODE:String = "matrix";
private static var ROTATENODE:String = "rotate";
private static var SCENESECTION:String = "scene";
private static var INTERNAL_SCALING:Number = 100;
private static var CAMERAPREFAB:String = "camera";
private static var ARRAYSECTION:String = "array";
private static var PARAMTAG:String = "param";
private static var COLLADASECTION:String = "COLLADA";
private static var ASSETSECTION:String = "asset";
private static var LIGHTPREFAB:String = "light";
private static var toRADIANS:Number = 0.0174532925199433;
public function LibraryCollada(_arg1, _arg2:MaterialsList=null, _arg3:Number=1, _arg4:Boolean=false, _arg5:Object=null){
materialsToLoad = 0;
_doubleSidedMaterials = false;
super(null, null, _arg5);
this._materials = ((_arg2) || (new MaterialsList()));
this._container = this;
this.loaded = false;
this._scaling = ((_arg3) || (DEFAULT_SCALING));
this._scaling = (this._scaling * INTERNAL_SCALING);
this._doubleSidedMaterials = _arg4;
this._geometries = new Object();
if ((_arg1 is XML)){
this.COLLADA = _arg1;
this._filename = "";
buildCollada();
} else {
if ((_arg1 is String)){
this._filename = _arg1;
loadCollada();
};
};
}
private function handleSecurityLoadError(_arg1:SecurityErrorEvent):void{
trace("COLLADA file security load error", _arg1.text);
dispatchEvent(new FileLoadEvent(FileLoadEvent.SECURITY_LOAD_ERROR, this._filename, 0, 0, _arg1.text));
}
private function getId(_arg1:String):String{
return (_arg1.split("#")[1]);
}
public function getMaterialsList():MaterialsList{
return (_materials);
}
private function onMaterialLoadError(_arg1:FileLoadEvent):void{
var _local2:BitmapFileMaterial;
_local2 = (_arg1.target as BitmapFileMaterial);
trace(("Colllada failed to load material : " + _local2));
materialsToLoad--;
if (materialsToLoad == 0){
dispatchEvent(new FileLoadEvent(FileLoadEvent.COLLADA_MATERIALS_DONE));
};
}
private function onComplete(_arg1:Event):void{
this.COLLADA = new XML(this._loader.data);
buildCollada();
}
private function handleIOError(_arg1:IOErrorEvent):void{
trace("COLLADA file load error", _arg1.text);
dispatchEvent(new FileLoadEvent(FileLoadEvent.LOAD_ERROR, this._filename, 0, 0, _arg1.text));
}
private function parseGeometry(_arg1:XML, _arg2:DisplayObject3D, _arg3:Matrix3D=null, _arg4:Object=null):void{
var _local5:Matrix3D;
var _local6:Object;
var _local7:Array;
var _local8:Boolean;
var _local9:XML;
var _local10:Array;
var _local11:XML;
var _local12:Array;
var _local13:Number;
var _local14:String;
var _local15:Number;
var _local16:Object;
var _local17:Number;
var _local18:String;
var _local19:Number;
if (_arg1 != null){
_local5 = ((Matrix3D.clone(_arg3)) || (Matrix3D.IDENTITY));
_local6 = new Object();
_local6.name = _arg1.@id;
_local7 = (_local6.triangles = new Array());
_local8 = (_arg1.mesh.triangles.length() > 1);
for each (_local9 in _arg1.mesh.triangles) {
_local10 = new Array();
for each (_local11 in _local9.input) {
_local6[_local11.@semantic] = deserialize(_local11, _arg1);
_local10.push(_local11.@semantic);
};
_local12 = _local9.p.split(" ");
_local13 = _local9.@count;
_local14 = _local9.@material;
addMaterial(_arg2, _local14, _arg4);
_local15 = 0;
while (_local15 < _local13) {
_local16 = new Object();
_local17 = 0;
while (_local17 < 3) {
_local19 = 0;
while ((_local18 = _local10[_local19])) {
if (!_local16[_local18]){
_local16[_local18] = new Array();
};
_local16[_local18].push(Number(_local12.shift()));
_local19++;
};
_local16["material"] = _local14;
_local17++;
};
_local7.push(_local16);
_local15++;
};
};
buildObject(_local6, _arg2, _local5);
};
}
private function handleLoadProgress(_arg1:ProgressEvent):void{
var _local2:FileLoadEvent;
_local2 = new FileLoadEvent(FileLoadEvent.LOAD_PROGRESS, this._filename, _arg1.bytesLoaded, _arg1.bytesTotal);
dispatchEvent(_local2);
}
private function onMaterialLoadComplete(_arg1:FileLoadEvent):void{
materialsToLoad--;
if (materialsToLoad == 0){
materials = new MaterialsList();
dispatchEvent(new FileLoadEvent(FileLoadEvent.COLLADA_MATERIALS_DONE));
};
}
private function deserialize(_arg1:XML, _arg2:XML):Array{
var output:Array;
var id:String;
var acc:XMLList;
var floId:String;
var floXML:XMLList;
var floStr:String;
var floats:Array;
var params:Array;
var par:XML;
var count:int;
var stride:int;
var i:int;
var element:Object;
var j:int;
var recursive:XMLList;
var input = _arg1;
var geo = _arg2;
output = new Array();
id = input.@source.split("#")[1];
acc = geo..source.(@id == id).technique_common.accessor;
if (acc != new XMLList(null)){
floId = acc.@source.split("#")[1];
floXML = COLLADA..float_array.(@id == floId);
floStr = floXML.toString();
floats = floStr.split(" ");
params = new Array();
for each (par in acc.param) {
params.push(par.@name);
};
count = acc.@count;
stride = acc.@stride;
i = 0;
while (i < count) {
element = new Object();
j = 0;
while (j < stride) {
element[params[j]] = floats.shift();
j = (j + 1);
};
output.push(element);
i = (i + 1);
};
} else {
recursive = geo..vertices.(@id == id)[INPUTTAG];
output = deserialize(recursive[0], geo);
};
return (output);
}
private function parseScene(_arg1:XML):void{
var _local2:XML;
for each (_local2 in _arg1.node) {
parseNode(_local2, this._container);
};
}
private function scaleMatrix(_arg1:Array):Matrix3D{
if (this._yUp){
return (Matrix3D.scaleMatrix(_arg1[0], _arg1[1], _arg1[2]));
};
return (Matrix3D.scaleMatrix(_arg1[0], _arg1[2], _arg1[1]));
}
private function buildObject(_arg1:Object, _arg2:DisplayObject3D, _arg3:Matrix3D=null):void{
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:Array;
var _local8:Number;
var _local9:int;
var _local10:Array;
var _local11:Array;
var _local12:Object;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Array;
var _local17:Vertex3D;
var _local18:Vertex3D;
var _local19:Vertex3D;
var _local20:Array;
var _local21:Array;
var _local22:Array;
var _local23:Array;
var _local24:NumberUV;
var _local25:NumberUV;
var _local26:NumberUV;
var _local27:String;
var _local28:Triangle3D;
_arg3 = ((_arg3) || (Matrix3D.IDENTITY));
_arg2.addGeometry(new GeometryObject3D());
_local4 = (_arg2.geometry.vertices = new Array());
_local5 = this._scaling;
_local6 = _local4.length;
_local7 = _arg1.VERTEX;
_local8 = _local7.length;
_local9 = 0;
while (_local9 < _local8) {
_local12 = _local7[_local9];
_local13 = (Number(_local12.X) * _local5);
_local14 = (Number(_local12.Y) * _local5);
_local15 = (Number(_local12.Z) * _local5);
if (this._yUp){
_local4.push(new Vertex3D(-(_local13), _local14, _local15));
} else {
_local4.push(new Vertex3D(_local13, _local15, _local14));
};
_local9++;
};
_local10 = (_arg2.geometry.faces = new Array());
_local11 = _arg1.triangles;
_local8 = _local11.length;
_local9 = 0;
while (_local9 < _local8) {
_local16 = _local11[_local9].VERTEX;
_local17 = _local4[(_local6 + _local16[0])];
_local18 = _local4[(_local6 + _local16[1])];
_local19 = _local4[(_local6 + _local16[2])];
_local20 = [_local17, _local18, _local19];
_local21 = _arg1.TEXCOORD;
_local22 = _local11[_local9].TEXCOORD;
if (((_local22) && (_local21))){
_local24 = new NumberUV(_local21[_local22[0]].S, _local21[_local22[0]].T);
_local25 = new NumberUV(_local21[_local22[1]].S, _local21[_local22[1]].T);
_local26 = new NumberUV(_local21[_local22[2]].S, _local21[_local22[2]].T);
_local23 = [_local24, _local25, _local26];
} else {
_local23 = null;
};
_local27 = ((_local11[_local9].material) || (null));
_local28 = new Triangle3D(_arg2, _local20, _materials.getMaterialByName(_local27), _local23);
_local10.push(_local28);
_local9++;
};
_arg2.geometry.ready = true;
_arg3.n14 = (_arg3.n14 * _local5);
_arg3.n24 = (_arg3.n24 * _local5);
_arg3.n34 = (_arg3.n34 * _local5);
_arg2.visible = true;
}
private function bakedMatrix(_arg1:Matrix3D):Matrix3D{
_arg1.n14 = (_arg1.n14 * _scaling);
_arg1.n24 = (_arg1.n24 * _scaling);
_arg1.n34 = (_arg1.n34 * _scaling);
return (_arg1);
}
private function parseNode(_arg1:XML, _arg2:DisplayObjectContainer3D):void{
var matrix:Matrix3D;
var newNode:DisplayObject3D;
var instance:DisplayObject3D;
var children:XMLList;
var totalChildren:int;
var i:int;
var child:XML;
var bindMaterial:Object;
var instance_material:XML;
var geometry:XML;
var geoId:String;
var geo:XML;
var node = _arg1;
var parent = _arg2;
matrix = Matrix3D.IDENTITY;
if (String(node.instance_geometry) == ""){
newNode = new DisplayObject3D(node.@name);
} else {
newNode = new TriangleMesh3D(null, null, null, node.@name);
};
instance = parent.addChild(newNode, node.@name);
children = node.children();
totalChildren = children.length();
i = 0;
while (i < totalChildren) {
child = children[i];
switch (child.name().localName){
case "translate":
matrix = Matrix3D.multiply(matrix, translateMatrix(getArray(child)));
break;
case "rotate":
matrix = Matrix3D.multiply(matrix, rotateMatrix(getArray(child)));
break;
case "scale":
matrix = Matrix3D.multiply(matrix, scaleMatrix(getArray(child)));
break;
case "matrix":
matrix = Matrix3D.multiply(matrix, bakedMatrix(new Matrix3D(getArray(child))));
break;
case "node":
parseNode(child, instance);
break;
case "instance_geometry":
bindMaterial = new Object();
for each (instance_material in child..instance_material) {
bindMaterial[instance_material.@symbol] = instance_material.@target.split("#")[1];
};
for each (geometry in child) {
geoId = getId(geometry.@url);
geo = COLLADA.library_geometries.geometry.(@id == geoId)[0];
parseGeometry(geo, instance, Matrix3D.clone(matrix), bindMaterial);
};
break;
};
i = (i + 1);
};
instance.copyTransform(matrix);
}
private function loadCollada():void{
this._loader = new URLLoader();
this._loader.addEventListener(Event.COMPLETE, onComplete);
this._loader.addEventListener(IOErrorEvent.IO_ERROR, handleIOError);
this._loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, handleSecurityLoadError);
this._loader.addEventListener(ProgressEvent.PROGRESS, handleLoadProgress);
this._loader.load(new URLRequest(this._filename));
}
private function getArray(_arg1:String):Array{
var _local2:Array;
var _local3:Array;
var _local4:Number;
var _local5:Number;
_local2 = _arg1.split(" ");
_local3 = new Array();
_local4 = _local2.length;
_local5 = 0;
while (_local5 < _local4) {
_local3[_local5] = Number(_local2[_local5]);
_local5++;
};
return (_local3);
}
private function translateMatrix(_arg1:Array):Matrix3D{
if (this._yUp){
return (Matrix3D.translationMatrix((-(_arg1[0]) * this._scaling), (_arg1[1] * this._scaling), (_arg1[2] * this._scaling)));
};
return (Matrix3D.translationMatrix((_arg1[0] * this._scaling), (_arg1[2] * this._scaling), (_arg1[1] * this._scaling)));
}
private function getTexture(_arg1:String):String{
var filename:String;
var material:XML;
var effectId:String;
var effect:XML;
var textureId:String;
var sampler:XML;
var imageId:String;
var image:XML;
var sourceId:String;
var source:XML;
var name = _arg1;
filename = null;
material = COLLADA.library_materials.material.(@id == name)[0];
if (material){
effectId = getId(material.instance_effect.@url);
effect = COLLADA.library_effects.effect.(@id == effectId)[0];
if (effect..texture.length() == 0){
return (null);
};
textureId = effect..texture[0].@texture;
sampler = effect..newparam.(@sid == textureId)[0];
imageId = textureId;
if (sampler){
sourceId = sampler..source[0];
source = effect..newparam.(@sid == sourceId)[0];
imageId = source..init_from[0];
};
image = COLLADA.library_images.image.(@id == imageId)[0];
filename = image.init_from;
if (filename.substr(0, 2) == "./"){
filename = filename.substr(2);
};
};
return (filename);
}
private function addMaterial(_arg1:DisplayObject3D, _arg2:String, _arg3:Object):void{
var _local4:MaterialObject3D;
var _local5:String;
var _local6:String;
if (this._materials){
_local4 = this._materials.getMaterialByName(_arg2);
} else {
_materials = new MaterialsList();
};
if (!_local4){
_local5 = this._filename.slice(0, (this._filename.lastIndexOf("/") + 1));
_local6 = getTexture(_arg3[_arg2]);
if (_local6){
materialsToLoad++;
_local4 = new BitmapAssetMaterial(_local6);
materialsToLoad--;
if (materialsToLoad == 0){
materials = new MaterialsList();
dispatchEvent(new FileLoadEvent(FileLoadEvent.COLLADA_MATERIALS_DONE));
};
} else {
_local4 = MaterialObject3D.DEFAULT;
Papervision3D.log((("Collada material " + _arg2) + " not found."));
};
_local4.name = _arg2;
_local4.doubleSided = _doubleSidedMaterials;
_local4.tiled = true;
};
_materials.addMaterial(_local4);
if (!_arg1.materials){
_arg1.materials = new MaterialsList();
};
_local4.registerObject(_arg1);
_arg1.materials.addMaterial(_local4, _arg2);
}
private function buildCollada():void{
var sceneId:String;
var scene:XML;
var fileEvent:FileLoadEvent;
materialsToLoad = 0;
this._yUp = (COLLADA.asset.up_axis == "Y_UP");
sceneId = getId(COLLADA.scene.instance_visual_scene.@url);
scene = COLLADA.library_visual_scenes.visual_scene.(@id == sceneId)[0];
parseScene(scene);
fileEvent = new FileLoadEvent(FileLoadEvent.LOAD_COMPLETE, _filename);
this.dispatchEvent(fileEvent);
this.loaded = true;
}
private function rotateMatrix(_arg1:Array):Matrix3D{
if (this._yUp){
return (Matrix3D.rotationMatrix(_arg1[0], _arg1[1], _arg1[2], (-(_arg1[3]) * toRADIANS)));
};
return (Matrix3D.rotationMatrix(_arg1[0], _arg1[2], _arg1[1], (-(_arg1[3]) * toRADIANS)));
}
}
}//package org.papervision3d.objects.parsers
Section 162
//Cube (org.papervision3d.objects.primitives.Cube)
package org.papervision3d.objects.primitives {
import org.papervision3d.core.proto.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.*;
public class Cube extends TriangleMesh3D {
private var insideFaces:int;
public var segments:Number3D;
private var excludeFaces:int;
public static var ALL:int = (((((FRONT + BACK) + RIGHT) + LEFT) + TOP) + BOTTOM);
public static var LEFT:int = 8;
public static var FRONT:int = 1;
public static var BOTTOM:int = 32;
public static var TOP:int = 16;
public static var BACK:int = 2;
public static var NONE:int = 0;
public static var RIGHT:int = 4;
public function Cube(_arg1:MaterialsList, _arg2:Number=500, _arg3:Number=500, _arg4:Number=500, _arg5:int=1, _arg6:int=1, _arg7:int=1, _arg8:int=0, _arg9:int=0, _arg10:Object=null){
super(_arg1.getMaterialByName("all"), new Array(), new Array(), null, _arg10);
this.materials = _arg1;
this.insideFaces = _arg8;
this.excludeFaces = _arg9;
segments = new Number3D(_arg5, _arg6, _arg7);
buildCube(_arg2, _arg4, _arg3);
}
private function buildPlane(_arg1:String, _arg2:String, _arg3:String, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false):void{
var _local8:MaterialObject3D;
var _local9:String;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Array;
var _local16:Array;
var _local17:Array;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:int;
var _local23:NumberUV;
var _local24:NumberUV;
var _local25:NumberUV;
var _local26:int;
var _local27:Vertex3D;
var _local28:Vertex3D;
var _local29:Vertex3D;
var _local30:Vertex3D;
_local8 = materials.getMaterialByName(_arg1);
if (!_local8){
_local8 = materials.getMaterialByName("all");
if (!_local8){
Papervision3D.log("Cube: Required material not found in given materials list. Supported materials are: front, back, right, left, top, bottom & all.");
return;
};
};
if ((((((_arg2 == "x")) && ((_arg3 == "y")))) || ((((_arg2 == "y")) && ((_arg3 == "x")))))){
_local9 = "z";
} else {
if ((((((_arg2 == "x")) && ((_arg3 == "z")))) || ((((_arg2 == "z")) && ((_arg3 == "x")))))){
_local9 = "y";
} else {
if ((((((_arg2 == "z")) && ((_arg3 == "y")))) || ((((_arg2 == "y")) && ((_arg3 == "z")))))){
_local9 = "x";
};
};
};
_local10 = (_arg7) ? -1 : 1;
_local11 = this.segments[_arg2];
_local12 = this.segments[_arg3];
_local13 = (_local11 + 1);
_local14 = (_local12 + 1);
_local15 = this.geometry.vertices;
_local16 = this.geometry.faces;
_local17 = new Array();
_local18 = (_arg4 / 2);
_local19 = (_arg5 / 2);
_local20 = (_arg4 / _local11);
_local21 = (_arg5 / _local12);
_local22 = 0;
while (_local22 < _local13) {
_local26 = 0;
while (_local26 < _local14) {
_local27 = new Vertex3D();
_local27[_arg2] = (((_local22 * _local20) - _local18) * _local10);
_local27[_arg3] = ((_local26 * _local21) - _local19);
_local27[_local9] = _arg6;
_local15.push(_local27);
_local17.push(_local27);
_local26++;
};
_local22++;
};
_local22 = 0;
while (_local22 < _local11) {
_local26 = 0;
while (_local26 < _local12) {
_local28 = _local17[((_local22 * _local14) + _local26)];
_local29 = _local17[((_local22 * _local14) + (_local26 + 1))];
_local30 = _local17[(((_local22 + 1) * _local14) + _local26)];
_local23 = new NumberUV((_local22 / _local11), (_local26 / _local12));
_local24 = new NumberUV((_local22 / _local11), ((_local26 + 1) / _local12));
_local25 = new NumberUV(((_local22 + 1) / _local11), (_local26 / _local12));
_local16.push(new Triangle3D(this, [_local28, _local30, _local29], _local8, [_local23, _local25, _local24]));
_local28 = _local17[(((_local22 + 1) * _local14) + (_local26 + 1))];
_local29 = _local17[(((_local22 + 1) * _local14) + _local26)];
_local30 = _local17[((_local22 * _local14) + (_local26 + 1))];
_local23 = new NumberUV(((_local22 + 1) / _local11), ((_local26 + 1) / _local12));
_local24 = new NumberUV(((_local22 + 1) / _local11), (_local26 / _local12));
_local25 = new NumberUV((_local22 / _local11), ((_local26 + 1) / _local12));
_local16.push(new Triangle3D(this, [_local29, _local28, _local30], _local8, [_local24, _local23, _local25]));
_local26++;
};
_local22++;
};
}
private function buildCube(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local4 = (_arg1 / 2);
_local5 = (_arg2 / 2);
_local6 = (_arg3 / 2);
if (!(excludeFaces & FRONT)){
buildPlane("front", "x", "y", _arg1, _arg2, _local6, !(Boolean((insideFaces & FRONT))));
};
if (!(excludeFaces & BACK)){
buildPlane("back", "x", "y", _arg1, _arg2, -(_local6), Boolean((insideFaces & BACK)));
};
if (!(excludeFaces & RIGHT)){
buildPlane("right", "z", "y", _arg3, _arg2, _local4, Boolean((insideFaces & RIGHT)));
};
if (!(excludeFaces & LEFT)){
buildPlane("left", "z", "y", _arg3, _arg2, -(_local4), !(Boolean((insideFaces & LEFT))));
};
if (!(excludeFaces & TOP)){
buildPlane("top", "x", "z", _arg1, _arg3, _local5, Boolean((insideFaces & TOP)));
};
if (!(excludeFaces & BOTTOM)){
buildPlane("bottom", "x", "z", _arg1, _arg3, -(_local5), !(Boolean((insideFaces & BOTTOM))));
};
mergeVertices();
this.geometry.ready = true;
if (Papervision3D.useRIGHTHANDED){
this.geometry.flipFaces();
};
}
}
}//package org.papervision3d.objects.primitives
Section 163
//Plane (org.papervision3d.objects.primitives.Plane)
package org.papervision3d.objects.primitives {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.geom.renderables.*;
import org.papervision3d.core.math.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.*;
public class Plane extends TriangleMesh3D {
public var segmentsH:Number;
public var segmentsW:Number;
public static var DEFAULT_SCALE:Number = 1;
public static var DEFAULT_SEGMENTS:Number = 1;
public static var DEFAULT_SIZE:Number = 500;
public function Plane(_arg1:MaterialObject3D=null, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Object=null){
var _local7:Number;
super(_arg1, new Array(), new Array(), null, _arg6);
this.segmentsW = ((_arg4) || (DEFAULT_SEGMENTS));
this.segmentsH = ((_arg5) || (this.segmentsW));
_local7 = DEFAULT_SCALE;
if (!_arg3){
if (_arg2){
_local7 = _arg2;
};
if (((_arg1) && (_arg1.bitmap))){
_arg2 = (_arg1.bitmap.width * _local7);
_arg3 = (_arg1.bitmap.height * _local7);
} else {
_arg2 = (DEFAULT_SIZE * _local7);
_arg3 = (DEFAULT_SIZE * _local7);
};
};
buildPlane(_arg2, _arg3);
}
private function buildPlane(_arg1:Number, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Array;
var _local8:Array;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:int;
var _local14:NumberUV;
var _local15:NumberUV;
var _local16:NumberUV;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:Vertex3D;
var _local21:Vertex3D;
var _local22:Vertex3D;
_local3 = this.segmentsW;
_local4 = this.segmentsH;
_local5 = (_local3 + 1);
_local6 = (_local4 + 1);
_local7 = this.geometry.vertices;
_local8 = this.geometry.faces;
_local9 = (_arg1 / 2);
_local10 = (_arg2 / 2);
_local11 = (_arg1 / _local3);
_local12 = (_arg2 / _local4);
_local13 = 0;
while (_local13 < (_local3 + 1)) {
_local17 = 0;
while (_local17 < _local6) {
_local18 = ((_local13 * _local11) - _local9);
_local19 = ((_local17 * _local12) - _local10);
_local7.push(new Vertex3D(_local18, _local19, 0));
_local17++;
};
_local13++;
};
_local13 = 0;
while (_local13 < _local3) {
_local17 = 0;
while (_local17 < _local4) {
_local20 = _local7[((_local13 * _local6) + _local17)];
_local21 = _local7[((_local13 * _local6) + (_local17 + 1))];
_local22 = _local7[(((_local13 + 1) * _local6) + _local17)];
_local14 = new NumberUV((_local13 / _local3), (_local17 / _local4));
_local15 = new NumberUV((_local13 / _local3), ((_local17 + 1) / _local4));
_local16 = new NumberUV(((_local13 + 1) / _local3), (_local17 / _local4));
_local8.push(new Triangle3D(this, [_local20, _local22, _local21], material, [_local14, _local16, _local15]));
_local20 = _local7[(((_local13 + 1) * _local6) + (_local17 + 1))];
_local21 = _local7[(((_local13 + 1) * _local6) + _local17)];
_local22 = _local7[((_local13 * _local6) + (_local17 + 1))];
_local14 = new NumberUV(((_local13 + 1) / _local3), ((_local17 + 1) / _local4));
_local15 = new NumberUV(((_local13 + 1) / _local3), (_local17 / _local4));
_local16 = new NumberUV((_local13 / _local3), ((_local17 + 1) / _local4));
_local8.push(new Triangle3D(this, [_local20, _local22, _local21], material, [_local14, _local16, _local15]));
_local17++;
};
_local13++;
};
this.geometry.ready = true;
if (Papervision3D.useRIGHTHANDED){
this.geometry.flipFaces();
};
}
}
}//package org.papervision3d.objects.primitives
Section 164
//DisplayObject3D (org.papervision3d.objects.DisplayObject3D)
package org.papervision3d.objects {
import org.papervision3d.core.proto.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.view.*;
import flash.display.*;
import org.papervision3d.core.math.*;
import org.papervision3d.view.layer.*;
import org.papervision3d.core.data.*;
import org.papervision3d.core.culling.*;
import org.papervision3d.*;
public class DisplayObject3D extends DisplayObjectContainer3D {
public var filters:Array;
public var extra:Object;
public var frustumTestMethod:int;// = 0
private var _rotationX:Number;
private var _rotationY:Number;
private var _rotationZ:Number;
private var position:Number3D;
public var meshSort:uint;// = 1
public var materials:MaterialsList;
public var id:int;
private var xAxis:Number3D;
private var zAxis:Number3D;
private var _scaleDirty:Boolean;// = false
private var _numClones:uint;// = 0
public var alpha:Number;// = 1
private var _scaleX:Number;
private var _scaleY:Number;
private var _scaleZ:Number;
public var screen:Number3D;
protected var _userData:UserData;
public var screenZ:Number;
protected var _useOwnContainer:Boolean;// = false
public var visible:Boolean;
public var name:String;
public var container:ViewportLayer;
private var target:Number3D;
public var world:Matrix3D;
public var blendMode:String;// = "normal"
private var _material:MaterialObject3D;
public var culled:Boolean;
public var transform:Matrix3D;
public var geometry:GeometryObject3D;
public var parent:DisplayObjectContainer3D;
protected var _scene:SceneObject3D;// = null
public var view:Matrix3D;
private var yAxis:Number3D;
public var faces:Array;
public var flipLightDirection:Boolean;// = false
private var _rotation:Number3D;
protected var _sorted:Array;
protected var _transformDirty:Boolean;// = false
private var _rotationDirty:Boolean;// = false
public var parentContainer:DisplayObject3D;
private static const LEFT:Number3D = new Number3D(-1, 0, 0);
public static const MESH_SORT_CLOSE:uint = 3;
public static const MESH_SORT_CENTER:uint = 1;
private static const BACKWARD:Number3D = new Number3D(0, 0, -1);
private static const FORWARD:Number3D = new Number3D(0, 0, 1);
public static const MESH_SORT_FAR:uint = 2;
private static const DOWN:Number3D = new Number3D(0, -1, 0);
private static const UP:Number3D = new Number3D(0, 1, 0);
private static const RIGHT:Number3D = new Number3D(1, 0, 0);
private static var entry_count:uint = 0;
private static var _totalDisplayObjects:int = 0;
private static var _tempMatrix:Matrix3D = Matrix3D.IDENTITY;
public static var sortedArray:Array = new Array();
private static var _tempQuat:Quaternion = new Quaternion();
private static var toDEGREES:Number = 57.2957795130823;
public static var faceLevelMode:Boolean;
private static var toRADIANS:Number = 0.0174532925199433;
public function DisplayObject3D(_arg1:String=null, _arg2:GeometryObject3D=null, _arg3:Object=null):void{
var _local4:Number;
_transformDirty = false;
position = Number3D.ZERO;
target = Number3D.ZERO;
zAxis = Number3D.ZERO;
xAxis = Number3D.ZERO;
yAxis = Number3D.ZERO;
_rotation = Number3D.ZERO;
_rotationDirty = false;
_scaleDirty = false;
_numClones = 0;
alpha = 1;
blendMode = BlendMode.NORMAL;
filters = [];
_useOwnContainer = false;
flipLightDirection = false;
frustumTestMethod = FrustumTestMethod.BOUNDING_SPHERE;
screen = new Number3D();
_scene = null;
meshSort = MESH_SORT_CENTER;
faces = new Array();
super();
if (_arg1 != null){
Papervision3D.log(("DisplayObject3D: " + _arg1));
};
this.culled = false;
this.transform = Matrix3D.IDENTITY;
this.world = Matrix3D.IDENTITY;
this.view = Matrix3D.IDENTITY;
if (_arg3 != null){
this.x = (_arg3.x) ? ((_arg3.x) || (0)) : 0;
this.y = (_arg3.y) ? ((_arg3.y) || (0)) : 0;
this.z = (_arg3.z) ? ((_arg3.z) || (0)) : 0;
};
rotationX = (_arg3) ? ((_arg3.rotationX) || (0)) : 0;
rotationY = (_arg3) ? ((_arg3.rotationY) || (0)) : 0;
rotationZ = (_arg3) ? ((_arg3.rotationZ) || (0)) : 0;
_local4 = (Papervision3D.usePERCENT) ? 100 : 1;
scaleX = (_arg3) ? ((_arg3.scaleX) || (_local4)) : _local4;
scaleY = (_arg3) ? ((_arg3.scaleY) || (_local4)) : _local4;
scaleZ = (_arg3) ? ((_arg3.scaleZ) || (_local4)) : _local4;
if (((_arg3) && (_arg3.extra))){
this.extra = _arg3.extra;
};
this.visible = true;
this.id = _totalDisplayObjects++;
this.name = ((_arg1) || (String(this.id)));
_numClones = 0;
if (_arg2){
addGeometry(_arg2);
};
}
public function set z(_arg1:Number):void{
this.transform.n34 = _arg1;
}
public function moveDown(_arg1:Number):void{
translate(_arg1, DOWN);
}
public function set scene(_arg1:SceneObject3D):void{
var _local2:DisplayObject3D;
_scene = _arg1;
for each (_local2 in this._childrenByName) {
if (_local2.scene == null){
_local2.scene = _scene;
};
};
}
public function project(_arg1:DisplayObject3D, _arg2:RenderSessionData):Number{
var _local3:Number;
var _local4:Number;
var _local5:DisplayObject3D;
if (this._transformDirty){
updateTransform();
};
this.world.calculateMultiply(_arg1.world, this.transform);
if ((_arg2.camera is IObjectCuller)){
if (this === _arg2.camera){
this.culled = true;
} else {
this.culled = (IObjectCuller(_arg2.camera).testObject(this) < 0);
};
if (this.culled){
_arg2.renderStatistics.culledObjects++;
return (0);
};
if (_arg1 !== _arg2.camera){
this.view.calculateMultiply4x4(_arg1.view, this.transform);
};
} else {
if (_arg1 !== _arg2.camera){
this.view.calculateMultiply(_arg1.view, this.transform);
};
};
_local3 = 0;
_local4 = 0;
for each (_local5 in this._childrenByName) {
if (_local5.visible){
_local3 = (_local3 + _local5.project(this, _arg2));
_local4++;
};
};
return ((this.screenZ = (_local3 / _local4)));
}
public function get material():MaterialObject3D{
return (_material);
}
public function get userData():UserData{
return (_userData);
}
public function calculateScreenCoords(_arg1:CameraObject3D):void{
var _local2:Number;
_local2 = ((_arg1.focus * _arg1.zoom) / (_arg1.focus + view.n34));
screen.x = (view.n14 * _local2);
screen.y = (view.n24 * _local2);
screen.z = view.n34;
}
public function lookAt(_arg1:DisplayObject3D, _arg2:Number3D=null):void{
var _local3:Matrix3D;
position.reset(this.x, this.y, this.z);
target.reset(_arg1.x, _arg1.y, _arg1.z);
zAxis.copyFrom(target);
zAxis.minusEq(position);
zAxis.normalize();
if (zAxis.modulo > 0.1){
xAxis = Number3D.cross(zAxis, ((_arg2) || (UP)), xAxis);
xAxis.normalize();
yAxis = Number3D.cross(zAxis, xAxis, yAxis);
yAxis.normalize();
_local3 = this.transform;
_local3.n11 = (xAxis.x * _scaleX);
_local3.n21 = (xAxis.y * _scaleX);
_local3.n31 = (xAxis.z * _scaleX);
_local3.n12 = (-(yAxis.x) * _scaleY);
_local3.n22 = (-(yAxis.y) * _scaleY);
_local3.n32 = (-(yAxis.z) * _scaleY);
_local3.n13 = (zAxis.x * _scaleZ);
_local3.n23 = (zAxis.y * _scaleZ);
_local3.n33 = (zAxis.z * _scaleZ);
this._transformDirty = false;
this._rotationDirty = true;
} else {
trace("lookAt error");
};
}
public function set rotationX(_arg1:Number):void{
this._rotationX = (Papervision3D.useDEGREES) ? (-(_arg1) * toRADIANS) : -(_arg1);
this._transformDirty = true;
}
protected function setParentContainer(_arg1:DisplayObject3D, _arg2:Boolean=true):void{
var _local3:DisplayObject3D;
if (((_arg2) && (!((_arg1 == this))))){
parentContainer = _arg1;
};
for each (_local3 in children) {
_local3.setParentContainer(_arg1, _arg2);
};
}
public function set rotationZ(_arg1:Number):void{
this._rotationZ = (Papervision3D.useDEGREES) ? (-(_arg1) * toRADIANS) : -(_arg1);
this._transformDirty = true;
}
public function set rotationY(_arg1:Number):void{
this._rotationY = (Papervision3D.useDEGREES) ? (-(_arg1) * toRADIANS) : -(_arg1);
this._transformDirty = true;
}
public function get scale():Number{
if ((((this._scaleX == this._scaleY)) && ((this._scaleX == this._scaleZ)))){
if (Papervision3D.usePERCENT){
return ((this._scaleX * 100));
};
return (this._scaleX);
//unresolved jump
};
return (NaN);
}
public function addGeometry(_arg1:GeometryObject3D=null):void{
if (_arg1){
this.geometry = _arg1;
};
}
public function get sceneX():Number{
return (this.world.n14);
}
public function get scaleY():Number{
if (Papervision3D.usePERCENT){
return ((this._scaleY * 100));
};
return (this._scaleY);
}
public function get scaleZ():Number{
if (Papervision3D.usePERCENT){
return ((this._scaleZ * 100));
};
return (this._scaleZ);
}
public function moveUp(_arg1:Number):void{
translate(_arg1, UP);
}
public function get scaleX():Number{
if (Papervision3D.usePERCENT){
return ((this._scaleX * 100));
};
return (this._scaleX);
}
public function distanceTo(_arg1:DisplayObject3D):Number{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = (this.x - _arg1.x);
_local3 = (this.y - _arg1.y);
_local4 = (this.z - _arg1.z);
return (Math.sqrt((((_local2 * _local2) + (_local3 * _local3)) + (_local4 * _local4))));
}
public function get sceneY():Number{
return (this.world.n24);
}
public function set userData(_arg1:UserData):void{
_userData = _arg1;
}
public function clone():DisplayObject3D{
var _local1:String;
var _local2:DisplayObject3D;
var _local3:DisplayObject3D;
_local1 = ((this.name + "_") + _numClones++);
_local2 = new DisplayObject3D(_local1);
if (this.material){
_local2.material = this.material;
};
if (this.materials){
_local2.materials = this.materials.clone();
};
if (this.geometry){
_local2.geometry = this.geometry.clone(_local2);
_local2.geometry.ready = true;
};
_local2.copyTransform(this.transform);
for each (_local3 in this.children) {
_local2.addChild(_local3.clone());
};
return (_local2);
}
public function get sceneZ():Number{
return (this.world.n34);
}
private function updateRotation():void{
_rotation = Matrix3D.matrix2euler(this.transform, _rotation);
this._rotationX = (_rotation.x * toRADIANS);
this._rotationY = (_rotation.y * toRADIANS);
this._rotationZ = (_rotation.z * toRADIANS);
this._rotationDirty = false;
}
public function hitTestObject(_arg1:DisplayObject3D, _arg2:Number=1):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local3 = (this.x - _arg1.x);
_local4 = (this.y - _arg1.y);
_local5 = (this.z - _arg1.z);
_local6 = (((_local3 * _local3) + (_local4 * _local4)) + (_local5 * _local5));
_local7 = (this.geometry) ? this.geometry.boundingSphere.maxDistance : 0;
_local8 = (_arg1.geometry) ? _arg1.geometry.boundingSphere.maxDistance : 0;
_local7 = (_local7 * _arg2);
return (((_local7 + _local8) > _local6));
}
override public function toString():String{
return (((((((this.name + ": x:") + Math.round(this.x)) + " y:") + Math.round(this.y)) + " z:") + Math.round(this.z)));
}
public function set material(_arg1:MaterialObject3D):void{
if (_material){
_material.unregisterObject(this);
};
_material = _arg1;
_material.registerObject(this);
}
public function copyTransform(_arg1):void{
var _local2:Matrix3D;
var _local3:Matrix3D;
_local2 = this.transform;
_local3 = ((_arg1 is DisplayObject3D)) ? _arg1.transform : _arg1;
_local2.n11 = _local3.n11;
_local2.n12 = _local3.n12;
_local2.n13 = _local3.n13;
_local2.n14 = _local3.n14;
_local2.n21 = _local3.n21;
_local2.n22 = _local3.n22;
_local2.n23 = _local3.n23;
_local2.n24 = _local3.n24;
_local2.n31 = _local3.n31;
_local2.n32 = _local3.n32;
_local2.n33 = _local3.n33;
_local2.n34 = _local3.n34;
this._transformDirty = false;
this._rotationDirty = true;
}
public function get x():Number{
return (this.transform.n14);
}
public function get y():Number{
return (this.transform.n24);
}
public function get z():Number{
return (this.transform.n34);
}
public function roll(_arg1:Number):void{
var _local2:Number3D;
_arg1 = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1;
_local2 = FORWARD.clone();
if (this._transformDirty){
updateTransform();
};
Matrix3D.rotateAxis(transform, _local2);
_tempMatrix = Matrix3D.rotationMatrix(_local2.x, _local2.y, _local2.z, _arg1, _tempMatrix);
this.transform.calculateMultiply3x3(_tempMatrix, transform);
this._rotationDirty = true;
}
public function yaw(_arg1:Number):void{
var _local2:Number3D;
_arg1 = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1;
_local2 = UP.clone();
if (this._transformDirty){
updateTransform();
};
Matrix3D.rotateAxis(transform, _local2);
_tempMatrix = Matrix3D.rotationMatrix(_local2.x, _local2.y, _local2.z, _arg1, _tempMatrix);
this.transform.calculateMultiply3x3(_tempMatrix, transform);
this._rotationDirty = true;
}
public function getMaterialByName(_arg1:String):MaterialObject3D{
var _local2:MaterialObject3D;
var _local3:DisplayObject3D;
_local2 = (this.materials) ? this.materials.getMaterialByName(_arg1) : null;
if (_local2){
return (_local2);
};
for each (_local3 in this._childrenByName) {
_local2 = _local3.getMaterialByName(_arg1);
if (_local2){
return (_local2);
};
};
return (null);
}
public function set useOwnContainer(_arg1:Boolean):void{
_useOwnContainer = _arg1;
setParentContainer(this, true);
}
public function moveLeft(_arg1:Number):void{
translate(_arg1, LEFT);
}
public function get scene():SceneObject3D{
return (_scene);
}
public function get rotationY():Number{
if (this._rotationDirty){
updateRotation();
};
return ((Papervision3D.useDEGREES) ? (-(this._rotationY) * toDEGREES) : -(this._rotationY));
}
public function get rotationZ():Number{
if (this._rotationDirty){
updateRotation();
};
return ((Papervision3D.useDEGREES) ? (-(this._rotationZ) * toDEGREES) : -(this._rotationZ));
}
public function set scaleY(_arg1:Number):void{
if (Papervision3D.usePERCENT){
this._scaleY = (_arg1 / 100);
} else {
this._scaleY = _arg1;
};
this._transformDirty = true;
}
public function set scaleZ(_arg1:Number):void{
if (Papervision3D.usePERCENT){
this._scaleZ = (_arg1 / 100);
} else {
this._scaleZ = _arg1;
};
this._transformDirty = true;
}
public function get rotationX():Number{
if (this._rotationDirty){
updateRotation();
};
return ((Papervision3D.useDEGREES) ? (-(this._rotationX) * toDEGREES) : -(this._rotationX));
}
public function translate(_arg1:Number, _arg2:Number3D):void{
var _local3:Number3D;
_local3 = _arg2.clone();
if (this._transformDirty){
updateTransform();
};
Matrix3D.rotateAxis(transform, _local3);
this.x = (this.x + (_arg1 * _local3.x));
this.y = (this.y + (_arg1 * _local3.y));
this.z = (this.z + (_arg1 * _local3.z));
}
public function set scaleX(_arg1:Number):void{
if (Papervision3D.usePERCENT){
this._scaleX = (_arg1 / 100);
} else {
this._scaleX = _arg1;
};
this._transformDirty = true;
}
public function pitch(_arg1:Number):void{
var _local2:Number3D;
_arg1 = (Papervision3D.useDEGREES) ? (_arg1 * toRADIANS) : _arg1;
_local2 = RIGHT.clone();
if (this._transformDirty){
updateTransform();
};
Matrix3D.rotateAxis(transform, _local2);
_tempMatrix = Matrix3D.rotationMatrix(_local2.x, _local2.y, _local2.z, _arg1, _tempMatrix);
this.transform.calculateMultiply3x3(_tempMatrix, transform);
this._rotationDirty = true;
}
public function set scale(_arg1:Number):void{
if (Papervision3D.usePERCENT){
_arg1 = (_arg1 / 100);
};
this._scaleX = (this._scaleY = (this._scaleZ = _arg1));
this._transformDirty = true;
}
public function moveForward(_arg1:Number):void{
translate(_arg1, FORWARD);
}
public function copyPosition(_arg1):void{
var _local2:Matrix3D;
var _local3:Matrix3D;
_local2 = this.transform;
_local3 = ((_arg1 is DisplayObject3D)) ? _arg1.transform : _arg1;
_local2.n14 = _local3.n14;
_local2.n24 = _local3.n24;
_local2.n34 = _local3.n34;
}
public function get useOwnContainer():Boolean{
return (_useOwnContainer);
}
protected function updateTransform():void{
var _local1:Matrix3D;
_tempQuat = Matrix3D.euler2quaternion(-(this._rotationY), -(this._rotationZ), this._rotationX, _tempQuat);
_tempMatrix = Matrix3D.quaternion2matrix(_tempQuat.x, _tempQuat.y, _tempQuat.z, _tempQuat.w, _tempMatrix);
_local1 = this.transform;
_tempMatrix.n14 = _local1.n14;
_tempMatrix.n24 = _local1.n24;
_tempMatrix.n34 = _local1.n34;
_local1.copy(_tempMatrix);
_tempMatrix.reset();
_tempMatrix.n11 = this._scaleX;
_tempMatrix.n22 = this._scaleY;
_tempMatrix.n33 = this._scaleZ;
this.transform.calculateMultiply(_local1, _tempMatrix);
this._transformDirty = false;
}
public function createViewportLayer(_arg1:Viewport3D, _arg2:Boolean=true):ViewportLayer{
var _local3:ViewportLayer;
_local3 = _arg1.getChildLayer(this, true);
if (_arg2){
addChildrenToLayer(this, _local3);
};
return (_local3);
}
public function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = (this.x - _arg1);
_local5 = (this.y - _arg2);
_local6 = (this.z - _arg3);
_local7 = (((_local4 * _local4) + (_local5 * _local5)) + (_local6 * _local6));
_local8 = (this.geometry) ? this.geometry.boundingSphere.maxDistance : 0;
return ((_local8 > _local7));
}
public function addChildrenToLayer(_arg1:DisplayObject3D, _arg2:ViewportLayer):void{
var _local3:DisplayObject3D;
for each (_local3 in _arg1.children) {
_arg2.addDisplayObject3D(_local3);
_local3.addChildrenToLayer(_local3, _arg2);
};
}
public function moveRight(_arg1:Number):void{
translate(_arg1, RIGHT);
}
public function moveBackward(_arg1:Number):void{
translate(_arg1, BACKWARD);
}
public function set x(_arg1:Number):void{
this.transform.n14 = _arg1;
}
public function materialsList():String{
var _local1:String;
var _local2:String;
var _local3:DisplayObject3D;
_local1 = "";
for (_local2 in this.materials) {
_local1 = (_local1 + (_local2 + "\n"));
};
for each (_local3 in this._childrenByName) {
for (_local2 in _local3.materials.materialsByName) {
_local1 = (_local1 + (("+ " + _local2) + "\n"));
};
};
return (_local1);
}
public function set y(_arg1:Number):void{
this.transform.n24 = _arg1;
}
override public function addChild(_arg1:DisplayObject3D, _arg2:String=null):DisplayObject3D{
_arg1 = super.addChild(_arg1, _arg2);
if (_arg1.scene == null){
_arg1.scene = scene;
};
if (this.useOwnContainer){
_arg1.parentContainer = this;
};
return (_arg1);
}
public static function get ZERO():DisplayObject3D{
return (new (DisplayObject3D));
}
}
}//package org.papervision3d.objects
Section 165
//BasicRenderEngine (org.papervision3d.render.BasicRenderEngine)
package org.papervision3d.render {
import org.papervision3d.core.proto.*;
import org.papervision3d.core.render.data.*;
import org.papervision3d.view.*;
import org.papervision3d.core.render.command.*;
import flash.geom.*;
import org.papervision3d.core.render.material.*;
import org.papervision3d.view.layer.*;
import org.papervision3d.events.*;
import org.papervision3d.core.render.*;
import org.papervision3d.core.render.project.*;
import org.papervision3d.core.render.sort.*;
import org.papervision3d.core.render.filter.*;
import org.papervision3d.core.utils.*;
public class BasicRenderEngine extends AbstractRenderEngine implements IRenderEngine {
public var sorter:IRenderSorter;
public var projectionPipeline:ProjectionPipeline;
protected var renderStatistics:RenderStatistics;
protected var renderDoneEvent:RendererEvent;
protected var renderList:Array;
protected var renderSessionData:RenderSessionData;
protected var stopWatch:StopWatch;
protected var projectionDoneEvent:RendererEvent;
public var filter:IRenderFilter;
protected var cleanRHD:RenderHitData;
public function BasicRenderEngine():void{
cleanRHD = new RenderHitData();
super();
init();
}
override public function removeFromRenderList(_arg1:IRenderListItem):int{
return (renderList.splice(renderList.indexOf(_arg1), 1));
}
protected function doRender(_arg1:RenderSessionData, _arg2:Array=null):RenderStatistics{
var _local3:RenderableListItem;
var _local4:Viewport3D;
var _local5:ViewportLayer;
stopWatch.reset();
stopWatch.start();
MaterialManager.getInstance().updateMaterialsBeforeRender(_arg1);
filter.filter(renderList);
sorter.sort(renderList);
_local4 = _arg1.viewPort;
while ((_local3 = renderList.pop())) {
_local5 = _local4.accessLayerFor(_local3, true);
_local3.render(_arg1, _local5.graphicsChannel);
_local4.lastRenderList.push(_local3);
_local5.processRenderItem(_local3);
};
MaterialManager.getInstance().updateMaterialsAfterRender(_arg1);
_arg1.renderStatistics.renderTime = stopWatch.stop();
_arg1.viewPort.updateAfterRender(_arg1);
return (renderStatistics);
}
protected function init():void{
renderStatistics = new RenderStatistics();
projectionPipeline = new BasicProjectionPipeline();
stopWatch = new StopWatch();
sorter = new BasicRenderSorter();
filter = new BasicRenderFilter();
renderList = new Array();
renderSessionData = new RenderSessionData();
renderSessionData.renderer = this;
projectionDoneEvent = new RendererEvent(RendererEvent.PROJECTION_DONE, renderSessionData);
renderDoneEvent = new RendererEvent(RendererEvent.RENDER_DONE, renderSessionData);
}
override public function renderScene(_arg1:SceneObject3D, _arg2:CameraObject3D, _arg3:Viewport3D, _arg4:Boolean=true):RenderStatistics{
renderSessionData.scene = _arg1;
renderSessionData.camera = _arg2;
renderSessionData.viewPort = _arg3;
renderSessionData.container = _arg3.containerSprite;
renderSessionData.triangleCuller = _arg3.triangleCuller;
renderSessionData.particleCuller = _arg3.particleCuller;
renderSessionData.renderObjects = _arg1.objects;
renderSessionData.renderLayers = null;
renderSessionData.renderStatistics.clear();
_arg3.updateBeforeRender(renderSessionData);
projectionPipeline.project(renderSessionData);
if (hasEventListener(RendererEvent.PROJECTION_DONE)){
dispatchEvent(projectionDoneEvent);
};
doRender(renderSessionData, null);
if (hasEventListener(RendererEvent.RENDER_DONE)){
dispatchEvent(renderDoneEvent);
};
return (renderSessionData.renderStatistics);
}
public function hitTestPoint2D(_arg1:Point, _arg2:Viewport3D):RenderHitData{
return (_arg2.hitTestPoint2D(_arg1));
}
override public function addToRenderList(_arg1:IRenderListItem):int{
return (renderList.push(_arg1));
}
public function renderLayers(_arg1:SceneObject3D, _arg2:CameraObject3D, _arg3:Viewport3D, _arg4:Array=null, _arg5:Boolean=true):RenderStatistics{
renderSessionData.scene = _arg1;
renderSessionData.camera = _arg2;
renderSessionData.viewPort = _arg3;
renderSessionData.container = _arg3.containerSprite;
renderSessionData.triangleCuller = _arg3.triangleCuller;
renderSessionData.particleCuller = _arg3.particleCuller;
renderSessionData.renderObjects = getLayerObjects(_arg4);
renderSessionData.renderLayers = _arg4;
renderSessionData.renderStatistics.clear();
_arg3.updateBeforeRender(renderSessionData);
projectionPipeline.project(renderSessionData);
if (hasEventListener(RendererEvent.PROJECTION_DONE)){
dispatchEvent(projectionDoneEvent);
};
doRender(renderSessionData);
if (hasEventListener(RendererEvent.RENDER_DONE)){
dispatchEvent(renderDoneEvent);
};
return (renderSessionData.renderStatistics);
}
private function getLayerObjects(_arg1:Array):Array{
var _local2:Array;
var _local3:ViewportLayer;
_local2 = new Array();
for each (_local3 in _arg1) {
_local2 = _local2.concat(_local3.getLayerObjects());
};
return (_local2);
}
public function destroy():void{
renderDoneEvent = null;
projectionDoneEvent = null;
projectionPipeline = null;
sorter = null;
filter = null;
renderStatistics = null;
renderList = null;
renderSessionData.destroy();
renderSessionData = null;
cleanRHD = null;
stopWatch = null;
}
}
}//package org.papervision3d.render
Section 166
//Scene3D (org.papervision3d.scenes.Scene3D)
package org.papervision3d.scenes {
import org.papervision3d.core.proto.*;
public class Scene3D extends SceneObject3D {
}
}//package org.papervision3d.scenes
Section 167
//ViewportLayerSortMode (org.papervision3d.view.layer.util.ViewportLayerSortMode)
package org.papervision3d.view.layer.util {
public class ViewportLayerSortMode {
public static var Z_SORT:String = "z";
public static var INDEX_SORT:String = "index";
}
}//package org.papervision3d.view.layer.util
Section 168
//ViewportBaseLayer (org.papervision3d.view.layer.ViewportBaseLayer)
package org.papervision3d.view.layer {
import org.papervision3d.view.*;
import org.papervision3d.objects.*;
public class ViewportBaseLayer extends ViewportLayer {
public function ViewportBaseLayer(_arg1:Viewport3D){
super(_arg1, null);
}
override public function updateBeforeRender():void{
var _local1:int;
clear();
_local1 = (childLayers.length - 1);
while (_local1 >= 0) {
if (childLayers[_local1].dynamicLayer){
removeLayerAt(_local1);
};
_local1--;
};
super.updateBeforeRender();
}
override public function getChildLayer(_arg1:DisplayObject3D, _arg2:Boolean=true, _arg3:Boolean=false):ViewportLayer{
if (layers[_arg1]){
return (layers[_arg1]);
};
if (((_arg2) || (_arg1.useOwnContainer))){
return (getChildLayerFor(_arg1, _arg3));
};
return (this);
}
}
}//package org.papervision3d.view.layer
Section 169
//ViewportLayer (org.papervision3d.view.layer.ViewportLayer)
package org.papervision3d.view.layer {
import org.papervision3d.view.*;
import org.papervision3d.core.render.command.*;
import flash.display.*;
import org.papervision3d.objects.*;
import flash.utils.*;
import org.papervision3d.view.layer.util.*;
public class ViewportLayer extends Sprite {
public var layerIndex:Number;
public var layers:Dictionary;
public var dynamicLayer:Boolean;// = false
public var sortMode:String;
public var weight:Number;// = 0
public var childLayers:Array;
public var forceDepth:Boolean;// = false
protected var viewport:Viewport3D;
public var screenDepth:Number;// = 0
public var displayObject3D:DisplayObject3D;
public var displayObjects:Dictionary;
public var graphicsChannel:Graphics;
public function ViewportLayer(_arg1:Viewport3D, _arg2:DisplayObject3D, _arg3:Boolean=false){
layers = new Dictionary(true);
displayObjects = new Dictionary(true);
forceDepth = false;
screenDepth = 0;
weight = 0;
sortMode = ViewportLayerSortMode.Z_SORT;
dynamicLayer = false;
super();
this.viewport = _arg1;
this.displayObject3D = _arg2;
this.dynamicLayer = _arg3;
this.graphicsChannel = this.graphics;
if (_arg3){
this.filters = _arg2.filters;
this.blendMode = _arg2.blendMode;
this.alpha = _arg2.alpha;
};
if (_arg2){
addDisplayObject3D(_arg2);
};
init();
}
public function getLayerObjects(_arg1:Array=null):Array{
var _local2:DisplayObject3D;
var _local3:ViewportLayer;
if (!_arg1){
_arg1 = new Array();
};
for each (_local2 in this.displayObjects) {
if (_local2){
_arg1.push(_local2);
};
};
for each (_local3 in childLayers) {
_local3.getLayerObjects(_arg1);
};
return (_arg1);
}
protected function init():void{
childLayers = new Array();
}
public function updateInfo():void{
var _local1:ViewportLayer;
for each (_local1 in childLayers) {
_local1.updateInfo();
if (!forceDepth){
this.weight = (this.weight + _local1.weight);
this.screenDepth = (this.screenDepth + (_local1.screenDepth * _local1.weight));
};
};
if (!forceDepth){
this.screenDepth = (this.screenDepth / this.weight);
};
}
public function sortChildLayers():void{
if (sortMode == ViewportLayerSortMode.Z_SORT){
childLayers.sortOn("screenDepth", (Array.DESCENDING | Array.NUMERIC));
} else {
childLayers.sortOn("layerIndex", Array.NUMERIC);
};
orderLayers();
}
private function onChildRemoved(_arg1:ViewportLayerEvent):void{
if (_arg1.do3d){
unlinkChild(_arg1.do3d, _arg1);
};
}
public function removeAllLayers():void{
var _local1:int;
_local1 = (childLayers.length - 1);
while (_local1 >= 0) {
removeLayerAt(_local1);
_local1--;
};
}
public function updateAfterRender():void{
var _local1:ViewportLayer;
for each (_local1 in childLayers) {
_local1.updateAfterRender();
};
}
public function removeLayer(_arg1:ViewportLayer):void{
var _local2:DisplayObject3D;
var _local3:int;
for each (_local2 in _arg1.displayObjects) {
unlinkChild(_local2);
};
_local3 = getChildIndex(_arg1);
if (_local3 > -1){
childLayers.splice(_local3, 1);
};
}
protected function getChildLayerFor(_arg1:DisplayObject3D, _arg2:Boolean=false):ViewportLayer{
var _local3:ViewportLayer;
if (_arg1){
_local3 = new ViewportLayer(viewport, _arg1, _arg1.useOwnContainer);
addLayer(_local3);
if (_arg2){
_arg1.addChildrenToLayer(_arg1, _local3);
};
return (_local3);
} else {
trace("Needs to be a do3d");
};
return (null);
}
public function addLayer(_arg1:ViewportLayer):void{
var _local2:DisplayObject3D;
var _local3:ViewportLayer;
childLayers.push(_arg1);
addChild(_arg1);
_arg1.addEventListener(ViewportLayerEvent.CHILD_ADDED, onChildAdded);
_arg1.addEventListener(ViewportLayerEvent.CHILD_REMOVED, onChildRemoved);
for each (_local2 in _arg1.displayObjects) {
linkChild(_local2, _arg1);
};
for each (_local3 in _arg1.layers) {
for each (_local2 in _local3.displayObjects) {
linkChild(_local2, _local3);
};
};
}
public function childLayerIndex(_arg1:DisplayObject3D):Number{
var _local2:int;
_arg1 = (_arg1.parentContainer) ? _arg1.parentContainer : _arg1;
_local2 = 0;
while (_local2 < childLayers.length) {
if (childLayers[_local2].hasDisplayObject3D(_arg1)){
return (_local2);
};
_local2++;
};
return (-1);
}
protected function orderLayers():void{
var _local1:int;
_local1 = 0;
while (_local1 < childLayers.length) {
this.setChildIndex(childLayers[_local1], _local1);
childLayers[_local1].sortChildLayers();
_local1++;
};
}
public function removeLayerAt(_arg1:Number):void{
var _local2:DisplayObject3D;
for each (_local2 in childLayers[_arg1].displayObjects) {
unlinkChild(_local2);
};
removeChild(childLayers[_arg1]);
childLayers.splice(_arg1, 1);
}
protected function reset():void{
if (!forceDepth){
screenDepth = 0;
};
this.weight = 0;
}
private function linkChild(_arg1:DisplayObject3D, _arg2:ViewportLayer, _arg3:ViewportLayerEvent=null):void{
layers[_arg1] = _arg2;
dispatchEvent(new ViewportLayerEvent(ViewportLayerEvent.CHILD_ADDED, _arg1, _arg2));
}
public function updateBeforeRender():void{
var _local1:ViewportLayer;
clear();
for each (_local1 in childLayers) {
_local1.updateBeforeRender();
};
}
private function onChildAdded(_arg1:ViewportLayerEvent):void{
if (_arg1.do3d){
linkChild(_arg1.do3d, _arg1.layer, _arg1);
};
}
public function getChildLayer(_arg1:DisplayObject3D, _arg2:Boolean=true, _arg3:Boolean=false):ViewportLayer{
_arg1 = (_arg1.parentContainer) ? _arg1.parentContainer : _arg1;
if (layers[_arg1]){
return (layers[_arg1]);
};
if (_arg2){
return (getChildLayerFor(_arg1, _arg3));
};
return (null);
}
public function processRenderItem(_arg1:RenderableListItem):void{
if (!forceDepth){
this.screenDepth = (this.screenDepth + _arg1.screenDepth);
this.weight++;
};
}
public function clear():void{
graphicsChannel.clear();
reset();
}
public function removeDisplayObject3D(_arg1:DisplayObject3D):void{
displayObjects[_arg1] = null;
dispatchEvent(new ViewportLayerEvent(ViewportLayerEvent.CHILD_REMOVED, _arg1, this));
}
private function unlinkChild(_arg1:DisplayObject3D, _arg2:ViewportLayerEvent=null):void{
layers[_arg1] = null;
dispatchEvent(new ViewportLayerEvent(ViewportLayerEvent.CHILD_REMOVED, _arg1));
}
public function addDisplayObject3D(_arg1:DisplayObject3D, _arg2:Boolean=true):void{
if (!_arg1){
return;
};
displayObjects[_arg1] = _arg1;
dispatchEvent(new ViewportLayerEvent(ViewportLayerEvent.CHILD_ADDED, _arg1, this));
if (_arg2){
_arg1.addChildrenToLayer(_arg1, this);
};
}
public function hasDisplayObject3D(_arg1:DisplayObject3D):Boolean{
return (!((displayObjects[_arg1] == null)));
}
}
}//package org.papervision3d.view.layer
Section 170
//ViewportLayerEvent (org.papervision3d.view.layer.ViewportLayerEvent)
package org.papervision3d.view.layer {
import org.papervision3d.objects.*;
import flash.events.*;
public class ViewportLayerEvent extends Event {
public var layer:ViewportLayer;
public var do3d:DisplayObject3D;
public static const CHILD_REMOVED:String = "childRemoved";
public static const CHILD_ADDED:String = "childAdded";
public function ViewportLayerEvent(_arg1:String, _arg2:DisplayObject3D=null, _arg3:ViewportLayer=null){
super(_arg1, false, false);
this.do3d = _arg2;
this.layer = _arg3;
}
}
}//package org.papervision3d.view.layer
Section 171
//Viewport3D (org.papervision3d.view.Viewport3D)
package org.papervision3d.view {
import org.papervision3d.core.render.data.*;
import org.papervision3d.core.render.command.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.objects.*;
import flash.events.*;
import org.papervision3d.view.layer.*;
import org.papervision3d.core.culling.*;
import flash.utils.*;
import org.papervision3d.core.view.*;
import org.papervision3d.core.render.*;
import org.papervision3d.core.utils.*;
public class Viewport3D extends Sprite implements IViewport3D {
protected var _interactive:Boolean;
public var cullingRectangle:Rectangle;
protected var _viewportObjectFilter:ViewportObjectFilter;
protected var _layerInstances:Dictionary;
protected var _hWidth:Number;
protected var _autoScaleToStage:Boolean;
protected var _lastRenderer:IRenderEngine;
protected var _containerSprite:ViewportBaseLayer;
protected var _hHeight:Number;
public var sizeRectangle:Rectangle;
protected var renderHitData:RenderHitData;
protected var _autoClipping:Boolean;
protected var _height:Number;
public var interactiveSceneManager:InteractiveSceneManager;
public var lastRenderList:Array;
public var lineCuller:ILineCuller;
protected var _autoCulling:Boolean;
public var particleCuller:IParticleCuller;
protected var _width:Number;
public var triangleCuller:ITriangleCuller;
public function Viewport3D(_arg1:Number=640, _arg2:Number=480, _arg3:Boolean=false, _arg4:Boolean=false, _arg5:Boolean=true, _arg6:Boolean=true){
init();
this.interactive = _arg4;
this.viewportWidth = _arg1;
this.viewportHeight = _arg2;
this.autoClipping = _arg5;
this.autoCulling = _arg6;
this.autoScaleToStage = _arg3;
this._layerInstances = new Dictionary(true);
}
public function set autoCulling(_arg1:Boolean):void{
if (_arg1){
triangleCuller = new RectangleTriangleCuller(cullingRectangle);
particleCuller = new RectangleParticleCuller(cullingRectangle);
lineCuller = new RectangleLineCuller(cullingRectangle);
} else {
if (!_arg1){
triangleCuller = new DefaultTriangleCuller();
particleCuller = new DefaultParticleCuller();
lineCuller = new DefaultLineCuller();
};
};
_autoCulling = _arg1;
}
protected function onRemovedFromStage(_arg1:Event):void{
stage.removeEventListener(Event.RESIZE, onStageResize);
}
public function hitTestMouse():RenderHitData{
var _local1:Point;
_local1 = new Point(containerSprite.mouseX, containerSprite.mouseY);
return (hitTestPoint2D(_local1));
}
protected function init():void{
this.renderHitData = new RenderHitData();
lastRenderList = new Array();
sizeRectangle = new Rectangle();
cullingRectangle = new Rectangle();
_containerSprite = new ViewportBaseLayer(this);
addChild(_containerSprite);
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
}
protected function onStageResize(_arg1:Event=null):void{
if (_autoScaleToStage){
viewportWidth = stage.stageWidth;
viewportHeight = stage.stageHeight;
};
}
public function set autoClipping(_arg1:Boolean):void{
if (_arg1){
scrollRect = sizeRectangle;
} else {
scrollRect = null;
};
_autoClipping = _arg1;
}
public function updateAfterRender(_arg1:RenderSessionData):void{
var _local2:ViewportLayer;
if (interactive){
interactiveSceneManager.updateRenderHitData();
};
if (_arg1.renderLayers){
for each (_local2 in _arg1.renderLayers) {
_local2.updateInfo();
_local2.sortChildLayers();
_local2.updateAfterRender();
};
} else {
containerSprite.updateInfo();
containerSprite.updateAfterRender();
};
containerSprite.sortChildLayers();
}
public function accessLayerFor(_arg1:RenderableListItem, _arg2:Boolean=false):ViewportLayer{
var _local3:DisplayObject3D;
if (_arg1.renderableInstance){
_local3 = _arg1.renderableInstance.instance;
_local3 = (_local3.parentContainer) ? _local3.parentContainer : _local3;
if (containerSprite.layers[_local3]){
if (_arg2){
_local3.container = containerSprite.layers[_local3];
};
return (containerSprite.layers[_local3]);
} else {
if (_local3.useOwnContainer){
return (containerSprite.getChildLayer(_local3, true, true));
};
};
};
return (containerSprite);
}
public function get viewportHeight():Number{
return (_height);
}
public function get autoCulling():Boolean{
return (_autoCulling);
}
public function hitTestPoint2D(_arg1:Point):RenderHitData{
var _local2:RenderableListItem;
var _local3:RenderHitData;
var _local4:IRenderListItem;
var _local5:uint;
renderHitData.clear();
if (interactive){
_local3 = renderHitData;
_local5 = lastRenderList.length;
while ((_local4 = lastRenderList[--_local5])) {
if ((_local4 is RenderableListItem)){
_local2 = (_local4 as RenderableListItem);
_local3 = _local2.hitTestPoint2D(_arg1, _local3);
if (_local3.hasHit){
return (_local3);
};
};
};
};
return (renderHitData);
}
public function updateBeforeRender(_arg1:RenderSessionData):void{
var _local2:ViewportLayer;
lastRenderList.length = 0;
if (_arg1.renderLayers){
for each (_local2 in _arg1.renderLayers) {
_local2.updateBeforeRender();
};
} else {
_containerSprite.updateBeforeRender();
};
_layerInstances = new Dictionary(true);
}
protected function onAddedToStage(_arg1:Event):void{
stage.addEventListener(Event.RESIZE, onStageResize);
onStageResize();
}
public function getChildLayer(_arg1:DisplayObject3D, _arg2:Boolean=true, _arg3:Boolean=true):ViewportLayer{
return (containerSprite.getChildLayer(_arg1, _arg2, _arg3));
}
public function get viewportObjectFilter():ViewportObjectFilter{
return (_viewportObjectFilter);
}
public function get containerSprite():ViewportLayer{
return (_containerSprite);
}
public function set viewportWidth(_arg1:Number):void{
_width = _arg1;
_hWidth = (_arg1 / 2);
containerSprite.x = _hWidth;
cullingRectangle.x = -(_hWidth);
cullingRectangle.width = _arg1;
sizeRectangle.width = _arg1;
if (_autoClipping){
scrollRect = sizeRectangle;
};
}
public function get autoClipping():Boolean{
return (_autoClipping);
}
public function set viewportObjectFilter(_arg1:ViewportObjectFilter):void{
_viewportObjectFilter = _arg1;
}
public function get viewportWidth():Number{
return (_width);
}
public function set autoScaleToStage(_arg1:Boolean):void{
_autoScaleToStage = _arg1;
if (((_arg1) && (!((stage == null))))){
onStageResize();
};
}
public function set interactive(_arg1:Boolean):void{
if (_arg1 != _interactive){
if (((_interactive) && (interactiveSceneManager))){
interactiveSceneManager.destroy();
interactiveSceneManager = null;
};
_interactive = _arg1;
if (_arg1){
interactiveSceneManager = new InteractiveSceneManager(this);
};
};
}
public function set viewportHeight(_arg1:Number):void{
_height = _arg1;
_hHeight = (_arg1 / 2);
containerSprite.y = _hHeight;
cullingRectangle.y = -(_hHeight);
cullingRectangle.height = _arg1;
sizeRectangle.height = _arg1;
if (_autoClipping){
scrollRect = sizeRectangle;
};
}
public function get autoScaleToStage():Boolean{
return (_autoScaleToStage);
}
public function get interactive():Boolean{
return (_interactive);
}
public function destroy():void{
if (interactiveSceneManager){
interactiveSceneManager.destroy();
interactiveSceneManager = null;
};
lastRenderList = null;
}
}
}//package org.papervision3d.view
Section 172
//Papervision3D (org.papervision3d.Papervision3D)
package org.papervision3d {
public class Papervision3D {
public static var useDEGREES:Boolean = true;
public static var useRIGHTHANDED:Boolean = false;
public static var VERBOSE:Boolean = true;
public static var NAME:String = "Papervision3D";
public static var DATE:String = "24.03.08";
public static var AUTHOR:String = "(c) 2006-2007 Copyright by Carlos Ulloa - | John Grden | Ralph Hauwert | Tim Knip | Andy Zupko";
public static var VERSION:String = "Public Alpha 2.0 - Great White";
public static var usePERCENT:Boolean = false;
public static function log(_arg1:String):void{
if (Papervision3D.VERBOSE){
trace(_arg1);
};
}
}
}//package org.papervision3d
Section 173
//png (shipShadow.png)
package shipShadow {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package shipShadow
Section 174
//andromedusIntro_mc_1 (xpr_fla.andromedusIntro_mc_1)
package xpr_fla {
import flash.display.*;
public dynamic class andromedusIntro_mc_1 extends MovieClip {
public function andromedusIntro_mc_1(){
addFrameScript(160, frame161);
}
function frame161(){
MovieClip(parent).gotoAndStop(2);
}
}
}//package xpr_fla
Section 175
//level1_mc_16 (xpr_fla.level1_mc_16)
package xpr_fla {
import flash.display.*;
public dynamic class level1_mc_16 extends MovieClip {
public var split:MovieClip;
public var startLine:startBridge_template;
}
}//package xpr_fla
Section 176
//level2_mc_40 (xpr_fla.level2_mc_40)
package xpr_fla {
import flash.display.*;
public dynamic class level2_mc_40 extends MovieClip {
public var split:MovieClip;
public var startLine:startBridge_template;
}
}//package xpr_fla
Section 177
//level3_mc_45 (xpr_fla.level3_mc_45)
package xpr_fla {
import flash.display.*;
public dynamic class level3_mc_45 extends MovieClip {
public var split:MovieClip;
public var startLine:startBridge_template;
}
}//package xpr_fla
Section 178
//level4_mc_48 (xpr_fla.level4_mc_48)
package xpr_fla {
import flash.display.*;
public dynamic class level4_mc_48 extends MovieClip {
public var split:MovieClip;
public var startLine:startBridge_template;
}
}//package xpr_fla
Section 179
//MainTimeline (xpr_fla.MainTimeline)
package xpr_fla {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Contacts.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.view.*;
import org.papervision3d.core.geom.renderables.*;
import flash.display.*;
import flash.geom.*;
import org.papervision3d.core.math.*;
import org.papervision3d.objects.*;
import flash.events.*;
import org.papervision3d.materials.special.*;
import org.papervision3d.core.geom.*;
import org.papervision3d.events.*;
import fl.transitions.*;
import flash.net.*;
import flash.utils.*;
import fl.transitions.easing.*;
import org.papervision3d.*;
import Box2D.Common.*;
import org.papervision3d.core.utils.*;
import flash.media.*;
import org.papervision3d.render.*;
import org.papervision3d.objects.parsers.*;
import org.papervision3d.scenes.*;
import org.papervision3d.materials.*;
import org.papervision3d.cameras.*;
import CPMStar.*;
import org.papervision3d.objects.primitives.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
import fl.motion.*;
import org.papervision3d.objects.special.*;
import org.papervision3d.materials.shaders.*;
import org.papervision3d.lights.*;
public dynamic class MainTimeline extends MovieClip {
public var aiHandicap:Array;
public var waypoint:uint;
public var maxThrustAI:Number;
public var m_physScale:Number;
public var playerShipBody:b2Body;
public var farClipDistance:Number;
public var curveLongLowXML:XML;
public var bonus:uint;
public var stageAssets:MovieClip;
public var ad:DisplayObject;
public var gameMusicChannel:SoundChannel;
public var accelerateSound:accelerate;
public var trackLocked:Boolean;
public var shipXML:XML;
public var highscores:highscores_mc;
public var padlock:padlock_mc;
public var m_iterations:int;
public var menuTween:Tween;
public var record:Boolean;
public var towerXML:XML;
public var thrust:Number;
public var introMusicTransform:SoundTransform;
public var sToDRightHighXML:XML;
public var positionSum:uint;
public var shipLocked:Boolean;
public var writeScoresURL:String;
public var beepLowSound:beepLow;
public var accelerateSoundChannel:SoundChannel;
public var shipDHighXML:XML;
public var andromedusIntro:MovieClip;
public var tickerSection:uint;
public var preloader:preloader_mc;
public var fadeInThrust:Boolean;
public var xmlArray:Array;
public var cameraDummy:Cube;
public var upKeyDown:Boolean;
public var finished:Boolean;
public var scene:Scene3D;
public var numberOfLevels:uint;
public var countdownActive:Boolean;
public var maxPossibleScore:uint;
public var downKeyDown:Boolean;
public var CPMStarContentSpotID:String;
public var viewport:Viewport3D;
public var readScoresURL:String;
public var track4Locked:Boolean;
public var levelLoader:levelLoader_mc;
public var positionAverage:uint;
public var sfxChannel:SoundChannel;
public var diagonalLowXML:XML;
public var xArray:Array;
public var renderer:BasicRenderEngine;
public var pyramidXML:XML;
public var submitSuccess:Boolean;
public var sharpBendMedXML:XML;
public var fpsCounter:Number;
public var bgObjectArray:Array;
public var splitReached:Boolean;
public var maxThrustPlayer:Number;
public var aiShipArrayLow:Array;
public var fps:Number;
public var curveLongHighXML:XML;
public var levelComplete:Boolean;
public var hsLoader:URLLoader;
public var lowPolyArray:Array;
public var thrustDampingPlayer:Number;
public var storedX:Array;
public var bestLap:Number;
public var storedZ:Array;
public var confirmQuit:confirmQuit_mc;
public var shipCLowXML:XML;
public var background:MovieClip;
public var currentURL:String;
public var diagonalHighXML:XML;
public var gui:gui_mc;
public var securityOn:Boolean;
public var soundToggle:soundToggle_mc;
public var m_world:b2World;
public var shipBLowXML:XML;
public var numberOfSections:uint;
public var sharpBendHighXML:XML;
public var gameMusic:xprMusic2;
public var numberOfLaps:uint;
public var levelContainer:levelContainer_mc;
public var menu:menu_mc;
public var tower2XML:XML;
public var gameRunning:Boolean;
public var track3Locked:Boolean;
public var tickerArray:Array;
public var aiShipArrayHigh:Array;
public var medPolyArray:Array;
public var grandstandXML:XML;
public var currentLevel:uint;
public var tower3XML:XML;
public var thrustVolume:Number;
public var startBridgeXML:XML;
public var leftKeyDown:Boolean;
public var lap:uint;
public var instructions:instructions_mc;
public var selectTrack:selectTrack_mc;
public var selectVehicleTween:Tween;
public var fpsElapsedTime:Number;
public var camSpeed:Number;
public var lapRecord:Array;
public var shipAHighXML:XML;
public var projectCanvas:Sprite;
public var frameTimer:uint;
public var musicToggle:musicToggle_mc;
public var lastBody2:b2Body;
public var lastBody1:b2Body;
public var shipCUsed:Boolean;
public var rightKeyDown:Boolean;
public var dataR:String;
public var dataT:String;
public var dataX:String;
public var sToDLeftMedXML:XML;
public var dataZ:String;
public var playerCollider:Cube;
public var selectTrackTween:Tween;
public var shipHigh:Array;
public var zArray:Array;
public var shipALowXML:XML;
public var numberOfBGObjects:uint;
public var levelTimer:Number;
public var timeAllowed:Array;
public var whooshSound:whoosh;
public var swearList:Array;
public var fadeOutThrust:Boolean;
public var track2Locked:Boolean;
public var ship:LibraryCollada;
public var aiShipBody:Array;
public var flareY:Number;
public var straightMedXML:XML;
public var debug:debug_mc;
public var sToDRightMedXML:XML;
public var flareX:Number;
public var so:SharedObject;
public var shipBUsed:Boolean;
public var cameraRotationTween:Tween;
public var lapTimer:Number;
public var gameMusicVolume:Number;
public var raceFinished:Boolean;
public var flares:flares_mc;
public var playerStartX:Number;
public var playerStartZ:Number;
public var highPolyArray:Array;
public var playerMarker:playerMarker_mc;
public var shipShadow:Plane;
public var aiStartX:Array;
public var sharpBendLowXML:XML;
public var shipHeight:Number;
public var aiStartZ:Array;
public var blackBackground:blackBackground_mc;
public var selectVehicle:selectVehicle_mc;
public var raceRecord:Array;
public var score:uint;
public var curveLongMedXML:XML;
public var tracksCompleted:uint;
public var allowedURL:String;
public var adBox:MovieClip;
public var allowedLocal:String;
public var positionAverageCounter:uint;
public var shipDLocked:Boolean;
public var shipBHighXML:XML;
public var constantSoundChannel:SoundChannel;
public var scoresArray:Array;
public var straightHighXML:XML;
public var m_timeStep:Number;
public var collisionSound1:collision1;
public var collisionSound2:collision2;
public var collisionSound3:collision3;
public var collisionSound4:collision4;
public var iteration:uint;
public var shipAUsed:Boolean;
public var mouseDown:Boolean;
public var musicOn:Boolean;
public var ticker:ticker_mc;
public var introMusic:menuMusic;
public var cameraPitch:Number;
public var musicChannel:SoundChannel;
public var camera:FreeCamera3D;
public var levelInfoArray:Array;
public var playerPosition:uint;
public var scaleFactor:Number;
public var zooming:Boolean;
public var diagonalMedXML:XML;
public var playerShipLetter:String;
public var gameWon:Boolean;
public var countdownStage:uint;
public var soundOn:Boolean;
public var rotating:Boolean;
public var medClipDistance:Number;
public var fpsNewTime:Number;
public var fpsStartTime:Number;
public var gameMusicTransform:SoundTransform;
public var numberOfAIShips:uint;
public var shipCLocked:Boolean;
public var aiShadow:Array;
public var tickerStart:Number;
public var aiProperties:Array;
public var sToDLeftHighXML:XML;
public var sToDLeftLowXML:XML;
public var level:Object;
public var shipCHighXML:XML;
public var introMusicVolume:Number;
public var countdownTimer:Timer;
public var accelerateSoundPlaying:Boolean;
public var rotationSpeedPlayer:Number;
public var nearClipDistance:Number;
public var straightLowXML:XML;
public var instructionsTween:Tween;
public var sToDRightLowXML:XML;
public var constantSound:constant;
public var override:Boolean;
public var frameCounter:Number;
public var shipDLowXML:XML;
public var tileSize:Number;
public var highscoresTween:Tween;
public var frameRate:uint;
public var gameOverScreen:gameOverScreen_mc;
public var levelLoaderTween:Tween;
public var beepHighSound:beepHigh;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
public function removeMenu(_arg1:TweenEvent):void{
menuTween.removeEventListener(TweenEvent.MOTION_FINISH, removeMenu);
projectCanvas.removeChild(menu);
}
public function soundUp(_arg1:MouseEvent):void{
if (soundOn == true){
soundToggle.gotoAndStop("onUp");
} else {
soundToggle.gotoAndStop("offUp");
};
}
public function createStartBridge(_arg1, _arg2):void{
var _local3:LibraryCollada;
numberOfBGObjects++;
_local3 = new LibraryCollada(xmlArray["startBridgeXML"]);
scene.addChild(_local3);
_local3.scale = 0.00125;
_local3.x = (_arg1 * scaleFactor);
_local3.y = 0;
_local3.z = ((levelContainer.height - _arg2) * scaleFactor);
bgObjectArray[numberOfBGObjects] = _local3;
}
public function loader(_arg1:Event){
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = stage.loaderInfo.bytesTotal;
_local3 = stage.loaderInfo.bytesLoaded;
_local4 = Math.round(((_local3 * 100) / _local2));
preloader.loadingBar.width = (4 * _local4);
preloader.loadingText.text = (String(_local4) + "%");
if ((((_local3 >= _local2)) && ((finished == false)))){
preloader.loadingText.text = "100%";
finished = true;
preloader.continueButton.visible = true;
preloader.continueButton.addEventListener(MouseEvent.MOUSE_DOWN, end_preload);
};
}
public function initVehicleSelect(_arg1:MouseEvent):void{
if ((((trackLocked == false)) || ((override == true)))){
selectTrack.startButton.removeEventListener(MouseEvent.MOUSE_DOWN, initVehicleSelect);
selectTrack.buttonZone.removeEventListener(MouseEvent.MOUSE_DOWN, setTrack);
selectTrack.buttonZone.removeEventListener(MouseEvent.MOUSE_OVER, showTrackLight);
selectTrack.buttonZone.removeEventListener(MouseEvent.MOUSE_OUT, hideTrackLight);
initPhysics();
createBackground();
background.visible = false;
selectVehicle = new selectVehicle_mc();
projectCanvas.addChild(selectVehicle);
selectVehicle.buttonZone.coverA.alpha = 0;
selectVehicle.buttonZone.light.visible = false;
selectVehicle.buttonZone.light.mouseEnabled = false;
selectVehicle.shipName.text = "FIRECREST";
selectVehicle.powerMask.width = (25 + (23 * 2));
selectVehicle.handlingMask.width = (25 + (23 * 5));
init3D();
loadShips();
selectVehicle.alpha = 0;
padlock = new padlock_mc();
projectCanvas.addChild(padlock);
padlock.x = 295;
padlock.y = 245;
padlock.visible = false;
fadeInSelectVehicle();
};
}
public function showLight(_arg1:MouseEvent):void{
selectVehicle.buttonZone.light.visible = true;
if (_arg1.target == selectVehicle.buttonZone.coverA){
selectVehicle.buttonZone.light.y = 0;
};
if (_arg1.target == selectVehicle.buttonZone.coverB){
selectVehicle.buttonZone.light.y = 60;
};
if (_arg1.target == selectVehicle.buttonZone.coverC){
selectVehicle.buttonZone.light.y = 120;
};
if (_arg1.target == selectVehicle.buttonZone.coverD){
selectVehicle.buttonZone.light.y = 180;
};
}
public function createWallH(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:uint;
var _local12:*;
var _local13:*;
_local5 = (10 * scaleFactor);
_local6 = (_arg3 * scaleFactor);
_local7 = 0;
_local8 = 0;
_local11 = 1;
while (_local11 <= 2) {
if (_local11 == 1){
_local7 = _arg1;
_local8 = (_arg2 - 20);
} else {
_local7 = _arg1;
_local8 = (_arg2 + 20);
};
_local9 = (_local7 * scaleFactor);
_local10 = ((levelContainer.height - _local8) * scaleFactor);
_local12 = new b2BodyDef();
_local13 = new b2BoxDef();
_local13.maskBits = 2;
_local13.extents.Set((_local6 / 2), (_local5 / 2));
_local13.friction = 0;
_local13.density = 0;
_local13.restitution = 0.95;
_local12.AddShape(_local13);
_local12.position.Set(_local9, -(_local10));
_local12.linearDamping = 0.07;
_local12.angularDamping = 0.02;
m_world.CreateBody(_local12);
_local11++;
};
}
public function submit(_arg1:String, _arg2:Number):URLLoader{
var _local3:URLVariables;
var _local4:URLRequest;
var _local5:URLLoader;
_local3 = new URLVariables();
_local3.hsname = _arg1;
_local3.score = String(_arg2);
_local4 = new URLRequest(writeScoresURL);
_local4.data = _local3;
_local4.method = URLRequestMethod.POST;
_local5 = new URLLoader();
_local5.dataFormat = URLLoaderDataFormat.TEXT;
_local5.load(_local4);
return (_local5);
}
public function displayGameOverMessages():void{
gameOverScreen.message1.text = ((((("Position: " + String(positionAverage)) + "\nTime: ") + String((frameTimer / 100))) + "\nBestLap: ") + String((bestLap / 100)));
gameOverScreen.message2.text = "";
if (positionAverage == 1){
gameOverScreen.cup1.visible = true;
gameOverScreen.cup2.visible = true;
if (currentLevel > tracksCompleted){
tracksCompleted = currentLevel;
so.data.tracksCompleted = tracksCompleted;
applyLocks();
};
};
}
public function scrollTicker(_arg1:Event):void{
ticker.mc.textField.x = (ticker.mc.textField.x - 3);
if (ticker.mc.textField.x < (tickerStart - ticker.mc.textField.width)){
ticker.mc.textField.x = (tickerStart + 450);
tickerSection++;
if (tickerSection >= tickerArray.length){
tickerSection = 0;
};
ticker.mc.textField.text = tickerArray[tickerSection];
ticker.mc.textField.autoSize = TextFieldAutoSize.LEFT;
};
}
public function createWallV(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:uint;
var _local12:*;
var _local13:*;
_local5 = (_arg4 * scaleFactor);
_local6 = (10 * scaleFactor);
_local7 = 0;
_local8 = 0;
_local11 = 1;
while (_local11 <= 2) {
if (_local11 == 1){
_local7 = (_arg1 - 20);
_local8 = _arg2;
} else {
_local7 = (_arg1 + 20);
_local8 = _arg2;
};
_local9 = (_local7 * scaleFactor);
_local10 = ((levelContainer.height - _local8) * scaleFactor);
_local12 = new b2BodyDef();
_local13 = new b2BoxDef();
_local13.maskBits = 2;
_local13.extents.Set((_local6 / 2), (_local5 / 2));
_local13.friction = 0;
_local13.density = 0;
_local13.restitution = 0.95;
_local12.AddShape(_local13);
_local12.position.Set(_local9, -(_local10));
_local12.linearDamping = 0.07;
_local12.angularDamping = 0.02;
m_world.CreateBody(_local12);
_local11++;
};
}
public function updateSelectVehicle(_arg1:Event):void{
var _local2:String;
var _local3:*;
_local3 = 1;
while (_local3 <= 4) {
if (_local3 == 1){
_local2 = "A";
};
if (_local3 == 2){
_local2 = "B";
};
if (_local3 == 3){
_local2 = "C";
};
if (_local3 == 4){
_local2 = "D";
};
shipHigh[_local2].yaw(2);
_local3++;
};
render();
}
public function removeInstructions(_arg1:TweenEvent):void{
instructionsTween.removeEventListener(TweenEvent.MOTION_FINISH, removeInstructions);
projectCanvas.removeChild(instructions);
}
public function activateSelectVehicle(_arg1:TweenEvent):void{
removeSelectTrack();
selectVehicleTween.removeEventListener(TweenEvent.MOTION_FINISH, activateSelectVehicle);
selectVehicle.start.addEventListener(MouseEvent.MOUSE_DOWN, fadeInLevelLoader);
selectVehicle.addEventListener(Event.ENTER_FRAME, updateSelectVehicle);
selectVehicle.buttonZone.addEventListener(MouseEvent.MOUSE_DOWN, showShip);
selectVehicle.buttonZone.addEventListener(MouseEvent.MOUSE_OVER, showLight);
selectVehicle.buttonZone.addEventListener(MouseEvent.MOUSE_OUT, hideLight);
}
function frame1(){
stop();
}
function frame2(){
stop();
preloader.continueButton.visible = false;
CPMStarContentSpotID = "233Q8FF2F6C4";
ad = new AdLoader(CPMStarContentSpotID);
adBox.addChild(ad);
finished = false;
stage.addEventListener(Event.ENTER_FRAME, loader);
}
public function createGrandstand(_arg1, _arg2, _arg3):void{
var _local4:LibraryCollada;
numberOfBGObjects++;
_local4 = new LibraryCollada(xmlArray["grandstandXML"]);
scene.addChild(_local4);
_local4.scale = -0.0005;
_local4.pitch(180);
_local4.x = (_arg1 * scaleFactor);
_local4.y = 0;
_local4.z = ((levelContainer.height - _arg2) * scaleFactor);
_local4.yaw(-(_arg3));
bgObjectArray[numberOfBGObjects] = _local4;
}
function frame4(){
stop();
fps = 0;
fpsStartTime = 0;
fpsNewTime = 0;
fpsElapsedTime = 0;
fpsCounter = 0;
so = SharedObject.getLocal("xprData");
tracksCompleted = 0;
if (((!((so.data.tracksCompleted == undefined))) && (!((so.data.tracksCompleted == null))))){
tracksCompleted = so.data.tracksCompleted;
};
if (tracksCompleted > 4){
tracksCompleted = 4;
};
lapRecord = new Array();
lapRecord[1] = 100000;
lapRecord[2] = 100000;
lapRecord[3] = 100000;
lapRecord[4] = 100000;
if (((!((so.data.lapRecord1 == undefined))) && (!((so.data.lapRecord1 == null))))){
lapRecord[1] = so.data.lapRecord1;
};
if (((!((so.data.lapRecord2 == undefined))) && (!((so.data.lapRecord2 == null))))){
lapRecord[2] = so.data.lapRecord2;
};
if (((!((so.data.lapRecord3 == undefined))) && (!((so.data.lapRecord3 == null))))){
lapRecord[3] = so.data.lapRecord3;
};
if (((!((so.data.lapRecord4 == undefined))) && (!((so.data.lapRecord4 == null))))){
lapRecord[4] = so.data.lapRecord4;
};
raceRecord = new Array();
raceRecord[1] = 100000;
raceRecord[2] = 100000;
raceRecord[3] = 100000;
raceRecord[4] = 100000;
if (((((!((so.data.raceRecord1 == undefined))) && (!((so.data.raceRecord1 == null))))) && (!((so.data.raceRecord1 == 0))))){
raceRecord[1] = so.data.raceRecord1;
};
if (((((!((so.data.raceRecord2 == undefined))) && (!((so.data.raceRecord2 == null))))) && (!((so.data.raceRecord2 == 0))))){
raceRecord[2] = so.data.raceRecord2;
};
if (((((!((so.data.raceRecord3 == undefined))) && (!((so.data.raceRecord3 == null))))) && (!((so.data.raceRecord3 == 0))))){
raceRecord[3] = so.data.raceRecord3;
};
if (((((!((so.data.raceRecord4 == undefined))) && (!((so.data.raceRecord4 == null))))) && (!((so.data.raceRecord4 == 0))))){
raceRecord[4] = so.data.raceRecord4;
};
numberOfLaps = 6;
frameRate = 30;
numberOfLevels = 5;
numberOfSections = 0;
score = 0;
bonus = 0;
maxPossibleScore = 10000;
numberOfAIShips = 0;
numberOfBGObjects = 0;
lap = 0;
waypoint = 0;
playerPosition = 0;
positionAverageCounter = 0;
positionSum = 0;
positionAverage = 0;
frameTimer = 0;
iteration = 0;
countdownStage = 0;
frameCounter = 0;
lapTimer = 0;
levelTimer = 0;
scaleFactor = 6.25;
tileSize = 100;
cameraPitch = 10;
farClipDistance = 3000;
medClipDistance = 1500;
nearClipDistance = 500;
thrust = 0;
maxThrustPlayer = 0;
thrustDampingPlayer = 0;
rotationSpeedPlayer = 0;
maxThrustAI = 33000;
shipHeight = 15;
flareX = 0;
flareY = 0;
playerStartX = 0;
playerStartZ = 0;
camSpeed = 0;
bestLap = 1000000;
dataX = "";
dataZ = "";
dataR = "";
dataT = "";
storedX = new Array();
storedZ = new Array();
xArray = new Array();
zArray = new Array();
override = false;
record = false;
submitSuccess = false;
gameRunning = false;
levelComplete = false;
gameWon = false;
leftKeyDown = false;
rightKeyDown = false;
upKeyDown = false;
downKeyDown = false;
mouseDown = false;
splitReached = true;
shipAUsed = false;
shipBUsed = false;
shipCUsed = false;
countdownActive = false;
raceFinished = false;
zooming = false;
rotating = false;
shipLocked = false;
shipCLocked = true;
shipDLocked = true;
track2Locked = true;
track3Locked = true;
track4Locked = true;
trackLocked = false;
musicChannel = new SoundChannel();
introMusic = new menuMusic();
soundOn = true;
musicOn = true;
accelerateSoundPlaying = false;
introMusicVolume = 0.5;
introMusicTransform = new SoundTransform(introMusicVolume, 0);
accelerateSoundChannel = new SoundChannel();
accelerateSound = new accelerate();
constantSoundChannel = new SoundChannel();
constantSound = new constant();
fadeInThrust = false;
fadeOutThrust = false;
thrustVolume = 0;
beepHighSound = new beepHigh();
beepLowSound = new beepLow();
whooshSound = new whoosh();
sfxChannel = new SoundChannel();
gameMusicChannel = new SoundChannel();
gameMusic = new xprMusic2();
gameMusicVolume = 0.7;
gameMusicTransform = new SoundTransform(gameMusicVolume, 0);
collisionSound1 = new collision1();
collisionSound2 = new collision2();
collisionSound3 = new collision3();
collisionSound4 = new collision4();
tickerSection = 0;
tickerStart = 0;
tickerArray = new Array();
m_physScale = 1;
m_timeStep = (1 / stage.frameRate);
m_iterations = 10;
readScoresURL = ("http://www.andromedus.com/scripts/lynx_read_scores.php?" + String(Math.random()));
writeScoresURL = "http://www.andromedus.com/scripts/lynx_insert_score.php";
timeAllowed = new Array();
levelInfoArray = new Array();
swearList = new Array("FUK", "FUC", "COK", "C0K", "KOK", "K0K", "DIK", "D1K", "DIC", "D1C", "DYK", "JEW", "J3W", "WOG", "W0G", "YID", "Y1D", "CNT", "TIT", "T1T", "GAY", "G4Y", "DYK", "POO", "P00", "MUF", "CUM", "BUM", "ASS", "FAG", "HOE", "PIS", "P1S", "SOD", "S0D", "BNP", "NIG", "N1G", "NOG", "N0G", "NIP", "N1P", "JAP", "NOB", "N0B");
scoresArray = new Array();
highPolyArray = new Array();
medPolyArray = new Array();
lowPolyArray = new Array();
aiShipArrayHigh = new Array();
aiShipArrayLow = new Array();
aiShipBody = new Array();
aiProperties = new Array();
xmlArray = new Array();
bgObjectArray = new Array();
shipHigh = new Array();
aiShadow = new Array();
aiStartX = new Array();
aiStartZ = new Array();
aiHandicap = new Array();
securityOn = false;
currentURL = stage.loaderInfo.url;
allowedURL = "andromedus.com";
allowedLocal = "Richard/Documents/";
initialise();
shipXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-08-28T08:39:35Z</created>
<modified>2008-08-28T08:39:35Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>shipTexture0</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>shipTexture1</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>shipTexture2</init_from>
</image>
<image id="material3-image" name="material3-image">
<init_from>shipTexture3</init_from>
</image>
<image id="material4-image" name="material4-image">
<init_from>shipTexture4</init_from>
</image>
<image id="material5-image" name="material5-image">
<init_from>shipTexture5</init_from>
</image>
<image id="material6-image" name="material6-image">
<init_from>shipTexture6</init_from>
</image>
<image id="material7-image" name="material7-image">
<init_from>shipTexture7</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
<material id="material3ID" name="material3">
<instance_effect url="#material3-effect"/>
</material>
<material id="material4ID" name="material4">
<instance_effect url="#material4-effect"/>
</material>
<material id="material5ID" name="material5">
<instance_effect url="#material5-effect"/>
</material>
<material id="material6ID" name="material6">
<instance_effect url="#material6-effect"/>
</material>
<material id="material7ID" name="material7">
<instance_effect url="#material7-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material3-effect" name="material3-effect">
<profile_COMMON>
<newparam sid="material3-image-surface">
<surface type="2D">
<init_from>material3-image</init_from>
</surface>
</newparam>
<newparam sid="material3-image-sampler">
<sampler2D>
<source>material3-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material3-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material4-effect" name="material4-effect">
<profile_COMMON>
<newparam sid="material4-image-surface">
<surface type="2D">
<init_from>material4-image</init_from>
</surface>
</newparam>
<newparam sid="material4-image-sampler">
<sampler2D>
<source>material4-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material4-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material5-effect" name="material5-effect">
<profile_COMMON>
<newparam sid="material5-image-surface">
<surface type="2D">
<init_from>material5-image</init_from>
</surface>
</newparam>
<newparam sid="material5-image-sampler">
<sampler2D>
<source>material5-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material5-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material6-effect" name="material6-effect">
<profile_COMMON>
<newparam sid="material6-image-surface">
<surface type="2D">
<init_from>material6-image</init_from>
</surface>
</newparam>
<newparam sid="material6-image-sampler">
<sampler2D>
<source>material6-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material6-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
</profile_COMMON>
</effect>
<effect id="material7-effect" name="material7-effect">
<profile_COMMON>
<newparam sid="material7-image-surface">
<surface type="2D">
<init_from>material7-image</init_from>
</surface>
</newparam>
<newparam sid="material7-image-sampler">
<sampler2D>
<source>material7-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material7-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="96">45.495000 -50.550000 -0.000000 17.743050 -198.850000 -0.000000 45.495000 50.550000 -0.000000 17.743050 -198.850000 11.180000 45.495000 -50.550000 26.000000 45.495000 50.550000 26.000000 72.495000 50.550000 26.000000 72.495000 50.550000 -0.000000 72.495000 122.250000 -0.000000 -45.495000 -50.550000 -0.000000 -45.495000 50.550000 -0.000000 -72.495000 122.250000 -0.000000 -72.495000 50.550000 -0.000000 -76.995000 122.250000 -0.000000 -76.995000 50.550000 -0.000000 -72.495000 50.550000 26.000000 -76.995000 50.550000 26.000000 -76.995000 122.250000 76.000000 -72.495000 122.250000 76.000000 -72.495000 122.250000 26.000000 -45.495000 50.550000 26.000000 72.495000 122.250000 26.000000 -13.411575 31.450000 48.800000 13.411575 31.450000 48.800000 -45.495000 -50.550000 26.000000 -17.743050 -198.850000 -0.000000 -17.743050 -198.850000 11.180000 72.495000 122.250000 76.000000 76.995000 50.550000 26.000000 76.995000 122.250000 76.000000 76.995000 122.250000 -0.000000 76.995000 50.550000 -0.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="32" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="69">-0.000000 0.000000 -1.000000 0.982937 -0.183941 0.000000 1.000000 0.000000 0.000000 0.000000 -1.000000 0.000000 0.000000 -0.572003 0.820252 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.766565 0.642166 0.000000 -0.267886 0.963451 -0.579273 -0.000000 0.815134 -1.000000 0.000000 0.000000 -0.982937 -0.183941 0.000000 0.000000 -1.000000 -0.000000 0.000000 -0.099437 0.995044 0.579273 -0.000000 0.815134 -1.000000 0.000000 0.000000 1.000000 -0.000000 -0.000000 0.000000 -0.572003 0.820252 1.000000 -0.000000 0.000000 -0.000000 1.000000 -0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 -0.000000 -1.000000 0.000000 -0.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="23" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="210">-4.549500 -5.055000 -1.774305 -19.885000 -4.549500 5.055000 -4.131909 -0.000000 -19.219341 1.118000 -19.219341 -0.000000 -4.131909 2.600000 5.055000 -0.000000 -5.055000 2.600000 -5.055000 -0.000000 5.055000 2.600000 4.549500 -0.000000 7.249500 2.600000 4.549500 2.600000 7.249500 -0.000000 -7.249500 12.225000 -7.249500 5.055000 4.549500 -5.055000 4.549500 5.055000 7.249500 12.225000 7.249500 5.055000 7.699500 12.225000 7.699500 5.055000 -7.249500 2.600000 -7.699500 -0.000000 -7.249500 -0.000000 -7.699500 2.600000 -7.249500 5.633580 -7.699500 14.374798 -7.699500 5.633580 -7.249500 14.374798 12.225000 7.600000 5.055000 2.600000 12.225000 2.600000 -4.549500 5.055000 -7.249500 12.225000 -7.249500 5.055000 7.249500 12.225000 4.549500 5.055000 1.341157 1.721225 -4.549500 -1.253082 4.549500 -1.253082 -1.341158 1.721225 -1.341157 4.337337 4.549500 -4.173738 1.341158 4.337337 -4.549500 -4.173738 -3.145000 1.733628 -5.055000 -2.202342 5.055000 -2.202342 -5.055000 2.600000 5.055000 -0.000000 5.055000 2.600000 -5.055000 -0.000000 -4.549500 2.600000 -4.549500 -0.000000 19.219341 -0.000000 4.131909 2.600000 4.131909 -0.000000 19.219341 1.118000 -1.774305 0.000000 1.774305 1.118000 -1.774305 1.118000 1.774305 0.000000 1.774305 -19.885000 4.549500 -4.771410 -1.774305 -19.675276 1.774305 -19.675276 -4.549500 -4.771410 5.055000 -2.202342 3.145000 1.733628 -5.055000 -2.202342 7.249500 5.055000 12.225000 2.600000 5.055000 2.600000 12.225000 7.600000 7.699500 5.633580 7.249500 14.374798 7.249500 5.633580 7.699500 14.374798 12.225000 -0.000000 12.225000 7.600000 5.055000 -0.000000 7.699500 2.600000 7.699500 -0.000000 -7.699500 5.055000 -7.699500 12.225000 -7.249500 2.600000 -7.699500 0.000000 -7.249500 0.000000 -7.699500 7.600000 -7.249500 7.600000 7.249500 -0.000000 -7.249500 2.600000 -7.249500 -0.000000 7.249500 2.600000 7.249500 0.000000 7.699500 7.600000 7.249500 2.600000 7.699500 0.000000 -5.055000 0.000000 -12.225000 7.600000 -12.225000 0.000000 -5.055000 2.600000 7.249500 7.600000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="105" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="26">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 2 0 2 8 0 15 7 0 16 9 0 17 8 0 15 2 0 2 10 0 18 8 0 15 9 0 17 10 0 18 11 0 19 8 0 15 12 0 20 11 0 19 10 0 18 12 0 20 13 0 21 11 0 19 13 0 21 12 0 20 14 0 22 20 6 34 19 6 35 15 6 36 19 6 35 20 6 34 21 6 37 21 6 37 20 6 34 5 6 38 25 12 60 3 12 61 26 12 62 3 12 61 25 12 60 1 12 63 25 0 64 2 0 2 1 0 1 9 0 17 2 0 2 25 0 64 4 13 65 26 13 66 3 13 67 26 13 66 4 13 65 24 13 68 21 6 37 5 6 38 6 6 72 7 0 16 8 0 15 31 0 85 31 0 85 8 0 15 30 0 86 21 19 87 30 19 88 8 19 89 30 19 88 21 19 87 29 19 90 29 19 90 21 19 87 27 19 91 11 21 96 17 21 97 19 21 98 17 21 97 11 21 96 13 21 99 19 21 98 17 21 97 18 21 104 </p>
</triangles>
<triangles material="material1" count="13">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 1 3 3 1 4 1 1 5 3 1 4 0 1 3 4 1 6 15 3 23 14 3 24 12 3 25 14 3 24 15 3 23 16 3 26 18 5 31 15 5 32 19 5 33 25 11 56 24 11 57 9 11 58 24 11 57 25 11 56 26 11 59 28 18 52 30 18 80 29 18 81 30 18 80 28 18 52 31 18 82 28 3 83 7 3 14 31 3 84 7 3 14 28 3 83 6 3 12 14 22 100 17 22 101 13 22 102 17 22 101 14 22 100 16 22 103 </p>
</triangles>
<triangles material="material5" count="6">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>2 2 7 4 2 8 0 2 9 4 2 8 2 2 7 5 2 10 20 10 50 9 10 51 24 10 52 9 10 51 20 10 50 10 10 53 11 20 92 21 20 93 8 20 94 21 20 93 11 20 92 19 20 95 </p>
</triangles>
<triangles material="material4" count="10">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>2 3 11 6 3 12 5 3 13 6 3 12 2 3 11 7 3 14 15 4 27 17 4 28 16 4 29 17 4 28 15 4 27 18 4 30 22 7 39 5 7 40 20 7 41 5 7 40 22 7 39 23 7 42 20 3 54 12 3 25 10 3 55 12 3 25 20 3 54 15 3 23 28 17 76 27 17 77 6 17 78 27 17 77 28 17 76 29 17 79 </p>
</triangles>
<triangles material="material3" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>22 8 43 4 8 44 23 8 45 4 8 44 22 8 43 24 8 46 </p>
</triangles>
<triangles material="material2" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>22 9 47 20 9 48 24 9 49 5 14 69 23 14 70 4 14 71 </p>
</triangles>
<triangles material="material6" count="1">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>21 15 73 6 15 74 27 15 75 </p>
</triangles>
<triangles material="material7" count="1">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>27 16 75 6 16 74 21 16 73 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material5" target="#material5ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material4" target="#material4ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material3" target="#material3ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material6" target="#material6ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material7" target="#material7ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
-0.590035 0.327503 -0.737971 -392.909878
-0.807378 -0.239341 0.539312 316.499052
0.000000 0.914034 0.405638 239.790392
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
straightHighXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-08-22T17:52:00Z</created>
<modified>2008-08-22T17:52:00Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>magenta</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>yellow</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>lightGrey</init_from>
</image>
<image id="material3-image" name="material3-image">
<init_from>darkGrey</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
<material id="material3ID" name="material3">
<instance_effect url="#material3-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material3-effect" name="material3-effect">
<profile_COMMON>
<newparam sid="material3-image-surface">
<surface type="2D">
<init_from>material3-image</init_from>
</surface>
</newparam>
<newparam sid="material3-image-sampler">
<sampler2D>
<source>material3-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material3-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="96">-886.602540 1000.000000 50.000000 -1000.000000 500.000000 50.000000 -1000.000000 1000.000000 50.000000 -886.602540 500.000000 50.000000 -800.000000 1000.000000 -0.000000 -800.000000 500.000000 -0.000000 -886.602540 -0.000000 50.000000 -800.000000 -0.000000 -0.000000 -886.602540 -500.000000 50.000000 -800.000000 -500.000000 -0.000000 -886.602540 -1000.000000 50.000000 -800.000000 -1000.000000 -0.000000 0.000000 -500.000000 -0.000000 0.000000 -1000.000000 -0.000000 800.000000 -500.000000 -0.000000 800.000000 -1000.000000 -0.000000 886.602540 -500.000000 50.000000 886.602540 -1000.000000 50.000000 1000.000000 -500.000000 50.000000 1000.000000 -1000.000000 50.000000 1000.000000 0.000000 50.000000 886.602540 0.000000 50.000000 800.000000 0.000000 -0.000000 886.602540 500.000000 50.000000 800.000000 500.000000 -0.000000 886.602540 1000.000000 50.000000 800.000000 1000.000000 -0.000000 1000.000000 1000.000000 50.000000 1000.000000 500.000000 50.000000 -1000.000000 -1000.000000 50.000000 -1000.000000 -500.000000 50.000000 -1000.000000 -0.000000 50.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="32" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="42">0.000000 -0.000000 1.000000 0.500000 -0.000000 0.866025 0.500000 0.000000 0.866025 0.500000 0.000000 0.866025 0.500000 0.000000 0.866025 0.000000 0.000000 1.000000 -0.500000 0.000000 0.866025 -0.000000 -0.000000 1.000000 -0.000000 -0.000000 1.000000 -0.500000 0.000000 0.866025 -0.500000 -0.000000 0.866025 -0.000000 -0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="14" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="112">88.660254 100.000000 100.000000 50.000000 100.000000 100.000000 88.660254 50.000000 -100.000000 69.282032 -50.000000 79.282032 -100.000000 79.282032 -50.000000 69.282032 0.000000 79.282032 -50.000000 79.282032 0.000000 69.282032 0.000000 69.282032 50.000000 79.282032 0.000000 79.282032 50.000000 69.282032 100.000000 79.282032 100.000000 69.282032 0.000000 -50.000000 80.000000 -100.000000 80.000000 -50.000000 0.000000 -100.000000 -80.000000 -50.000000 -80.000000 -100.000000 -50.000000 79.282032 -100.000000 69.282032 -50.000000 69.282032 -100.000000 79.282032 -100.000000 -50.000000 -88.660254 -100.000000 -88.660254 -50.000000 -100.000000 -100.000000 -100.000000 0.000000 -88.660254 0.000000 -50.000000 69.282032 0.000000 79.282032 -50.000000 79.282032 0.000000 69.282032 0.000000 69.282032 50.000000 79.282032 0.000000 79.282032 50.000000 69.282032 50.000000 69.282032 100.000000 79.282032 100.000000 69.282032 -100.000000 100.000000 -88.660254 50.000000 -88.660254 100.000000 -100.000000 50.000000 -88.660254 0.000000 -100.000000 0.000000 100.000000 -100.000000 88.660254 -50.000000 88.660254 -100.000000 100.000000 -50.000000 88.660254 -0.000000 100.000000 -0.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="56" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="16">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 18 7 27 17 7 28 16 7 29 17 7 28 18 7 27 19 7 30 16 8 29 20 8 31 18 8 27 20 8 31 16 8 29 21 8 32 27 5 44 23 5 45 25 5 46 23 5 45 27 5 44 28 5 47 28 11 47 21 11 48 23 11 45 21 11 48 28 11 47 20 11 49 29 12 50 8 12 51 10 12 52 8 12 51 29 12 50 30 12 53 30 12 53 6 12 54 8 12 51 6 12 54 30 12 53 31 12 55 31 13 55 3 13 3 6 13 54 3 13 3 31 13 55 1 13 1 </p>
</triangles>
<triangles material="material1" count="8">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>4 1 4 3 1 5 0 1 6 3 1 5 4 1 4 5 1 7 7 3 11 8 3 12 6 3 13 8 3 12 7 3 11 9 3 14 14 9 33 21 9 34 16 9 35 21 9 34 14 9 33 22 9 36 24 9 41 25 9 42 23 9 38 25 9 42 24 9 41 26 9 43 </p>
</triangles>
<triangles material="material2" count="8">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>5 2 7 6 2 8 3 2 9 6 2 8 5 2 7 7 2 10 9 4 14 10 4 15 8 4 12 10 4 15 9 4 14 11 4 16 16 6 23 15 6 24 14 6 25 15 6 24 16 6 23 17 6 26 22 10 37 23 10 38 21 10 39 23 10 38 22 10 37 24 10 40 </p>
</triangles>
<triangles material="material3" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>12 5 17 11 5 18 9 5 19 11 5 18 12 5 17 13 5 20 14 5 21 13 5 20 12 5 17 13 5 20 14 5 21 15 5 22 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material3" target="#material3ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.997315 0.056561 -0.046515 729.365147
-0.073231 0.770285 -0.633481 -4421.472201
0.000000 0.635187 0.772359 6521.281841
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["straightHighXML"] = straightHighXML;
straightMedXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-08-22T22:53:14Z</created>
<modified>2008-08-22T22:53:14Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>yellowAndGrey</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>magenta</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>darkGrey</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="42">-800.000000 1000.000000 -0.000000 -886.602540 -1000.000000 50.000000 -886.602540 1000.000000 50.000000 -800.000000 -1000.000000 -0.000000 -800.000000 -500.000000 -0.000000 800.000000 -500.000000 -0.000000 800.000000 -1000.000000 -0.000000 886.602540 1000.000000 50.000000 800.000000 1000.000000 -0.000000 886.602540 -1000.000000 50.000000 1000.000000 1000.000000 50.000000 1000.000000 -1000.000000 50.000000 -1000.000000 -1000.000000 50.000000 -1000.000000 1000.000000 50.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="14" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="15">0.500000 -0.000000 0.866025 0.000000 0.000000 1.000000 -0.500000 -0.000000 0.866025 -0.000000 -0.000000 1.000000 0.000000 -0.000000 1.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="5" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="44">-1.105490 -0.508793 -1.305485 1.491209 -1.305490 -0.508793 -1.105485 1.491209 -1.105486 0.991208 -80.000000 -50.000000 80.000000 -100.000000 80.000000 -50.000000 -80.000000 -100.000000 2.381200 0.993394 2.581199 -0.506606 2.381200 1.493394 2.381199 -0.506606 2.581200 1.493394 -100.000000 100.000000 -88.660254 -100.000000 -88.660254 100.000000 -100.000000 -100.000000 100.000000 -100.000000 88.660254 100.000000 88.660254 -100.000000 100.000000 100.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="22" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="6">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 3 0 3 0 0 0 4 0 4 5 2 9 7 2 10 6 2 11 7 2 10 5 2 9 8 2 12 6 2 11 7 2 10 9 2 13 </p>
</triangles>
<triangles material="material2" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>5 1 5 3 1 6 4 1 7 3 1 6 5 1 5 6 1 8 </p>
</triangles>
<triangles material="material1" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>10 3 14 9 3 15 7 3 16 9 3 15 10 3 14 11 3 17 12 4 18 2 4 19 1 4 20 2 4 19 12 4 18 13 4 21 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.999570 -0.017597 0.023439 497.418182
0.029310 0.600141 -0.799357 -3599.365422
-0.000000 0.799701 0.600399 3089.321516
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["straightMedXML"] = straightMedXML;
straightLowXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-08-28T09:59:16Z</created>
<modified>2008-08-28T09:59:16Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>lightGrey</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="12">1000.000000 1000.000000 50.000000 -1000.000000 -1000.000000 50.000000 -1000.000000 1000.000000 50.000000 1000.000000 -1000.000000 50.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="4" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="3">0.000000 -0.000000 1.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="1" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="8">-100.000000 100.000000 100.000000 -100.000000 100.000000 100.000000 -100.000000 -100.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="4" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.999570 -0.017597 0.023439 360.910171
0.029310 0.600141 -0.799357 -6283.324842
-0.000000 0.799701 0.600399 5420.121655
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["straightLowXML"] = straightLowXML;
sharpBendHighXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-08-22T23:16:45Z</created>
<modified>2008-08-22T23:16:45Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>magenta</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>darkGrey</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>yellow</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="15">1000.000000 -1000.000000 50.000000 886.602540 -1000.000000 50.000000 1000.000000 -886.602540 50.000000 1000.000000 -800.000000 0.000000 800.000000 -1000.000000 0.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="5" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="6">0.000000 0.000000 1.000000 -0.447214 0.447214 0.774597 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="2" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="14">-100.000000 -100.000000 -88.660254 -100.000000 -100.000000 -88.660254 -8.018411 106.495755 14.142136 98.590060 8.018411 106.495755 -14.142136 98.590060 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="7" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="1">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 </p>
</triangles>
<triangles material="material1" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>1 1 3 3 1 4 2 1 5 3 1 4 1 1 3 4 1 6 </p>
</triangles>
</mesh>
</geometry>
<geometry id="mesh2-geometry" name="mesh2-geometry">
<mesh>
<source id="mesh2-geometry-position">
<float_array id="mesh2-geometry-position-array" count="63">-800.000000 -500.000000 0.000000 -886.602540 -1000.000000 50.000000 -886.602540 -493.748834 50.000000 -800.000000 -1000.000000 0.000000 -1000.000000 -1000.000000 50.000000 -1000.000000 -493.748834 50.000000 -886.602540 12.502331 50.000000 -1000.000000 12.502331 50.000000 -498.272392 506.251166 50.000000 -441.573663 449.552436 50.000000 3.455215 1000.000000 50.000000 3.455215 886.602540 50.000000 501.727608 1000.000000 50.000000 501.727608 886.602540 50.000000 1000.000000 886.602540 50.000000 1000.000000 1000.000000 50.000000 1000.000000 800.000000 0.000000 500.000000 800.000000 0.000000 0.000000 800.000000 0.000000 -400.000000 400.000000 0.000000 -800.000000 0.000000 0.000000 </float_array>
<technique_common>
<accessor source="#mesh2-geometry-position-array" count="21" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh2-geometry-normal">
<float_array id="mesh2-geometry-normal-array" count="33">0.500000 0.000000 0.866025 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 -0.000000 -0.000000 1.000000 -0.000000 -0.500000 0.866025 -0.000000 -0.500000 0.866025 0.451367 -0.459607 0.764872 0.433490 -0.433490 0.790046 0.433490 -0.433490 0.790046 0.408805 -0.416268 0.812157 0.500000 -0.000000 0.866025 </float_array>
<technique_common>
<accessor source="#mesh2-geometry-normal-array" count="11" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh2-geometry-uv">
<float_array id="mesh2-geometry-uv-array" count="80">50.000000 69.282032 100.000000 79.282032 49.374883 79.282032 100.000000 69.282032 100.000000 -100.000000 88.660254 -49.374883 88.660254 -100.000000 100.000000 -49.374883 88.660254 1.250233 100.000000 1.250233 49.827239 50.625117 44.157366 44.955244 -0.345522 100.000000 -0.345522 88.660254 -50.172761 100.000000 -50.172761 88.660254 -100.000000 88.660254 -100.000000 100.000000 -100.000000 69.282032 -50.172761 79.282032 -100.000000 79.282032 -50.000000 69.282032 -0.345522 79.282032 0.000000 69.282032 -62.369168 51.419045 -56.054563 43.657270 0.005786 51.419045 -56.568542 44.691734 0.000000 44.691734 -0.564184 52.847703 0.000000 44.691734 56.568542 44.691734 -0.564184 52.847703 0.005786 54.095005 57.077894 45.525122 62.380741 54.095005 0.000000 69.282032 49.374883 79.282032 -1.250233 79.282032 50.000000 69.282032 </float_array>
<technique_common>
<accessor source="#mesh2-geometry-uv-array" count="40" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh2-geometry-vertex">
<input semantic="POSITION" source="#mesh2-geometry-position"/>
</vertices>
<triangles material="material1" count="6">
<input semantic="VERTEX" source="#mesh2-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh2-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh2-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 17 5 21 11 5 22 13 5 19 11 5 22 17 5 21 18 5 23 19 8 30 20 8 31 9 8 32 9 9 33 20 9 34 6 9 35 </p>
</triangles>
<triangles material="material0" count="12">
<input semantic="VERTEX" source="#mesh2-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh2-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh2-geometry-uv" offset="2" set="0"/>
<p>4 1 4 2 1 5 1 1 6 2 1 5 4 1 4 5 1 7 5 1 7 6 1 8 2 1 5 6 1 8 5 1 7 7 1 9 8 2 10 6 2 8 7 2 9 6 2 8 8 2 10 9 2 11 10 1 12 9 1 11 8 1 10 9 1 11 10 1 12 11 1 13 12 1 14 11 1 13 10 1 12 11 1 13 12 1 14 13 1 15 12 3 14 14 3 16 13 3 15 14 3 16 12 3 14 15 3 17 </p>
</triangles>
<triangles material="material2" count="6">
<input semantic="VERTEX" source="#mesh2-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh2-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh2-geometry-uv" offset="2" set="0"/>
<p>16 4 18 13 4 19 14 4 20 13 4 19 16 4 18 17 4 21 11 6 24 18 6 25 9 6 26 18 7 27 19 7 28 9 7 29 20 10 36 2 10 37 6 10 38 2 10 37 20 10 36 0 10 39 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
<node id="mesh2" name="mesh2">
<instance_geometry url="#mesh2-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.924234 -0.336507 0.180430 1202.764220
0.381827 0.814534 -0.436741 -3158.808187
0.000000 0.472544 0.881307 4576.529787
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["sharpBendHighXML"] = sharpBendHighXML;
sharpBendMedXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-08-22T23:28:33Z</created>
<modified>2008-08-22T23:28:33Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>yellowAndGrey</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>magenta</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="36">-800.000000 0.000000 0.000000 -886.602540 -1000.000000 50.000000 -886.602540 12.502331 50.000000 -800.000000 -1000.000000 0.000000 -1000.000000 -1000.000000 50.000000 -1000.000000 12.502331 50.000000 3.455215 1000.000000 50.000000 3.455215 886.602540 50.000000 1000.000000 1000.000000 50.000000 1000.000000 886.602540 50.000000 1000.000000 800.000000 0.000000 0.000000 800.000000 0.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="12" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="21">0.500000 0.000000 0.866025 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 -0.000000 -0.000000 1.000000 -0.000000 -0.500000 0.866025 0.458090 -0.458090 0.761779 0.408805 -0.416268 0.812157 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="7" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="44">10.047118 7.963348 10.233592 7.030979 10.233592 7.975005 10.047119 7.030979 100.000000 -100.000000 88.660254 1.250233 88.660254 -100.000000 100.000000 1.250233 -0.345522 100.000000 -0.345522 88.660254 -100.000000 100.000000 -100.000000 88.660254 -4.707377 6.984121 -4.514259 6.021873 -4.514260 6.984121 -4.707376 6.018536 -0.691275 3.943757 -0.798503 3.899521 -0.798503 3.113598 8.152954 4.948093 8.031037 4.098446 8.152955 4.060726 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="22" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="6">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 10 4 12 7 4 13 9 4 14 7 4 13 10 4 12 11 4 15 7 5 16 11 5 17 0 5 18 7 6 19 0 6 20 2 6 21 </p>
</triangles>
<triangles material="material1" count="6">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>4 1 4 2 1 5 1 1 6 2 1 5 4 1 4 5 1 7 6 2 8 2 2 5 5 2 7 2 2 5 6 2 8 7 2 9 8 3 10 7 3 9 6 3 8 7 3 9 8 3 10 9 3 11 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.924234 -0.336507 0.180430 651.697192
0.381827 0.814534 -0.436741 -2014.648024
-0.000000 0.472544 0.881307 3181.556048
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["sharpBendMedXML"] = sharpBendMedXML;
sharpBendLowXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-08-23T08:16:14Z</created>
<modified>2008-08-23T08:16:14Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>magenta</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="24">-886.602540 12.502331 50.000000 -1000.000000 -1000.000000 50.000000 -1000.000000 12.502331 50.000000 -886.602540 -1000.000000 50.000000 3.455215 1000.000000 50.000000 3.455215 886.602540 50.000000 1000.000000 1000.000000 50.000000 1000.000000 886.602540 50.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="8" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="9">0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 -0.000000 -0.000000 1.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="3" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="16">88.660254 1.250233 100.000000 -100.000000 100.000000 1.250233 88.660254 -100.000000 -0.345522 100.000000 -0.345522 88.660254 -100.000000 100.000000 -100.000000 88.660254 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="8" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="6">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 4 1 4 0 1 0 2 1 2 0 1 0 4 1 4 5 1 5 6 2 6 5 2 5 4 2 4 5 2 5 6 2 6 7 2 7 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.924234 -0.336507 0.180430 651.697192
0.381827 0.814534 -0.436741 -2014.648024
-0.000000 0.472544 0.881307 3181.556048
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["sharpBendLowXML"] = sharpBendLowXML;
curveLongHighXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-08-24T10:40:50Z</created>
<modified>2008-08-24T10:40:50Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>magenta</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>lightGrey</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>yellow</init_from>
</image>
<image id="material3-image" name="material3-image">
<init_from>darkGrey</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
<material id="material3ID" name="material3">
<instance_effect url="#material3-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material3-effect" name="material3-effect">
<profile_COMMON>
<newparam sid="material3-image-surface">
<surface type="2D">
<init_from>material3-image</init_from>
</surface>
</newparam>
<newparam sid="material3-image-sampler">
<sampler2D>
<source>material3-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material3-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="180">0.000000 -1500.000000 50.000000 -113.397460 -2000.000000 50.000000 -113.397460 -1500.000000 50.000000 0.000000 -2000.000000 50.000000 -200.000000 -2000.000000 -0.000000 -200.000000 -1500.000000 -0.000000 -1800.000000 -2000.000000 -0.000000 -1800.000000 -1500.000000 -0.000000 -1886.602540 -2000.000000 50.000000 -1886.602540 -1500.000000 50.000000 -2000.000000 -2000.000000 50.000000 -2000.000000 -1500.000000 50.000000 -1886.602540 -1000.000000 50.000000 -2000.000000 -1000.000000 50.000000 -1886.602540 -500.000000 50.000000 -2000.000000 -500.000000 50.000000 -1886.602540 0.000000 50.000000 -2000.000000 0.000000 50.000000 -1500.000000 500.000000 50.000000 -1443.301270 443.301270 50.000000 -1000.000000 1000.000000 50.000000 -943.301270 943.301270 50.000000 -500.000000 1500.000000 50.000000 -443.301270 1443.301270 50.000000 0.000000 2000.000000 50.000000 0.000000 1886.602540 50.000000 500.000000 2000.000000 50.000000 500.000000 1886.602540 50.000000 1000.000000 1886.602540 50.000000 1000.000000 2000.000000 50.000000 1500.000000 1886.602540 50.000000 1500.000000 2000.000000 50.000000 2000.000000 1886.602540 50.000000 2000.000000 2000.000000 50.000000 1500.000000 1800.000000 -0.000000 2000.000000 1800.000000 -0.000000 1000.000000 1800.000000 -0.000000 500.000000 1800.000000 -0.000000 0.000000 1800.000000 -0.000000 -400.000000 1400.000000 -0.000000 -900.000000 900.000000 -0.000000 -1400.000000 400.000000 0.000000 -1800.000000 0.000000 -0.000000 -1800.000000 -500.000000 -0.000000 -1800.000000 -1000.000000 -0.000000 -113.397460 -1000.000000 50.000000 -200.000000 -1000.000000 -0.000000 400.000000 -400.000000 -0.000000 443.301270 -443.301270 50.000000 1000.000000 200.000000 -0.000000 1000.000000 113.397460 50.000000 1500.000000 200.000000 -0.000000 1500.000000 113.397460 50.000000 2000.000000 113.397460 50.000000 2000.000000 200.000000 -0.000000 1500.000000 0.000000 50.000000 2000.000000 0.000000 50.000000 1000.000000 0.000000 50.000000 500.000000 -500.000000 50.000000 0.000000 -1000.000000 50.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="60" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="102">-0.000000 0.000000 1.000000 -0.500000 0.000000 0.866025 0.000000 -0.000000 1.000000 0.500000 0.000000 0.866025 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 -0.000000 1.000000 0.000000 -0.000000 1.000000 -0.000000 -0.000000 1.000000 -0.000000 -0.000000 1.000000 0.000000 -0.000000 1.000000 0.000000 -0.000000 1.000000 0.000000 -0.500000 0.866025 -0.000000 -0.500000 0.866025 0.000000 -0.500000 0.866025 0.000000 -0.500000 0.866025 0.447214 -0.447214 0.774597 0.447214 -0.447214 0.774597 0.447214 -0.447214 0.774597 0.447214 -0.447214 0.774597 0.500000 -0.000000 0.866025 0.500000 0.000000 0.866025 0.500000 0.000000 0.866025 -0.500000 0.000000 0.866025 -0.447214 0.447214 0.774597 -0.447214 0.447214 0.774597 0.000000 0.500000 0.866025 -0.000000 0.500000 0.866025 0.000000 0.000000 1.000000 -0.000000 0.000000 1.000000 -0.000000 0.000000 1.000000 -0.000000 0.000000 1.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="34" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="224">-0.000000 -150.000000 11.339746 -200.000000 11.339746 -150.000000 -0.000000 -200.000000 -200.000000 -17.320508 -150.000000 -7.320508 -200.000000 -7.320508 -150.000000 -17.320508 180.000000 -200.000000 20.000000 -150.000000 20.000000 -200.000000 180.000000 -150.000000 200.000000 165.884573 150.000000 155.884573 200.000000 155.884573 150.000000 165.884573 200.000000 -200.000000 188.660254 -150.000000 188.660254 -200.000000 200.000000 -150.000000 188.660254 -100.000000 200.000000 -100.000000 188.660254 -50.000000 200.000000 -50.000000 188.660254 0.000000 200.000000 0.000000 150.000000 50.000000 188.660254 0.000000 200.000000 0.000000 144.330127 44.330127 100.000000 100.000000 94.330127 94.330127 50.000000 150.000000 44.330127 144.330127 0.000000 200.000000 0.000000 188.660254 -50.000000 200.000000 -0.000000 188.660254 -0.000000 200.000000 -50.000000 188.660254 -100.000000 188.660254 -100.000000 200.000000 -150.000000 188.660254 -150.000000 200.000000 -200.000000 188.660254 -200.000000 200.000000 -200.000000 165.884573 -150.000000 155.884573 -150.000000 165.884573 -200.000000 155.884573 -100.000000 155.884573 -150.000000 165.884573 -100.000000 165.884573 -50.000000 155.884573 -100.000000 165.884573 -50.000000 165.884573 -0.000000 155.884573 -0.000000 165.884573 -70.710678 98.590060 -133.402945 106.495755 -127.279221 98.590060 -70.710678 106.495755 -0.000000 98.590060 -70.710678 106.495755 -70.710678 98.590060 -0.000000 106.495755 70.710678 98.590060 -0.000000 106.495755 0.000000 98.590060 70.710678 106.495755 127.279221 98.590060 70.710678 106.495755 70.710678 98.590060 133.402945 106.495755 0.000000 155.884573 50.000000 165.884573 0.000000 165.884573 50.000000 155.884573 50.000000 155.884573 100.000000 165.884573 50.000000 165.884573 100.000000 155.884573 -100.000000 -7.320508 -100.000000 -17.320508 0.000000 43.817805 -78.729089 51.723499 -84.852814 43.817805 0.000000 51.723499 84.852814 43.817805 0.000000 51.723499 0.000000 43.817805 78.729089 51.723499 150.000000 -17.320508 100.000000 -7.320508 100.000000 -17.320508 150.000000 -7.320508 200.000000 -7.320508 150.000000 -7.320508 200.000000 -17.320508 -200.000000 11.339746 -150.000000 -0.000000 -150.000000 11.339746 -200.000000 -0.000000 -100.000000 -0.000000 -150.000000 -0.000000 -100.000000 11.339746 -50.000000 -50.000000 -100.000000 -0.000000 -44.330127 -44.330127 -0.000000 -100.000000 11.339746 -100.000000 -0.000000 -100.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="112" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="36">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 10 4 16 9 4 17 8 4 18 9 4 17 10 4 16 11 4 19 11 5 19 12 5 20 9 5 17 12 5 20 11 5 19 13 5 21 13 4 21 14 4 22 12 4 20 14 4 22 13 4 21 15 4 23 15 4 23 16 4 24 14 4 22 16 4 24 15 4 23 17 4 25 18 6 26 16 6 27 17 6 28 16 6 27 18 6 26 19 6 29 20 7 30 19 7 29 18 7 26 19 7 29 20 7 30 21 7 31 22 8 32 21 8 31 20 8 30 21 8 31 22 8 32 23 8 33 24 9 34 23 9 33 22 9 32 23 9 33 24 9 34 25 9 35 26 10 36 25 10 37 24 10 38 25 10 37 26 10 36 27 10 39 26 11 36 28 11 40 27 11 39 28 11 40 26 11 36 29 11 41 29 12 41 30 12 42 28 12 40 30 12 42 29 12 41 31 12 43 31 13 43 32 13 44 30 13 42 32 13 44 31 13 43 33 13 45 53 30 99 55 30 100 52 30 101 55 30 100 53 30 99 56 30 102 57 31 103 52 31 101 55 31 104 52 31 101 57 31 103 50 31 105 58 32 106 50 32 105 57 32 107 50 32 105 58 32 106 48 32 108 59 33 109 48 33 108 58 33 106 48 33 108 59 33 109 45 33 110 59 0 111 2 0 2 45 0 110 2 0 2 59 0 111 0 0 0 </p>
</triangles>
<triangles material="material1" count="18">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>4 1 4 2 1 5 1 1 6 2 1 5 4 1 4 5 1 7 8 3 12 7 3 13 6 3 14 7 3 13 8 3 12 9 3 15 36 15 50 30 15 51 34 15 47 30 15 51 36 15 50 28 15 52 38 17 56 27 17 55 37 17 53 27 17 55 38 17 56 25 17 57 40 19 62 23 19 63 39 19 64 23 19 63 40 19 62 21 19 65 42 21 70 19 21 71 41 21 72 19 21 71 42 21 70 16 21 73 43 23 78 12 23 79 14 23 80 12 23 79 43 23 78 44 23 81 47 26 84 45 26 85 46 26 86 45 26 85 47 26 84 48 26 87 51 28 92 50 28 93 49 28 94 50 28 93 51 28 92 52 28 95 </p>
</triangles>
<triangles material="material3" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>6 2 8 5 2 9 4 2 10 5 2 9 6 2 8 7 2 11 </p>
</triangles>
<triangles material="material2" count="18">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>32 14 46 34 14 47 30 14 48 34 14 47 32 14 46 35 14 49 37 16 53 28 16 54 36 16 50 28 16 54 37 16 53 27 16 55 39 18 58 25 18 59 38 18 60 25 18 59 39 18 58 23 18 61 41 20 66 21 20 67 40 20 68 21 20 67 41 20 66 19 20 69 42 22 74 14 22 75 16 22 76 14 22 75 42 22 74 43 22 77 44 24 81 9 24 15 12 24 79 9 24 15 44 24 81 7 24 13 5 25 7 45 25 82 2 25 5 45 25 82 5 25 7 46 25 83 49 27 88 48 27 89 47 27 90 48 27 89 49 27 88 50 27 91 51 29 92 53 29 96 52 29 97 53 29 96 51 29 92 54 29 98 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material3" target="#material3ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.916393 -0.294353 0.271256 3478.173213
0.400279 0.673887 -0.621010 -7089.532907
-0.000000 0.677667 0.735369 8069.932907
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["curveLongHighXML"] = curveLongHighXML;
curveLongMedXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-08-24T10:39:38Z</created>
<modified>2008-08-24T10:39:38Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>magenta</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>yellowAndGrey</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>darkGrey</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="78">0.000000 -1000.000000 50.000000 -113.397460 -2000.000000 50.000000 -113.397460 -1000.000000 50.000000 0.000000 -2000.000000 50.000000 -200.000000 -2000.000000 -0.000000 -200.000000 -1500.000000 -0.000000 -200.000000 -1000.000000 -0.000000 1000.000000 200.000000 -0.000000 1000.000000 113.397460 50.000000 2000.000000 200.000000 -0.000000 2000.000000 113.397460 50.000000 1000.000000 0.000000 50.000000 2000.000000 0.000000 50.000000 -1800.000000 -2000.000000 -0.000000 -1800.000000 -1500.000000 -0.000000 -1800.000000 0.000000 -0.000000 -1886.602540 -2000.000000 50.000000 -1886.602540 0.000000 50.000000 -2000.000000 -2000.000000 50.000000 -2000.000000 0.000000 50.000000 0.000000 2000.000000 50.000000 0.000000 1886.602540 50.000000 2000.000000 2000.000000 50.000000 2000.000000 1886.602540 50.000000 0.000000 1800.000000 -0.000000 2000.000000 1800.000000 -0.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="26" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="39">-0.000000 0.000000 1.000000 -0.500000 0.000000 0.866025 -0.447214 0.447214 0.774597 0.000000 0.500000 0.866025 0.000000 0.000000 1.000000 -0.000000 0.000000 1.000000 0.000000 -0.000000 1.000000 0.500000 0.000000 0.866025 0.000000 -0.000000 1.000000 0.000000 -0.000000 1.000000 0.000000 -0.000000 1.000000 -0.000000 -0.500000 0.866025 0.447214 -0.447214 0.774597 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="13" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="104">-0.000000 -100.000000 11.339746 -200.000000 11.339746 -100.000000 -0.000000 -200.000000 -23.052668 -2.530632 -22.864504 -3.471446 -22.864505 -2.530632 -23.052668 -3.001039 -23.052667 -3.471446 -3.861819 2.516005 -3.772348 3.441661 -3.861819 3.476313 -3.772347 2.550657 31.174095 -3.481675 31.362807 -2.538113 31.174094 -2.538113 31.362807 -3.481675 -200.000000 11.339746 -100.000000 -0.000000 -100.000000 11.339746 -200.000000 -0.000000 -0.000000 -100.000000 -100.000000 -0.000000 180.000000 -200.000000 20.000000 -150.000000 20.000000 -200.000000 180.000000 -150.000000 21.149933 14.050219 21.149930 15.980953 21.149932 14.532902 21.343006 14.050219 21.343003 15.980953 200.000000 -200.000000 188.660254 0.000000 188.660254 -200.000000 200.000000 0.000000 0.000000 200.000000 188.660254 0.000000 200.000000 0.000000 0.000000 188.660254 -200.000000 200.000000 0.000000 188.660254 0.000000 200.000000 -200.000000 188.660254 -12.506512 16.988124 -12.702252 15.030737 -12.506513 15.030737 -12.702251 16.988124 17.994238 9.095902 18.107898 10.969833 17.994237 10.925812 18.107899 9.051881 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="52" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="12">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 10 4 17 11 4 18 8 4 19 11 4 18 10 4 17 12 4 20 0 5 21 8 5 19 11 5 22 8 5 19 0 5 21 2 5 2 18 8 32 17 8 33 16 8 34 17 8 33 18 8 32 19 8 35 20 9 36 17 9 37 19 9 38 17 9 37 20 9 36 21 9 39 22 10 40 21 10 41 20 10 42 21 10 41 22 10 40 23 10 43 </p>
</triangles>
<triangles material="material1" count="14">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>4 1 4 2 1 5 1 1 6 5 1 7 2 1 5 4 1 4 2 1 5 5 1 7 6 1 8 7 2 9 2 2 10 6 2 11 2 2 10 7 2 9 8 2 12 9 3 13 8 3 14 7 3 15 8 3 14 9 3 13 10 3 16 13 7 27 15 7 28 14 7 29 16 7 30 15 7 28 13 7 27 15 7 28 16 7 30 17 7 31 23 11 44 24 11 45 21 11 46 24 11 45 23 11 44 25 11 47 15 12 48 21 12 49 24 12 50 21 12 49 15 12 48 17 12 51 </p>
</triangles>
<triangles material="material2" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>13 6 23 5 6 24 4 6 25 5 6 24 13 6 23 14 6 26 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.674886 -0.673588 0.301344 1840.109498
0.737922 0.616047 -0.275603 -1494.201914
-0.000000 0.408369 0.912817 5943.558709
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["curveLongMedXML"] = curveLongMedXML;
curveLongLowXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-08-24T10:47:39Z</created>
<modified>2008-08-24T10:47:39Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>curveLongLowTexture</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="21">0.000000 0.000000 0.000000 -2000.000000 -2000.000000 0.000000 -2000.000000 -0.000000 0.000000 0.000000 -2000.000000 0.000000 0.000000 2000.000000 -0.000000 2000.000000 -0.000000 -0.000000 2000.000000 2000.000000 -0.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="7" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="9">0.000000 -0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="3" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="22">-0.000000 1.000000 1.000000 -0.000000 1.000000 1.000000 -0.000000 0.000000 1.000000 -1.997142 1.998571 -0.998571 1.000000 0.000000 1.000000 -0.000000 -0.000000 1.000000 -0.000000 -0.000000 1.000000 1.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="11" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="5">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 4 1 4 0 1 5 2 1 6 4 2 7 5 2 8 0 2 9 5 2 8 4 2 7 6 2 10 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.948058 -0.259920 0.183380 1671.317287
0.318098 0.774663 -0.546544 -4140.384348
0.000000 0.576488 0.817106 7233.635821
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["curveLongLowXML"] = curveLongLowXML;
startBridgeXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-09-16T11:29:47Z</created>
<modified>2008-09-16T11:29:47Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>yellowAndGrey</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>darkGrey</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>magenta</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="45">-1000.000000 -0.000000 1050.000000 -1400.000000 -0.000000 50.000000 -1000.000000 -0.000000 50.000000 -1400.000000 -0.000000 1050.000000 -1000.000000 -0.000000 1450.000000 0.000000 0.000000 1050.000000 1000.000000 400.000000 1050.000000 -1000.000000 400.000000 1050.000000 -1000.000000 400.000000 50.000000 1000.000000 0.000000 1050.000000 1000.000000 0.000000 50.000000 1000.000000 400.000000 50.000000 1400.000000 0.000000 1050.000000 1400.000000 0.000000 50.000000 1000.000000 0.000000 1450.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="15" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="21">0.000000 -1.000000 0.000000 0.000000 -1.000000 -0.000000 0.000000 -0.000000 1.000000 -1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 -1.000000 0.000000 0.000000 -1.000000 0.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="7" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="62">-5.139120 3.014218 -2.805534 0.291698 -1.249809 1.069560 -6.694848 2.236356 -2.000000 1.050000 -2.000000 1.450000 -2.800000 1.050000 0.000000 1.050000 100.000000 -0.000000 -100.000000 40.000000 -0.000000 0.000000 100.000000 40.000000 -0.000000 105.000000 40.000000 5.000000 40.000000 105.000000 -0.000000 5.000000 -100.000000 0.000000 -40.000000 105.000000 -0.000000 5.000000 -0.000000 105.000000 -40.000000 5.000000 2.195411 0.097705 7.666915 1.270170 6.103629 2.051814 3.758698 -0.683938 2.000000 1.450000 2.000000 1.050000 2.800000 1.050000 -100.000000 145.000000 0.000000 105.000000 100.000000 145.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="31" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="8">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 0 1 4 4 1 5 3 1 6 4 1 5 0 1 4 5 1 7 10 0 21 12 0 22 9 0 23 12 0 22 10 0 21 13 0 24 14 5 25 9 5 26 12 5 27 9 5 26 14 5 25 5 5 7 </p>
</triangles>
<triangles material="material1" count="7">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 2 8 6 2 9 5 2 10 6 2 9 0 2 8 7 2 11 0 3 12 8 3 13 7 3 14 8 3 13 0 3 12 2 3 15 5 2 10 6 2 9 9 2 16 6 4 17 10 4 18 9 4 19 10 4 18 6 4 17 11 4 20 </p>
</triangles>
<triangles material="material2" count="1">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>4 6 28 5 6 29 14 6 30 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.879447 -0.137759 0.455627 2795.939081
0.475997 0.254522 -0.841811 -5101.106318
0.000000 0.957205 0.289411 2467.160676
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["startBridgeXML"] = startBridgeXML;
shipAHighXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-09-17T17:27:08Z</created>
<modified>2008-09-17T17:27:08Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>redMed</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>darkGrey</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>black</init_from>
</image>
<image id="material3-image" name="material3-image">
<init_from>redDark</init_from>
</image>
<image id="material4-image" name="material4-image">
<init_from>redLight</init_from>
</image>
</library_images> <library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
<material id="material3ID" name="material3">
<instance_effect url="#material3-effect"/>
</material>
<material id="material4ID" name="material4">
<instance_effect url="#material4-effect"/>
</material>
<material id="FrontColorNoCullingID" name="FrontColorNoCulling">
<instance_effect url="#FrontColorNoCulling-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material3-effect" name="material3-effect">
<profile_COMMON>
<newparam sid="material3-image-surface">
<surface type="2D">
<init_from>material3-image</init_from>
</surface>
</newparam>
<newparam sid="material3-image-sampler">
<sampler2D>
<source>material3-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material3-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material4-effect" name="material4-effect">
<profile_COMMON>
<newparam sid="material4-image-surface">
<surface type="2D">
<init_from>material4-image</init_from>
</surface>
</newparam>
<newparam sid="material4-image-sampler">
<sampler2D>
<source>material4-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material4-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="FrontColorNoCulling-effect" name="FrontColorNoCulling-effect">
<profile_COMMON>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<color>1.000000 1.000000 1.000000 1</color>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="51">-45.495000 50.550000 28.937099 45.495000 58.797249 19.421042 -45.495000 58.797249 19.421042 45.495000 50.550000 28.937099 -22.747500 0.000000 18.437099 22.747500 0.000000 18.437099 -20.245275 -101.725000 36.687099 20.245275 -101.725000 36.687099 -17.743050 -203.450000 54.937099 17.743050 -203.450000 54.937099 -0.000000 80.550000 54.937099 -45.495000 -50.550000 54.937099 -60.495000 80.550000 54.937099 -60.495000 128.162153 0.000000 60.495000 128.162153 0.000000 60.495000 80.550000 54.937099 45.495000 -50.550000 54.937099 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="17" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="57">0.000000 -0.755689 -0.654931 -0.000000 0.203374 -0.979101 0.000000 -0.176586 -0.984285 -0.000000 -0.176586 -0.984285 0.000000 0.000000 -1.000000 0.908704 0.103971 0.404286 -0.707292 -0.176071 -0.684644 0.745801 0.135366 0.652270 -0.935451 -0.267102 -0.231489 0.636225 -0.077338 -0.767617 0.000000 0.755689 0.654931 0.000000 0.852763 -0.522298 -0.636225 -0.077338 -0.767617 -0.000000 0.755689 0.654931 0.935451 -0.267102 -0.231489 -0.908704 0.103971 0.404286 0.707292 -0.176071 -0.684644 -0.745801 0.135366 0.652270 -0.745801 0.135366 0.652270 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="19" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="134">4.549500 -1.123929 -4.549500 -2.383184 4.549500 -2.383184 -4.549500 -1.123929 -2.274750 0.374963 4.549500 5.537862 -4.549500 5.537862 2.274750 0.374963 2.024528 10.660484 -2.274750 0.325573 2.274750 0.325573 -2.024527 10.660484 1.774305 20.995395 -2.024527 10.660484 -1.774305 20.995395 6.985453 -80.098425 0.000000 31.712598 -6.985453 -80.098425 17.911417 -19.901575 23.816929 31.712598 8.690463 7.084417 -4.505070 7.084417 5.539397 4.241745 6.004291 4.295681 -3.806301 7.862808 0.549497 2.855110 0.406239 2.857407 -4.161260 7.672795 -9.647417 5.265101 -19.701073 7.672795 6.902878 2.528336 9.406397 6.179105 6.109847 3.506511 13.984638 0.532007 -7.996140 2.774846 -11.992573 -5.796910 -5.287774 -2.766673 -6.049500 -1.123929 -6.049500 -8.393731 -0.000000 -1.123929 -0.000000 8.891941 -4.549500 4.727121 4.549500 4.727121 11.992573 -5.796910 7.996140 2.774846 5.287774 -2.766673 0.000000 -1.123929 6.049500 -8.393731 6.049500 -1.123929 -6.902878 2.528336 -9.406397 6.179105 -13.984638 0.532007 -6.109847 3.506511 -8.690463 7.084417 -5.539397 4.241745 4.505070 7.084417 -6.004291 4.295681 -0.549497 2.855110 3.806301 7.862808 -0.406239 2.857407 9.647417 5.265101 4.161260 7.672795 4.161260 7.672795 9.647417 5.265101 19.701073 7.672795 -23.816929 31.712598 -17.911417 -19.901575 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="67" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="8">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 12 5 20 11 5 21 0 5 22 11 7 27 8 7 29 6 7 28 10 9 34 13 9 35 2 9 36 14 12 43 10 12 44 1 12 45 15 15 53 3 15 54 16 15 55 16 18 62 7 18 63 9 18 64 </p>
</triangles>
<triangles material="material4" count="6">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>4 1 4 3 1 5 0 1 6 3 1 5 4 1 4 5 1 7 8 3 12 7 3 13 6 3 8 7 3 13 8 3 12 9 3 14 12 10 37 13 10 38 10 10 39 10 13 46 14 13 47 15 13 48 </p>
</triangles>
<triangles material="material2" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>6 2 8 5 2 9 4 2 10 5 2 9 6 2 8 7 2 11 </p>
</triangles>
<triangles material="FrontColorNoCulling" count="5">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>8 4 15 10 4 16 9 4 17 11 4 18 10 4 16 8 4 15 10 4 16 11 4 18 12 4 19 9 4 17 15 4 65 16 4 66 9 4 17 10 4 16 15 4 65 </p>
</triangles>
<triangles material="material3" count="6">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 6 23 11 6 24 4 6 25 2 8 30 12 8 31 0 8 32 12 8 31 2 8 30 13 8 33 1 14 49 15 14 50 14 14 51 15 14 50 1 14 49 3 14 52 3 16 56 5 16 57 16 16 58 </p>
</triangles>
<triangles material="material1" count="3">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>4 7 26 11 7 27 6 7 28 10 11 40 2 11 41 1 11 42 5 17 59 7 17 60 16 17 61 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material4" target="#material4ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="FrontColorNoCulling" target="#FrontColorNoCullingID"/>
<instance_material symbol="material3" target="#material3ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.145852 0.438216 -0.886958 -1157.657487
-0.989306 0.064605 -0.130763 -271.493166
0.000000 0.896545 0.442953 661.361252
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["shipAHighXML"] = shipAHighXML;
shipALowXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-09-16T13:28:44Z</created>
<modified>2008-09-16T13:28:44Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>redMed</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>.darkGrey</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>redDark</init_from>
</image>
<image id="material3-image" name="material3-image">
<init_from>redLight</init_from>
</image>
</library_images> <library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
<material id="material3ID" name="material3">
<instance_effect url="#material3-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material3-effect" name="material3-effect">
<profile_COMMON>
<newparam sid="material3-image-surface">
<surface type="2D">
<init_from>material3-image</init_from>
</surface>
</newparam>
<newparam sid="material3-image-sampler">
<sampler2D>
<source>material3-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material3-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="51">-45.495000 -50.550000 -0.000000 -17.743050 -203.450000 -0.000000 -20.245275 -101.725000 18.250000 -22.747500 -0.000000 36.500000 -45.495000 50.550000 26.000000 45.495000 50.550000 26.000000 22.747500 -0.000000 36.500000 45.495000 -50.550000 -0.000000 60.495000 80.550000 -0.000000 45.495000 58.797249 35.516057 60.495000 128.162153 54.937099 -0.000000 80.550000 -0.000000 -45.495000 58.797249 35.516057 -60.495000 128.162153 54.937099 -60.495000 80.550000 -0.000000 20.245275 -101.725000 18.250000 17.743050 -203.450000 -0.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="17" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="48">-0.745801 -0.135366 0.652270 -0.707292 -0.176071 0.684644 -0.000000 0.203374 0.979101 0.707292 -0.176071 0.684644 0.908704 -0.103971 0.404286 0.935451 -0.267102 0.231489 -0.636225 -0.077338 0.767617 0.000000 0.852763 0.522298 0.636225 -0.077338 0.767617 -0.935451 -0.267102 0.231489 0.000000 -0.755689 0.654931 -0.908704 -0.103971 0.404286 0.000000 0.755689 -0.654931 -0.000000 0.755689 -0.654931 0.745801 -0.135366 0.652270 0.745801 -0.135366 0.652270 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="16" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="102">4.161260 -3.508637 19.701073 -3.508637 9.647417 -1.100943 -0.406239 1.306752 6.004291 -0.291437 0.549497 1.149133 -3.806301 -3.858564 4.549500 -4.420583 -2.274750 0.742316 -4.549500 -4.420583 2.274750 0.742316 -6.004291 -0.291437 3.806301 -3.858564 -0.549497 1.149133 8.690463 -2.059691 5.539397 0.782981 -4.505070 -2.059691 -6.902878 2.816152 -9.406397 -0.834618 -6.109847 1.837976 -13.984638 4.812481 11.992573 9.317875 5.287774 6.287638 7.996140 0.746119 -4.549500 -0.042287 -0.000000 -4.207106 4.549500 -0.042287 -7.996140 0.746119 -5.287774 6.287638 -11.992573 9.317875 6.902878 2.816152 9.406397 -0.834618 13.984638 4.812481 6.109847 1.837976 4.549500 6.534721 -4.549500 5.275465 4.549500 5.275465 -4.549500 6.534721 -8.690463 -2.059691 4.505070 -2.059691 -5.539397 0.782981 -6.049500 12.545267 -6.049500 5.275465 -0.000000 5.275465 6.049500 12.545267 -0.000000 5.275465 6.049500 5.275465 0.406239 1.306752 -9.647417 -1.100943 -4.161260 -3.508637 -19.701073 -3.508637 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="51" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="8">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 8 4 14 5 4 15 7 4 16 10 6 21 9 6 22 11 6 23 11 8 27 12 8 28 13 8 29 12 10 34 5 10 35 4 10 36 5 10 35 12 10 34 9 10 37 14 11 38 0 11 39 4 11 40 7 15 49 15 15 48 16 15 50 </p>
</triangles>
<triangles material="material1" count="3">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>3 0 3 0 0 0 2 0 2 12 7 24 11 7 25 9 7 26 6 14 47 15 14 48 7 14 49 </p>
</triangles>
<triangles material="material2" count="6">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>4 1 4 3 1 5 0 1 6 5 3 11 7 3 12 6 3 13 9 5 17 8 5 18 5 5 19 8 5 18 9 5 17 10 5 20 12 9 30 14 9 31 13 9 32 14 9 31 12 9 30 4 9 33 </p>
</triangles>
<triangles material="material3" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>5 2 7 3 2 8 4 2 9 3 2 8 5 2 7 6 2 10 13 12 41 14 12 42 11 12 43 10 13 44 11 13 45 8 13 46 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material3" target="#material3ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.949439 0.037472 -0.311706 -297.139042
-0.313950 0.113321 -0.942652 -831.988223
0.000000 0.992852 0.119356 198.323227
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["shipALowXML"] = shipALowXML;
shipBHighXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-09-18T14:47:59Z</created>
<modified>2008-09-18T14:47:59Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>greenMed</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>greenDark</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>black</init_from>
</image>
<image id="material3-image" name="material3-image">
<init_from>darkGrey</init_from>
</image>
<image id="material4-image" name="material4-image">
<init_from>greenLight</init_from>
</image>
</library_images>
<library_materials>
<material id="FrontColorNoCullingID" name="FrontColorNoCulling">
<instance_effect url="#FrontColorNoCulling-effect"/>
</material>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
<material id="material3ID" name="material3">
<instance_effect url="#material3-effect"/>
</material>
<material id="material4ID" name="material4">
<instance_effect url="#material4-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="FrontColorNoCulling-effect" name="FrontColorNoCulling-effect">
<profile_COMMON>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<color>1.000000 1.000000 1.000000 1</color>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material3-effect" name="material3-effect">
<profile_COMMON>
<newparam sid="material3-image-surface">
<surface type="2D">
<init_from>material3-image</init_from>
</surface>
</newparam>
<newparam sid="material3-image-sampler">
<sampler2D>
<source>material3-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material3-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material4-effect" name="material4-effect">
<profile_COMMON>
<newparam sid="material4-image-surface">
<surface type="2D">
<init_from>material4-image</init_from>
</surface>
</newparam>
<newparam sid="material4-image-sampler">
<sampler2D>
<source>material4-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material4-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="39">54.341127 80.550000 35.000000 -40.867006 -50.550000 35.000000 -54.341127 80.550000 35.000000 -15.938133 -173.150000 35.000000 15.938133 -173.150000 35.000000 40.867006 -50.550000 35.000000 39.341127 95.550000 0.000000 9.219698 23.612500 22.425000 0.000000 95.550000 0.000000 -9.219698 23.612500 22.425000 -39.341127 95.550000 0.000000 -18.439396 -33.325000 9.850000 18.439396 -33.325000 9.850000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="13" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="45">0.000000 0.000000 -1.000000 0.900232 -0.092524 -0.425467 -0.161325 -0.231512 -0.959363 -0.000000 -0.297604 -0.954689 0.000000 0.919145 0.393919 -0.900232 -0.092524 -0.425467 0.161325 -0.231512 -0.959363 -0.801359 0.249803 -0.543527 -0.689354 -0.140170 -0.710735 0.000000 -0.177027 -0.984206 0.689354 -0.140170 -0.710735 0.801359 0.249803 -0.543527 -0.000000 0.215659 -0.976469 0.000000 0.919145 0.393919 -0.000000 0.919145 0.393919 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="15" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="104">-21.394144 31.712598 16.089373 -19.901575 21.394144 31.712598 6.274855 -68.169291 -6.274855 -68.169291 -16.089373 -19.901575 -9.907150 1.249427 4.610692 5.116941 -8.568368 5.116941 -6.242967 2.724967 2.235010 -9.678633 0.593536 -1.731469 0.000000 -9.122056 -0.921970 -1.586883 -3.934113 -9.122056 0.921970 -1.586883 3.934113 -9.122056 -5.434113 0.043988 -3.934113 -3.763899 -0.000000 -3.763899 9.907150 1.249427 8.568368 5.116941 -4.610692 5.116941 -0.593536 -1.731469 -2.235010 -9.678633 6.242967 2.724967 1.979885 2.742687 -6.042163 4.240796 -3.730263 1.244578 -16.650206 6.024311 -2.898255 2.449126 -4.139327 6.024311 1.593813 17.661121 -1.843940 3.454238 1.843940 3.454238 -1.593813 17.661121 4.139327 6.024311 2.898255 2.449126 16.650206 6.024311 -1.979885 2.742687 3.730263 1.244578 6.042163 4.240796 -0.921970 2.789302 1.843940 -3.041658 0.921970 2.789302 -1.843940 -3.041658 -5.434113 0.043988 0.000000 -3.763899 5.434113 0.043988 5.434113 0.043988 0.000000 -3.763899 3.934113 -3.763899 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="52" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="FrontColorNoCulling" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 3 0 3 0 0 0 4 0 4 4 0 4 0 0 0 5 0 5 </p>
</triangles>
<triangles material="material1" count="5">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>6 1 6 5 1 7 0 1 8 10 5 20 2 5 21 1 5 22 9 7 26 1 7 27 11 7 28 7 11 39 12 11 40 5 11 41 2 13 46 8 13 47 0 13 48 </p>
</triangles>
<triangles material="material0" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>5 2 9 6 2 10 7 2 11 9 6 23 10 6 24 1 6 25 3 8 29 11 8 30 1 8 31 5 10 36 12 10 37 4 10 38 </p>
</triangles>
<triangles material="material4" count="3">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>8 3 12 7 3 13 6 3 14 8 3 12 9 3 15 7 3 13 9 3 15 8 3 12 10 3 16 </p>
</triangles>
<triangles material="material3" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>2 4 17 10 4 18 8 4 19 9 12 42 12 12 43 7 12 44 12 12 43 9 12 42 11 12 45 0 14 49 8 14 50 6 14 51 </p>
</triangles>
<triangles material="material2" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>3 9 32 12 9 33 11 9 34 12 9 33 3 9 32 4 9 35 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="FrontColorNoCulling" target="#FrontColorNoCullingID"/>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material4" target="#material4ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material3" target="#material3ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.888272 0.228920 -0.398206 -334.321141
-0.459317 0.442707 -0.770090 -634.974452
0.000000 0.866952 0.498391 412.292621
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["shipBHighXML"] = shipBHighXML;
shipBLowXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-09-18T14:47:21Z</created>
<modified>2008-09-18T14:47:21Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>greenMed</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>greenDark</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>darkGrey</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="12">-15.938133 -173.150000 35.000000 -18.439396 -33.325000 9.850000 -40.867006 -50.550000 35.000000 -9.219698 23.612500 22.425000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="4" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="6">-0.689354 -0.140170 -0.710735 -0.801359 0.249803 -0.543527 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="2" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="12">-16.650206 6.024311 -2.898255 2.449126 -4.139327 6.024311 1.979885 2.742687 -6.042163 4.240796 -3.730263 1.244578 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="6" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="1">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 </p>
</triangles>
<triangles material="material1" count="1">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>3 1 3 2 1 4 1 1 5 </p>
</triangles>
</mesh>
</geometry>
<geometry id="mesh2-geometry" name="mesh2-geometry">
<mesh>
<source id="mesh2-geometry-position">
<float_array id="mesh2-geometry-position-array" count="12">40.867006 -50.550000 35.000000 18.439396 -33.325000 9.850000 15.938133 -173.150000 35.000000 9.219698 23.612500 22.425000 </float_array>
<technique_common>
<accessor source="#mesh2-geometry-position-array" count="4" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh2-geometry-normal">
<float_array id="mesh2-geometry-normal-array" count="6">0.689354 -0.140170 -0.710735 0.801359 0.249803 -0.543527 </float_array>
<technique_common>
<accessor source="#mesh2-geometry-normal-array" count="2" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh2-geometry-uv">
<float_array id="mesh2-geometry-uv-array" count="12">4.139327 6.024311 2.898255 2.449126 16.650206 6.024311 -1.979885 2.742687 3.730263 1.244578 6.042163 4.240796 </float_array>
<technique_common>
<accessor source="#mesh2-geometry-uv-array" count="6" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh2-geometry-vertex">
<input semantic="POSITION" source="#mesh2-geometry-position"/>
</vertices>
<triangles material="material0" count="1">
<input semantic="VERTEX" source="#mesh2-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh2-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh2-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 </p>
</triangles>
<triangles material="material1" count="1">
<input semantic="VERTEX" source="#mesh2-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh2-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh2-geometry-uv" offset="2" set="0"/>
<p>3 1 3 1 1 4 0 1 5 </p>
</triangles>
</mesh>
</geometry>
<geometry id="mesh3-geometry" name="mesh3-geometry">
<mesh>
<source id="mesh3-geometry-position">
<float_array id="mesh3-geometry-position-array" count="21">39.341127 95.550000 0.000000 40.867006 -50.550000 35.000000 54.341127 80.550000 35.000000 0.000000 95.550000 0.000000 -54.341127 80.550000 35.000000 -39.341127 95.550000 0.000000 -40.867006 -50.550000 35.000000 </float_array>
<technique_common>
<accessor source="#mesh3-geometry-position-array" count="7" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh3-geometry-normal">
<float_array id="mesh3-geometry-normal-array" count="15">0.900232 -0.092524 -0.425467 -0.000000 0.919145 0.393919 0.000000 0.919145 0.393919 0.000000 0.919145 0.393919 -0.900232 -0.092524 -0.425467 </float_array>
<technique_common>
<accessor source="#mesh3-geometry-normal-array" count="5" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh3-geometry-uv">
<float_array id="mesh3-geometry-uv-array" count="30">-9.907150 1.249427 4.610692 5.116941 -8.568368 5.116941 5.434113 0.043988 0.000000 -3.763899 3.934113 -3.763899 -5.434113 0.043988 0.000000 -3.763899 5.434113 0.043988 -5.434113 0.043988 -3.934113 -3.763899 -0.000000 -3.763899 9.907150 1.249427 8.568368 5.116941 -4.610692 5.116941 </float_array>
<technique_common>
<accessor source="#mesh3-geometry-uv-array" count="15" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh3-geometry-vertex">
<input semantic="POSITION" source="#mesh3-geometry-position"/>
</vertices>
<triangles material="material1" count="3">
<input semantic="VERTEX" source="#mesh3-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh3-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh3-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 4 2 6 3 2 7 2 2 8 5 4 12 4 4 13 6 4 14 </p>
</triangles>
<triangles material="material2" count="2">
<input semantic="VERTEX" source="#mesh3-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh3-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh3-geometry-uv" offset="2" set="0"/>
<p>2 1 3 3 1 4 0 1 5 4 3 9 5 3 10 3 3 11 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
<node id="mesh2" name="mesh2">
<instance_geometry url="#mesh2-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
<node id="mesh3" name="mesh3">
<instance_geometry url="#mesh3-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
-0.705087 0.203162 -0.679395 -532.961271
-0.709121 -0.202007 0.675530 544.081561
0.000000 0.958081 0.286499 230.303740
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["shipBLowXML"] = shipBLowXML;
shipCHighXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-09-19T14:54:53Z</created>
<modified>2008-09-19T14:54:53Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>blueDark</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>black</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>blueLight</init_from>
</image>
<image id="material3-image" name="material3-image">
<init_from>darkGrey</init_from>
</image>
<image id="material4-image" name="material4-image">
<init_from>blueMed</init_from>
</image>
<image id="material5-image" name="material5-image">
<init_from>redLight</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
<material id="material3ID" name="material3">
<instance_effect url="#material3-effect"/>
</material>
<material id="material4ID" name="material4">
<instance_effect url="#material4-effect"/>
</material>
<material id="FrontColorNoCullingID" name="FrontColorNoCulling">
<instance_effect url="#FrontColorNoCulling-effect"/>
</material>
<material id="material5ID" name="material5">
<instance_effect url="#material5-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material3-effect" name="material3-effect">
<profile_COMMON>
<newparam sid="material3-image-surface">
<surface type="2D">
<init_from>material3-image</init_from>
</surface>
</newparam>
<newparam sid="material3-image-sampler">
<sampler2D>
<source>material3-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material3-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material4-effect" name="material4-effect">
<profile_COMMON>
<newparam sid="material4-image-surface">
<surface type="2D">
<init_from>material4-image</init_from>
</surface>
</newparam>
<newparam sid="material4-image-sampler">
<sampler2D>
<source>material4-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material4-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="FrontColorNoCulling-effect" name="FrontColorNoCulling-effect">
<profile_COMMON>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<color>1.000000 1.000000 1.000000 1</color>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material5-effect" name="material5-effect">
<profile_COMMON>
<newparam sid="material5-image-surface">
<surface type="2D">
<init_from>material5-image</init_from>
</surface>
</newparam>
<newparam sid="material5-image-sampler">
<sampler2D>
<source>material5-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material5-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="48">45.495000 -50.550000 50.000000 17.743050 -198.850000 76.000000 45.495000 -50.550000 76.000000 0.000000 -12.550000 27.200000 44.946900 47.400000 51.600000 44.946900 47.400000 76.000000 0.000000 47.400000 76.000000 -17.743050 -198.850000 76.000000 -44.946900 47.400000 76.000000 -45.495000 -50.550000 76.000000 -45.495000 -50.550000 50.000000 -44.946900 47.400000 51.600000 -44.946900 123.100000 30.200000 -84.946900 47.400000 76.000000 44.946900 123.100000 30.200000 84.946900 47.400000 76.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="16" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="57">0.982937 -0.183941 0.000000 0.286278 -0.217183 -0.933208 0.459338 0.017077 -0.888098 0.999984 0.005596 -0.000000 0.000000 0.000000 -1.000000 -0.982937 -0.183941 0.000000 -0.286278 -0.217183 -0.933208 -0.459338 0.017077 -0.888098 -0.000000 0.376978 -0.926222 0.000000 1.000000 0.000000 0.000000 0.517650 0.855592 0.000000 -1.000000 0.000000 -0.999984 0.005596 -0.000000 -0.506226 -0.234602 -0.829878 -0.000000 -0.272034 -0.962288 0.506226 -0.234602 -0.829878 -0.000000 0.517650 0.855592 0.000000 0.517650 0.855592 -0.000000 -0.253394 -0.967363 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="19" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="138">4.131909 5.000000 19.219341 7.600000 4.131909 7.600000 1.277524 8.030270 0.999837 1.685253 14.769651 15.265815 5.220535 6.169096 -4.569739 6.517183 1.254134 1.208853 5.080378 5.000000 -4.714775 7.600000 -4.714775 5.160000 5.080378 7.600000 -6.985453 -78.287402 -17.695630 18.661417 -17.911417 -19.901575 0.000000 18.661417 6.985453 -78.287402 17.695630 18.661417 17.911417 -19.901575 -4.131909 7.600000 -19.219341 7.600000 -4.131909 5.000000 -0.999837 1.685253 -1.277524 8.030270 -14.769651 15.265815 -1.254134 1.208853 4.569739 6.517183 -5.220535 6.169096 4.494690 6.335499 -4.494690 6.335499 0.000000 -0.137029 17.695630 29.921260 -17.695630 20.314961 17.695630 20.314961 -17.695630 29.921260 0.000000 29.921260 -4.494690 -0.121365 -4.494690 -8.969037 -0.000000 -0.121365 -8.494690 -0.121365 4.494690 7.600000 4.494690 5.160000 8.494690 7.600000 -5.080378 7.600000 4.714775 5.160000 4.714775 7.600000 -5.080378 5.000000 6.190528 4.609287 13.058818 0.773783 7.872430 8.982479 4.494690 -3.157549 -4.494690 -11.024220 4.494690 -11.024220 -4.494690 -3.157549 -7.872430 8.982479 -13.058818 0.773783 -6.190528 4.609287 4.494690 -0.121365 4.494690 -8.969037 8.494690 -0.121365 0.000000 -0.121365 -0.000000 -0.121365 -8.494690 7.600000 -4.494690 5.160000 -4.494690 7.600000 -1.774305 21.161811 -0.000000 1.903273 1.774305 21.161811 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="69" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="6">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 0 3 9 5 3 10 4 3 11 5 3 10 0 3 9 2 3 12 9 5 20 7 5 21 10 5 22 9 12 44 11 12 45 8 12 46 11 12 45 9 12 44 10 12 47 </p>
</triangles>
<triangles material="material2" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 1 3 3 1 4 1 1 5 3 6 23 10 6 24 7 6 25 11 14 51 14 14 52 12 14 53 14 14 52 11 14 51 4 14 54 </p>
</triangles>
<triangles material="material4" count="8">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 2 6 4 2 7 3 2 8 3 7 26 11 7 27 10 7 28 8 10 37 12 10 38 6 10 39 12 10 38 8 10 37 13 10 40 11 13 48 12 13 49 13 13 50 15 15 55 14 15 56 4 15 57 5 16 58 14 16 59 15 16 60 14 16 59 5 16 58 6 16 61 </p>
</triangles>
<triangles material="FrontColorNoCulling" count="8">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>1 4 13 5 4 14 2 4 15 1 4 13 6 4 16 5 4 14 7 4 17 6 4 16 1 4 13 7 4 17 8 4 18 6 4 16 8 4 18 7 4 17 9 4 19 8 9 32 4 9 33 11 9 34 4 9 33 8 9 32 5 9 35 5 9 35 8 9 32 6 9 36 </p>
</triangles>
<triangles material="material3" count="1">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>4 8 29 11 8 30 3 8 31 </p>
</triangles>
<triangles material="material5" count="3">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>8 11 41 11 11 42 13 11 43 14 17 59 6 17 62 12 17 38 15 11 63 4 11 64 5 11 65 </p>
</triangles>
<triangles material="material1" count="1">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>1 18 66 3 18 67 7 18 68 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material4" target="#material4ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="FrontColorNoCulling" target="#FrontColorNoCullingID"/>
<instance_material symbol="material3" target="#material3ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material5" target="#material5ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
-0.712199 -0.409519 0.570146 430.775646
-0.701977 0.415482 -0.578448 -433.981642
0.000000 -0.812200 -0.583379 -381.387893
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["shipCHighXML"] = shipCHighXML;
shipCLowXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-09-19T15:01:08Z</created>
<modified>2008-09-19T15:01:08Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>blueDark</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>blueMed</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>redLight</init_from>
</image>
<image id="material3-image" name="material3-image">
<init_from>darkGrey</init_from>
</image>
<image id="material4-image" name="material4-image">
<init_from>blueLight</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
<material id="material3ID" name="material3">
<instance_effect url="#material3-effect"/>
</material>
<material id="FrontColorNoCullingID" name="FrontColorNoCulling">
<instance_effect url="#FrontColorNoCulling-effect"/>
</material>
<material id="material4ID" name="material4">
<instance_effect url="#material4-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material3-effect" name="material3-effect">
<profile_COMMON>
<newparam sid="material3-image-surface">
<surface type="2D">
<init_from>material3-image</init_from>
</surface>
</newparam>
<newparam sid="material3-image-sampler">
<sampler2D>
<source>material3-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material3-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="FrontColorNoCulling-effect" name="FrontColorNoCulling-effect">
<profile_COMMON>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<color>1.000000 1.000000 1.000000 1</color>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material4-effect" name="material4-effect">
<profile_COMMON>
<newparam sid="material4-image-surface">
<surface type="2D">
<init_from>material4-image</init_from>
</surface>
</newparam>
<newparam sid="material4-image-sampler">
<sampler2D>
<source>material4-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material4-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="48">45.495000 -50.550000 50.000000 17.743050 -198.850000 76.000000 45.495000 -50.550000 76.000000 44.946900 47.400000 76.000000 44.946900 47.400000 51.600000 84.946900 47.400000 76.000000 44.946900 123.100000 30.200000 0.000000 47.400000 76.000000 -44.946900 47.400000 76.000000 -44.946900 47.400000 51.600000 0.000000 -12.550000 27.200000 -44.946900 123.100000 30.200000 -84.946900 47.400000 76.000000 -45.495000 -50.550000 76.000000 -45.495000 -50.550000 50.000000 -17.743050 -198.850000 76.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="16" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="45">0.982937 -0.183941 0.000000 0.999984 0.005596 -0.000000 0.000000 -1.000000 0.000000 0.506226 -0.234602 -0.829878 -0.000000 0.517650 0.855592 0.000000 1.000000 0.000000 -0.000000 0.376978 -0.926222 -0.000000 -0.272034 -0.962288 0.000000 0.517650 0.855592 0.000000 0.517650 0.855592 -0.999984 0.005596 -0.000000 -0.982937 -0.183941 0.000000 -0.459338 0.017077 -0.888098 -0.506226 -0.234602 -0.829878 0.459338 0.017077 -0.888098 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="15" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="106">4.131909 5.000000 19.219341 7.600000 4.131909 7.600000 -4.714775 7.600000 5.080378 5.000000 5.080378 7.600000 -4.714775 5.160000 -8.494690 7.600000 -4.494690 5.160000 -4.494690 7.600000 -7.872430 8.982479 -13.058818 0.773783 -6.190528 4.609287 4.494690 -0.121365 4.494690 -8.969037 8.494690 -0.121365 0.000000 -0.121365 -17.695630 29.921260 17.695630 29.921260 0.000000 29.921260 -17.695630 20.314961 17.695630 20.314961 4.494690 6.335499 -4.494690 6.335499 0.000000 -0.137029 -4.494690 -11.024220 4.494690 -3.157549 -4.494690 -3.157549 4.494690 -11.024220 -0.000000 -0.121365 -4.494690 -8.969037 -4.494690 -0.121365 -0.000000 -0.121365 -8.494690 -0.121365 4.494690 7.600000 4.494690 5.160000 8.494690 7.600000 -5.080378 7.600000 4.714775 5.160000 4.714775 7.600000 -5.080378 5.000000 -4.131909 7.600000 -19.219341 7.600000 -4.131909 5.000000 -1.254134 1.208853 4.569739 6.517183 -5.220535 6.169096 6.190528 4.609287 13.058818 0.773783 7.872430 8.982479 5.220535 6.169096 -4.569739 6.517183 1.254134 1.208853 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="53" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="6">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 3 1 3 0 1 4 2 1 5 0 1 4 3 1 3 4 1 6 13 10 37 9 10 38 8 10 39 9 10 38 13 10 37 14 10 40 13 11 41 15 11 42 14 11 43 </p>
</triangles>
<triangles material="material2" count="3">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>5 2 7 4 2 8 3 2 9 6 8 14 7 8 29 11 8 30 8 2 34 9 2 35 12 2 36 </p>
</triangles>
<triangles material="material1" count="8">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>5 3 10 6 3 11 4 3 12 3 4 13 6 4 14 5 4 15 6 4 14 3 4 13 7 4 16 8 9 31 11 9 30 7 9 32 11 9 30 8 9 31 12 9 33 10 12 44 9 12 45 14 12 46 9 13 47 11 13 48 12 13 49 0 14 50 4 14 51 10 14 52 </p>
</triangles>
<triangles material="FrontColorNoCulling" count="3">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>3 5 17 8 5 18 7 5 19 4 5 20 8 5 18 3 5 17 8 5 18 4 5 20 9 5 21 </p>
</triangles>
<triangles material="material3" count="1">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>4 6 22 9 6 23 10 6 24 </p>
</triangles>
<triangles material="material4" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>6 7 25 9 7 26 4 7 27 9 7 26 6 7 25 11 7 28 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="FrontColorNoCulling" target="#FrontColorNoCullingID"/>
<instance_material symbol="material3" target="#material3ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material4" target="#material4ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
-0.135092 -0.306368 0.942278 709.504888
-0.990833 0.041771 -0.128472 -74.935315
-0.000000 -0.950996 -0.309203 -172.308151
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["shipCLowXML"] = shipCLowXML;
shipDHighXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-09-19T11:19:08Z</created>
<modified>2008-09-19T11:19:08Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>yellowMed</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>darkGrey</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>yellowDark</init_from>
</image>
<image id="material3-image" name="material3-image">
<init_from>.black</init_from>
</image>
<image id="material4-image" name="material4-image">
<init_from>yellow</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
<material id="material3ID" name="material3">
<instance_effect url="#material3-effect"/>
</material>
<material id="material4ID" name="material4">
<instance_effect url="#material4-effect"/>
</material>
<material id="FrontColorNoCullingID" name="FrontColorNoCulling">
<instance_effect url="#FrontColorNoCulling-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material3-effect" name="material3-effect">
<profile_COMMON>
<newparam sid="material3-image-surface">
<surface type="2D">
<init_from>material3-image</init_from>
</surface>
</newparam>
<newparam sid="material3-image-sampler">
<sampler2D>
<source>material3-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material3-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material4-effect" name="material4-effect">
<profile_COMMON>
<newparam sid="material4-image-surface">
<surface type="2D">
<init_from>material4-image</init_from>
</surface>
</newparam>
<newparam sid="material4-image-sampler">
<sampler2D>
<source>material4-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material4-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="FrontColorNoCulling-effect" name="FrontColorNoCulling-effect">
<profile_COMMON>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<color>1.000000 1.000000 1.000000 1</color>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="36">-11.524623 23.612500 22.425000 -51.083758 -50.550000 35.000000 -23.049246 -111.525000 -0.650000 -49.653246 59.025000 8.750000 0.000000 75.837500 21.875000 -81.511690 92.650000 35.000000 81.511690 92.650000 35.000000 49.653246 59.025000 8.750000 11.524623 23.612500 22.425000 23.049246 -111.525000 -0.650000 0.000000 -219.550000 35.000000 51.083758 -50.550000 35.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="12" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="45">-0.594417 0.184347 -0.782742 0.129669 -0.232604 -0.963889 0.277403 -0.071305 -0.958104 0.000000 0.615360 -0.788246 -0.277403 -0.071305 -0.958104 0.000000 -0.010531 -0.999945 0.000000 0.168316 -0.985733 -0.000000 -0.313391 -0.949624 -0.926906 -0.280176 -0.249694 0.000000 0.000000 -1.000000 -0.719533 -0.152890 -0.677419 0.719533 -0.152890 -0.677419 -0.129669 -0.232604 -0.963889 0.594417 0.184347 -0.782742 0.926906 -0.280176 -0.249694 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="15" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="100">1.913908 2.804684 -6.341308 4.825263 -11.334746 -0.903057 -0.143119 -1.931652 1.462921 -7.066734 6.923269 2.790370 -7.344980 -1.182355 -4.480529 -5.764781 -1.999998 -0.990329 0.000000 7.323963 -8.151169 9.456862 -4.965325 5.191064 8.151169 9.456862 4.965325 5.191064 4.480529 -5.764781 7.344980 -1.182355 1.999998 -0.990329 -1.152462 -2.337504 -0.000000 -7.560293 1.152462 -2.337504 -1.152462 2.705011 2.304925 -11.004329 1.152462 2.705011 -2.304925 -11.004329 -2.304925 10.570312 2.304925 10.570312 -0.000000 21.945866 -3.360713 4.975315 -21.015896 4.975315 -10.008552 1.293699 20.111716 -19.901575 -32.091217 36.476378 -0.000000 -86.437008 32.091217 36.476378 10.756850 6.671267 -3.882856 6.671267 6.805619 3.102737 -20.111716 -19.901575 -10.756850 6.671267 -6.805619 3.102737 3.882856 6.671267 -6.923269 2.790370 -1.462921 -7.066734 0.143119 -1.931652 6.341308 4.825263 -1.913908 2.804684 11.334746 -0.903057 3.360713 4.975315 10.008552 1.293699 21.015896 4.975315 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="50" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="7">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 4 2 6 3 2 7 0 2 8 4 3 9 5 3 10 3 3 11 5 3 10 4 3 9 6 3 12 6 3 12 4 3 9 7 3 13 7 4 14 4 4 15 8 4 16 11 13 44 8 13 45 9 13 46 </p>
</triangles>
<triangles material="material4" count="5">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 1 3 3 1 4 1 1 5 8 5 17 4 5 18 0 5 19 1 8 27 10 8 28 2 8 29 11 12 41 7 12 42 8 12 43 11 14 47 9 14 48 10 14 49 </p>
</triangles>
<triangles material="material1" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 6 20 9 6 21 8 6 22 9 6 21 0 6 20 2 6 23 </p>
</triangles>
<triangles material="material3" count="1">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>9 7 24 2 7 25 10 7 26 </p>
</triangles>
<triangles material="FrontColorNoCulling" count="3">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>1 9 30 6 9 31 10 9 32 6 9 31 1 9 30 5 9 33 10 9 32 6 9 31 11 9 37 </p>
</triangles>
<triangles material="material2" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>5 10 34 1 10 35 3 10 36 6 11 38 7 11 39 11 11 40 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material4" target="#material4ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material3" target="#material3ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="FrontColorNoCulling" target="#FrontColorNoCullingID"/>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
-0.851206 -0.201024 0.484807 499.609885
-0.524832 0.326033 -0.786291 -750.529156
0.000000 -0.923738 -0.383025 -366.214676
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["shipDHighXML"] = shipDHighXML;
shipDLowXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-09-19T11:24:09Z</created>
<modified>2008-09-19T11:24:09Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>yellowDark</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>.yellow</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>yellowMed</init_from>
</image>
<image id="material3-image" name="material3-image">
<init_from>black</init_from>
</image>
<image id="material4-image" name="material4-image">
<init_from>darkGrey</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
<material id="FrontColorNoCullingID" name="FrontColorNoCulling">
<instance_effect url="#FrontColorNoCulling-effect"/>
</material>
<material id="material3ID" name="material3">
<instance_effect url="#material3-effect"/>
</material>
<material id="material4ID" name="material4">
<instance_effect url="#material4-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="FrontColorNoCulling-effect" name="FrontColorNoCulling-effect">
<profile_COMMON>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<color>1.000000 1.000000 1.000000 1</color>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material3-effect" name="material3-effect">
<profile_COMMON>
<newparam sid="material3-image-surface">
<surface type="2D">
<init_from>material3-image</init_from>
</surface>
</newparam>
<newparam sid="material3-image-sampler">
<sampler2D>
<source>material3-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material3-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material4-effect" name="material4-effect">
<profile_COMMON>
<newparam sid="material4-image-surface">
<surface type="2D">
<init_from>material4-image</init_from>
</surface>
</newparam>
<newparam sid="material4-image-sampler">
<sampler2D>
<source>material4-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material4-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="30">-81.511690 92.650000 35.000000 -51.083758 -50.550000 35.000000 -49.653246 59.025000 8.750000 81.511690 92.650000 35.000000 0.000000 -219.550000 35.000000 51.083758 -50.550000 35.000000 49.653246 59.025000 8.750000 0.000000 75.837500 21.875000 -23.049246 -111.525000 -0.650000 23.049246 -111.525000 -0.650000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="10" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="36">-0.719533 -0.152890 -0.677419 0.000000 0.000000 -1.000000 0.719533 -0.152890 -0.677419 0.000000 0.615360 -0.788246 0.319426 -0.224707 -0.920583 -0.614346 0.168254 -0.770889 -0.926906 -0.280176 -0.249694 -0.000000 -0.313391 -0.949624 -0.000000 0.119362 -0.992851 0.614346 0.168254 -0.770889 -0.319426 -0.224707 -0.920583 0.926906 -0.280176 -0.249694 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="12" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="80">10.756850 6.671267 -3.882856 6.671267 6.805619 3.102737 -32.091217 36.476378 20.111716 -19.901575 32.091217 36.476378 -0.000000 -86.437008 -20.111716 -19.901575 -10.756850 6.671267 -6.805619 3.102737 3.882856 6.671267 8.151169 9.456862 0.000000 7.323963 4.965325 5.191064 -8.151169 9.456862 -4.965325 5.191064 -6.202720 -3.162583 -1.970753 -6.523262 7.073650 0.198096 7.314393 2.937638 -6.224822 4.998175 -11.365229 -0.598636 -3.360713 4.975315 -21.015896 4.975315 -10.008552 1.293699 -2.304925 10.570312 2.304925 10.570312 -0.000000 21.945866 2.304925 -11.080527 0.000000 7.790637 -2.304925 -11.080527 6.224822 4.998175 -7.314393 2.937638 11.365229 -0.598636 -7.073650 0.198096 1.970753 -6.523262 6.202720 -3.162583 3.360713 4.975315 10.008552 1.293699 21.015896 4.975315 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="40" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 3 2 8 6 2 9 5 2 10 </p>
</triangles>
<triangles material="FrontColorNoCulling" count="3">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>3 1 3 1 1 4 0 1 5 1 1 4 3 1 3 4 1 6 4 1 6 3 1 3 5 1 7 </p>
</triangles>
<triangles material="material2" count="5">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>3 3 11 7 3 12 6 3 13 0 3 14 7 3 12 3 3 11 7 3 12 0 3 14 2 3 15 7 5 19 1 5 20 8 5 21 5 9 31 7 9 32 9 9 33 </p>
</triangles>
<triangles material="material1" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>7 4 16 2 4 17 1 4 18 1 6 22 4 6 23 8 6 24 5 10 34 6 10 35 7 10 36 5 11 37 9 11 38 4 11 39 </p>
</triangles>
<triangles material="material3" count="1">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>9 7 25 8 7 26 4 7 27 </p>
</triangles>
<triangles material="material4" count="1">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>9 8 28 7 8 29 8 8 30 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="FrontColorNoCulling" target="#FrontColorNoCullingID"/>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material3" target="#material3ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material4" target="#material4ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.949875 0.111851 -0.291935 -291.146412
0.312629 -0.339843 0.887000 861.879808
0.000000 -0.933807 -0.357776 -334.775393
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["shipDLowXML"] = shipDLowXML;
grandstandXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-09-19T12:48:02Z</created>
<modified>2008-09-19T12:48:02Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>darkGrey</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>greyStripes</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>lightGrey</init_from>
</image>
<image id="material3-image" name="material3-image">
<init_from>black</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
<material id="material3ID" name="material3">
<instance_effect url="#material3-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material3-effect" name="material3-effect">
<profile_COMMON>
<newparam sid="material3-image-surface">
<surface type="2D">
<init_from>material3-image</init_from>
</surface>
</newparam>
<newparam sid="material3-image-sampler">
<sampler2D>
<source>material3-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material3-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="48">4000.000000 2000.000000 2000.000000 4000.000000 -2000.000000 0.000000 4000.000000 -2000.000000 500.000000 4000.000000 2000.000000 0.000000 -4000.000000 -2000.000000 500.000000 -4000.000000 -2000.000000 0.000000 -4000.000000 2000.000000 0.000000 -4000.000000 2000.000000 2000.000000 -3500.000000 2000.000000 2000.000000 -3500.000000 -2000.000000 500.000000 -3500.000000 -666.666667 500.000000 -3500.000000 2000.000000 1500.000000 3500.000000 2000.000000 1500.000000 3500.000000 -666.666667 500.000000 3500.000000 2000.000000 2000.000000 3500.000000 -2000.000000 500.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="16" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="24">1.000000 0.000000 0.000000 0.000000 -1.000000 0.000000 -1.000000 0.000000 0.000000 0.000000 -0.351123 0.936329 0.000000 -0.351123 0.936329 -1.000000 0.000000 0.000000 0.000000 -0.351123 0.936329 0.000000 -0.000000 1.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="8" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="68">-200.000000 200.000000 200.000000 0.000000 200.000000 50.000000 -200.000000 0.000000 -3.999991 0.291807 4.000009 0.791807 -3.999991 0.791807 4.000009 0.291807 -200.000000 50.000000 200.000000 200.000000 350.000000 257.490524 400.000000 -169.709663 400.000000 257.490524 350.000000 -169.709663 66.666667 50.000000 -200.000000 150.000000 -3.515441 2.416950 3.484559 -0.431051 3.484559 2.416950 -3.515441 -0.431051 200.000000 200.000000 -66.666667 50.000000 200.000000 150.000000 -200.000000 50.000000 -350.000000 257.490524 -400.000000 -169.709663 -350.000000 -169.709663 -400.000000 257.490524 3.500009 0.791807 -3.499991 0.791807 3.477032 -1.975372 -3.522968 -0.642039 -3.522968 -1.975372 3.477032 -0.642039 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="34" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 6 2 1 4 2 8 5 2 3 4 2 8 6 2 1 7 2 9 </p>
</triangles>
<triangles material="material1" count="8">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>1 1 4 4 1 5 2 1 6 4 1 5 1 1 4 5 1 7 12 4 16 10 4 17 11 4 18 10 4 17 12 4 16 13 4 19 2 1 6 9 1 28 15 1 29 2 1 6 4 1 5 9 1 28 9 7 30 13 7 31 15 7 32 13 7 31 9 7 30 10 7 33 </p>
</triangles>
<triangles material="material2" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>8 3 10 4 3 11 7 3 12 4 3 11 8 3 10 9 3 13 14 6 24 2 6 25 15 6 26 2 6 25 14 6 24 0 6 27 </p>
</triangles>
<triangles material="material3" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>8 0 0 10 0 14 9 0 2 10 0 14 8 0 0 11 0 15 14 5 20 13 5 21 12 5 22 13 5 21 14 5 20 15 5 23 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material3" target="#material3ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.964228 0.104305 -0.243692 -3377.051110
-0.265076 0.379415 -0.886442 -14266.915119
0.000000 0.919328 0.393491 6387.609947
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["grandstandXML"] = grandstandXML;
diagonalHighXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-10-03T13:15:56Z</created>
<modified>2008-10-03T13:15:56Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>magenta</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>yellow</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>lightGrey</init_from>
</image>
<image id="material3-image" name="material3-image">
<init_from>darkGrey</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
<material id="material3ID" name="material3">
<instance_effect url="#material3-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material3-effect" name="material3-effect">
<profile_COMMON>
<newparam sid="material3-image-surface">
<surface type="2D">
<init_from>material3-image</init_from>
</surface>
</newparam>
<newparam sid="material3-image-sampler">
<sampler2D>
<source>material3-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material3-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="96">292.890700 1707.104262 50.000000 -126.923928 1126.921409 50.000000 -207.108041 1207.105522 50.000000 373.074813 1626.920150 50.000000 -65.686684 1065.684165 -0.000000 434.312056 1565.682906 -0.000000 -565.685425 565.685425 -0.000000 -626.922669 626.922669 50.000000 -1065.684165 65.686684 -0.000000 -1126.921409 126.923928 50.000000 -1565.682906 -434.312056 -0.000000 -1626.920150 -373.074813 50.000000 -1207.105522 207.108041 50.000000 -1707.104262 -292.890700 50.000000 -707.106781 707.106781 50.000000 -999.997481 -999.997481 -0.000000 -499.998741 -499.998741 -0.000000 -434.312056 -1565.682906 -0.000000 65.686684 -1065.684165 -0.000000 -373.074813 -1626.920150 50.000000 126.923928 -1126.921409 50.000000 565.685425 -565.685425 -0.000000 626.922669 -626.922669 50.000000 1065.684165 -65.686684 -0.000000 1126.921409 -126.923928 50.000000 1565.682906 434.312056 -0.000000 1626.920150 373.074813 50.000000 1207.105522 -207.108041 50.000000 1707.104262 292.890700 50.000000 707.106781 -707.106781 50.000000 207.108041 -1207.105522 50.000000 -292.890700 -1707.104262 50.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="32" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="27">0.000000 -0.000000 1.000000 0.353553 -0.353553 0.866025 0.000000 -0.000000 1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 1.000000 -0.353553 0.353553 0.866025 -0.353553 0.353553 0.866025 -0.000000 0.000000 1.000000 -0.000000 0.000000 1.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="9" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="100">-29.289070 170.710426 12.692393 112.692141 20.710804 120.710552 -37.307481 162.692015 -141.421000 79.282032 -70.710500 69.282032 -70.710500 79.282032 -141.421000 69.282032 0.000000 69.282032 0.000000 79.282032 70.710500 69.282032 70.710500 79.282032 141.421000 69.282032 141.421000 79.282032 162.692015 -37.307481 120.710552 20.710804 112.692141 12.692393 170.710426 -29.289070 70.710678 70.710678 62.692267 62.692267 106.568417 6.568668 99.999748 -99.999748 156.568291 -43.431206 49.999874 -49.999874 43.431206 -156.568291 -6.568668 -106.568417 -70.710500 69.282032 -141.421000 79.282032 -141.421000 69.282032 -70.710500 79.282032 -0.000000 69.282032 -70.710500 79.282032 -70.710500 69.282032 -0.000000 79.282032 70.710500 69.282032 -0.000000 79.282032 -0.000000 69.282032 70.710500 79.282032 141.421000 69.282032 141.421000 79.282032 -162.692015 37.307481 -120.710552 -20.710804 -112.692141 -12.692393 -170.710426 29.289070 -70.710678 -70.710678 -62.692267 -62.692267 -20.710804 -120.710552 -12.692393 -112.692141 29.289070 -170.710426 37.307481 -162.692015 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="50" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="16">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 11 2 14 12 2 15 9 2 16 12 2 15 11 2 14 13 2 17 14 2 18 9 2 16 12 2 15 9 2 16 14 2 18 7 2 19 2 3 2 7 3 19 14 3 18 7 3 19 2 3 2 1 3 1 26 4 40 27 4 41 24 4 42 27 4 41 26 4 40 28 4 43 29 7 44 24 7 42 27 7 41 24 7 42 29 7 44 22 7 45 30 8 46 22 8 45 29 8 44 22 8 45 30 8 46 20 8 47 31 8 48 20 8 47 30 8 46 20 8 47 31 8 48 19 8 49 </p>
</triangles>
<triangles material="material1" count="8">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>3 1 4 4 1 5 1 1 6 4 1 5 3 1 4 5 1 7 8 1 10 7 1 9 6 1 8 7 1 9 8 1 10 9 1 11 21 6 30 20 6 31 18 6 32 20 6 31 21 6 30 22 6 33 25 6 38 24 6 37 23 6 34 24 6 37 25 6 38 26 6 39 </p>
</triangles>
<triangles material="material2" count="8">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>6 1 8 1 1 6 4 1 5 1 1 6 6 1 8 7 1 9 10 1 12 9 1 11 8 1 10 9 1 11 10 1 12 11 1 13 18 5 26 19 5 27 17 5 28 19 5 27 18 5 26 20 5 29 23 5 34 22 5 35 21 5 36 22 5 35 23 5 34 24 5 37 </p>
</triangles>
<triangles material="material3" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>8 4 20 15 4 21 10 4 22 15 4 21 8 4 20 16 4 23 16 4 23 17 4 24 15 4 21 17 4 24 16 4 23 18 4 25 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material3" target="#material3ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.998843 -0.045366 0.015978 598.922718
0.048098 0.942115 -0.331822 -2365.255290
0.000000 0.332207 0.943207 7040.688244
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["diagonalHighXML"] = diagonalHighXML;
diagonalMedXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-10-03T13:19:41Z</created>
<modified>2008-10-03T13:19:41Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>yellowAndGrey</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>magenta</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>darkGrey</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="42">373.074813 1626.920150 50.000000 -1565.682906 -434.312056 -0.000000 -1626.920150 -373.074813 50.000000 -1065.684165 65.686684 -0.000000 434.312056 1565.682906 -0.000000 -434.312056 -1565.682906 -0.000000 65.686684 -1065.684165 -0.000000 -373.074813 -1626.920150 50.000000 1626.920150 373.074813 50.000000 1565.682906 434.312056 -0.000000 -292.890700 -1707.104262 50.000000 1707.104262 292.890700 50.000000 292.890700 1707.104262 50.000000 -1707.104262 -292.890700 50.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="14" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="15">0.353553 -0.353553 0.866025 0.000000 0.000000 1.000000 -0.353553 0.353553 0.866025 -0.000000 0.000000 1.000000 0.000000 -0.000000 1.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="5" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="44">-1.305490 -0.508793 -1.105485 1.491209 -1.305485 1.491209 -1.105486 0.991208 -1.105490 -0.508793 106.568417 6.568668 43.431206 -156.568291 156.568291 -43.431206 -6.568668 -106.568417 2.381200 0.993394 2.581200 1.493394 2.381200 1.493394 2.581199 -0.506606 2.381199 -0.506606 -162.692015 37.307481 29.289070 -170.710426 37.307481 -162.692015 -170.710426 29.289070 162.692015 -37.307481 -29.289070 170.710426 -37.307481 162.692015 170.710426 -29.289070 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="22" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="6">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 3 0 3 0 0 0 4 0 4 6 2 9 7 2 10 5 2 11 7 2 10 6 2 9 8 2 12 8 2 12 6 2 9 9 2 13 </p>
</triangles>
<triangles material="material2" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>3 1 5 5 1 6 1 1 7 5 1 6 3 1 5 6 1 8 </p>
</triangles>
<triangles material="material1" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>8 3 14 10 3 15 7 3 16 10 3 15 8 3 14 11 3 17 2 4 18 12 4 19 0 4 20 12 4 19 2 4 18 13 4 21 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.999570 -0.017597 0.023439 1106.798959
0.029310 0.600141 -0.799357 -5239.577629
0.000000 0.799701 0.600399 4142.090268
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["diagonalMedXML"] = diagonalMedXML;
diagonalLowXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-10-03T13:24:19Z</created>
<modified>2008-10-03T13:24:19Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>lightGrey</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="12">292.890700 1707.104262 50.000000 -292.890700 -1707.104262 50.000000 -1707.104262 -292.890700 50.000000 1707.104262 292.890700 50.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="4" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="3">0.000000 -0.000000 1.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="1" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="8">1.000000 1.000000 -0.000000 0.000000 1.000000 -0.000000 -0.000000 1.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="4" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.999570 -0.017597 0.023439 360.910171
0.029310 0.600141 -0.799357 -6283.324842
-0.000000 0.799701 0.600399 5420.121655
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["diagonalLowXML"] = diagonalLowXML;
sToDRightHighXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-10-03T12:39:16Z</created>
<modified>2008-10-03T12:39:16Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>lightGrey</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>magenta</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>darkGrey</init_from>
</image>
<image id="material3-image" name="material3-image">
<init_from>yellow</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
<material id="material3ID" name="material3">
<instance_effect url="#material3-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material3-effect" name="material3-effect">
<profile_COMMON>
<newparam sid="material3-image-surface">
<surface type="2D">
<init_from>material3-image</init_from>
</surface>
</newparam>
<newparam sid="material3-image-sampler">
<sampler2D>
<source>material3-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material3-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="120">-800.000000 -500.000000 -0.000000 -886.602540 -1000.000000 50.000000 -886.602540 -500.000000 50.000000 -800.000000 -1000.000000 -0.000000 0.000000 -500.000000 -0.000000 0.000000 -1000.000000 -0.000000 800.000000 -500.000000 0.000000 800.000000 -1000.000000 -0.000000 886.602540 -367.242797 50.000000 800.000000 -331.370850 0.000000 1182.842712 51.471863 0.000000 1256.762604 2.917267 50.000000 1195.525361 64.154511 0.000000 1565.685425 434.314575 0.000000 1626.922669 373.077331 50.000000 1336.946717 -77.266845 50.000000 1707.106781 292.893219 50.000000 1000.000000 -414.213562 50.000000 886.602540 -1000.000000 50.000000 1000.000000 -1000.000000 50.000000 -1000.000000 -1000.000000 50.000000 -1000.000000 -500.000000 50.000000 -1000.000000 -42.893219 50.000000 -886.602540 -42.893219 50.000000 -886.602540 367.242797 50.000000 -1000.000000 414.213562 50.000000 -676.776695 737.436867 50.000000 -596.592583 657.252754 50.000000 -353.553391 1060.660172 50.000000 -273.369278 980.476059 50.000000 -30.330086 1383.883476 50.000000 49.854027 1303.699364 50.000000 292.893219 1707.106781 50.000000 373.077331 1626.922669 50.000000 111.091270 1242.462120 0.000000 434.314575 1565.685425 0.000000 -212.132034 919.238816 0.000000 -535.355339 596.015511 0.000000 -800.000000 331.370850 0.000000 -800.000000 -42.893219 0.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="40" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="63">0.500000 0.000000 0.866025 0.000000 0.000000 1.000000 -0.000000 -0.000000 1.000000 -0.500000 -0.000000 0.866025 -0.353553 0.353553 0.866025 -0.353553 0.353553 0.866025 0.000000 -0.000000 1.000000 0.000000 -0.000000 1.000000 -0.000000 -0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 -0.000000 1.000000 -0.000000 -0.000000 1.000000 -0.000000 -0.000000 1.000000 -0.000000 0.000000 1.000000 -0.000000 0.000000 1.000000 0.353553 -0.353553 0.866025 0.353553 -0.353553 0.866025 0.353553 -0.353553 0.866025 0.353553 -0.353553 0.866025 0.500000 -0.000000 0.866025 0.500000 -0.000000 0.866025 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="21" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="156">50.000000 69.282032 100.000000 79.282032 50.000000 79.282032 100.000000 69.282032 0.000000 -50.000000 80.000000 -100.000000 80.000000 -50.000000 0.000000 -100.000000 -80.000000 -50.000000 0.000000 -100.000000 0.000000 -50.000000 -80.000000 -100.000000 -50.000000 69.282032 -36.724280 79.282032 -100.000000 69.282032 -33.137085 69.282032 87.279221 69.282032 36.724280 79.282032 33.137085 69.282032 89.072818 79.282032 89.072818 69.282032 141.421356 69.282032 89.072818 79.282032 89.072818 69.282032 141.421356 79.282032 -162.692267 37.307733 -133.694672 -7.726685 -125.676260 0.291727 -170.710678 29.289322 -100.000000 -41.421356 -125.676260 0.291727 -133.694672 -7.726685 -88.660254 -36.724280 -88.660254 -100.000000 -100.000000 -100.000000 -100.000000 79.282032 100.000000 -100.000000 88.660254 -50.000000 88.660254 -100.000000 100.000000 -50.000000 100.000000 -4.289322 88.660254 -4.289322 88.660254 36.724280 100.000000 41.421356 67.677670 73.743687 59.659258 65.725275 35.355339 106.066017 27.336928 98.047606 3.033009 138.388348 -4.985403 130.369936 -29.289322 170.710678 -4.985403 130.369936 3.033009 138.388348 -37.307733 162.692267 -141.421356 79.282032 -95.710678 69.282032 -95.710678 79.282032 -141.421356 69.282032 -50.000000 69.282032 -95.710678 79.282032 -95.710678 69.282032 -50.000000 79.282032 -4.289322 69.282032 -50.000000 79.282032 -50.000000 69.282032 -4.289322 79.282032 33.137085 69.282032 -4.289322 79.282032 -4.289322 69.282032 36.724280 79.282032 -33.137085 69.282032 4.289322 79.282032 -36.724280 79.282032 4.289322 69.282032 4.289322 69.282032 50.000000 79.282032 4.289322 79.282032 50.000000 69.282032 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="78" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="14">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 6 3 12 8 3 13 7 3 14 8 3 13 6 3 12 9 3 15 10 4 16 8 4 17 9 4 18 8 4 17 10 4 16 11 4 19 11 4 19 10 4 16 12 4 20 7 3 14 8 3 13 18 3 35 36 16 58 31 16 59 34 16 60 31 16 59 36 16 58 29 16 61 38 18 66 27 18 67 37 18 68 27 18 67 38 18 66 24 18 69 38 19 70 23 19 71 24 19 72 23 19 71 38 19 70 39 19 73 </p>
</triangles>
<triangles material="material2" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>4 1 4 3 1 5 0 1 6 3 1 5 4 1 4 5 1 7 6 2 8 5 2 9 4 2 10 5 2 9 6 2 8 7 2 11 </p>
</triangles>
<triangles material="material3" count="8">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>13 5 21 11 5 22 12 5 23 11 5 22 13 5 21 14 5 24 33 15 54 34 15 55 31 15 56 34 15 55 33 15 54 35 15 57 37 17 62 29 17 63 36 17 64 29 17 63 37 17 62 27 17 65 39 20 74 2 20 75 23 20 76 2 20 75 39 20 74 0 20 77 </p>
</triangles>
<triangles material="material1" count="20">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>14 6 25 15 6 26 11 6 27 15 6 26 14 6 25 16 6 28 17 7 29 11 7 30 15 7 31 11 7 30 17 7 29 8 7 32 17 8 29 18 8 33 8 8 32 18 8 33 17 8 29 19 8 34 20 9 36 2 9 37 1 9 38 2 9 37 20 9 36 21 9 39 22 10 40 2 10 37 21 10 39 2 10 37 22 10 40 23 10 41 22 1 40 24 1 42 23 1 41 24 1 42 22 1 40 25 1 43 26 11 44 24 11 42 25 11 43 24 11 42 26 11 44 27 11 45 28 12 46 27 12 45 26 12 44 27 12 45 28 12 46 29 12 47 30 13 48 29 13 47 28 13 46 29 13 47 30 13 48 31 13 49 32 14 50 31 14 51 30 14 52 31 14 51 32 14 50 33 14 53 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material3" target="#material3ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.999977 -0.005872 0.003397 346.721236
0.006784 0.865572 -0.500739 -2175.544856
0.000000 0.500750 0.865592 4167.548071
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["sToDRightHighXML"] = sToDRightHighXML;
sToDRightMedXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-10-03T10:40:44Z</created>
<modified>2008-10-03T10:40:44Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>yellowAndGrey</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>magenta</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>darkGrey</init_from>
</image>
<image id="material3-image" name="material3-image">
<init_from>lightGrey</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
<material id="material3ID" name="material3">
<instance_effect url="#material3-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material3-effect" name="material3-effect">
<profile_COMMON>
<newparam sid="material3-image-surface">
<surface type="2D">
<init_from>material3-image</init_from>
</surface>
</newparam>
<newparam sid="material3-image-sampler">
<sampler2D>
<source>material3-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material3-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="60">-800.000000 331.370850 0.000000 -886.602540 -1000.000000 50.000000 -886.602540 367.242797 50.000000 -800.000000 -1000.000000 -0.000000 -800.000000 -500.000000 -0.000000 800.000000 -500.000000 0.000000 800.000000 -1000.000000 -0.000000 886.602540 -367.242797 50.000000 800.000000 -331.370850 0.000000 1565.685425 434.314575 0.000000 1626.922669 373.077331 50.000000 1000.000000 -414.213562 50.000000 1707.106781 292.893219 50.000000 886.602540 -1000.000000 50.000000 1000.000000 -1000.000000 50.000000 -1000.000000 414.213562 50.000000 -1000.000000 -1000.000000 50.000000 292.893219 1707.106781 50.000000 373.077331 1626.922669 50.000000 434.314575 1565.685425 0.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="20" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="27">0.500000 -0.000000 0.866025 -0.000000 -0.000000 1.000000 -0.500000 -0.000000 0.866025 -0.353553 0.353553 0.866025 0.000000 -0.000000 1.000000 -0.000000 -0.000000 1.000000 0.000000 -0.000000 1.000000 -0.000000 0.000000 1.000000 0.353553 -0.353553 0.866025 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="9" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="68">3.107888 3.418939 3.310509 2.070120 3.310509 3.455281 3.107888 2.070120 3.107888 2.576673 -80.000000 -50.000000 80.000000 -100.000000 80.000000 -50.000000 -80.000000 -100.000000 -50.000000 69.282032 -36.724280 79.282032 -100.000000 69.282032 -33.137085 69.282032 10.303067 3.604156 10.466183 4.458042 10.303068 4.487298 10.466183 3.604156 -162.692267 37.307733 -100.000000 -41.421356 -88.660254 -36.724280 -170.710678 29.289322 -88.660254 -100.000000 -100.000000 -100.000000 -100.000000 79.282032 88.660254 -100.000000 100.000000 41.421356 88.660254 36.724280 100.000000 -100.000000 -29.289322 170.710678 -37.307733 162.692267 -2.216932 1.497728 -1.995609 3.429410 -2.216931 3.469106 -1.995610 1.497728 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="34" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="7">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 3 0 3 0 0 0 4 0 4 9 3 13 7 3 14 8 3 15 7 3 14 9 3 13 10 3 16 18 8 30 0 8 31 2 8 32 0 8 31 18 8 30 19 8 33 </p>
</triangles>
<triangles material="material2" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>5 1 5 3 1 6 4 1 7 3 1 6 5 1 5 6 1 8 </p>
</triangles>
<triangles material="material3" count="3">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>5 2 9 7 2 10 6 2 11 7 2 10 5 2 9 8 2 12 6 2 11 7 2 10 13 2 23 </p>
</triangles>
<triangles material="material1" count="8">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>10 4 17 11 4 18 7 4 19 11 4 18 10 4 17 12 4 20 11 5 18 13 5 21 7 5 19 13 5 21 11 5 18 14 5 22 1 6 24 15 6 25 2 6 26 15 6 25 1 6 24 16 6 27 17 7 28 2 7 26 15 7 25 2 7 26 17 7 28 18 7 29 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material3" target="#material3ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.985015 0.119436 -0.124424 -259.228448
-0.172471 0.682121 -0.710609 -3170.119818
0.000000 0.721420 0.692498 3346.574845
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["sToDRightMedXML"] = sToDRightMedXML;
sToDRightLowXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-10-03T10:49:56Z</created>
<modified>2008-10-03T10:49:56Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>magenta</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="18">-1000.000000 414.213562 50.000000 -886.602540 -1000.000000 50.000000 -1000.000000 -1000.000000 50.000000 -886.602540 367.242797 50.000000 292.893219 1707.106781 50.000000 373.077331 1626.922669 50.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="6" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="6">0.000000 -0.000000 1.000000 -0.000000 0.000000 1.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="2" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="12">100.000000 41.421356 88.660254 -100.000000 100.000000 -100.000000 88.660254 36.724280 -29.289322 170.710678 -37.307733 162.692267 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="6" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 4 1 4 3 1 3 0 1 0 3 1 3 4 1 4 5 1 5 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.985015 0.119436 -0.124424 -259.228448
-0.172471 0.682121 -0.710609 -3170.119818
0.000000 0.721420 0.692498 3346.574845
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["sToDRightLowXML"] = sToDRightLowXML;
sToDLeftHighXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-10-03T12:38:46Z</created>
<modified>2008-10-03T12:38:46Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>lightGrey</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>magenta</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>darkGrey</init_from>
</image>
<image id="material3-image" name="material3-image">
<init_from>yellow</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
<material id="material3ID" name="material3">
<instance_effect url="#material3-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material3-effect" name="material3-effect">
<profile_COMMON>
<newparam sid="material3-image-surface">
<surface type="2D">
<init_from>material3-image</init_from>
</surface>
</newparam>
<newparam sid="material3-image-sampler">
<sampler2D>
<source>material3-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material3-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="120">886.602540 -500.000000 50.000000 800.000000 -1000.000000 -0.000000 800.000000 -500.000000 -0.000000 886.602540 -1000.000000 50.000000 1000.000000 -500.000000 50.000000 1000.000000 -1000.000000 50.000000 1000.000000 -42.893219 50.000000 886.602540 -42.893219 50.000000 800.000000 -42.893219 -0.000000 886.602540 367.242797 50.000000 800.000000 331.370850 -0.000000 596.592583 657.252754 50.000000 535.355339 596.015511 -0.000000 273.369278 980.476059 50.000000 212.132034 919.238816 -0.000000 -49.854027 1303.699364 50.000000 -111.091270 1242.462120 -0.000000 -373.077331 1626.922669 50.000000 -434.314575 1565.685425 -0.000000 -292.893219 1707.106781 50.000000 30.330086 1383.883476 50.000000 353.553391 1060.660172 50.000000 676.776695 737.436867 50.000000 1000.000000 414.213562 50.000000 0.000000 -1000.000000 -0.000000 0.000000 -500.000000 -0.000000 -800.000000 -1000.000000 -0.000000 -800.000000 -500.000000 -0.000000 -800.000000 -331.370850 -0.000000 -886.602540 -1000.000000 50.000000 -886.602540 -367.242797 50.000000 -1000.000000 -1000.000000 50.000000 -1000.000000 -414.213562 50.000000 -1256.762604 2.917267 50.000000 -1336.946717 -77.266845 50.000000 -1626.922669 373.077331 50.000000 -1707.106781 292.893219 50.000000 -1565.685425 434.314575 -0.000000 -1195.525361 64.154511 -0.000000 -1182.842712 51.471863 -0.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="40" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="30">-0.500000 0.000000 0.866025 0.000000 0.000000 1.000000 -0.500000 -0.000000 0.866025 -0.353553 -0.353553 0.866025 -0.353553 -0.353553 0.866025 -0.353553 -0.353553 0.866025 -0.353553 -0.353553 0.866025 0.500000 0.000000 0.866025 0.353553 0.353553 0.866025 0.353553 0.353553 0.866025 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="10" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="144">-50.000000 79.282032 -100.000000 69.282032 -50.000000 69.282032 -100.000000 79.282032 -100.000000 -50.000000 -88.660254 -100.000000 -88.660254 -50.000000 -100.000000 -100.000000 -100.000000 -4.289322 -88.660254 -4.289322 -50.000000 69.282032 -4.289322 79.282032 -50.000000 79.282032 -4.289322 69.282032 -4.289322 69.282032 36.724280 79.282032 -4.289322 79.282032 33.137085 69.282032 -33.137085 69.282032 4.289322 79.282032 -36.724280 79.282032 4.289322 69.282032 4.289322 69.282032 50.000000 79.282032 4.289322 79.282032 50.000000 69.282032 50.000000 69.282032 95.710678 79.282032 50.000000 79.282032 95.710678 69.282032 95.710678 69.282032 141.421356 79.282032 95.710678 79.282032 141.421356 69.282032 29.289322 170.710678 4.985403 130.369936 37.307733 162.692267 -3.033009 138.388348 -27.336928 98.047606 -35.355339 106.066017 -59.659258 65.725275 -67.677670 73.743687 -88.660254 36.724280 -100.000000 41.421356 0.000000 -100.000000 -80.000000 -50.000000 -80.000000 -100.000000 0.000000 -50.000000 80.000000 -100.000000 80.000000 -50.000000 100.000000 69.282032 33.137085 69.282032 50.000000 69.282032 100.000000 79.282032 36.724280 79.282032 100.000000 -100.000000 88.660254 -36.724280 88.660254 -100.000000 100.000000 -41.421356 125.676260 0.291727 133.694672 -7.726685 162.692267 37.307733 170.710678 29.289322 -141.421356 69.282032 -89.072818 79.282032 -141.421356 79.282032 -89.072818 69.282032 -89.072818 69.282032 -36.724280 79.282032 -89.072818 79.282032 -87.279221 69.282032 -33.137085 69.282032 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="72" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="14">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 8 2 14 9 2 15 7 2 16 9 2 15 8 2 14 10 2 17 10 3 18 11 3 19 9 3 20 11 3 19 10 3 18 12 3 21 14 5 26 15 5 27 13 5 28 15 5 27 14 5 26 16 5 29 26 7 50 28 7 51 27 7 52 29 7 53 28 7 51 26 7 50 28 7 51 29 7 53 30 7 54 38 9 67 30 9 68 33 9 69 30 9 68 38 9 67 39 9 70 30 9 68 39 9 70 28 9 71 </p>
</triangles>
<triangles material="material1" count="20">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>4 1 4 3 1 5 0 1 6 3 1 5 4 1 4 5 1 7 0 1 6 6 1 8 4 1 4 6 1 8 0 1 6 7 1 9 19 1 34 15 1 35 17 1 36 15 1 35 19 1 34 20 1 37 20 1 37 13 1 38 15 1 35 13 1 38 20 1 37 21 1 39 21 1 39 11 1 40 13 1 38 11 1 40 21 1 39 22 1 41 22 1 41 9 1 42 11 1 40 9 1 42 22 1 41 23 1 43 23 1 43 7 1 9 9 1 42 7 1 9 23 1 43 6 1 8 31 1 55 30 1 56 29 1 57 30 1 56 31 1 55 32 1 58 32 1 58 33 1 59 30 1 56 33 1 59 32 1 58 34 1 60 34 1 60 35 1 61 33 1 59 35 1 61 34 1 60 36 1 62 </p>
</triangles>
<triangles material="material3" count="8">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>2 0 10 7 0 11 0 0 12 7 0 11 2 0 10 8 0 13 12 4 22 13 4 23 11 4 24 13 4 23 12 4 22 14 4 25 16 6 30 17 6 31 15 6 32 17 6 31 16 6 30 18 6 33 37 8 63 33 8 64 35 8 65 33 8 64 37 8 63 38 8 66 </p>
</triangles>
<triangles material="material2" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>24 1 44 2 1 45 1 1 46 2 1 45 24 1 44 25 1 47 26 1 48 25 1 47 24 1 44 25 1 47 26 1 48 27 1 49 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material3" target="#material3ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.996042 -0.061393 0.064269 702.511823
0.088880 0.688012 -0.720236 -4064.688651
0.000000 0.723098 0.690746 4904.658944
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["sToDLeftHighXML"] = sToDLeftHighXML;
sToDLeftMedXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-10-03T12:35:42Z</created>
<modified>2008-10-03T12:35:42Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>yellowAndGrey</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>magenta</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>darkGrey</init_from>
</image>
<image id="material3-image" name="material3-image">
<init_from>lightGrey</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
<material id="material3ID" name="material3">
<instance_effect url="#material3-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material3-effect" name="material3-effect">
<profile_COMMON>
<newparam sid="material3-image-surface">
<surface type="2D">
<init_from>material3-image</init_from>
</surface>
</newparam>
<newparam sid="material3-image-sampler">
<sampler2D>
<source>material3-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material3-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="60">886.602540 367.242797 50.000000 800.000000 -500.000000 -0.000000 800.000000 331.370850 -0.000000 800.000000 -1000.000000 -0.000000 886.602540 -1000.000000 50.000000 1000.000000 414.213562 50.000000 1000.000000 -1000.000000 50.000000 -292.893219 1707.106781 50.000000 -373.077331 1626.922669 50.000000 -434.314575 1565.685425 0.000000 -800.000000 -1000.000000 -0.000000 -800.000000 -500.000000 -0.000000 -800.000000 -331.370850 -0.000000 -886.602540 -1000.000000 50.000000 -886.602540 -367.242797 50.000000 -1000.000000 -1000.000000 50.000000 -1000.000000 -414.213562 50.000000 -1626.922669 373.077331 50.000000 -1707.106781 292.893219 50.000000 -1565.685425 434.314575 0.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="20" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="24">-0.500000 -0.000000 0.866025 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 -0.353553 -0.353553 0.866025 0.500000 -0.000000 0.866025 0.000000 -0.000000 1.000000 0.000000 -0.000000 1.000000 0.353553 0.353553 0.866025 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="8" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="68">17.805791 3.455281 17.603170 2.576672 17.603170 3.418939 17.603171 2.070120 17.805792 2.070120 -100.000000 41.421356 -88.660254 -100.000000 -88.660254 36.724280 -100.000000 -100.000000 29.289322 170.710678 37.307733 162.692267 -14.569349 10.688867 -14.790673 8.757183 -14.790672 10.728564 -14.569351 8.757183 80.000000 -100.000000 -80.000000 -50.000000 -80.000000 -100.000000 80.000000 -50.000000 100.000000 69.282032 33.137085 69.282032 50.000000 69.282032 100.000000 79.282032 36.724280 79.282032 100.000000 -100.000000 88.660254 -36.724280 88.660254 -100.000000 100.000000 -41.421356 162.692267 37.307733 170.710678 29.289322 1.036164 8.954410 1.199280 9.808296 1.199279 8.954410 1.036164 9.837552 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="34" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="7">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 3 0 3 0 0 0 4 0 4 2 3 11 8 3 12 0 3 13 8 3 12 2 3 11 9 3 14 19 7 30 14 7 31 17 7 32 14 7 31 19 7 30 12 7 33 </p>
</triangles>
<triangles material="material1" count="8">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>5 1 5 4 1 6 0 1 7 4 1 6 5 1 5 6 1 8 0 2 7 7 2 9 5 2 5 7 2 9 0 2 7 8 2 10 15 5 24 14 5 25 13 5 26 14 5 25 15 5 24 16 5 27 16 6 27 17 6 28 14 6 25 17 6 28 16 6 27 18 6 29 </p>
</triangles>
<triangles material="material2" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>10 1 15 1 1 16 3 1 17 1 1 16 10 1 15 11 1 18 </p>
</triangles>
<triangles material="material3" count="3">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>10 4 19 12 4 20 11 4 21 13 4 22 12 4 20 10 4 19 12 4 20 13 4 22 14 4 23 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material3" target="#material3ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.996738 0.058528 -0.055560 369.027175
-0.080699 0.722889 -0.686236 -4834.297418
0.000000 0.688481 0.725254 5723.847534
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["sToDLeftMedXML"] = sToDLeftMedXML;
sToDLeftLowXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-10-03T11:50:57Z</created>
<modified>2008-10-03T11:50:57Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>magenta</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="18">1000.000000 414.213562 50.000000 886.602540 -1000.000000 50.000000 886.602540 367.242797 50.000000 1000.000000 -1000.000000 50.000000 -292.893219 1707.106781 50.000000 -373.077331 1626.922669 50.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="6" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="6">-0.000000 -0.000000 1.000000 0.000000 0.000000 1.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="2" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="12">-100.000000 41.421356 -88.660254 -100.000000 -88.660254 36.724280 -100.000000 -100.000000 29.289322 170.710678 37.307733 162.692267 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="6" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="4">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 2 1 2 4 1 4 0 1 0 4 1 4 2 1 2 5 1 5 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.978113 -0.141370 0.152672 232.626560
0.208073 0.664555 -0.717686 -4057.752864
0.000000 0.733745 0.679425 4341.113745
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["sToDLeftLowXML"] = sToDLeftLowXML;
pyramidXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-10-16T12:45:18Z</created>
<modified>2008-10-16T12:45:18Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>yellowAndGrey</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>greyStripes</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="15">0.000000 0.000000 2000.000000 0.000000 -2000.000000 0.000000 -2000.000000 0.000000 0.000000 2000.000000 0.000000 0.000000 0.000000 2000.000000 0.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="5" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="12">-0.577350 -0.577350 0.577350 0.577350 -0.577350 0.577350 0.577350 0.577350 0.577350 -0.577350 0.577350 0.577350 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="4" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="18">0.000000 1.484539 -2.571297 -0.742270 2.571297 -0.742270 -1.285649 -0.742270 1.285649 -0.742270 -2.571297 -0.742270 2.571297 -0.742270 1.285649 -0.742270 -1.285649 -0.742270 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="9" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 4 2 5 3 2 6 0 2 0 </p>
</triangles>
<triangles material="material1" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>3 1 3 1 1 4 0 1 0 4 3 7 0 3 0 2 3 8 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.257652 -0.312251 0.914393 7564.241967
0.966238 0.083263 -0.243827 -1994.901600
0.000000 0.946344 0.323162 3143.007538
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["pyramidXML"] = pyramidXML;
towerXML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-10-29T12:47:55Z</created>
<modified>2008-10-29T12:47:55Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>greySquares1</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>greySquares2</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>greySquares3</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="18">2000.000000 0.000000 5000.000000 -1000.000000 1732.050808 0.000000 2000.000000 0.000000 0.000000 -1000.000000 1732.050808 5000.000000 -1000.000000 -1732.050808 5000.000000 -1000.000000 -1732.050808 0.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="6" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="9">0.500000 0.866025 0.000000 -1.000000 0.000000 0.000000 0.500000 -0.866025 0.000000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="3" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="16">0.866025 2.500000 -0.866025 0.000000 0.866025 0.000000 -0.866025 2.500000 0.866025 2.500000 -0.866025 0.000000 0.866025 0.000000 -0.866025 2.500000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="8" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 </p>
</triangles>
<triangles material="material2" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>4 1 3 1 1 2 3 1 0 1 1 2 4 1 3 5 1 1 </p>
</triangles>
<triangles material="material1" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>4 2 4 2 2 5 5 2 6 2 2 5 4 2 4 0 2 7 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
-0.081419 -0.372968 0.924265 10525.657512
0.996680 -0.030468 0.075504 866.787599
0.000000 0.927344 0.374211 6764.839584
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["towerXML"] = towerXML;
tower2XML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-10-29T13:11:35Z</created>
<modified>2008-10-29T13:11:35Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>redDark</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>darkGrey</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>redMed</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="21">-607.100000 -1056.550993 3732.600000 2000.000000 0.000000 0.000000 -1000.000000 -1732.050808 0.000000 1222.900000 0.000000 3732.600000 -1000.000000 1732.050808 0.000000 -607.100000 1056.550993 3732.600000 -607.100000 0.000000 3732.600000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="7" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="9">0.497313 -0.861371 0.103537 0.497313 0.861371 0.103537 -0.994506 0.000000 0.104683 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="3" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="26">0.958218 3.317484 -1.574592 -0.094124 1.574592 -0.094124 -0.962784 3.317484 1.059062 3.649232 -1.732051 -0.103537 1.732051 -0.103537 -1.054040 3.649232 0.000000 3.648538 1.732051 -0.104683 1.056551 3.648538 -1.056551 3.648538 -1.732051 -0.104683 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="13" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 </p>
</triangles>
<triangles material="material2" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>3 1 4 4 1 5 1 1 6 4 1 5 3 1 4 5 1 7 </p>
</triangles>
<triangles material="material1" count="3">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>6 2 8 4 2 9 5 2 10 0 2 11 4 2 9 6 2 8 4 2 9 0 2 11 2 2 12 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.249495 -0.525004 0.813710 8351.326375
0.968376 0.135263 -0.209647 -2162.868005
-0.000000 0.840283 0.542148 7607.925955
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["tower2XML"] = tower2XML;
tower3XML = <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<authoring_tool>Google SketchUp 6.4.112</authoring_tool>
</contributor>
<created>2008-10-29T13:11:35Z</created>
<modified>2008-10-29T13:11:35Z</modified>
<unit name="centimeters" meter="0.01"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images>
<image id="material0-image" name="material0-image">
<init_from>blueMed</init_from>
</image>
<image id="material1-image" name="material1-image">
<init_from>greenMed</init_from>
</image>
<image id="material2-image" name="material2-image">
<init_from>redMed</init_from>
</image>
</library_images>
<library_materials>
<material id="material0ID" name="material0">
<instance_effect url="#material0-effect"/>
</material>
<material id="material1ID" name="material1">
<instance_effect url="#material1-effect"/>
</material>
<material id="material2ID" name="material2">
<instance_effect url="#material2-effect"/>
</material>
</library_materials>
<library_effects>
<effect id="material0-effect" name="material0-effect">
<profile_COMMON>
<newparam sid="material0-image-surface">
<surface type="2D">
<init_from>material0-image</init_from>
</surface>
</newparam>
<newparam sid="material0-image-sampler">
<sampler2D>
<source>material0-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material0-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material1-effect" name="material1-effect">
<profile_COMMON>
<newparam sid="material1-image-surface">
<surface type="2D">
<init_from>material1-image</init_from>
</surface>
</newparam>
<newparam sid="material1-image-sampler">
<sampler2D>
<source>material1-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material1-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
<effect id="material2-effect" name="material2-effect">
<profile_COMMON>
<newparam sid="material2-image-surface">
<surface type="2D">
<init_from>material2-image</init_from>
</surface>
</newparam>
<newparam sid="material2-image-sampler">
<sampler2D>
<source>material2-image-surface</source>
</sampler2D>
</newparam>
<technique sid="COMMON">
<phong>
<emission>
<color>0.000000 0.000000 0.000000 1</color>
</emission>
<ambient>
<color>0.000000 0.000000 0.000000 1</color>
</ambient>
<diffuse>
<texture texture="material2-image-sampler" texcoord="UVSET0"/>
</diffuse>
<specular>
<color>0.330000 0.330000 0.330000 1</color>
</specular>
<shininess>
<float>20.000000</float>
</shininess>
<reflectivity>
<float>0.100000</float>
</reflectivity>
<transparent>
<color>1 1 1 1</color>
</transparent>
<transparency>
<float>0.000000</float>
</transparency>
</phong>
</technique>
<extra>
<technique profile="GOOGLEEARTH">
<double_sided>1</double_sided>
</technique>
</extra>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="mesh1-geometry" name="mesh1-geometry">
<mesh>
<source id="mesh1-geometry-position">
<float_array id="mesh1-geometry-position-array" count="21">-607.100000 -1056.550993 3732.600000 2000.000000 0.000000 0.000000 -1000.000000 -1732.050808 0.000000 1222.900000 0.000000 3732.600000 -1000.000000 1732.050808 0.000000 -607.100000 1056.550993 3732.600000 -607.100000 0.000000 3732.600000 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-position-array" count="7" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-normal">
<float_array id="mesh1-geometry-normal-array" count="9">0.497313 -0.861371 0.103537 0.497313 0.861371 0.103537 -0.994506 0.000000 0.104683 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-normal-array" count="3" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="mesh1-geometry-uv">
<float_array id="mesh1-geometry-uv-array" count="26">0.958218 3.317484 -1.574592 -0.094124 1.574592 -0.094124 -0.962784 3.317484 1.059062 3.649232 -1.732051 -0.103537 1.732051 -0.103537 -1.054040 3.649232 0.000000 3.648538 1.732051 -0.104683 1.056551 3.648538 -1.056551 3.648538 -1.732051 -0.104683 </float_array>
<technique_common>
<accessor source="#mesh1-geometry-uv-array" count="13" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="mesh1-geometry-vertex">
<input semantic="POSITION" source="#mesh1-geometry-position"/>
</vertices>
<triangles material="material0" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 </p>
</triangles>
<triangles material="material2" count="2">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>3 1 4 4 1 5 1 1 6 4 1 5 3 1 4 5 1 7 </p>
</triangles>
<triangles material="material1" count="3">
<input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0"/>
<input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1"/>
<input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0"/>
<p>6 2 8 4 2 9 5 2 10 0 2 11 4 2 9 6 2 8 4 2 9 0 2 11 2 2 12 </p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_cameras>
<camera id="Camera-camera" name="Camera-camera">
<optics>
<technique_common>
<perspective>
<xfov>46.666667</xfov>
<yfov>35.000000</yfov>
<znear>2.540000</znear>
<zfar>2540.000000</zfar>
</perspective>
</technique_common>
</optics>
</camera>
</library_cameras>
<library_visual_scenes>
<visual_scene id="SketchUpScene" name="SketchUpScene">
<node id="Model" name="Model">
<node id="mesh1" name="mesh1">
<instance_geometry url="#mesh1-geometry">
<bind_material>
<technique_common>
<instance_material symbol="material0" target="#material0ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material2" target="#material2ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
<instance_material symbol="material1" target="#material1ID">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</node>
<node id="Camera" name="Camera">
<matrix>
0.249495 -0.525004 0.813710 8351.326375
0.968376 0.135263 -0.209647 -2162.868005
-0.000000 0.840283 0.542148 7607.925955
0.000000 0.000000 0.000000 1.000000
</matrix>
<instance_camera url="#Camera-camera"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#SketchUpScene"/>
</scene>
</COLLADA>
;
xmlArray["tower3XML"] = tower3XML;
}
public function createCollisionObject(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):void{
var _local9:Sprite;
var _local10:Sprite;
var _local11:Point;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:*;
var _local19:*;
_arg8 = (_arg8 + 90);
_local9 = new Sprite();
stage.addChild(_local9);
_local10 = new Sprite();
_local10.x = _arg3;
_local10.y = _arg4;
_local9.addChild(_local10);
_local11 = new Point(_local10.x, _local10.y);
_local9.rotation = _arg8;
_local12 = (_arg1 + (_local10.localToGlobal(_local11).x / 2));
_local13 = (_arg2 + (_local10.localToGlobal(_local11).y / 2));
stage.removeChild(_local9);
_local14 = (_arg5 * scaleFactor);
_local15 = (_arg6 * scaleFactor);
_local16 = (_local12 * scaleFactor);
_local17 = ((levelContainer.height - _local13) * scaleFactor);
_local18 = new b2BodyDef();
_local19 = new b2BoxDef();
_local19.maskBits = 2;
_local19.extents.Set((_local14 / 2), (_local15 / 2));
_local19.friction = 0;
_local19.density = 0;
_local19.restitution = 0.95;
_local18.AddShape(_local19);
_local18.position.Set(_local16, -(_local17));
_local18.linearDamping = 0.07;
_local18.angularDamping = 0.02;
_local18.rotation = (((_arg8 + _arg7) * Math.PI) / 180);
m_world.CreateBody(_local18);
}
function frame3(){
stageAssets.visible = false;
}
public function fadeMenuIn():void{
menu = new menu_mc();
projectCanvas.addChild(menu);
menuTween = new Tween(menu, "alpha", None.easeNone, 0, 1, 1, true);
menuTween.addEventListener(TweenEvent.MOTION_FINISH, activateMenu);
}
public function showGameOverScreen():void{
gameRunning = false;
gameOverScreen = new gameOverScreen_mc();
projectCanvas.addChild(gameOverScreen);
gameOverScreen.cup1.visible = false;
gameOverScreen.cup2.visible = false;
displayGameOverMessages();
gameOverScreen.continueButton.addEventListener(MouseEvent.MOUSE_DOWN, removeGameOverScreen);
gameOverScreen.playAgain.addEventListener(MouseEvent.MOUSE_DOWN, playAgain);
}
public function loadShips():void{
var _local1:String;
var _local2:*;
var _local3:LibraryCollada;
_local2 = 1;
while (_local2 <= 4) {
if (_local2 == 1){
_local1 = "A";
};
if (_local2 == 2){
_local1 = "B";
};
if (_local2 == 3){
_local1 = "C";
};
if (_local2 == 4){
_local1 = "D";
};
_local3 = new LibraryCollada(xmlArray[(("ship" + _local1) + "HighXML")]);
shipHigh[_local1] = _local3;
shipHigh[_local1].scale = -0.0013;
scene.addChild(shipHigh[_local1]);
shipHigh[_local1].x = (5 + ((stage.stageWidth / 2) * scaleFactor));
shipHigh[_local1].z = -80;
if (_local1 == "A"){
shipHigh[_local1].y = (12 + 5);
};
if (_local1 == "B"){
shipHigh[_local1].y = (11 + 5);
shipHigh[_local1].scale = -0.0016;
};
if (_local1 == "C"){
shipHigh[_local1].y = (14 + 5);
};
if (_local1 == "D"){
shipHigh[_local1].y = (10 + 5);
};
if (_local1 != "A"){
shipHigh[_local1].visible = false;
};
_local2++;
};
playerShipLetter = "A";
}
public function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:SoundTransform;
var _local3:SoundTransform;
if (_arg1.keyCode == Keyboard.LEFT){
leftKeyDown = true;
};
if (_arg1.keyCode == Keyboard.RIGHT){
rightKeyDown = true;
};
if (_arg1.keyCode == Keyboard.UP){
upKeyDown = true;
if ((((soundOn == true)) && ((accelerateSoundPlaying == false)))){
accelerateSoundPlaying = true;
accelerateSoundChannel = accelerateSound.play(0, 1);
_local2 = new SoundTransform(0.3, 0);
accelerateSoundChannel.soundTransform = _local2;
constantSoundChannel.stop();
constantSoundChannel = constantSound.play(0, 10000);
_local3 = new SoundTransform(0, 0);
constantSoundChannel.soundTransform = _local3;
fadeInThrust = true;
fadeOutThrust = false;
};
};
if (_arg1.keyCode == Keyboard.DOWN){
downKeyDown = true;
};
}
public function updateFlares():void{
var _local1:Number;
var _local2:uint;
var _local3:String;
var _local4:Number;
_local1 = (flareX + background.sky1.x);
_local2 = 1;
while (_local2 <= 6) {
_local3 = ("f" + String(_local2));
flares[_local3].x = (((_local1 - ((_local1 * (_local2 - 1)) / 4)) + (stage.stageWidth / 2)) - (flares.f1.width / 2));
flares[_local3].y = (flareY + ((_local2 - 1) * 20));
_local4 = (Math.abs((flares[_local3].x - flares.f1.x)) / (stage.stageWidth / 2));
if (_local4 > 1){
_local4 = 1;
};
flares[_local3].alpha = ((1 - _local4) * 0.7);
_local2++;
};
}
public function swearFilter(_arg1:String):Boolean{
var _local2:Boolean;
var _local3:int;
_local2 = false;
_local3 = 0;
while (_local3 < swearList.length) {
if (_arg1.toUpperCase() == swearList[_local3].toUpperCase()){
_local2 = true;
};
_local3++;
};
return (_local2);
}
public function musicOver(_arg1:MouseEvent):void{
if (musicOn == true){
musicToggle.gotoAndStop("onOver");
} else {
musicToggle.gotoAndStop("offOver");
};
}
public function playAgain(_arg1:MouseEvent):void{
var _local2:*;
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2Vec2;
var _local6:b2Vec2;
submitSuccess = false;
gameOverScreen.continueButton.removeEventListener(MouseEvent.MOUSE_DOWN, removeGameOverScreen);
gameOverScreen.playAgain.removeEventListener(MouseEvent.MOUSE_DOWN, playAgain);
projectCanvas.removeChild(gameOverScreen);
_local2 = 1;
while (_local2 <= numberOfAIShips) {
aiShipArrayHigh[_local2].x = aiStartX[_local2];
aiShipArrayHigh[_local2].z = aiStartZ[_local2];
aiShipArrayHigh[_local2].rotationY = 0;
aiShipArrayHigh[_local2].yaw(0);
aiShipArrayLow[_local2].x = aiShipArrayHigh[_local2].x;
aiShipArrayLow[_local2].z = aiShipArrayHigh[_local2].z;
aiShipArrayLow[_local2].rotationY = aiShipArrayHigh[_local2].rotationY;
aiShipArrayLow[_local2].yaw(0);
_local5 = new b2Vec2(aiShipArrayHigh[_local2].x, -(aiShipArrayHigh[_local2].z));
aiShipBody[_local2].SetCenterPosition(_local5, 0);
_local6 = new b2Vec2(0, 0);
aiShipBody[_local2].SetLinearVelocity(_local6);
aiProperties[_local2].waypoint = 0;
aiProperties[_local2].lap = 1;
aiProperties[_local2].splitReached = false;
_local2++;
};
ship.x = playerStartX;
ship.z = playerStartZ;
ship.rotationY = 0;
ship.yaw(0);
_local3 = new b2Vec2(ship.x, -(ship.z));
playerShipBody.SetCenterPosition(_local3, 0);
_local4 = new b2Vec2(0, 0);
playerShipBody.SetLinearVelocity(_local4);
playerMarker.waypoint = 0;
levelTimer = 0;
lap = 0;
splitReached = true;
frameCounter = 0;
waypoint = 0;
frameTimer = 0;
lapTimer = 0;
countdownStage = 0;
accelerateSoundPlaying = false;
fadeInThrust = false;
fadeOutThrust = false;
thrustVolume = 0;
gui.lap.text = ("1/" + numberOfLaps);
positionAverage = 4;
gui.position.text = String(positionAverage);
gui.message.text = "";
gui.message2.text = "";
gui.countdown.visible = true;
gui.countdown.text = "";
bestLap = 1000000;
gameMusicChannel.stop();
constantSoundChannel.stop();
accelerateSoundChannel.stop();
sfxChannel.stop();
cameraDummy.rotationY = 180;
raceFinished = false;
stage.focus = stage;
countdownActive = true;
zooming = true;
camera.x = (ship.x + 100);
camera.z = (ship.z + 1000);
rotating = false;
countdownTimer = new Timer(1000, 8);
countdownTimer.addEventListener(TimerEvent.TIMER, updateCountdown);
countdownTimer.start();
}
public function keyUpHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.LEFT){
leftKeyDown = false;
};
if (_arg1.keyCode == Keyboard.RIGHT){
rightKeyDown = false;
};
if (_arg1.keyCode == Keyboard.UP){
upKeyDown = false;
accelerateSoundPlaying = false;
accelerateSoundChannel.stop();
fadeOutThrust = true;
fadeInThrust = false;
};
if (_arg1.keyCode == Keyboard.DOWN){
downKeyDown = false;
};
}
public function removeTicker():void{
ticker.removeEventListener(Event.ENTER_FRAME, scrollTicker);
stage.removeChild(ticker);
}
public function submitCompleteHandler(_arg1:Event):void{
submitSuccess = true;
gameOverScreen.message2.text = "Score submitted!";
hsLoader.removeEventListener(Event.COMPLETE, submitCompleteHandler);
}
public function createPyramid(_arg1, _arg2):void{
var _local3:LibraryCollada;
numberOfBGObjects++;
_local3 = new LibraryCollada(xmlArray["pyramidXML"]);
scene.addChild(_local3);
_local3.scale = -0.0005;
_local3.pitch(180);
_local3.x = (_arg1 * scaleFactor);
_local3.y = 0;
_local3.z = ((levelContainer.height - _arg2) * scaleFactor);
bgObjectArray[numberOfBGObjects] = _local3;
}
public function fadeHighscoresInOnClick(_arg1:MouseEvent):void{
menu.highscoresButton.removeEventListener(MouseEvent.MOUSE_DOWN, fadeHighscoresInOnClick);
fadeMenuOut();
fadeHighscoresIn();
}
public function submitHighscore(_arg1:MouseEvent):void{
gameOverScreen.submitButton.removeEventListener(MouseEvent.MOUSE_DOWN, submitHighscore);
gameOverScreen.message2.text = "Connecting: Please wait ...";
hsLoader = submit(gameOverScreen.playerName.text, score);
hsLoader.addEventListener(Event.COMPLETE, submitCompleteHandler);
setTimeout(submitFail, 15000);
}
public function showCovers():void{
selectVehicle.buttonZone.coverA.alpha = 1;
selectVehicle.buttonZone.coverB.alpha = 1;
selectVehicle.buttonZone.coverC.alpha = 1;
selectVehicle.buttonZone.coverD.alpha = 1;
}
public function checkGameOver():void{
if (levelTimer > timeAllowed[currentLevel]){
levelTimer = timeAllowed[currentLevel];
if (levelComplete == false){
showGameOverScreen();
};
};
}
public function mouseUpHandler(_arg1:MouseEvent):void{
mouseDown = false;
}
public function activateMenu(_arg1:TweenEvent):void{
menuTween.removeEventListener(TweenEvent.MOTION_FINISH, activateMenu);
if (securityOn == true){
if (((!((currentURL.indexOf(allowedURL, 0) == -1))) || (!((currentURL.indexOf(allowedLocal, 0) == -1))))){
menu.playButton.addEventListener(MouseEvent.MOUSE_DOWN, fadeSelectTrackInOnClick);
};
} else {
menu.playButton.addEventListener(MouseEvent.MOUSE_DOWN, fadeSelectTrackInOnClick);
};
menu.instructionsButton.addEventListener(MouseEvent.MOUSE_DOWN, fadeInstructionsIn);
menu.minijuegos.addEventListener(MouseEvent.MOUSE_DOWN, gotoMinijuegos);
menu.moreGames.addEventListener(MouseEvent.MOUSE_DOWN, gotoMinijuegos);
menu.andromedus.addEventListener(MouseEvent.MOUSE_DOWN, gotoAndromedus);
}
public function initialiseAI():void{
var _local1:uint;
var _local2:uint;
if (currentLevel == 1){
storedX[1] = " 349.4*1177*2300.1*3488.8*4661.4*5633.4*5949.4*5849.9*4947*3851.3*3833.9*3073.6*1997.6*1230.5*953.5*309.3*181.5*104.5*";
storedZ[1] = "5815.4*6652.4*6924.7*6903.4*6809.6*6141.4*5077.4*3908.1*3299.4*3564.2*4644.8*5095.1*4819.6*3924.6*2839.6*2481.6*3501.5*4666.8*";
};
if (currentLevel == 2){
storedX[1] = "77.6*82.4*199.7*1057.2*1706.1*2035.1*2936.7*3802*4675.7*5853.5*6891.4*6929.3*5861.6*4677.4*3654.9*2703.3*1517.1*350.5*132.2*146.3*";
storedZ[1] = "4800*5991.7*7160.3*7343.9*6662.7*5638.4*4884*4137.7*3556.2*3642.9*3339.1*2329.7*2115.7*2183.9*1801.5*1316.1*1333.7*1471.2*2458.2*3642.3*";
};
if (currentLevel == 3){
storedX[1] = "4655.6*4916.2*4352.3*3190.9*1999.7*1378.9*829.5*999.4*2025.4*3148*3506.1*2617.4*2447.1*2593.9*3666.9*4808.7*4825.5*4829.5*4552.4*";
storedZ[1] = "5228.1*6343.9*7207.7*7117.1*7102.7*6279.6*5428.2*4302.1*4140.8*3924.5*2936.3*2224.6*1173.3*78*120.3*236.5*1270.5*2450.7*3558.1*";
};
if (currentLevel == 4){
storedX[1] = "369*196.5*382.8*1114.2*2011.4*3159.4*4241.4*5251.3*6092.4*7107*7171.8*6639.4*5906.7*5449.8*4633.7*4592.3*3640.1*2487.2*1324.8*318.9*415.9*";
storedZ[1] = "2617.5*3750.7*4830.3*5589.1*6171.4*6148.4*6427.6*6058.4*6434.5*6139.8*5065.2*4127.3*3251.7*2380.4*1614.8*559.6*355*400*401.4*709.6*1759.2*";
};
_local1 = 1;
_local2 = 1;
while (_local2 <= _local1) {
xArray[_local2] = storedX[_local2].split("*");
zArray[_local2] = storedZ[_local2].split("*");
_local2++;
};
}
public function initGame():void{
var _local1:Date;
background.visible = true;
projectCanvas.removeChild(blackBackground);
createForeground();
initialiseAI();
projectCanvas.addEventListener(Event.ENTER_FRAME, gameLoop);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
stage.focus = stage;
raceFinished = false;
countdownActive = true;
zooming = true;
camera.x = (ship.x + 100);
camera.y = 10;
camera.z = (ship.z + 1000);
camera.pitch(cameraPitch);
countdownTimer = new Timer(1000, 8);
countdownTimer.addEventListener(TimerEvent.TIMER, updateCountdown);
countdownTimer.start();
bestLap = 1000000;
debug = new debug_mc();
stage.addChild(debug);
debug.x = (stage.stageWidth - debug.width);
debug.y = 40;
debug.visible = false;
_local1 = new Date();
fpsStartTime = _local1.getTime();
frameTimer = 0;
lapTimer = 0;
}
public function updateThrustVolume():void{
var _local1:SoundTransform;
var _local2:SoundTransform;
if (soundOn == true){
if (fadeInThrust == true){
_local1 = new SoundTransform(thrustVolume, 0);
constantSoundChannel.soundTransform = _local1;
thrustVolume = (thrustVolume + 0.001);
if (thrustVolume >= 0.2){
fadeInThrust = false;
};
};
if (fadeOutThrust == true){
_local2 = new SoundTransform(thrustVolume, 0);
constantSoundChannel.soundTransform = _local2;
thrustVolume = (thrustVolume - 0.004);
if (thrustVolume <= 0){
thrustVolume = 0;
fadeOutThrust = false;
constantSoundChannel.stop();
};
};
};
}
public function curveAngle(_arg1:Number, _arg2:Number, _arg3:Number):Number{
var _local4:Number;
var _local5:Number;
_local4 = wrapValue((_arg1 - _arg2));
if (_local4 < 180){
_local4 = -(_local4);
} else {
_local4 = (360 - _local4);
};
_local5 = wrapValue((_arg1 + (_local4 / _arg3)));
return (_local5);
}
public function hideLight(_arg1:MouseEvent):void{
selectVehicle.buttonZone.light.visible = false;
}
public function fadeInLevelLoader(_arg1:MouseEvent):void{
if ((((shipLocked == false)) || ((override == true)))){
projectCanvas.removeChild(padlock);
selectVehicle.start.removeEventListener(MouseEvent.MOUSE_DOWN, fadeInLevelLoader);
selectVehicle.removeEventListener(Event.ENTER_FRAME, updateSelectVehicle);
selectVehicle.buttonZone.removeEventListener(MouseEvent.MOUSE_DOWN, showShip);
selectVehicle.buttonZone.removeEventListener(MouseEvent.MOUSE_OVER, showLight);
selectVehicle.buttonZone.removeEventListener(MouseEvent.MOUSE_OUT, hideLight);
levelLoader = new levelLoader_mc();
levelLoader.bar.width = 0;
levelLoader.percentage.text = "0%";
projectCanvas.addChild(levelLoader);
levelLoader.controls.alpha = 0;
levelLoader.alpha = 0;
levelLoaderTween = new Tween(levelLoader, "alpha", None.easeNone, 0, 1, 1, true);
levelLoaderTween.addEventListener(TweenEvent.MOTION_FINISH, activateLevelLoader);
};
}
public function updatePhysics():void{
var _local1:b2Body;
m_world.Step(m_timeStep, m_iterations);
_local1 = m_world.m_bodyList;
while (_local1) {
if ((_local1.m_userData is DisplayObject3D)){
_local1.m_userData.x = _local1.m_position.x;
_local1.m_userData.z = -(_local1.m_position.y);
if (_local1.m_userData.name == "playerShip"){
playerMarker.x = (_local1.m_userData.x / scaleFactor);
playerMarker.y = (levelContainer.height - (_local1.m_userData.z / scaleFactor));
};
if (_local1.m_userData.name != "playerShip"){
_local1.m_userData.rotationY = (180 - (_local1.m_rotation * (180 / Math.PI)));
aiShipArrayLow[_local1.m_userData.name.valueOf()].x = _local1.m_userData.x;
aiShipArrayLow[_local1.m_userData.name.valueOf()].z = _local1.m_userData.z;
aiShipArrayLow[_local1.m_userData.name.valueOf()].rotationY = _local1.m_userData.rotationY;
aiProperties[_local1.m_userData.name.valueOf()].shipMarker.x = (_local1.m_userData.x / scaleFactor);
aiProperties[_local1.m_userData.name.valueOf()].shipMarker.y = (levelContainer.height - (_local1.m_userData.z / scaleFactor));
};
};
_local1 = _local1.m_next;
};
}
public function reset():void{
if (levelComplete == false){
};
}
public function fadeInstructionsOut(_arg1:MouseEvent):void{
instructions.menuButton.removeEventListener(MouseEvent.MOUSE_DOWN, removeInstructions);
instructions.minijuegos.removeEventListener(MouseEvent.MOUSE_DOWN, gotoMinijuegos);
instructions.andromedus.removeEventListener(MouseEvent.MOUSE_DOWN, gotoAndromedus);
fadeMenuIn();
instructionsTween = new Tween(instructions, "alpha", None.easeNone, 1, 0, 1, true);
instructionsTween.addEventListener(TweenEvent.MOTION_FINISH, removeInstructions);
}
public function levelUp():void{
gameRunning = false;
levelComplete = false;
bonus = (timeAllowed[currentLevel] - levelTimer);
score = (score + bonus);
reset();
cleanUp();
currentLevel++;
fadeSelectTrackIn();
}
public function fadeHighscoresIn():void{
highscores = new highscores_mc();
projectCanvas.addChild(highscores);
highscores.connectingDisplay.text = "Connecting ...";
highscores.rankDisplay.text = "";
highscores.nameDisplay.text = "";
highscores.scoreDisplay.text = "";
highscoresTween = new Tween(highscores, "alpha", None.easeNone, 0, 1, 1, true);
highscoresTween.addEventListener(TweenEvent.MOTION_FINISH, activateHighscores);
}
public function gotoAndromedus(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.andromedus.com";
_local3 = new URLRequest(_local2);
navigateToURL(_local3);
}
public function hideTrackLight(_arg1:MouseEvent):void{
selectTrack.buttonZone.light.visible = false;
}
public function createShip(_arg1, _arg2):void{
var _local3:BitmapAssetMaterial;
var _local4:*;
var _local5:*;
ship = shipHigh[playerShipLetter];
if (playerShipLetter == "A"){
shipAUsed = true;
};
if (playerShipLetter == "B"){
shipBUsed = true;
};
if (playerShipLetter == "C"){
shipCUsed = true;
};
ship.visible = true;
ship.rotationY = 0;
ship.yaw(0);
ship.x = (_arg1 * scaleFactor);
ship.z = ((levelContainer.height - _arg2) * scaleFactor);
_local3 = new BitmapAssetMaterial("shipShadow.png", false);
shipShadow = new Plane(_local3, 20, 40, 4, 4);
scene.addChild(shipShadow);
shipShadow.y = 8;
shipShadow.rotationY = ship.rotationY;
_local4 = new b2BodyDef();
_local5 = new b2BoxDef();
_local5.categoryBits = 2;
_local5.extents.Set(13, 26);
_local5.friction = 0;
_local5.density = 0.15;
_local5.restitution = 0.95;
_local4.AddShape(_local5);
_local4.userData = ship;
_local4.position.Set(ship.x, -(ship.z));
if (playerShipLetter == "A"){
_local4.linearDamping = 0.11;
};
if (playerShipLetter == "B"){
_local4.linearDamping = 0.11;
};
if (playerShipLetter == "C"){
_local4.linearDamping = 0.11;
};
if (playerShipLetter == "D"){
_local4.linearDamping = 0.11;
};
_local4.angularDamping = 0.02;
_local4.userData.name = "playerShip";
playerShipBody = m_world.CreateBody(_local4);
if (playerShipLetter == "A"){
maxThrustPlayer = 33000;
thrustDampingPlayer = 300;
rotationSpeedPlayer = 4.5;
};
if (playerShipLetter == "B"){
maxThrustPlayer = 34000;
thrustDampingPlayer = 300;
rotationSpeedPlayer = 4.3;
};
if (playerShipLetter == "C"){
maxThrustPlayer = 35000;
thrustDampingPlayer = 300;
rotationSpeedPlayer = 4;
};
if (playerShipLetter == "D"){
maxThrustPlayer = 36000;
thrustDampingPlayer = 280;
rotationSpeedPlayer = 3.5;
};
playerMarker = new playerMarker_mc();
level.addChild(playerMarker);
playerMarker.waypoint = 0;
playerStartX = ship.x;
playerStartZ = ship.z;
}
public function showTrackLight(_arg1:MouseEvent):void{
selectTrack.buttonZone.light.visible = true;
if (_arg1.target == selectTrack.buttonZone.coverA){
selectTrack.buttonZone.light.x = 0;
selectTrack.buttonZone.light.y = 0;
};
if (_arg1.target == selectTrack.buttonZone.coverB){
selectTrack.buttonZone.light.x = 180;
selectTrack.buttonZone.light.y = 0;
};
if (_arg1.target == selectTrack.buttonZone.coverC){
selectTrack.buttonZone.light.x = 0;
selectTrack.buttonZone.light.y = 180;
};
if (_arg1.target == selectTrack.buttonZone.coverD){
selectTrack.buttonZone.light.x = 180;
selectTrack.buttonZone.light.y = 180;
};
}
public function hideShips():void{
shipHigh["A"].visible = false;
shipHigh["B"].visible = false;
shipHigh["C"].visible = false;
shipHigh["D"].visible = false;
}
public function downloadHandler(_arg1:Event):void{
var _local2:String;
var _local3:String;
var _local4:XML;
var _local5:String;
var _local6:int;
var _local7:uint;
hsLoader.removeEventListener(Event.COMPLETE, downloadHandler);
_local4 = XML(hsLoader.data);
scoresArray.length = 0;
for (_local5 in _local4.name) {
_local2 = _local4.name[_local5];
if (swearFilter(_local2) == true){
_local2 = "XxX";
};
_local7 = Math.round(parseInt(_local4.name.@score[_local5]));
if (_local7 > maxPossibleScore){
_local7 = 0;
};
_local3 = String(_local7);
scoresArray.push({name:_local2, score:_local3});
};
scoresArray.sortOn("score", Array.NUMERIC);
scoresArray.reverse();
highscores.connectingDisplay.text = "";
highscores.rankDisplay.text = "";
highscores.nameDisplay.text = "";
highscores.scoreDisplay.text = "";
_local6 = 0;
while (_local6 < 10) {
highscores.rankDisplay.appendText((String((_local6 + 1)) + ".\n"));
highscores.nameDisplay.appendText((scoresArray[_local6].name + "\n"));
highscores.scoreDisplay.appendText((scoresArray[_local6].score + "\n"));
_local6++;
};
}
public function gameLoop(_arg1:Event):void{
if ((((gameRunning == true)) && ((raceFinished == false)))){
updateFPS();
updateGUI();
checkBox2DCollisions();
updateBackground();
updateFlares();
check3DCollisions();
clip();
checkInput();
movePlayer();
updatePhysics();
updateShadows();
moveCamera();
render();
checkSplitReached();
checkLapComplete();
recordLap();
controlAI();
findPosition();
updateTime();
updateThrustVolume();
};
if (countdownActive == true){
fadeOutIntroMusic();
updateFPS();
updateGUI();
checkBox2DCollisions();
updateBackground();
updateFlares();
check3DCollisions();
clip();
checkInput();
updateShadows();
moveCamera();
render();
checkSplitReached();
findPosition();
updateThrustVolume();
};
if (raceFinished == true){
updateFPS();
check3DCollisions();
clip();
movePlayer();
updatePhysics();
updateShadows();
render();
checkSplitReached();
controlAI();
};
}
public function activateHighscores(_arg1:TweenEvent):void{
var _local2:String;
var _local3:URLRequest;
highscoresTween.removeEventListener(TweenEvent.MOTION_FINISH, activateHighscores);
highscores.menuButton.addEventListener(MouseEvent.MOUSE_DOWN, fadeHighscoresOut);
_local2 = readScoresURL;
_local3 = new URLRequest(_local2);
hsLoader = new URLLoader(_local3);
hsLoader.addEventListener(Event.COMPLETE, downloadHandler);
}
public function removeGameOverScreen(_arg1:MouseEvent):void{
submitSuccess = false;
gameOverScreen.continueButton.removeEventListener(MouseEvent.MOUSE_DOWN, removeGameOverScreen);
gameOverScreen.playAgain.removeEventListener(MouseEvent.MOUSE_DOWN, playAgain);
projectCanvas.removeChild(gameOverScreen);
exitGame();
fadeMenuIn();
addTicker();
}
public function resumeGame(_arg1:MouseEvent):void{
gameRunning = true;
projectCanvas.removeChild(confirmQuit);
confirmQuit.yesButton.removeEventListener(MouseEvent.MOUSE_DOWN, quitGame);
confirmQuit.noButton.removeEventListener(MouseEvent.MOUSE_DOWN, resumeGame);
gui.quitButton.addEventListener(MouseEvent.MOUSE_DOWN, showConfirmQuit);
stage.focus = stage;
}
public function checkLapComplete():void{
var _local1:Boolean;
var _local2:*;
var _local3:Boolean;
var _local4:uint;
var _local5:*;
_local1 = level.startLine.hitTestPoint(playerMarker.x, playerMarker.y);
if ((((_local1 == true)) && ((splitReached == true)))){
lap++;
if (soundOn == true){
};
if (lap > 1){
if (lap <= numberOfLaps){
gui.lap.text = ((String(lap) + "/") + numberOfLaps);
};
if (lapTimer < lapRecord[currentLevel]){
lapRecord[currentLevel] = lapTimer;
gui.bestLap.text = String((lapRecord[currentLevel] / 100));
gui.message.text = "LAP RECORD !!!";
if (currentLevel == 1){
so.data.lapRecord1 = lapRecord[1];
};
if (currentLevel == 2){
so.data.lapRecord2 = lapRecord[2];
};
if (currentLevel == 3){
so.data.lapRecord3 = lapRecord[3];
};
if (currentLevel == 4){
so.data.lapRecord4 = lapRecord[4];
};
};
if (lapTimer < bestLap){
bestLap = lapTimer;
};
lapTimer = 0;
if (record == true){
trace(("DataX: " + dataX));
trace(("DataZ: " + dataZ));
dataX = "";
dataZ = "";
};
};
splitReached = false;
if (lap == numberOfLaps){
gui.lastLap.visible = true;
setTimeout(removeLastLap, 1500);
};
};
_local2 = 1;
while (_local2 <= numberOfAIShips) {
_local3 = level.startLine.hitTestPoint(aiProperties[_local2].shipMarker.x, aiProperties[_local2].shipMarker.y);
if ((((_local3 == true)) && ((aiProperties[_local2].splitReached == true)))){
aiProperties[_local2].lap++;
aiProperties[_local2].splitReached = false;
};
_local2++;
};
if (lap > numberOfLaps){
raceFinished = true;
constantSoundChannel.stop();
if (soundOn == true){
sfxChannel = whooshSound.play();
};
gui.quitButton.removeEventListener(MouseEvent.MOUSE_DOWN, showConfirmQuit);
setTimeout(showGameOverScreen, 3000);
_local4 = (numberOfAIShips + 1);
_local5 = 1;
while (_local5 <= numberOfAIShips) {
if (lap > aiProperties[_local5].lap){
_local4--;
};
positionAverage = _local4;
gui.position.text = (String(positionAverage) + "/4");
_local5++;
};
if (frameTimer < raceRecord[currentLevel]){
raceRecord[currentLevel] = frameTimer;
gui.raceRecord.text = String((raceRecord[currentLevel] / 100));
gui.message2.text = "NEW RACE RECORD !!!";
if (currentLevel == 1){
so.data.raceRecord1 = raceRecord[1];
};
if (currentLevel == 2){
so.data.raceRecord2 = raceRecord[2];
};
if (currentLevel == 3){
so.data.raceRecord3 = raceRecord[3];
};
if (currentLevel == 4){
so.data.raceRecord4 = raceRecord[4];
};
};
};
}
public function fadeSelectTrackInOnClick(_arg1:MouseEvent){
menu.playButton.removeEventListener(MouseEvent.MOUSE_DOWN, fadeSelectTrackInOnClick);
removeTicker();
fadeMenuOut();
fadeSelectTrackIn();
}
public function applyLocks():void{
if (tracksCompleted == 0){
shipCLocked = true;
shipDLocked = true;
track2Locked = true;
track3Locked = true;
track4Locked = true;
};
if (tracksCompleted == 1){
shipCLocked = false;
shipDLocked = true;
track2Locked = false;
track3Locked = true;
track4Locked = true;
};
if (tracksCompleted == 2){
shipCLocked = false;
shipDLocked = false;
track2Locked = false;
track3Locked = false;
track4Locked = true;
};
if (tracksCompleted == 3){
shipCLocked = false;
shipDLocked = false;
track2Locked = false;
track3Locked = false;
track4Locked = false;
};
if (tracksCompleted == 4){
shipCLocked = false;
shipDLocked = false;
track2Locked = false;
track3Locked = false;
track4Locked = false;
};
}
public function activateLevelLoader(_arg1:TweenEvent):void{
levelLoaderTween.removeEventListener(TweenEvent.MOTION_FINISH, activateLevelLoader);
projectCanvas.removeChild(selectVehicle);
levelLoader.controls.alpha = 1;
hideShips();
iteration = 0;
stage.frameRate = 10000;
stage.addEventListener(Event.ENTER_FRAME, createLevel);
}
public function createCameraDummy():void{
var _local1:WireframeMaterial;
var _local2:MaterialsList;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:*;
_local1 = new WireframeMaterial();
_local2 = new MaterialsList();
_local2.addMaterial(_local1, "all");
_local3 = 100;
_local4 = 100;
_local5 = 100;
_local6 = Cube.ALL;
cameraDummy = new Cube(_local2, _local3, _local4, _local5, 1, 1, 1, 0, _local6);
cameraDummy.visible = true;
cameraDummy.rotationY = 180;
scene.addChild(cameraDummy);
}
public function check3DCollisions():void{
}
public function createBasicSection(_arg1, _arg2, _arg3, _arg4):void{
var _local5:LibraryCollada;
var _local6:LibraryCollada;
var _local7:LibraryCollada;
numberOfSections++;
_local5 = new LibraryCollada(xmlArray[(_arg4 + "HighXML")]);
scene.addChild(_local5);
_local5.scale = -0.00125;
_local5.pitch(180);
_local5.x = (_arg1 * scaleFactor);
_local5.y = 0;
_local5.z = ((levelContainer.height - _arg2) * scaleFactor);
_local5.yaw(_arg3);
highPolyArray[numberOfSections] = _local5;
_local6 = new LibraryCollada(xmlArray[(_arg4 + "MedXML")]);
_local6.visible = false;
_local6.scale = -0.00125;
_local6.pitch(180);
_local6.x = _local5.x;
_local6.y = _local5.y;
_local6.z = _local5.z;
_local6.yaw(_arg3);
medPolyArray[numberOfSections] = _local6;
scene.addChild(_local6);
_local7 = new LibraryCollada(xmlArray[(_arg4 + "LowXML")]);
_local7.visible = false;
_local7.scale = -0.00125;
_local7.pitch(180);
_local7.x = _local5.x;
_local7.y = _local5.y;
_local7.z = _local5.z;
_local7.yaw(_arg3);
lowPolyArray[numberOfSections] = _local7;
scene.addChild(_local7);
if (_arg4 == "sharpBend"){
createCollisionObject(_arg1, _arg2, -20, 0, 10, 40, 0, _arg3);
createCollisionObject(_arg1, _arg2, 0, -20, 40, 10, 0, _arg3);
};
if (_arg4 == "curveLong"){
createCollisionObject(_arg1, _arg2, -40, 20, 10, 40, 0, _arg3);
createCollisionObject(_arg1, _arg2, 20, -40, 40, 10, 0, _arg3);
createCollisionObject(_arg1, _arg2, -20, -20, 10, 56.6, 45, _arg3);
createCollisionObject(_arg1, _arg2, 0, 30, 10, 20, 0, _arg3);
createCollisionObject(_arg1, _arg2, 34, 0, 20, 10, 0, _arg3);
createCollisionObject(_arg1, _arg2, 14, 10, 10, 28.3, 45, _arg3);
};
if (_arg4 == "sToDRight"){
createCollisionObject(_arg1, _arg2, 6, -20, 28, 10, 0, _arg3);
createCollisionObject(_arg1, _arg2, -21, -7, 10, 36, 45, _arg3);
createCollisionObject(_arg1, _arg2, 14, 24, 12, 10, 0, _arg3);
createCollisionObject(_arg1, _arg2, -0.6, 30, 10, 20, 45, _arg3);
};
if (_arg4 == "sToDLeft"){
createCollisionObject(_arg1, _arg2, 6, 20, 28, 10, 0, _arg3);
createCollisionObject(_arg1, _arg2, -21, 7, 10, 36, -45, _arg3);
createCollisionObject(_arg1, _arg2, 14, -24, 12, 10, 0, _arg3);
createCollisionObject(_arg1, _arg2, -0.6, -30, 10, 20, -45, _arg3);
};
}
public function showConfirmQuit(_arg1:MouseEvent):void{
gameRunning = false;
gui.quitButton.removeEventListener(MouseEvent.MOUSE_DOWN, showConfirmQuit);
confirmQuit = new confirmQuit_mc();
projectCanvas.addChild(confirmQuit);
confirmQuit.yesButton.addEventListener(MouseEvent.MOUSE_DOWN, quitGame);
confirmQuit.noButton.addEventListener(MouseEvent.MOUSE_DOWN, resumeGame);
}
public function checkSplitReached():void{
var _local1:Boolean;
var _local2:*;
var _local3:Boolean;
_local1 = level.split.hitTestPoint(playerMarker.x, playerMarker.y);
if (_local1 == true){
splitReached = true;
};
_local2 = 1;
while (_local2 <= numberOfAIShips) {
_local3 = level.split.hitTestPoint(aiProperties[_local2].shipMarker.x, aiProperties[_local2].shipMarker.y);
if (_local3 == true){
aiProperties[_local2].splitReached = true;
};
_local2++;
};
}
public function removeLastLap():void{
if (gameRunning == true){
gui.lastLap.visible = false;
};
}
public function findPosition():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:Number;
playerPosition = (numberOfAIShips + 1);
_local1 = 1;
while (_local1 <= numberOfAIShips) {
if (lap > aiProperties[_local1].lap){
playerPosition--;
};
if (lap == aiProperties[_local1].lap){
if ((((playerMarker.waypoint == 0)) || ((aiProperties[_local1].waypoint == 0)))){
_local2 = (((level.startLine.x - playerMarker.x) * (level.startLine.x - playerMarker.x)) + ((level.startLine.y - playerMarker.y) * (level.startLine.y - playerMarker.y)));
_local3 = (((level.startLine.x - aiProperties[_local1].shipMarker.x) * (level.startLine.x - aiProperties[_local1].shipMarker.x)) + ((level.startLine.y - aiProperties[_local1].shipMarker.y) * (level.startLine.y - aiProperties[_local1].shipMarker.y)));
if ((((aiProperties[_local1].splitReached == true)) && ((splitReached == true)))){
if (_local2 < _local3){
playerPosition--;
};
} else {
if (_local2 > _local3){
playerPosition--;
};
};
} else {
if (playerMarker.waypoint > aiProperties[_local1].waypoint){
playerPosition--;
};
if (playerMarker.waypoint == aiProperties[_local1].waypoint){
if (playerMarker.distToWaypoint < aiProperties[_local1].distToWaypoint){
playerPosition--;
};
};
};
};
_local1++;
};
positionAverageCounter++;
positionSum = (positionSum + playerPosition);
if (positionAverageCounter == 15){
positionAverageCounter = 0;
_local4 = Math.round((positionSum / 15));
positionAverage = _local4;
positionSum = 0;
};
}
public function setTrack(_arg1:MouseEvent):void{
hideTrackCovers();
if (_arg1.target == selectTrack.buttonZone.coverA){
currentLevel = 1;
selectTrack.buttonZone.coverA.alpha = 1;
trackLocked = false;
};
if (_arg1.target == selectTrack.buttonZone.coverB){
currentLevel = 2;
selectTrack.buttonZone.coverB.alpha = 1;
if (track2Locked == true){
trackLocked = true;
} else {
trackLocked = false;
};
};
if (_arg1.target == selectTrack.buttonZone.coverC){
currentLevel = 3;
selectTrack.buttonZone.coverC.alpha = 1;
if (track3Locked == true){
trackLocked = true;
} else {
trackLocked = false;
};
};
if (_arg1.target == selectTrack.buttonZone.coverD){
currentLevel = 4;
selectTrack.buttonZone.coverD.alpha = 1;
if (track4Locked == true){
trackLocked = true;
} else {
trackLocked = false;
};
};
}
public function initialiseSoundToggle():void{
soundToggle.addEventListener(MouseEvent.MOUSE_OVER, soundOver);
soundToggle.addEventListener(MouseEvent.MOUSE_OUT, soundUp);
soundToggle.addEventListener(MouseEvent.MOUSE_DOWN, toggleSound);
}
public function movePlayer():void{
var _local1:b2Vec2;
var _local2:*;
var _local3:*;
var _local4:Number;
var _local5:Number;
if (leftKeyDown == true){
ship.yaw(rotationSpeedPlayer);
};
if (rightKeyDown == true){
ship.yaw(-(rotationSpeedPlayer));
};
if (upKeyDown == true){
thrust = maxThrustPlayer;
};
if (downKeyDown == true){
thrust = (-(maxThrustPlayer) / 20);
};
_local1 = new b2Vec2((thrust * Math.sin(((ship.rotationY * Math.PI) / 180))), (thrust * Math.cos(((ship.rotationY * Math.PI) / 180))));
playerShipBody.WakeUp();
playerShipBody.ApplyImpulse(_local1, playerShipBody.GetCenterPosition());
if (thrust > thrustDampingPlayer){
thrust = (thrust - thrustDampingPlayer);
};
if (thrust < -(thrustDampingPlayer)){
thrust = (thrust + thrustDampingPlayer);
};
if ((((thrust > -(thrustDampingPlayer))) && ((thrust < thrustDampingPlayer)))){
thrust = 0;
};
playerShipBody.m_rotation = (Math.PI - ((ship.rotationY * Math.PI) / 180));
_local2 = (playerMarker.waypoint + 1);
_local3 = (playerMarker.waypoint + 2);
if (_local2 > xArray.length){
_local2 = (_local2 - xArray.length);
};
if (_local3 > xArray.length){
_local3 = (_local3 - xArray.length);
};
_local4 = (((xArray[_local2] - ship.x) * (xArray[_local2] - ship.x)) + ((zArray[_local2] - ship.z) * (zArray[_local2] - ship.z)));
playerMarker.distToWaypoint = _local4;
if (_local4 < 16000){
playerMarker.waypoint++;
};
_local5 = (((xArray[_local3] - ship.x) * (xArray[_local3] - ship.x)) + ((zArray[_local3] - ship.z) * (zArray[_local3] - ship.z)));
if (_local5 < playerMarker.distToWaypoint){
playerMarker.distToWaypoint = _local5;
};
if (_local5 < 16000){
playerMarker.waypoint = (playerMarker.waypoint + 2);
};
if (playerMarker.waypoint > (xArray.length - 3)){
playerMarker.waypoint = 0;
};
}
public function fadeSelectTrackIn():void{
selectTrack = new selectTrack_mc();
projectCanvas.addChild(selectTrack);
selectTrack.track2Lock.mouseEnabled = false;
selectTrack.track3Lock.mouseEnabled = false;
selectTrack.track4Lock.mouseEnabled = false;
if (track2Locked == false){
selectTrack.track2Lock.visible = false;
};
if (track3Locked == false){
selectTrack.track3Lock.visible = false;
};
if (track4Locked == false){
selectTrack.track4Lock.visible = false;
};
hideTrackCovers();
selectTrack.buttonZone.coverA.alpha = 1;
currentLevel = 1;
selectTrack.buttonZone.light.visible = false;
selectTrack.buttonZone.light.mouseEnabled = false;
if (currentLevel == 1){
};
selectTrackTween = new Tween(selectTrack, "alpha", None.easeNone, 0, 1, 1, true);
selectTrackTween.addEventListener(TweenEvent.MOTION_FINISH, activateSelectTrack);
}
public function render():void{
renderer.renderScene(scene, camera, viewport);
}
public function hideTrackCovers():void{
selectTrack.buttonZone.coverA.alpha = 0;
selectTrack.buttonZone.coverB.alpha = 0;
selectTrack.buttonZone.coverC.alpha = 0;
selectTrack.buttonZone.coverD.alpha = 0;
}
public function toggleSound(_arg1:MouseEvent):void{
var _local2:SoundTransform;
var _local3:SoundTransform;
if (soundOn == true){
soundOn = false;
soundToggle.gotoAndStop("offOver");
_local2 = new SoundTransform(0, 0);
constantSoundChannel.soundTransform = _local2;
accelerateSoundChannel.stop();
sfxChannel.stop();
} else {
soundOn = true;
_local3 = new SoundTransform(thrustVolume, 0);
constantSoundChannel.soundTransform = _local3;
soundToggle.gotoAndStop("onOver");
};
}
public function exitGame():void{
cleanUp();
currentLevel = 1;
score = 0;
levelComplete = false;
soundToggle.x = 565;
soundToggle.y = 11;
musicToggle.x = 539;
musicToggle.y = 7;
gameMusicChannel.stop();
musicChannel = introMusic.play(0, 100);
if (musicOn == true){
introMusicVolume = 0.5;
} else {
introMusicVolume = 0;
};
introMusicTransform = new SoundTransform(introMusicVolume, 0);
musicChannel.soundTransform = introMusicTransform;
}
public function activateInstructions(_arg1:TweenEvent):void{
instructionsTween.removeEventListener(TweenEvent.MOTION_FINISH, activateInstructions);
instructions.menuButton.addEventListener(MouseEvent.MOUSE_DOWN, fadeInstructionsOut);
instructions.minijuegos.addEventListener(MouseEvent.MOUSE_DOWN, gotoMinijuegos);
instructions.andromedus.addEventListener(MouseEvent.MOUSE_DOWN, gotoAndromedus);
}
public function controlAI():void{
var _local1:uint;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
_local1 = 1;
_local2 = 1;
while (_local2 <= numberOfAIShips) {
_local3 = (aiProperties[_local2].waypoint + 1);
_local4 = (aiProperties[_local2].waypoint + 2);
if (_local3 > xArray[_local1].length){
_local3 = (_local3 - xArray[_local1].length);
};
if (_local4 > xArray[_local1].length){
_local4 = (_local4 - xArray[_local1].length);
};
_local5 = aiProperties[_local2].maxThrust;
_local6 = Math.atan2((zArray[_local1][_local3] - aiShipArrayHigh[_local2].z), (xArray[_local1][_local3] - aiShipArrayHigh[_local2].x));
aiShipBody[_local2].m_rotation = ((Math.PI / 2) + _local6);
if (positionAverage == 1){
_local5 = (33500 * aiHandicap[currentLevel]);
};
if (positionAverage == 2){
_local5 = (32500 * aiHandicap[currentLevel]);
};
if (positionAverage == 3){
_local5 = (0x7D00 * aiHandicap[currentLevel]);
};
if (positionAverage == 4){
_local5 = (29000 * aiHandicap[currentLevel]);
};
_local7 = new b2Vec2((_local5 * Math.sin(aiShipBody[_local2].m_rotation)), (_local5 * Math.cos(aiShipBody[_local2].m_rotation)));
aiShipBody[_local2].WakeUp();
aiShipBody[_local2].ApplyImpulse(_local7, aiShipBody[_local2].GetCenterPosition());
_local8 = (((xArray[_local1][_local3] - aiShipArrayHigh[_local2].x) * (xArray[_local1][_local3] - aiShipArrayHigh[_local2].x)) + ((zArray[_local1][_local3] - aiShipArrayHigh[_local2].z) * (zArray[_local1][_local3] - aiShipArrayHigh[_local2].z)));
aiProperties[_local2].distToWaypoint = _local8;
if (_local8 < 16000){
aiProperties[_local2].waypoint++;
};
_local9 = (((xArray[_local1][_local4] - aiShipArrayHigh[_local2].x) * (xArray[_local1][_local4] - aiShipArrayHigh[_local2].x)) + ((zArray[_local1][_local4] - aiShipArrayHigh[_local2].z) * (zArray[_local1][_local4] - aiShipArrayHigh[_local2].z)));
if (_local9 < aiProperties[_local2].distToWaypoint){
aiProperties[_local2].distToWaypoint = _local9;
};
if (_local9 < 16000){
aiProperties[_local2].waypoint = (aiProperties[_local2].waypoint + 2);
};
if (aiProperties[_local2].waypoint > (xArray[_local1].length - 3)){
aiProperties[_local2].waypoint = 0;
};
_local2++;
};
}
public function moveCamera():void{
var _local1:Number;
if (zooming == false){
camera.x = ship.x;
camera.z = ship.z;
} else {
camera.x = (camera.x - 0.8);
camera.z = (camera.z - 8);
if (camera.z <= ship.z){
zooming = false;
};
};
if (rotating == true){
_local1 = curveAngle(cameraDummy.rotationY, (180 - ship.rotationY), camSpeed);
cameraDummy.rotationY = _local1;
};
camera.rotationX = cameraDummy.rotationX;
camera.rotationZ = cameraDummy.rotationZ;
camera.rotationY = cameraDummy.rotationY;
camera.pitch(cameraPitch);
}
public function updateShadows():void{
var _local1:uint;
shipShadow.x = (ship.x + 3);
shipShadow.z = (ship.z - 3);
shipShadow.rotationY = 0;
shipShadow.rotationX = -90;
shipShadow.rotationY = (180 - ship.rotationY);
_local1 = 1;
while (_local1 <= numberOfAIShips) {
aiShadow[_local1].x = (aiShipArrayHigh[_local1].x + 3);
aiShadow[_local1].z = (aiShipArrayHigh[_local1].z - 3);
aiShadow[_local1].rotationY = 0;
aiShadow[_local1].rotationX = -90;
aiShadow[_local1].rotationY = aiShipArrayHigh[_local1].rotationY;
_local1++;
};
}
public function createTower3(_arg1, _arg2):void{
var _local3:LibraryCollada;
numberOfBGObjects++;
_local3 = new LibraryCollada(xmlArray["tower3XML"]);
scene.addChild(_local3);
_local3.scale = -0.0005;
_local3.pitch(180);
_local3.x = (_arg1 * scaleFactor);
_local3.y = 0;
_local3.z = ((levelContainer.height - _arg2) * scaleFactor);
bgObjectArray[numberOfBGObjects] = _local3;
}
public function soundOver(_arg1:MouseEvent):void{
if (soundOn == true){
soundToggle.gotoAndStop("onOver");
} else {
soundToggle.gotoAndStop("offOver");
};
}
public function checkBox2DCollisions():void{
var _local1:b2Contact;
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
_local1 = m_world.GetContactList();
while (_local1) {
if (_local1.GetManifoldCount() > 0){
_local2 = _local1.GetShape1().GetBody();
_local3 = _local1.GetShape2().GetBody();
if (soundOn == true){
if ((((_local2 == playerShipBody)) || ((_local3 == playerShipBody)))){
if ((((((_local2 == lastBody1)) && ((_local3 == lastBody2)))) || ((((_local2 == lastBody2)) && ((_local3 == lastBody1)))))){
} else {
_local4 = Math.round((Math.random() * 2));
if (_local4 == 1){
sfxChannel = collisionSound3.play();
};
if (_local4 == 2){
sfxChannel = collisionSound4.play();
};
lastBody1 = _local2;
lastBody2 = _local3;
};
};
};
};
_local1 = _local1.GetNext();
};
}
public function createAIShip(_arg1, _arg2):void{
var _local3:String;
var _local4:LibraryCollada;
var _local5:BitmapAssetMaterial;
var _local6:Plane;
var _local7:LibraryCollada;
var _local8:*;
var _local9:*;
var _local10:Object;
var _local11:*;
numberOfAIShips++;
if (shipAUsed == false){
_local3 = "A";
shipAUsed = true;
} else {
if (shipBUsed == false){
_local3 = "B";
shipBUsed = true;
} else {
if (shipCUsed == false){
_local3 = "C";
shipCUsed = true;
} else {
_local3 = "D";
};
};
};
_local4 = shipHigh[_local3];
aiShipArrayHigh[numberOfAIShips] = _local4;
aiShipArrayHigh[numberOfAIShips].x = (_arg1 * scaleFactor);
aiShipArrayHigh[numberOfAIShips].z = ((levelContainer.height - _arg2) * scaleFactor);
aiShipArrayHigh[numberOfAIShips].rotationY = 0;
aiShipArrayHigh[numberOfAIShips].yaw(0);
_local5 = new BitmapAssetMaterial("shipShadow.png", false);
_local6 = new Plane(_local5, 20, 40, 2, 2);
aiShadow[numberOfAIShips] = _local6;
scene.addChild(aiShadow[numberOfAIShips]);
aiShadow[numberOfAIShips].y = 8;
aiShadow[numberOfAIShips].rotationY = aiShipArrayHigh[numberOfAIShips].rotationY;
_local7 = new LibraryCollada(xmlArray[(("ship" + _local3) + "LowXML")]);
_local7.scale = -0.0013;
if (_local3 == "B"){
_local7.scale = -0.00136;
};
scene.addChild(_local7);
_local7.y = _local4.y;
_local7.x = (_arg1 * scaleFactor);
_local7.z = ((levelContainer.height - _arg2) * scaleFactor);
_local7.rotationY = aiShipArrayHigh[numberOfAIShips].rotationY;
_local7.visible = false;
aiShipArrayLow[numberOfAIShips] = _local7;
_local8 = new b2BodyDef();
_local9 = new b2BoxDef();
_local9.categoryBits = 2;
_local9.extents.Set(13, 26);
_local9.friction = 0;
_local9.density = 0.15;
_local9.restitution = 0.95;
_local8.AddShape(_local9);
_local8.userData = _local4;
_local8.position.Set(_local4.x, -(_local4.z));
_local8.linearDamping = 0.1;
_local8.angularDamping = 0.24;
_local8.userData.name = String(numberOfAIShips);
aiShipBody[numberOfAIShips] = m_world.CreateBody(_local8);
_local10 = new Object();
aiProperties[numberOfAIShips] = _local10;
aiProperties[numberOfAIShips].waypoint = 0;
aiProperties[numberOfAIShips].maxThrust = (maxThrustAI * 0.98);
aiProperties[numberOfAIShips].lap = 1;
aiProperties[numberOfAIShips].splitReached = false;
_local11 = new aiMarker_mc();
aiProperties[numberOfAIShips].shipMarker = _local11;
level.addChild(aiProperties[numberOfAIShips].shipMarker);
aiStartX[numberOfAIShips] = aiShipArrayHigh[numberOfAIShips].x;
aiStartZ[numberOfAIShips] = aiShipArrayHigh[numberOfAIShips].z;
}
public function createTower2(_arg1, _arg2):void{
var _local3:LibraryCollada;
numberOfBGObjects++;
_local3 = new LibraryCollada(xmlArray["tower2XML"]);
scene.addChild(_local3);
_local3.scale = -0.0005;
_local3.pitch(180);
_local3.x = (_arg1 * scaleFactor);
_local3.y = 0;
_local3.z = ((levelContainer.height - _arg2) * scaleFactor);
bgObjectArray[numberOfBGObjects] = _local3;
}
public function end_preload(_arg1:MouseEvent):void{
removeChild(adBox);
stage.removeEventListener(Event.ENTER_FRAME, loader);
gotoAndPlay(2);
}
public function initialiseMusicToggle():void{
musicToggle.addEventListener(MouseEvent.MOUSE_OVER, musicOver);
musicToggle.addEventListener(MouseEvent.MOUSE_OUT, musicUp);
musicToggle.addEventListener(MouseEvent.MOUSE_DOWN, toggleMusic);
}
public function removeSelectTrack():void{
projectCanvas.removeChild(selectTrack);
}
public function createDiagonalWall(_arg1:Number, _arg2:Number, _arg3:Number, _arg4):void{
var _local5:Number;
var _local6:Number;
var _local7:Sprite;
var _local8:Sprite;
var _local9:Point;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:uint;
var _local15:*;
var _local16:*;
_local5 = ((1.41421 * _arg3) * scaleFactor);
_local6 = (10 * scaleFactor);
_local7 = new Sprite();
stage.addChild(_local7);
_local8 = new Sprite();
_local7.addChild(_local8);
_local10 = 0;
_local11 = 0;
_local14 = 1;
while (_local14 <= 2) {
if (_local14 == 1){
_local8.x = -20;
_local8.y = 0;
_local9 = new Point(_local8.x, _local8.y);
_local7.rotation = _arg4;
_local10 = (_arg1 + (_local8.localToGlobal(_local9).x / 2));
_local11 = (_arg2 + (_local8.localToGlobal(_local9).y / 2));
} else {
_local8.x = 20;
_local8.y = 0;
_local9 = new Point(_local8.x, _local8.y);
_local7.rotation = _arg4;
_local10 = (_arg1 + (_local8.localToGlobal(_local9).x / 2));
_local11 = (_arg2 + (_local8.localToGlobal(_local9).y / 2));
};
_local12 = (_local10 * scaleFactor);
_local13 = ((levelContainer.height - _local11) * scaleFactor);
_local15 = new b2BodyDef();
_local16 = new b2BoxDef();
_local16.maskBits = 2;
_local16.extents.Set((_local6 / 2), (_local5 / 2));
_local16.friction = 0;
_local16.density = 0;
_local16.restitution = 0.95;
_local15.AddShape(_local16);
_local15.position.Set(_local12, -(_local13));
_local15.linearDamping = 0.07;
_local15.angularDamping = 0.02;
_local15.rotation = ((_arg4 * Math.PI) / 180);
m_world.CreateBody(_local15);
_local14++;
};
stage.removeChild(_local7);
}
public function gotoMinijuegos(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.minijuegos.com";
_local3 = new URLRequest(_local2);
navigateToURL(_local3);
}
public function populateArrays():void{
timeAllowed[1] = 60000;
timeAllowed[2] = 500;
timeAllowed[3] = 400;
timeAllowed[4] = 300;
timeAllowed[5] = 200;
levelInfoArray[1] = "";
levelInfoArray[2] = "Level info 2";
levelInfoArray[3] = "Level info 3";
levelInfoArray[4] = "Level info 4";
levelInfoArray[5] = "Level info 5";
tickerArray[0] = "*** WELCOME TO THE PLANET XENON PRIME. THE YEAR IS 2476AD AND IT'S TIME FOR XENON PRIME RACING !!! ***";
tickerArray[1] = "*** A GAME DEVELOPED BY -ANDROMEDUS SOFTWARE- ***";
tickerArray[2] = "*** SPONSORED BY MINIJUEGOS.COM ***";
tickerArray[3] = "*** CODING BY -RIC- ***";
tickerArray[4] = "*** MUSIC BY -BISHOP ODO- ***";
tickerArray[5] = "*** ARTWORK BY -THE HOD- ***";
tickerArray[6] = "*** 3D MODELLING BY -CHAL- ***";
tickerArray[7] = "*** XENON PRIME IS THE LARGEST PLANET IN THE XENON PLANETARY SYSTEM, PART OF THE ANDROMEDUS CLUSTER. ALMOST 50% OF THE ECONOMY OF THE PLANET IS DERIVED FROM HOVER RACING, ATTRACTING COMPETITORS AND SPECTATORS FROM OVER 100 PLANETS IN THE ANDROMEDUS CLUSTER. ***";
tickerArray[8] = "*** THE XENON PRIME RACING CHAMPIONSHIPS ARE HELD ONCE EVERY XENOQUART - WHICH IS 217.3 EARTH DAYS. LAP TIMES AND RACE TIMES ARE MEASURED IN IX'S (IMPERIAL XENOSECS), WHICH ARE SLIGHTLY LONGER THAN EARTH SECONDS. ***";
aiHandicap[1] = 0.95;
aiHandicap[2] = 0.965;
aiHandicap[3] = 0.97;
aiHandicap[4] = 1;
}
public function initialise():void{
MochiBot.track(this, "15125a41");
populateArrays();
applyLocks();
projectCanvas = new Sprite();
stage.addChild(projectCanvas);
blackBackground = new blackBackground_mc();
projectCanvas.addChild(blackBackground);
fadeMenuIn();
addTicker();
soundToggle = new soundToggle_mc();
stage.addChild(soundToggle);
musicToggle = new musicToggle_mc();
stage.addChild(musicToggle);
initialiseSoundToggle();
initialiseMusicToggle();
musicChannel = introMusic.play(0, 100);
musicChannel.soundTransform = introMusicTransform;
soundToggle.x = 565;
soundToggle.y = 11;
musicToggle.x = 539;
musicToggle.y = 7;
}
public function cleanUp():void{
levelTimer = 0;
numberOfSections = 0;
highPolyArray = new Array();
medPolyArray = new Array();
lowPolyArray = new Array();
numberOfAIShips = 0;
aiShipArrayHigh = new Array();
aiShipArrayLow = new Array();
aiShipBody = new Array();
aiProperties = new Array();
aiShadow = new Array();
lap = 0;
splitReached = true;
frameCounter = 0;
waypoint = 0;
frameTimer = 0;
lapTimer = 0;
numberOfBGObjects = 0;
bgObjectArray = new Array();
shipHigh = new Array();
shipAUsed = false;
shipBUsed = false;
shipCUsed = false;
countdownActive = false;
fadeInThrust = false;
fadeOutThrust = false;
thrustVolume = 0;
introMusicVolume = 0.5;
countdownStage = 0;
rotating = false;
zooming = false;
storedX = new Array();
storedZ = new Array();
xArray = new Array();
zArray = new Array();
level = null;
levelContainer = null;
scene = null;
aiStartX = new Array();
aiStartZ = new Array();
accelerateSoundPlaying = false;
constantSoundChannel.stop();
accelerateSoundChannel.stop();
sfxChannel.stop();
projectCanvas.removeChild(gui);
projectCanvas.removeChild(flares);
gui.quitButton.removeEventListener(MouseEvent.MOUSE_DOWN, showConfirmQuit);
projectCanvas.removeEventListener(Event.ENTER_FRAME, gameLoop);
projectCanvas.removeChild(viewport);
projectCanvas.removeChild(background);
stage.removeChild(projectCanvas);
stage.removeChild(debug);
projectCanvas = new Sprite();
stage.addChildAt(projectCanvas, 0);
blackBackground = new blackBackground_mc();
projectCanvas.addChild(blackBackground);
cleanPhysics();
}
public function showShip(_arg1:MouseEvent):void{
var _local2:String;
if (_arg1.target == selectVehicle.buttonZone.coverA){
_local2 = "A";
selectVehicle.shipName.text = "FIRECREST";
selectVehicle.powerMask.width = (25 + (23 * 2));
selectVehicle.handlingMask.width = (25 + (23 * 5));
padlock.visible = false;
shipLocked = false;
};
if (_arg1.target == selectVehicle.buttonZone.coverB){
_local2 = "B";
selectVehicle.shipName.text = "BUZZARD";
selectVehicle.powerMask.width = (25 + (23 * 3));
selectVehicle.handlingMask.width = (25 + (23 * 4));
padlock.visible = false;
shipLocked = false;
};
if (_arg1.target == selectVehicle.buttonZone.coverC){
_local2 = "C";
selectVehicle.shipName.text = "PEREGRINE";
selectVehicle.powerMask.width = (25 + (23 * 4));
selectVehicle.handlingMask.width = (25 + (23 * 3));
if (shipCLocked == true){
padlock.visible = true;
shipLocked = true;
} else {
padlock.visible = false;
shipLocked = false;
};
};
if (_arg1.target == selectVehicle.buttonZone.coverD){
_local2 = "D";
selectVehicle.shipName.text = "CONDOR";
selectVehicle.powerMask.width = (25 + (23 * 5));
selectVehicle.handlingMask.width = (25 + (23 * 2));
if (shipDLocked == true){
padlock.visible = true;
shipLocked = true;
} else {
padlock.visible = false;
shipLocked = false;
};
};
hideShips();
showCovers();
selectVehicle.buttonZone[("cover" + _local2)].alpha = 0;
shipHigh[_local2].visible = true;
playerShipLetter = _local2;
}
public function quitGame(_arg1:MouseEvent):void{
projectCanvas.removeChild(confirmQuit);
confirmQuit.yesButton.removeEventListener(MouseEvent.MOUSE_DOWN, quitGame);
confirmQuit.noButton.removeEventListener(MouseEvent.MOUSE_DOWN, resumeGame);
exitGame();
fadeMenuIn();
addTicker();
}
public function updateBackground():void{
var _local1:Number;
_local1 = ((-((background.sky1.width + background.sky2.width)) * wrapValue(cameraDummy.rotationY)) / 360);
if (_local1 > -(background.sky1.width)){
background.sky1.x = _local1;
background.sky2.x = (_local1 + background.sky1.width);
} else {
background.sky1.x = (_local1 + (2 * background.sky1.width));
background.sky2.x = (_local1 + background.sky1.width);
};
}
public function fadeHighscoresOut(_arg1:MouseEvent):void{
highscores.menuButton.removeEventListener(MouseEvent.MOUSE_DOWN, fadeHighscoresOut);
fadeMenuIn();
highscoresTween = new Tween(highscores, "alpha", None.easeNone, 1, 0, 1, true);
highscoresTween.addEventListener(TweenEvent.MOTION_FINISH, removeHighscores);
}
public function activateSelectTrack(_arg1:TweenEvent):void{
selectTrackTween.removeEventListener(TweenEvent.MOTION_FINISH, activateSelectTrack);
selectTrack.buttonZone.addEventListener(MouseEvent.MOUSE_DOWN, setTrack);
selectTrack.buttonZone.addEventListener(MouseEvent.MOUSE_OVER, showTrackLight);
selectTrack.buttonZone.addEventListener(MouseEvent.MOUSE_OUT, hideTrackLight);
selectTrack.startButton.addEventListener(MouseEvent.MOUSE_DOWN, initVehicleSelect);
}
public function mouseDownHandler(_arg1:MouseEvent):void{
mouseDown = true;
}
public function addTicker():void{
tickerSection = 0;
ticker = new ticker_mc();
stage.addChild(ticker);
ticker.x = 76;
ticker.y = 566;
tickerStart = ticker.mc.textField.x;
ticker.mc.textField.x = (tickerStart + 450);
ticker.mc.textField.text = tickerArray[tickerSection];
ticker.mc.textField.autoSize = TextFieldAutoSize.LEFT;
ticker.addEventListener(Event.ENTER_FRAME, scrollTicker);
}
public function initPhysics():void{
var _local1:b2AABB;
var _local2:b2Vec2;
var _local3:Boolean;
_local1 = new b2AABB();
_local1.minVertex.Set(-1000, -10000);
_local1.maxVertex.Set(10000, 1000);
_local2 = new b2Vec2(0, 0);
_local3 = true;
m_world = new b2World(_local1, _local2, _local3);
}
public function toggleMusic(_arg1:MouseEvent):void{
var _local2:SoundTransform;
var _local3:SoundTransform;
_local2 = musicChannel.soundTransform;
_local3 = gameMusicChannel.soundTransform;
if (musicOn == true){
musicOn = false;
musicToggle.gotoAndStop("offOver");
_local2.volume = 0;
_local3.volume = 0;
musicChannel.soundTransform = _local2;
gameMusicChannel.soundTransform = _local3;
} else {
musicOn = true;
musicToggle.gotoAndStop("onOver");
if (countdownActive == true){
_local2.volume = introMusicVolume;
} else {
_local2.volume = 0.5;
};
musicChannel.soundTransform = _local2;
_local3.volume = gameMusicVolume;
gameMusicChannel.soundTransform = _local3;
};
}
public function updateTime():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
frameTimer++;
_local1 = int((frameTimer / 100));
_local2 = int(((frameTimer - (_local1 * 100)) / 10));
_local3 = ((frameTimer - (_local1 * 100)) - (_local2 * 10));
lapTimer++;
_local4 = int((lapTimer / 100));
_local5 = int(((lapTimer - (_local4 * 100)) / 10));
_local6 = ((lapTimer - (_local4 * 100)) - (_local5 * 10));
gui.time.text = (((String(_local1) + ":") + String(_local2)) + String(_local3));
if ((((lapTimer > 100)) || ((lap < 2)))){
gui.lapTime.text = (((String(_local4) + ":") + String(_local5)) + String(_local6));
gui.message.text = "";
};
}
public function wrapValue(_arg1:Number):Number{
if (_arg1 < 0){
_arg1 = (_arg1 + 360);
};
if (_arg1 > 360){
_arg1 = (_arg1 - 360);
};
return (_arg1);
}
public function fadeInSelectVehicle():void{
selectVehicleTween = new Tween(selectVehicle, "alpha", None.easeNone, 0, 1, 1, true);
selectVehicleTween.addEventListener(TweenEvent.MOTION_FINISH, activateSelectVehicle);
}
public function clip(){
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local1 = 1;
while (_local1 <= numberOfSections) {
_local4 = highPolyArray[_local1].distanceTo(camera);
if (_local4 < nearClipDistance){
highPolyArray[_local1].visible = true;
medPolyArray[_local1].visible = false;
lowPolyArray[_local1].visible = false;
};
if ((((_local4 >= nearClipDistance)) && ((_local4 < medClipDistance)))){
highPolyArray[_local1].visible = false;
medPolyArray[_local1].visible = true;
lowPolyArray[_local1].visible = false;
};
if ((((_local4 >= medClipDistance)) && ((_local4 < farClipDistance)))){
highPolyArray[_local1].visible = false;
medPolyArray[_local1].visible = false;
lowPolyArray[_local1].visible = true;
};
if (_local4 >= farClipDistance){
highPolyArray[_local1].visible = false;
medPolyArray[_local1].visible = false;
lowPolyArray[_local1].visible = false;
};
_local1++;
};
_local2 = 1;
while (_local2 <= numberOfAIShips) {
_local5 = aiShipArrayLow[_local2].distanceTo(camera);
if (_local5 < nearClipDistance){
aiShipArrayLow[_local2].visible = false;
aiShipArrayHigh[_local2].visible = true;
aiShadow[_local2].visible = true;
};
if ((((_local5 >= nearClipDistance)) && ((_local5 < farClipDistance)))){
aiShipArrayLow[_local2].visible = true;
aiShipArrayHigh[_local2].visible = false;
aiShadow[_local2].visible = false;
};
if (_local5 >= farClipDistance){
aiShipArrayLow[_local2].visible = false;
aiShipArrayHigh[_local2].visible = false;
aiShadow[_local2].visible = false;
};
_local2++;
};
_local3 = 1;
while (_local3 <= numberOfBGObjects) {
_local6 = bgObjectArray[_local3].distanceTo(camera);
if (_local6 >= farClipDistance){
bgObjectArray[_local3].visible = false;
} else {
bgObjectArray[_local3].visible = true;
};
_local3++;
};
}
public function fadeMenuOut():void{
menu.playButton.removeEventListener(MouseEvent.MOUSE_DOWN, fadeSelectTrackInOnClick);
menu.instructionsButton.removeEventListener(MouseEvent.MOUSE_DOWN, fadeInstructionsIn);
menu.minijuegos.removeEventListener(MouseEvent.MOUSE_DOWN, gotoMinijuegos);
menu.moreGames.removeEventListener(MouseEvent.MOUSE_DOWN, gotoMinijuegos);
menu.andromedus.removeEventListener(MouseEvent.MOUSE_DOWN, gotoAndromedus);
menuTween = new Tween(menu, "alpha", None.easeNone, 1, 0, 1, true);
menuTween.addEventListener(TweenEvent.MOTION_FINISH, removeMenu);
}
public function fadeInstructionsIn(_arg1:MouseEvent):void{
fadeMenuOut();
instructions = new instructions_mc();
projectCanvas.addChild(instructions);
instructionsTween = new Tween(instructions, "alpha", None.easeNone, 0, 1, 1, true);
instructionsTween.addEventListener(TweenEvent.MOTION_FINISH, activateInstructions);
}
public function submitFail():void{
if (submitSuccess == false){
gameOverScreen.message2.text = "Sorry, could not connect. Try submitting again.";
hsLoader.removeEventListener(Event.COMPLETE, submitCompleteHandler);
gameOverScreen.submitButton.addEventListener(MouseEvent.MOUSE_DOWN, submitHighscore);
};
}
public function createForeground():void{
gui = new gui_mc();
projectCanvas.addChild(gui);
gui.message.text = "";
gui.message2.text = "";
gui.countdown.text = "";
gui.lap.text = ("1/" + numberOfLaps);
positionAverage = 4;
gui.position.text = String(positionAverage);
gui.lastLap.visible = false;
soundToggle.x = 527;
soundToggle.y = 552;
musicToggle.x = 501;
musicToggle.y = 548;
gui.bestLap.text = String((lapRecord[currentLevel] / 100));
if (lapRecord[currentLevel] == 100000){
gui.bestLap.text = "---";
};
gui.raceRecord.text = String((raceRecord[currentLevel] / 100));
if (raceRecord[currentLevel] == 100000){
gui.raceRecord.text = "---";
};
if (currentLevel == 1){
flares = new flares_mc();
projectCanvas.addChild(flares);
flareX = 490;
flareY = 10;
gui.fog1.visible = true;
gui.fog2.visible = false;
gui.fog3.visible = false;
gui.fog4.visible = false;
};
if (currentLevel == 2){
flares = new flares_mc();
projectCanvas.addChild(flares);
flareX = -500;
flareY = 60;
gui.fog1.visible = false;
gui.fog2.visible = true;
gui.fog3.visible = false;
gui.fog4.visible = false;
};
if (currentLevel == 3){
flares = new flares_mc();
projectCanvas.addChild(flares);
flareX = 1000;
flareY = 60;
gui.fog1.visible = false;
gui.fog2.visible = false;
gui.fog3.visible = true;
gui.fog4.visible = false;
};
if (currentLevel == 4){
flares = new flares_mc();
projectCanvas.addChild(flares);
flareX = -600;
flareY = 60;
gui.fog1.visible = false;
gui.fog2.visible = false;
gui.fog3.visible = false;
gui.fog4.visible = true;
};
}
public function createBackground():void{
if (currentLevel == 1){
background = new background1_mc();
};
if (currentLevel == 2){
background = new background2_mc();
};
if (currentLevel == 3){
background = new background3_mc();
};
if (currentLevel == 4){
background = new background4_mc();
};
projectCanvas.addChild(background);
}
public function updateFPS():void{
var _local1:Date;
_local1 = new Date();
fpsNewTime = _local1.getTime();
fpsElapsedTime = (fpsNewTime - fpsStartTime);
fpsCounter++;
if (fpsCounter == 99){
fpsCounter = 0;
fps = int((100 / (fpsElapsedTime / 1000)));
fpsStartTime = fpsNewTime;
};
debug.fps.text = ("fps " + String(fps));
}
public function createCube(_arg1:Number, _arg2:Number):void{
}
public function createTower(_arg1, _arg2):void{
var _local3:LibraryCollada;
numberOfBGObjects++;
_local3 = new LibraryCollada(xmlArray["towerXML"]);
scene.addChild(_local3);
_local3.scale = -0.0005;
_local3.pitch(180);
_local3.x = (_arg1 * scaleFactor);
_local3.y = 0;
_local3.z = ((levelContainer.height - _arg2) * scaleFactor);
bgObjectArray[numberOfBGObjects] = _local3;
}
public function init3D():void{
Papervision3D.VERBOSE = false;
viewport = new Viewport3D(600, 600, false, false, true, true);
projectCanvas.addChild(viewport);
viewport.x = 0;
viewport.y = 0;
scene = new Scene3D();
camera = new FreeCamera3D();
camera.x = ((stage.stageWidth / 2) * scaleFactor);
camera.y = (10 + 5);
camera.z = 0;
camera.focus = 150;
camera.zoom = 3;
createCameraDummy();
renderer = new BasicRenderEngine();
}
public function updateCountdown(_arg1:TimerEvent):void{
countdownStage++;
if (countdownStage < 4){
rotating = false;
gui.countdown.text = "GET READY";
render();
};
if (countdownStage == 4){
if (soundOn == true){
beepLowSound.play();
};
gui.countdown.text = "3";
rotating = true;
camSpeed = 20;
render();
};
if (countdownStage == 5){
if (soundOn == true){
beepLowSound.play();
};
gui.countdown.text = "2";
render();
};
if (countdownStage == 6){
if (soundOn == true){
beepLowSound.play();
};
gui.countdown.text = "1";
render();
};
if (countdownStage == 7){
if (soundOn == true){
beepHighSound.play();
};
gui.countdown.text = "GO!";
gameRunning = true;
countdownActive = false;
camSpeed = 10;
gameMusicChannel = gameMusic.play(0, 10);
if (musicOn == true){
gameMusicVolume = 0.7;
} else {
gameMusicVolume = 0;
};
gameMusicTransform = new SoundTransform(gameMusicVolume, 0);
gameMusicChannel.soundTransform = gameMusicTransform;
if (soundOn == true){
sfxChannel = whooshSound.play();
};
};
if (countdownStage == 8){
gui.countdown.visible = false;
gui.quitButton.addEventListener(MouseEvent.MOUSE_DOWN, showConfirmQuit);
};
}
public function recordLap():void{
var _local1:Number;
var _local2:Number;
if ((((lap > 0)) && ((record == true)))){
frameCounter++;
if (frameCounter == 30){
frameCounter = 0;
_local1 = (Math.round((ship.x * 10)) / 10);
_local2 = (Math.round((ship.z * 10)) / 10);
dataX = (dataX + (String(_local1) + "*"));
dataZ = (dataZ + (String(_local2) + "*"));
};
};
}
public function musicUp(_arg1:MouseEvent):void{
if (musicOn == true){
musicToggle.gotoAndStop("onUp");
} else {
musicToggle.gotoAndStop("offUp");
};
}
public function checkInput():void{
}
public function cleanPhysics():void{
var _local1:b2Body;
var _local2:*;
var _local3:b2Body;
var _local4:*;
_local1 = m_world.m_bodyList;
_local2 = m_world.m_bodyCount;
_local4 = 0;
while (_local4 < (_local2 - 1)) {
_local3 = _local1;
_local1 = _local1.m_next;
m_world.DestroyBody(_local3);
if ((((_local3.hasOwnProperty("m_userData") == true)) && (!((_local3.m_userData == null))))){
_local3.m_userData = null;
};
_local4++;
};
}
public function updateGUI():void{
gui.position.text = (String(positionAverage) + "/4");
}
public function removeHighscores(_arg1:TweenEvent):void{
highscoresTween.removeEventListener(TweenEvent.MOTION_FINISH, removeHighscores);
projectCanvas.removeChild(highscores);
}
public function fadeOutIntroMusic():void{
if (musicOn == true){
if (introMusicVolume > 0){
introMusicTransform = new SoundTransform(introMusicVolume, 0);
musicChannel.soundTransform = introMusicTransform;
introMusicVolume = (introMusicVolume - 0.004);
if (introMusicVolume <= 0){
introMusicVolume = 0;
musicChannel.stop();
};
};
};
}
public function createLevel(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:DisplayObject;
levelContainer = new levelContainer_mc();
level = levelContainer.getChildAt((currentLevel - 1));
_local2 = level.numChildren;
_local3 = iteration;
_local4 = ((200 * _local3) / _local2);
levelLoader.bar.width = _local4;
levelLoader.percentage.text = (String(Math.round(((100 * _local3) / _local2))) + " %");
_local5 = level.getChildAt(iteration);
if ((_local5 is playerShip_template)){
createShip(_local5.x, _local5.y);
};
if ((_local5 is aiShip_template)){
createAIShip(_local5.x, _local5.y);
};
if ((_local5 is cube_template)){
createCube(_local5.x, _local5.y);
};
if ((_local5 is straightV_template)){
createBasicSection(_local5.x, _local5.y, 0, "straight");
};
if ((_local5 is straightH_template)){
createBasicSection(_local5.x, _local5.y, 90, "straight");
};
if ((_local5 is bend1_template)){
createBasicSection(_local5.x, _local5.y, 180, "sharpBend");
};
if ((_local5 is bend7_template)){
createBasicSection(_local5.x, _local5.y, -90, "sharpBend");
};
if ((_local5 is bend9_template)){
createBasicSection(_local5.x, _local5.y, 0, "sharpBend");
};
if ((_local5 is bend3_template)){
createBasicSection(_local5.x, _local5.y, 90, "sharpBend");
};
if ((_local5 is curveLong1_template)){
createBasicSection(_local5.x, _local5.y, 180, "curveLong");
};
if ((_local5 is curveLong7_template)){
createBasicSection(_local5.x, _local5.y, -90, "curveLong");
};
if ((_local5 is curveLong9_template)){
createBasicSection(_local5.x, _local5.y, 0, "curveLong");
};
if ((_local5 is curveLong3_template)){
createBasicSection(_local5.x, _local5.y, 90, "curveLong");
};
if ((_local5 is diagonalForward_template)){
createBasicSection(_local5.x, _local5.y, 90, "diagonal");
};
if ((_local5 is diagonalBackward_template)){
createBasicSection(_local5.x, _local5.y, 0, "diagonal");
};
if ((_local5 is sToDLeft1_template)){
createBasicSection(_local5.x, _local5.y, 180, "sToDRight");
};
if ((_local5 is sToDLeft7_template)){
createBasicSection(_local5.x, _local5.y, -90, "sToDRight");
};
if ((_local5 is sToDLeft9_template)){
createBasicSection(_local5.x, _local5.y, 0, "sToDRight");
};
if ((_local5 is sToDLeft3_template)){
createBasicSection(_local5.x, _local5.y, 90, "sToDRight");
};
if ((_local5 is sToDRight1_template)){
createBasicSection(_local5.x, _local5.y, -90, "sToDLeft");
};
if ((_local5 is sToDRight7_template)){
createBasicSection(_local5.x, _local5.y, 0, "sToDLeft");
};
if ((_local5 is sToDRight9_template)){
createBasicSection(_local5.x, _local5.y, 90, "sToDLeft");
};
if ((_local5 is sToDRight3_template)){
createBasicSection(_local5.x, _local5.y, 180, "sToDLeft");
};
if ((_local5 is wallV_template)){
createWallV(_local5.x, _local5.y, _local5.width, _local5.height);
};
if ((_local5 is wallH_template)){
createWallH(_local5.x, _local5.y, _local5.width, _local5.height);
};
if ((_local5 is startBridge_template)){
createStartBridge(_local5.x, _local5.y);
};
if ((_local5 is grandstand_template)){
createGrandstand(_local5.x, _local5.y, _local5.rotation);
};
if ((_local5 is pyramid_template)){
createPyramid(_local5.x, _local5.y);
};
if ((_local5 is tower_template)){
createTower(_local5.x, _local5.y);
};
if ((_local5 is tower2_template)){
createTower2(_local5.x, _local5.y);
};
if ((_local5 is tower3_template)){
createTower3(_local5.x, _local5.y);
};
if ((_local5 is diagonalWallForward_template)){
createDiagonalWall(_local5.x, _local5.y, _local5.width, 45);
};
if ((_local5 is diagonalWallBackward_template)){
createDiagonalWall(_local5.x, _local5.y, _local5.width, -45);
};
iteration++;
if (iteration > (level.numChildren - 1)){
projectCanvas.removeChild(levelLoader);
stage.removeEventListener(Event.ENTER_FRAME, createLevel);
stage.frameRate = frameRate;
initGame();
};
}
}
}//package xpr_fla
Section 180
//minijuegos_mc_7 (xpr_fla.minijuegos_mc_7)
package xpr_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class minijuegos_mc_7 extends MovieClip {
public function minijuegos_mc_7(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(MouseEvent.MOUSE_DOWN, gotoMinijuegos);
}
public function gotoMinijuegos(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.minijuegos.com";
_local3 = new URLRequest(_local2);
navigateToURL(_local3);
}
}
}//package xpr_fla
Section 181
//Symbol4_3 (xpr_fla.Symbol4_3)
package xpr_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class Symbol4_3 extends MovieClip {
public function Symbol4_3(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(MouseEvent.MOUSE_DOWN, gotoAndromedus);
}
public function gotoAndromedus(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLRequest;
_local2 = "http://www.andromedus.com";
_local3 = new URLRequest(_local2);
navigateToURL(_local3);
}
}
}//package xpr_fla
Section 182
//textField_mc_121 (xpr_fla.textField_mc_121)
package xpr_fla {
import flash.display.*;
import flash.text.*;
public dynamic class textField_mc_121 extends MovieClip {
public var textField:TextField;
}
}//package xpr_fla
Section 183
//trackButtonZone_mc_71 (xpr_fla.trackButtonZone_mc_71)
package xpr_fla {
import flash.display.*;
public dynamic class trackButtonZone_mc_71 extends MovieClip {
public var light:MovieClip;
public var coverA:MovieClip;
public var coverB:MovieClip;
public var coverD:MovieClip;
public var coverC:MovieClip;
}
}//package xpr_fla
Section 184
//vehicleButtonZone_mc_98 (xpr_fla.vehicleButtonZone_mc_98)
package xpr_fla {
import flash.display.*;
public dynamic class vehicleButtonZone_mc_98 extends MovieClip {
public var light:MovieClip;
public var coverA:MovieClip;
public var coverB:MovieClip;
public var coverD:MovieClip;
public var coverC:MovieClip;
}
}//package xpr_fla
Section 185
//accelerate (accelerate)
package {
import flash.media.*;
public dynamic class accelerate extends Sound {
}
}//package
Section 186
//aiMarker_mc (aiMarker_mc)
package {
import flash.display.*;
public dynamic class aiMarker_mc extends MovieClip {
}
}//package
Section 187
//aiShip_template (aiShip_template)
package {
import flash.display.*;
public dynamic class aiShip_template extends MovieClip {
}
}//package
Section 188
//background1_mc (background1_mc)
package {
import flash.display.*;
public dynamic class background1_mc extends MovieClip {
public var sky1:MovieClip;
public var sky2:MovieClip;
}
}//package
Section 189
//background2_mc (background2_mc)
package {
import flash.display.*;
public dynamic class background2_mc extends MovieClip {
public var sky1:MovieClip;
public var sky2:MovieClip;
}
}//package
Section 190
//background3_mc (background3_mc)
package {
import flash.display.*;
public dynamic class background3_mc extends MovieClip {
public var sky1:MovieClip;
public var sky2:MovieClip;
}
}//package
Section 191
//background4_mc (background4_mc)
package {
import flash.display.*;
public dynamic class background4_mc extends MovieClip {
public var sky1:MovieClip;
public var sky2:MovieClip;
}
}//package
Section 192
//beepHigh (beepHigh)
package {
import flash.media.*;
public dynamic class beepHigh extends Sound {
}
}//package
Section 193
//beepLow (beepLow)
package {
import flash.media.*;
public dynamic class beepLow extends Sound {
}
}//package
Section 194
//bend1_template (bend1_template)
package {
import flash.display.*;
public dynamic class bend1_template extends MovieClip {
}
}//package
Section 195
//bend3_template (bend3_template)
package {
import flash.display.*;
public dynamic class bend3_template extends MovieClip {
}
}//package
Section 196
//bend7_template (bend7_template)
package {
import flash.display.*;
public dynamic class bend7_template extends MovieClip {
}
}//package
Section 197
//bend9_template (bend9_template)
package {
import flash.display.*;
public dynamic class bend9_template extends MovieClip {
}
}//package
Section 198
//black (black)
package {
import flash.display.*;
public dynamic class black extends BitmapData {
public function black(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 199
//blackBackground_mc (blackBackground_mc)
package {
import flash.display.*;
public dynamic class blackBackground_mc extends MovieClip {
}
}//package
Section 200
//blueDark (blueDark)
package {
import flash.display.*;
public dynamic class blueDark extends BitmapData {
public function blueDark(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 201
//blueLight (blueLight)
package {
import flash.display.*;
public dynamic class blueLight extends BitmapData {
public function blueLight(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 202
//blueMed (blueMed)
package {
import flash.display.*;
public dynamic class blueMed extends BitmapData {
public function blueMed(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 203
//collision1 (collision1)
package {
import flash.media.*;
public dynamic class collision1 extends Sound {
}
}//package
Section 204
//collision2 (collision2)
package {
import flash.media.*;
public dynamic class collision2 extends Sound {
}
}//package
Section 205
//collision3 (collision3)
package {
import flash.media.*;
public dynamic class collision3 extends Sound {
}
}//package
Section 206
//collision4 (collision4)
package {
import flash.media.*;
public dynamic class collision4 extends Sound {
}
}//package
Section 207
//confirmQuit_mc (confirmQuit_mc)
package {
import flash.display.*;
public dynamic class confirmQuit_mc extends MovieClip {
public var noButton:SimpleButton;
public var yesButton:SimpleButton;
}
}//package
Section 208
//constant (constant)
package {
import flash.media.*;
public dynamic class constant extends Sound {
}
}//package
Section 209
//cube_template (cube_template)
package {
import flash.display.*;
public dynamic class cube_template extends MovieClip {
}
}//package
Section 210
//curveLong1_template (curveLong1_template)
package {
import flash.display.*;
public dynamic class curveLong1_template extends MovieClip {
}
}//package
Section 211
//curveLong3_template (curveLong3_template)
package {
import flash.display.*;
public dynamic class curveLong3_template extends MovieClip {
}
}//package
Section 212
//curveLong7_template (curveLong7_template)
package {
import flash.display.*;
public dynamic class curveLong7_template extends MovieClip {
}
}//package
Section 213
//curveLong9_template (curveLong9_template)
package {
import flash.display.*;
public dynamic class curveLong9_template extends MovieClip {
}
}//package
Section 214
//curveLongLowTexture (curveLongLowTexture)
package {
import flash.display.*;
public dynamic class curveLongLowTexture extends BitmapData {
public function curveLongLowTexture(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 215
//darkGrey (darkGrey)
package {
import flash.display.*;
public dynamic class darkGrey extends BitmapData {
public function darkGrey(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 216
//debug_mc (debug_mc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class debug_mc extends MovieClip {
public var fps:TextField;
}
}//package
Section 217
//diagonalBackward_template (diagonalBackward_template)
package {
import flash.display.*;
public dynamic class diagonalBackward_template extends MovieClip {
}
}//package
Section 218
//diagonalForward_template (diagonalForward_template)
package {
import flash.display.*;
public dynamic class diagonalForward_template extends MovieClip {
}
}//package
Section 219
//diagonalWallBackward_template (diagonalWallBackward_template)
package {
import flash.display.*;
public dynamic class diagonalWallBackward_template extends MovieClip {
}
}//package
Section 220
//diagonalWallForward_template (diagonalWallForward_template)
package {
import flash.display.*;
public dynamic class diagonalWallForward_template extends MovieClip {
}
}//package
Section 221
//flares_mc (flares_mc)
package {
import flash.display.*;
public dynamic class flares_mc extends MovieClip {
public var f6:MovieClip;
public var f4:MovieClip;
public var f1:MovieClip;
public var f5:MovieClip;
public var f3:MovieClip;
public var f2:MovieClip;
}
}//package
Section 222
//fog3_mc (fog3_mc)
package {
import flash.display.*;
public dynamic class fog3_mc extends MovieClip {
}
}//package
Section 223
//gameOverScreen_mc (gameOverScreen_mc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class gameOverScreen_mc extends MovieClip {
public var message2:TextField;
public var message1:TextField;
public var playerName:TextField;
public var submitButton:SimpleButton;
public var cup1:MovieClip;
public var continueButton:SimpleButton;
public var cup2:MovieClip;
public var playAgain:SimpleButton;
}
}//package
Section 224
//grandstand_template (grandstand_template)
package {
import flash.display.*;
public dynamic class grandstand_template extends MovieClip {
}
}//package
Section 225
//greenDark (greenDark)
package {
import flash.display.*;
public dynamic class greenDark extends BitmapData {
public function greenDark(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 226
//greenLight (greenLight)
package {
import flash.display.*;
public dynamic class greenLight extends BitmapData {
public function greenLight(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 227
//greenMed (greenMed)
package {
import flash.display.*;
public dynamic class greenMed extends BitmapData {
public function greenMed(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 228
//greySquares1 (greySquares1)
package {
import flash.display.*;
public dynamic class greySquares1 extends BitmapData {
public function greySquares1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 229
//greySquares2 (greySquares2)
package {
import flash.display.*;
public dynamic class greySquares2 extends BitmapData {
public function greySquares2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 230
//greySquares3 (greySquares3)
package {
import flash.display.*;
public dynamic class greySquares3 extends BitmapData {
public function greySquares3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 231
//greyStripes (greyStripes)
package {
import flash.display.*;
public dynamic class greyStripes extends BitmapData {
public function greyStripes(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 232
//gui_mc (gui_mc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class gui_mc extends MovieClip {
public var lapTime:TextField;
public var message2:TextField;
public var message:TextField;
public var bestLap:TextField;
public var position:TextField;
public var lastLap:MovieClip;
public var countdown:TextField;
public var fog1:MovieClip;
public var fog3:MovieClip;
public var fog2:fog3_mc;
public var fog4:MovieClip;
public var quitButton:SimpleButton;
public var raceRecord:TextField;
public var lap:TextField;
public var time:TextField;
}
}//package
Section 233
//highscores_mc (highscores_mc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class highscores_mc extends MovieClip {
public var menuButton:SimpleButton;
public var nameDisplay:TextField;
public var scoreDisplay:TextField;
public var connectingDisplay:TextField;
public var rankDisplay:TextField;
}
}//package
Section 234
//instructions_mc (instructions_mc)
package {
import flash.display.*;
public dynamic class instructions_mc extends MovieClip {
public var menuButton:SimpleButton;
public var andromedus:SimpleButton;
public var minijuegos:SimpleButton;
}
}//package
Section 235
//levelContainer_mc (levelContainer_mc)
package {
import flash.display.*;
public dynamic class levelContainer_mc extends MovieClip {
}
}//package
Section 236
//levelLoader_mc (levelLoader_mc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class levelLoader_mc extends MovieClip {
public var bar:MovieClip;
public var percentage:TextField;
public var controls:MovieClip;
}
}//package
Section 237
//lightGrey (lightGrey)
package {
import flash.display.*;
public dynamic class lightGrey extends BitmapData {
public function lightGrey(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 238
//magenta (magenta)
package {
import flash.display.*;
public dynamic class magenta extends BitmapData {
public function magenta(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 239
//menu_mc (menu_mc)
package {
import flash.display.*;
public dynamic class menu_mc extends MovieClip {
public var instructionsButton:SimpleButton;
public var moreGames:SimpleButton;
public var playButton:SimpleButton;
public var andromedus:SimpleButton;
public var minijuegos:SimpleButton;
}
}//package
Section 240
//menuMusic (menuMusic)
package {
import flash.media.*;
public dynamic class menuMusic extends Sound {
}
}//package
Section 241
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 242
//musicToggle_mc (musicToggle_mc)
package {
import flash.display.*;
public dynamic class musicToggle_mc extends MovieClip {
public function musicToggle_mc(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 243
//padlock_mc (padlock_mc)
package {
import flash.display.*;
public dynamic class padlock_mc extends MovieClip {
}
}//package
Section 244
//playerMarker_mc (playerMarker_mc)
package {
import flash.display.*;
public dynamic class playerMarker_mc extends MovieClip {
}
}//package
Section 245
//playerShip_template (playerShip_template)
package {
import flash.display.*;
public dynamic class playerShip_template extends MovieClip {
}
}//package
Section 246
//preloader_mc (preloader_mc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class preloader_mc extends MovieClip {
public var loadingBar:MovieClip;
public var loadingText:TextField;
public var continueButton:SimpleButton;
}
}//package
Section 247
//pyramid_template (pyramid_template)
package {
import flash.display.*;
public dynamic class pyramid_template extends MovieClip {
}
}//package
Section 248
//redDark (redDark)
package {
import flash.display.*;
public dynamic class redDark extends BitmapData {
public function redDark(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 249
//redLight (redLight)
package {
import flash.display.*;
public dynamic class redLight extends BitmapData {
public function redLight(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 250
//redMed (redMed)
package {
import flash.display.*;
public dynamic class redMed extends BitmapData {
public function redMed(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 251
//redSquares (redSquares)
package {
import flash.display.*;
public dynamic class redSquares extends BitmapData {
public function redSquares(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 252
//selectTrack_mc (selectTrack_mc)
package {
import flash.display.*;
public dynamic class selectTrack_mc extends MovieClip {
public var buttonZone:MovieClip;
public var track2Lock:padlock_mc;
public var track4Lock:padlock_mc;
public var startButton:SimpleButton;
public var track3Lock:padlock_mc;
}
}//package
Section 253
//selectVehicle_mc (selectVehicle_mc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class selectVehicle_mc extends MovieClip {
public var buttonZone:MovieClip;
public var start:SimpleButton;
public var handlingMask:MovieClip;
public var powerMask:MovieClip;
public var shipName:TextField;
}
}//package
Section 254
//shipTexture0 (shipTexture0)
package {
import flash.display.*;
public dynamic class shipTexture0 extends BitmapData {
public function shipTexture0(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 255
//shipTexture1 (shipTexture1)
package {
import flash.display.*;
public dynamic class shipTexture1 extends BitmapData {
public function shipTexture1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 256
//shipTexture2 (shipTexture2)
package {
import flash.display.*;
public dynamic class shipTexture2 extends BitmapData {
public function shipTexture2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 257
//shipTexture3 (shipTexture3)
package {
import flash.display.*;
public dynamic class shipTexture3 extends BitmapData {
public function shipTexture3(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 258
//shipTexture4 (shipTexture4)
package {
import flash.display.*;
public dynamic class shipTexture4 extends BitmapData {
public function shipTexture4(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 259
//shipTexture5 (shipTexture5)
package {
import flash.display.*;
public dynamic class shipTexture5 extends BitmapData {
public function shipTexture5(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 260
//shipTexture6 (shipTexture6)
package {
import flash.display.*;
public dynamic class shipTexture6 extends BitmapData {
public function shipTexture6(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 261
//shipTexture7 (shipTexture7)
package {
import flash.display.*;
public dynamic class shipTexture7 extends BitmapData {
public function shipTexture7(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 262
//soundContainer (soundContainer)
package {
import flash.display.*;
public dynamic class soundContainer extends MovieClip {
}
}//package
Section 263
//soundToggle_mc (soundToggle_mc)
package {
import flash.display.*;
public dynamic class soundToggle_mc extends MovieClip {
public function soundToggle_mc(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 264
//startBridge_template (startBridge_template)
package {
import flash.display.*;
public dynamic class startBridge_template extends MovieClip {
}
}//package
Section 265
//sToDLeft1_template (sToDLeft1_template)
package {
import flash.display.*;
public dynamic class sToDLeft1_template extends MovieClip {
}
}//package
Section 266
//sToDLeft3_template (sToDLeft3_template)
package {
import flash.display.*;
public dynamic class sToDLeft3_template extends MovieClip {
}
}//package
Section 267
//sToDLeft7_template (sToDLeft7_template)
package {
import flash.display.*;
public dynamic class sToDLeft7_template extends MovieClip {
}
}//package
Section 268
//sToDLeft9_template (sToDLeft9_template)
package {
import flash.display.*;
public dynamic class sToDLeft9_template extends MovieClip {
}
}//package
Section 269
//sToDRight1_template (sToDRight1_template)
package {
import flash.display.*;
public dynamic class sToDRight1_template extends MovieClip {
}
}//package
Section 270
//sToDRight3_template (sToDRight3_template)
package {
import flash.display.*;
public dynamic class sToDRight3_template extends MovieClip {
}
}//package
Section 271
//sToDRight7_template (sToDRight7_template)
package {
import flash.display.*;
public dynamic class sToDRight7_template extends MovieClip {
}
}//package
Section 272
//sToDRight9_template (sToDRight9_template)
package {
import flash.display.*;
public dynamic class sToDRight9_template extends MovieClip {
}
}//package
Section 273
//straightH_template (straightH_template)
package {
import flash.display.*;
public dynamic class straightH_template extends MovieClip {
}
}//package
Section 274
//straightV_template (straightV_template)
package {
import flash.display.*;
public dynamic class straightV_template extends MovieClip {
}
}//package
Section 275
//ticker_mc (ticker_mc)
package {
import flash.display.*;
public dynamic class ticker_mc extends MovieClip {
public var mc:MovieClip;
}
}//package
Section 276
//tower_template (tower_template)
package {
import flash.display.*;
public dynamic class tower_template extends MovieClip {
}
}//package
Section 277
//tower2_template (tower2_template)
package {
import flash.display.*;
public dynamic class tower2_template extends MovieClip {
}
}//package
Section 278
//tower3_template (tower3_template)
package {
import flash.display.*;
public dynamic class tower3_template extends MovieClip {
}
}//package
Section 279
//wallH_template (wallH_template)
package {
import flash.display.*;
public dynamic class wallH_template extends MovieClip {
}
}//package
Section 280
//wallV_template (wallV_template)
package {
import flash.display.*;
public dynamic class wallV_template extends MovieClip {
}
}//package
Section 281
//whoosh (whoosh)
package {
import flash.media.*;
public dynamic class whoosh extends Sound {
}
}//package
Section 282
//xprMusic2 (xprMusic2)
package {
import flash.media.*;
public dynamic class xprMusic2 extends Sound {
}
}//package
Section 283
//yellow (yellow)
package {
import flash.display.*;
public dynamic class yellow extends BitmapData {
public function yellow(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 284
//yellowAndGrey (yellowAndGrey)
package {
import flash.display.*;
public dynamic class yellowAndGrey extends BitmapData {
public function yellowAndGrey(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 285
//yellowDark (yellowDark)
package {
import flash.display.*;
public dynamic class yellowDark extends BitmapData {
public function yellowDark(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 286
//yellowMed (yellowMed)
package {
import flash.display.*;
public dynamic class yellowMed extends BitmapData {
public function yellowMed(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package