Beispiel #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public SimPathStore(String simName, Vector2 pos, Vector3d globalPos, Vector3 endTop)
        {
            RegisterPathStore(pos, this);
            RegionName = simName;
            RegionLocation = pos;
            Start = Vector3.Zero;
            GlobalStart = globalPos;
            GlobalEnd = globalPos;
            Size = endTop;
            _XY256 = Size.X;
            _OuterBounds = new Box3Fill(true);
            OuterBounds.AddPoint(Start.X, Start.Y, Start.Z, Vector3.Zero);
            OuterBounds.AddPoint(endTop.X, endTop.Y, endTop.Z, Vector3.Zero);
            //TheSimZMinMaxLevel = new SimZMinMaxLevel(MinMaxLevel);
            StepSize = 1f/POINTS_PER_METER;
            _Max256 = XY256 - StepSize;
            MAPSPACE = (int) XY256*((int) POINTS_PER_METER);
            RegisterHttp();
            if (Size.X != Size.Y) throw new Exception("X and Y must be the same for " + this);
#if COLLIDER_ODE            
            odeScene = (OdeScene) odePhysics.GetScene(RegionName);
            odeScene.Initialise(meshMerizer, null);
            float[] _heightmap = new float[256*256];
            for (int i = 0; i < (256*256); i++)
            {
                _heightmap[i] = 21f;
            }
            odeScene.SetTerrain(_heightmap);
#endif
            //CreateDefaultRoutes();
            //  CurrentPlane = new CollisionPlane(MAPSPACE,MAPSPACE,0);
        }