Godlike / Pegasus

Game physics engine (can fly)
MIT License
5 stars 2 forks source link

Bounding volumes refactoring #96

Closed yanenkoa closed 6 years ago

yanenkoa commented 6 years ago

Bounding volumes classes need some refactoring / optimizations. More details can be found in #94 PR conversation.

MrDmitry commented 6 years ago

Just wondering where exactly shall be more details found? Can you at least post quotes and context here so it would be easier to define the scope of this issue?

I mean github may collapse one of the comments because it would think it's outdated because of next commit or amend

yanenkoa commented 6 years ago

@dsodintsov relevant comments in #94 are referencing this issue. But you're right, this may be inconvenient, if they are ever collapsed, so I guess I just document it here. These all relate to Pegasus/include/geometry/BoundingVolume.hpp:

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.

yanenkoa commented 6 years ago

This issue is no longer relevant for this repo: collision detection has been carried out into Arion. This is the replacement.