ncollide icon indicating copy to clipboard operation
ncollide copied to clipboard

unreachable in project_point_with_feature

Open keeslinp opened this issue 7 years ago • 5 comments

I am not super familiar with the internals of ncollide so I'm not sure how to follow this bug any further (some of the internals are super complicated).

I'm attempting to have a Ball follow a Cuboid so each frame I update it's position and it works great except that there is a certain location (the same one each time) that when I go through there it panics from an unreachable on line 100 of point_aabb.rs Nothing seems really strange about the coordinates (520, 100).

Any hints about where I should look would be super helpful. Thanks!

keeslinp avatar Oct 06 '18 03:10 keeslinp

That's strange. Do you have the exact transform of the cuboid too so I can reproduce this in a small test case?

sebcrozet avatar Oct 06 '18 04:10 sebcrozet

Thanks for the fast response!

Cuboid: Isometry { rotation: Unit { value: Complex { re: 1.0, im: 0.0 } }, translation: Translation { vector: Matrix { data: [420.0, 100.0] } }, _noconstruct: PhantomData }
translation: Translation { vector: Matrix { data: [100.0, 100.0] } }
Ball: Isometry { rotation: Unit { value: Complex { re: 1.0, im: 0.0 } }, translation: Translation { vector: Matrix { data: [520.0, 200.0] } }, _noconstruct: PhantomData }

The translation is just the radius of the ball so that its center is the same as the cuboids. Otherwise, it just attaches the bottom right corner of the ball to the top left corner of the cuboid.

keeslinp avatar Oct 06 '18 19:10 keeslinp

I found out that I was using CollisionGroups incorrectly and once I made that change a lot of collision bugs went away, including this one. I'm not sure how collision groups affected this, but the issue is gone so I'll close this ticket for now. Thanks!

keeslinp avatar Oct 06 '18 20:10 keeslinp

Reaching an unreachable is a bug independently from how the user achieves it. I'm reopening this, but will wait for next week or the week after to investigate since it has a lower priority now that it does not cause you trouble anymore.

Thank you for the test case!

sebcrozet avatar Oct 07 '18 04:10 sebcrozet

For what it's worth, I ran into this same error. I was using a Compound shape in conjunction with the salva fluid simulator. This triggered a call to project_point_with_feature, which is currently unimplemented for Compound.

willcrichton avatar Jul 01 '20 05:07 willcrichton