Beispiel #1
0
        public MapForcesManager(Map map, Point3D boundryMin, Point3D boundryMax)
        {
            _map        = map;
            _boundryMin = boundryMin;
            _boundryMax = boundryMax;

            // This will keep objects on the XY plane using forces (not velocities)
            _keep2D = new KeepItems2D();

            _map.ItemAdded   += Map_ItemAdded;
            _map.ItemRemoved += Map_ItemRemoved;

            // Just using one property from boundry (assumes the boundry is square, and max is positive)
            _boundryForceEnd          = _boundryMax.X;
            _boundryForceBegin        = _boundryForceEnd * .85d;
            _boundryForceBeginSquared = _boundryForceBegin * _boundryForceBegin;
            _boundryWidth             = _boundryForceEnd - _boundryForceBegin;
        }
        public MapForcesManager(Map map, Point3D boundryMin, Point3D boundryMax)
        {
            _map = map;
            _boundryMin = boundryMin;
            _boundryMax = boundryMax;

            // This will keep objects on the XY plane using forces (not velocities)
            _keep2D = new KeepItems2D();

            _map.ItemAdded += new EventHandler<MapItemArgs>(Map_ItemAdded);
            _map.ItemRemoved += new EventHandler<MapItemArgs>(Map_ItemRemoved);

            // Just using one property from boundry (assumes the boundry is square, and max is positive)
            _boundryForceEnd = _boundryMax.X;
            _boundryForceBegin = _boundryForceEnd * .85d;
            _boundryForceBeginSquared = _boundryForceBegin * _boundryForceBegin;
            _boundryWidth = _boundryForceEnd - _boundryForceBegin;
        }