Exemplo n.º 1
0
        private void ConstructPhysicsSimulator(Vector2 gravity)
        {
            GeomList        = new GenericList <Geom>(32);
            _geomAddList    = new List <Geom>(32);
            _geomRemoveList = new List <Geom>(32);

            BodyList        = new GenericList <Body>(32);
            _bodyAddList    = new List <Body>(32);
            _bodyRemoveList = new List <Body>(32);

            ControllerList        = new GenericList <Controller>(8);
            _controllerAddList    = new List <Controller>(8);
            _controllerRemoveList = new List <Controller>(8);

            JointList        = new GenericList <Joint>(32);
            _jointAddList    = new List <Joint>(32);
            _jointRemoveList = new List <Joint>(32);

            SpringList        = new GenericList <Spring>(32);
            _springAddList    = new List <Spring>(32);
            _springRemoveList = new List <Spring>(32);

            _broadPhaseCollider = new SelectiveSweepCollider(this);

            Gravity = gravity;

            //Create arbiter list with default capacity of 128
            ArbiterList = new ArbiterList(128);

            //Poolsize of 128, will grow as needed.
            arbiterPool = new Pool <Arbiter>(128);
        }
Exemplo n.º 2
0
        private void ConstructPhysicsSimulator(Vector2 gravity)
        {
            geomList       = new GeomList();
            geomAddList    = new List <Geom>();
            geomRemoveList = new List <Geom>();

            bodyList       = new BodyList();
            bodyAddList    = new List <Body>();
            bodyRemoveList = new List <Body>();

            controllerList       = new ControllerList();
            controllerAddList    = new List <Controller>();
            controllerRemoveList = new List <Controller>();

            jointList       = new JointList();
            jointAddList    = new List <Joint>();
            jointRemoveList = new List <Joint>();

            _broadPhaseCollider = new SelectiveSweepCollider(this);

            arbiterList = new ArbiterList();
            _gravity    = gravity;

            arbiterPool = new Pool <Arbiter>(_arbiterPoolSize);

            #region Added by Daniel Pramel 08/17/08

            _inactivityController = new InactivityController(this);

            _scaling = new Scaling(0.001f, 0.01f);

            #endregion
        }
Exemplo n.º 3
0
 public void SetBroadPhaseCollider(IBroadPhaseCollider broadPhaseCollider)
 {
     if (geomList.Count > 0)
     {
         throw new Exception("The GeomList must be empty when setting the broad phase collider type");
     }
     _broadPhaseCollider = broadPhaseCollider;
 }
Exemplo n.º 4
0
        private void ConstructPhysicsSimulator(Vector2 gravity)
        {
            geomList = new GenericList<Geom>();
            geomAddList = new List<Geom>();
            geomRemoveList = new List<Geom>();

            bodyList = new GenericList<Body>();
            bodyAddList = new List<Body>();
            bodyRemoveList = new List<Body>();

            controllerList = new GenericList<Controller>();
            controllerAddList = new List<Controller>();
            controllerRemoveList = new List<Controller>();

            jointList = new GenericList<Joint>();
            jointAddList = new List<Joint>();
            jointRemoveList = new List<Joint>();

            springList = new GenericList<Spring>();
            springAddList = new List<Spring>();
            springRemoveList = new List<Spring>();

            _broadPhaseCollider = new SelectiveSweepCollider(this);

            arbiterList = new ArbiterList();
            Gravity = gravity;

            //Poolsize of 10, will grow as needed.
            arbiterPool = new Pool<Arbiter>(100);
        }
        private void ConstructPhysicsSimulator(Vector2 gravity)
        {
            GeomList = new GenericList<Geom>(32);
            _geomAddList = new List<Geom>(32);
            _geomRemoveList = new List<Geom>(32);

            BodyList = new GenericList<Body>(32);
            _bodyAddList = new List<Body>(32);
            _bodyRemoveList = new List<Body>(32);

            ControllerList = new GenericList<Controller>(8);
            _controllerAddList = new List<Controller>(8);
            _controllerRemoveList = new List<Controller>(8);

            JointList = new GenericList<Joint>(32);
            _jointAddList = new List<Joint>(32);
            _jointRemoveList = new List<Joint>(32);

            SpringList = new GenericList<Spring>(32);
            _springAddList = new List<Spring>(32);
            _springRemoveList = new List<Spring>(32);

            _broadPhaseCollider = new SelectiveSweepCollider(this);

            Gravity = gravity;

            //Create arbiter list with default capacity of 128
            ArbiterList = new ArbiterList(128);

            //Poolsize of 128, will grow as needed.
            arbiterPool = new Pool<Arbiter>(128);
        }
Exemplo n.º 6
0
        private void ConstructPhysicsSimulator(Vector2 gravity)
        {
            geomList = new GeomList();
            geomAddList = new List<Geom>();
            geomRemoveList = new List<Geom>();

            bodyList = new BodyList();
            bodyAddList = new List<Body>();
            bodyRemoveList = new List<Body>();

            controllerList = new ControllerList();
            controllerAddList = new List<Controller>();
            controllerRemoveList = new List<Controller>();

            jointList = new JointList();
            jointAddList = new List<Joint>();
            jointRemoveList = new List<Joint>();

            springList = new SpringList();
            springAddList = new List<Spring>();
            springRemoveList = new List<Spring>();

            _broadPhaseCollider = new SelectiveSweepCollider(this);

            arbiterList = new ArbiterList();
            _gravity = gravity;

            arbiterPool = new Pool<Arbiter>(_arbiterPoolSize);

            #region Added by Daniel Pramel 08/17/08

            _inactivityController = new InactivityController(this);

            _scaling = new Scaling(0.001f, 0.01f);

            #endregion
        }