home *** CD-ROM | disk | FTP | other *** search
Text File | 2010-05-14 | 36.4 KB | 1,045 lines |
- package Box2D.Dynamics
- {
- import Box2D.Collision.*;
- import Box2D.Collision.Shapes.*;
- import Box2D.Common.*;
- import Box2D.Common.Math.*;
- import Box2D.Dynamics.Contacts.*;
- import Box2D.Dynamics.Joints.*;
-
- public class _fp437
- {
- public static var m_continuousPhysics:Boolean;
-
- public static var m_warmStarting:Boolean;
-
- public static var m_positionCorrection:Boolean;
-
- private static var s_jointColor:_ny735 = new _ny735(0.5,0.8,0.8);
-
- private static var s_coreColor:_ny735 = new _ny735(0.9,0.6,0.6);
-
- private static var s_xf:_ni781 = new _ni781();
-
- public var m_blockAllocator:*;
-
- public var m_boundaryListener:_wy488;
-
- public var m_contactList:_nb823;
-
- public var m_contactListener:_nu737;
-
- public var m_broadPhase:_lx230;
-
- public var m_inv_dt0:Number;
-
- public var m_jointCount:int;
-
- public var m_bodyCount:int;
-
- public var m_lock:Boolean;
-
- public var m_destructionListener:_sk806;
-
- public var m_allowSleep:Boolean;
-
- public var m_positionIterationCount:int;
-
- public var m_groundBody:_th791;
-
- public var m_contactCount:int;
-
- public var m_contactFilter:_fm757;
-
- public var m_bodyList:_th791;
-
- public var m_debugDraw:_ee618;
-
- public var m_stackAllocator:*;
-
- public var m_jointList:_yw701;
-
- public var m_gravity:b2Vec2;
-
- public var m_contactManager:_gj519;
-
- public function _fp437(param1:_pv475, param2:b2Vec2, param3:Boolean)
- {
- var _loc4_:_qh446 = null;
- m_contactManager = new _gj519();
- super();
- m_destructionListener = null;
- m_boundaryListener = null;
- m_contactFilter = _fm757.b2_defaultFilter;
- m_contactListener = null;
- m_debugDraw = null;
- m_bodyList = null;
- m_contactList = null;
- m_jointList = null;
- m_bodyCount = 0;
- m_contactCount = 0;
- m_jointCount = 0;
- m_positionCorrection = true;
- m_warmStarting = true;
- m_continuousPhysics = true;
- m_allowSleep = param3;
- m_gravity = param2;
- m_lock = false;
- m_inv_dt0 = 0;
- m_contactManager.m_world = this;
- m_broadPhase = new _lx230(param1,m_contactManager);
- _loc4_ = new _qh446();
- m_groundBody = _ea632(_loc4_);
- }
-
- public function _ap354(param1:_yw701) : void
- {
- var _loc2_:Boolean = false;
- var _loc3_:_th791 = null;
- var _loc4_:_th791 = null;
- var _loc5_:_th791 = null;
- var _loc6_:_hx306 = null;
- _loc2_ = param1.m_collideConnected;
- if(param1.m_prev)
- {
- param1.m_prev.m_next = param1.m_next;
- }
- if(param1.m_next)
- {
- param1.m_next.m_prev = param1.m_prev;
- }
- if(param1 == m_jointList)
- {
- m_jointList = param1.m_next;
- }
- _loc3_ = param1.m_body1;
- _loc4_ = param1.m_body2;
- _loc3_._uo631();
- _loc4_._uo631();
- if(param1.m_node1.prev)
- {
- param1.m_node1.prev.next = param1.m_node1.next;
- }
- if(param1.m_node1.next)
- {
- param1.m_node1.next.prev = param1.m_node1.prev;
- }
- if(param1.m_node1 == _loc3_.m_jointList)
- {
- _loc3_.m_jointList = param1.m_node1.next;
- }
- param1.m_node1.prev = null;
- param1.m_node1.next = null;
- if(param1.m_node2.prev)
- {
- param1.m_node2.prev.next = param1.m_node2.next;
- }
- if(param1.m_node2.next)
- {
- param1.m_node2.next.prev = param1.m_node2.prev;
- }
- if(param1.m_node2 == _loc4_.m_jointList)
- {
- _loc4_.m_jointList = param1.m_node2.next;
- }
- param1.m_node2.prev = null;
- param1.m_node2.next = null;
- _yw701._ai321(param1,m_blockAllocator);
- --m_jointCount;
- if(_loc2_ == false)
- {
- _loc5_ = _loc3_.m_shapeCount < _loc4_.m_shapeCount ? _loc3_ : _loc4_;
- _loc6_ = _loc5_.m_shapeList;
- while(_loc6_)
- {
- _loc6_._jt704(m_broadPhase,_loc5_.m_xf);
- _loc6_ = _loc6_.m_next;
- }
- }
- }
-
- public function _og618(param1:_ee618) : void
- {
- m_debugDraw = param1;
- }
-
- public function _yd266(param1:b2Vec2) : void
- {
- m_gravity = param1;
- }
-
- public function _ea632(param1:_qh446) : _th791
- {
- var _loc2_:_th791 = null;
- if(m_lock == true)
- {
- return null;
- }
- _loc2_ = new _th791(param1,this);
- _loc2_.m_prev = null;
- _loc2_.m_next = m_bodyList;
- if(m_bodyList)
- {
- m_bodyList.m_prev = _loc2_;
- }
- m_bodyList = _loc2_;
- ++m_bodyCount;
- return _loc2_;
- }
-
- public function _nl191(param1:Boolean) : void
- {
- m_warmStarting = param1;
- }
-
- public function _qr65(param1:_pv475, param2:Array, param3:int) : int
- {
- var _loc4_:Array = null;
- var _loc5_:int = 0;
- var _loc6_:int = 0;
- _loc4_ = new Array(param3);
- _loc5_ = m_broadPhase._yg769(param1,_loc4_,param3);
- _loc6_ = 0;
- while(_loc6_ < _loc5_)
- {
- param2[_loc6_] = _loc4_[_loc6_];
- _loc6_++;
- }
- return _loc5_;
- }
-
- public function _ej487() : void
- {
- m_broadPhase._ej487();
- }
-
- public function _mm442(param1:_hx306) : void
- {
- param1._jt704(m_broadPhase,param1.m_body.m_xf);
- }
-
- public function _qk184(param1:_es399) : _yw701
- {
- var _loc2_:_yw701 = null;
- var _loc3_:_th791 = null;
- var _loc4_:_hx306 = null;
- _loc2_ = _yw701._em71(param1,m_blockAllocator);
- _loc2_.m_prev = null;
- _loc2_.m_next = m_jointList;
- if(m_jointList)
- {
- m_jointList.m_prev = _loc2_;
- }
- m_jointList = _loc2_;
- ++m_jointCount;
- _loc2_.m_node1.joint = _loc2_;
- _loc2_.m_node1.other = _loc2_.m_body2;
- _loc2_.m_node1.prev = null;
- _loc2_.m_node1.next = _loc2_.m_body1.m_jointList;
- if(_loc2_.m_body1.m_jointList)
- {
- _loc2_.m_body1.m_jointList.prev = _loc2_.m_node1;
- }
- _loc2_.m_body1.m_jointList = _loc2_.m_node1;
- _loc2_.m_node2.joint = _loc2_;
- _loc2_.m_node2.other = _loc2_.m_body1;
- _loc2_.m_node2.prev = null;
- _loc2_.m_node2.next = _loc2_.m_body2.m_jointList;
- if(_loc2_.m_body2.m_jointList)
- {
- _loc2_.m_body2.m_jointList.prev = _loc2_.m_node2;
- }
- _loc2_.m_body2.m_jointList = _loc2_.m_node2;
- if(param1.collideConnected == false)
- {
- _loc3_ = param1.body1.m_shapeCount < param1.body2.m_shapeCount ? param1.body1 : param1.body2;
- _loc4_ = _loc3_.m_shapeList;
- while(_loc4_)
- {
- _loc4_._jt704(m_broadPhase,_loc3_.m_xf);
- _loc4_ = _loc4_.m_next;
- }
- }
- return _loc2_;
- }
-
- public function _gu529(param1:Number, param2:int) : void
- {
- var _loc3_:_ut97 = null;
- m_lock = true;
- _loc3_ = new _ut97();
- _loc3_.dt = param1;
- _loc3_.maxIterations = param2;
- if(param1 > 0)
- {
- _loc3_.inv_dt = 1 / param1;
- }
- else
- {
- _loc3_.inv_dt = 0;
- }
- _loc3_.dtRatio = m_inv_dt0 * param1;
- _loc3_.positionCorrection = m_positionCorrection;
- _loc3_.warmStarting = m_warmStarting;
- m_contactManager._yo98();
- if(_loc3_.dt > 0)
- {
- _eq278(_loc3_);
- }
- if(m_continuousPhysics && _loc3_.dt > 0)
- {
- _ss251(_loc3_);
- }
- _yi655();
- m_inv_dt0 = _loc3_.inv_dt;
- m_lock = false;
- }
-
- public function _md511(param1:_th791) : void
- {
- var _loc2_:_gs664 = null;
- var _loc3_:_hx306 = null;
- var _loc4_:_gs664 = null;
- var _loc5_:_hx306 = null;
- if(m_lock == true)
- {
- return;
- }
- _loc2_ = param1.m_jointList;
- while(_loc2_)
- {
- _loc4_ = _loc2_;
- _loc2_ = _loc2_.next;
- if(m_destructionListener)
- {
- m_destructionListener._qk634(_loc4_.joint);
- }
- _ap354(_loc4_.joint);
- }
- _loc3_ = param1.m_shapeList;
- while(_loc3_)
- {
- _loc5_ = _loc3_;
- _loc3_ = _loc3_.m_next;
- if(m_destructionListener)
- {
- m_destructionListener._ia490(_loc5_);
- }
- _loc5_._wp50(m_broadPhase);
- _hx306._ai321(_loc5_,m_blockAllocator);
- }
- if(param1.m_prev)
- {
- param1.m_prev.m_next = param1.m_next;
- }
- if(param1.m_next)
- {
- param1.m_next.m_prev = param1.m_prev;
- }
- if(param1 == m_bodyList)
- {
- m_bodyList = param1.m_next;
- }
- --m_bodyCount;
- }
-
- public function _il32(param1:_sk806) : void
- {
- m_destructionListener = param1;
- }
-
- public function _bk63() : int
- {
- return m_broadPhase.m_pairManager.m_pairCount;
- }
-
- public function _cx763(param1:_fm757) : void
- {
- m_contactFilter = param1;
- }
-
- public function _fy651(param1:Boolean) : void
- {
- m_continuousPhysics = param1;
- }
-
- public function _rv304() : _th791
- {
- return m_bodyList;
- }
-
- public function _gg115(param1:_nu737) : void
- {
- m_contactListener = param1;
- }
-
- public function _ss678() : _yw701
- {
- return m_jointList;
- }
-
- public function _sf664() : int
- {
- return m_broadPhase.m_proxyCount;
- }
-
- public function _ci380() : int
- {
- return m_bodyCount;
- }
-
- public function _yi655() : void
- {
- var _loc1_:uint = 0;
- var _loc2_:int = 0;
- var _loc3_:_th791 = null;
- var _loc4_:_hx306 = null;
- var _loc5_:_yw701 = null;
- var _loc6_:_lx230 = null;
- var _loc7_:b2Vec2 = null;
- var _loc8_:b2Vec2 = null;
- var _loc9_:b2Vec2 = null;
- var _loc10_:_ny735 = null;
- var _loc11_:_ni781 = null;
- var _loc12_:_pv475 = null;
- var _loc13_:_pv475 = null;
- var _loc14_:Array = null;
- var _loc15_:* = false;
- var _loc16_:uint = 0;
- var _loc17_:_yl661 = null;
- var _loc18_:_cm170 = null;
- var _loc19_:_cm170 = null;
- var _loc20_:b2Vec2 = null;
- var _loc21_:b2Vec2 = null;
- var _loc22_:_cm170 = null;
- var _loc23_:_bs125 = null;
- var _loc24_:_ik102 = null;
- var _loc25_:b2Vec2 = null;
- var _loc26_:_oh327 = null;
- var _loc27_:b2Vec2 = null;
- var _loc28_:Number = NaN;
- if(m_debugDraw == null)
- {
- return;
- }
- m_debugDraw.m_sprite.graphics.clear();
- _loc1_ = m_debugDraw._aq226();
- _loc7_ = new b2Vec2();
- _loc8_ = new b2Vec2();
- _loc9_ = new b2Vec2();
- _loc10_ = new _ny735(0,0,0);
- _loc12_ = new _pv475();
- _loc13_ = new _pv475();
- _loc14_ = [new b2Vec2(),new b2Vec2(),new b2Vec2(),new b2Vec2()];
- if(_loc1_ & _ee618.e_shapeBit)
- {
- _loc15_ = (_loc1_ & _ee618.e_coreShapeBit) == _ee618.e_coreShapeBit;
- _loc3_ = m_bodyList;
- while(_loc3_)
- {
- _loc11_ = _loc3_.m_xf;
- _loc4_ = _loc3_._tq424();
- while(_loc4_)
- {
- if(_loc3_._ur192())
- {
- _sa385(_loc4_,_loc11_,new _ny735(0.5,0.9,0.5),_loc15_);
- }
- else if(_loc3_._bk718())
- {
- _sa385(_loc4_,_loc11_,new _ny735(0.5,0.5,0.9),_loc15_);
- }
- else
- {
- _sa385(_loc4_,_loc11_,new _ny735(0.9,0.9,0.9),_loc15_);
- }
- _loc4_ = _loc4_.m_next;
- }
- _loc3_ = _loc3_.m_next;
- }
- }
- if(_loc1_ & _ee618.e_jointBit)
- {
- _loc5_ = m_jointList;
- while(_loc5_)
- {
- _sv193(_loc5_);
- _loc5_ = _loc5_.m_next;
- }
- }
- if(_loc1_ & _ee618.e_pairBit)
- {
- _loc6_ = m_broadPhase;
- _loc7_._br741(1 / _loc6_.m_quantizationFactor.x,1 / _loc6_.m_quantizationFactor.y);
- _loc10_._br741(0.9,0.9,0.3);
- _loc2_ = 0;
- while(_loc2_ < _yl661.b2_tableCapacity)
- {
- _loc16_ = uint(_loc6_.m_pairManager.m_hashTable[_loc2_]);
- while(_loc16_ != _yl661.b2_nullPair)
- {
- _loc17_ = _loc6_.m_pairManager.m_pairs[_loc16_];
- _loc18_ = _loc6_.m_proxyPool[_loc17_.proxyId1];
- _loc19_ = _loc6_.m_proxyPool[_loc17_.proxyId2];
- _loc12_.lowerBound.x = _loc6_.m_worldAABB.lowerBound.x + _loc7_.x * _loc6_.m_bounds[0][_loc18_.lowerBounds[0]].value;
- _loc12_.lowerBound.y = _loc6_.m_worldAABB.lowerBound.y + _loc7_.y * _loc6_.m_bounds[1][_loc18_.lowerBounds[1]].value;
- _loc12_.upperBound.x = _loc6_.m_worldAABB.lowerBound.x + _loc7_.x * _loc6_.m_bounds[0][_loc18_.upperBounds[0]].value;
- _loc12_.upperBound.y = _loc6_.m_worldAABB.lowerBound.y + _loc7_.y * _loc6_.m_bounds[1][_loc18_.upperBounds[1]].value;
- _loc13_.lowerBound.x = _loc6_.m_worldAABB.lowerBound.x + _loc7_.x * _loc6_.m_bounds[0][_loc19_.lowerBounds[0]].value;
- _loc13_.lowerBound.y = _loc6_.m_worldAABB.lowerBound.y + _loc7_.y * _loc6_.m_bounds[1][_loc19_.lowerBounds[1]].value;
- _loc13_.upperBound.x = _loc6_.m_worldAABB.lowerBound.x + _loc7_.x * _loc6_.m_bounds[0][_loc19_.upperBounds[0]].value;
- _loc13_.upperBound.y = _loc6_.m_worldAABB.lowerBound.y + _loc7_.y * _loc6_.m_bounds[1][_loc19_.upperBounds[1]].value;
- _loc8_.x = 0.5 * (_loc12_.lowerBound.x + _loc12_.upperBound.x);
- _loc8_.y = 0.5 * (_loc12_.lowerBound.y + _loc12_.upperBound.y);
- _loc9_.x = 0.5 * (_loc13_.lowerBound.x + _loc13_.upperBound.x);
- _loc9_.y = 0.5 * (_loc13_.lowerBound.y + _loc13_.upperBound.y);
- m_debugDraw._lv253(_loc8_,_loc9_,_loc10_);
- _loc16_ = _loc17_.next;
- }
- _loc2_++;
- }
- }
- if(_loc1_ & _ee618.e_aabbBit)
- {
- _loc6_ = m_broadPhase;
- _loc20_ = _loc6_.m_worldAABB.lowerBound;
- _loc21_ = _loc6_.m_worldAABB.upperBound;
- _loc7_._br741(1 / _loc6_.m_quantizationFactor.x,1 / _loc6_.m_quantizationFactor.y);
- _loc10_._br741(0.9,0.3,0.9);
- _loc2_ = 0;
- while(_loc2_ < _kc225.b2_maxProxies)
- {
- _loc22_ = _loc6_.m_proxyPool[_loc2_];
- if(_loc22_._dt39() != false)
- {
- _loc12_.lowerBound.x = _loc20_.x + _loc7_.x * _loc6_.m_bounds[0][_loc22_.lowerBounds[0]].value;
- _loc12_.lowerBound.y = _loc20_.y + _loc7_.y * _loc6_.m_bounds[1][_loc22_.lowerBounds[1]].value;
- _loc12_.upperBound.x = _loc20_.x + _loc7_.x * _loc6_.m_bounds[0][_loc22_.upperBounds[0]].value;
- _loc12_.upperBound.y = _loc20_.y + _loc7_.y * _loc6_.m_bounds[1][_loc22_.upperBounds[1]].value;
- _loc14_[0]._br741(_loc12_.lowerBound.x,_loc12_.lowerBound.y);
- _loc14_[1]._br741(_loc12_.upperBound.x,_loc12_.lowerBound.y);
- _loc14_[2]._br741(_loc12_.upperBound.x,_loc12_.upperBound.y);
- _loc14_[3]._br741(_loc12_.lowerBound.x,_loc12_.upperBound.y);
- m_debugDraw._kd272(_loc14_,4,_loc10_);
- }
- _loc2_++;
- }
- _loc14_[0]._br741(_loc20_.x,_loc20_.y);
- _loc14_[1]._br741(_loc21_.x,_loc20_.y);
- _loc14_[2]._br741(_loc21_.x,_loc21_.y);
- _loc14_[3]._br741(_loc20_.x,_loc21_.y);
- m_debugDraw._kd272(_loc14_,4,new _ny735(0.3,0.9,0.9));
- }
- if(_loc1_ & _ee618.e_obbBit)
- {
- _loc10_._br741(0.5,0.3,0.5);
- _loc3_ = m_bodyList;
- while(_loc3_)
- {
- _loc11_ = _loc3_.m_xf;
- _loc4_ = _loc3_._tq424();
- while(_loc4_)
- {
- if(_loc4_.m_type == _hx306.e_polygonShape)
- {
- _loc23_ = _loc4_ as _bs125;
- _loc24_ = _loc23_._bm808();
- _loc25_ = _loc24_.extents;
- _loc14_[0]._br741(-_loc25_.x,-_loc25_.y);
- _loc14_[1]._br741(_loc25_.x,-_loc25_.y);
- _loc14_[2]._br741(_loc25_.x,_loc25_.y);
- _loc14_[3]._br741(-_loc25_.x,_loc25_.y);
- _loc2_ = 0;
- while(_loc2_ < 4)
- {
- _loc26_ = _loc24_.R;
- _loc27_ = _loc14_[_loc2_];
- _loc28_ = _loc24_.center.x + (_loc26_.col1.x * _loc27_.x + _loc26_.col2.x * _loc27_.y);
- _loc14_[_loc2_].y = _loc24_.center.y + (_loc26_.col1.y * _loc27_.x + _loc26_.col2.y * _loc27_.y);
- _loc14_[_loc2_].x = _loc28_;
- _loc26_ = _loc11_.R;
- _loc28_ = _loc11_.position.x + (_loc26_.col1.x * _loc27_.x + _loc26_.col2.x * _loc27_.y);
- _loc14_[_loc2_].y = _loc11_.position.y + (_loc26_.col1.y * _loc27_.x + _loc26_.col2.y * _loc27_.y);
- _loc14_[_loc2_].x = _loc28_;
- _loc2_++;
- }
- m_debugDraw._kd272(_loc14_,4,_loc10_);
- }
- _loc4_ = _loc4_.m_next;
- }
- _loc3_ = _loc3_.m_next;
- }
- }
- if(_loc1_ & _ee618.e_centerOfMassBit)
- {
- _loc3_ = m_bodyList;
- while(_loc3_)
- {
- _loc11_ = s_xf;
- _loc11_.R = _loc3_.m_xf.R;
- _loc11_.position = _loc3_._yd753();
- m_debugDraw._ex362(_loc11_);
- _loc3_ = _loc3_.m_next;
- }
- }
- }
-
- public function _sv193(param1:_yw701) : void
- {
- var _loc2_:_th791 = null;
- var _loc3_:_th791 = null;
- var _loc4_:_ni781 = null;
- var _loc5_:_ni781 = null;
- var _loc6_:b2Vec2 = null;
- var _loc7_:b2Vec2 = null;
- var _loc8_:b2Vec2 = null;
- var _loc9_:b2Vec2 = null;
- var _loc10_:_ny735 = null;
- var _loc11_:_av415 = null;
- var _loc12_:b2Vec2 = null;
- var _loc13_:b2Vec2 = null;
- _loc2_ = param1.m_body1;
- _loc3_ = param1.m_body2;
- _loc4_ = _loc2_.m_xf;
- _loc5_ = _loc3_.m_xf;
- _loc6_ = _loc4_.position;
- _loc7_ = _loc5_.position;
- _loc8_ = param1._ms688();
- _loc9_ = param1._va771();
- _loc10_ = s_jointColor;
- switch(param1.m_type)
- {
- case _yw701.e_distanceJoint:
- m_debugDraw._lv253(_loc8_,_loc9_,_loc10_);
- break;
- case _yw701.e_pulleyJoint:
- _loc11_ = param1 as _av415;
- _loc12_ = _loc11_._yy353();
- _loc13_ = _loc11_._qt125();
- m_debugDraw._lv253(_loc12_,_loc8_,_loc10_);
- m_debugDraw._lv253(_loc13_,_loc9_,_loc10_);
- m_debugDraw._lv253(_loc12_,_loc13_,_loc10_);
- break;
- case _yw701.e_mouseJoint:
- m_debugDraw._lv253(_loc8_,_loc9_,_loc10_);
- break;
- default:
- if(_loc2_ != m_groundBody)
- {
- m_debugDraw._lv253(_loc6_,_loc8_,_loc10_);
- }
- m_debugDraw._lv253(_loc8_,_loc9_,_loc10_);
- if(_loc3_ != m_groundBody)
- {
- m_debugDraw._lv253(_loc7_,_loc9_,_loc10_);
- }
- }
- }
-
- public function _sf430(param1:Boolean) : void
- {
- m_positionCorrection = param1;
- }
-
- public function _ex420() : _th791
- {
- return m_groundBody;
- }
-
- public function _sa385(param1:_hx306, param2:_ni781, param3:_ny735, param4:Boolean) : void
- {
- var _loc5_:_ny735 = null;
- var _loc6_:_vy532 = null;
- var _loc7_:b2Vec2 = null;
- var _loc8_:Number = NaN;
- var _loc9_:b2Vec2 = null;
- var _loc10_:int = 0;
- var _loc11_:_bs125 = null;
- var _loc12_:int = 0;
- var _loc13_:Array = null;
- var _loc14_:Array = null;
- var _loc15_:Array = null;
- _loc5_ = s_coreColor;
- switch(param1.m_type)
- {
- case _hx306.e_circleShape:
- _loc6_ = param1 as _vy532;
- _loc7_ = _ui293._db724(param2,_loc6_.m_localPosition);
- _loc8_ = _loc6_.m_radius;
- _loc9_ = param2.R.col1;
- m_debugDraw._ec502(_loc7_,_loc8_,_loc9_,param3);
- if(param4)
- {
- m_debugDraw._na573(_loc7_,_loc8_ - _kc225.b2_toiSlop,_loc5_);
- }
- break;
- case _hx306.e_polygonShape:
- _loc11_ = param1 as _bs125;
- _loc12_ = _loc11_._px512();
- _loc13_ = _loc11_._fh374();
- _loc14_ = new Array(_kc225.b2_maxPolygonVertices);
- _loc10_ = 0;
- while(_loc10_ < _loc12_)
- {
- _loc14_[_loc10_] = _ui293._db724(param2,_loc13_[_loc10_]);
- _loc10_++;
- }
- m_debugDraw._cy655(_loc14_,_loc12_,param3);
- if(param4)
- {
- _loc15_ = _loc11_._sv339();
- _loc10_ = 0;
- while(_loc10_ < _loc12_)
- {
- _loc14_[_loc10_] = _ui293._db724(param2,_loc15_[_loc10_]);
- _loc10_++;
- }
- m_debugDraw._kd272(_loc14_,_loc12_,_loc5_);
- }
- }
- }
-
- public function _df47() : int
- {
- return m_jointCount;
- }
-
- public function _mv283() : int
- {
- return m_contactCount;
- }
-
- public function _tg527(param1:_wy488) : void
- {
- m_boundaryListener = param1;
- }
-
- public function _ss251(param1:_ut97) : void
- {
- var _loc2_:_th791 = null;
- var _loc3_:_hx306 = null;
- var _loc4_:_hx306 = null;
- var _loc5_:_th791 = null;
- var _loc6_:_th791 = null;
- var _loc7_:_eg754 = null;
- var _loc8_:_tn475 = null;
- var _loc9_:int = 0;
- var _loc10_:Array = null;
- var _loc11_:_nb823 = null;
- var _loc12_:_nb823 = null;
- var _loc13_:Number = NaN;
- var _loc14_:_th791 = null;
- var _loc15_:int = 0;
- var _loc16_:_ut97 = null;
- var _loc17_:int = 0;
- var _loc18_:Number = NaN;
- var _loc19_:Number = NaN;
- var _loc20_:_th791 = null;
- var _loc21_:Boolean = false;
- _loc8_ = new _tn475(m_bodyCount,_kc225.b2_maxTOIContactsPerIsland,0,m_stackAllocator,m_contactListener);
- _loc9_ = m_bodyCount;
- _loc10_ = new Array(_loc9_);
- _loc2_ = m_bodyList;
- while(_loc2_)
- {
- _loc2_.m_flags &= ~_th791.e_islandFlag;
- _loc2_.m_sweep.t0 = 0;
- _loc2_ = _loc2_.m_next;
- }
- _loc11_ = m_contactList;
- while(_loc11_)
- {
- _loc11_.m_flags &= ~(_nb823.e_toiFlag | _nb823.e_islandFlag);
- _loc11_ = _loc11_.m_next;
- }
- while(true)
- {
- _loc12_ = null;
- _loc13_ = 1;
- _loc11_ = m_contactList;
- for(; _loc11_; _loc11_ = _loc11_.m_next)
- {
- if(!(_loc11_.m_flags & (_nb823.e_slowFlag | _nb823.e_nonSolidFlag)))
- {
- _loc18_ = 1;
- if(_loc11_.m_flags & _nb823.e_toiFlag)
- {
- _loc18_ = _loc11_.m_toi;
- }
- else
- {
- _loc3_ = _loc11_.m_shape1;
- _loc4_ = _loc11_.m_shape2;
- _loc5_ = _loc3_.m_body;
- _loc6_ = _loc4_.m_body;
- if((_loc5_._ur192() || _loc5_._bk718()) && (_loc6_._ur192() || _loc6_._bk718()))
- {
- continue;
- }
- _loc19_ = _loc5_.m_sweep.t0;
- if(_loc5_.m_sweep.t0 < _loc6_.m_sweep.t0)
- {
- _loc19_ = _loc6_.m_sweep.t0;
- _loc5_.m_sweep._dd348(_loc19_);
- }
- else if(_loc6_.m_sweep.t0 < _loc5_.m_sweep.t0)
- {
- _loc19_ = _loc5_.m_sweep.t0;
- _loc6_.m_sweep._dd348(_loc19_);
- }
- _loc18_ = _he523._vt746(_loc11_.m_shape1,_loc5_.m_sweep,_loc11_.m_shape2,_loc6_.m_sweep);
- if(_loc18_ > 0 && _loc18_ < 1)
- {
- _loc18_ = (1 - _loc18_) * _loc19_ + _loc18_;
- if(_loc18_ > 1)
- {
- _loc18_ = 1;
- }
- }
- _loc11_.m_toi = _loc18_;
- _loc11_.m_flags |= _nb823.e_toiFlag;
- }
- if(Number.MIN_VALUE < _loc18_ && _loc18_ < _loc13_)
- {
- _loc12_ = _loc11_;
- _loc13_ = _loc18_;
- }
- }
- }
- if(_loc12_ == null || 1 - 100 * Number.MIN_VALUE < _loc13_)
- {
- break;
- }
- _loc3_ = _loc12_.m_shape1;
- _loc4_ = _loc12_.m_shape2;
- _loc5_ = _loc3_.m_body;
- _loc6_ = _loc4_.m_body;
- _loc5_._dd348(_loc13_);
- _loc6_._dd348(_loc13_);
- _loc12_._ne371(m_contactListener);
- _loc12_.m_flags &= ~_nb823.e_toiFlag;
- if(_loc12_.m_manifoldCount != 0)
- {
- _loc14_ = _loc5_;
- if(_loc14_._ur192())
- {
- _loc14_ = _loc6_;
- }
- _loc8_._re527();
- _loc15_ = 0;
- var _loc22_:*;
- _loc10_[_loc22_ = _loc15_++] = _loc14_;
- _loc14_.m_flags |= _th791.e_islandFlag;
- while(_loc15_ > 0)
- {
- _loc2_ = _loc10_[--_loc15_];
- _loc8_._pa292(_loc2_);
- _loc2_.m_flags &= ~_th791.e_sleepFlag;
- if(!_loc2_._ur192())
- {
- _loc7_ = _loc2_.m_contactList;
- while(_loc7_)
- {
- if(_loc8_.m_contactCount != _loc8_.m_contactCapacity)
- {
- if(!(_loc7_.contact.m_flags & (_nb823.e_islandFlag | _nb823.e_slowFlag | _nb823.e_nonSolidFlag)))
- {
- if(_loc7_.contact.m_manifoldCount != 0)
- {
- _loc8_._hu475(_loc7_.contact);
- _loc7_.contact.m_flags |= _nb823.e_islandFlag;
- _loc20_ = _loc7_.other;
- if(!(_loc20_.m_flags & _th791.e_islandFlag))
- {
- if(_loc20_._ur192() == false)
- {
- _loc20_._dd348(_loc13_);
- _loc20_._uo631();
- }
- var _loc23_:*;
- _loc10_[_loc23_ = _loc15_++] = _loc20_;
- _loc20_.m_flags |= _th791.e_islandFlag;
- }
- }
- }
- }
- _loc7_ = _loc7_.next;
- }
- }
- }
- _loc16_ = new _ut97();
- _loc16_.dt = (1 - _loc13_) * param1.dt;
- _loc16_.inv_dt = 1 / _loc16_.dt;
- _loc16_.maxIterations = param1.maxIterations;
- _loc8_._ss251(_loc16_);
- _loc17_ = 0;
- while(_loc17_ < _loc8_.m_bodyCount)
- {
- _loc2_ = _loc8_.m_bodies[_loc17_];
- _loc2_.m_flags &= ~_th791.e_islandFlag;
- if(!(_loc2_.m_flags & (_th791.e_sleepFlag | _th791.e_frozenFlag)))
- {
- if(!_loc2_._ur192())
- {
- _loc21_ = _loc2_._nt224();
- if(_loc21_ == false && m_boundaryListener != null)
- {
- m_boundaryListener._al490(_loc2_);
- }
- _loc7_ = _loc2_.m_contactList;
- while(_loc7_)
- {
- _loc7_.contact.m_flags &= ~_nb823.e_toiFlag;
- _loc7_ = _loc7_.next;
- }
- }
- }
- _loc17_++;
- }
- _loc17_ = 0;
- while(_loc17_ < _loc8_.m_contactCount)
- {
- _loc11_ = _loc8_.m_contacts[_loc17_];
- _loc11_.m_flags &= ~(_nb823.e_toiFlag | _nb823.e_islandFlag);
- _loc17_++;
- }
- m_broadPhase._ol779();
- }
- }
- }
-
- public function _eq278(param1:_ut97) : void
- {
- var _loc2_:_th791 = null;
- var _loc3_:_tn475 = null;
- var _loc4_:_nb823 = null;
- var _loc5_:_yw701 = null;
- var _loc6_:int = 0;
- var _loc7_:Array = null;
- var _loc8_:_th791 = null;
- var _loc9_:int = 0;
- var _loc10_:int = 0;
- var _loc11_:_th791 = null;
- var _loc12_:_eg754 = null;
- var _loc13_:_gs664 = null;
- var _loc14_:Boolean = false;
- m_positionIterationCount = 0;
- _loc3_ = new _tn475(m_bodyCount,m_contactCount,m_jointCount,m_stackAllocator,m_contactListener);
- _loc2_ = m_bodyList;
- while(_loc2_)
- {
- _loc2_.m_flags &= ~_th791.e_islandFlag;
- _loc2_ = _loc2_.m_next;
- }
- _loc4_ = m_contactList;
- while(_loc4_)
- {
- _loc4_.m_flags &= ~_nb823.e_islandFlag;
- _loc4_ = _loc4_.m_next;
- }
- _loc5_ = m_jointList;
- while(_loc5_)
- {
- _loc5_.m_islandFlag = false;
- _loc5_ = _loc5_.m_next;
- }
- _loc6_ = m_bodyCount;
- _loc7_ = new Array(_loc6_);
- _loc8_ = m_bodyList;
- while(_loc8_)
- {
- if(!(_loc8_.m_flags & (_th791.e_islandFlag | _th791.e_sleepFlag | _th791.e_frozenFlag)))
- {
- if(!_loc8_._ur192())
- {
- _loc3_._re527();
- _loc9_ = 0;
- var _loc15_:*;
- _loc7_[_loc15_ = _loc9_++] = _loc8_;
- _loc8_.m_flags |= _th791.e_islandFlag;
- while(_loc9_ > 0)
- {
- _loc2_ = _loc7_[--_loc9_];
- _loc3_._pa292(_loc2_);
- _loc2_.m_flags &= ~_th791.e_sleepFlag;
- if(!_loc2_._ur192())
- {
- _loc12_ = _loc2_.m_contactList;
- while(_loc12_)
- {
- if(!(_loc12_.contact.m_flags & (_nb823.e_islandFlag | _nb823.e_nonSolidFlag)))
- {
- if(_loc12_.contact.m_manifoldCount != 0)
- {
- _loc3_._hu475(_loc12_.contact);
- _loc12_.contact.m_flags |= _nb823.e_islandFlag;
- _loc11_ = _loc12_.other;
- if(!(_loc11_.m_flags & _th791.e_islandFlag))
- {
- var _loc16_:*;
- _loc7_[_loc16_ = _loc9_++] = _loc11_;
- _loc11_.m_flags |= _th791.e_islandFlag;
- }
- }
- }
- _loc12_ = _loc12_.next;
- }
- _loc13_ = _loc2_.m_jointList;
- while(_loc13_)
- {
- if(_loc13_.joint.m_islandFlag != true)
- {
- _loc3_._ti526(_loc13_.joint);
- _loc13_.joint.m_islandFlag = true;
- _loc11_ = _loc13_.other;
- if(!(_loc11_.m_flags & _th791.e_islandFlag))
- {
- _loc7_[_loc16_ = _loc9_++] = _loc11_;
- _loc11_.m_flags |= _th791.e_islandFlag;
- }
- }
- _loc13_ = _loc13_.next;
- }
- }
- }
- _loc3_._eq278(param1,m_gravity,m_positionCorrection,m_allowSleep);
- if(_loc3_.m_positionIterationCount > m_positionIterationCount)
- {
- m_positionIterationCount = _loc3_.m_positionIterationCount;
- }
- _loc10_ = 0;
- while(_loc10_ < _loc3_.m_bodyCount)
- {
- _loc2_ = _loc3_.m_bodies[_loc10_];
- if(_loc2_._ur192())
- {
- _loc2_.m_flags &= ~_th791.e_islandFlag;
- }
- _loc10_++;
- }
- }
- }
- _loc8_ = _loc8_.m_next;
- }
- _loc2_ = m_bodyList;
- while(_loc2_)
- {
- if(!(_loc2_.m_flags & (_th791.e_sleepFlag | _th791.e_frozenFlag)))
- {
- if(!_loc2_._ur192())
- {
- _loc14_ = _loc2_._nt224();
- if(_loc14_ == false && m_boundaryListener != null)
- {
- m_boundaryListener._al490(_loc2_);
- }
- }
- }
- _loc2_ = _loc2_.m_next;
- }
- m_broadPhase._ol779();
- }
- }
- }
-
-