meiyunyang / chipmunk-physics

Automatically exported from code.google.com/p/chipmunk-physics
MIT License
0 stars 0 forks source link

cpArbiter a and b shapes are the reverse order that they should be in #13

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Call cpSpaceAddCollisionHandler and pass collision types A and B, in 
that order.
2. Debug the collision handler function specified and step into the 
collision handler (in my case, the xBeginHandler).

What is the expected output? What do you see instead?

As the documentation states, if types A and B are passed into 
cpSpaceAddCollisionHandler, arb->a should be of type A, and arb->b should 
be of type B.  Instead, arb->a always appears to be of type B, and arb-b 
always appears to be of type A.

What version of the product are you using? On what operating system?

5.0, MacOS development on iPhone with Cocos2d.

Original issue reported on code.google.com by vargon...@gmail.com on 24 Jan 2010 at 5:51

GoogleCodeExporter commented 8 years ago
This isn't really a bug, the order of those fields is random for each pair of 
objects. Accessing the raw struct will 
not work. There is a function that gets them in the correct order for you.
http://code.google.com/p/chipmunk-physics/wiki/cpArbiter#Helper_Functions

A number of people have asked this, I'm going to change the field name in the 
trunk code to better reflect their 
purpose.

Original comment by slemb...@gmail.com on 24 Jan 2010 at 3:37