Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to unsigned 32 bit integers for particle positions #3

Closed
bergwerf opened this issue Jun 11, 2016 · 1 comment
Closed

Migrate to unsigned 32 bit integers for particle positions #3

bergwerf opened this issue Jun 11, 2016 · 1 comment

Comments

@bergwerf
Copy link
Owner

Until now there have been two ways to represent the particle position: unsigned 16 bit integers and 32 bit floats. The floats were originally there to allow simulations with more precision, however, they have added a lot of complexity and confusion to the code. The 3 x uint16 positions were originally intended to represent a voxel position so the particle position does not have to be converted to a voxel position every step (note that uint16 is almost the largest type that is suitable for this because the voxel position and type have to be hashed into a 64 bit integer). However, to keep things simple we're going to move to unsigned 32 bit integers. The ability to omit voxel position computation and particle distance computation (by using voxel groups instead of square roots) can still be maintained by setting each voxel to contain only one particle position. Voxels can also contain more particle positions to increase precision.

@bergwerf
Copy link
Owner Author

I'm now only using unsigned 16 bit integers for positions and I think this is (currently) sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant