Godlike / Arion

Real-time oriented 3d collision detection library
MIT License
3 stars 1 forks source link

Bounding volumes refactoring #7

Open yanenkoa opened 6 years ago

yanenkoa commented 6 years ago

Bounding volumes classes over at Arion/include/Arion/BoundingVolumes.hpp and Arion/sources/BoundingVolumes.cpp need some refactorings and optimizations:

1) Rename indices to faces in Mesh struct -- this just makes more sense for that field; 2) Introduce POD with with Mesh mesh and std::set<std::size_t> indices fields -- they are very often passed around in tandem, so that would be convenient; 3) Make auxiliary structs, which store calculation data for bounding volume algorithms (see, for instance, OrientedBoundingBox::Box), private and rename them to something more sensible (like OBBData in the case of OrientedBoundingBox) -- they are only used inside those classes; 4) Refactor bounding volumes classes in order to not store calculation data after the calculations are over (for instance, all fields in OrientedBoundingBox except m_boxShape are not used anywhere outside the constructor) -- right now this calculation data is still stored after constructor finishes execution.

Note: this issue was carried over from here in Pegasus repo.