ProjectPhysX / FluidX3D

The fastest and most memory efficient lattice Boltzmann CFD software, running on all GPUs via OpenCL. Free for non-commercial use.
https://youtube.com/@ProjectPhysX
Other
3.81k stars 301 forks source link

Mesh translation #23

Closed trparry closed 1 year ago

trparry commented 1 year ago

Hello, thank you for making this awesome project available! After getting the star wars tie fighter working, I was looking at how you rotated the mesh before revoxelizing. In setup.cpp you make a matrix called rotation and pass it to the rotate function. Is it possible to also translate the mesh, or is the mesh always constrained to the "center" point that you define when you use read_stl? Perhaps I'm not interpreting this correctly. Translating the mesh would be useful to observe the interaction between two solid geometries within the simulation domain, where the two geometries could be both rotating and translating dynamically. Thanks for any clarification!

ProjectPhysX commented 1 year ago

Thanks for bringing this up! A translation function was indeed missing. I just added it in release v1.2. You can now use:

mesh.translate(const float3& translation);