coredump-ch / rpsrtsrs

Rock-Paper-Scissors-Real-Time-Strategy game written in Rust.
GNU Affero General Public License v3.0
11 stars 5 forks source link

Convert all vector types to cgmath #62

Closed dbrgn closed 6 years ago

dbrgn commented 6 years ago

I first tried to integrate nalgebra, but it's definitely not the right library for us, it's more focussed on N-dimensionality and too generic.

cgmath on the other hand is optimized for computer graphics and provides very convenient functionality like a From<[f64; f64]> impl for the Vector2 type or .x and .y accessors on Vector2.

It probably has all features we need from a linalg lib, like operator overloading and functions like magnitude2.

This PR is WIP since it needs to port some vector operations currently used from piston to cgmath itself. Also, it's based on the implement_bullets branch, so #58 needs to be merged first.

rnestler commented 6 years ago

I merged #58, you may rebase :)

dbrgn commented 6 years ago

Done. I'll fix the remaining issues tonight.

dbrgn commented 6 years ago

There wasn't much that needed to be changed. Ready to merge!

dbrgn commented 6 years ago

Silly comment? You mean the TODO? You were right about that :stuck_out_tongue:

rnestler commented 6 years ago

Silly comment? You mean the TODO? You were right about that 😛

Yes but we could've added it in a follow up PR.