home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / pup_idol.swf / scripts / Box2D / Dynamics / b2BodyDef.as < prev    next >
Encoding:
Text File  |  2008-08-07  |  1.6 KB  |  70 lines

  1. package Box2D.Dynamics
  2. {
  3.    import Box2D.Collision.Shapes.b2ShapeDef;
  4.    import Box2D.Common.Math.b2Vec2;
  5.    import Box2D.Common.b2Settings;
  6.    
  7.    public class b2BodyDef
  8.    {
  9.        
  10.       
  11.       public var angularDamping:Number;
  12.       
  13.       public var linearVelocity:b2Vec2;
  14.       
  15.       public var position:b2Vec2;
  16.       
  17.       public var isSleeping:Boolean;
  18.       
  19.       public var allowSleep:Boolean;
  20.       
  21.       public var userData:*;
  22.       
  23.       public var preventRotation:Boolean;
  24.       
  25.       public var shapes:Array;
  26.       
  27.       public var linearDamping:Number;
  28.       
  29.       public var rotation:Number;
  30.       
  31.       public var angularVelocity:Number;
  32.       
  33.       public function b2BodyDef()
  34.       {
  35.          shapes = new Array();
  36.          super();
  37.          userData = null;
  38.          var _loc1_:int = 0;
  39.          while(_loc1_ < b2Settings.b2_maxShapesPerBody)
  40.          {
  41.             shapes[_loc1_] = null;
  42.             _loc1_++;
  43.          }
  44.          position = new b2Vec2(0,0);
  45.          rotation = 0;
  46.          linearVelocity = new b2Vec2(0,0);
  47.          angularVelocity = 0;
  48.          linearDamping = 0;
  49.          angularDamping = 0;
  50.          allowSleep = true;
  51.          isSleeping = false;
  52.          preventRotation = false;
  53.       }
  54.       
  55.       public function AddShape(param1:b2ShapeDef) : void
  56.       {
  57.          var _loc2_:int = 0;
  58.          while(_loc2_ < b2Settings.b2_maxShapesPerBody)
  59.          {
  60.             if(shapes[_loc2_] == null)
  61.             {
  62.                shapes[_loc2_] = param1;
  63.                break;
  64.             }
  65.             _loc2_++;
  66.          }
  67.       }
  68.    }
  69. }
  70.