Пример #1
0
        public VoltWorld(int historyLength, Fix64 damping)
        {
            this.HistoryLength = historyLength;
            this.Damping       = damping;

            this.IterationCount = VoltConfig.DEFAULT_ITERATION_COUNT;
            this.DeltaTime      = VoltConfig.DEFAULT_DELTA_TIME;

            this.bodies    = new CheapList <VoltBody>();
            this.manifolds = new List <Manifold>();

            this.dynamicBroadphase = new NaiveBroadphase();
            this.staticBroadphase  = new TreeBroadphase();

            this.reusableBuffer = new VoltBuffer <VoltBody>();
            this.reusableOutput = new VoltBuffer <VoltBody>();

            this.bodyPool    = new VoltPool <VoltBody>();
            this.circlePool  = new VoltPool <VoltShape, VoltCircle>();
            this.polygonPool = new VoltPool <VoltShape, VoltPolygon>();

            this.contactPool  = new VoltPool <Contact>();
            this.manifoldPool = new VoltPool <Manifold>();
            this.historyPool  = new VoltPool <HistoryBuffer>();
        }
Пример #2
0
        public VoltWorld(
      int historyLength = 0,
      float damping = VoltConfig.DEFAULT_DAMPING)
        {
            this.HistoryLength = historyLength;
              this.Damping = damping;

              this.IterationCount = VoltConfig.DEFAULT_ITERATION_COUNT;
              this.DeltaTime = VoltConfig.DEFAULT_DELTA_TIME;

              this.bodies = new CheapList<VoltBody>();
              this.manifolds = new List<Manifold>();

              this.dynamicBroadphase = new NaiveBroadphase();
              this.staticBroadphase = new TreeBroadphase();

              this.reusableBuffer = new VoltBuffer<VoltBody>();
              this.reusableOutput = new VoltBuffer<VoltBody>();

              this.bodyPool = new VoltPool<VoltBody>();
              this.circlePool = new VoltPool<VoltShape, VoltCircle>();
              this.polygonPool = new VoltPool<VoltShape, VoltPolygon>();

              this.contactPool = new VoltPool<Contact>();
              this.manifoldPool = new VoltPool<Manifold>();
              this.historyPool = new VoltPool<HistoryBuffer>();
        }