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

Centralize basic math types and functions (part 3) #370

Draft
wants to merge 90 commits into
base: main
Choose a base branch
from

Conversation

dimitry-ishenko
Copy link
Contributor

This is a third in a series of PRs meant clean up and centralize basic math constants, vectors and matrices. Currently these are scattered all over the project and many of them have overlapping functionality.

For example, there are VECTOR3 and VECTOR4 types defined in the SDK (the OrbiterAPI.h file). Then there are Vector and Vector4 types defined in the Orbiter (the Vecmat.h file). There are also FVECTOR3 and FVECTOR4 which are equivalents of VECTOR3 and VECTOR4 but with the float data type. Each one of these classes overloads their own set of operators and defines their own versions of different functions. This results in messy and duplicate code.

Similar situation exists for the matrices, and simple math constants eg, 𝜋, etc.)

The plan is to unite all these types and define a set of operator and function templates that are uniform and are shared by all these types. The steps are:

  • Define operator and function templates for vectors.
  • Centralize VECTOR4 type.
  • Centralize VECTOR3 type.
  • Merge Vector4 and VECTOR4.
  • Merge Vector and VECTOR3.

Some of the functions were taken over by the new vector templates.
Others were removed or absorbed into D3D9Util.h.
Remove unnecessary _V().
Use new vector functions.
Remove unnecessary _V().
Use new vector functions.
Remove unnecessary _V().
Remove unnecessary _V().
Use new vector functions.
Remove unnecessary _V().
Use new vector functions.
Remove unnecessary _V().
Use new vector functions.
Remove unnecessary _V().
Remove unnecessary _V().
Remove unnecessary _V().
Remove unnecessary _V().
Use new vector functions.
Remove unnecessary _V().
Remove unnecessary _V().
Remove unnecessary _V().
Use new vector functions.
Remove unnecessary _V().
Remove unnecessary _V().
Use new vector functions.
Remove unnecessary _V().
Use new vector functions.
Remove unnecessary _V().
Use new vector functions.
Remove unnecessary _V().
Remove unnecessary _V().
Use new vector functions.
These have now been replaced by the standard function and operator
templates in vector.hpp.
There is only one place where it's used as a vector and for that I've
added the to_VECTOR4 function.
This is to be consistent wit other vector types.
This is needed in preparation for VECTOR3 update.
This is to be consistent wit other vector types and will also allow us
to merge it with the Vector class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant