not tested, but should work (assuming that a terrain chunk is 32*32):
Code:
hit.chunk * 1024 + hit.vertex;