home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / Beez.swf / scripts / Box2D / Collision / b2Manifold.as < prev    next >
Encoding:
Text File  |  2008-09-03  |  1.1 KB  |  48 lines

  1. package Box2D.Collision
  2. {
  3.    import Box2D.Common.Math.b2Vec2;
  4.    import Box2D.Common.b2Settings;
  5.    
  6.    public class b2Manifold
  7.    {
  8.        
  9.       
  10.       public var pointCount:int = 0;
  11.       
  12.       public var normal:b2Vec2;
  13.       
  14.       public var points:Array;
  15.       
  16.       public function b2Manifold()
  17.       {
  18.          super();
  19.          points = new Array(b2Settings.b2_maxManifoldPoints);
  20.          for(var i:int = 0; i < b2Settings.b2_maxManifoldPoints; i++)
  21.          {
  22.             points[i] = new b2ManifoldPoint();
  23.          }
  24.          normal = new b2Vec2();
  25.       }
  26.       
  27.       public function Set(m:b2Manifold) : void
  28.       {
  29.          pointCount = m.pointCount;
  30.          for(var i:int = 0; i < b2Settings.b2_maxManifoldPoints; i++)
  31.          {
  32.             (points[i] as b2ManifoldPoint).Set(m.points[i]);
  33.          }
  34.          normal.SetV(m.normal);
  35.       }
  36.       
  37.       public function Reset() : void
  38.       {
  39.          for(var i:int = 0; i < b2Settings.b2_maxManifoldPoints; i++)
  40.          {
  41.             (points[i] as b2ManifoldPoint).Reset();
  42.          }
  43.          normal.SetZero();
  44.          pointCount = 0;
  45.       }
  46.    }
  47. }
  48.