Mercurial > projects > chipmunkd
comparison trunk/chipmunkd/cpCollision.d @ 23:4ceef5833c8c
updated to chipmunk 5.3.3
author | Extrawurst |
---|---|
date | Fri, 10 Dec 2010 02:10:27 +0100 |
parents | df4ebc8add66 |
children | 4541ca17975b |
comparison
equal
deleted
inserted
replaced
22:ed2c81f3d1df | 23:4ceef5833c8c |
---|---|
97 // Helper function for working with contact buffers | 97 // Helper function for working with contact buffers |
98 // This used to malloc/realloc memory on the fly but was repurposed. | 98 // This used to malloc/realloc memory on the fly but was repurposed. |
99 static cpContact * | 99 static cpContact * |
100 nextContactPoint(cpContact *arr, int *numPtr) | 100 nextContactPoint(cpContact *arr, int *numPtr) |
101 { | 101 { |
102 int num = *numPtr; | 102 int index = *numPtr; |
103 | 103 |
104 if(num < CP_MAX_CONTACTS_PER_ARBITER) | 104 if(index < CP_MAX_CONTACTS_PER_ARBITER){ |
105 (*numPtr) = num + 1; | 105 (*numPtr) = index + 1; |
106 | 106 return &arr[index]; |
107 return &arr[num]; | 107 } else { |
108 return &arr[CP_MAX_CONTACTS_PER_ARBITER - 1]; | |
109 } | |
108 } | 110 } |
109 | 111 |
110 // Find the minimum separating axis for the give poly and axis list. | 112 // Find the minimum separating axis for the give poly and axis list. |
111 static int | 113 static int |
112 findMSA(const cpPolyShape *poly, const cpPolyShapeAxis *axes, const int num, cpFloat *min_out) | 114 findMSA(const cpPolyShape *poly, const cpPolyShapeAxis *axes, const int num, cpFloat *min_out) |