MCPcopy Create free account
hub / github.com/axmolengine/axmol / SliceQuery

Function SliceQuery

tests/cpp-tests/Source/ChipmunkTestBed/demo/Slice.cpp:101–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101static 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
115static void update(cpSpace* space, double dt)
116{

Callers

nothing calls this directly

Calls 2

cpShapePointQueryFunction · 0.85

Tested by

no test coverage detected