1. Consider using Pointf and if you need 3D, there is Point3D 2. You could take point structure as template parameter too. 3. Do not assign one by one, there is copy assignment operator https://github.com/ahmadqasembader/physics-engine/blob/d1b3315d60a2b71f1d00f84424eb7fd57fa52d7f/particle.cpp#L100
physics-engine/particle.cpp
Line 100 in d1b3315