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); } }
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); } }
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(); }
public void BuildPrimitive(GraphicsDevice g) { //Primitive.InitializeFromChunk(this, g); VoxelListPrimitive primitive = new VoxelListPrimitive(); primitive.InitializeFromChunk(this, g); }