A lot of things can be simplified through the use of vectors and matrices. Unfortunately GameMaker's support for both of these structures is pretty limited.
What is UBG Math?
UBG Math is an extension that aims to implement common mathematical functions and abilities found in other game engines. This includes vectors, matrices and quaternions at the moment.
What Does This Extension Provide?
This extension provides several structures for you to use in your projects as well as expands some existing structures provided by GameMaker. Added structures are proper vector2s, vector3s, and vector4s (vector4s include quaternion operations). Expanded structures are matrices.
You are now able to perform numerous calculations that would be expected of these structures. A non-exhaustive list of examples being: - Matrix / 4D Vector multiplication - Inverse, transpose, determinant matrix calculations - Common vector math (add, subtract, cross, dot) - Game-related vector math (bounce, project, slide, slerp, rotate, angle-diff, ...) - Quaternion constructors (from euler, from axis / angle pair) - Common quaternion functions (rotate vector, multiply, to matrix, from matrix) - Related string functions (string_scientific, string_matrix, string_vector, ...)
This extension is intended to be convenient and finely integrated as if the functions were native to GameMaker: Studio; something you can easily just plop into projects. This initial release is simply getting the big things out of the way. If you require or desire more functions, structures, and/or abilities then let me know and I'll add it to the extension.
If you have requests, bugs, or questions then please feel free to contact me! I will actively be adding functions and requests by paying customers. As with all my projects, documentation is provided online for free.