Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@griush
Copy link
Owner

@griush griush commented Sep 2, 2025

TODO before merge

  • write useful tests
  • rewrite the example and add an extensive demo
  • benchmark and test performance

This PR introduces a complete rewrite of the vector and matrix libraries with a focus on generic programming, flexibility, and broader applicability. The changes move away from fixed-dimension structures and game-focused assumptions, allowing the libraries to be useful in a wide range of engineering, physics, and graphics contexts.

Key Changes and Improvements

  1. Generic NxM Matrices

    • Matrices are now fully generic in both rows and columns, with type Mat(r, c, T).
    • No more hardcoded dimensions; operations like addition, subtraction, multiplication, and transposition work for any compatible sizes.
    • Square-matrix-specific operations (identity, diagonal, determinant, inverse) are compile-time checked for validity.
    • Row-major storage with [r][c]T ensures clarity and consistency.
  2. Generic Vectors

    • Vectors support any dimension and numeric type (Vec(n, T)), with convenience operations for addition, subtraction, scaling, dot product, cross product (3D), normalization, and more.
    • RH/LH conventions are explicitly supported for operations that are convention-dependent (cross, rotation, reflection, lookAt).
  3. Graphics Utilities

    • LookAt, orthographic, and perspective matrices are preserved, with explicit RH/LH variants.
    • Translation, scaling, and rotation matrices are included and are now convention-aware where applicable.
    • Homogeneous transformations are consistent with the generic matrix API.
  4. Clean Architecture

    • The API is consistent, type-safe, and fully generic, removing hardcoded assumptions from the old version.
    • Encourages use in engineering, aerospace, physics simulations, robotics, and general 3D graphics, not only game development.
    • Supports extension for new operations without breaking the existing API.

because of all the reworks I decided to nuke all examples and tests, they were very bad anyways
@griush griush self-assigned this Sep 2, 2025
@griush griush added enhancement New feature or request help wanted Extra attention is needed labels Sep 2, 2025
@griush griush removed the help wanted Extra attention is needed label Sep 21, 2025
@griush
Copy link
Owner Author

griush commented Sep 21, 2025

Closes #23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant