protected override void ThreadFunction()
        {
            while (stop != true)
            {
                if (state == ChunkState.Stopped)
                {
                    continue;
                }
                else if (state == ChunkState.Stopping)
                {
                    state = ChunkState.Stopped;
                    continue;
                }

                if (queue.Count == 0)
                {
                    state = ChunkState.Waiting;
                }
                else
                {
                    state = ChunkState.Loading;

                    ChunkComponent thisComponent;
                    bool           dequeued = queue.TryDequeue(out thisComponent);

                    if (dequeued == false || thisComponent == null)
                    {
                        continue;
                    }

                    Coord3D thisPosition = thisComponent.position;
                    if (thisPosition == null)
                    {
                        continue;
                    }

                    VoxelObject voxelObject = thisComponent.position.voxelObject;
                    if (voxelObject == null)
                    {
                        continue;
                    }

                    if (thisComponent.chunk == null)
                    {
                        Chunk thisChunk = voxelObject.GenerateChunk(thisPosition.x, thisPosition.y, thisPosition.z);
                        thisChunk.component = thisComponent;
                        thisComponent.chunk = thisChunk;
                        thisChunk.PrepareLoad();
                        thisComponent.BuildCollision();
                    }
                    else
                    {
                        thisComponent.BuildCollision();
                    }

                    if (state != ChunkState.Stopped)
                    {
                        state = ChunkState.Waiting;
                    }
                }

                updates++;                      //	Increment update count
            }

            IsDone = true;
        }