RandyGaul / cute_headers

Collection of cross-platform one-file C/C++ libraries with no dependencies, primarily used for games
4.3k stars 270 forks source link

cute_c2.h c2x usage in c2Collide and consistency int the API. #200

Open roig opened 4 years ago

roig commented 4 years ago

Hello Randy,

I spent some time debugging an "inconsistent" behavior in c2Collide.

In c2Collide if you input a C2_TYPE that is not a c2Poly then c2x transform is not used to transform the points of that shape.

This is inconsistent with other functions in the API that use the transform in all shapes, for example in c2Toi (c2GJK one) if you input a C2_TYPE that is not a c2Poly then the c2x transform is applied to that shape.

I think that maybe what can be improved is to treat the points in the shapes as local points and always transform these points in each function in the api. (If the user passes nullptr no transformation is applied ofc)

I know that this is a minor issue but from a users perspective i think it's a bit inconsistent. Thoughts?

RandyGaul commented 4 years ago

We can update c2Collide's behavior, though this is a fairly time-consuming task. It would help to reduce time it takes to implement the changes to know which functions aren't transforming points like you expected. Do you have a list of the ones you've noticed so far?