Example #1
0
File: Area.cs Project: tubitos/1
 public Boolean IsLoaded(Chunk chunk)
 {
     if (loadedWorld.Contains (chunk))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Example #2
0
File: Area.cs Project: tubitos/1
        private void SetUpChunkArray(Vector2 worldSize)
        {
            _width = (int) worldSize.X;
            _length = (int) worldSize.Y;

            world = new Chunk[_width * _length];

            for (int i = 0; i < world.GetLength (0); i++)
            {
                world[i] = new Chunk ();
                world[i].localPosition = new Vector2 ((float) (i % _width), (float) Math.Floor ((double) i / _width));
                world[i].worldPosition = Vector2.Zero;
                world[i].model = new SimpleModel (EngineSettings.factory, "models\\landscape\\chunk\\#test\\chunk");
                world[i].SetTexture ("models\\landscape\\chunk\\#test\\chunkT", TextureType.DIFFUSE);
                world[i].name = name + String.Format (" Chunk: {0}, {1}", (i % _width), (i % _width));
                world[i].SetupCollisionModel (new TriangleMeshObject (world[i].model, (new Vector3 (1000.0F) * new Vector3 (world[i].localPosition.X, 0.0F, world[i].localPosition.Y)), Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial ()));
            }
        }