コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #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();
        }
コード例 #4
0
ファイル: VoxelChunk.cs プロジェクト: maroussil/dwarfcorp
 public void BuildPrimitive(GraphicsDevice g)
 {
     //Primitive.InitializeFromChunk(this, g);
     VoxelListPrimitive primitive = new VoxelListPrimitive();
     primitive.InitializeFromChunk(this, g);
 }