Ejemplo n.º 1
0
        public void Rebuild(GraphicsDevice g)
        {
            if (g == null || g.IsDisposed)
            {
                return;
            }
            VoxelListPrimitive primitive = new VoxelListPrimitive();

            primitive.InitializeFromChunk(this, Manager.World.PlayerFaction.Designations, Manager.World.DesignationDrawer, Manager.World);
            // TODO: Move to main thread!
            var changedMessage = new Message(Message.MessageType.OnChunkModified, "Chunk Modified");

            foreach (var c in Manager.World.EnumerateIntersectingObjects(GetBoundingBox(), CollisionType.Both))
            {
                c.ReceiveMessageRecursive(changedMessage);
            }
        }
Ejemplo n.º 2
0
        public void Rebuild(GraphicsDevice g)
        {
            if (g == null || g.IsDisposed)
            {
                return;
            }
            VoxelListPrimitive primitive = new VoxelListPrimitive();

            primitive.InitializeFromChunk(this);

            var changedMessage = new Message(Message.MessageType.OnChunkModified, "Chunk Modified");

            foreach (var c in Manager.World.CollisionManager.EnumerateIntersectingObjects(GetBoundingBox(),
                                                                                          CollisionManager.CollisionType.Both).OfType <GameComponent>())
            {
                c.ReceiveMessageRecursive(changedMessage);
            }
        }
Ejemplo n.º 3
0
        public void Rebuild(GraphicsDevice g)
        {
            if (g == null || g.IsDisposed)
            {
                return;
            }

            var primitive = new VoxelListPrimitive();

            primitive.InitializeFromChunk(this, Manager.World.PersistentData.Designations, Manager.World);

            PrimitiveMutex.WaitOne();
            if (Primitive != null)
            {
                Primitive.Dispose();
            }
            Primitive = primitive;
            PrimitiveMutex.ReleaseMutex();
        }
Ejemplo n.º 4
0
 public void BuildPrimitive(GraphicsDevice g)
 {
     //Primitive.InitializeFromChunk(this, g);
     VoxelListPrimitive primitive = new VoxelListPrimitive();
     primitive.InitializeFromChunk(this, g);
 }