| 99 | } |
| 100 | |
| 101 | static void SliceQuery(cpShape* shape, cpVect point, cpVect normal, cpFloat alpha, struct SliceContext* context) |
| 102 | { |
| 103 | cpVect a = context->a; |
| 104 | cpVect b = context->b; |
| 105 | |
| 106 | // Check that the slice was complete by checking that the endpoints aren't in the sliced shape. |
| 107 | if (cpShapePointQuery(shape, a, NULL) > 0.0f && cpShapePointQuery(shape, b, NULL) > 0.0f) |
| 108 | { |
| 109 | // Can't modify the space during a query. |
| 110 | // Must make a post-step callback to do the actual slicing. |
| 111 | cpSpaceAddPostStepCallback(context->space, (cpPostStepFunc)SliceShapePostStep, shape, context); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | static void update(cpSpace* space, double dt) |
| 116 | { |
nothing calls this directly
no test coverage detected