In my project I am setting a default collision pair function with cpSpaceSetDefaultCollisionPairFunc. I noticed that normal_coef is always 1.0. I am also trying to put a thin object-orientated layer on top of chipmunk for my project.
First question: Why is normal_coef always 1.0 in this case?
Second: Will the absolute value of normal_coef always equal 1?
Third: If I were doing something like:
Code: Select all
CPEntity* const entityA = (CPEntity*)a->data;
CPEntity* const entityB = (CPEntity*)b->data;
[entityA collidedWith:entityB withContacts:contacts count:numContacts normalCoef:normal_coef];
[entityB collidedWith:entityA withContacts:contacts count:numContacts normalCoef:normal_coef];
Would it make sense to negate the normal_coef in the second message line ([entityB...])? From what I gathered searching the forum, if I set up a pair function where the previous B was the pair functions A and the previous A was the pair functions B then the pair functions normal_coef would be opposite the previous normal_coef. So I think the answer is yes, but I'd like to know for sure.
Thanks in advance, and please point out anything I need to clarify.