STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
229593
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2595 · P5190

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/39138606?noj=FRM39138606-21DC" width="1" height="1"></div>

Kinetikz.swf

This is the info page for
Flash #30027

(Click the ID number above for more basic data on this flash file.)


Text
A

Restart

Restart

START

text

Restart

Restart

Quit

Quit

level 1

score 0

discs 0

Music On

Music Off

Sound On

Sound Off

1. Move the mouse
to aim the gun

2. Click the mouse
to fire a disc

3. Get the puck to the target,
and don't run out of discs!

You can restart the current level
at any time, but you won't get
your discs back!

Quit game

Back to
menu

instructions >>

intro >>

sounds

hint

2

K

i

n

e

t

i

k

z

Play

More Games

More Games

Instructions

High Scores

Gaming News

Developed by

<p align="center"><font face="Harquil" size="15" color="#ffff00" letterSpacing="0.000000" kerning="0"><a href="http://www.andromedus.com" target = "_blank">andromedus.com</a></font></p>

Sponsored by

<p align="center"><font face="Harquil" size="15" color="#ffff00" letterSpacing="0.000000" kerning="0"><a href="http://www.armorgames.com" target = "_blank">armorgames.com</a></font></p>

Sound On

Music On

100 point bonus and 7 extra discs per level

300 point bonus and 4 extra discs per level

500 point bonus per level and unlimited discs

Easy

Hard

Free Play

X

message

Congratulations

You cleared all levels and scored 000

Player 1

Submit

Retry Level

Level Complete

Bonus Info

Continue

Are you sure you
want to quit?

Yes

No

ActionScript [AS3]

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
//andromedusIntro_mc_41 (kinetikz_unlocked_fla.andromedusIntro_mc_41) package kinetikz_unlocked_fla { import flash.display.*; public dynamic class andromedusIntro_mc_41 extends MovieClip { public function andromedusIntro_mc_41(){ addFrameScript(160, frame161); } function frame161(){ MovieClip(parent).gotoAndStop(5); } } }//package kinetikz_unlocked_fla
Section 64
//difficultyMenu_mc_115 (kinetikz_unlocked_fla.difficultyMenu_mc_115) package kinetikz_unlocked_fla { import flash.display.*; public dynamic class difficultyMenu_mc_115 extends MovieClip { public var padlock:MovieClip; public var freeButton:SimpleButton; public var easyButton:SimpleButton; public var back:SimpleButton; public var hardButton:SimpleButton; } }//package kinetikz_unlocked_fla
Section 65
//MainTimeline (kinetikz_unlocked_fla.MainTimeline) package kinetikz_unlocked_fla { import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.Contacts.*; import Box2D.Dynamics.Joints.*; import Box2D.Dynamics.*; import Box2D.Collision.*; import flash.display.*; import flash.events.*; import flash.net.*; import Box2D.Common.*; import flash.media.*; import flash.text.*; import flash.system.*; import flash.geom.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.external.*; import flash.filters.*; import flash.printing.*; import flash.ui.*; import flash.utils.*; import flash.xml.*; public dynamic class MainTimeline extends MovieClip { public var boxSound:box; public var m_physScale:Number; public var mini_mouseIsDown:Boolean; public var hsname:String; public var guiTop:MovieClip; public var mini_m_physScale:Number; public var shootSound:shoot; public var myPreloader:MovieClip; public var startButton:SimpleButton; public var startDiscs:uint; public var m_iterations:int; public var startLevel:uint; public var confirmQuitVisible:Boolean; public var linkFollowed:Boolean; public var ballSound:ball1; public var metalSound:metal; public var discsUsed:uint; public var padlockOff:Boolean; public var armorIntro:MovieClip; public var andromedusIntro:MovieClip; public var finished:Boolean; public var numberOfLevels:uint; public var crosshairs:crosshair; public var hint:Array; public var score:Number; public var winSound:win; public var targetReached:Boolean; public var bonusDiscs:Array; public var allowedURL:String; public var puckOutSound:puckOut; public var puckTouchingWall:Boolean; public var newDiscSound:newDisc; public var guiBack:MovieClip; public var m_timeStep:Number; public var levelCompleteVisible:Boolean; public var kinetikzSound:kinetikz; public var levelComplete:levelComplete_mc; public var disableMouseDown:Boolean; public var gameoverSound:gameover; public var submitSuccess:Boolean; public var musicOn:Boolean; public var hs:URLLoader; public var lastPuckPosition:b2Vec2; public var confirmQuit:confirmQuit_mc; public var mini_m_iterations:int; public var gameOverCounter:uint; public var currentURL:String; public var securityOn:Boolean; public var gameWon:Boolean; public var m_world:b2World; public var soundOn:Boolean; public var mini_gun:gun_mc; public var mini_m_world:b2World; public var gun:MovieClip; public var turretY:Number; public var gameRunning:Boolean; public var menu:menu_mc; public var turretX:Number; public var travelator:Array; public var mini_crosshairs:crosshair; public var loadToStage:MovieClip; public var discActive:Array; public var mini_turretY:Number; public var mini_turretX:Number; public var currentLevel:uint; public var target:target_mc; public var channel1:SoundChannel; public var lastPuckRotation:Number; public var discs:uint; public var instructions:instructions_mc; public var actorCanvas:MovieClip; public var mini_m_timeStep:Number; public var difficulty:String; public var retryLevel:Boolean; public var newLevelSound:newLevel; public var mini_actorCanvas:MovieClip; public var levelRestarted:Boolean; public var mini_disableMouseDown:Boolean; public var numberOfBonusDiscs:uint; public var lastBody1:b2Body; public var lastBody2:b2Body; public var numberOfTravelators:uint; public var mouseIsDown:Boolean; public var gameOverScreen:gameOverScreen_mc; public var targetSound:target2; public function MainTimeline(){ addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5); } public function mini_createLevel():void{ spawnWallH(300, 0); spawnWallV(0, 300); spawnWallV(600, 300); spawnLetter("A", 100, 100); spawnLetter("R", 140, 100); spawnLetter("M", 180, 100); spawnLetter("O", 220, 100); spawnLetter("R", 260, 100); spawnLetter("G", 100, 140); spawnLetter("A", 140, 140); spawnLetter("M", 180, 140); spawnLetter("E", 220, 140); spawnLetter("S", 260, 140); } public function submitToArmorbot(_arg1, _arg2):URLLoader{ var _local3:URLRequest; var _local4:URLVariables; var _local5:Number; var _local6:String; var _local7:URLLoader; _local3 = new URLRequest("http://rankz.armorbot.com/submit/as3_v0.php"); _local3.method = URLRequestMethod.POST; _local4 = new URLVariables(); _local4.flashkey = "V01TbERsc0g="; _local4.SU0249 = "MjM5MmolZSVhJW4lcw=="; _local4.bmFtZTE = _arg1; _local5 = _arg2; _local6 = (_local5 + "Z"); _local4.c2NvcmUx = _local6.split("0").join("U"); _local4.c2NvcmUx = _local4.c2NvcmUx.split("").join("A"); _local4.c2NvcmUx = _local4.c2NvcmUx.split("AU").join("Y"); _local4.c2NvcmUx = _local4.c2NvcmUx.split("A1").join("B"); _local4.c2NvcmUx = _local4.c2NvcmUx.split(".").join("N"); _local3.data = _local4; _local7 = new URLLoader(); _local7.dataFormat = URLLoaderDataFormat.TEXT; _local7.load(_local3); return (_local7); } 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)); myPreloader.loadingBar.width = (4 * _local4); myPreloader.loadingText.text = (("Loading: " + String(_local4)) + "%"); if ((((_local3 >= _local2)) && ((finished == false)))){ myPreloader.loadingText.text = "Loading: 100%"; end_preload(); finished = true; }; playMiniGame(); } public function submit(_arg1:String, _arg2:Number):URLLoader{ var _local3:URLVariables; var _local4:URLRequest; var _local5:URLLoader; _local3 = new URLVariables(); _local3.hsname = hsname; _local3.score = String(_arg2); _local4 = new URLRequest("http://www.andromedus.com/scripts/insert_score.php"); _local4.data = _local3; _local4.method = URLRequestMethod.POST; _local5 = new URLLoader(); _local5.dataFormat = URLLoaderDataFormat.TEXT; _local5.load(_local4); return (_local5); } public function toggleSound(_arg1:MouseEvent):void{ if (soundOn == true){ soundOn = false; menu.soundBox.alpha = 0; } else { soundOn = true; menu.soundBox.alpha = 1; }; } public function spawnBall(_arg1:b2Body, _arg2:Number, _arg3:Number){ var _local4:*; var _local5:*; var _local6:roundShadow_mc; _local4 = new b2BodyDef(); _local5 = new b2CircleDef(); _local5.radius = 10; _local5.friction = 1; _local5.density = 1; _local5.restitution = 1; _local4.AddShape(_local5); _local4.userData = new ball_mc(); _local4.position.Set(_arg2, _arg3); _local4.linearDamping = 0.02; _local4.angularDamping = 0.02; _local4.userData.width = (_local5.radius * 2); _local4.userData.height = (_local5.radius * 2); _local4.userData.id = "ball"; actorCanvas.addChild(_local4.userData); _local4.userData.roundShadow = new roundShadow_mc(); _local4.userData.roundShadow.width = (_local5.radius * 2); _local4.userData.roundShadow.height = (_local5.radius * 2); actorCanvas.addChildAt(_local4.userData.roundShadow, 0); _arg1 = m_world.CreateBody(_local4); return (_arg1); } public function gotoHighScores(_arg1:MouseEvent):void{ var _local2:String; var _local3:URLRequest; _local2 = "http://rankz.armorbot.com/kinetikz/"; _local3 = new URLRequest(_local2); navigateToURL(_local3); } public function mini_spawnBall(_arg1:b2Body, _arg2:Number, _arg3:Number){ var _local4:*; var _local5:*; var _local6:roundShadow_mc; _local4 = new b2BodyDef(); _local5 = new b2CircleDef(); _local5.radius = 10; _local5.friction = 1; _local5.density = 1; _local5.restitution = 1; _local4.AddShape(_local5); _local4.userData = new ball_mc(); _local4.position.Set(_arg2, _arg3); _local4.linearDamping = 0.02; _local4.angularDamping = 0.02; _local4.userData.width = (_local5.radius * 2); _local4.userData.height = (_local5.radius * 2); _local4.userData.id = "ball"; mini_actorCanvas.addChild(_local4.userData); _local4.userData.roundShadow = new roundShadow_mc(); _local4.userData.roundShadow.width = (_local5.radius * 2); _local4.userData.roundShadow.height = (_local5.radius * 2); mini_actorCanvas.addChildAt(_local4.userData.roundShadow, 1); _arg1 = mini_m_world.CreateBody(_local4); return (_arg1); } public function quitGameRelay(_arg1:MouseEvent):void{ confirmQuit.yes.removeEventListener(MouseEvent.MOUSE_DOWN, quitGameRelay); stage.removeChild(confirmQuit); confirmQuitVisible = false; quitGame(); } public function removeGameOverScreen(_arg1:MouseEvent):void{ removeGameOverScreenEcho(); } public function playMiniGame():void{ mini_updateCursor(); mini_aimTurret(); mini_fireBall(); } public function mini_makeWorld():void{ var _local1:b2AABB; var _local2:b2Vec2; var _local3:Boolean; _local1 = new b2AABB(); _local1.minVertex.Set(0, 0); _local1.maxVertex.Set(600, 600); _local2 = new b2Vec2(0, 0); _local3 = true; mini_m_world = new b2World(_local1, _local2, _local3); stage.addEventListener(Event.ENTER_FRAME, mini_update, false, 0, true); } public function playSound(_arg1:b2Body, _arg2:b2Body){ var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:b2Vec2; var _local10:b2Vec2; if ((((((_arg1 == lastBody1)) && ((_arg2 == lastBody2)))) || ((((_arg1 == lastBody2)) && ((_arg2 == lastBody1)))))){ } else { _local3 = 0; _local4 = 0; _local5 = 0; _local6 = 0; _local7 = 0; _local8 = 0; _local9 = _arg1.GetLinearVelocity(); _local10 = _arg2.GetLinearVelocity(); _local3 = _local9.x; _local4 = _local9.y; _local5 = _local10.x; _local6 = _local10.y; _local7 = Math.abs((_local5 - _local3)); _local8 = Math.abs((_local6 - _local4)); if ((((_local7 > 25)) && ((_local8 > 25)))){ if ((((_arg1.m_userData.id == "wall")) || ((_arg2.m_userData.id == "wall")))){ metalSound.play(); } else { if ((((_arg1.m_userData.id == "puck")) || ((_arg2.m_userData.id == "puck")))){ boxSound.play(); } else { ballSound.play(); }; }; lastBody1 = _arg1; lastBody2 = _arg2; }; }; } public function mini_fireBall(){ var _local1:b2Body; var _local2:Number; var _local3:*; var _local4:b2Vec2; if ((((mini_mouseIsDown == true)) && ((mini_disableMouseDown == false)))){ mini_disableMouseDown = true; _local1 = mini_spawnBall(_local1, mini_turretX, mini_turretY); _local2 = ((mini_gun.turret.rotation * Math.PI) / 180); _local3 = 200000; _local4 = new b2Vec2((_local3 * Math.sin(_local2)), (-(_local3) * Math.cos(_local2))); _local1.ApplyImpulse(_local4, _local1.GetCenterPosition()); }; } public function removeInstructions(_arg1:MouseEvent):void{ instructions.backToMenu.removeEventListener(MouseEvent.MOUSE_DOWN, removeInstructions); instructions.gui.quitButton.removeEventListener(MouseEvent.MOUSE_DOWN, removeInstructions); stage.removeChild(instructions); } public function makeWorld():void{ var _local1:b2AABB; var _local2:b2Vec2; var _local3:Boolean; _local1 = new b2AABB(); _local1.minVertex.Set(0, 0); _local1.maxVertex.Set(600, 600); _local2 = new b2Vec2(0, 0); _local3 = true; m_world = new b2World(_local1, _local2, _local3); stage.addEventListener(Event.ENTER_FRAME, update, false, 0, true); } public function mini_updateCursor():void{ if (1 == 2){ mini_crosshairs.visible = true; mini_crosshairs.x = stage.mouseX; mini_crosshairs.y = stage.mouseY; Mouse.hide(); } else { Mouse.show(); mini_crosshairs.visible = false; }; } public function storeHints():void{ var _local1:*; _local1 = 1; while (_local1 <= 30) { hint[_local1] = " "; _local1++; }; hint[1] = "Fire discs at the puck, and get it to the target"; hint[3] = "You get more discs for each level you complete"; hint[4] = "Hit the bonus icon with any object to get 2 extra discs"; hint[5] = "There are 30 levels to complete!"; hint[2] = "Hit the restart button to reset the level at any time - but you won't get any more discs!"; hint[30] = "Final Level!"; } function frame4(){ stop(); stage.frameRate = 30; } function frame2(){ } function frame3(){ stop(); stage.frameRate = 24; armorIntro.addEventListener(MouseEvent.MOUSE_DOWN, follow_link); } public function initialiseFreeGame(_arg1:MouseEvent):void{ difficulty = "free"; menu.difficultyMenu.easyButton.removeEventListener(MouseEvent.MOUSE_DOWN, initialiseFreeGame); initialiseGame(); } function frame1(){ stop(); startButton.visible = false; finished = false; mini_m_physScale = 1; mini_m_timeStep = (1 / 30); mini_m_iterations = 10; mini_turretX = 0; mini_turretY = 0; mini_mouseIsDown = false; mini_disableMouseDown = false; linkFollowed = false; mini_crosshairs = new crosshair(); addEventListener(Event.ENTER_FRAME, loader); initialiseMiniGame(); try { MochiBot.track(this, "e705c5a9"); } catch(error:IllegalOperationError) { }; } public function gotoArmorGames(_arg1:MouseEvent):void{ var _local2:String; var _local3:URLRequest; _local2 = "http://www.armorgames.com"; _local3 = new URLRequest(_local2); navigateToURL(_local3); } public function aimTurret(){ var _local1:Number; var _local2:Number; _local1 = (stage.mouseX - turretX); _local2 = (turretY - stage.mouseY); gun.turret.rotation = ((180 / Math.PI) * Math.atan2(_local1, _local2)); } function frame5(){ startDiscs = 5; startLevel = 1; numberOfLevels = 30; m_physScale = 1; m_timeStep = (1 / 30); m_iterations = 10; turretX = 0; turretY = 0; numberOfTravelators = 0; numberOfBonusDiscs = 0; score = 0; gameOverCounter = 0; actorCanvas = new MovieClip(); crosshairs = new crosshair(); securityOn = false; currentURL = stage.loaderInfo.url; allowedURL = "armorgames.com"; targetSound = new target2(); shootSound = new shoot(); ballSound = new ball1(); boxSound = new box(); metalSound = new metal(); gameoverSound = new gameover(); newDiscSound = new newDisc(); newLevelSound = new newLevel(); puckOutSound = new puckOut(); winSound = new win(); channel1 = new SoundChannel(); kinetikzSound = new kinetikz(); targetReached = false; mouseIsDown = false; disableMouseDown = false; musicOn = true; soundOn = true; submitSuccess = false; gameRunning = false; levelRestarted = false; puckTouchingWall = false; levelCompleteVisible = false; confirmQuitVisible = false; gameWon = false; retryLevel = false; padlockOff = false; travelator = new Array(); bonusDiscs = new Array(); discActive = new Array(); hint = new Array(); storeHints(); channel1 = kinetikzSound.play(0, 1000); initialiseMenu(); } public function end_preload():void{ startButton.visible = true; startButton.addEventListener(MouseEvent.MOUSE_DOWN, gotoSplash); } public function retry(_arg1:MouseEvent):void{ retryLevel = true; removeGameOverScreenEcho(); } public function mini_aimTurret(){ var _local1:Number; var _local2:Number; _local1 = (stage.mouseX - mini_turretX); _local2 = (mini_turretY - stage.mouseY); mini_gun.turret.rotation = ((180 / Math.PI) * Math.atan2(_local1, _local2)); } public function checkCollisions():void{ var _local1:b2Contact; var _local2:b2Body; var _local3:b2Body; _local1 = m_world.GetContactList(); while (_local1) { if (_local1.GetManifoldCount() > 0){ _local2 = _local1.GetShape1().GetBody(); _local3 = _local1.GetShape2().GetBody(); if (soundOn == true){ playSound(_local2, _local3); }; preventSticking(_local2, _local3); }; _local1 = _local1.GetNext(); }; } public function removeLevelComplete(_arg1:MouseEvent):void{ levelComplete.resume.removeEventListener(MouseEvent.MOUSE_DOWN, removeLevelComplete); stage.removeChild(levelComplete); levelCompleteVisible = false; if (gameWon == true){ gameRunning = false; gameOver(); } else { makeWorld(); createLevel(currentLevel); disableMouseDown = true; guiTop.quitButton.addEventListener(MouseEvent.MOUSE_DOWN, confirmQuitGame); guiTop.resetButton.addEventListener(MouseEvent.MOUSE_DOWN, resetLevel); }; } public function createBonusDiscs(_arg1:Number, _arg2:Number):void{ var _local3:Boolean; var _local4:bonusDiscs_mc; _local3 = false; numberOfBonusDiscs++; if (levelRestarted == true){ if (discActive[numberOfBonusDiscs] == false){ _local3 = true; }; }; _local4 = new bonusDiscs_mc(); bonusDiscs[numberOfBonusDiscs] = _local4; actorCanvas.addChildAt(bonusDiscs[numberOfBonusDiscs], 0); bonusDiscs[numberOfBonusDiscs].x = _arg1; bonusDiscs[numberOfBonusDiscs].y = _arg2; bonusDiscs[numberOfBonusDiscs].width = 25; bonusDiscs[numberOfBonusDiscs].height = 25; bonusDiscs[numberOfBonusDiscs].alpha = 0.6; if (_local3 == true){ bonusDiscs[numberOfBonusDiscs].visible = false; }; if (levelRestarted == false){ discActive[numberOfBonusDiscs] = true; }; } public function initialiseMenu(){ menu = new menu_mc(); stage.addChild(menu); menu.difficultyMenu.visible = false; if (soundOn == false){ menu.soundBox.alpha = 0; }; if (musicOn == false){ menu.musicBox.alpha = 0; }; if (securityOn == true){ if (currentURL.indexOf(allowedURL, 0) != -1){ menu.playGame.addEventListener(MouseEvent.MOUSE_DOWN, selectDifficulty); } else { menu.warningMessage.text = "Please go to Armor Games to play this game!"; }; } else { menu.playGame.addEventListener(MouseEvent.MOUSE_DOWN, selectDifficulty); }; menu.soundBox.addEventListener(MouseEvent.MOUSE_DOWN, toggleSound); menu.musicBox.addEventListener(MouseEvent.MOUSE_DOWN, toggleMusic); menu.instructionsButton.addEventListener(MouseEvent.MOUSE_DOWN, showInstructions); menu.viewHighScores.addEventListener(MouseEvent.MOUSE_DOWN, gotoHighScores); menu.moreGames.addEventListener(MouseEvent.MOUSE_DOWN, gotoArmorGames); menu.gamingNews.addEventListener(MouseEvent.MOUSE_DOWN, gotoArmorBlog); } public function initialiseMiniGame():void{ stage.addChild(mini_crosshairs); stage.addEventListener(MouseEvent.MOUSE_DOWN, mini_handleMouseDown); stage.addEventListener(MouseEvent.MOUSE_UP, mini_handleMouseUp); mini_getTurretPosition(); mini_makeWorld(); mini_createLevel(); } public function update(_arg1:Event):void{ var _local2:b2Body; m_world.Step(m_timeStep, m_iterations); _local2 = m_world.m_bodyList; while (_local2) { if ((_local2.m_userData is Sprite)){ _local2.m_userData.x = _local2.m_position.x; _local2.m_userData.y = _local2.m_position.y; _local2.m_userData.rotation = (_local2.m_rotation * (180 / Math.PI)); if (_local2.m_userData.hasOwnProperty("roundShadow") == true){ _local2.m_userData.roundShadow.x = (_local2.m_position.x + 3); _local2.m_userData.roundShadow.y = (_local2.m_position.y + 3); }; if (_local2.m_userData.hasOwnProperty("squareShadow") == true){ _local2.m_userData.squareShadow.x = (_local2.m_position.x + 3); _local2.m_userData.squareShadow.y = (_local2.m_position.y + 3); _local2.m_userData.squareShadow.rotation = (_local2.m_rotation * (180 / Math.PI)); }; if (_local2.m_userData.hasOwnProperty("crossShadow") == true){ _local2.m_userData.crossShadow.rotation = (_local2.m_rotation * (180 / Math.PI)); }; if (_local2.m_userData.hasOwnProperty("crossShadow2") == true){ _local2.m_userData.crossShadow2.rotation = (_local2.m_rotation * (180 / Math.PI)); }; if (_local2.m_userData.hasOwnProperty("highlight") == true){ _local2.m_userData.highlight.x = (_local2.m_position.x - 5); _local2.m_userData.highlight.y = (_local2.m_position.y - 5); }; }; _local2 = _local2.m_next; }; } public function removeGameOverScreenEcho():void{ submitSuccess = false; gameOverScreen.submitButton.removeEventListener(MouseEvent.MOUSE_DOWN, submitHighscore); gameOverScreen.backToMenu.removeEventListener(MouseEvent.MOUSE_DOWN, removeGameOverScreen); gameOverScreen.viewHighScores.removeEventListener(MouseEvent.MOUSE_DOWN, gotoHighScores); gameOverScreen.retryButton.removeEventListener(MouseEvent.MOUSE_DOWN, retry); stage.removeChild(gameOverScreen); quitGame(); } public function handleMouseUp(_arg1:MouseEvent):void{ mouseIsDown = false; disableMouseDown = false; } public function quitGame():void{ destroyLevel(); stage.removeEventListener(Event.ENTER_FRAME, gameLoop); guiTop.resetButton.removeEventListener(MouseEvent.MOUSE_DOWN, resetLevel); guiTop.quitButton.removeEventListener(MouseEvent.MOUSE_DOWN, quitGameRelay); guiTop.musicToggle.removeEventListener(MouseEvent.MOUSE_DOWN, toggleMusic2); guiTop.soundToggle.removeEventListener(MouseEvent.MOUSE_DOWN, toggleSound2); stage.removeChild(guiBack); stage.removeChild(gun); stage.removeChild(guiTop); restoreCursor(); stage.removeChild(crosshairs); levelRestarted = false; if (retryLevel == false){ currentLevel = startLevel; score = 0; initialiseMenu(); } else { score = 0; retryLevel = false; initialiseGameEcho(); }; } public function createWall(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):void{ var _local6:*; var _local7:*; var _local8:*; var _local9:*; var _local10:*; var _local11:*; var _local12:*; var _local13:*; var _local14:*; var _local15:squareShadow_mc; _local6 = 0; if ((((_arg5 < 0)) && ((_arg5 >= -90)))){ _local6 = ((Math.PI / 180) * Math.abs(_arg5)); } else { if ((((_arg5 < -90)) && ((_arg5 >= -180)))){ _local6 = ((Math.PI / 180) * (180 - Math.abs(_arg5))); } else { if ((((_arg5 > 90)) && ((_arg5 <= 180)))){ _local6 = ((Math.PI / 180) * (360 - Math.abs(_arg5))); } else { _local6 = ((Math.PI / 180) * Math.abs(_arg5)); }; }; }; _local7 = Math.cos(_local6); _local8 = Math.sin(_local6); _local9 = _arg3; _local10 = _arg4; _local11 = (((_local10 * _local7) - (_local9 * _local8)) / ((_local7 * _local7) - (_local8 * _local8))); _local12 = ((_local9 - (_local11 * _local8)) / _local7); _local13 = new b2BodyDef(); _local14 = new b2BoxDef(); _local14.extents.Set((_local12 * 0.5), (_local11 * 0.5)); _local14.friction = 0.15; _local14.restitution = 1; _local14.density = 0; _local13.position.Set(_arg1, _arg2); _local13.AddShape(_local14); _local13.rotation = ((_arg5 * Math.PI) / 180); _local13.userData = new wall_mc(); _local13.userData.width = (_local14.extents.x * 2); _local13.userData.height = (_local14.extents.y * 2); _local13.userData.id = "wall"; actorCanvas.addChild(_local13.userData); _local13.userData.squareShadow = new squareShadow_mc(); _local13.userData.squareShadow.width = (_local14.extents.x * 2); _local13.userData.squareShadow.height = (_local14.extents.y * 2); _local13.userData.squareShadow.x = (_arg1 + 5); _local13.userData.squareShadow.y = (_arg2 + 5); actorCanvas.addChildAt(_local13.userData.squareShadow, 0); m_world.CreateBody(_local13); } public function mini_handleMouseUp(_arg1:MouseEvent):void{ mini_mouseIsDown = false; mini_disableMouseDown = false; } public function submitHighscore(_arg1:MouseEvent):void{ hsname = gameOverScreen.playerName.text; gameOverScreen.message.text = "Connecting: Please wait ..."; hs = submitToArmorbot(hsname, score); hs.addEventListener(Event.COMPLETE, highScoreCompleteHandler); setTimeout(submitFail, 15000); } public function spawnWallH(_arg1:Number, _arg2:Number){ var _local3:*; var _local4:*; _local3 = new b2BodyDef(); _local4 = new b2BoxDef(); _local4.extents.Set(300, 10); _local4.friction = 1; _local4.density = 0; _local4.restitution = 0.85; _local3.AddShape(_local4); _local3.position.Set(_arg1, _arg2); _local3.linearDamping = 0.03; _local3.angularDamping = 0.02; mini_m_world.CreateBody(_local3); } public function initialiseEasyGame(_arg1:MouseEvent):void{ difficulty = "easy"; menu.difficultyMenu.easyButton.removeEventListener(MouseEvent.MOUSE_DOWN, initialiseEasyGame); initialiseGame(); } public function initialiseGameEcho():void{ disableMouseDown = true; stage.addEventListener(MouseEvent.MOUSE_DOWN, handleMouseDown); stage.addEventListener(MouseEvent.MOUSE_UP, handleMouseUp); addGUI(); getTurretPosition(); makeWorld(); createLevel(currentLevel); stage.addEventListener(Event.ENTER_FRAME, gameLoop); guiTop.resetButton.addEventListener(MouseEvent.MOUSE_DOWN, resetLevel); guiTop.quitButton.addEventListener(MouseEvent.MOUSE_DOWN, confirmQuitGame); score = 0; if (difficulty == "easy"){ discs = 7; }; if (difficulty == "hard"){ discs = 4; }; if (difficulty == "free"){ discs = 100; }; discsUsed = 0; gameWon = false; gameRunning = true; } public function checkNonPhysicsCollisions():void{ var _local1:b2Body; var _local2:*; var _local3:MovieClip; var _local4:b2Vec2; var _local5:b2Vec2; var _local6:b2Vec2; var _local7:uint; var _local8:uint; var _local9:*; _local1 = m_world.m_bodyList; _local2 = m_world.m_bodyCount; _local4 = new b2Vec2(100, 0); _local5 = new b2Vec2(-100, 0); _local6 = new b2Vec2(0, 100); _local7 = 0; _local8 = 0; _local9 = 0; while (_local9 < (_local2 - 1)) { if (numberOfTravelators > 0){ _local7 = 1; while (_local7 <= numberOfTravelators) { if (_local1.hasOwnProperty("m_userData") == true){ if (_local1.m_userData != null){ if (_local1.m_userData.hitTestObject(travelator[_local7].hitZone) == true){ if (travelator[_local7].variety == "left"){ _local1.SetLinearVelocity(_local5); }; if (travelator[_local7].variety == "right"){ _local1.SetLinearVelocity(_local4); }; if (travelator[_local7].variety == "down"){ _local1.SetLinearVelocity(_local6); }; }; }; }; _local7++; }; }; if (numberOfBonusDiscs > 0){ _local8 = 1; while (_local8 <= numberOfBonusDiscs) { if (_local1.hasOwnProperty("m_userData") == true){ if (_local1.m_userData != null){ if ((((_local1.m_userData.hitTestObject(bonusDiscs[_local8]) == true)) && ((bonusDiscs[_local8].visible == true)))){ discs = (discs + 2); bonusDiscs[_local8].visible = false; discActive[_local8] = false; if (soundOn == true){ newDiscSound.play(0, 2); }; }; }; }; _local8++; }; }; if (targetReached == false){ if (_local1.hasOwnProperty("m_userData") == true){ if (_local1.m_userData != null){ if (_local1.m_userData.hasOwnProperty("id") == true){ if (_local1.m_userData.id == "puck"){ if (_local1.m_userData.hitTestObject(target.hitZone) == true){ target.fill.visible = true; targetReached = true; if (soundOn == true){ targetSound.play(); }; setTimeout(changeLevel, 2000); }; if ((((((_local1.m_position.x > 610)) || ((_local1.m_position.x < -10)))) || ((_local1.m_position.y > 610)))){ resetLevelEcho(); break; }; }; }; }; }; }; _local1 = _local1.m_next; _local9++; }; } public function spawnWallV(_arg1:Number, _arg2:Number){ var _local3:*; var _local4:*; _local3 = new b2BodyDef(); _local4 = new b2BoxDef(); _local4.extents.Set(10, 300); _local4.friction = 1; _local4.density = 0; _local4.restitution = 0.85; _local3.AddShape(_local4); _local3.position.Set(_arg1, _arg2); _local3.linearDamping = 0.03; _local3.angularDamping = 0.02; mini_m_world.CreateBody(_local3); } public function addGUI():void{ guiBack = new guiBack_mc(); stage.addChild(guiBack); stage.addChild(actorCanvas); gun = new gun_mc(); stage.addChild(gun); gun.width = (gun.width * 0.75); gun.height = (gun.height * 0.75); gun.x = 300; gun.y = (600 - (gun.height / 3)); guiTop = new guiTop_mc(); stage.addChild(guiTop); guiTop.musicToggle.addEventListener(MouseEvent.MOUSE_DOWN, toggleMusic2); if (musicOn == true){ guiTop.musicToggleOff.visible = false; guiTop.musicToggleOn.visible = true; } else { guiTop.musicToggleOff.visible = true; guiTop.musicToggleOn.visible = false; }; guiTop.soundToggle.addEventListener(MouseEvent.MOUSE_DOWN, toggleSound2); if (soundOn == true){ guiTop.soundToggleOff.visible = false; guiTop.soundToggleOn.visible = true; } else { guiTop.soundToggleOff.visible = true; guiTop.soundToggleOn.visible = false; }; stage.addChild(crosshairs); } public function toggleMusic(_arg1:MouseEvent):void{ if (musicOn == true){ musicOn = false; menu.musicBox.alpha = 0; channel1.stop(); } else { musicOn = true; menu.musicBox.alpha = 1; channel1 = kinetikzSound.play(0, 1000); }; } public function toggleMusic2(_arg1:MouseEvent):void{ if (musicOn == true){ musicOn = false; guiTop.musicToggleOff.visible = true; guiTop.musicToggleOn.visible = false; channel1.stop(); } else { musicOn = true; guiTop.musicToggleOff.visible = false; guiTop.musicToggleOn.visible = true; channel1 = kinetikzSound.play(0, 1000); }; } public function showInstructions(_arg1:MouseEvent):void{ instructions = new instructions_mc(); stage.addChild(instructions); instructions.backToMenu.addEventListener(MouseEvent.MOUSE_DOWN, removeInstructions); instructions.gui.quitButton.addEventListener(MouseEvent.MOUSE_DOWN, removeInstructions); } public function mini_getTurretPosition():void{ var _local1:Point; var _local2:Point; _local1 = new Point(mini_gun.turret.x, mini_gun.turret.y); _local2 = mini_gun.turret.parent.localToGlobal(_local1); mini_turretX = _local2.x; mini_turretY = _local2.y; } public function spawnPuck(_arg1:Number, _arg2:Number){ var _local3:*; var _local4:*; var _local5:roundShadow_mc; var _local6:highlight_mc; _local3 = new b2BodyDef(); _local4 = new b2CircleDef(); _local4.radius = 15; _local4.friction = 0.15; _local4.density = 1; _local4.restitution = 1; _local3.AddShape(_local4); _local3.userData = new puck_mc(); _local3.linearDamping = 0.02; _local3.angularDamping = 0.02; _local3.position.Set(_arg1, _arg2); _local3.userData.width = (_local4.radius * 2); _local3.userData.height = (_local4.radius * 2); _local3.userData.id = "puck"; _local3.userData.roundShadow = new roundShadow_mc(); _local3.userData.roundShadow.width = (_local4.radius * 2); _local3.userData.roundShadow.height = (_local4.radius * 2); actorCanvas.addChildAt(_local3.userData.roundShadow, 0); actorCanvas.addChild(_local3.userData); _local3.userData.highlight = new highlight_mc(); _local3.userData.highlight.width = _local4.radius; _local3.userData.highlight.height = _local4.radius; actorCanvas.addChild(_local3.userData.highlight); m_world.CreateBody(_local3); } public function initialiseGame():void{ menu.soundBox.removeEventListener(MouseEvent.MOUSE_DOWN, toggleSound); menu.musicBox.removeEventListener(MouseEvent.MOUSE_DOWN, toggleMusic); menu.viewHighScores.removeEventListener(MouseEvent.MOUSE_DOWN, gotoHighScores); menu.moreGames.removeEventListener(MouseEvent.MOUSE_DOWN, gotoArmorGames); menu.gamingNews.removeEventListener(MouseEvent.MOUSE_DOWN, gotoArmorBlog); stage.removeChild(menu); currentLevel = startLevel; initialiseGameEcho(); } public function resetLevelEcho():void{ levelRestarted = true; destroyLevel(); makeWorld(); createLevel(currentLevel); } public function initialiseHardGame(_arg1:MouseEvent):void{ difficulty = "hard"; menu.difficultyMenu.easyButton.removeEventListener(MouseEvent.MOUSE_DOWN, initialiseHardGame); initialiseGame(); } public function continueGame(_arg1:MouseEvent):void{ confirmQuit.no.removeEventListener(MouseEvent.MOUSE_DOWN, continueGame); stage.removeChild(confirmQuit); confirmQuitVisible = false; disableMouseDown = true; } public function submitFail():void{ if (submitSuccess == false){ gameOverScreen.message.text = "Sorry, could not connect. Try submitting again."; hs.removeEventListener(Event.COMPLETE, highScoreCompleteHandler); }; } public function fireBall(){ var _local1:b2Body; var _local2:Number; var _local3:*; var _local4:b2Vec2; if ((((((((((((mouseIsDown == true)) && ((disableMouseDown == false)))) && ((stage.mouseY > 55)))) && ((discs > 0)))) && ((levelCompleteVisible == false)))) && ((confirmQuitVisible == false)))){ disableMouseDown = true; _local1 = spawnBall(_local1, turretX, turretY); _local2 = ((gun.turret.rotation * Math.PI) / 180); _local3 = 200000; _local4 = new b2Vec2((_local3 * Math.sin(_local2)), (-(_local3) * Math.cos(_local2))); _local1.ApplyImpulse(_local4, _local1.GetCenterPosition()); if (soundOn == true){ shootSound.play(); }; discsUsed++; if (difficulty != "free"){ discs--; }; }; } public function gotoArmorBlog(_arg1:MouseEvent):void{ var _local2:String; var _local3:URLRequest; _local2 = "http://www.armorblog.com"; _local3 = new URLRequest(_local2); navigateToURL(_local3); } public function spawnDoorStop(_arg1:Number, _arg2:Number){ var _local3:*; var _local4:*; var _local5:roundShadow_mc; _local3 = new b2BodyDef(); _local4 = new b2CircleDef(); _local4.radius = 5; _local4.friction = 1; _local4.density = 0; _local4.restitution = 0; _local3.AddShape(_local4); _local3.userData = new doorStop_mc(); _local3.position.Set(_arg1, _arg2); _local3.userData.width = (_local4.radius * 2); _local3.userData.height = (_local4.radius * 2); _local3.userData.id = "doorStop"; actorCanvas.addChild(_local3.userData); _local3.userData.roundShadow = new roundShadow_mc(); _local3.userData.roundShadow.width = (_local4.radius * 2); _local3.userData.roundShadow.height = (_local4.radius * 2); actorCanvas.addChildAt(_local3.userData.roundShadow, 0); m_world.CreateBody(_local3); } public function getTurretPosition():void{ var _local1:Point; var _local2:Point; _local1 = new Point(gun.turret.x, gun.turret.y); _local2 = gun.turret.parent.localToGlobal(_local1); turretX = _local2.x; turretY = _local2.y; } public function createHintBox(_arg1:Number, _arg2:Number):void{ var _local3:hintBox_mc; _local3 = new hintBox_mc(); actorCanvas.addChildAt(_local3, 0); _local3.x = _arg1; _local3.y = _arg2; _local3.width = 200; _local3.height = 100; _local3.message.text = hint[currentLevel]; } public function traceVelocities():void{ var _local1:b2Body; if (gameRunning == true){ _local1 = m_world.m_bodyList; while (_local1) { if (_local1.hasOwnProperty("m_userData") == true){ if (_local1.m_userData != null){ if (_local1.m_userData.id == "puck"){ trace(("x: " + _local1.m_position.x)); trace(("y: " + _local1.m_position.y)); }; }; }; _local1 = _local1.m_next; }; }; } public function preventSticking(_arg1, _arg2):void{ var _local3:b2Vec2; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:b2Vec2; var _local8:b2Vec2; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:b2Vec2; if (_arg1.hasOwnProperty("m_userData") == true){ if (_arg2.hasOwnProperty("m_userData") == true){ if (_arg1.m_userData != null){ if (_arg2.m_userData != null){ if ((((_arg1.m_userData.id == "puck")) && ((_arg2.m_userData.id == "wall")))){ _local3 = new b2Vec2((_arg2.m_position.x - _arg1.m_position.x), (_arg2.m_position.y - _arg1.m_position.y)); _local4 = _local3.Length(); _local5 = ((-100 * _local3.x) / _local4); _local6 = ((-100 * _local3.y) / _local4); _local7 = new b2Vec2(_local5, _local6); _arg1.ApplyImpulse(_local7, _arg1.GetCenterPosition()); }; if ((((_arg2.m_userData.id == "puck")) && ((_arg1.m_userData.id == "wall")))){ _local8 = new b2Vec2((_arg1.m_position.x - _arg2.m_position.x), (_arg1.m_position.y - _arg2.m_position.y)); _local9 = _local8.Length(); _local10 = ((-100 * _local8.x) / _local9); _local11 = ((-100 * _local8.y) / _local9); _local12 = new b2Vec2(_local10, _local11); _arg2.ApplyImpulse(_local12, _arg2.GetCenterPosition()); }; }; }; }; }; } public function toggleSound2(_arg1:MouseEvent):void{ if (soundOn == true){ soundOn = false; guiTop.soundToggleOff.visible = true; guiTop.soundToggleOn.visible = false; } else { soundOn = true; guiTop.soundToggleOff.visible = false; guiTop.soundToggleOn.visible = true; }; } public function spawnLetter(_arg1:String, _arg2:Number, _arg3:Number){ var _local4:*; var _local5:*; var _local6:squareShadow_mc; _local4 = new b2BodyDef(); _local5 = new b2BoxDef(); _local5.extents.Set(12, 12); _local5.friction = 1; _local5.density = 1; _local5.restitution = 0.85; _local4.AddShape(_local5); _local4.userData = new letter_mc(); _local4.position.Set((115 + _arg2), _arg3); _local4.linearDamping = 0.03; _local4.angularDamping = 0.02; _local4.userData.width = (_local5.extents.x * 2); _local4.userData.height = (_local5.extents.y * 2); _local4.userData.id = "letter"; mini_actorCanvas.addChild(_local4.userData); _local4.userData.addEventListener(MouseEvent.MOUSE_DOWN, mini_follow_link); _local4.userData.letter.text = _arg1; _local4.userData.squareShadow = new squareShadow_mc(); _local4.userData.squareShadow.width = (_local5.extents.x * 2); _local4.userData.squareShadow.height = (_local5.extents.y * 2); mini_actorCanvas.addChildAt(_local4.userData.squareShadow, 1); mini_m_world.CreateBody(_local4); } public function updateCursor():void{ if ((((((((stage.mouseY > 40)) && ((stage.mouseY < 560)))) && ((levelCompleteVisible == false)))) && ((confirmQuitVisible == false)))){ Mouse.hide(); crosshairs.visible = true; crosshairs.x = stage.mouseX; crosshairs.y = stage.mouseY; } else { Mouse.show(); crosshairs.visible = false; }; } public function removeDifficulty(_arg1:MouseEvent):void{ menu.playGame.addEventListener(MouseEvent.MOUSE_DOWN, selectDifficulty); menu.difficultyMenu.back.removeEventListener(MouseEvent.MOUSE_DOWN, removeDifficulty); menu.difficultyMenu.easyButton.removeEventListener(MouseEvent.MOUSE_DOWN, initialiseEasyGame); menu.difficultyMenu.hardButton.removeEventListener(MouseEvent.MOUSE_DOWN, initialiseHardGame); menu.difficultyMenu.freeButton.removeEventListener(MouseEvent.MOUSE_DOWN, initialiseFreeGame); menu.difficultyMenu.visible = false; } public function mini_restoreCursor():void{ Mouse.show(); mini_crosshairs.visible = false; } public function spawnPivot(_arg1:Number, _arg2:Number){ var _local3:*; var _local4:*; var _local5:squareShadow_mc; var _local6:b2Body; var _local7:*; var _local8:*; var _local9:b2Body; var _local10:b2RevoluteJointDef; _local3 = new b2BodyDef(); _local4 = new b2BoxDef(); _local4.extents.Set(100, 10); _local4.friction = 1; _local4.density = 1; _local4.restitution = 0.05; _local3.AddShape(_local4); _local3.userData = new pivot_mc(); _local3.position.Set(_arg1, _arg2); _local3.linearDamping = 0.03; _local3.angularDamping = 0.003; _local3.userData.width = (_local4.extents.x * 2); _local3.userData.height = (_local4.extents.y * 2); _local3.userData.id = "pivot"; actorCanvas.addChild(_local3.userData); _local3.userData.squareShadow = new squareShadow_mc(); _local3.userData.squareShadow.width = (_local4.extents.x * 2); _local3.userData.squareShadow.height = (_local4.extents.y * 2); actorCanvas.addChildAt(_local3.userData.squareShadow, 0); _local6 = m_world.CreateBody(_local3); _local7 = new b2BodyDef(); _local8 = new b2BoxDef(); _local8.extents.Set(1, 1); _local8.friction = 1; _local8.density = 0; _local8.restitution = 0.85; _local7.AddShape(_local8); _local7.position.Set(_arg1, _arg2); _local9 = m_world.CreateBody(_local7); _local10 = new b2RevoluteJointDef(); _local10.body1 = _local6; _local10.body2 = _local9; _local10.anchorPoint = _local6.GetCenterPosition(); _local10.enableMotor = false; m_world.CreateJoint(_local10); } public function highScoreCompleteHandler(_arg1:Event):void{ submitSuccess = true; gameOverScreen.message.text = "Score submitted!"; trace(hsname); hs.removeEventListener(Event.COMPLETE, highScoreCompleteHandler); gameOverScreen.submitButton.removeEventListener(MouseEvent.MOUSE_DOWN, submitHighscore); } public function resetLevel(_arg1:MouseEvent):void{ resetLevelEcho(); } public function createTravelator(_arg1:Number, _arg2:Number, _arg3:String):void{ var _local4:travelator_mc; var _local5:travelatorleft_mc; var _local6:travelatordown_mc; numberOfTravelators++; if (_arg3 == "right"){ _local4 = new travelator_mc(); travelator[numberOfTravelators] = _local4; }; if (_arg3 == "left"){ _local5 = new travelatorleft_mc(); travelator[numberOfTravelators] = _local5; }; if (_arg3 == "down"){ _local6 = new travelatordown_mc(); travelator[numberOfTravelators] = _local6; }; actorCanvas.addChildAt(travelator[numberOfTravelators], 0); travelator[numberOfTravelators].x = _arg1; travelator[numberOfTravelators].y = _arg2; if ((((_arg3 == "left")) || ((_arg3 == "right")))){ travelator[numberOfTravelators].width = 100; travelator[numberOfTravelators].height = 30; } else { travelator[numberOfTravelators].width = 30; travelator[numberOfTravelators].height = 100; }; travelator[numberOfTravelators].variety = _arg3; } public function restoreCursor():void{ Mouse.show(); crosshairs.visible = false; } public function checkForGameOver():void{ var _local1:b2Vec2; var _local2:Number; var _local3:Boolean; var _local4:b2Body; if ((((((((discs <= 0)) && ((gameRunning == true)))) && ((levelCompleteVisible == false)))) && ((targetReached == false)))){ gameOverCounter++; _local2 = 0; _local3 = true; _local4 = m_world.m_bodyList; while (_local4) { _local1 = _local4.GetLinearVelocity(); _local2 = ((_local1.x * _local1.x) + (_local1.y * _local1.y)); if (_local2 > 4){ if ((_local4.m_userData is wall_mc)){ } else { _local3 = false; }; }; _local4 = _local4.m_next; }; if ((((_local3 == true)) || ((gameOverCounter > 400)))){ gameRunning = false; gameOverCounter = 0; gameOver(); }; }; } public function gotoSplash(_arg1:MouseEvent):void{ removeChild(myPreloader); removeEventListener(Event.ENTER_FRAME, loader); cleanUpMiniGame(); startButton.removeEventListener(MouseEvent.MOUSE_DOWN, gotoSplash); gotoAndPlay(2); } public function spawnPivotV(_arg1:Number, _arg2:Number){ var _local3:*; var _local4:*; var _local5:squareShadow_mc; var _local6:b2Body; var _local7:*; var _local8:*; var _local9:b2Body; var _local10:b2RevoluteJointDef; _local3 = new b2BodyDef(); _local4 = new b2BoxDef(); _local4.extents.Set(10, 100); _local4.friction = 1; _local4.density = 1; _local4.restitution = 0.05; _local3.AddShape(_local4); _local3.userData = new pivotV_mc(); _local3.position.Set(_arg1, _arg2); _local3.linearDamping = 0.03; _local3.angularDamping = 0.003; _local3.userData.width = (_local4.extents.x * 2); _local3.userData.height = (_local4.extents.y * 2); _local3.userData.id = "pivot"; actorCanvas.addChild(_local3.userData); _local3.userData.squareShadow = new squareShadow_mc(); _local3.userData.squareShadow.width = (_local4.extents.x * 2); _local3.userData.squareShadow.height = (_local4.extents.y * 2); actorCanvas.addChildAt(_local3.userData.squareShadow, 0); _local6 = m_world.CreateBody(_local3); _local7 = new b2BodyDef(); _local8 = new b2BoxDef(); _local8.extents.Set(1, 1); _local8.friction = 1; _local8.density = 0; _local8.restitution = 0.85; _local7.AddShape(_local8); _local7.position.Set(_arg1, _arg2); _local9 = m_world.CreateBody(_local7); _local10 = new b2RevoluteJointDef(); _local10.body1 = _local6; _local10.body2 = _local9; _local10.anchorPoint = _local6.GetCenterPosition(); _local10.enableMotor = false; m_world.CreateJoint(_local10); } public function mini_update(_arg1:Event):void{ var _local2:b2Body; mini_m_world.Step(mini_m_timeStep, mini_m_iterations); _local2 = mini_m_world.m_bodyList; while (_local2) { if ((_local2.m_userData is Sprite)){ _local2.m_userData.x = _local2.m_position.x; _local2.m_userData.y = _local2.m_position.y; _local2.m_userData.rotation = (_local2.m_rotation * (180 / Math.PI)); if (_local2.m_userData.hasOwnProperty("roundShadow") == true){ _local2.m_userData.roundShadow.x = (_local2.m_position.x + 3); _local2.m_userData.roundShadow.y = (_local2.m_position.y + 3); }; if (_local2.m_userData.hasOwnProperty("squareShadow") == true){ _local2.m_userData.squareShadow.x = (_local2.m_position.x + 3); _local2.m_userData.squareShadow.y = (_local2.m_position.y + 3); _local2.m_userData.squareShadow.rotation = (_local2.m_rotation * (180 / Math.PI)); }; }; _local2 = _local2.m_next; }; } public function gameLoop(_arg1:Event):void{ if (gameRunning == true){ updateCursor(); aimTurret(); fireBall(); checkNonPhysicsCollisions(); checkCollisions(); updateGUI(); checkForGameOver(); }; } public function mini_handleMouseDown(_arg1:MouseEvent):void{ mini_mouseIsDown = true; } public function spawnMotor(_arg1:Number, _arg2:Number){ var _local3:*; var _local4:*; var _local5:squareShadow_mc; var _local6:b2Body; var _local7:*; var _local8:*; var _local9:b2Body; var _local10:b2RevoluteJointDef; _local3 = new b2BodyDef(); _local4 = new b2BoxDef(); _local4.extents.Set(100, 10); _local4.friction = 1; _local4.density = 1; _local4.restitution = 0.85; _local3.AddShape(_local4); _local3.userData = new motor_mc(); _local3.position.Set(_arg1, _arg2); _local3.userData.width = (_local4.extents.x * 2); _local3.userData.height = (_local4.extents.y * 2); _local3.userData.id = "motor"; actorCanvas.addChild(_local3.userData); _local3.userData.squareShadow = new squareShadow_mc(); _local3.userData.squareShadow.width = (_local4.extents.x * 2); _local3.userData.squareShadow.height = (_local4.extents.y * 2); actorCanvas.addChildAt(_local3.userData.squareShadow, 0); _local6 = m_world.CreateBody(_local3); _local7 = new b2BodyDef(); _local8 = new b2BoxDef(); _local8.extents.Set(1, 1); _local8.friction = 1; _local8.density = 0; _local8.restitution = 0.85; _local7.AddShape(_local8); _local7.position.Set(_arg1, _arg2); _local9 = m_world.CreateBody(_local7); _local10 = new b2RevoluteJointDef(); _local10.body1 = _local6; _local10.body2 = _local9; _local10.anchorPoint = _local6.GetCenterPosition(); _local10.enableMotor = true; _local10.motorTorque = 100000000; _local10.motorSpeed = -2; m_world.CreateJoint(_local10); } public function destroyLevel():void{ var _local1:b2Body; var _local2:*; var _local3:b2Body; var _local4:*; var _local5:uint; var _local6:*; _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++; }; _local5 = actorCanvas.numChildren; _local6 = 0; while (_local6 <= (_local5 - 1)) { actorCanvas.removeChildAt(0); _local6++; }; numberOfTravelators = 0; numberOfBonusDiscs = 0; } public function follow_link(_arg1:MouseEvent):void{ var _local2:String; var _local3:URLRequest; if (linkFollowed == false){ linkFollowed = true; _local2 = "http://www.armorgames.com"; _local3 = new URLRequest(_local2); navigateToURL(_local3); }; } public function spawnPivotC(_arg1:Number, _arg2:Number){ var _local3:*; var _local4:*; var _local5:*; var _local6:b2Body; var _local7:squareShadow_mc; var _local8:squareShadow_mc; var _local9:*; var _local10:*; var _local11:b2Body; var _local12:b2RevoluteJointDef; _local3 = new b2BodyDef(); _local4 = new b2BoxDef(); _local4.extents.Set(100, 10); _local4.friction = 1; _local4.density = 1; _local4.restitution = 0.05; _local5 = new b2BoxDef(); _local5.extents.Set(10, 100); _local5.friction = 1; _local5.density = 1; _local5.restitution = 0.05; _local3.AddShape(_local4); _local3.AddShape(_local5); _local3.position.Set(_arg1, _arg2); _local3.linearDamping = 0.03; _local3.angularDamping = 0.003; _local3.userData = new pivotC_mc(); _local3.userData.width = (_local4.extents.x * 2); _local3.userData.height = (_local4.extents.x * 2); _local3.userData.id = "pivotC"; actorCanvas.addChild(_local3.userData); _local6 = m_world.CreateBody(_local3); _local3.userData.crossShadow = new squareShadow_mc(); _local3.userData.crossShadow.width = 200; _local3.userData.crossShadow.height = 20; _local3.userData.crossShadow.x = (_arg1 + 5); _local3.userData.crossShadow.y = (_arg2 + 5); actorCanvas.addChildAt(_local3.userData.crossShadow, 0); _local3.userData.crossShadow2 = new squareShadow_mc(); _local3.userData.crossShadow2.width = 20; _local3.userData.crossShadow2.height = 200; _local3.userData.crossShadow2.x = (_arg1 + 5); _local3.userData.crossShadow2.y = (_arg2 + 5); actorCanvas.addChildAt(_local3.userData.crossShadow2, 0); _local9 = new b2BodyDef(); _local10 = new b2BoxDef(); _local10.extents.Set(1, 1); _local10.friction = 1; _local10.density = 0; _local10.restitution = 0.85; _local9.AddShape(_local10); _local9.position.Set(_arg1, _arg2); _local11 = m_world.CreateBody(_local9); _local12 = new b2RevoluteJointDef(); _local12.body1 = _local6; _local12.body2 = _local11; _local12.anchorPoint = _local6.GetCenterPosition(); _local12.enableMotor = false; m_world.CreateJoint(_local12); } public function changeLevel():void{ var _local1:int; var _local2:uint; var _local3:uint; guiTop.quitButton.removeEventListener(MouseEvent.MOUSE_DOWN, confirmQuitGame); guiTop.resetButton.removeEventListener(MouseEvent.MOUSE_DOWN, resetLevel); levelRestarted = false; levelCompleteVisible = true; destroyLevel(); levelComplete = new levelComplete_mc(); stage.addChild(levelComplete); restoreCursor(); levelComplete.resume.addEventListener(MouseEvent.MOUSE_DOWN, removeLevelComplete); _local1 = 0; _local2 = 0; _local3 = 0; if (difficulty == "easy"){ score = (score + 100); }; if (difficulty == "hard"){ score = (score + 300); }; if (difficulty == "free"){ score = (score + 500); }; _local1 = (1000 - (discsUsed * 100)); if (_local1 > 0){ score = (score + _local1); } else { _local1 = 0; }; if (discsUsed == 1){ score = (score + 1000); _local2 = 1000; }; if (difficulty == "easy"){ _local3 = ((100 + _local1) + _local2); levelComplete.message.text = ((((("\nLevel complete bonus: 100 \nEfficiency bonus: " + String(_local1)) + "\nHole in One bonus: ") + String(_local2)) + "\n\nTotal: ") + _local3); }; if (difficulty == "hard"){ _local3 = ((300 + _local1) + _local2); levelComplete.message.text = ((((("\nLevel complete bonus: 300 \nEfficiency bonus: " + String(_local1)) + "\nHole in One bonus: ") + String(_local2)) + "\n\nTotal: ") + _local3); }; if (difficulty == "free"){ _local3 = ((500 + _local1) + _local2); levelComplete.message.text = ((((("\nLevel complete bonus: 500 \nEfficiency bonus: " + String(_local1)) + "\nHole in One bonus: ") + String(_local2)) + "\n\nTotal: ") + _local3); }; if (currentLevel >= numberOfLevels){ gameWon = true; }; if (gameWon == false){ if (difficulty == "hard"){ levelComplete.message.appendText("\n\n\nNew discs: 4"); }; if (difficulty == "easy"){ levelComplete.message.appendText("\n\n\nNew discs: 7"); }; currentLevel++; }; targetReached = false; discsUsed = 0; if (difficulty == "hard"){ discs = (discs + 4); }; if (difficulty == "easy"){ discs = (discs + 7); }; if (difficulty == "free"){ discs = 100; }; } public function cleanUpMiniGame():void{ var _local1:b2Body; var _local2:*; var _local3:b2Body; var _local4:*; var _local5:uint; var _local6:*; stage.removeChild(mini_crosshairs); mini_restoreCursor(); _local1 = mini_m_world.m_bodyList; _local2 = mini_m_world.m_bodyCount; _local4 = 0; while (_local4 < (_local2 - 1)) { _local3 = _local1; _local1 = _local1.m_next; mini_m_world.DestroyBody(_local3); if ((((_local3.hasOwnProperty("m_userData") == true)) && (!((_local3.m_userData == null))))){ _local3.m_userData = null; }; _local4++; }; _local5 = mini_actorCanvas.numChildren; _local6 = 0; while (_local6 <= (_local5 - 1)) { mini_actorCanvas.removeChildAt(0); _local6++; }; stage.removeEventListener(Event.ENTER_FRAME, mini_update); } public function confirmQuitGame(_arg1:MouseEvent):void{ if (gameRunning == true){ confirmQuit = new confirmQuit_mc(); stage.addChild(confirmQuit); restoreCursor(); confirmQuitVisible = true; confirmQuit.yes.addEventListener(MouseEvent.MOUSE_DOWN, quitGameRelay); confirmQuit.no.addEventListener(MouseEvent.MOUSE_DOWN, continueGame); }; } public function updateGUI(){ guiTop.levelDisplay.text = ("level " + String(currentLevel)); guiTop.scoreDisplay.text = ("score " + String(score)); guiTop.discsDisplay.text = ("discs " + String(discs)); } public function selectDifficulty(_arg1:MouseEvent):void{ menu.playGame.removeEventListener(MouseEvent.MOUSE_DOWN, selectDifficulty); menu.difficultyMenu.visible = true; if (padlockOff == false){ menu.difficultyMenu.padlock.visible = true; } else { menu.difficultyMenu.padlock.visible = false; }; menu.difficultyMenu.easyButton.addEventListener(MouseEvent.MOUSE_DOWN, initialiseEasyGame); menu.difficultyMenu.hardButton.addEventListener(MouseEvent.MOUSE_DOWN, initialiseHardGame); if (padlockOff == true){ menu.difficultyMenu.freeButton.addEventListener(MouseEvent.MOUSE_DOWN, initialiseFreeGame); }; menu.difficultyMenu.back.addEventListener(MouseEvent.MOUSE_DOWN, removeDifficulty); } public function mini_follow_link(_arg1:MouseEvent):void{ var _local2:String; var _local3:URLRequest; if (linkFollowed == false){ linkFollowed = true; _local2 = "http://armorgames.com"; _local3 = new URLRequest(_local2); navigateToURL(_local3); }; } public function spawnBlock(_arg1:Number, _arg2:Number){ var _local3:*; var _local4:*; var _local5:squareShadow_mc; _local3 = new b2BodyDef(); _local4 = new b2BoxDef(); _local4.extents.Set(10, 10); _local4.friction = 1; _local4.density = 1; _local4.restitution = 0.85; _local3.AddShape(_local4); _local3.userData = new block_mc(); _local3.position.Set(_arg1, _arg2); _local3.linearDamping = 0.03; _local3.angularDamping = 0.02; _local3.userData.width = (_local4.extents.x * 2); _local3.userData.height = (_local4.extents.y * 2); _local3.userData.id = "block"; actorCanvas.addChild(_local3.userData); _local3.userData.squareShadow = new squareShadow_mc(); _local3.userData.squareShadow.width = (_local4.extents.x * 2); _local3.userData.squareShadow.height = (_local4.extents.y * 2); actorCanvas.addChildAt(_local3.userData.squareShadow, 0); m_world.CreateBody(_local3); } public function createTarget(_arg1:Number, _arg2:Number):void{ target = new target_mc(); actorCanvas.addChildAt(target, 0); target.x = _arg1; target.y = _arg2; target.width = 50; target.height = 50; target.alpha = 0.6; target.fill.visible = false; } public function createLevel(_arg1:uint):void{ var _local2:levelContainer_mc; var _local3:*; var _local4:*; var _local5:DisplayObject; var _local6:b2Body; var _local7:b2Body; _local2 = new levelContainer_mc(); _local3 = _local2.getChildAt((_arg1 - 1)); _local4 = 0; while (_local4 < _local3.numChildren) { _local5 = _local3.getChildAt(_local4); if ((((_local5 is wallH_template)) || ((_local5 is wallV_template)))){ createWall(_local5.x, _local5.y, _local5.width, _local5.height, _local5.rotation); }; if ((_local5 is block_template)){ spawnBlock(_local5.x, _local5.y); }; if ((_local5 is pivot_template)){ spawnPivot(_local5.x, _local5.y); }; if ((_local5 is pivotV_template)){ spawnPivotV(_local5.x, _local5.y); }; if ((_local5 is pivotC_template)){ spawnPivotC(_local5.x, _local5.y); }; if ((_local5 is doorStop_template)){ spawnDoorStop(_local5.x, _local5.y); }; if ((_local5 is motor_template)){ spawnMotor(_local5.x, _local5.y); }; if ((_local5 is ball_template)){ _local6 = spawnBall(_local6, _local5.x, _local5.y); }; if ((_local5 is puck_template)){ spawnPuck(_local5.x, _local5.y); }; if ((_local5 is target_template)){ createTarget(_local5.x, _local5.y); }; if ((_local5 is bonusDiscs_template)){ createBonusDiscs(_local5.x, _local5.y); }; if ((_local5 is hintBox_template)){ createHintBox(_local5.x, _local5.y); }; if ((_local5 is travelator_template)){ createTravelator(_local5.x, _local5.y, "right"); }; if ((_local5 is travelatorleft_template)){ createTravelator(_local5.x, _local5.y, "left"); }; if ((_local5 is travelatordown_template)){ createTravelator(_local5.x, _local5.y, "down"); }; _local4++; }; if (soundOn == true){ if (levelRestarted == false){ } else { puckOutSound.play(); }; }; } public function gameOver():void{ restoreCursor(); if (soundOn == true){ if (gameWon == false){ gameoverSound.play(); } else { winSound.play(); }; }; guiTop.resetButton.removeEventListener(MouseEvent.MOUSE_DOWN, resetLevel); guiTop.quitButton.removeEventListener(MouseEvent.MOUSE_DOWN, confirmQuitGame); gameOverScreen = new gameOverScreen_mc(); stage.addChild(gameOverScreen); if (gameWon == false){ gameOverScreen.cup1.visible = false; gameOverScreen.cup2.visible = false; }; if (gameWon == false){ gameOverScreen.message1.text = "Game Over"; } else { gameOverScreen.message1.text = "Congratulations"; }; gameOverScreen.message.text = " "; if (gameWon == false){ gameOverScreen.finalScore.text = ("You scored " + String(score)); } else { gameOverScreen.finalScore.text = (("You cleared all levels and scored " + String(score)) + ". Free Play mode unlocked!"); padlockOff = true; }; gameOverScreen.backToMenu.addEventListener(MouseEvent.MOUSE_DOWN, removeGameOverScreen); gameOverScreen.submitButton.addEventListener(MouseEvent.MOUSE_DOWN, submitHighscore); gameOverScreen.viewHighScores.addEventListener(MouseEvent.MOUSE_DOWN, gotoHighScores); gameOverScreen.retryButton.addEventListener(MouseEvent.MOUSE_DOWN, retry); } public function handleMouseDown(_arg1:MouseEvent):void{ mouseIsDown = true; } } }//package kinetikz_unlocked_fla
Section 66
//myPreloader_mc_5 (kinetikz_unlocked_fla.myPreloader_mc_5) package kinetikz_unlocked_fla { import flash.display.*; import flash.text.*; public dynamic class myPreloader_mc_5 extends MovieClip { public var loadingBar:MovieClip; public var loadingText:TextField; } }//package kinetikz_unlocked_fla
Section 67
//xczcxzc_135 (kinetikz_unlocked_fla.xczcxzc_135) package kinetikz_unlocked_fla { import flash.display.*; public dynamic class xczcxzc_135 extends MovieClip { public function xczcxzc_135(){ addFrameScript(125, frame126); } function frame126(){ MovieClip(parent).gotoAndStop(4); } } }//package kinetikz_unlocked_fla
Section 68
//ball_mc (ball_mc) package { import flash.display.*; public dynamic class ball_mc extends MovieClip { } }//package
Section 69
//ball_template (ball_template) package { import flash.display.*; public dynamic class ball_template extends MovieClip { } }//package
Section 70
//ball1 (ball1) package { import flash.media.*; public dynamic class ball1 extends Sound { } }//package
Section 71
//block_mc (block_mc) package { import flash.display.*; public dynamic class block_mc extends MovieClip { } }//package
Section 72
//block_template (block_template) package { import flash.display.*; public dynamic class block_template extends MovieClip { } }//package
Section 73
//bonusDiscs_mc (bonusDiscs_mc) package { import flash.display.*; public dynamic class bonusDiscs_mc extends MovieClip { } }//package
Section 74
//bonusDiscs_template (bonusDiscs_template) package { import flash.display.*; public dynamic class bonusDiscs_template extends MovieClip { } }//package
Section 75
//box (box) package { import flash.media.*; public dynamic class box extends Sound { } }//package
Section 76
//confirmQuit_mc (confirmQuit_mc) package { import flash.display.*; public dynamic class confirmQuit_mc extends MovieClip { public var no:SimpleButton; public var yes:SimpleButton; } }//package
Section 77
//crosshair (crosshair) package { import flash.display.*; public dynamic class crosshair extends MovieClip { } }//package
Section 78
//doorStop_mc (doorStop_mc) package { import flash.display.*; public dynamic class doorStop_mc extends MovieClip { } }//package
Section 79
//doorStop_template (doorStop_template) package { import flash.display.*; public dynamic class doorStop_template extends MovieClip { } }//package
Section 80
//gameover (gameover) package { import flash.media.*; public dynamic class gameover extends Sound { } }//package
Section 81
//gameOverScreen_mc (gameOverScreen_mc) package { import flash.display.*; import flash.text.*; public dynamic class gameOverScreen_mc extends MovieClip { public var retryButton:SimpleButton; public var message:TextField; public var message1:TextField; public var playerName:TextField; public var backToMenu:SimpleButton; public var submitButton:SimpleButton; public var cup1:MovieClip; public var cup2:MovieClip; public var finalScore:TextField; public var viewHighScores:SimpleButton; } }//package
Section 82
//guiBack_mc (guiBack_mc) package { import flash.display.*; public dynamic class guiBack_mc extends MovieClip { } }//package
Section 83
//guiTop_mc (guiTop_mc) package { import flash.display.*; import flash.text.*; public dynamic class guiTop_mc extends MovieClip { public var soundToggleOff:MovieClip; public var soundToggle:SimpleButton; public var discsDisplay:TextField; public var quitButton:SimpleButton; public var resetButton:SimpleButton; public var soundToggleOn:MovieClip; public var musicToggleOn:SimpleButton; public var levelDisplay:TextField; public var scoreDisplay:TextField; public var musicToggleOff:SimpleButton; public var musicToggle:SimpleButton; } }//package
Section 84
//gun_mc (gun_mc) package { import flash.display.*; public dynamic class gun_mc extends MovieClip { public var turret:MovieClip; } }//package
Section 85
//highlight_mc (highlight_mc) package { import flash.display.*; public dynamic class highlight_mc extends MovieClip { } }//package
Section 86
//hintBox_mc (hintBox_mc) package { import flash.display.*; import flash.text.*; public dynamic class hintBox_mc extends MovieClip { public var message:TextField; } }//package
Section 87
//hintBox_template (hintBox_template) package { import flash.display.*; public dynamic class hintBox_template extends MovieClip { } }//package
Section 88
//instructions_mc (instructions_mc) package { import flash.display.*; public dynamic class instructions_mc extends MovieClip { public var gui:guiTop_mc; public var backToMenu:SimpleButton; public function instructions_mc(){ addFrameScript(541, frame542); } function frame542(){ stop(); } } }//package
Section 89
//kinetikz (kinetikz) package { import flash.media.*; public dynamic class kinetikz extends Sound { } }//package
Section 90
//letter_mc (letter_mc) package { import flash.display.*; import flash.text.*; public dynamic class letter_mc extends MovieClip { public var letter:TextField; } }//package
Section 91
//levelComplete_mc (levelComplete_mc) package { import flash.display.*; import flash.text.*; public dynamic class levelComplete_mc extends MovieClip { public var message:TextField; public var resume:SimpleButton; } }//package
Section 92
//levelContainer_mc (levelContainer_mc) package { import flash.display.*; public dynamic class levelContainer_mc extends MovieClip { } }//package
Section 93
//menu_mc (menu_mc) package { import flash.display.*; import flash.text.*; public dynamic class menu_mc extends MovieClip { public var soundBox:SimpleButton; public var instructionsButton:SimpleButton; public var musicBox:SimpleButton; public var moreGames:SimpleButton; public var playGame:SimpleButton; public var gamingNews:SimpleButton; public var difficultyMenu:MovieClip; public var warningMessage:TextField; public var viewHighScores:SimpleButton; } }//package
Section 94
//metal (metal) package { import flash.media.*; public dynamic class metal extends Sound { } }//package
Section 95
//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 96
//motor_mc (motor_mc) package { import flash.display.*; public dynamic class motor_mc extends MovieClip { } }//package
Section 97
//motor_template (motor_template) package { import flash.display.*; public dynamic class motor_template extends MovieClip { } }//package
Section 98
//newDisc (newDisc) package { import flash.media.*; public dynamic class newDisc extends Sound { } }//package
Section 99
//newLevel (newLevel) package { import flash.media.*; public dynamic class newLevel extends Sound { } }//package
Section 100
//pivot_mc (pivot_mc) package { import flash.display.*; public dynamic class pivot_mc extends MovieClip { } }//package
Section 101
//pivot_template (pivot_template) package { import flash.display.*; public dynamic class pivot_template extends MovieClip { } }//package
Section 102
//pivotC_mc (pivotC_mc) package { import flash.display.*; public dynamic class pivotC_mc extends MovieClip { } }//package
Section 103
//pivotC_template (pivotC_template) package { import flash.display.*; public dynamic class pivotC_template extends MovieClip { } }//package
Section 104
//pivotV_mc (pivotV_mc) package { import flash.display.*; public dynamic class pivotV_mc extends MovieClip { } }//package
Section 105
//pivotV_template (pivotV_template) package { import flash.display.*; public dynamic class pivotV_template extends MovieClip { } }//package
Section 106
//puck_mc (puck_mc) package { import flash.display.*; public dynamic class puck_mc extends MovieClip { } }//package
Section 107
//puck_template (puck_template) package { import flash.display.*; public dynamic class puck_template extends MovieClip { } }//package
Section 108
//puckOut (puckOut) package { import flash.media.*; public dynamic class puckOut extends Sound { } }//package
Section 109
//restartButton_bt (restartButton_bt) package { import flash.display.*; public dynamic class restartButton_bt extends SimpleButton { } }//package
Section 110
//roundShadow_mc (roundShadow_mc) package { import flash.display.*; public dynamic class roundShadow_mc extends MovieClip { } }//package
Section 111
//shoot (shoot) package { import flash.media.*; public dynamic class shoot extends Sound { } }//package
Section 112
//sounds_mc (sounds_mc) package { import flash.display.*; public dynamic class sounds_mc extends MovieClip { } }//package
Section 113
//squareShadow_mc (squareShadow_mc) package { import flash.display.*; public dynamic class squareShadow_mc extends MovieClip { } }//package
Section 114
//target_mc (target_mc) package { import flash.display.*; public dynamic class target_mc extends MovieClip { public var fill:MovieClip; public var hitZone:MovieClip; } }//package
Section 115
//target_template (target_template) package { import flash.display.*; public dynamic class target_template extends MovieClip { } }//package
Section 116
//target2 (target2) package { import flash.media.*; public dynamic class target2 extends Sound { } }//package
Section 117
//travelator_mc (travelator_mc) package { import flash.display.*; public dynamic class travelator_mc extends MovieClip { public var hitZone:MovieClip; } }//package
Section 118
//travelator_template (travelator_template) package { import flash.display.*; public dynamic class travelator_template extends MovieClip { } }//package
Section 119
//travelatordown_mc (travelatordown_mc) package { import flash.display.*; public dynamic class travelatordown_mc extends MovieClip { public var hitZone:MovieClip; } }//package
Section 120
//travelatordown_template (travelatordown_template) package { import flash.display.*; public dynamic class travelatordown_template extends MovieClip { } }//package
Section 121
//travelatorleft_mc (travelatorleft_mc) package { import flash.display.*; public dynamic class travelatorleft_mc extends MovieClip { public var hitZone:MovieClip; } }//package
Section 122
//travelatorleft_template (travelatorleft_template) package { import flash.display.*; public dynamic class travelatorleft_template extends MovieClip { } }//package
Section 123
//wall_mc (wall_mc) package { import flash.display.*; public dynamic class wall_mc extends MovieClip { } }//package
Section 124
//wallH_template (wallH_template) package { import flash.display.*; public dynamic class wallH_template extends MovieClip { } }//package
Section 125
//wallV_template (wallV_template) package { import flash.display.*; public dynamic class wallV_template extends MovieClip { } }//package
Section 126
//win (win) package { import flash.media.*; public dynamic class win extends Sound { } }//package

Library Items

Symbol 1 GraphicUsed by:4
Symbol 2 FontUsed by:3 21 56 57 58 146 209 210 211 212 213 214 215 216 218 220 221 225 227 230 231 232 233 241 242 243 244 245 247 249 251 265
Symbol 3 EditableTextUses:2Used by:4
Symbol 4 MovieClip {letter_mc}Uses:1 3
Symbol 5 FontUsed by:6 8 127
Symbol 6 TextUses:5Used by:10
Symbol 7 GraphicUsed by:10
Symbol 8 TextUses:5Used by:10
Symbol 9 GraphicUsed by:10
Symbol 10 Button {restartButton_bt}Uses:6 7 8 9
Symbol 11 GraphicUsed by:12 42 109
Symbol 12 MovieClipUses:11Used by:13
Symbol 13 MovieClip {squareShadow_mc}Uses:12Used by:287
Symbol 14 GraphicUsed by:15
Symbol 15 MovieClipUses:14Used by:16
Symbol 16 MovieClip {roundShadow_mc}Uses:15Used by:287
Symbol 17 GraphicUsed by:18
Symbol 18 MovieClip {ball_mc}Uses:17Used by:45 158 287
Symbol 19 GraphicUsed by:20 263 276 287 295
Symbol 20 MovieClipUses:19Used by:Timeline
Symbol 21 TextUses:2Used by:22
Symbol 22 ButtonUses:21Used by:Timeline
Symbol 23 GraphicUsed by:24
Symbol 24 MovieClipUses:23Used by:25
Symbol 25 MovieClip {gun_mc}Uses:24Used by:91 287  Timeline
Symbol 26 GraphicUsed by:32
Symbol 27 GraphicUsed by:28 144 145 266 267
Symbol 28 MovieClipUses:27Used by:32
Symbol 29 FontUsed by:30 50 51 53 54 60 62 67 69 123 260 264
Symbol 30 EditableTextUses:29Used by:32
Symbol 31 GraphicUsed by:32
Symbol 32 MovieClip {kinetikz_unlocked_fla.myPreloader_mc_5}Uses:26 28 30 31Used by:Timeline
Symbol 33 GraphicUsed by:91 124 256 257
Symbol 34 GraphicUsed by:35
Symbol 35 MovieClip {puck_mc}Uses:34Used by:36 287
Symbol 36 MovieClip {puck_template}Uses:35Used by:91 149 151 155 160 161 165 170 172 173 174 175 182 183 184 185 186 188 189 190 191 192 193 194 195 196 197 198 199 200 201 287
Symbol 37 GraphicUsed by:38
Symbol 38 MovieClipUses:37Used by:43
Symbol 39 GraphicUsed by:43
Symbol 40 GraphicUsed by:41
Symbol 41 MovieClipUses:40Used by:43
Symbol 42 MovieClipUses:11Used by:43
Symbol 43 MovieClip {target_mc}Uses:38 39 41 42Used by:44 287
Symbol 44 MovieClip {target_template}Uses:43Used by:91 149 151 155 160 161 165 170 172 173 174 175 182 183 184 185 186 188 189 190 191 192 193 194 195 196 197 198 199 200 201 287
Symbol 45 MovieClip {ball_template}Uses:18Used by:91 172 174 188 194 199 287
Symbol 46 GraphicUsed by:47
Symbol 47 MovieClip {crosshair}Uses:46Used by:91
Symbol 48 BitmapUsed by:49
Symbol 49 GraphicUses:48Used by:71
Symbol 50 TextUses:29Used by:52
Symbol 51 TextUses:29Used by:52
Symbol 52 ButtonUses:50 51Used by:71
Symbol 53 TextUses:29Used by:55
Symbol 54 TextUses:29Used by:55
Symbol 55 ButtonUses:53 54Used by:71
Symbol 56 EditableTextUses:2Used by:71
Symbol 57 EditableTextUses:2Used by:71
Symbol 58 EditableTextUses:2Used by:71
Symbol 59 GraphicUsed by:71
Symbol 60 TextUses:29Used by:61
Symbol 61 ButtonUses:60Used by:71
Symbol 62 TextUses:29Used by:63
Symbol 63 ButtonUses:62Used by:71
Symbol 64 GraphicUsed by:65 66
Symbol 65 MovieClipUses:64Used by:66
Symbol 66 ButtonUses:65 64Used by:71
Symbol 67 TextUses:29Used by:68
Symbol 68 MovieClipUses:67Used by:71
Symbol 69 TextUses:29Used by:70
Symbol 70 MovieClipUses:69Used by:71
Symbol 71 MovieClip {guiTop_mc}Uses:49 52 55 56 57 58 59 61 63 66 68 70Used by:91 257 287
Symbol 72 GraphicUsed by:75
Symbol 73 FontUsed by:74 77 80 83 86 88 223 231 233 239 240 261 262 271 275 277 278 281 282 284
Symbol 74 TextUses:73Used by:75
Symbol 75 MovieClipUses:72 74Used by:91
Symbol 76 GraphicUsed by:78
Symbol 77 TextUses:73Used by:78
Symbol 78 MovieClipUses:76 77Used by:91
Symbol 79 GraphicUsed by:81
Symbol 80 TextUses:73Used by:81
Symbol 81 MovieClipUses:79 80Used by:91
Symbol 82 GraphicUsed by:84
Symbol 83 TextUses:73Used by:84
Symbol 84 MovieClipUses:82 83Used by:91
Symbol 85 GraphicUsed by:87
Symbol 86 TextUses:73Used by:87
Symbol 87 MovieClipUses:85 86Used by:91
Symbol 88 TextUses:73Used by:89
Symbol 89 ButtonUses:88Used by:91 274
Symbol 90 GraphicUsed by:91
Symbol 91 MovieClip {instructions_mc}Uses:33 36 44 45 47 25 71 75 78 81 84 87 89 90Used by:287  Timeline
Symbol 92 FontUsed by:93
Symbol 93 TextUses:92Used by:287  Timeline
Symbol 94 GraphicUsed by:95
Symbol 95 MovieClipUses:94Used by:100 103 104
Symbol 96 GraphicUsed by:100 103 104
Symbol 97 GraphicUsed by:100 103 104
Symbol 98 GraphicUsed by:100
Symbol 99 GraphicUsed by:100
Symbol 100 MovieClip {travelatordown_mc}Uses:95 96 97 98 99Used by:Timeline
Symbol 101 GraphicUsed by:103 104
Symbol 102 GraphicUsed by:103 104
Symbol 103 MovieClip {travelatorleft_mc}Uses:95 96 97 101 102Used by:Timeline
Symbol 104 MovieClip {travelator_mc}Uses:95 96 97 101 102Used by:106 108 150 287
Symbol 105 GraphicUsed by:106
Symbol 106 MovieClip {travelatordown_template}Uses:104 105Used by:161 172 185 193 197 199 201  Timeline
Symbol 107 GraphicUsed by:108
Symbol 108 MovieClip {travelatorleft_template}Uses:104 107Used by:161 172 175 183 185 188 189 191 193 196 199 201  Timeline
Symbol 109 MovieClip {block_template}Uses:11Used by:160 174 184 190 196 200 287
Symbol 110 GraphicUsed by:111 139
Symbol 111 MovieClipUses:110Used by:122
Symbol 112 BitmapUsed by:113
Symbol 113 GraphicUses:112Used by:114
Symbol 114 MovieClipUses:113Used by:115 122
Symbol 115 MovieClipUses:114Used by:122
Symbol 116 BitmapUsed by:117
Symbol 117 GraphicUses:116Used by:118
Symbol 118 MovieClipUses:117Used by:122
Symbol 119 BitmapUsed by:120
Symbol 120 GraphicUses:119Used by:121
Symbol 121 MovieClipUses:120Used by:122
Symbol 122 MovieClip {kinetikz_unlocked_fla.andromedusIntro_mc_41}Uses:111 115 118 121 114Used by:287  Timeline
Symbol 123 TextUses:29Used by:287
Symbol 124 MovieClip {guiBack_mc}Uses:33Used by:287
Symbol 125 GraphicUsed by:126
Symbol 126 MovieClip {block_mc}Uses:125Used by:287
Symbol 127 TextUses:5Used by:139
Symbol 128 Sound {kinetikz}Used by:139
Symbol 129 Sound {target2}Used by:139
Symbol 130 Sound {box}Used by:139
Symbol 131 Sound {shoot}Used by:139
Symbol 132 Sound {newLevel}Used by:139
Symbol 133 Sound {puckOut}Used by:139
Symbol 134 Sound {win}Used by:139
Symbol 135 Sound {newDisc}Used by:139
Symbol 136 Sound {metal}Used by:139
Symbol 137 Sound {gameover}Used by:139
Symbol 138 Sound {ball1}Used by:139
Symbol 139 MovieClip {sounds_mc}Uses:110 127 128 129 130 131 132 133 134 135 136 137 138Used by:287
Symbol 140 GraphicUsed by:141
Symbol 141 MovieClipUses:140Used by:142
Symbol 142 MovieClip {wall_mc}Uses:141Used by:287
Symbol 143 GraphicUsed by:149 151 155 160 161 165 170 172 173 174 175 182 183 184 185 186 188 189 190 191 192 193 194 195 196 197 198 199 200 201
Symbol 144 MovieClip {wallH_template}Uses:27Used by:149 151 155 160 161 165 170 172 173 174 175 182 183 184 185 186 188 189 190 191 192 193 194 195 196 197 198 199 200 201 287
Symbol 145 MovieClip {wallV_template}Uses:27Used by:149 161 170 173 174 182 184 185 190 191 192 195 198 200 201 287
Symbol 146 EditableTextUses:2Used by:147
Symbol 147 MovieClip {hintBox_mc}Uses:146Used by:148 287
Symbol 148 MovieClip {hintBox_template}Uses:147Used by:149 151 155 160 172 175 182 192 201 287
Symbol 149 MovieClipUses:143 144 44 36 145 148Used by:202
Symbol 150 MovieClip {travelator_template}Uses:104Used by:151 161 172 173 174 175 182 184 185 188 191 193 196 197 198 200 201 287
Symbol 151 MovieClipUses:143 144 44 36 150 148Used by:202
Symbol 152 GraphicUsed by:153
Symbol 153 MovieClip {pivot_mc}Uses:152Used by:154 287
Symbol 154 MovieClip {pivot_template}Uses:153Used by:155 174 184 189 193 200 201 287
Symbol 155 MovieClipUses:143 144 148 44 36 154Used by:202
Symbol 156 FontUsed by:157
Symbol 157 TextUses:156Used by:158
Symbol 158 MovieClip {bonusDiscs_mc}Uses:18 157Used by:159 287
Symbol 159 MovieClip {bonusDiscs_template}Uses:158Used by:160 175 185 186 190 192 195 196 198 199 200 201 287
Symbol 160 MovieClipUses:143 144 44 36 109 148 159Used by:202
Symbol 161 MovieClipUses:143 144 44 36 150 145 106 108Used by:202
Symbol 162 GraphicUsed by:165 185 190 193 195 196 197 199 201
Symbol 163 GraphicUsed by:164 280
Symbol 164 MovieClip {motor_template}Uses:163Used by:165 195 197 287
Symbol 165 MovieClipUses:143 144 162 44 36 164Used by:202
Symbol 166 GraphicUsed by:170
Symbol 167 GraphicUsed by:168
Symbol 168 MovieClip {pivotC_mc}Uses:167Used by:169 287
Symbol 169 MovieClip {pivotC_template}Uses:168Used by:170 192 199 287
Symbol 170 MovieClipUses:143 144 166 44 36 145 169Used by:202
Symbol 171 GraphicUsed by:172
Symbol 172 MovieClipUses:171 144 143 45 44 36 148 150 106 108Used by:202
Symbol 173 MovieClipUses:143 144 44 36 145 150Used by:202
Symbol 174 MovieClipUses:143 144 45 145 44 36 150 109 154Used by:202
Symbol 175 MovieClipUses:143 144 44 36 159 148 150 108Used by:202
Symbol 176 GraphicUsed by:177
Symbol 177 MovieClip {pivotV_mc}Uses:176Used by:178 287
Symbol 178 MovieClip {pivotV_template}Uses:177Used by:182 189 191 287
Symbol 179 GraphicUsed by:180
Symbol 180 MovieClip {doorStop_mc}Uses:179Used by:181 287
Symbol 181 MovieClip {doorStop_template}Uses:180Used by:182 287
Symbol 182 MovieClipUses:143 144 44 36 148 178 145 150 181Used by:202
Symbol 183 MovieClipUses:143 144 44 36 108Used by:202
Symbol 184 MovieClipUses:143 144 109 44 36 150 154 145Used by:202
Symbol 185 MovieClipUses:143 144 162 44 36 106 159 145 150 108Used by:202
Symbol 186 MovieClipUses:143 144 44 36 159Used by:202
Symbol 187 GraphicUsed by:188
Symbol 188 MovieClipUses:143 144 187 44 36 45 108 150Used by:202
Symbol 189 MovieClipUses:143 144 44 36 178 154 108Used by:202
Symbol 190 MovieClipUses:143 144 162 44 36 145 159 109Used by:202
Symbol 191 MovieClipUses:143 144 44 36 178 108 150 145Used by:202
Symbol 192 MovieClipUses:143 144 44 36 145 148 169 159Used by:202
Symbol 193 MovieClipUses:143 144 162 44 36 150 108 106 154Used by:202
Symbol 194 MovieClipUses:143 144 44 36 45Used by:202
Symbol 195 MovieClipUses:143 144 162 44 36 164 145 159Used by:202
Symbol 196 MovieClipUses:143 144 162 44 36 109 108 150 159Used by:202
Symbol 197 MovieClipUses:143 144 162 44 36 164 106 150Used by:202
Symbol 198 MovieClipUses:143 144 44 36 150 159 145Used by:202
Symbol 199 MovieClipUses:143 144 162 44 36 159 169 45 108 106Used by:202
Symbol 200 MovieClipUses:143 144 44 36 145 154 150 109 159Used by:202
Symbol 201 MovieClipUses:143 144 162 44 36 148 159 154 106 108 150 145Used by:202
Symbol 202 MovieClip {levelContainer_mc}Uses:149 151 155 160 161 165 170 172 173 174 175 182 183 184 185 186 188 189 190 191 192 193 194 195 196 197 198 199 200 201Used by:287
Symbol 203 GraphicUsed by:204
Symbol 204 MovieClipUses:203Used by:205
Symbol 205 MovieClip {highlight_mc}Uses:204Used by:287
Symbol 206 GraphicUsed by:257
Symbol 207 GraphicUsed by:208
Symbol 208 MovieClipUses:207Used by:257
Symbol 209 TextUses:2Used by:217
Symbol 210 TextUses:2Used by:217
Symbol 211 TextUses:2Used by:217
Symbol 212 TextUses:2Used by:217
Symbol 213 TextUses:2Used by:217
Symbol 214 TextUses:2Used by:217
Symbol 215 TextUses:2Used by:217
Symbol 216 TextUses:2Used by:217
Symbol 217 MovieClipUses:209 210 211 212 213 214 215 216Used by:257
Symbol 218 TextUses:2Used by:219
Symbol 219 ButtonUses:218Used by:257
Symbol 220 TextUses:2Used by:222
Symbol 221 TextUses:2Used by:222
Symbol 222 ButtonUses:220 221Used by:257
Symbol 223 TextUses:73Used by:224
Symbol 224 ButtonUses:223Used by:257
Symbol 225 TextUses:2Used by:226
Symbol 226 ButtonUses:225Used by:257 274
Symbol 227 TextUses:2Used by:228
Symbol 228 ButtonUses:227Used by:257
Symbol 229 GraphicUsed by:257
Symbol 230 TextUses:2Used by:257
Symbol 231 EditableTextUses:2 73Used by:257
Symbol 232 TextUses:2Used by:257
Symbol 233 EditableTextUses:2 73Used by:257
Symbol 234 GraphicUsed by:257
Symbol 235 GraphicUsed by:236
Symbol 236 ButtonUses:235Used by:257
Symbol 237 GraphicUsed by:238
Symbol 238 ButtonUses:237Used by:257
Symbol 239 TextUses:73Used by:257
Symbol 240 TextUses:73Used by:257
Symbol 241 EditableTextUses:2Used by:257
Symbol 242 TextUses:2Used by:256
Symbol 243 TextUses:2Used by:256
Symbol 244 TextUses:2Used by:256
Symbol 245 TextUses:2Used by:246
Symbol 246 ButtonUses:245Used by:256
Symbol 247 TextUses:2Used by:248
Symbol 248 ButtonUses:247Used by:256
Symbol 249 TextUses:2Used by:250
Symbol 250 ButtonUses:249Used by:256
Symbol 251 TextUses:2Used by:252
Symbol 252 ButtonUses:251Used by:256
Symbol 253 BitmapUsed by:254
Symbol 254 GraphicUses:253Used by:255
Symbol 255 MovieClipUses:254Used by:256
Symbol 256 MovieClip {kinetikz_unlocked_fla.difficultyMenu_mc_115}Uses:33 242 243 244 246 248 250 252 255Used by:257
Symbol 257 MovieClip {menu_mc}Uses:33 71 206 208 217 219 222 224 226 228 229 230 231 232 233 234 236 238 239 240 241 256Used by:287
Symbol 258 GraphicUsed by:259
Symbol 259 MovieClipUses:258Used by:274 279 286
Symbol 260 EditableTextUses:29Used by:274
Symbol 261 EditableTextUses:73Used by:274
Symbol 262 EditableTextUses:73Used by:274
Symbol 263 MovieClipUses:19Used by:274
Symbol 264 EditableTextUses:29Used by:274
Symbol 265 TextUses:2Used by:274
Symbol 266 MovieClipUses:27Used by:267
Symbol 267 ButtonUses:266 27Used by:274 279
Symbol 268 BitmapUsed by:269
Symbol 269 GraphicUses:268Used by:270
Symbol 270 MovieClipUses:269Used by:274
Symbol 271 TextUses:73Used by:272 273
Symbol 272 MovieClipUses:271Used by:273
Symbol 273 ButtonUses:272 271Used by:274
Symbol 274 MovieClip {gameOverScreen_mc}Uses:259 89 226 260 261 262 263 264 265 267 270 273Used by:287
Symbol 275 TextUses:73Used by:279
Symbol 276 MovieClipUses:19Used by:279
Symbol 277 EditableTextUses:73Used by:279
Symbol 278 TextUses:73Used by:279
Symbol 279 MovieClip {levelComplete_mc}Uses:259 275 276 277 278 267Used by:287
Symbol 280 MovieClip {motor_mc}Uses:163Used by:287
Symbol 281 TextUses:73Used by:286
Symbol 282 TextUses:73Used by:283
Symbol 283 ButtonUses:282Used by:286
Symbol 284 TextUses:73Used by:285
Symbol 285 ButtonUses:284Used by:286
Symbol 286 MovieClip {confirmQuit_mc}Uses:259 281 283 285Used by:287
Symbol 287 MovieClipUses:35 45 109 122 123 124 18 126 139 43 142 202 44 144 145 36 16 13 205 153 154 150 104 178 177 168 169 71 257 91 93 25 274 279 158 159 147 148 280 164 181 180 19 286Used by:Timeline
Symbol 288 GraphicUsed by:289
Symbol 289 MovieClipUses:288Used by:295
Symbol 290 GraphicUsed by:295
Symbol 291 GraphicUsed by:295
Symbol 292 GraphicUsed by:295
Symbol 293 GraphicUsed by:294
Symbol 294 MovieClipUses:293Used by:295
Symbol 295 MovieClip {kinetikz_unlocked_fla.xczcxzc_135}Uses:19 289 290 291 292 294 SS1Used by:Timeline
Streaming Sound 1Used by:Symbol 295 MovieClip {kinetikz_unlocked_fla.xczcxzc_135}

Instance Names

"mini_actorCanvas"Frame 1Symbol 20 MovieClip
"startButton"Frame 1Symbol 22 Button
"mini_gun"Frame 1Symbol 25 MovieClip {gun_mc}
"myPreloader"Frame 1Symbol 32 MovieClip {kinetikz_unlocked_fla.myPreloader_mc_5}
"loadToStage"Frame 2Symbol 287 MovieClip
"armorIntro"Frame 3Symbol 295 MovieClip {kinetikz_unlocked_fla.xczcxzc_135}
"andromedusIntro"Frame 4Symbol 122 MovieClip {kinetikz_unlocked_fla.andromedusIntro_mc_41}
"letter"Symbol 4 MovieClip {letter_mc} Frame 1Symbol 3 EditableText
"turret"Symbol 25 MovieClip {gun_mc} Frame 1Symbol 24 MovieClip
"loadingBar"Symbol 32 MovieClip {kinetikz_unlocked_fla.myPreloader_mc_5} Frame 1Symbol 28 MovieClip
"loadingText"Symbol 32 MovieClip {kinetikz_unlocked_fla.myPreloader_mc_5} Frame 1Symbol 30 EditableText
"fill"Symbol 43 MovieClip {target_mc} Frame 1Symbol 38 MovieClip
"hitZone"Symbol 43 MovieClip {target_mc} Frame 1Symbol 42 MovieClip
"resetButton"Symbol 71 MovieClip {guiTop_mc} Frame 1Symbol 52 Button
"quitButton"Symbol 71 MovieClip {guiTop_mc} Frame 1Symbol 55 Button
"levelDisplay"Symbol 71 MovieClip {guiTop_mc} Frame 1Symbol 56 EditableText
"scoreDisplay"Symbol 71 MovieClip {guiTop_mc} Frame 1Symbol 57 EditableText
"discsDisplay"Symbol 71 MovieClip {guiTop_mc} Frame 1Symbol 58 EditableText
"musicToggleOn"Symbol 71 MovieClip {guiTop_mc} Frame 1Symbol 61 Button
"musicToggleOff"Symbol 71 MovieClip {guiTop_mc} Frame 1Symbol 63 Button
"musicToggle"Symbol 71 MovieClip {guiTop_mc} Frame 1Symbol 66 Button
"soundToggleOn"Symbol 71 MovieClip {guiTop_mc} Frame 1Symbol 68 MovieClip
"soundToggleOff"Symbol 71 MovieClip {guiTop_mc} Frame 1Symbol 70 MovieClip
"soundToggle"Symbol 71 MovieClip {guiTop_mc} Frame 1Symbol 66 Button
"gui"Symbol 91 MovieClip {instructions_mc} Frame 1Symbol 71 MovieClip {guiTop_mc}
"backToMenu"Symbol 91 MovieClip {instructions_mc} Frame 1Symbol 89 Button
"hitZone"Symbol 100 MovieClip {travelatordown_mc} Frame 1Symbol 95 MovieClip
"hitZone"Symbol 103 MovieClip {travelatorleft_mc} Frame 1Symbol 95 MovieClip
"hitZone"Symbol 104 MovieClip {travelator_mc} Frame 1Symbol 95 MovieClip
"message"Symbol 147 MovieClip {hintBox_mc} Frame 1Symbol 146 EditableText
"easyButton"Symbol 256 MovieClip {kinetikz_unlocked_fla.difficultyMenu_mc_115} Frame 1Symbol 246 Button
"hardButton"Symbol 256 MovieClip {kinetikz_unlocked_fla.difficultyMenu_mc_115} Frame 1Symbol 248 Button
"freeButton"Symbol 256 MovieClip {kinetikz_unlocked_fla.difficultyMenu_mc_115} Frame 1Symbol 250 Button
"back"Symbol 256 MovieClip {kinetikz_unlocked_fla.difficultyMenu_mc_115} Frame 1Symbol 252 Button
"padlock"Symbol 256 MovieClip {kinetikz_unlocked_fla.difficultyMenu_mc_115} Frame 1Symbol 255 MovieClip
"playGame"Symbol 257 MovieClip {menu_mc} Frame 1Symbol 219 Button
"moreGames"Symbol 257 MovieClip {menu_mc} Frame 1Symbol 222 Button
"instructionsButton"Symbol 257 MovieClip {menu_mc} Frame 1Symbol 224 Button
"viewHighScores"Symbol 257 MovieClip {menu_mc} Frame 1Symbol 226 Button
"gamingNews"Symbol 257 MovieClip {menu_mc} Frame 1Symbol 228 Button
"soundBox"Symbol 257 MovieClip {menu_mc} Frame 1Symbol 236 Button
"musicBox"Symbol 257 MovieClip {menu_mc} Frame 1Symbol 238 Button
"warningMessage"Symbol 257 MovieClip {menu_mc} Frame 1Symbol 241 EditableText
"difficultyMenu"Symbol 257 MovieClip {menu_mc} Frame 1Symbol 256 MovieClip {kinetikz_unlocked_fla.difficultyMenu_mc_115}
"backToMenu"Symbol 274 MovieClip {gameOverScreen_mc} Frame 1Symbol 89 Button
"viewHighScores"Symbol 274 MovieClip {gameOverScreen_mc} Frame 1Symbol 226 Button
"message"Symbol 274 MovieClip {gameOverScreen_mc} Frame 1Symbol 260 EditableText
"message1"Symbol 274 MovieClip {gameOverScreen_mc} Frame 1Symbol 261 EditableText
"finalScore"Symbol 274 MovieClip {gameOverScreen_mc} Frame 1Symbol 262 EditableText
"playerName"Symbol 274 MovieClip {gameOverScreen_mc} Frame 1Symbol 264 EditableText
"submitButton"Symbol 274 MovieClip {gameOverScreen_mc} Frame 1Symbol 267 Button
"cup1"Symbol 274 MovieClip {gameOverScreen_mc} Frame 1Symbol 270 MovieClip
"cup2"Symbol 274 MovieClip {gameOverScreen_mc} Frame 1Symbol 270 MovieClip
"retryButton"Symbol 274 MovieClip {gameOverScreen_mc} Frame 1Symbol 273 Button
"message"Symbol 279 MovieClip {levelComplete_mc} Frame 1Symbol 277 EditableText
"resume"Symbol 279 MovieClip {levelComplete_mc} Frame 1Symbol 267 Button
"yes"Symbol 286 MovieClip {confirmQuit_mc} Frame 1Symbol 283 Button
"no"Symbol 286 MovieClip {confirmQuit_mc} Frame 1Symbol 285 Button

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata not present, AS3.




http://swfchan.com/7/30027/info.shtml
Created: 19/5 -2019 14:22:29 Last modified: 19/5 -2019 14:22:29 Server time: 21/12 -2024 14:09:32