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

collision-rs out of sync with cgmath #108

Closed
trsoluti opened this issue Feb 19, 2019 · 6 comments
Closed

collision-rs out of sync with cgmath #108

trsoluti opened this issue Feb 19, 2019 · 6 comments

Comments

@trsoluti
Copy link
Contributor

Here's a strange problem that cost me an afternoon:

  1. collision-rs currently relies on cgmath version 0.16. cgmath is now at 0.17.
  2. collision-rs structures refer to cgmath structures such as Point2.

If I compile a program with the latest collision-rs and the latest cgmath, I get the following error message on my types:

the trait EuclideanSpace is not implemented for cgmath::point::Point2<f32>

(This is for the constraint P::Point: EuclideanSpace, which is used by amethyst-rhusics.)

Here is a simple snippet that reproduces the problem:

use cgmath::EuclideanSpace;
use collision::Primitive;
use collision::primitive::Primitive2;

fn main() {
    do_it::<Primitive2<f32>>();
}

fn do_it<P>()
where
    P: Primitive,
    P::Point: EuclideanSpace,
{
    println!("hello!")
}

It seems as if you need a crate-version of collision-rs for every crate-version of cgmath, so a user can pick the right pair.

@kvark
Copy link
Collaborator

kvark commented Feb 19, 2019

Another way to get us stable across cgmath releases is #10
cc @vitvakatu

@vitvakatu
Copy link
Contributor

Unfortunately I'm unable to find some time to work on this right now, so hopping anyone else will do.

@trsoluti
Copy link
Contributor Author

I've created a sync'd version of collision-rs in my folder https://github.com/trsoluti/collision-rs that also has been updated to rust-2018 and reduces some of the double-dependencies (e.g. uses traits re-exported from cgmath instead of importing them directly from the source library). It solves my test case.

Someone please take a look at it, see if it's okay, and guide me through the pull request process. Thanks in advance.

@kvark
Copy link
Collaborator

kvark commented Feb 22, 2019

@trsoluti please file a PR right away for the review, it doesn't have to be perfect ;)

@trsoluti
Copy link
Contributor Author

trsoluti commented Apr 2, 2019

The updated collision-rs is still not on Crates.io. How to push it? (I want to update rhusics next.)

@kvark
Copy link
Collaborator

kvark commented Apr 4, 2019

Sorry about the delay!
https://crates.io/crates/collision/0.20.1

@kvark kvark closed this as completed Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants