home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / pup_idol.swf / scripts / Box2D / Dynamics / Contacts / b2CircleContact.as next >
Encoding:
Text File  |  2008-08-07  |  1.3 KB  |  52 lines

  1. package Box2D.Dynamics.Contacts
  2. {
  3.    import Box2D.Collision.*;
  4.    import Box2D.Collision.Shapes.*;
  5.    import Box2D.Common.*;
  6.    import Box2D.Common.Math.*;
  7.    import Box2D.Dynamics.*;
  8.    
  9.    public class b2CircleContact extends b2Contact
  10.    {
  11.        
  12.       
  13.       public var m_manifold:Array;
  14.       
  15.       public function b2CircleContact(param1:b2Shape, param2:b2Shape)
  16.       {
  17.          m_manifold = [new b2Manifold()];
  18.          super(param1,param2);
  19.          m_manifold[0].pointCount = 0;
  20.          m_manifold[0].points[0].normalImpulse = 0;
  21.          m_manifold[0].points[0].tangentImpulse = 0;
  22.       }
  23.       
  24.       public static function Destroy(param1:b2Contact, param2:*) : void
  25.       {
  26.       }
  27.       
  28.       public static function Create(param1:b2Shape, param2:b2Shape, param3:*) : b2Contact
  29.       {
  30.          return new b2CircleContact(param1,param2);
  31.       }
  32.       
  33.       override public function Evaluate() : void
  34.       {
  35.          b2Collision.b2CollideCircle(m_manifold[0],m_shape1 as b2CircleShape,m_shape2 as b2CircleShape,false);
  36.          if(m_manifold[0].pointCount > 0)
  37.          {
  38.             m_manifoldCount = 1;
  39.          }
  40.          else
  41.          {
  42.             m_manifoldCount = 0;
  43.          }
  44.       }
  45.       
  46.       override public function GetManifolds() : Array
  47.       {
  48.          return m_manifold;
  49.       }
  50.    }
  51. }
  52.